


#var AUTO_INT_COUNT D((LAST_AUTO_INT-FIRST_AUTO_INT+1))
#var FIRST_AUTO_INT D(1)
#var FIRST_TRAP D(0)
#var LAST_AUTO_INT D(7)
#var LAST_TRAP D(15)
#var TRAP_COUNT D((LAST_TRAP-FIRST_TRAP+1))
#var AutoInts D(IntVecs)
#var FALSE D(0)
#var TRUE D(1)

#var _DEREF_INT_HANDLER typedef struct{short foo;}_DEREF_INT_HANDLER;
#var INT_HANDLER typedef _DEREF_INT_HANDLER *INT_HANDLER;
#var AUTO_INT_1 D(100)
#var AUTO_INT_2 D(104)
#var AUTO_INT_3 D(108)
#var AUTO_INT_4 D(112)
#var AUTO_INT_5 D(116)
#var AUTO_INT_6 D(120)
#var AUTO_INT_7 D(124)
#var TRAP_0 D(128)
#var TRAP_1 D(132)
#var TRAP_2 D(136)
#var TRAP_3 D(140)
#var TRAP_4 D(144)
#var TRAP_5 D(148)
#var TRAP_6 D(152)
#var TRAP_7 D(156)
#var TRAP_8 D(160)
#var TRAP_9 D(164)
#var TRAP_10 D(168)
#var TRAP_11 D(172)
#var TRAP_12 D(176)
#var TRAP_13 D(180)
#var TRAP_14 D(184)
#var TRAP_15 D(188)
#var INT_VEC_RESET D(4)
#var INT_VEC_BUS_ERROR D(8)
#var INT_VEC_ADDRESS_ERROR D(12)
#var INT_VEC_ILLEGAL_INSTRUCTION D(16)
#var INT_VEC_ZERO_DIVIDE D(20)
#var INT_VEC_CHK_INS D(24)
#var INT_VEC_TRAPV_INS D(28)
#var INT_VEC_PRIVILEGE_VIOLATION D(32)
#var INT_VEC_TRACE D(36)
#var INT_VEC_LINE_1010 D(40)
#var INT_VEC_LINE_1111 D(44)
#var INT_VEC_UNINITIALIZED_INT D(60)
#var INT_VEC_SPURIOUS_INT D(96)
#var INT_VEC_KEY_PRESS D(104)
#var INT_VEC_LINK D(112)
#var INT_VEC_ON_KEY_PRESS D(120)
#var INT_VEC_STACK_OVERFLOW D(124)
#var INT_VEC_INT_MASK D(132)
#var INT_VEC_MANUAL_RESET D(136)
#var INT_VEC_OFF D(144)
#var INT_VEC_SELF_TEST D(168)
#var INT_VEC_ARCHIVE D(172)
#var INT_VEC_ER_THROW D(188)

#var AUTO_INT(IntNo) D(((long)(IntNo)*4+0x60))
#var DisableAutoInt3() D((pokeIO_bclr(0x600015,2)))
#var DUMMY_HANDLER D(((INT_HANDLER)(__dummy_handler__)))
#var __dummy_handler__ void __dummy_handler__();
#var EnableAutoInt3() D((pokeIO_bset(0x600015,2)))
#var ExecuteHandler void _(INT_HANDLER h)__ATTR_TIOS__;asm{ExecuteHandler:move.l 4(a7),a0;move.w sr,-(a7);jmp (a0)};
#var GetIntVec(i) D((*(INT_HANDLER*)(i)))
#var SetIntVec(i,h) D(((void)(pokeIO_bclr(0x600001,2),*(INT_HANDLER*)(i)=(h),pokeIO_bset(0x600001,2))))
#var TRAP(TrapNo) D(((long)(TrapNo)*4+0x80))
#var DEFINE_INT_HANDLER(name) D(extern _DEREF_INT_HANDLER name[]; asm{name: move.w #0x2700,sr;movem.l d0-d7/a0-a6,-(sp);move.l 0xC8,a5;jsr __##name##_body__;movem.l (sp)+,d0-d7/a0-a6;rte}; void __##name##_body__(void))

