Skip to content

Instantly share code, notes, and snippets.

@retokromer
Created January 3, 2017 11:41
Show Gist options
  • Save retokromer/340b8c498470953cdb95a36387026fd0 to your computer and use it in GitHub Desktop.
Save retokromer/340b8c498470953cdb95a36387026fd0 to your computer and use it in GitHub Desktop.
Display the byte in A (8-bit value) in hex form. AF will be corrupt at exit.
.txt_output equ &bb5a
.print_hex_byte
push af
rrca
rrca
rrca
rrca
call print_byte_digit
pop af
.print_byte_digit
and %00001111
add a,"0"
cp "9"+1
jr c,number
add a,"A"-"9"-1
.number
jp txt_output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment