The ADD instruction tells the microcontroller’s CPU to add the source byte to register A and put the result in register A. Recall, A is the accumulator register typically used for all arithmetic and logic instructions.
The ADD instruction is usually in the following form:
ADD A, source ; ADD the source operand to the accumulator
The source operand can be either a register or immediate data, but the destination register must always be register A.
Example of ADD instruction:
MOV A, #23H ; load 23H i.e. in hexadecimal into register A
MOV R2, #28H ; load 28H into register R2
ADD A, R2 ; add contents of R2 to A thus, A = A + R2
The following instructions aren’t allowed:
ADD R2, A ; Not allowed as A must always be the destination register
ADD R2, #25 ; Not allowed as destination register is not A
You may also read:
The world of electronics is constantly evolving, allowing designers and manufacturers to push the boundaries…
PIC microcontrollers are fabricated by Microchip Technology. PIC16C84 and PIC16F84 are the two microcontrollers in…
8-bit microprocessors are limited in their speed (the number of instructions that can be executed…
The 68HC11 (also abbreviated as 6811 or HC11) is an 8-bit microcontroller that was introduced…
Mutual exclusion typically imposes some conditions on access to a given resource by two or…
In envisaging a new microcontroller design, it is prudent to follow a design procedure that…