2
votes

Given the assembly instruction:

bne $s0, $s1, DONE

The address of the instruction is 500 bytes. If the offset field contains the following value:

1111111111110100

what is the target address? Explain your answer.

Is the answer to this question : 494? My reasoning is that the offset field in decimal is -10 but i am not sure about it :( and the address of pc at this point is 500+4 so:

target address = pc address + (offset)= 504+(-10) = 494.

I wanted to know if i am doing it correct or not.

Thanks

1

1 Answers

3
votes

You are correct, except that 1111111111110100 is not -10 in decimal, it's -12. Thus, the target address is 504-12 = 492.