; Filename: exceptions.s ; Author: ECE 353 student ; Description: exception handlers EXPORT Undef_Handler EXPORT SWI_Handler EXPORT PAbt_Handler EXPORT DAbt_Handler EXPORT IRQ_Handler EXPORT FIQ_Handler IMPORT Globals IMPORT DisplayPrompt INCLUDE aduc7026.inc AREA FLASH, CODE, READONLY ARM ; dummy handlers for interrupts here Undef_Handler MOVS PC, LR SWI_Handler MOVS PC, LR PAbt_Handler SUBS PC, LR, #4 DAbt_Handler SUBS PC, LR, #8 IRQ_Handler PUSH {R1,R7,LR} ;; Store context ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LDR R7, =(UART_MMR_BASE) LDR R1, [R7,#COMRX] ;; read incoming byte CMP R1, #0x0D BLEQ DisplayPrompt STRNE R1, [R7,#COMTX] ;; echo to screen ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; POP {R1,R7,LR} ;; restore context SUBS PC, LR, #4 ;; return from interrupt FIQ_Handler SUBS PC, LR, #4 END