Guest User

Untitled

a guest
Mar 6th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include "ti83plus.inc"
  2.  
  3.     .org $9a9a
  4. Interrupt:
  5.     di              ; Disable interrupts to prevent interruptception
  6.  
  7.     ex af, af'      ; Swap all registers with their shadow registers
  8.     exx             ;   so we don't mess up data
  9.    
  10.     ld hl, (d_tick)
  11.     inc hl
  12.     ld (d_tick), hl
  13.    
  14.     ex af, af'      ; Swap back the registers
  15.     exx             ; ^
  16.  
  17.     .org $9d93
  18. Start:
  19.     ; Clear the screen
  20.     bcall(_ClrLCDFull)
  21.    
  22.     ; Install interrupt for the counter
  23.     di              ; Disable interrupts while installing
  24.    
  25.     ld a, $9a       ; Fill $9900 to $9A00 with $9a
  26.     ld ($9900), a   ; ^
  27.     ld hl, $9900    ; ^
  28.     ld de, $9901    ; ^
  29.     ld bc, 256      ; ^
  30.     ldir            ; ^
  31.    
  32.     ld a, $99       ; Set the interrupt HSB to $99
  33.     ld i, a         ; ^
  34.    
  35.     im 2            ; Set interrupt mode 2
  36.     ei              ; Re-enable interrupts
  37.    
  38.     ; do stuff
  39.    
  40.     im 1
  41.    
  42.     ret
  43.    
  44. d_tick:
  45.     .dw $00
Advertisement
Add Comment
Please, Sign In to add comment