Instruction manual
00d6 cb 27 sla a
00d8 cb 27 sla a
00da 57 ld d,a ;store high-nybble
00db 23 inc hl ;get next character of the pair
00dc 7e ld a,(hl)
00dd e5 push hl ;store hl
00de cd ae 00 call hex_char_to_nybble
00e1 e1 pop hl
00e2 fe ff cp 0ffh ;non-hex character?
00e4 ca ec 00 jp z,hex_to_byte_err ;yes, exit with error
00e7 b2 or d ;no, combine with high-nybble
00e8 23 inc hl ;point to next memory location after char pair
00e9 37 scf
00ea 3f ccf ;no-error exit (carry = 0)
00eb c9 ret
00ec 37 hex_to_byte_err: scf ;error, carry flag set
00ed c9 ret
00ee .. hex_char_table: defm "0123456789ABCDEF" ;ASCII hex table
00fe ;
00fe ;Subroutine to get a two-byte address from serial input.
00fe ;Returns with address value in HL
00fe ;Uses locations in RAM for buffer and variables
00fe 21 08 db address_entry: ld hl,buffer ;location for entered string
0101 cd 4c 00 call get_line ;returns with address string in buffer
0104 21 08 db ld hl,buffer ;location of stored address entry string
0107 cd c7 00 call hex_to_byte ;will get high-order byte first
010a da 20 01 jp c, address_entry_error ;if error, jump
010d 32 01 db ld (current_location+1),a ;store high-order byte, little-endian
0110 21 0a db ld hl,buffer+2 ;point to low-order hex char pair
0113 cd c7 00 call hex_to_byte ;get low-order byte
0116 da 20 01 jp c, address_entry_error ;jump if error
0119 32 00 db ld (current_location),a ;store low-order byte in lower memory
011c 2a 00 db ld hl,(current_location) ;put memory address in hl
011f c9 ret
0120 21 c2 03 address_entry_error: ld hl,address_error_msg
0123 cd 18 00 call write_string
0126 c3 fe 00 jp address_entry
0129 ;
0129 ;Subroutine to get a decimal string, return a word value
0129 ;Calls decimal_string_to_word subroutine
50










