Write an assembly language program to design a MOD-10 UP counter to count from 0 to 9 with a one-second delay between each count. At the count of 9, the counter should reset itself to 0 and repeat the sequence continuously. Display each count at the Output Port 02H.
# ORG 8000H
START:
MVI B,00
MOV A,B
DSPLY: OUT 20
CALL DELAY
INR B
MOV A,B
CPI 0A
JNZ DSPLY
JMP START
DELAY:
LXI H,3641H
NEXT: DCX H
MOV A,L
ORA H
JNZ NEXT
RET
Post a Comment
0 Comments