Circuit Diagram:
Assembly Language Program:
ORG 0000H
ROW:MOV p2, #0FH ;C+4R = R1+4R0
JB p2.0, NEXT
MOV R0,#00H
AJMP COLUMN
NEXT:
JB p2.1, NEXT1
MOV R0,#01H
AJMP COLUMN
NEXT1:
JB p2.2, NEXT2
MOV R0,#02H
AJMP COLUMN
NEXT2:
JB p2.3, ROW
MOV R0,#03H
COLUMN:
MOV p2, #0F0H
JB p2.4, NEXT3
MOV R1,#00H
AJMP DISPLAY
NEXT3:
JB p2.5, NEXT4
MOV R1,#01H
AJMP DISPLAY
NEXT4:
JB p2.6, NEXT5
MOV R1,#02H
AJMP DISPLAY
NEXT5:
JB p2.7, ROW
MOV R1,#03H
DISPLAY:
MOV A, R0
RL A
RL A
ADD A, R1
ACALL CONVERT
MOV P1, A
AJMP ROW
CONVERT:
INC A
MOVC A, @A+PC
RET
DB 00111111B
DB 00000110B
DB 01011011B
DB 01001111B
DB 01100110B
DB 01101101B
DB 01111101B
DB 00000111B
DB 01111111B
DB 01101111B
DB 01110111B
DB 01111100B
DB 00111001B
DB 01011110B
DB 01111001B
DB 01110001B
END
No comments:
Post a Comment