Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

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.