Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to understand 8086 instruction encoding. Even though I found a general instruction and a bulky reference I still don't get it.

Could you please explain me how the following "translations" from byte data are done?

Thanks in advance!

48 -> dec ax

EB0D -> jmp short 0xf

642120 -> and [fs:bx+si],sp
share|improve this question
    
Why don't you check instead official manuals from Intel? Instruction encoding is explained perfectly there. – m0skit0 Feb 22 '12 at 9:12
    
I didn't know them, thank you! – muffel Feb 25 '12 at 12:55
up vote 0 down vote accepted

Your disassembler shows JMP SHORT offset from beginning of instruction when actual JMP SHORT counts from byte after instruction. Maybe you need other disassembler which does good decoding.

share|improve this answer
    
Perhaps you could recommend one? – uSlackr Feb 22 '12 at 13:39
1  
IDA? ollydbg? Visual studio? – ZaB Feb 22 '12 at 23:38
    
NASM – m0skit0 Feb 25 '12 at 13:45

An (or this) unconditional jump is followed by data, either real data or alignment data. For 8086, 2 or 4 is a good alignment, so the next instruction could start at the 21 or 20 or beyond that.

share|improve this answer
    
Not to nitpick, but 64h is not a prefix byte on the 8086. At least not according to: electronicsandbooks.com/eab1/manual/… page 273 Its 4 years on but still – Sam May 10 at 21:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.