Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $mod52
- JMP start
- org 03h ;INT0 interruption
- LJMP i0int
- org 0Bh ;Timer0 Interrupt
- LJMP t0int
- org 015h
- start:
- ;Setting default positions
- MOV A, #0Fh
- MOV R0, #24
- MOV P1, A
- ;Setting interruption modes
- SETB EA ;enable all
- SETB ET0 ;enable timer 0 int
- SETB EX0 ;enable int0 int
- SETB IE0 ;set IE0 to 1 = no interupt right now
- ;Setting timer0 up
- MOV TH0, #0h ;set timer high to 0
- MOV TL0, #0h ;set timer low to 0
- MOV TMOD, #0Ah ;run timer in 1 byte mode
- SETB TR0 ;run timer
- finish:
- JMP finish
- ;Timer0 interruption procedure
- t0int:
- DJNZ R0, intEnd
- MOV R0, #24
- RR A
- MOV P1, A
- intEnd:
- RETI
- ;INT0 interruption
- i0int:
- MOV P1, #055h
- RETI
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement