RosettaCodeData/Task/Literals-String/MIPS-Assembly/literals-string-2.mips
2023-07-01 13:44:08 -04:00

5 lines
264 B
Text

;print 0 if $t0 if even, 1 if $t0 is odd
andi t0,t0,1 ;clear all but bit 1. This tells us if $t0 is odd or even.
addiu t0,"0" ;add ASCII 0 (0x30) to $t0
jal PrintChar ;implementation-defined print routine that prints the ASCII value of $t0 to the screen.