Doubt in Intel docs
Posted: Tue Aug 12, 2003 11:00 pm
hi everyone,
I have doubt whether r/m16 is just a superset of r16. But the intel doc(IA-32, part-2) seems to specify registers in both r16 and r/m16 as the same. But they use different opcodes for the two cases.
This is how they define it:
-----------------------------------------------------------------------------
r/m16 - A byte operand that is either the contents of a byte general-purpose register or a byte from memory.
r16 - One of the word general purpose registers.-----------------------------------------------------------------------------
Now what if I had something like
mov ax, imm16 ;imm16 is immediate value of size 16 bits
What will be the opcode ? Which one would it ?
1. mov r/m16, imm16
or
2. mov r16, imm16
Thanking you in advace.
modshah
I have doubt whether r/m16 is just a superset of r16. But the intel doc(IA-32, part-2) seems to specify registers in both r16 and r/m16 as the same. But they use different opcodes for the two cases.
This is how they define it:
-----------------------------------------------------------------------------
r/m16 - A byte operand that is either the contents of a byte general-purpose register or a byte from memory.
r16 - One of the word general purpose registers.-----------------------------------------------------------------------------
Now what if I had something like
mov ax, imm16 ;imm16 is immediate value of size 16 bits
What will be the opcode ? Which one would it ?
1. mov r/m16, imm16
or
2. mov r16, imm16
Thanking you in advace.
modshah