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
166 views
in Technique[技术] by (71.8m points)

What does [--][--] mean in the Intel x86 Assembly docs?

Searching the Intel Volume 2A docs only reveals 4 uses of [--][--], and only says one short sentence of its meaning:

The [--][--] nomenclature means a SIB follows the ModR/M byte.

Referring to this for the SIB byte:


enter image description here


So, what does this mean? How do you use it, in the table in which it appears:

enter image description here

I am starting to get a sense of how to use this table to understand the bottom left corner box of this table, and it's relation to the top column headers, but have yet to understand the rest of this table. I think I can figure out how this computed address stuff works, but what does the [--][--] mean? Do you fill in the -- with registers, so it would be like [eax][eax]? Or, I don't have any idea. Please help.

What are some examples of instruction calls that demonstrate its usage?

question from:https://stackoverflow.com/questions/65949565/what-does-mean-in-the-intel-x86-assembly-docs

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

1 Reply

0 votes
by (71.8m points)

-- is a placeholder / wild-card. That table entry tells you to use that r/m encoding to signal a SIB for any indexed addressing mode.

They seem to be using a weird asm-level syntax where a 2-register addressing mode would look like [edi][eax] or whatever, instead of the more modern-standard [edi+eax]. Although I think MASM does allow [edi][eax].

If your addressing mode matches that [*][*] pattern (i.e. has 2 registers), then you use that entry (and thus signal the presence of a SIB byte).


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

...