I am learning about assembly and am doing assembly computations, particularly with MIPS instructions to calculate the changed registers and memory addresses.
The initial address states are here :
$t0 = 0x0000000B, $t1 = 0xFFFFFFFF, $t2 = 0xABABABAC
This is the code we have to use to calculate: addi $t4, $t0, -3. sub $t4, $t4, $t1
I calculated the first one here:
add intermediate $t0 +(-3) into $t4
$t4 = 0x0000000B - 0x00000003 (B = 11 in hexadecimal) (11-3)
0x00000008 is stored in register $t4. (8)
For this one, I calculated it and got subtract $t4 - $t1 into $t4 $t4 = 0x00000008 - 0xFFFFFFFF = -0x00000007
but I'm not sure if that is correct because it is a negative memory address so would it just be positive? Switching it ( 0xFFFFFFFF - 0x00000008 gives 0x00000007 but that is not the right order of operations in the code unless i'm wrong)
Can anyone justify which one is correct?
Thank you.
User contributions licensed under CC BY-SA 3.0