Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ti83plus.inc"
- .org $9d93
- Start:
- ; Clear the screen
- bcall(_ClrLCDFull)
- ; Install interrupt for the counter
- di ; Disable interrupts while installing
- ld a, $9a ; Fill $9900 to $9A00 with $9a
- ld ($9900), a ; ^
- ld hl, $9900 ; ^
- ld de, $9901 ; ^
- ld bc, 256 ; ^
- ldir ; ^
- ld a, $99 ; Set the interrupt HSB to $99
- ld i, a ; ^
- ld hl,9a9ah
- ld (hl),Interrupt
- im 2 ; Set interrupt mode 2
- ei ; Re-enable interrupts
- ; do stuff
- im 1
- ret
- d_tick:
- .dw $00
- Interrupt:
- di ; Disable interrupts to prevent interruptception
- ex af, af' ; Swap all registers with their shadow registers
- exx ; so we don't mess up data
- ld hl, (d_tick)
- inc hl
- ld (d_tick), hl
- ex af, af' ; Swap back the registers
- exx ; ^
Advertisement
Add Comment
Please, Sign In to add comment