; bcd up/down counters
ORG 0H
SJMP 30H
ORG 30H
MOV A,#00
UP: MOV P0,A
ACALL DELAY
ADD A, #01
DA A
CJNE A,#100,UP
DOWN: MOV P0,A
ACALL DELAY
ADD A,#99h
DA A
CJNE A,#0,DOWN
SJMP UP
DELAY: MOV r1,#0FFH
DECR1: MOV r2,#0FFH
DECR: MOV r3,#0FFH
DJNZ r3,$
DJNZ r2,DECR
RET
END
Related topics:
8051 Program - up counter 8bit | 8051 Program - down counter 8bit | 8051 Program - bcd up counter 8bit | 8051 Program - bcd down counter 8bit | 8051 Program - hex up and down counters | 8051 Program - memory subroutines | 8051 Program - math subroutines | 8051 Program - conversion subroutines
List of topics: 8051
No comments:
Post a Comment