Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .text
- .align 2
- .global hexasc
- hexasc:
- andi r8, r4, 0xf # Strips away all but the first 4 bits
- movi r9, 0x0a
- blt r8, r9, digit # If true it's a digit
- addi r2, r8, 0x37 # Adds 0x37 which gives the correct ASCII-code
- ret
- digit:
- addi r2, r8, 0x30 # Adds 0x30 so that it gives the correct ASCII-code
- ret
Add Comment
Please, Sign In to add comment