m2 mca
m2 mca
Indexed addressing:
PC and data pointers are allowed 16 bit address register is this mode of
addressing.
These 16 bit register points the base of the lookup table and accumulator
register contains code to be converted using the looking table.
The lookup table data address is found by adding the contents of accumulator
register with that of PC or data pointer.
In the case of jump instruction the contents of accumulator are added with one
of the specified 16 bit register to form a jump destination address.
T R A N SF E R I N S T R U C TI O N S
Mnemonic Description Byte Cycle
MOV A,Rn Moves the register to the accumulator 1 1
MOV A,direct Moves the direct byte to the accumulator 2 2
MOV A,@Ri Moves the indirect to the accumulator 1 2
MOV A,#data Moves the immediate data to the accumulator 2 2
MOV Rn,A Moves the accumulator to the register 1 2
MOV Rn,direct Moves the direct byte to the register 2 4
MOV Rn,#data Moves the immediate data to the register 2 2
MOV direct,A Moves the accumulator to the direct byte 2 3
MOV direct,Rn Moves the register to the direct byte 2 3
MOV direct,direct Moves the direct byte to the direct byte 3 4
MOV direct,@Ri Moves the indirect to the direct byte 2 4
D ATA T RANSFER I NSTRUCTIONS
SUBB A,direct Subtracts the direct byte from the accumulator with a borrow 2 2
SUBB A,@Ri Subtracts the indirect RAM from the accumulator with a borrow 1 2
SUBB A,#data Subtracts the immediate data from the accumulator with a borrow 2 2
A RITHMETIC I NSTRUCTIONS
DJNZ Rx,rel Decrements direct byte and jump if not 0. Short jump. 3 4
NOP No operation 1 1
L OGIC INSTRUCTION
PROGRAM:
MOV R0,#37h
MOV R1,#59h
MOV R2,#10
MOV @R1,A
INC R0
INC R1
DJNZ R2, L1
P RGRAMING WITH 8051
DJN2 R2, UP
DJN2 R1, UP