Tal Achituv wrote:
Shachar Shemesh wrote:
Tal's question, however, was a different one. He asked whether 90 could mean anything else. Specifically, he asked whether 90 could mean something that actually did something. Without reference to the specific place in the manual where you got that question from, Tal, I doubt anyone here will answer you however.
Shachar,
Please take a look at http://www.achituv.com/intel_ref_3-462.jpg
This is a picture of the page number 3-462 out of the "Intel Instruction Set Reference",
As you can see - the XCHG operations on AX, and EAX with r16's and r32's respectively.
Either I'm missing something, or this is a typo.
The former.
What this page says is this. In order to encode XCHG AX, something, you issue 90hex + encode the other operand. In case the second operand is AX, the result is to replace AX with AX. As I have mentioned elsewhere, NOP is encoded as 90, which means that XCHG AX, AX and NOP are one and the same.
If you don't believe me, try writing the following program:
XCHG AX,AX
assemble it, and then run it through objdump -d. You will see that the disassembler understnads this command as "NOP".
I'm not entirely familiar with the different Intel notations (the meanings of the +rw, +rd & /r flags, and what r16 / r32 reffers to,
These are various ways of encoding the operands. To answer your original question - 90 is NOP. Nothing else. You will find that trying to encode anything other than XCHG AX,AX will result in the first byte not being 90, but something else.
The begining of the exact same book you posted a photocopy of should have a reference explaining how to encode the r16 etc. notation.
my guess was that r16 is another name for AX, and r32 is another name for EAX - which is similar to a MIPS notation that I
used to work with. - but I was told that this is not the case.)
No, it is not. r16 is any 16 bit operand, while r32 is any 32 bit operand. The CPU has a 16 bit mode and a 32 bit mode. These operands have standard options (detailed, if memory serves me right, right before the book starts to list all possible opcodes). You will find, however, that the standard encoding of r16 when referred to AX is to leave it as is, which means that 90 is XCHG AX,AX.
Thanks, Tal.
Shachar
-- Shachar Shemesh Lingnu Open Source Consulting ltd. http://www.lingnu.com/
================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
