Microprocessor Class 18
Microprocessor Class 18
PART 18
SIBIN K
● ADD A, 20H
● ADD A, @R0 ; add contents of A and memory whose address is given by register R2,
● ADD A, #20H
ADDC – Add with carry
If A holds 89H (10001001)and R0 holds 95H (10010101) with the carry flag set.
● ADDC A,R0 ; the result is 1FH in the accumulator with both the carry flag and the
● ADDC A, 20H
● ADDC A, @R0
● ADDC A, #20H
● SUBB A, R3 ; subtracts the contents of R3 and carry together from A and store result
in A
● SUBB A, 20H
● SUBB A, @R2
● SUBB A, #20H
● MUL AB ; multiplies the unsigned 8-bit intigers in the accumulator and register B. the
low-order byte of the 16-bit product is left in the accumulator, and high- order byte in
B. if the product is greater than 255 (FFH) the overflow flag is set; otherwise it is
cleared.
● DIV AB ; it divides the unsigned 8bit intiger in the A by the unsigned 8bit intiger in
register B. the Accumulator receives the intiger part of the quotient; register B
● Suppose A holds the value 55H, R3 contains 68H, carry flag is set to 1.
ADDC A, R3
DA A
● INC A ; The contents of A register is incremented by 1
● INC R2
● INC 20H
● INC @R2
● INC DPTR ;
● DEC A ; decrements the content of A by one
● DEC R3
● DEC 20H
● DEC @R2 ; Decrements the contents of memory location whose address is given by
register R2 by 1
Branching instructions
● Jumps
Jumps alter the program flow by replacing the PC contents with the address of the jump
address. There are 3 types of jump instructions. They are:-
● 1. Relative Jump ; jumps upto PC + 127 bytes, PC – 128 bytes away from the PC
JNZ rel
● Jump if accumulator is not zero
● JC rel ; jump if carry is set
LCALL addr16 ;
● Long call
● LCALL unconditionally calls a subroutine located at the absolute long address.
RET
● Return from sub routine
● Return to anywhere in the program at the address found on the top two bytes of the
stack
RETI
● Return from interrupt
● Return from a routine called by a hardware interrupt and reset the interrupt logic
Thank you