ADC Instruction Machine Code
Posted: Tue Mar 24, 2009 12:17 am
Hello there.
Im working on my simple assembler. Im looking to Intel and AMD documentations;
ADC AL, imm8 : 14 ib
ADC AX, imm16 : 15 iw
ADC EAX, imm32 : 15 id
Im writing a code like that in NASM,
[BITS 32]
ADC al, 0x40
ADC ax, 0x4040
ADC eax, 0x40404040
and looking to machine codes are,
14 40 66 15 40 40 15 40 40 40 40
As you see for AL and EAX, machine codes are true but for AX, there is an extra code: 66
Also i used same code in Delphi. And disassemblied. Same result.
What is wrong? Are the documents wrong? Or compilers are wrong?
(Also this is same in ADD instruction)
Thanks in advance.
Im working on my simple assembler. Im looking to Intel and AMD documentations;
ADC AL, imm8 : 14 ib
ADC AX, imm16 : 15 iw
ADC EAX, imm32 : 15 id
Im writing a code like that in NASM,
[BITS 32]
ADC al, 0x40
ADC ax, 0x4040
ADC eax, 0x40404040
and looking to machine codes are,
14 40 66 15 40 40 15 40 40 40 40
As you see for AL and EAX, machine codes are true but for AX, there is an extra code: 66
Also i used same code in Delphi. And disassemblied. Same result.
What is wrong? Are the documents wrong? Or compilers are wrong?
(Also this is same in ADD instruction)
Thanks in advance.