AngoLinux

80386 Programmer's Reference Manual -- Opcode ADC


ADC -- Add with Carry

OpcodeInstructionClocks DescriptionExample
14 ibadcb imm8,al2 Add with carry immediate byte to ALadcb $0x7f,%al
15 iwadcw imm16,ax2 Add with carry immediate word to AXadcw $0x7fff,%ax
15 idadcl imm32,eax2 Add with carry immediate dword to EAXadcl $0x7fffffff,%eax
80 /2 ibadcb imm8,r/m82/7 Add with carry immediate byte to r/m byteadcb $0x7f,%dl
adcb $0x7f,(%ebx,1)
adcb $0x7f,m8(%ebx,1)
adcb $0x7f,m8(%ebx,%ebp,1)
81 /2 iwadcw imm16,r/m162/7 Add with carry immediate word to r/m wordadcw $0x7fff,%cx
adcw $0x7fff,(%ebx,1)
adcw $0x7fff,(%ebx,2)
adcw $0x7fff,(%ebx,%ebp,1)
81 /2 idadcl imm32,r/m322/7 Add with CF immediate dword to r/m dwordadcl $0x7fffffff,%ecx
adcl $0x7fffffff,(%ebx,2)
adcl $0x7fffffff,(%ebx,4)
adcl $0x7fffffff,(%ebx,%ebp,1)
83 /2 ibadcw imm8,r/m162/7 Add with CF sign-extended immediate byte to r/m wordadcw $0x7f,%cx
adcw $0x7f,(%ebx,1)
adcw $0x7f,(%ebx,2)
adcw $0x7f,(%ebx,%ebp,1)
83 /2 ibadcl imm8,r/m322/7 Add with CF sign-extended immediate byte into r/m dwordadcl $0x7f,%ecx
adcl $0x7f,(%ebx,2)
adcl $0x7f,(%ebx,4)
adcl $0x7f,(%ebx,%ebp,1)
10 /radcb r8,r/m82/7 Add with carry byte register to r/m byteadcb %bh,%dl
adcb %bh,(%ebx,1)
adcb %bh,m8(%ebx,1)
adcb %bh,m8(%ebx,%ebp,1)
11 /radcw r16,r/m162/7 Add with carry word register to r/m wordadcw %bx,%cx
adcw %bx,(%ebx,1)
adcw %bx,(%ebx,2)
adcw %bx,(%ebx,%ebp,1)
11 /radcl r32,r/m322/7 Add with CF dword register to r/m dwordadcl %ebx,%ecx
adcl %ebx,(%ebx,2)
adcl %ebx,(%ebx,4)
adcl %ebx,(%ebx,%ebp,1)
12 /radcb r/m8,r82/6 Add with carry r/m byte to byte registeradcb %dl,%bh
adcb (%ebx,1),%bh
adcb m8(%ebx,1),%bh
adcb m8(%ebx,%ebp,1),%bh
13 /radcw r/m16,r162/6 Add with carry r/m word to word registeradcw %cx,%bx
adcw (%ebx,1),%bx
adcw (%ebx,2),%bx
adcw (%ebx,%ebp,1),%bx
13 /radcl r/m32,r322/6 Add with CF r/m dword to dword registeradcl %ecx,%ebx
adcl (%ebx,2),%ebx
adcl (%ebx,4),%ebx
adcl (%ebx,%ebp,1),%ebx

Operation




DEST := DEST + SRC + CF;

Description

ADC performs an integer addition of the two operands DEST and SRC and the carry flag, CF. The result of the addition is assigned to the first operand (DEST), and the flags are set accordingly. ADC is usually executed as part of a multi-byte or multi-word addition operation. When an immediate byte value is added to a word or doubleword operand, the immediate value is first 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) if 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]