|★ CODING ★ LISTINGS ★ RSX CLOCK/ALARM ★|
|Clock|Popular Computing Weekly)||Real Time Clock|Computing with the Amstrad)||Rsx - Clock - Interrupt - Uhr für den CPC 464|CPC Amstrad International)||RSX Clock||RSX Clock|Popular Computing Weekly)||Rtc - Real Time Clock|Amstrad Action)|
Keep track of those long hours at the keyboard with this interrupt driven clock by S Potter
This program is an RSX or Residential System Extension program which means its operation is controlled by real commands, not calls or pokes.
Locomotive Basic allows the machine code programmer to assign new keywords to the operating system and the system accepts them as it would normal keywords such as, Print etc. It is the programmer's job define the keywords and point them in the general direction of the routine they should control. These new keywords are preceded by the symbol (found by Shift/@).
The program is the Real Time Digital Alarm Clock for the Amstrad CPC 464/664 and is written as an RSX to allow ease of use.
The Amstrad has no fewer than four different types of interrupt easily accessible to the programmer, not counting the Basic Every! After interrupts which unfortunately are at a lower level of priority and suffer delays to Input etc.
This program uses the Ticker interrupt which is a 50th second interrupt and uses a count of 50, thus the program is accessed once every second. Consult the Concise Firmware Manual for more details on RSX and interrupts.
Type in the Basic loader, remembering to save the program before calling the program. Normally the start address is 40000 and is 500 bytes long so save the program by Save "title",b, 40000,500,40000.
With the Basic listing you will find odd line numbers; these are to coincide with the start address of the eight bytes of data on that line, the last number is the checksum of that line. To make typing easy use type in direct mode Auto 40000,8 to generate the line numbers. Any errors will report the line number where the error occurred. After running the Basic program with no error reports. Save the code as above and Call 40000.
The commands for the clock are: Clockonjiour.minute.second to display the clock and set the time. The parameters are optional when just redisplaying the clock, and the seconds are also optional.
The program is located at 40000 to allow room for a Symbol After 0 and DDI 1 disc drive if installed, when Him em is 40699, but may be relocated with an assembler to 500 bytes below Himem as required. It also uses all standard firmware calls and functions so memory area permitting will operate with most programs.
Finally, the clock is displayed in Window 7 so redefining Window 7 will allow the clock to be displayed anywhere on screen.