- #1
Lapse
- 49
- 4
Homework Statement
My specific question is:
What is the value held in r7 (written in hexadecimal) after the following instructions execute?
addi r5, r0, 0x30 ldw r7, 0(r5)
Homework Equations
N/A
The Attempt at a Solution
There's a few things I'm not understanding...
Here are my attempts:
Method 1:
r5 = r0 + 0x30 = 0xABCDEFAA + 0x30 = 0xABCDF01A
r7 = r5 + 0 = 0xABCDF01A
Notice that I assigned the "word address" values as the "register values". Is this correct? Is a word address the same as a register?
Method 2:
r5 = r0 + 0x30 = 0 + 0x30 = 0x30
r7 = r5 + 0 = 0x30
Here, I assumed no value was given for the registers, so I assigned the register number as the register value; i.e. r0 = 0, or r2 = 2. Is this the correct method?