 LST OFF
*  Prime 2.2
*
*  LIST.USERS - By John Hagen - 05 Feb 90
*
*  A ML program to list all users from Email system.
*

 PUT EQUATES

TEMP EQU $DE ;Temp storage
COLWIDTH EQU $32B ;Users screen/col width

TSTMDM = $7200 ;Test Modem hook address
POUT = TSTMDM+2 ;Print to screen hook
MOUT = POUT+2 ;
MOUT1 = MOUT+2 ;
MINP = MOUT1+2 ;
PUSH = MINP+2 ;
CASE = PUSH+2 ;Convert to upper case
RDCHAR = CASE+2 ;Keyboard input 1 key
DHOME = RDCHAR+2 ;Do HOME/Clear screen

ASL4 MAC  ;macro for multiply 4 bytes by 2
 ASL ]1
 ROL ]1+1
 ROL ]1+2
 ROL ]1+3
 <<<

 ORG $6800 ;Buffer workspace

*
*  Set up the FIL.USR into the buffer
*
FILSETUP LDX #0 ;Clear the index
FILOOP LDA FILUSR,X ;Get the filename character
 BEQ FILDONE ;Finished, go open the file
 STA PATHNAME+1,X ;Save the char
 INX ;Inc the char cntr
 JMP FILOOP ;Continue
FILDONE STX PATHNAME ;Save the char count

*
*  Open the user file
*
FILOPEN LDX #0 ;Clear the index
 JSR MLI ;Call the MLI
 HEX C8 ;OPEN
 DA POPEN ;OPEN Param list
 BCC SETREFN ;MLI Call successful
 JMP HANDLERR ;MLI Error

*
*  Update all the file reference number pointers
*
SETREFN LDA OPREFNUM ;Get the ref number
 STA RDREFNUM ;For the READ command
 STA EOREFNUM ;EOF Command
 STA MKREFNUM ;MARK commands
 STA CLREFNUM ;CLOSE command

*
*  Set up memory and user screen
*
 LDX #0 ;Clear the index
 STX RECNUM ; and this one
 STX TBUFF ; and the modem input
 JSR DHOMEHK ;Clear the screens
 LDA #$8D ;Carriage Return
 JSR POUTHK ;For the user
 JSR POUTHK ;One more for measure

*
*  Time For The GET_EOF
*
GETEOF JSR MLI ;Call the MLI
 HEX D1 ;GET_EOF
 DA PEOF
 BEQ STARTUSR ;MLI Successful
 JMP HANDLERR ;MLI Error

*
*  Get Starting user number from user
*
STARTUSR LDX #0 ;Clear the index
STARTUS1 LDA STARTMSG,X ;Get the msg
 BEQ STARTUS2 ;Finished
 JSR POUTHK ;Send to user
 INX
 BNE STARTUS1 ;Continue Msg
STARTUS2 LDX #0 ;Clear the index
 LDA #0 ;Clear the data
 STA TBUFF ;Clear modem input
 STA STARTCNT ;Clear the counter
STARTUS3 STA STARTDAT,X ;Clear the data storage
 INX
 CPX #4 ;Finished?
 BNE STARTUS3 ;Not yet
 LDX #0 ;Clear the index
STARTGET JSR RDCHARHK ;Get Modem Input
 STA TBUFF ;Save the input
 CMP #0 ;No input?
 BEQ STARTGET ;Nothing, wait some more
 CMP #$0D ;Carriage Return?
 BEQ USER ;Yes, press on
 CMP #8 ;Backspace?
 BEQ STARTBAC ;Yes, do it
 CMP #127 ;Delete key?
 BEQ STARTBAC ;Yes, do it
 CMP #$30 ;Less than zero?
 BCC STARTBAD ;Yes, bad answer
 CMP #$3A ;Greater than nine?
 BCS STARTBAD ;Yes, bad answer

*  Echo Input To the User

