Help in CS! Question about MIPS!

CarpeDeo

Golden Member
Feb 10, 2000
1,778
0
0
If you can help me with this, I am totally in your gratitude.

110 represents the ascii character 'o'.

The 32-bit integer 110 is stored in a stack ($sp).

$s0 points to the stack at location of word 110.

I want to extract the low byte of the word 110 and copy it to an output using sb (save byte).

So I tried loading the word into a temporary register by:
lw $t0,0($s0)

Now if I take the first byte of $t0, can't I save it to my output register $v0 with this command?

lb $t1,0($t0)
sb $v0,0($t1)

?? Why doesn't this work for me?

 

CarpeDeo

Golden Member
Feb 10, 2000
1,778
0
0
STUPID. Got it figured out. I was switching the positions of the registers when I was sb'ing. Also some other little problems here and there. Thanks for my help! haha.