Untitled
unknown
plain_text
7 months ago
839 B
6
Indexable
Never
$MOD842 y: mov A,#0 mov R7, #10H mov R5, #60H mov R6, #30H x: call DELAY inc A cjne A,#0AH, x mov A, #0 inc R7 cjne R7, #16h, x mov R7, #10H inc R5 cjne R5,#6AH, x mov R5,#60H inc R6 cjne R6,#36H, x mov R6,#30H jmp y DELAY: ; Delays by ms 10* A ; 10mSec based on 2.094MHZ ; Core Clock ; i.e. default ADuC842 Clock MOV R1,#0FFH ; Acc holds delay variable (1 clock) DLY0: MOV R2,#0FH ; Set up delay loop0 (2 clocks) DLY1: MOV R3,#0FH ; Set up delay loop1 (2 clocks) call wysw DJNZ R3,$ ; Dec R3 & Jump here until R3 is 0 (3 clocks) DJNZ R2,DLY1 ; Dec R2 & Jump DLY1 until R2 is 0 (3 clocks) DJNZ R1,DLY0 ; Dec R1 & Jump DLY0 until R1 is 0 (3 clocks) RET AAAA: mov R0, #100 DJNZ R0, $ RET wysw: MOV P2, A CALL AAAA MOV P2, R7 CALL AAAA MOV P2, R5 CALL AAAA MOV P2, R6 RET end
Leave a Comment