SWAP A
ADD C
MUL AB
CJNE A, add, radd
MOV A, R0
MOVX A, @ A + DPTR.
SWAP A
Description: This instruction exchanges bits 0-3 of the Accumulator with bits 4-7 of the
Accumulator. This instruction is identical to executing "RR A" or "RL A four times
Example: MOV A, #59H ; A= 59H
SWAP A ; A= 95H
ADD C
Description: This instruction is used to perform addition of two eight-bit numbers along with
carry. The result is stored in accumulator which is the default destination.
Example: ADDC A, R0 : Add contents of accumulator, R0 and carry .The result is stored in
accumulator.
MUL AB
Description: the multiplicand and the multiplier must be in A and B registers. After
multiplication if the result is 8 bit it will be in the accumulator and if the result is larger than
8 bit ,lower byte of result will be in accumulator and higher byte will be in register B.
Example :MOV A,#10H
MOV B,#02 H
MUL AB
After execution A=20H,B=0 H
CJNE A, add, radd
Description: Compare the contents of the accumulator with the 8 bit data in memory
address mentioned in the instruction and if they are not equal then jump to the relative
address mentioned in the instruction.
Example: CJNE A, 04H, UP: Compare the contents of the accumulator with the contents of
04H memory and if they are not equal then jump to the line of instruction where UP label is
mention
MOV A,R0
Description: this instruction copies the contents of source register R0 into accumulator. The
register R0 remains unaffected.
Example: Before Execution A=43 H, R0=32 H
After execution A=32 H, R0-32H
MOVX A, @ A + DPTR. (Consider it as MOVC A,@A+DPTR)
Description: Copy the contents of code memory pointed by the sum of Accumulator and
DPTR to the Accumulator
MOVC is a move instruction, which moves data from the code memory space. The
address operand in this example is formed by adding the content of the DPTR register to
the accumulator value. Here the DPTR value is referred to as the base address and the
accumulator value is referred to as the index address.