summaryrefslogtreecommitdiff
path: root/interrupts.asm.m4
diff options
context:
space:
mode:
authorAstrid Smith2011-10-20 22:30:09 -0700
committerAstrid Smith2011-10-20 22:30:09 -0700
commitf7e1599919eeabb8abf6f3402a0626300df5d4e7 (patch)
tree678c89c4d4834faae3bece15653509bfbeb7f493 /interrupts.asm.m4
parent7540086d5b75a52d8af9dfa697b45160c010d023 (diff)
Interrupts and documentation changes
Diffstat (limited to 'interrupts.asm.m4')
-rw-r--r--interrupts.asm.m417
1 files changed, 10 insertions, 7 deletions
diff --git a/interrupts.asm.m4 b/interrupts.asm.m4
index 404f02f..7b4e522 100644
--- a/interrupts.asm.m4
+++ b/interrupts.asm.m4
@@ -1,7 +1,7 @@
-;;; interrupt handling code
+;;; interrupt handling code, in -*- asm -*-
;; Current interrupt mode. IM 1 and friends will modify
- ;; this, it can be any of 0, 1, 2.
+ ;; this. It can be any of 0, 1, 2.
int_mode: dc.b 0
;; 0 if the emulated device doesn't want interrupts.
@@ -24,18 +24,20 @@ int_enabled: dc.b 1
;; This emulator, on the other hand, will fetch the immediate
;; argument from the JP instruction in the shim, and then
;; dance off into la-la land.
-int_opcode: dc.b 0
+int0_opcode: dc.b 0
dc.b $c3 ; JP immed.w
-int_return: dc.w 0 ; the destination address
+int0_return: dc.w 0 ; the destination address
;; This is the interrupt routine. It can come at any point
;; during an instruction, though routines that use a5 (e.g. by
- ;; calling C subroutines) will have to turn off interrupts.
+ ;; calling C subroutines) will have to turn off or hold
+ ;; interrupts.
+ ;;
;; Routines that call into TIOS will have to remove this
;; interrupt handler.
int_handler:
- sub.l #4,a5
+ sub.l #INT_OFFSET,a5
rte
@@ -67,9 +69,10 @@ do_interrupt:
;; IM 0: A byte is placed on the bus and executed as if it
;; were inline in the program. This emulator will put that
- ;; byte into int_opcode and set epc (or int_jump) to point
+ ;; byte into int0_opcode and set epc (or int_jump) to point
;; there.
int_do_mode0:
+ move epc,int0_opcode
rts
;; This routine emulates a mode 1 interrupt.