I/O Handling 153 Additional Pre-Defined Symbols Isr _flag and Isr _psw are pre-defined symbols in the assembler. Also pre-defined are two other symbols used by the assembler - End _isr _low and End _isr _high. These symbols may not be redefined. Prioritizing ON INT Branches Since more than one interrupt may occur while a single BASIC statement is executing, it is possible that by the time the line finishes there may be a number of ON INT branches waiting to be executed. In such situations you may want to assure that some ON INT branches are taken before others, or that you finish one routine (caused by an ON INT GOSUB or ON INT CALL) before you start another.
This can be achieved by using the {priority} option of the ON INT statement, thereby "prioritizing" the branching caused by interrupts.! There is a "system priority" for ordering this interrupt branching. For an ON INT to be honored at the end of a BASIC line, its priority must be greater than the current system priority. Initially, the system priority is set to O. When a BASIC line finishes, and there is at least one ON INT branch pending which is greater than the system priority, then the system takes the branch any integer numeric expression from 1 to 15. If {priority} is omitted,.} is assumed. associated with the ON INTwith the greatest {priority}.
The values assigned to {priority} may be If the ON INT branch to be executed is a GOTO, then the system priority level is unchanged. But if the branch to be executed is a GOSUB or a CALL, then the system priority level is executing, then the previous system priority level is restored. changed to the priority level of the ON INT. Whenever the subroutine or subprogram is finished Thus, with the GOSUB and CALL versions, there are two effects involving priorities - The subroutine or subprogram is not allowed to execute until its priority is the highest one pending .
Whenever the subroutine or subprogram is executing, it locks out any other interrupting branches unless they have a higher priority. I 1 This "prioritizing" also holds between the various types of end-of-Iine branch statements that have the priority parameter. Thus an ON KEY with high priority is executed before an ON INT with low priority.