STARTUS5 SEC ;Set the carry for subtraction
 LDA TBUFF ;Get the users input char
 JSR POUTHK ;Go echo to the user
 SBC #48 ;Convert from Ascii
 LDX STARTCNT ;See how many already
 STA STARTDAT,X ;And save this input
 INX ;Increment the counter
 STX STARTCNT ; and save it
 CPX #4 ;Max count?
 BEQ USER ;Yes, let's continue
STARTSET LDA #0 ;Clear the Accumulator
 STA TBUFF ; and the modem
 JMP STARTGET ;Get the next keypress
STARTBAC LDA STARTCNT ;See how many already
 BEQ STARTBAD ;Bad answer if none
 LDA #8 ;Backspace char
 JSR POUTHK ;Send to the user
 LDA #32 ;Space Char
 JSR POUTHK ;Erase last char on user screen
 LDA #8 ;And another backspace
 JSR POUTHK ; to reposition cursor
 DEC STARTCNT ;Decrement the counter
 JMP STARTBA1 ;Clean house and continue
STARTBAD LDA #7 ;The dreaded Bell!
 JSR POUTHK ;Tell user bad answer
STARTBA1 LDA #0 ;Clear it out
 STA TBUFF ; and the modem input
 BEQ STARTGET ;Get another input number
*
*  Set up the starting user number
*
USER LDX STARTCNT ;See how many there were
 CPX #0 ;none?
 BNE USER0 ;Yes there was a start specified
 JMP OFFSET ;No, so start at user 0000

*  If all four numbers, bypass the routine
USER0 CPX #4 ;All four inputs provided?
 BEQ USER4 ;Yes, press on

*  Move to respective positions
 LDY #3 ;Preset to three
USER1 LDA STARTDAT-1,X ;Get the numbers
 STA STARTDAT,Y ;Save in proper position
 DEX ;Countdown
 DEY ;Countdown
 CPX #0 ;Last one?
 BNE USER1 ;Nope, keep working
 CPY #0 ;All Finished?
 BEQ USER3 ;Clear last address
 TYA ;Move the Y
 TAX
 LDA #0 ;Clear it out
USER2 STA STARTDAT,X
 DEX
 CPX #0 ;Finished?
 BNE USER2 ;Nope, continue

*
*  Now convert to hex data
*
*  Do the ones and tens first
*
USER3 STX STARTDAT ;Zero out the MSByte
USER4 LDX STARTDAT+2 ;Load the 10's digit
 CLC ;Clear the carry bit
USER5 LDA STARTDAT+3 ;Load the one's digit
USER6 CPX #0 ;Finished?
 BEQ USER8 ;Yes, do the 100's next
 ADC #9 ;Add 9 to it
 STA STARTDAT+3 ; and save it
 DEX ;Countdown
 STX STARTDAT+2 ;Save for future use
 JMP USER4 ;Continue

*
*  Convert the 100's
*
USER8 LDX #0 ;Clear the counter
 STX STARTDAT+2 ;Clear the MSByte
 CLC ;Clear the carry bit
USER9 LDX STARTDAT+1 ;Get the 100's digit
 CLC ;Clear the carry bit
USER10 LDA STARTDAT+3 ;Get the LSByte
 CPX #0 ;Finished?
 BEQ USER11 ;Yes
 ADC #99 ;Add 99 to it
 STA STARTDAT+3 ;Save it
 DEX ;Dec the 100's counter
 STX STARTDAT+1 ; and save it
 BCC USER9
 INC STARTDAT+2 ;Add for a count of 256
 JMP USER9 ;Continue

*
*  Now do the 1000's
*
USER11 LDX STARTDAT ;Get the 1000's digit
 CLC ;Clear the carry bit
