home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
misc
/
insidcpm.lbr
/
RECTRAN.AQM
/
RECTRAN.ASM
Wrap
Assembly Source File
|
1985-02-09
|
2KB
|
73 lines
; * * * * * RECTRAN -- DISPLAY SKEW TRANSLATION
;
MACLIB CPMEQU ; standard names
MACLIB PROG ; prolog, service macros
MACLIB COSUB ; console output
MACLIB HEXSUB ; hex displays
MACLIB BIOSCALL ; bios interface
;
PROLOG 30,RECTRAN
;
HEADING DB 'Record skew pattern for disk '
DRIVE DB 0,CR,LF,CR,LF+80H
NOXLATE DB 'that disk needs no translation.',CR,LF+80H
NRECS DW 0
PLENGTH EQU 16
NPRINT DB 0
;
RECTRAN EQU $
MVI A,PLENGTH
STA NPRINT ; initialize count of numbers
LDA CPMFCB ; see if drive specified
DCR A ; convert FCB for to service 14 form
JP REC2 ; (yes, drive given)
SERVICE 25 ; omitted, get current drive
REC2 MOV E,A ; save drive for service 14
MOV C,A ; ..and for BIOS seldsk call
ADI 'A' ; make printable
STA DRIVE ; ..put in heading & print
LXI H,HEADING ! CALL COSTR
SERVICE 14 ; establish drive to BDOS
SERVICE 31 ; HL --> DPB, set DE = SPT
MOV E,M ! INX H ! MOV D,M
XCHG ; save records/track
SHLD NRECS ; ..for loop control
MVI A,B$SELDSK
CALL BIOS ; HL --> DPH, set DE --> xlate table
MOV E,M ! INX H ! MOV D,M
MOV A,E ; if that address is zero,
ORA D ; ..no translation is done.
JNZ REC3
LXI H,NOXLATE ! CALL COSTR
RET ; ..in which case, quit
REC3 LXI B,0 ; clear record number
;
RECLOOP MVI A,B$SECTRAN
CALL BIOS ; HL = xlate(BC)
CALL PRINT ; display the result
LHLD NRECS ; decrement loop variable
DCX H
MOV A,L ! ORA H
RZ ; return to CCP if done
SHLD NRECS ; save loop count
INX B ; step record number
JMP RECLOOP ; and continue
;
PRINT CALL HEXADDR ; print HL as hex word
CALL COSPACE ; ..and a space
LDA NPRINT ; see if end of line
DCR A
STA NPRINT
RNZ ; (no, continue)
MVI A,PLENGTH
STA NPRINT ; refresh line count
CALL COCRLF ; start a new line
RET
;
; COMMON SUBROUTINES
;
COSUBM
HEXSUBM
BIOSM
END