AMX Timing Control
K
A
DAK
73
In this example, the clock ISP pointer (CLKISP) must be installed into vector number 33
in the processor Interrupt Vector Table (IVT). AMX service procedure AAIVTW has been
used in a Restart Procedure for this purpose. When the clock interrupt occurs, the
processor disables the interrupt facility, saves the flags and the return address on the
interrupted task's stack and fetches the ISP pointer from vector 33 in the IVT. The
processor then jumps to the clock ISP at address CLKISP in program memory.
The clock ISP must ensure that the clock keeps running. The manner in which this is
accomplished is, of course, hardware dependent. Sometimes one or more processor
registers will be required in order to access the hardware clock to keep it running. The
ISP must save the registers it requires, keep the clock running and restore the registers.
The ISP calls the AMX Clock Handler at its entry point AACLK.
Note that interrupts must be disabled upon entry to procedure AACLK.
If more than one device shares the interrupt, the ISP must determine the interrupt source
by testing device status registers. If the clock caused the interrupt, the ISP must dismiss
the clock interrupt and keep the clock running. The ISP must then call the AMX Clock
Handler at its entry point AACLK.
Note that the clock ISP does not call the AMX Interrupt Supervisor entry or exit
procedures AAINT or AAINX. The AMX Clock Handler AACLK will invoke the AMX
Interrupt Supervisor if, and only if, an AMX clock tick must be serviced by the AMX
Kernel.
It is important to note that, because of task switching invoked by function AACLK, there
may be significant delay before AMX returns from the AACLK call and executes the IRET
instruction to resume execution of the preempted task.