System information
;
; end of write command, process read
;
notw:
; not a write command, read record?
0184 FE52 cpi 'R'
0186 C2B401 jnz error ; skip if not
;
; read random record
0189 0E21 mvi c,readr
018B 115C00 lxi d,fcb
018E CD0500 call bdos
0191 B7 ora a ; return code 00?
0192 C2B401 jnz error
;
; read was successful, write to console
0195 CDCA01 call crlf ; new line
0198 0E80 mvi c,128 ; max 128 characters
019A 218000 lxi h,buff ; next to get
wloop:
019D 7E mov a,m ; next character
019E 23 inx h ; next to get
019F E67F ani 7fh ; mask parity
01A1 CA3701 jz ready ; for another command if 00
01A4 C5 push b ; save counter
01A5 E5 push h ; save next to get
01A6 FE20 cpi ' ' ; graphic?
01A8 D4C301 cnc putchr ; skip output if not
01AB E1 pop h
01AC C1 pop b
01AD 0D dcr c ; count=count-1
01AE C29D01 jnz wloop
01B1 C33701 jmp ready
;
; end of read command, all errors end up here
;
error:
01B4 115402 lxi d,errmsg
01B7 CDD501 call print
01BA C33701 jmp ready
;
5.5 A Sample Random Access Program CP/M Operating System Manual
5-50