Instruction manual

0039 c9 ret
003a ;
003a ;Binary dump to port. Send a stream of binary data from memory to serial output
003a ;Address of dump passed in HL, length of dump in BC
003a db 03 bdump: in a,(3) ;get status
003c e6 01 and 001h ;check TxRDY bit
003e ca 3a 00 jp z,bdump ;not ready, loop
0041 7e ld a,(hl)
0042 d3 02 out (2),a
0044 23 inc hl
0045 0b dec bc
0046 78 ld a,b ;need to test this way because
0047 b1 or c ;dec rp instruction does not change flags
0048 c2 3a 00 jp nz,bdump
004b c9 ret
004c ;
004c ;Subroutine to get a string from serial input, place in buffer.
004c ;Buffer address passed in HL reg.
004c ;Uses A,BC,DE,HL registers (including calls to other subroutines).
004c ;Line entry ends by hitting return key. Return char not included in string (replaced by zero).
004c ;Backspace editing OK. No error checking.
004c ;
004c 0e 00 get_line: ld c,000h ;line position
004e 7c ld a,h ;put original buffer address in de
004f 57 ld d,a ;after this don't need to preserve hl
0050 7d ld a,l ;subroutines called don't use de
0051 5f ld e,a
0052 db 03 get_line_next_char: in a,(3) ;get status
0054 e6 02 and 002h ;check RxRDY bit
0056 ca 52 00 jp z,get_line_next_char ;not ready, loop
0059 db 02 in a,(2) ;get char
005b fe 0d cp 00dh ;check if return
005d c8 ret z ;yes, normal exit
005e fe 7f cp 07fh ;check if backspace (VT102 keys)
0060 ca 74 00 jp z,get_line_backspace ;yes, jump to backspace routine
0063 fe 08 cp 008h ;check if backspace (ANSI keys)
0065 ca 74 00 jp z,get_line_backspace ;yes, jump to backspace
0068 cd 0c 00 call write_char ;put char on screen
006b 12 ld (de),a ;store char in buffer
006c 13 inc de ;point to next space in buffer
47