Saturday, April 30, 2016

8051 Program – logical operation

; logical operation
; AND, OR, NOT and XOR
; register operation
ORG 0H
MOV R1,#20H ;First BYTE
MOV R2,#10H ;Second BYTE
MOV A,R1
ANL A,R2
MOV R0,A;ANDINGR0=R1 AND R2
MOV A,R1
ORL A,R2
MOV R3,A;ORINGR3=R1 OR R2
MOV A,R1
CPL A
MOV R4,A;NEGATIONR4=~R1
MOV A,R1
XRL A,R2
MOV R5,A;XORINGR5=R1 XOR R2
SJMP $
END



Related topics:
8051 Program - parity generation   |   8051 Program - polling an io pin   |   8051 Program - port loopback   |   8051 Program - send ascii to port   |   8051 Program - serializing data   |   8051 Program - simple serial transmission   |   8051 Program - memory subroutines   |   8051 Program - math subroutines   |   8051 Program - conversion subroutines

List of topics: 8051

No comments:

Post a Comment