So I have this question that say, beq instruction
is executing from 0x80000000
address, what is the lowest destination address you can reach.
the answer is 0x7ffe0004
, but I couldn't figure out how to get to this result. any help please?
So I have this question that say, beq instruction
is executing from 0x80000000
address, what is the lowest destination address you can reach.
the answer is 0x7ffe0004
, but I couldn't figure out how to get to this result. any help please?
The offset is a 16-bit signed field, ranging from -32768 to +32767. That offset is in words, so it is multipied by 4. The PC will already have been advanced, so the new address is PC + 4 + 4*offset
. 4 x 32768 is 0x20000. 0x80000000 + 4 - 0x20000 is 0x7ffe0004.