Here are my problems with my code: slt $2, $2, 91. slt Rd, R1, R2 The destination register, Rd, is set to 1 if the first source register, R1 is less than the second source register, R2 If you want to compare to the ASCII hexadecimal value for 'Z' you would need to put that hex into a register first. That hex is 0x5A.
I'm confused as to which one is the slt Rd, R1, R2. For li $2,65 # 0x41 I should change this to 0x5A because I want to compare that with the start of the alphabet?
Here is my code:
.data
$LC0:
.ascii "%c \000"
.text
main:
addiu $sp,$sp,-40
sw $31,36($sp)
sw $fp,32($sp)
move $fp,$sp
li $2,65 # 0x41
sw $2,24($fp)
b $L2
nop
$L3:
lw $5,24($fp)
lui $t1, 100
addiu $t1,$t2,-100
jal printf
nop
lw $2,24($fp)
nop
addiu $2,$2,2
sw $2,24($fp)
$L2:
lw $2,24($fp)
nop
slt $2,$2,91 # Having issues with this line of code
bne $2,$0,$L3
nop
move $2,$0
move $sp,$fp
lw $31,36($sp)
lw $fp,32($sp)
addiu $sp,$sp,40
jr $31
nop