Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. .ORIG x3000
  2.  
  3. LEA R1,Isr
  4. STI R1,Intrpt
  5. LD R6,STACKB ; initialize stack pointer
  6. LEA R1,EBit
  7. STI R1,KBSR
  8.  
  9. InfLoop AND R1,R1,#0 ; make sure it's infinitely cleared
  10. BR InfLoop
  11.  
  12. Isr
  13. AND R0, R0, #0 ; Save R7 (return location)
  14. ADD R0, R7, #0
  15. JSR PUSH
  16. AND R0, R0, #0 ; Save R5 (frame pointer)
  17. ADD R0, R5, #0
  18. JSR PUSH
  19. AND R0, R0, #0 ; Save R1
  20. ADD R0, R1, #0
  21. JSR PUSH
  22.  
  23. Monitr LDI R1, DSR ;polling monitor
  24. BRzp Monitr
  25. STI R0,DDR
  26.  
  27. JSR POP ; Restore R1
  28. ADD R1,R0,#0
  29. JSR POP ; Restore R5
  30. ADD R5,R0,#0
  31. JSR POP ; Restore R7
  32. ADD R7,R0,#0
  33.  
  34. RTI
  35.  
  36. ;------------------------
  37. PUSH ADD R6,R6,#-1
  38. STR R0,R6,#0
  39. RET
  40. ;------------------------
  41.  
  42. ;------------------------
  43. POP LDR R0,R6,#0
  44. ADD R6,R6,#1
  45. RET
  46. ;------------------------
  47.  
  48. halt
  49.  
  50. STACKB .FILL 0xFD00 ;stack
  51. Intrpt .FILL 0x0180 ; interrupt location
  52. EBit .FILL 0x4000 ;enable bit for kbsr
  53. DSR .FILL xFE04 ;display
  54. DDR .FILL xFE06 ;display
  55. KBSR .FILL xFE00 ;keyboard
  56. KBDR .FILL xFE02 ;keyboard
  57.  
  58. .end
  59.  
  60. ;Keybrd LDI R1,KBSR ;polling keyboard
  61. ; BRZP Keybrd
  62. ; LDI R0,KBDR
  63. ; BR Next1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement