TITLE PUSER.MAC v4.5 April 30/89 ; Filename PUSER45.MAC ; Author Terry Pinto ; Language Z-80 Assembler ; Last Update Apr 18/89 ; By Terry Pinto ; PUSER is based on code from PBBS. ; The Public Bulletin Board System ; Author: Ian Cottrell ; 44 Lindhurst Cres ; Ottawa, ON, Canada ; K2G 0T7 ; The Information Centre RCP/M ; (613) 952-2289 (300/1200/2400) ;------------------------------------------------------------------ ; PBBS represents many hours of design, coding and debugging. ; However, I do not believe in SHAREWARE. So, if you find ; PBBS of value to you and wish to pay for it in some way, ; please consider a small contribution ($50 suggested) to your ; local Cancer Society in both of our names (thus creating a ; new class of software - charityware!). Then send a little ; note telling me what you did and we will both feel good! In ; any case, please share this program with others, it is free ; and no form of remuneration may be accepted by anyone except ; its author. ; PUSER is a stand alone program designed to print the entire user ; list on the console or the list device. This program can be assembled ; using either M80 or SLR180 by using the following commands: ; ; M80 =PUSER/N SLR180P PUSER.MAC ; ; You will have to link the program with the subroutine files PBBSUBS.REL, ; and SYSLIB36.REL supplied with this library. ; Use the following command. ; ; For M80/L80: ; L80 /P:100,PUSER,PBBSUBS,SYSLIB36/S,PUSERxx/N/E ; ; For SLR180P ; SLRNKP PUSER/N,/A:100,PUSERxx,PBBSUBS/S,SYSLIB36/S,/E ; ; NOTE: In both cases, the 'xx' refers to the version number used ; ; Information and other assembly options are obtained from PBBSDB.HDR, ; PBBSEQU.HDR and BDOSHDR.MAC. These files are included in the assembly ; process with the INCLUDE statement. ; ; This program may reside anywhere on the system in the current path. ; If you wish to use the non-wheel ability to allow your users to ; display the file, you will want to place it in the remote users path. ; The user file will be read from the currently defined SYSDRV and ; SYSUSR areas in PBBSEQU.HDR. ; ; HISTORY - ; Ver 1.0 03/15/87 Original release ; Ver 1.1 03/16/87 Fix improper exit causing ccp ; crash ; Ver 1.2 03/19/87 Allow for recognition of wheel ; for printing of telephone number ; and record number ; Ver 1.3 03/22/87 Allow for placement of file in ; any drive/user area on path and ; read the USER file in the SYSDRV ; and SYSUSR areas. ; Ver 1.4 03/31/87 Allowed for hardcopy output if ; wheel is set ; Ver 1.5 04/18/87 Added specific access level request ; for display or printout for wheel user ; and fixed problem with no reset of ; total users selected ; Ver 1.6 06/06/87 Corrected problems associated with ; the use of M80 when assembling. Colons ; were eliminated. ; Ver 1.7 08/23/87 Corrected failure to pick up User ; at Record 0. Added new feature: ; printer initialization and de- ; initialization. Added ^C abort. ; (implemented PUSER16.MOD) Jerry Levy ; Ver 1.71 11/20/87 Included the new PBBSUBS.REL file ; from PBBS-04. Changed linker compat. ; by removing ORG statement. ; Ver 1.80 01/19/88 Minor revision to link with the ; newer PBBSUBZ.REL file from PBBS ; version 4.0 and included code to ; optionally list either the folder ; numbers the user has access to, or ; the number of times on the system and ; the high message read. ; Ver 1.90 04/18/89 Repaired minor display problem with ; (Ver 4.50 04/18/89) users 0-9 not properly aligning the ; record number. Added code to conform ; to new user levels of 2-15. Added code ; to allow user search to be done by first ; character of last name as well as by user ; level. Changed code where necessary to ; conform to latest release version of ; PBBS v4.5. Revised version number ; listing to reflect the version number ; of PBBS to run with. ; ;------------------------------------------------------------------------- ; NOTE: This file MUST be linked to the latest version of PBBSUBS.REL ;------------------------------------------------------------------------- INCLUDE PBBSEQU.HDR ; PBBS configuration equates IF M80 ; M80 .Z80 ; Needed for M80 ASEG ORG 100H ENDIF ; M80 JP START ; Jump around header and data FF EQU 12 ; form feed character LINES EQU 21 ; maximum print lines on CRT minus two MXPLN EQU 66 ; maximum lines per page ; Set the following EQUate to indicate if you would like the hardcopy ; printout to include the folder numbers the user has access to or the ; number of times the user has been on the system and the high message ; read. Space limits us to having to choose one of the above two choices. ; If you want the folders listed, set FOLDER EQU 0FFh FOLDER EQU YES ; yes to print tos/msg instead of folders ; no to print folders instead of tos/msg ; You may vary the constant in the following equate to adjust ; the number of printed lines per page. PLINES EQU MXPLN-14 ; print lines per page minus fourteen LSTOUT EQU 5 ; BDOS list output character ext lpstr, lafdc, lhldc, ladc, lhlfdc, la2hc, lprint, lout ext phlfdc, pafdc, phldc IF ZCPR3 Z3IDEN: DB 'Z3ENV' ; Z3 Identifier Z3TYPE: DB 1 ; Z3 Environment (external) Z3EADR: DW 0000 ; Z3 Environment (address) Z3LOAD: DW 0000 ; Z3 load address ENDIF ; Version name, date and levels VNAME:: DB 'PUSER ' ; Name VERDAT::DB '89/' ; Year DB '04/' ; Month DB '30 ' ; Day DB 'v',0 ; Status VER:: DB 4 ; Version VERR:: DB 50 ; Revision AUTHOR::DB ' by: Terry Pinto',CR,LF,0 INCLUDE PBBSDB.HDR ; PBBS configuration strings, etc INCLUDE BDOSHDR.MAC ; Time and date conversions ; Printer setup and exit strings. SUTPTR is for initializing ; the printer to compressed print mode, and EXPTR is for ; de-initialize it to return to normal print. ; These strings can be as long as you need them to be, but make ; certain that that the last byte is a null (0) which is needed ; as the string terminator. ; You could leave them as all-nulls and set your printer by ; means of an external program, if you wish. SUPTR: DB 0DH,1BH,14H,1BH,36H,0 ; printer initialization ; edit for your printer ; for compressed type EXPTR: DB 0DH,1BH,1DH,1BH,36H,0 ; printer de-init. ; ...for normal type ; Preserve CPM stack, initialize new one for this program START: LD (CCPSTK),SP ; Save the return address LD SP,STACK ; Install our stack ; Save current drive/user LD E,0FFH LD C,32 CALL BDOS ; Get current user LD (TMPUSR),A ; Save it LD C,25 CALL BDOS ; Get current drive LD (TMPDRV),A ; Save it ; Everything ok, let's begin BEGIN: CALL PVER IF CREDITS LD HL,AUTHOR CALL PRINTM ELSE CALL PCRLF ENDIF ; CREDITS ; Print all users subroutine LD A,SYSDRV LD E,A ; transfer to E LD C,14 ; call to set drive CALL SPBDOS LD A,SYSUSR ; put system user area in A LD E,A ; transfer to E LD C,32 ; call to set user area CALL SPBDOS CALL UOPEN ; open user file PUSERS: LD HL,0 ; starting count of selected users LD (TUSERS),HL ; save in buffer LD HL,(Z3ENV+41) LD A,(HL) CP 0FFH ; is it set JP NZ,DSPLY ; if no, get access level CALL PRINT ; print following message DB CR,LF,'Send Output to [D]isplay - [P]rinter ' DB 'or [X] to Exit ',0 CALL EATCHR ; eat extra character CALL GETCH ; get user input CALL CAPS ; capitalize CP 'P' ; is it P JP Z,SLFLG ; if yes, print users CP 'D' ; is it D JR Z,DSPLY ; if yes, display users CP 'X' ; is it X JP Z,EXIT ; exit program CALL PRINT ; print following message DB CR,LF,LF,0 ; spaceing JP PUSERS ; go back and start again ; Get access request - returns with A=A-Z or A=00-0F or CR ; NOTE: Carriage return tested for prior to check for number and is ; acted upon first to eliminate conflict with user level 13. DSPLY: CALL GETACC ; get access request CALL PCRLF1 ; space out display GNEW: LD HL,(CURREC) ; get record number CALL GET ; get current record LD A,(PACC) ; get character entered CP 16 ; look for request for ALL users JP Z,PALL ; print ALL users JP C,PNUM ; print users matching access level JP PNAM ; print users matching last initial PNAM: CALL GLINIT ; get initial of last name of user in record LD HL,PACC ; point to character requested CP (HL) ; is requested character equal to last initial JP NZ,USDONE ; if not - exit JR PALL ; if yes - process it PNUM: LD HL,PACC ; point to character requested LD A,(ACESSF) ; get access level for user in record CP (HL) ; are they equal JP NZ,NEXT ; if not - get next record JP PALL ; if yes - process it PALL: LD A,(AVAILF) ; get available record field OR A ; is record available JP Z,NEXT ; if not - get next record LD HL,(Z3ENV+41) ; point to wheel byte LD A,(HL) ; get wheel setting CP 0FFH ; is it set? JR Z,PNM ; if yes - include levels 0 and 1 LD A,(ACESSF) ; get access level of user in record CP 2 ; is he a good user - 2 or above JP C,NEXT ; if not good - get the next record PNM: LD HL,UNAMEF ; point to user name field LD A,(HL) ; look at first character of user name CP ' ' ; is it a blank record JP Z,NEXT ; if yes - goto next record CALL CMORE ; check need for [more] or form feed GOTNM: LD A,(LSTFLG) ; get list enable flag CP 0FFH ; is it set? JP Z,ULIST ; if so, goto print routine LD HL,(Z3ENV+41) LD A,(HL) CP 0FFH ; is it set JR NZ,PNAME ; if no, don't print record number LD HL,(RRNO) ; get record number LD A,1 ; length of field LD (TRECNO),A ; record number in buffer CALL PHLDC CALL PAD ; pad string PNAME: LD B,30 ; length of user name field LD HL,UNAMEF ; point to user name field CALL PRINTN ; print field LD HL,PADSTR ; pad string CALL PRINTL ; print line LD B,20 ; length of city/state field LD HL,CITSTF ; point to city/state field CALL PRINTN ; print field LD A,B ; put length of field in A OR A ; set flags JR Z,GOTUS1 ; bypass pad string - city/state filled field LD HL,PADSTR ; pad string CALL PRINTL ; print line GOTUS1: LD HL,(Z3ENV+41) LD A,(HL) CP 0FFH ; is it set? JR NZ,LDATE ; if not, skip phone number LD B,12 ; length of field LD HL,PHONEF ; point to telephone number field CALL PRINTL ; print field CALL PAD ; pad string LDATE: LD HL,(Z3ENV+41) LD A,(HL) CP 0FFH ; is it set JR Z,DATE1 ; if yes, skip last on message CALL PRINT ; print following messgae DB ' last logon: ',0 DATE1: LD IX,LSTONF ; point to last on field CALL PDATE ; print date CALL PCRLF ; new line ; Get next record - when a record is encountered that the program considers ; not displayable (ie. record not available - record empty - or a match with ; selection is not found) the program will attempt to get the next record ; after checking to see if the user requested an ABORT. If EOF is detected ; the program will exit, otherwise CURREC, the current record number counter ; will be incremented to prepare for retreival of the next record. NEXT: CALL ABORT ; see if user wants to abort JR Z,USDONE ; if yes - exit XOR A ; clear flags LD HL,MAXU ; put maximum users in HL EX DE,HL ; swap DE and HL LD HL,(CURREC) ; put current record in DE INC HL ; add 1 to record count LD (CURREC),HL ; save new record number SBC HL,DE ; subtract HL-DE JP C,GNEW ; get next record ; Exit routines - selection has been exausted or user requested ABORT USDONE: CALL PRINT ; print following message DB CR,LF DB 'Total number of selected users: ',0 LD HL,(TUSERS) ; get total number of users selected CALL PHLFDC ; print results CALL PRINT ; print following message DB CR,LF,LF,'End of list...',0 DONE: LD HL,0 ; reset line counter LD (LNCNT),HL ; save in buffer LD (CURREC),HL ; reset current record counter LD (LNCNT),HL ; reset line counter LD A,0 ; reset print all flag LD (PACC),A ; save LD A,(LSTFLG) ; get list flag CP 0FFH ; is it set? CALL Z,RSLFLG ; reset list flag LD HL,0 ; set up for initialization LD (TUSERS),HL ; reset total users selected LD HL,(Z3ENV+41) ; point to wheel address LD A,(HL) ; get wheel byte CP 0FFH ; is it set? JP Z,PUSERS ; yes, get prompt line EXIT: CALL CLOSE ; close user file LD SP,(CCPSTK) ; restore stack pointer LD A,(TMPDRV) ; restore original drive LD E,A LD C,14 CALL SPBDOS LD A,(TMPUSR) ; restore original user LD E,A LD C,32 CALL SPBDOS RET ; exit ; Subroutines UOPEN: LD HL,USERS ; point to file CALL OPEN ; open file LD HL,USRLEN ; get length of record LD (RRSZ),HL ; set into buffer LD HL,0 ; set record number RET ;*********************************************************************** ; SUBROUTINE: HASH ; PURPOSE: Calc pos'n in USERS.PBS to start search ; INPUT: A =first character of last name ; OUTPUT: HL=pos'n in USERS.PBS to begin search ; USES: A,DE,HL ;*********************************************************************** HASH: SUB 41H ; Make it 0 thru 25 ADD A,A ; Double it LD HL,HSHTBL ; Point to start of table LD E,A ; Calc pos'n in table LD D,0 ADD HL,DE LD A,(HL) ; Get starting pos'n in HL INC HL LD H,(HL) LD L,A RET ; Remove an incorrect entry from the screen by backspacing, printing a ; space and backspacing again. DOBS: CALL PRINT ; Remove character from screen DB BS,' ',BS,0 RET ; Check for need to display [more] message and need to issue a form feed CMORE: LD HL,(TUSERS) ; get total users selected INC HL ; increment counter LD (TUSERS),HL ; save in buffer LD HL,(LNCNT) ; get line count INC HL ; add one line LD (LNCNT),HL ; save new count LD A,(LSTFLG) ; get list flag CP 0FFH ; is it set? JR NZ,DSPL1 ; if not, work with display LD DE,PLINES ; get maximum printer line count JR LPRNT ; continue DSPL1: LD DE,LINES ; get maximum line count LPRNT: SBC HL,DE ; subtract RET C ; skip more message LD HL,0 ; zero line count LD (LNCNT),HL ; store in buffer LD A,(LSTFLG) ; get list flag CP 0FFH ; is it set? JR NZ,MORE ; no, continue CALL FFD ; do a form feed RET ; skip [more] MORE: CALL PRINT ; print [more] message DB '[more]',0 CALL GETCH ; pause CALL EATCHR ; eat extra characters CALL PRINT ; new line DB CR,0 ; start at beginning of line again RET ; Check to see if user requested an ABORT ABORT: PUSH HL ; save the TBUF address PUSH DE PUSH BC LD E,0FFH LD C,6 CALL SPBDOS ; see if we got a character OR A JR Z,ABORT2 ; if no key pressed, then continue CP 'K'-'@' ; ^K to abort JR Z,ABORT1 CP 'C'-'@' ; ^C to abort JR Z,ABORT1 CALL CAPS CP 'C' ; also allows 'C' JR Z,ABORT1 CP 'K' ; and 'K' JR NZ,ABORT2 ABORT1: CALL PRINT ; if yes, then print abort message DB CR,LF,'++ ABORTED ++',cr,lf,0 LD HL,EXPTR ; point to printer exit string LD A,(LSTFLG) ; get print enable flag CP 0FFH ; is it set? CALL Z,SETLST ; if so, de-initialize printer POP BC ; restore all registers POP DE POP HL XOR A LD HL,(Z3ENV+41) LD A,(HL) CP 0FFH ; is it set? JP NZ,EXIT ; get prompt line LD HL,0 ; set line count to zero LD (CURREC),HL ; reset record counter LD (LNCNT),HL ; store in buffer LD (TUSERS),HL ; set total users to zero JP PUSERS ; exit ABORT2: LD A,1 OR A POP BC POP DE POP HL RET ; Print space PAD: CALL PRINT ; print following message DB ' ',0 ; print a space for appearance RET ; Erase preceeding character on display EATCHR: LD E,0FFH LD C,6 CALL SPBDOS OR A JR NZ,EATCHR RET SLFLG: CALL GETACC ; get access level request LD HL,SUPTR ; point to setup string CALL SETLST ; initialize printer LD HL,0 ; get starting page LD (PG),HL ; save in buffer CALL HEADER ; print page header LD A,0FFH ; set list enable flag LD (LSTFLG),A ; save in buffer JP GNEW ; start print ; send string to printer with no interpretation of non- ; printable characters. First null is the string terminator SETLST: LD A,(HL) ; point to first/next byte CP 0 ; RET Z ; done if it's a null CALL LOUT ; defined in SYSLIB36 INC HL ; advance pointer JR SETLST ; loop RSLFLG: LD A,0 ; set disable list flag LD (LSTFLG),A ; save in buffer LD HL,FOOT ; point to ending message CALL LPSTR ; send to printer LD HL,(TUSERS) ; get total number of users on system CALL LHLFDC ; send to printer LD HL,LCRLF ; point to carriage return/line feed CALL LPSTR ; send to printer CALL FMFD ; send form feed to printer LD HL,EXPTR ; point to printer exit string CALL SETLST ; de-initialize the printer RET ; Get access level or first character of name to search for. ; ENTRY - NONE ; EXIT - A contains binary 0-F if user level selected. ; A contains 'A'-'Z' if user last name is selected. ; - A contains 0DH if carriage return selected. GETACC: CALL PRINT DB CR,'Access Level - First Character of Last Name - ' DB 'or to Select ALL Users ',0 GTCH: CALL EATCHR ; eat extra character CALL GET0F ; get access level LD HL,(LNCNT) ; get line count INC HL ; advance by two to accomidate header INC HL LD (LNCNT),HL ; save new line count RET ; GET SELECTION 0-F ; This routine will allow the user to choose from a menu of fifteen ; selections inputing up to two decimal characters and returning ; the input in binary (00H-0FH) in register A. ; Two entry points are provided. A CALL to GET0F will accept entries ; of numbers from 0-15 and a CALL to GET1F will accept entries from ; 1-15, not allowing the entry of a 0. In either case, only accepted ; numbers will be echoed to the display. ; INPUT - None ; OUTPUT - Binary selection (00H-0FH) in register A ; Registers used: AF,BC ; Other subroutines used: GETCH, ECHO, DOBS IF HOTKEY GET1F: CALL GETCH ELSE GET1F: CALL GTCHCR ENDIF CP '0' JR Z,GET1F JR GOTCH IF HOTKEY GET0F: CALL GETCH ; Get a character ELSE GET0F: CALL GTCHCR ; Get a character ENDIF CP CR ; was a entered JP NZ,CHAZ ADD A,3 ; 0DH+3 to resolve conflict with user 13 LD (PACC),A CALL PRINT DB 'ALL',0 RET CHAZ: CALL ISAZ JR C,CH0F LD (PACC),A CALL ECHO CALL HASH LD (CURREC),HL RET CH0F: CALL IS0F JR C,GET0F GOTCH: CP '1' ; Is it a '1' JR NZ,VALID ; If not, go see if a valid number CALL ECHO ; Valid character so show it CALL GETCH ; Else, might want >9, get another char CP CR ; Then, was a character entered? LD B,A ; Save it before jumping LD A,1 ; then prepare for a 1 JR Z,GETRC LD A,B ; Else, restore entered character CP '0' ; Ensure that JR C,GET0F ; the entered character CP '5'+1 ; is within the JR NC,NORNG ; correct range CALL ECHO ; Valid character so show it SUB 26H ; Make it 0AH to 0FH (10 to 15 decimal) JR GETRC NORNG: CALL DOBS JP GET0F VALID: CP CR JR Z,GETRC CP '0' ; Is it > 0? JR C,GET0F ; If not, start again CP '9'+1 ; Else, is it < 10? JP NC,GET0F ; If not, start again CALL ECHO ; Else, show character SUB '0' ; and make it binary GETRC: LD HL,0 LD (CURREC),HL LD (PACC),A RET ; Exit with binary selection in A ; Get Last INITial of user in current record ; ENTRY - Record already in buffer (GET) ; EXIT - HL points to first character ; A contains first character of last name GLINIT: LD HL,UNAMEF ; point to user name LD A,' ' ; character to search for LD BC,30 ; maximum length of user name CPIR ; look for first character of last name LD A,(HL) ; get first character of last name RET ; Check character to see if it falls in the range A-Z ; ENTRY - A contains character to check ; EXIT - A contains character ; C set if character out of range ; NC set if character in range ISAZ: CALL CAPS CP 'A' ; check for less than 'A' RET NC ; return with carry CP 'Z'+1 ; check for less than 'Z'+1 RET ; return with non carry ; Check character to see if it falls in the range 0-0F ; ENTRY - A contains character to check ; EXIT - A contains character ; C set if character out of range ; NC set if character in range IS0F: CP 0 ; check for less than 0 RET NC ; return with carry CP 10H ; check for less than 0FH+1 RET ; return with non carry ; The following subroutine utilizes routines defined in SYSLIB36. ULIST: PUSH HL ; save register LD HL,(CURREC) ; get current record number CALL LHLDC ; send to printer CALL PAD2 ; space out listing CALL PAD2 ; space some more LD HL,UNAMEF ; point to name field LD DE,LNAME ; point to temporary buffer LD BC,30 ; length of field LDIR ; move into buffer LD HL,LNAME ; point to buffer LD (STAD),HL ; save starting address CALL LPSTR ; send to printer CALL LPAD ; pad string CALL PAD2 LD HL,CITSTF ; point to city/state field LD DE,LCITST ; point to temporary buffer LD BC,20 ; length of field LDIR ; move into buffer LD HL,LCITST ; point to buffer LD (STAD),HL ; save starting address CALL LPSTR ; send to printer LD DE,4 ; offset for padstring ADD HL,DE ; add offset for padding CALL LPAD ; pad string LD HL,PHONEF ; point to telephone number LD DE,LPHONE ; point to temporary buffer LD BC,12 ; length of field LDIR ; move into buffer LD HL,LPHONE ; point to buffer LD (STAD),HL ; save starting address CALL LPSTR ; send to printer LD DE,14 ; offset for padstring ADD HL,DE ; add offset for padding CALL LPAD ; pad string LD A,(ACESSF) ; get access field CP 8 ; is access above 7? JR C,PSWD ; if not, display regular LD HL,HDPSWD ; point to hidden password CALL LPSTR ; send to printer CALL PAD3 JP PSW2 ; skip normal password PSWD: LD HL,PSWRDF ; point to password field LD DE,LPSWRD ; point to temporary buffer LD BC,10 ; length of field LDIR ; move into buffer LD HL,LPSWRD ; point to buffer LD (STAD),HL ; save starting address CALL LPSTR ; send to printer LD DE,15 ; offset for padstring ADD HL,DE ; add offset for padding CALL LPAD ; pad string PSW2: LD A,(ACESSF) ; point to access level field CALL LADC ; send to printer CALL PAD2 ; space out listing LD HL,(TMSONF) ; point to times on system CALL LHLDC ; send to printer CALL PAD3 ; space out listing LD HL,LSTONF ; point to date CALL LPDATE CALL PAD2 ; space out listing IF FOLDER LD HL,(UFACCF) ; get user folder access bitmap CALL BITS ; process first 4 bits LD A,' ' ; space out CALL LOUT ; send space to LST: CALL BITS ; process next 4 bits CALL PAD2 ; space out listing JR UPL ; Subroutine to test the User Folder ACCess Flag (UFACCF). Testing is ; done using the following bitmap structure: ; ; Folder # 9 8 7 6 5 4 3 2 ; PMNT N N Y B Y Y Y Y ; ------------------------------ ; Register H 0 0 1 1 1 1 1 1 'grant' bits 1=granted ; Register L 0 0 0 1 0 0 0 0 'blocked' bits 1=blocked ; ------------------------------ ; Bit # 7 6 5 4 3 2 1 0 ; ; bits in H can be set manually by the sysop using PMNT or by allowing ; the system to set automatically by access level. If access to a specific ; folder is denied, then the sysop can 'block' access by using the BLOCK ; function in PMNT. In the example above, the user has been automatically ; given access to folders 2 thru 7 and the sysop has specifically blocked ; access to folder 6 for this user. The line labeled PMNT above is the way ; the display would appear using PMNT (read from right to left). BITS: LD B,4 ; set number of bits to display per round BIT: BIT 0,H ; test bit 7 of register H JR NZ,GRANT ; if set, access is granted BIT 0,L ; test bit 7 of register L JR NZ,BLOCK ; if set, access is blocked LD A,'N' ; otherwise access is denied JR PRBIT BLOCK: LD A,'B' ; show blocked access JR PRBIT GRANT: LD A,'Y' ; load a 'Y' PRBIT: CALL LOUT ; send to printer SRA H ; shift H register left SRA L ; shift L register left DJNZ BIT ; repeat until done RET ELSE LD A,(TOTMEF) ; point to total time on system CALL LADC ; send to printer CALL PAD3 ; space out listing LD A,(HIMSGF) ; point to high message read CALL LADC ; send to printer CALL PAD2 ; space out listing ENDIF ; folder UPL: LD A,(UPLDSF) ; point to total uploads CALL LADC ; send to printer CALL PAD2 ; space out listing LD A,(DNLDSF) ; point to total downloads CALL LADC ; send to printer LD HL,LCRLF ; point to list cr,lf CALL LPSTR ; send cr,lf POP HL ; restore register JP NEXT ; return for next record PAD0: LD HL,LSPC ; point to comma and space CALL LPSTR ; send to printer RET PAD1: LD HL,LSP1 ; point to 1 space CALL LPSTR ; send to printer RET PAD2: LD HL,LSP2 ; point to 2 spaces CALL LPSTR ; send to printer RET PAD3: LD HL,LSP3 ; point to 3 spaces CALL LPSTR ; send to printer RET LPAD: LD DE,(STAD) ; put starting address in DE SBC HL,DE ; subtract starting address ; from ending address EX DE,HL ; put difference in DE LD HL,PADSTR ; point to padstring ADD HL,DE ; add difference as offset ; into padstring CALL LPSTR ; print remainder of padstring RET FFD: CALL FMFD HEADER: LD HL,(PG) ; point to page number INC HL ; add 1 to page LD (PG),HL ; save in buffer LD HL,LPHDR ; point to header CALL LPSTR ; send to printer LD HL,VERDAT ; point to version date information CALL LPSTR ; send to printer LD HL,VER ; point to version number LD A,(HL) ; get version number ADD A,30H ; make ASCII CALL LOUT ; send to printer CALL LPRINT ; print decimal DB '.',0 LD HL,VERR ; point to revision number LD A,(HL) ; get revision number CALL LAFDC ; send to printer LD HL,LPHDR5 CALL LPSTR LD HL,LPHDR2 ; point to second part of header CALL LPSTR ; send to printer LD HL,(PG) ; point to page number CALL LHLDC ; send to printer LD HL,LPHDR4 ; point to fourth part of header CALL LPSTR ; send to printer LD HL,LPHDR3 ; point to third part of header CALL LPSTR ; send to printer RET LPDATE: LD A,(HL) ; point to month PUSH HL ; save month address on stack ADD A,A ; multiply month by 2 ADD A,A ; multiply month by 2 again LD E,A ; put in LSB of DE pair LD D,0 ; zero MSB of DE LD HL,MONTBL ; point to month table ADD HL,DE ; add in offset (HL now points to month) DEC HL ; subtract 1 DEC HL ; subtract 1 more DEC HL ; subtract another 1 DEC HL ; subtract yet another for 4 CALL LPSTR ; send to printer POP HL ; restore stack INC HL ; add 1 to HL LD A,(HL) ; point to day PUSH HL ; save day address on stack CALL LADC ; send to printer LD HL,SLASH ; point to / CALL LPSTR ; send to printer POP HL ; restore stack INC HL ; add 1 to HL LD A,(HL) ; point to year CALL LAFDC ; send to printer RET FMFD: LD C,LSTOUT ; BDOS list character output LD E,FF ; character to send to list device CALL BDOS ; send character RET MONTBL: DB 'Jan',0 DB 'Feb',0 DB 'Mar',0 DB 'Apr',0 DB 'May',0 DB 'Jun',0 DB 'Jul',0 DB 'Aug',0 DB 'Sep',0 DB 'Oct',0 DB 'Nov',0 DB 'Dec',0 ; messages LPHDR: DB CR,LF DB '==================================================' DB '==================================================' DB '=================================',CR,LF DB 'PUSER ',0 LPHDR5: DB ' ' DB ' PBBS USER FILE LISTING',0 LPHDR2: DB CR,LF DB 'Written by: Terry Pinto - Access Programming RAS ' DB ' ' DB ' Page ',0 LPHDR4: DB CR,LF DB '--------------------------------------------------' DB '--------------------------------------------------' DB '---------------------------------',CR,LF,0 LPHDR3: DB 'Rec # User name Location (city st) ' DB ' Phone # Password Lvl Log # Last on ' IF FOLDER DB 'Folders ' ELSE DB 'TOS Msg ' ENDIF DB 'ULD DLD',CR,LF DB '----- ----------------------------- --------------------' DB ' ------------ ---------- --- ----- --------- ' IF FOLDER DB '2345-6789 ' ELSE DB '--- --- ' ENDIF DB '--- ---',CR,LF,0 FOOT: DB CR,LF,'Total number of selected users: ',0 LNAME: DB ' ',0 LCITST: DB ' ',0 LPHONE: DB ' ',0 LPSWRD: DB ' ',0 HDPSWD: DB '----------',0 STAD: DW 0 ; temporary storage LSPC: DB ', ',0 ; coma and single space for print LSP1: DB ' ',0 ; single space for print LSP2: DB ' ',0 ; double space for print LSP3: DB ' ',0 ; triple space for print SLASH: DB '/',0 ; slash for date LCRLF: DB CR,LF,0 ; list crlf ; buffer area CHAR: DB 0 ; current character PACC: DB 0FFH ; display access level PG: DW 0 ; page number LSTNM: DB 0 ; address of first character of last name TUSERS: DW 0 ; total users on system LSTFLG: DB 0 ; list enable flag NULFLG: DB 0 ; name/user level flag LNCNT: DW 0 ; line counter TMPDRV: DB 0 ; temporary drive TMPUSR: DB 0 ; temporary user area CCPSTK: DW 0 ; pbbs stack pointer CURREC: DW 0 ; current record number TRECNO: DW 0 ; temporary record number ACCTMP: DB 0 ; temporary access level DS 64 ; define stack area STACK: DW 0 END