Fortune Telling Collection - Comprehensive fortune-telling - What is the difference between addition and addition with carry (ADC) in assembly language?

What is the difference between addition and addition with carry (ADC) in assembly language?

The biggest difference between addition and addition with carry (ADC) is that ADC not only needs to complete the addition instruction operation, but also needs to add with the carry flag bit to get the final calculation result.

The function of addition is to add two operands, and the result is sent to the destination operand, and the source operand remains unchanged. Two operands cannot be in memory addressing mode at the same time.

Add with carry (ADC) instruction is mainly used for the combination of multi-byte number and add instruction. The requirements for operands are the same as those for addition instructions. The operation result has an influence on PSW (program status word).

There are four addressing modes: immediate addressing, direct addressing, register addressing and register indirect addressing.

Extended data

Logical operation instruction:

These instructions are used to perform arithmetic and logical operations, including addition instruction ADD/ADC, subtraction instruction SUB/SBB, plus one instruction INC and minus one instruction DEC;;

Comparing operation instruction CMP, multiplication instruction MUL/IMUL and division instruction DIV/IDIV;;

Sign extension instruction CBW/CWDE/CDQE, decimal adjustment instruction DAA/DAS/AAA/AAS, logical operation NOT/AND/OR/XOR/TEST, etc.

Baidu Encyclopedia-Add Description