Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
332 views
in Technique[技术] by (71.8m points)

What do these x86 Assembly instruction codes mean?

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.

question from:https://stackoverflow.com/questions/65918186/what-do-these-x86-assembly-instruction-codes-mean

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...