home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
MISC
/
INSIDCPM.LBR
/
HEXDIR.AQM
/
HEXDIR.ASM
Wrap
Assembly Source File
|
2000-06-30
|
2KB
|
61 lines
; * * * * * HEXDIR -- DISPLAY EXTENT-0 DIRECTORY ENTRIES
;
MACLIB CPMEQU ; standard names
MACLIB PROG ; prolog, service macros
MACLIB HEXSUB ; hex display routines
MACLIB COSUB ; console output routines
MACLIB DPSUB ; 16-bit routines
;
PROLOG 30,HEXDIR
;
HEADING DB 'Extent-zero directory entries, drive '
DRIVE DB 0,CR,LF,CR,LF+80H
;
THEFCB DB 0 ; drive already selected
DB '????????' ; filename
DB '???' ; filetype
DB 0 ; extent zero entries
DB 0,0,0 ; s1, s2, record count
DW 0,0,0,0,0,0,0,0 ; data map
DW 0,0 ; current record, direct addr
;
HEXDIR EQU $
LDA CPMFCB ; see if a drivecode was given
DCR A ; convert A=1 into A=0
JP DIR2 ; (result not FF -- code given)
SERVICE 25 ; omitted, get current drive
DIR2 MOV E,A ; save drive for service 14
ADI 'A' ; make printable,
STA DRIVE ; ..put in message,
LXI H,HEADING
CALL COSTR ; ..print heading.
SERVICE 14 ; select drive (code in reg E)
SERVICE 17,THEFCB ; get first active entry
;
DIRLOOP ORA A ; any entries left?
RM ; (back to CCP if not)
CALL DIRDUMP ; yes, dump this one in hex
SERVICE 18,THEFCB
JMP DIRLOOP ; do next entry, if any
;
; Dump the directory entry whose number is in [A],
; from the current record in the buffer
;
DIRDUMP LXI H,CPMBUFF
ADD A ; convert 0,1,2,3 --> 0,32,64,96
ADD A ! ADD A
ADD A ! ADD A
CALL DP$ADAH ; ..and add to buffer address
MVI B,16 ; amount to dump in each line
CALL HEXLINE ! CALL COCRLF ; 1st line
CALL HEXLINE ! CALL COCRLF ; 2nd line
CALL COCRLF ; blank line
RET
;
; COMMON SUBROUTINES
;
HEXSUBM
COSUBM
DPSUBM
END