USER12 LDA STARTDAT+3 ;Get the LSB
 CPX #0 ;Finished?
 BEQ OFFSET ;Yes, do the real offset
 INC STARTDAT+2
 INC STARTDAT+2
 INC STARTDAT+2
 ADC #231 ;Add what's left to it
 STA STARTDAT+3 ;Save it
 DEX ;Decrement the 1000's counter
 STX STARTDAT ; and save it
 BCC USER11
 INC STARTDAT+2 ;Add for a count of 256
 JMP USER11 ;Continue

*
*  Calculate the offset needed for GET_MARK
*
OFFSET LDA STARTDAT+3 ;Get the LSByte
 STA MYDAT ; and save it first
 LDA STARTDAT+2 ;Get the next byte
 STA MYDAT+1 ; and save it in order
 LDA STARTDAT+1 ;Get the third byte
 STA MYDAT+2 ; and save it
 LDA STARTDAT ;Get the MSByte
 STA MYDAT+3 ;put position in correct order
 ASL4 MYDAT ;multiply x 2, 2^7th power =128
 ASL4 MYDAT
 ASL4 MYDAT
 ASL4 MYDAT
 ASL4 MYDAT
 ASL4 MYDAT
 ASL4 MYDAT

*
*  Now let's set up the offset so we can get started
*
GETMARK LDA MYDAT
 STA MARKPOS
 STA POSACT ;Actual position LSByte
 LDA MYDAT+1
 STA MARKPOS+1
 STA POSACT+1 ;Actual Position middle Byte
 LDA MYDAT+2
 STA MARKPOS+2
 STA POSACT+2 ;Actual Position MSByte
 LDA #$0D ;Carriage Return
 JSR POUTHK ;Send to the user
 JSR POUTHK ; and one more for measure
 LDA #0 ;CLear the accumulator
 STA TBUFF ; and the modem input
 JMP SETMARK ;Preposition the file

*
*  Let's read the data from the file
*
READFIL JSR MLI ;Call the MLI
 HEX CA ;READ
 DA PREAD
 BEQ PRINTBUF ;MLI Successful
 JMP HANDLERR ;MLI Error

*
*  Print Buffer Contents
*

*
*  User 1 in the buffer
*
PRINTBUF JSR SENDBOX ;Go send BOX # text
 LDX #65 ;Mail Box first byte
PRINTBX1 LDA READBUF,X ;Read the box byte
 JSR SENDDATA ;Go send it out
 CPX #69 ;Last byte?
 BNE PRINTBX1 ;Nope, continue
 LDA #$A0 ;Space character
 JSR SENDDATA ;SpSend to the screen
 LDX #21 ;Start of user alias
 JSR USERCK ;Ck status of this user
PRINTBU1 LDA READBUF,X ;Read the character
 JSR SENDDATA ;Go display the data
 CPX #40 ;Last byte for the alias?
 BNE PRINTBU1 ;Nope, continue
 JSR POSITION ;Update actual position

*
*  User 2 in the buffer
*
 JSR SENDBOX ;Go send the BOX #
 LDX #193 ;Next box # in the buffer
PRINTBX2 LDA READBUF,X ;Read thebox byte
 JSR SENDDATA ;Go send it out
 CPX #197 ;Last one?
 BNE PRINTBX2 ;Nope, continue
 LDA #$A0 ;Space character
 JSR SENDDATA ;Send to the user
 LDX #149 ;Start of next alias
 JSR USERCK ;Ck status of user
PRINTBU2 LDA READBUF,X ;Second user in buffer
 JSR SENDDATA ;Go display the data
 CPX #168 ;Last byte for the alias?
 BNE PRINTBU2 ;Nope, continue
 JSR POSITION ;Update the actual position

*
*  User 3 in the buffer
*
 JSR SENDBOX ;Send the BOX #
 LDX #65 ;Next box # in the buffer
PRINTBX3 LDA READBUF+256,X ;Read the box byte
 JSR SENDDATA ;Go send it out
 CPX #69 ;Last one?
 BNE PRINTBX3 ;Nope, continue
 LDA #$A0 ;Space character
 JSR SENDDATA ;Send to the screen
 LDX #21 ;Start of next alias
 JSR USERCK ;Ck status of user
PRINTBU3 LDA READBUF+256,X ;Third user in the buffer
 JSR SENDDATA ;Go display data
 CPX #40 ;Last character?
 BNE PRINTBU3 ;Nope, continue
 JSR POSITION ;Update actual position

*
*  User 4 in the buffer
*
 JSR SENDBOX ;Send the BOX #
 LDX #193 ;Next mail box in the buffer
PRINTBX4 LDA READBUF+256,X ;Read the box byte
 JSR SENDDATA ;Go send it out
 CPX #197 ;Finished yet?
 BNE PRINTBX4 ;Nope, continue
 LDA #$A0 ;SPace Character
 JSR SENDDATA ;Send it to the user
 LDX #149 ;Start of the 4th alias
 JSR USERCK ;Ck status of user
PRINTBU4 LDA READBUF+256,X ;4th user in the buffer
 JSR SENDDATA ;Go display it
 CPX #168 ;Last character?
 BNE PRINTBU4 ;Nope, continue
 JSR POSITION ;UPdate the position

*
*  Do next block of user data
*
NEXREC INC RECNUM ;Add one to the rec counter
 LDA #8 ;Allow 8 512byte blocks per pass
 CMP RECNUM ;Do we have 8 yet?
 BEQ NEXREC1 ;Yes, time for a page pause
 JMP SETMARK ;Not yet, move the pointer
NEXREC1 LDA #0 ;Clear the index
 STA RECNUM ;Reset the counter
 JSR GETANS ;Get users input to cont
*
*  Find out if user wanst more listings
*
 CMP #$4E ;"N"?
 BEQ NEXRERTS ;Back to BASic
 CMP #$20 ;" "?
 BEQ NEXRERTS ;Back to BASic
 CMP #$6E ;"n"?
 BEQ NEXRERTS ;Back to BASic
 JMP SETMARK ;Continue
NEXRERTS JSR CLOSEALL ;Close the file
 RTS ;BAck to BASic

*
*  Check to see if user is valid or not
*
USERCK STX USERDATX ;Save the X reg
 STY USERDATY ;SAve the Y reg
 TXA ;Load user alias address offset
 SEC ;Set the carry for subtraction
 SBC #21 ;Sub offset from the class code
 TAX ;Put in the X reg
 INC USERCNTR ;Increment the user cntr
 LDA USERCNTR ; and load it in the Accum
 CMP #1 ;is it the first pass?
 BEQ USEROLD ;Yes, bypass the offset
 CMP #2 ;Is it the 2nd pass?
 BEQ USEROLD ;Yes, bypass the offset
 CMP #4 ;Is it the 4th pass?
 BNE USEROFF1 ;Nope, do the offset
 LDA #0 ;Clear the Accum
 STA USERCNTR ; and the counter
USEROFF1 LDA READBUF+256,X ;Get the users class code
 JMP USEROLD1 ; and press on
USEROLD LDA READBUF,X ;Get the users class code
USEROLD1 CMP #$44 ;Is it a "D"eleted user?
 BEQ USERDELE ;Yes, display as deleted user
 CMP #$2A ;Is it "*" Unvalidated?
 BEQ USRUNVAL ;Yes, display as unvalidated
 CMP #$23 ;Is it the "#" restricted user?
 BEQ USRESTRI ;Yes, display as restricted
 CMP #$3F ;Is it the "?" questionable user
 BEQ USRQUEST ;Yes, display as questionable
 CMP #$58 ;Is it the "X" suspended user
 BEQ USRSUSPE ;Yes, display as suspended
 CMP #$21 ;Is it the "!" restricted user
 BEQ USRESTRI ;Yes, display as restricted
 CMP #$25 ;Is it the "%" unvalidated user
 BEQ USRUNVAL ;Yes, display as unvalidated
 BNE USEREXIT ;Normal user
