System information
getchr:
; read next console character to a
01BD 0E01 mvi c,coninp
01BF CD0500 call bdos
01C2 C9 ret
;
putchr;
; write character from a to console
01C3 0E02 mvi c,conout
01C5 5F mov e,a ; char to send
01C6 CD0500 call bdos ; send char
01C9 C9 ret
;
crlf:
; send carriage return, line feed
01CA 3E0D mvi a,cr ; carriage return
01CC CDC301 call putchr
01CF 3E0A mvi a,lf ; line feed
01D1 CDC301 call putchr
01D4 C9 ret
;
print:
; print the buffer addressed by de until $
01D5 D5 push d
01D6 CDCA01 call crlf
01D9 D1 pop d ; new line
01DA 0E09 mvi c,pstring
01DC CD0500 call bdos ; print the string
01DF C9 ret
;
readcom:
; read the next command line to the conbuf
01E0 116602 lxi d,prompt
01E3 CDD501 call print ; command?
01E6 0E0A mvi c,rstring
01E8 117502 lxi d,conbuf
01EB CD0500 call bdos
; command line is present, scan it
01EE 210000 lxi h,0 ; start with 0000
01F1 117702 lxi d,conlin ; command line
5.5 A Sample Random Access Program CP/M Operating System Manual
5-51