Created
January 3, 2017 11:41
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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