USERDELE LDY #00 ;Clear the Y
 LDX USERDATX ;Load the X offset
 LDA USERCNTR ;Lets see where we are
 CMP #0 ;For record 4 in the block
 BEQ USERCK2 ;Yes, do offset info
 CMP #3 ;Is it the 3rd record
 BEQ USERCK2 ;Yes, do offset info
USERCK1 LDA DELETED,Y ;Get the deleted display
 CMP #0 ;End of data yet?
 BEQ USEREXIT ;Yes, do restores and exit
 STA READBUF,X ;Save for display later
 INX ;Inc X
 INY ;Inc Y
 JMP USERCK1 ;Continue
USERCK2 LDA DELETED,Y ;Get the special msg
 CMP #0 ;Are we done?
 BEQ USEREXIT ;Yes, do restores and exit
 STA READBUF+256,X ;Save the info as offset
 INY ;Inc Y
 INX ;Inc X
 JMP USERCK2 ; and continue
USRUNVAL LDY #21 ;Preset offset to 21
 JMP USERDELE+2 ;Go do the unval display
USRESTRI LDY #42 ;Preset for 44 offset
 JMP USERDELE+2 ;Go do restricted display
USRQUEST LDY #63 ;Preset for 63
 JMP USERDELE+2 ;Go do questionable display
USRSUSPE LDY #84 ;Preset for 84 offset
 JMP USERDELE+2 ;Go do suspended display

USEREXIT LDX USERDATX ;Restore the X
 LDY USERDATY ;Restore the Y
USEREND RTS

USERDATX DS 1 ;Temp storage for X Reg
USERDATY DS 1 ;temp storage for Y Reg
USERCNTR DS 1 ;User pass counter

*
*  Check for past end of position
*
POSITION CLC ;Clear the carry bit
 LDA #128 ;To update the actual position
 ADC POSACT ;Add to the LSByte
 STA POSACT ; and save for next pass
 LDA #0 ;For the middle byte update
 ADC POSACT+1 ; to keep it current
 STA POSACT+1 ; and save for next pass
 LDA #0 ;For the MSByte position
 ADC POSACT+2 ; and add it to the actual MSB
 STA POSACT+2 ; and save for next pass
 CMP EOFVAL+2 ;Is it the same as it's MSByte?
 BNE DISPLAY ;Nope, keep working
 LDA POSACT+1 ;Yes, how about the middle byte
 CMP EOFVAL+1 ;Is it the same too for the EOF?
 BNE DISPLAY ;Nope, keep working
 LDA POSACT ;Now check the LSByte
 CMP EOFVAL ;Match the LSByte too?
 BNE DISPLAY ;Nope, keep working
 PLA ;Clear the last
 PLA  ; two JSR's
POSITIN1 LDA #0 ;Clear the accumulator
 STA TBUFF ; and modem input
 LDA #$8D ;Carriage return
 JSR POUTHK ;Send to user
 JSR POUTHK ;One more for measure
 LDX #0 ;Clear the index
POSEOF LDA ENDUSERS,X ;Get TXT for EOF
 CMP #0 ;Finished yet?
 BEQ POSEND1 ;Yes, finish with a press key
 JSR POUTHK ;Send msg to screen
 INX ;Inc the index
 BNE POSEOF ;Always
POSEND1 LDA #20 ;Press any key char
 JSR POUTHK ;Send to the user
 JSR CLOSEALL ; and close the file
POSRTS RTS ;Back to BASic

*
*  Display Pass counter
*
DISPLAY LDA COLWIDTH ;Get the users screen width
 CMP #80 ;80 Cols?
 BNE DISPRTS ;Nope, exit
 LDA DISPCNTR ;Load the pass counter
 CMP #0 ;First pass?
 BNE DISPLAY1 ;No, go clear and exit
 JSR PRNTSPC ;Send user spaces for col 41
 INC DISPCNTR ;Increment the cntr
 JMP DISPRTS ; and exit
