Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $MOD52
- ; tu zaczynam
- start:
- MOV R5, #00001001B
- et:
- MOV P2, R5
- CALL DELAY
- DEC R5
- CJNE R5, #0b, et
- MOV R6, #00011001B
- ety:
- MOV P2, R6
- CALL DELAY
- DEC R6
- CJNE R6, #00010000B, ety
- JMP start
- ;____________________________________________________________________
- ; SUBROUTINES
- DELAY:
- ; Delays by ms 10* A
- ; 10mSec based on 2.094MHZ
- ; Core Clock
- ; i.e. default ADuC842 Clock
- MOV R1,#01b ; Acc holds delay variable (1 clock)
- DLY0: MOV R2,#04Ah ; Set up delay loop0 (2 clocks)
- DLY1: MOV R3,#00Ah ; Set up delay loop1 (2 clocks)
- 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 ; Return from subroutine
- ;____________________________________________________________________
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement