; ; USERID.ASM AS OF 12/1/80 ; ;WRITTEN BY HOWARD MOULTON; SYSOP OF AMBBS REMOTE CP/M ;AMESBURY, MASS. 617-388-5125 (RINGBACK: SEE RCPMLIST.DOC) ;PROGRAM FOR USE AS PUBLIC DOMAIN SOFTWARE. ; ;ANY CHANGES AND IMPROVMENTS WOULD BE GREATLY APPRECIATED ;IF YOU LET ME KNOW WHAT THEY ARE SO WE ALL CAN SHARE THEM. ;THIS PROGRAM IS JUST A SMALL CONTRIBUTION AND ALL I HAVE ;TO OFFER FOR ALL THE CP/M SOFTWARE I'VE RECIEVED FROM THE ;MANY PEOPLE I'VE MET THRU CP/M USERS. ; ;12/1/80 MODIFIED TO OPERATE UNDER CP/M VERS.2.2 USING ATTRIBUTE ; MODIFICATION, DRIVE SELECT, USER AREA SELECT, CONTROL-C ; TRAP AND AUTOMATIC LOCATION OF THE CONSOLE COMMAND PRO- ; CESSOR COMMAND TABLE. BY: ROD HART WA3MEZ ; ; ;THE FOLLOWING MUST BE CHANGED TO CORRESPOND TO YOUR SYSTEM. ; FALSE EQU 0 TRUE EQU NOT FALSE ; V1 EQU FALSE ;TRUE IF CP/M VERSION 1.X V2 EQU TRUE ;TRUE IF CP/M VERSION 2.X WBOOT EQU TRUE ;WARMBOOT________CONT-C TRAP SET BY MODEM CONT. PGM ; USERN EQU 1 ;CP/M VERS 2.2 USER # DRIVEN EQU 0 ;CP/M VERS 2.2 DRIVE # ; MSIZE EQU 48 ;CP/M SIZE IN K ; IF V1 ;LOCATE CP/M VERS 1.4 CCP COMMAND TABLE BIAS EQU (MSIZE-16)*1024 ;CP/M VERS 1.4 OFFSET CCP EQU 2900H+BIAS ;CP/M VERS 1.4 CONSOLE COMMAND ;PROCESSOR COMTB EQU CCP+2F6H ;CONSOLE PROCESSOR COMMAND TABLE ENDIF ; IF V2 ;LOCATE CP/M VERS 2.2 CCP COMMAND TABLE BIAS EQU (MSIZE-20)*1024 ;CP/M VERS 2.2 OFFSET CCP EQU 3400H+BIAS ;CP/M VERS 2.2 CONSOLE COMMAND ;PROCESSOR COMTB EQU CCP+310H ;CONSOLE COMMAND PROCESSOR TABLE ENDIF ; READCON EQU 1 ;CONSOLE INPUT FUNCTION BDOS EQU 5 PRINT EQU 9 ;PRINT STRING FUNCTION PCNBUFF EQU 10 ;READ CONSOLE FUNCTION CONSTAT EQU 11 ;GET CONSOLE STATUS FUNCTION SELDSK EQU 13 ;RESET DISK SYSTEM FUNCTION OPEN EQU 15 ;FILE OPEN FUNCTION CLOSE EQU 16 ;CLOSE FILE FUNCTION ATTRIB EQU 1EH ;SET OR RESET FILE ATTRIBUTE FUNCTION WRITE EQU 21 ;WRITE SEQUENTIAL FUNCTION RENAME EQU 23 ;RENAME FILE FUNCTION DMA EQU 26 ;SET DMA ADDRESS FUNCTION SUSER EQU 32 ;SET OR GET USER CODE FUNCTION ; FCB EQU 5CH ;SYSTEM FCB FCB2 EQU FCB+16 DBUFF EQU 80H ;DMA ADDRESS ; CR EQU 13 ;CARRIAGE RETURN LF EQU 10 ;LINE FEED BELL EQU 7 ;BELL ; ORG 100H MVI C,CR CALL BDOS ;RESET LOGGED TO DISC A XRA A STA BUFF ;ZERO BUFFER LXI D,DBUFF MVI C,DMA CALL BDOS ;MAKE SURE WE ARE AT 80H FOR DMA START LXI H,FCB+1 ;CHECK FOR PASSWORD MVI A,'0' CMP M JNZ IDERR ;NO PASSWORD FOUND XRA A MVI B,8 L1 INX H ADD M DCR B JNZ L1 LXI H,USERCT ;NUMBER OF USER #'S TO CHECK MOV B,M LXI H,USERS CHK CMP M JZ CHOK ;PASSWORD FOUND INX H DCR B JNZ CHK IDERR LXI D,NOIDMSG MVI C,PRINT CALL BDOS ;PRINT NO PASSWORD FOUND MSG IDERR1 CALL GETC CPI cr JZ IDERR2 ;PROCESS COMMAND STA BUFF JMP IDERR1 ;NEED CARRIAGE RETURN IDERR2 LDA BUFF CPI 'h' JZ QUERY ;GIVE HELP CPI 'H' JZ QUERY ;GIVE HELP LXI D,EXMSG CALL SEND JMP 0 ;RETURN TO CP/M QUERY LXI D,INTRO CALL SEND ;PROVIDE HELP INFO QUERY1 CALL GETC CPI CR JZ QCK STA BUFF JMP QUERY1 QCK LDA BUFF CPI 'y' JZ QCONT ;GET INFO FOR APPLICATION CPI 'Y' JZ QCONT ;GET INFO FOR APPLICATION LXI D,EXMSG CALL SEND JMP 0 ;RETURN TO CP/M QCONT LXI H,FILENM ;PREPARE FOR INPUT LXI D,FCB+1 MLOOP MOV A,M ;LOOP UNTIL YOU HAVE IT ALL STAX D CPI 0 JZ QCONT1 ;HAVE COMPLETE FILE NAME IN FCB INX D INX H JMP MLOOP ;RETURN FOR NEXT CHARACTER QCONT1 LXI D,FCB MVI C,OPEN CALL BDOS ;OPEN APPLICATION INPUT FILE CPI 0FFH ;LOOK FOR END JZ GENERR ;FILE OPEN ERROR XRA A ;ZERO OUT A STA FCB+32 ;AND PUT 0 IN RECORD # ; ;ASK QUESTIONS REQUIRED TO PROCESS APPLICATION FOR PASSWORD QCONT2 LXI H,Q1H CALL PRINTH LXI D,Q1 CALL SEND XCHG CALL GETSTR LXI H,Q2H CALL PRINTH LXI D,Q2 CALL SEND XCHG CALL GETSTR LXI H,Q3H CALL PRINTH LXI D,Q3 CALL SEND XCHG CALL GETSTR LXI H,Q4H CALL PRINTH LXI D,Q4 CALL SEND XCHG CALL GETSTR LXI H,Q5H CALL PRINTH LXI D,Q5 CALL SEND XCHG CALL GETSTR LXI H,Q6H CALL PRINTH LXI D,Q6 CALL SEND XCHG CALL GETSTR LXI H,Q7H CALL PRINTH LXI D,Q7 CALL SEND XCHG CALL GETSTR LXI H,Q8H CALL PRINTH LXI D,Q8 CALL SEND XCHG CALL GETSTR LXI H,Q9H CALL PRINTH LXI D,Q9 CALL SEND XCHG CALL GETSTR LXI H,Q9AH CALL PRINTH LXI D,Q9A CALL SEND XCHG CALL GETSTR LXI H,Q10H CALL PRINTH LXI D,Q10 CALL SEND XCHG CALL GETSTR LXI H,Q11H CALL PRINTH LXI D,Q11 CALL SEND XCHG CALL GETSTR LXI H,Q12H CALL PRINTH LXI D,Q12 CALL SEND XCHG CALL GETSTR LXI H,Q13H CALL PRINTH LXI D,Q13 CALL SEND XCHG CALL GETSTR LXI H,Q14H CALL PRINTH LXI D,Q14 CALL SEND XCHG CALL GETSTR LXI D,FCB MVI C,CLOSE CALL BDOS ;CLOSE APPLICATION FILE ; ;RENAME FILE NOW SO USER CAN'T WRITE OVER THE INFORMATION ;AND IN CASE SOMEONE ELSE WANTS TO APPLY, HE WON'T WRITE ;OVER THIS ONE BEFORE I SEE IT. (DUE TO FACT THAT PGM ;CAN'T FIND FILE ON NEXT INVOCATION OF PROGRAM) REN LXI H,FILENM2 ;NEW FILENAME LXI D,FCB2+1 CALL MOVER LXI D,FCB MVI C,RENAME CALL BDOS ;RENAME FILE FOR PROTECTION ; IF V2 ;SET FILE ATTRIBUTE TO .SYS SO FILE IS INVISIBLE TO CALLERS MVI C,ATTRIB CALL BDOS ENDIF ; ;WE ARE DONE WITH THE FILE NOW SO LETS GET OUTTA HERE... LXI D,EQMSG CALL SEND FIN LXI D,EXMSG CALL SEND RET CHOK LXI D,OKMSG CALL SEND ; IF V1 ;ENABLE SELECTED FILES FOR AUTHORIZED USERS LXI D,RENMSG CALL SEND CALL CRLF LXI D,FCB+1 LXI H,BASICD CALL MOVER LXI D,FCB2+1 LXI H,BASICE CALL MOVER LXI D,FCB MVI C,RENAME CALL BDOS LXI D,BASICE CALL SEND ;SHOW WHICH FILES ARE AVAILABLE NOW... CALL CRLF LXI D,FCB+1 LXI H,MACD CALL MOVER LXI D,FCB2+1 LXI H,MACE CALL MOVER LXI D,FCB MVI C,RENAME CALL BDOS LXI D,MACE CALL SEND CALL CRLF LXI D,FCB+1 LXI H,LOADD CALL MOVER LXI D,FCB2+1 LXI H,LOADE CALL MOVER LXI D,FCB MVI C,RENAME CALL BDOS LXI D,LOADE CALL SEND CALL CRLF LXI D,FCB+1 LXI H,EDITD CALL MOVER LXI D,FCB2+1 LXI H,EDITE CALL MOVER LXI D,FCB MVI C,RENAME CALL BDOS LXI D,EDITE CALL SEND LXI D,FCB+1 LXI H,CBBSE CALL MOVER LXI D,FCB2+1 LXI H,CBBSD CALL MOVER LXI D,FCB MVI C,RENAME CALL BDOS ENDIF ; IF V2 ;ENABLE USER AREA AND DRIVE FOR AUTHORIZED USER MVI E,USERN MVI C,SUSER CALL BDOS ;SELECT USER AREA MVI E,DRIVEN MVI C,SELDSK CALL BDOS ;SELECT DRIVE ENDIF ; CALL CRLF CALL CRLF ; ;RENAME CCP COMMANDS AND SET CONT-C TRAP ON THE FLY LXI D,COMTB LXI H,NCOMTB CALL MOVER MVI A,0CDH STA 0 ;SET CONTROL-C TRAP LXI D,BBSMSG CALL SEND JMP FIN ; ;SUBROUTINES MOVER MOV A,M CPI 0 RZ STAX D INX D INX H JMP MOVER GETSTR PUSH D CALL GETC POP D CPI CR JZ WRBUFF CPI 'U'-40H JZ REASK CPI 'H'-40H JZ REASK CPI 7FH JZ REASK CPI 5FH JZ REASK STAX D INX D JMP GETSTR REASK CALL CRLF PUSH D LXI D,RTYMSG CALL SEND POP D CALL CRLF PUSH D MVI E,'?' MVI C,2 CALL BDOS MVI E,07 MVI C,2 CALL BDOS POP D LXI H,DBUFF REASK1 MOV A,M CPI ':' JZ REASKED INX H JMP REASK1 REASKED INX H ;ONE MORE TIME FOR SPACE INX H ;PUTS US BACK WHERE WE START IN DMA. XCHG JMP GETSTR CRLF PUSH D PUSH H MVI E,CR MVI C,2 CALL BDOS MVI E,LF MVI C,2 CALL BDOS MVI E,BELL MVI C,2 CALL BDOS POP H POP D RET PRINTH LXI D,DBUFF MOV A,M PRINTH1 STAX D INX H INX D MOV A,M CPI 0 JNZ PRINTH1 PRINTHE XCHG RET GETC MVI C,CONSTAT CALL BDOS ORA A JZ GETC MVI C,READCON CALL BDOS RET SEND PUSH H MVI C,PRINT CALL BDOS POP H RET WRBUFF MVI A,CR STAX D INX D MVI A,LF STAX D INX D WRBUFF1 MOV A,E CPI 0FFH JZ WRBUFF2 XRA A STAX D INX D JMP WRBUFF1 WRBUFF2 LXI D,FCB MVI C,WRITE CALL BDOS CPI 0 RZ CPI 1 JZ EXTERR CPI 2 JZ DIRFUL CPI 255 JZ DIRFUL JMP GENERR EXTERR LXI D,EXERMSG CALL SEND CALL FIN JMP 0 DIRFUL LXI D,DIRERMSG CALL SEND CALL FIN JMP 0 GENERR LXI D,GERRMSG CALL SEND CALL FIN JMP 0 ; IF V1 RENMSG DB CR,LF,LF,'THE FOLLOWING ARE ENABLED; THEY WILL BE DISABLED ' DB 'AT SIGN-OFF:$' ENDIF ; RTYMSG DB CR,LF,LF,'++RETYPE ENTIRE LINE PLEASE:$' ; EXERMSG DB CR,LF,LF,'++ERROR EXTENDING FILE: ABORTED.$' ; DIRERMSG DB CR,LF,LF,'++DISK OR DIRECTORY FULL: ABORTED.$' ; GERRMSG DB CR,LF,'++AN APPLICATION HAS ALREADY BEEN SUBMITTED AND SYSOP HAS' DB CR,LF,'NOT EXAMINED IT AS OF YET. PLEASE APPLY AGAIN TOMORROW.',07,'$' ; BBSMSG DB CR,LF,'MESSAGE SYSTEM IS NOW DISABLED. IF YOU WANT TO USE IT YOU' DB CR,LF,'WILL HAVE TO SIGN-OFF, THEN SIGN-IN AGAIN.',07,'$' ; okmsg DB CR,LF,'CP/M Now Patched For Normal Use.' ; IF NOT WBOOT DB CR,LF,07,07,07,'Remember: If you do a WARMSTART, YOU MUST CALL THIS' DB ' PROGRAM AGAIN,' DB CR,LF,'TO REINITIALIZE COMMAND TABLE. (Minor detail to be worked ' DB 'out later.',CR,LF,'Details, details...[sigh]).',07,07,07,'$' ENDIF ; IF WBOOT DB 07,07,07,'$' ENDIF ; ;THE FOLLOWING WILL BE IN A FILE TO READ IN THE FUTURE ;(HOPEFULLY) AND WILL REDUCE THE SIZE OF THE .ASM FILE CONSIDERABLY. noidmsg db CR,LF,'User ID not found or not specified.' DB CR,LF,'Enter "H" for help, to abort? ',07,'$' ; INTRO DB CR,LF,'This program allows the user to modify file' DB CR,LF,'extensions, rename files, erase files, and view .###' DB CR,LF,'type files. Another words, with the correct user ID, the' DB CR,LF,'user is given COMPLETE control of the system without ANY' DB CR,LF,'restrictions whatsoever. In addition, these files may' DB CR,LF,'be made available to you:' DB CR,LF,'Basic',CR,LF,'Mac',CR,LF,'Load',CR,LF,'Edit' DB CR,LF,'These programs will allow development of software directly' DB CR,LF,'on this system in 8080 code. EDIT will allow editing .ASM' DB CR,LF,'files, BASIC for basic programing, LOAD to convert .HEX' DB CR,LF,'files to .COM, and MAC for assembling .ASM files.' DB CR,LF,'If you wish to establish a user ID, please answer' DB CR,LF,'ALL questions complete. Any unanswered questions' DB CR,LF,'will assume you DO NOT want a user ID.' DB CR,LF,LF,'Do you wish to establish a User ID (Y/N)? ',07,'$' ; Q1 DB CR,LF,LF,'What is your FULL name (include middle initial)? ',07,'$' ; Q2 DB CR,LF,'What is your current STREET address? ',07,'$' ; Q3 DB CR,LF,'What CITY/STATE is that located in? ',07,'$' ; Q4 DB CR,LF,'Where do you work (company name only)? ',07,'$' ; Q5 DB CR,LF,'What is your current work address? ',07,'$' ; Q6 DB CR,LF,'What CITY/STATE? ',07,'$' ; Q7 DB CR,LF,'What is the phone # at your home (include area code)? ',07,'$' ; Q8 DB CR,LF,'What is it at work (include area code)? ',07,'$' ; Q9 DB CR,LF,'What extension (enter 0 if none)? ',07,'$' ; Q9A DB CR,LF,'What is your position at this company? ',07,'$' ; Q10 DB CR,LF,'What make modem are you using? ',07,'$' ; Q11 DB CR,LF,'Do you make computer calls from home or work (enter "home"' DB CR,LF,'or "work" or "both")? ',07,'$' ; Q12 DB CR,LF,'What kind of DOS (e.i. CP/M, HDOS,) do you use? ',07,'$' ; Q13 DB CR,LF,'What kind of microcomputer (i.e. TRS-80, ALTAIR)? ',07,'$' ; Q14 DB CR,LF,'What kind of programs would you like to see available? ',07,'$' ; eqmsg db cr,lf,lf,'End of questions; I left all info entered, on file.' db cr,lf,'The sysop will evaluate the information entered, and' db cr,lf,'determine if a user ID should be issued. If it is, call' db cr,lf,'this programm as follows:' db cr,lf,'A>USERID 0PASSWORD','$' ; exmsg db CR,LF,'Returning to CP/M....$' ; q1h db 'name: ',0 ; q2h db 'Current address: ',0 ; q3h db 'Current address - city/state: ',0 ; q4h db 'Works at: ',0 ; q5h db 'Work address: ',0 ; q6h db 'CITY/STATE of work: ',0 ; q7h db 'Number at home: ',0 ; q8h db 'Number at work: ',0 ; q9h db 'Extension: ',0 ; q9ah db 'Position at work: ',0 ; q10h db 'Kind of modem he/she uses: ',0 ; q11h db 'Makes calls usaully from: ',0 ; q12h db 'Kind of DOS he/she uses: ',0 ; q13h db 'Kind of computer: ',0 ; q14h db 'Kind of programming would like to see: ',0 ; BUFF DS 1 ; ;THESE BYTES ARE EQUATED BY FINDING OUT WHAT THE SUM ;IS OF ALL USERS LETTERS EXCLUDING THE STARTING '0'. ;REMEMBER, ALL UPPER CASE (CP/M DOES THAT WHEN YOU TYPE ;A>USERID 0XXXXXX) ;ID WILL BE IN FCB (5CH) WHEN PGM STARTS AND WILL ALREADY ;BE IN UPPERS. USERS DB 0FEH ;'XXXXXX' DB 0E3H ;'XXXXXX': USER NAME DB 01BH ;'XXXXXX': USER NAME DB 018H ;'RWHART': SYSOP ROD ; USERCT DB 04 ;number of user #'s in list ; IF V1 ;PATCHED CCP COMMAND TABLE NCOMTB DB 'SEE ERA TYPESAVEREN',0 ENDIF ; IF V2 ;PATCHED CCP COMMAND TABLE NCOMTB DB 'DIR ERA TYPESAVEREN AREA',0 ENDIF ; ;THESE FILES HAVE .### TYPE EXTENSIONS CAUSE I HAVE DIR WRITTEN ;TO MASK ANY FILE WITH A "#" LOCATED IN ANY POSITION IN THE ;EXTENSION OF THE FILE, SO USER DOES NOT SEE IT AT ALL (DOESN'T ;EVEN KNOW THE FILE IS THERE). ALSO HAVE MLIST MODIFIED TO ;NOT TYPE A FILE THAT HAS A # IN THE EXTENSION ANYWHERE. ;THE 80H+'X' IS REQUIRED IN ORDER TO MAKE .SYS FILE IN VERS 2.2 ; IF V1 FILENM DB 'APPUSER ###',0 ;APPLICATION INPUT FILE FILENM2 DB 'APPUSER #LA',0 ;APPLICATION HOLDING FILE ENDIF ; IF V2 FILENM DB 'APPUSER ',0 ;APPLICATION INPUT FILE FILENM2 DB 'APPUSER A',80H+'P','P',0 ;APPLICATION HOLDING FILE ENDIF ; IF V1 ;YOU CAN CHANGE THE FOLLOWING TO WHAT EVER FILES YOU WANT USERS ;TO HAVE ACCESS TO. REMEMBER TO PUT COMPLIMENTARY FILENAME IN ;RESPECTIVE LABEL. BASICE DB 'BASIC COM',0,'$' MACE DB 'MAC COM',0,'$' LOADE DB 'LOAD COM',0,'$' EDITE DB 'EDIT COM',0,'$' BASICD DB 'BASIC #OM',0 MACD DB 'MAC #OM',0 LOADD DB 'LOAD #OM',0 EDITD DB 'EDIT #OM',0 CBBSE DB 'CBBS COM',0 CBBSD DB 'C'+80H,'BBS COM',0 ENDIF ; ;AFTER USER IS SIGNED OFF SYSTEM, FILES ARE RENAMED FROM BYE, SO ADD ;APPRORIATE CODE TO BYE TO CORRESPOND TO FILES IN USERID.ASM ;THERE IS PROBABLY AN EASIER WAY TO DO THIS, AND CONSIDERING ;THAT THIS IS THE FIRST ATTEMPT OF ANYTHING LIKE THIS, SO ;THERE IS GOBS OF ROOM FOR IMPROVMENT, SO THAT IS WHY I ;SENT IT TO GET OTHER IDEAS. (LOOK WHAT HAPPENED TO SJBBS ;AFTER I GAVE THE FIRST COPY TO SOMEONE.)