User`s guide

erloop1 :
; end of read loop, Store 00
0lbE 3600 mvi m,0
; Write the record to selected record number
0lc0 0E28 mvi c,wrtrzf
01C2 115C00 lxi d,fcb
01C5 CD0500 call bdos
01C8 b7 ora a ;error code zero?
01C9 C2FF0l jnz error ;message if not
01CC C34b01 jmp ready +;ifor another record
;************************************
;* *
;* end of Write commands; pr0cess read *
;* *
;************************************
notf :
; not a Write command, read record?
0ICF FES2 cpi 'R'
0lDi C2FF01 jnz error ;skip if not
; read random record
01D4 0E21 mvi c;readr
01DB 115C00 lxi d,fcb
01D9 CD0500 call bdos
0lDC b7 ora a +;ireturn code 00?
0IDD C2FF0I jnz error
; read was Successful , Write to c0nsole
0lE0 CD1502 call crlf ;new line
01E3 0E80 mvi c,128 ;max 128 characters
0IE5 218000 lxi h,buff +;inext to get
wloop :
01E8 7E mov a,m ;next character
01E9 23 inx h ;next to get
0lEa E67F ani 7fh ;mask Parity
0lEC Ca4b0l jz ready ;for another command if 00
0lEF C5 push b +;isave counter
0lF0 E5 push h +;isave next to get
0lFl FEZ0 cpi ' ' ;graphic?
01F3 D40E02 cnc putchr +;iskip 0utput if not
0lFB El pop h
01F7 C1 pop b
01F8 0D dcr c +;icount=count-l
01F9 C2E801 jnz wloop
0lFC C34b01 jmp ready
4.3 A Sample Random Access Program CP/M 3 Programmer's Guide