Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

intel machine code to assembly code question

experts,i wonder the intel x86 machineCode/assemblyCode conversion is singleSide or bothSide?

means: assemblyCode ---> machineCode and machineCode ---> assemblyCode are both available.

since the x86 machineCode is vary in size (1-15 byte),and opcode vary in (1-3 byte),how to determine one opcode is 1byte or 2byte or 3byte ?

and i never found the example of prefix of x86 instructions,if here is 1byte prefix,how to determine it is prefix or opcode?

certainly, the assemblyCode ---> machineCode , the identity of mnemonics + oprand[w/b] can determine what the response machineCode is by maping certain MappingTable.

but,when the process is reversed:

{ bbbbbbbb,bbbbbbbb,bbbbbbbb, //instruction1 bbbbbbbb,bbbbbbbb,bbbbbbbb,bbbbbbbb,bbbbbbbb,bbbbbbbb,//instruction2 bbbbbbbb,bbbbbbbb//instruction3 }

----> {bbbbbbbb,bbbbbbbb,bbbbbbbb,bbbbbbbb,bbbbbbbb,bbbbbbbb,bbbbbbbb,bbbbbbbb,bbbbbbbb,bbbbbbbb,bbbbbbbb}

i don't know which is the significant bits or byts to determined how long(what size) one instruction is.

would any one tells me how to determine that?(the size of opcode,the prefix example.) thanks for help.

like image 399
Johnny Avatar asked Mar 09 '10 14:03

Johnny


1 Answers

The details you need are in Intel® 64 and IA-32 ArchitecturesSoftware Developer’s Manual Volume 2B: Instruction Set Reference, N-Z. Look at Appendix A, it includes everything you need.

like image 77
torak Avatar answered Nov 15 '22 18:11

torak