DISPLAY1 LDA #$8D ;Carriage return
 JSR POUTHK ; and send to the user
 LDA #0 ;Clear the Accum
 STA DISPCNTR ; and the counter
DISPRTS RTS ;Go do more listings

DISPCNTR DS 1 ;Counter storage

*
*  Send BOX # to screen
*
SENDBOX LDX #0 ;Clear the index
SENDBOX1 LDA USERBOX,X ;Get the text Msg
 BEQ SENDBOX2 ;Finished?
 JSR POUTHK ;Send to user
 INX ;Add to the counter
 BNE SENDBOX1 ;Always
SENDBOX2 RTS ;Finished!

*
*  Print USer Data
*
SENDDATA ORA #$80 ;Add high bit for display
 JSR POUTHK ;Send data to the screen
 INX ;Inc the Index
 RTS ;Back to the routine

*
*  Spaces for user listing to position to col 41
*
PRNTSPC LDX #0 ;Clear the index
PRNTSPC1 LDA #$A0 ;Space char
 JSR POUTHK ;Send to the user
 INX ;Inc the counter
 CPX #9 ;All 9 yet?
 BEQ PRNTSPC2 ;Yes!
 BNE PRNTSPC1 ;Work faster!
PRNTSPC2 RTS ;Back to the prg

*
*  Get the answer from the user for more listings
*
GETANS LDX #0 ;Clear the index
GETANS1 LDA GETDATA,X ;Get the msg
 BEQ GETANS3 ;Finished, get the answer
 JSR POUTHK ;Send user the msg
 INX ;Increment the counter
 BNE GETANS1 ;Always
GETANS3 JSR RDCHARHK ;Get the response
 JSR CASEHK ;Convert to upper case
 CMP #0 ;Nothing?
 BEQ GETANS3 ;Nothing, keep waiting
 CMP #$59 ;"Y"
 BEQ GETANS6 ;Yes
 CMP #$79 ;"y"
 BEQ GETANS6
 CMP #$0D ;Carriage Return
 BEQ GETANS5 ;Yes
 CMP #$4E ;"N"
 BEQ GETANS6
 CMP #$6E ;"n"
 BEQ GETANS6
 CMP #$20 ;" "
 BEQ GETANS4 ;Yes
 LDA #7 ;The dreaded bell
 JSR POUTHK ;Tell the user bad answer
 LDA #0 ;Clear the Accum
 STA TBUFF ; and the modem
 JMP GETANS3 ;Get the answer again
GETANS4 LDA #$4E ;Load the "N"
 BNE GETANS6 ;Always
GETANS5 LDA #$59 ;Load the "Y"
GETANS6 JSR POUTHK ;Send to the user
 LDX #0 ;Clear the index
 STX TBUFF ; and the modem
 TAY ;Save the A for later
 LDA #8 ;Backspace for spiffy look
GETANS7 JSR POUTHK ;Send to the user
 INX
 CPX #13 ;Last one?
 BNE GETANS7 ;Nope, do more
 TYA ;Restore the Accum
 RTS ;Back to the routine

*
*  Set the position via SET_MARK
*
SETMARK JSR MLI ;Call the MLI
 HEX CE ;SET_MARK
 DA PMARK ;Pramamater pointer
 BCC SETMARK1 ;No error, press on
 JMP HANDLERR ;MLI Error
SETMARK1 CLC ;Clear the carry
 LDA MARKPOS+1 ;Load the middle byte
 ADC #2 ;Increment by 4 records
 STA MARKPOS+1 ; and save it
 LDA #0 ;To see if we carried
 ADC MARKPOS+2 ;Now ass it in
 STA MARKPOS+2 ; and save it
 JMP READFIL ;Read more file info

