|
ADD -- Add
Opcode | Instruction | Clocks |
Description | Example |
04 ib | addb imm8,al | 2 |
Add immediate byte to AL | addb $0x7f,%al |
05 iw | addw imm16,ax | 2 |
Add immediate word to AX | addw $0x7fff,%ax |
05 id | addl imm32,eax | 2 |
Add immediate dword to EAX | addl $0x7fffffff,%eax |
80 /0 ib | addb imm8,r/m8 | 2/7 |
Add immediate byte to r/m byte | addb $0x7f,%dl
addb $0x7f,(%ebx,1)
addb $0x7f,m8(%ebx,1)
addb $0x7f,m8(%ebx,%ebp,1) |
81 /0 iw | addw imm16,r/m16 | 2/7 |
Add immediate word to r/m word | addw $0x7fff,%cx
addw $0x7fff,(%ebx,1)
addw $0x7fff,(%ebx,2)
addw $0x7fff,(%ebx,%ebp,1) |
81 /0 id | addl imm32,r/m32 | 2/7 |
Add immediate dword to r/m dword | addl $0x7fffffff,%ecx
addl $0x7fffffff,(%ebx,2)
addl $0x7fffffff,(%ebx,4)
addl $0x7fffffff,(%ebx,%ebp,1) |
83 /0 ib | addw imm8,r/m16 | 2/7 |
Add sign-extended immediate byte to r/m word | addw $0x7f,%cx
addw $0x7f,(%ebx,1)
addw $0x7f,(%ebx,2)
addw $0x7f,(%ebx,%ebp,1) |
83 /0 ib | addl imm8,r/m32 | 2/7 |
Add sign-extended immediate byte to r/m dword | addl $0x7f,%ecx
addl $0x7f,(%ebx,2)
addl $0x7f,(%ebx,4)
addl $0x7f,(%ebx,%ebp,1) |
00 /r | addb r8,r/m8 | 2/7 |
Add byte register to r/m byte | addb %bh,%dl
addb %bh,(%ebx,1)
addb %bh,m8(%ebx,1)
addb %bh,m8(%ebx,%ebp,1) |
01 /r | addw r16,r/m16 | 2/7 |
Add word register to r/m word | addw %bx,%cx
addw %bx,(%ebx,1)
addw %bx,(%ebx,2)
addw %bx,(%ebx,%ebp,1) |
01 /r | addl r32,r/m32 | 2/7 |
Add dword register to r/m dword | addl %ebx,%ecx
addl %ebx,(%ebx,2)
addl %ebx,(%ebx,4)
addl %ebx,(%ebx,%ebp,1) |
02 /r | addb r/m8,r8 | 2/6 |
Add r/m byte to byte register | addb %dl,%bh
addb (%ebx,1),%bh
addb m8(%ebx,1),%bh
addb m8(%ebx,%ebp,1),%bh |
03 /r | addw r/m16,r16 | 2/6 |
Add r/m word to word register | addw %cx,%bx
addw (%ebx,1),%bx
addw (%ebx,2),%bx
addw (%ebx,%ebp,1),%bx |
03 /r | addl r/m32,r32 | 2/6 |
Add r/m dword to dword register | addl %ecx,%ebx
addl (%ebx,2),%ebx
addl (%ebx,4),%ebx
addl (%ebx,%ebp,1),%ebx |
Operation
DEST := DEST + SRC;
Description
ADD performs an integer addition of the two operands (DEST and SRC). The result of the addition is assigned to the first operand (DEST), and the flags are set accordingly.
When an immediate byte is added to a word or doubleword operand, the immediate value is sign-extended to the size of the word or doubleword operand.
Flags Affected
OF, SF, ZF, AF, CF, and PF as described in Appendix C
Protected Mode Exceptions
#GP(0) if the result is in a nonwritable segment; #GP(0) for an illegal memory operand effective address in the CS, DS, ES, FS, or GS segments; #SS(0) for an illegal address in the SS segment; #PF(fault-code) for a page fault
Real Address Mode Exceptions
Interrupt 13 if any part of the operand would lie outside of the effective address space from 0 to 0FFFFH
Virtual 8086 Mode Exceptions
Same exceptions as in Real Address Mode; #PF(fault-code) for a page fault
[Home Page dell'ITIS "Fermi"]
[80386 Programmer's Reference Manual Index]
[Previous]
[Next]
|