User`s guide
; not end; Store character
0185 77 mov m,a
0186 23 inx h +;inext to fill
0187 0D dcr c +;icounter goes down
0188 C27901 jnz rloop +;iend of buffer?
erloop:
; end of read loop, Store 00
018b 3600 mvi m,0
; write the record to selected record number
018D 0E22 mvi c,Writer
018F 115C00 lxi d,fcb
0192 CD0so0 call bdos
0195 b7 ora a +;ierror code zero?
0196 C2FF0I jnz error +;imessage if not
0199 C34b01 jmp ready +;ifor another record
; ************************************************
;* *
;* end of Write command, pr0cess Write random zero fill *
;* *
; ************************************************
notw:
; not the quit command; random Write zero fill?
019C FE46 cpi 'F'
019E C2CF0I jnz notf
; this is a random Write; fill buffer until cr
01a1 11b302 lxi d,datmsg
01a4 CD3102 call print ;data Prompt
01a7 0E7F mvi c,127 +;iUP to 127 characters
01a9 218000 lxi h,buff ;destination
rloop1: ;iread next character to buff
0laC C5 push b +;isave counter
0laD E5 push h +;inext destination
0laE CD0802 call getchr +;icharacter to a
0lbI El pop h +;irestore counter
01b2 C1 pop b +;irestore next to fill
01b3 FE0D cpi cr +;iend of line?
01b5 CabE0l jz erloop1
; not end , store character
01b8 77 mov m,a
01b9 23 inx h ;next to fill
0lba 0D dcr c ;counter goes down
0lbb C2aC01 jnz rloopl ;end of buffer?
4.3 A Sample Random Access Program CP/M 3 Programmer's Guide