Specifications

Event Multitasking - 2
There are a few exceptions. The INPUT and INPUT KEYPAD$ statements will ignore interrupts until the input is
received. The DELAY statement will prevent a response to an interrupt until the delay period. If the serial output buffer
becomes full, and there are still more characters to put in the buffer, interrupts will not be serviced until all the characters
are in the buffer.
Interrupt Priorities
CAMBASIC does not have an interrupt priority scheme. However, you can lock out a response to an interrupt for critical
program segments with the ITROFF command.
CAMBASIC allows nesting of interrupts. That means an interrupt service routine can interrupt another interrupt service
routine. If there are two interrupt routines, A and B, and A has partly executed when B interrupts, B will execute to
conclusion and then A will finish. Thus, the routine that occurred last, in effect, has the highest priority.
Since the sequence of the incoming data must be preserved, ON COM$ interrupts are internally stacked in CAMBASIC,
such that each ON COM$ interrupt will be handled in its entirety before the next one occurs. Other types of interrupts,
such as ON TICK, can be nested inside an ON COM$ interrupt.
Event Multitasking does not have a priority system.
COM$ TASKING
ON COM$ defines a program branch when a task defined by the CONFIG COM$ statement becomes valid. The syntax is:
ON COM$ channel GOSUB line or label
ON COM$ channel GOSUB
After defining all the parameters with CONFIG COM$ the ON COM$ activates the task. You can deactivate the task by
executing the same statement but without a line number after GOSUB.
Channel 1 is COM1 and Channel 2 is COM2.
COM$ Example:
In the following example, the program will branch when 8 characters have been received. The XON and protocol functions
are disabled. All characters will be echoed.
10 CONFIG COM$ 1,0,8,0,1
20 ON COM$ 1 GOSUB 80
30 ..your program goes here
.
.
80 PRINT COM$(1)
90 RETURN
NOTE: If a serial reception error occurs, the program will branch to line 80 regardless of the number of
characters received. You can use the SYS(6) or SYS(7) function to determine the cause of the error.
COUNT MULTITASKING
Introduction
CAMBASIC supports eight event counters. These are generated in software and are intended for low–speed counting.