*
*  Error Handler
*
HANDLERR STA TEMP ;Save MLI error code
 CMP #$40 ;Invalid pathname error?
 BEQ E2 ;That's it
 CMP #$44 ;Pathname not found?
 BEQ E2 ;That's it
 CMP #$45 ;Vol/Dir not found?
 BEQ E2 ;That's it
 CMP #$46 ;File not found?
 BEQ E2 ;That's it
 CMP #$4C ;EOF Yet?
 BEQ E4 ;That's it
 CMP #$4D ;Past Marker?
 BEQ E4 ;That's it
 CMP #$56 ;Buffer address bad?
 BEQ E2 ;That's it
 LDX #TXIOERR-ZTXT
 BNE E3 ;Always
E2 LDX #TXFNF-ZTXT
E3 JSR PRINT ;Print error msg
 LDA #$8D ;Carriage Return
 JSR POUTHK ;Send to the user
 JSR CLOSEALL ;Close the files
 RTS ;Finished, back to BASic
E4 JMP POSITIN1

*
*  Print Message
*
PRINT LDA ZTXT,X ;Get the character
 BEQ PRINTRTS ;If 00, then exit
 JSR POUTHK ;Send to the user
 INX ;Increment the counter
 BNE PRINT ;Always
PRINTRTS RTS ;Back to the main routine

*
*  Close all the files
*
CLOSEALL JSR MLI ;Call the MLI
 HEX CC ;CLOSE
 DA PCLOSE ;Paramater List
 RTS ;No error ck

TSTMDMHK JMP (TSTMDM) ;Hook to TSTMDM
POUTHK JMP (POUT) ;Hook to Output
MINPHK JMP (MINP) ;
MOUT1HK JMP (MOUT1) ;
PUSHINP JMP (PUSH) ;
DHOMEHK JMP (DHOME) ;
RDCHARHK JMP (RDCHAR) ;
CASEHK JMP (CASE) ;

*
*  Messages
*
GETDATA ASC "More? <Y/n> "00
USERBOX ASC "Box #"00
ZTXT EQU *
TXIOERR HEX 87
 ASC "I/O Error            "00
TXFNF HEX 87
 ASC "File/Path not found"00
TXEOF HEX 87
 ASC "End of File!"00
ENDUSERS ASC "End of user list.  "00

DIRCOUNT EQU *
BUFINDX EQU DIRCOUNT+1

*
*  Paramater List
*
POPEN HEX 03 ;OPEN Parm list
 DA PATHNAME ;Pathename pointer
 DA OPENBUF ;I/O Buffer
OPREFNUM HEX 00 ;File ref number

PCLOSE HEX 01 ;Close Parm list
CLREFNUM HEX 00 ;CLOSE Ref number

PREAD HEX 04 ;READ Parm list
RDREFNUM HEX 00 ;READ Ref number
 DA READBUF ;Data pointer
RDCOUNT DW 512 ;Request count
TRANSCNT DW 0 ;Transfer count

PMARK HEX 02 ;SET/GET_MARK Parm list
MKREFNUM HEX 00 ;Reference number
MARKPOS DS 3 ;File position

PEOF HEX 02 ;SET/GET_EOF Parm list
EOREFNUM HEX 00 ;Reference number
EOFVAL DS 03 ;Data Storage for EOF

*
*  Miscellaneous info
*
MYDAT DS 4 ;Temporary storage
POSACT DS 3 ;Actual position Bytes
STARTCNT DS 1 ;Counter Storage
STARTDAT DS 4 ;Storage for start info
STARTMSG ASC "Start with which user? <0-9999> "00
PRESSKEY ASC "Press any key..."00
RECNUM DS 1 ;Current record number
FILUSR ASC "FIL.USR"00
DELETED ASC "Deleted user        "00
 ASC "Unvalidated User    "00
 ASC "Restricted User     "00
 ASC "Questionable User   "00
 ASC "Suspended User      "00
PATHNAME DS 65 ;Pathname storage
READBUF DS 512

 lst off
 SAV list.users

