System information
 014F 3C   inr a  ; err 255 becomes 0
 0150 CAB401  jz error ; error message, retry
 0153 C30000   jmp reboot  ; back to ccp
 ;
 ; end of command, process write
 ;
 notq:
 ; not the quit command, random write?
 0156 114702  lxi d,datmsg
 0159 CDD501  call print   ; data prompt
 015C 0E7F  mvi c,127 ; up to 127 characters
 015E 218000  lxi h,buff  ; destination
 rloop:  ;read next character to buff
 0161 C5  push b  ; save counter
 0162 E5  push h  ; next destination
 0163 CDBD01  call getchr  ; character to a
 0166 E1  pop h  ; restore counter
 0167 C1  pop b  ; resore next to fill
 0168 FE0D  cpi cr  ; end of line?
 016A CA7301  jz erloop
 ; not end, store character
 016D 77  mov m,a
 016E 23  inx  h   ; next to fill
 016F 0D  dcr c  ; counter goes down
 0170 C26101   jnz rloop  ; end of buffer?
 erloop:
 ; end of read loop, store 00
 0173 3600  mvi  m,0
 ;
 ; write the record to selected record number
 0175 0E22  mvi c,writer
 0177 115C00  lxi d,fcb
 017A CD0500 call bdos
 017D B7  ora a  ; error code zero?
 017E C2B401  jnz error  ; message if not
 0181 C33701     jmp ready ; for another record
5.5 A Sample Random Access Program CP/M Operating System Manual
5-49










