;----------------------------------------------------------------- ; EX82.ASM Responding to the DECE External Interrupt ExtInt. ; ; C.P. Diduch, 2001 ; ; This program assumes responds to the external interrupt, ExtInt ; of the DECE-I microcomputer. Each interrupt request branches ; control to an interrupt handler where LED's connected to ; port-3 are toggled. ; ; Author(s): ; Signature(s): Date: ;----------------------------------------------------------------- ; MAIN PROGRAM ; void main(void) { ; .ORG 0x8000 ; "assign the following to ROM" ; ADD R1, NULL, NULL ; R1 = 0 ; ADDL R0, NULL, IH ; "initialize interrupt vector" STOREM 0, R0 ; ADDL R0, NULL, 0x00F8 ; "write Interrupt Controller STOREP 0x001A, R0 ; Control Word to clear all ; Irq's and unmask ExtInt" ORL# FL, FL, 0x0040 ; "set DECE IF" ; do { M0: JMP M0 ; } ;----------------------------------------------------------------- ; void interrupt IH(void) ; ; Each time the interrupt handler, IH, is invoked it ; toggles the state of LED-15 and LED-0 at output port-3. ; IH: ; void interrupt IH(void) { ; XORL R1, R1, 0x8001 ; R1 = R1 ^ 0x8001; STOREP 0x0003, R1 ; outport(3, R2) ; ; ADDL R0, NULL, 0x0088 ; "write Interrupt Controller STOREP 0x001A, R0 ; Control Word to clear ; IrqExt at Interrupt Controller ; with IrqExt unmasked" RETI ; } ;-----------------------------------------------------------------