!! char/hex output hacking !! .data a: .word 0xffffffff b: .word 8 greeting: .ascii "hack string" .byte 0 greeting2: .asciz "hack string2" .text set a, %r1 ld [%r1], %r8 ! print out as char; there is no ascii char for this ! hex number - gigo... ta 1 ! print out as hex ta 4 ! spit out a newline mov 0xa, %r8 ta 1 set b, %r1 ld [%r1], %r8 ! print out single char; ascii 0x08 is the backspace ta 1 ! print out as decimal digit; add '0' = add 48; transfers ! to range of ascii decimal digits add %r8, '0', %r8 ta 1 ! undo previous hack; print out as hex sub %r8, '0', %r8 ta 4 ! spit out a newline mov 0xa, %r8 ta 1 set greeting, %r8 ta 6 ! spit out a newline mov 0xa, %r8 ta 1 ! spit out a newline set greeting2, %r8 ta 6 mov 0xa, %r8 ta 1 ta 0