HTBasic Help
×
Menu
Index

ON INTR

Defines a hardware interrupt initiated branch.
 
 ON INTR interface-select-code [,priority] action
 
Usage:
ON INTR 7 GOTO 1000
ON INTR Isc,Priority CALL Sub
ON INTR Gpib,4 GOSUB Repair
 
Example:           ON INTR.BAS
 
Description:
ON INTR defines an event branch to be taken when an interface card generates an interrupt. Execution of an ON INTR statement is not sufficient to allow an interrupt to occur. As a minimum, ENABLE INTR must be executed to establish an interrupt mask. Depending on the interface, additional statements may have to be executed as well. Refer to the device driver documentation for more information.
 
When an interrupt occurs a DISABLE INTR for the interface is automatically executed. Consequently, an ENABLE INTR statement must be used to explicitly re-enable interrupts.
 
There is only one ENABLE INTR mask per interface select code. Executing a new ENABLE INTR while another is still in effect will cause the interface or device to use the new mask value. If the ON INTR is executed in a different program context, the original ON INTR definition is restored when control returns to the calling context. However, the ENABLE INTR mask is not restored.
 
ON INTR is canceled by OFF INTR and disabled by DISABLE or DISABLE INTR. A SUBEXIT, SUBEND or RETURN from the defining subprogram also cancels it.
 
More information about ON INTR can be found under the "Common Information" heading of the ON CYCLE manual entry.
See Also: