; * * * * * XDPB -- DISPLAY THE DISK PARAMETER BLOCK ; MACLIB CPMEQU ; standard names MACLIB PROG ; prolog, service macros MACLIB HEXSUB ; hex display routines MACLIB COSUB ; console output routines ; PROLOG 30,DPB ; DISPLAY EQU $ DB 'Disk Parameter Block for drive ' DRIVE DS 1 ! DB CR,LF DB 'SPT: ' SPT DS 4 ! DB ' records per track',CR,LF DB 'BSH: ' BSH DS 2 ! DB ' recno >> BSH = block number',CR,LF DB 'BLM: ' BLM DS 2 ! DB ' recno AND BLM = record in block',CR,LF DB 'EXM: ' EXM DS 2 ! DB ' logical extent versus physical',CR,LF DB 'DSM: ' DSM DS 4 ! DB ' highest block number (origin 0)',CR,LF DB 'DRM: ' DRM DS 4 ! DB ' highest directory number (origin 0)',CR,LF DB 'ALV: ' ALV DS 4 ! DB ' bits reserving directory blocks',CR,LF DB 'CKS: ' CKS DS 4 ! DB ' size of check vector in bytes',CR,LF DB 'OFF: ' OFF DS 4 ! DB ' number of reserved tracks',CR,LF+80H ; DPB EQU $ LDA CPMFCB ; drivecode given? DCR A ; convert A=01 into A=00 JP DPB2 ; (yes, one was given) SERVICE 25 ; no drivecode, get current disk DPB2 MOV E,A ; save for select service ADI 'A' ; make drivecode printable, STA DRIVE ; ..put into display SERVICE 14 ; ..and select it SERVICE 31 ; HL --> DPB for current disk PUSH H ; (save it for dump) ; LXI D,SPT ; DE --> field in display CALL CVT2 ; make printable, advance HL & DE ; LXI D,BSH ! CALL CVT1 LXI D,BLM ! CALL CVT1 LXI D,EXM ! CALL CVT1 LXI D,DSM ! CALL CVT2 LXI D,DRM ! CALL CVT2 LXI D,ALV ! CALL CVT1 ! CALL CVT1 LXI D,CKS ! CALL CVT2 LXI D,OFF ! CALL CVT2 LXI H,DISPLAY CALL COSTR ; print the whole thing POP H ; then dump it all in hex MVI B,15 CALL HEXDUMP ! CALL COCRLF ; RET ; return to CCP ; CVT2 EQU $ ; display 16 bit integer ; (8080 FORM -- first byte is the least-significant) PUSH H ; save --> LSB INX H ; HL --> MSB CALL CVT1 ; ..convert, store that XTHL ; save HL, HL --> LSB CALL CVT1 ; ..convert, store that POP H ; HL --> next data RET ; CVT1 EQU $ ; display byte at HL++ MOV A,M ; get byte INX H ; .. advance HL CVT1A CALL HEXBYTE ; A, C = ASCII display STAX D ; put left in display INX D MOV A,C ; put right in display STAX D INX D RET ; ; * * * * * COMMON SUBROUTINES ; HEXSUBM COSUBM END