Output object code required by software interrupt.
A code for returning with RETB is generated with the target function definition used as a software interrupt handler. |
The interrupt handler definition is output to the .text section in the same way as normal function definitions. The section name can be changed through #pragma section. |
The specification becomes __near forcibly, regardless of whether __far is specified explicitly or implicitly. |
The interrupt specifications can include the following.
For details of register saving during interrupt processing or the stack frame, see "9.1 Function Call Interface". |
If the same item is written more than once at the same time, a compilation error will occur.
"#pragma interrupt_brk" generates a vector table. Therefore, if a vector table is defined through Section definition directives in the assembly language (for example, in the startup routine), a linkage error will occur.
Use the .VECTOR directive to write a vector table in the assembly language instead of using the section definition directive.
If an interrupt handler is called in the same way as a normal function, a compilation error will occur. |
The parameters and return value of an interrupt handler should be declared as void (e.g., void func (void);). |
If no register is used or no function is called in an interrupt handler, a register bank switching instruction is not output even though register bank switching has been specified by "#pragma interrupt". |
The output program is the same as that when #pragma interrupt is specified, except that the interrupt source is BRK and RETB is used in the code for returning.
Therefore, the following shows an example when there is no function call in the interrupt handler.
#pragma interrupt_brk inter void __near inter ( void ) { /*Interrupt processing (only AX, HL, and ES are used)*/ } |