You have my number; call me

Call is a newly released (beta) module by Steve Drain, designed to send WIMP messages to an application – and therefore allowing the application to carry out specific functions – after a set period, or at regular intervals.

The RISC OS timing system and call-back mechanism is normally used by way of two SWIs (software interrupts): OS_CallAfter and OS_CallEvery, which are used to set up an interval and point to an address in memory; if OS_CallAfter was used, then after the interval has passed, the code at the specified address is called, and if OS_CallEvery was used, then the code is called regularly, at the specified interval.

For normal applications, use of these two SWIs is not practical: If the application is not paged in when the specified interval has passed, the address given in the call to the SWIs may not contain the correct code, or it might not even contain code at all – it could be data, or nothing in particular – and the result could be a crash and/or corrupted data. Applications developers who need this sort of facility, therefore, must devise alternative approaches.

Steve’s Call module therefore provides an easy solution for application developers. They call the module to set up the interval and nature of the call (once with Call_After and recurring with Call_Every) and the module then calls the OS supplied SWIs, pointing to code within itself. When the OS calls the specified code, the module then sends a WIMP message to the relevant application, which can be used as a trigger for any functions that it wanted to perform after a certain amount of time, or on a regular basis.

 

Related posts