Instruction manual

006d 0c inc c ;inc counter
006e 3e 00 ld a,000h
0070 12 ld (de),a ;leaves zero-terminated string in buffer
0071 c3 52 00 jp get_line_next_char
0074 79 get_line_backspace: ld a,c ;check current position in line
0075 fe 00 cp 000h ;at beginning of line?
0077 ca 52 00 jp z,get_line_next_char ;yes, ignore backspace, get next char
007a 1b dec de ;no, erase char from buffer
007b 0d dec c ;back up one
007c 3e 00 ld a,000h ;put zero in place of last char
007e 12 ld (de),a
007f 21 84 03 ld hl,erase_char_string ;ANSI seq. To delete one char from line
0082 cd 18 00 call write_string ;transmits seq. to BS and erase char
0085 c3 52 00 jp get_line_next_char
0088 ;
0088 ;Creates a two-char hex string from the byte value passed in register A
0088 ;Location to place string passed in HL
0088 ;String is zero-terminated, stored in 3 locations starting at HL
0088 ;Also uses registers b,d, and e
0088 47 byte_to_hex_string: ld b,a ;store original byte
0089 cb 3f srl a ;shift right 4 times, putting
008b cb 3f srl a ;high nybble in low-nybble spot
008d cb 3f srl a ;and zeros in high-nybble spot
008f cb 3f srl a
0091 16 00 ld d,000h ;prepare for 16-bit addition
0093 5f ld e,a ;de contains offset
0094 e5 push hl ;temporarily store string target address
0095 21 ee 00 ld hl,hex_char_table ;use char table to get high-nybble character
0098 19 add hl,de ;add offset to start of table
0099 7e ld a,(hl) ;get char
009a e1 pop hl ;get string target address
009b 77 ld (hl),a ;store first char of string
009c 23 inc hl ;point to next string target address
009d 78 ld a,b ;get original byte back from reg b
009e e6 0f and 00fh ;mask off high-nybble
00a0 5f ld e,a ;d still has 000h, now de has offset
00a1 e5 push hl ;temp store string target address
00a2 21 ee 00 ld hl,hex_char_table ;start of table
00a5 19 add hl,de ;add offset
00a6 7e ld a,(hl) ;get char
48