Reputation: 79458
I am looking at asmdb and the intel docs to try and find out what some of these mean from asmdb:
add | x:r8/m8, ib/ub | 80 /0 ib
add | X:r64/m64, id | REX.W 81 /0 id
add | x:~r16/m16,~r16 | 66 01 /r
and | x:al, ib/ub | 24 ib
btc | x:r16/m16, ib/ub | 66 0F BA /7 ib
What do the /0
and /r
and /7
mean? I assume there might be more "slash x" values, what do they mean, how do I find them in the Intel docs?
Then what does the ib
and id
stuff mean, those aren't hex values and hard to search for in the Intel docs. 66
and 80
are hex values as far as I can tell, but the ib
, iw
, etc. aren't.
I want to eventually build a machine code generator, so need to be able to understand what these basic components of the machine code opcodes are.
Upvotes: 2
Views: 916
Reputation: 30480
You'll want to see Intel® 64 and IA-32 Architectures Software Developer Manuals.
"slash x" denotes that part of the instruction is encoded in the opcode (reg) part of the modr/m byte. See Vol 2A Chapter 2 INSTRUCTION FORMAT.
"ib" and "id" mean "immediate byte" and "immediate dword" respectively. You can see all the abbreviations in Vol 2A Appendix A.2 OPCODE MAP / KEY TO ABBREVIATIONS.
Upvotes: 4