You are on page 1of 7

P0(8bytes)=P0.1 to P0.

7=0 or 1
P1(8bytes)=8 bits=8 ports =P1.0 to P1.8=0 or 1 on each port
P2=

CJNE:
Org 0x0
Mov R0,#02H
Mov R1,#02H
Cjne R0,R1,label
Jmp end_code
Label:
Setb p1.0
End_code:
End
DATA POINTER:
Org 0000H (ye address jo likha va 000H ye rom address hai…code
stores in ROM and runs/execute In RAM)
Mov DPTR,#sabahat
Mov R0,#2
Mov A,R0
Movc A,@A+DPTR
Jmp here

Org 1000H
Sabahat:db 63H, 100H, 5H
End

SWAP:
mov R0,#11110000B
mov A,R0
SWAP A
A=00001111B
1111 0000
Upper niblle lower nibble

0000 1111
Masking:
As the name suggests this process masks/hides one nibble either upper
or lower and gives up our required nibble which can be upper nibble or
nibble
CODE EXAMPLE:
org 0x0
Mov R1,#1100 0101B
Mov R2,#0000 1111B
Mov A,R1
Anl A,R2
End

Code explanation:
A=0101B
 //(ANL COMMAND DOES AND OPERATION BASICALLY)
1100 0101
0000 1111
0000 0101
 In anl command the desination is always A.
//AC =PSW.6
//CARRY FLAG=PSW.7
DECIMAL ADJUSTMENT:
Org 0x0
Mov A,#15
Mov B,#16
Add A,B
Mov R0,A
Jb PSW.6, label
Jb PSW.7,label_2
Label:
Mov A,R0
Mov R1,#00001111B
Anl A,R1
Mov R2,A
Add R2,#6
Jmp $
Label_2:
Mov A,R3
Mov R4,#1111000B
Anl A,R4
Mov R5,A
Add R5,#6
Jmp end_code

End_code:
End

CONDITION FOR DECIMAL ADJUSTMENT:

You might also like