https://i.stack.imgur.com/CVHBj.png
I'm attempting to find the 1-byte displacement for some jumps. What I got was:
26
7
7
29
Not sure if I did that right though, any help?
https://i.stack.imgur.com/CVHBj.png
I'm attempting to find the 1-byte displacement for some jumps. What I got was:
26
7
7
29
Not sure if I did that right though, any help?
The offset is relative to the next instruction, you do not need to add the current instruction's length. In other words, the offset encoded is in addition to the normal increment that the cpu does for going to the next instruction. Which is why your first three answers are off by 2 each. Should be
0x24
,5
and5
.For the last one you counted right, but forgot to negate the result because it's a backwards jump. Thus, the answer is
-41
(decimal) which is0xd7
.PS: you could have typed that into an assembler and verified the offsets yourself.