Chapter 5 Notes on Debugging
Page 5-9
application program's handler.
unsigned Install_Handler (unsigned *location, unsigned address)
{
unsigned vec, oldvec;
oldvec = *location;
*location = address;
return (oldvec);
}
The return value provides the IRQ handler entry address before calling this function.
Near the beginning of the main() function, place the following code for installing the
application program's IRQ handler.
unsigned *irqadder = (unsigned *) 0x38;
angelHandlerEntry = Install_Handler(irqadder, (unsigned)IRQ_Handler);
IRQ_handler is the entry address for the application program's IRQ handler.
This chain allows the application program's IRQ handler to pass all exceptions that it does
not know how to handle to the Angel debugging monitor's IRQ handler with the following
procedure.
(1) Save registers.
(2) Call the application program's IRQ handler.
(3) Restore registers.
(4) If the application program does not know how to handle the interrupt, branch to the
Angel debugging monitor's IRQ handler.
(5) Otherwise, return from the application program's IRQ handler.
Do not, however, use __irq inside the IRQ handler.
See also 5. below for a description of the Angel debugging monitor exception vector table.
Содержание ML670100
Страница 16: ...Chapter 1 Read Me First Page 1 12...
Страница 79: ...Chapter 4 User Interface Page4 12...
Страница 91: ...Chapter 5 Notes on Debugging Page 5 12...
Страница 92: ...Chapter 6 Appendices...