Interrupts - AMSTRAD cpc 6128 User Instruction

Integrated computer/disc system
Hide thumbs Also See for cpc 6128:
Table of Contents

Advertisement

If you are tempted to PO K E around in the machine memory addresses, or C ALL the
sub-routines, save your program and listing before doing so, or you may regret it! The
extensive operating system firmware of the 6128 is described in SOFT 968, and is
beyond the scope ofthis introductory user manual.
In order to program extensively using machine code, it will be necessary to use an
assembler. The DEVPAC assembler from AMSOFT comprises a relocatable Z80
assembler, with editor, disassembler and monitor.
Part 2: Interrupts
The 6128 makes extensive use ofZ80 interrupts to provide an operating system that
includes several multi-tasking features, exemplified by the
AFT E
Rand
EVE
R Y
structures described earlier in this manual. The precedence ofthe event timers is:
Break ([ESC][ESC])
Timer 3
Timer 2 (and the three sound channel queues)
Timer 1
Timer 0
Interrupts should be included after considering the consequences of possible
intermediate variable states at the point of interruption. The interrupt sub-routine
itself should avoid unwanted interaction with the state of variables in the main
program.
The sound queues have independent interrupts of equal priority. Once a sound
interrupt has started, it is not interrupted by any other sound interrupt. This enables
sound interrupt routines to share variables with immunity from the effects
mentioned above.
When a sound queue's interrupt is enabled (by using 0 N S
Q
GO SUB), it will
immediately interrupt if the sound queue for that channel is not full, otherwise it will
interrupt when the current sound ends and there is room for more in the queue. The
action of interrupting disables the event, so the sub-routine must re-enable itself if
further interrupts are required.
Both attempting to issue a sound and testing the queue status will also disable a
sound interrupt.
For your reference ....
Chapter 7 Page 7

Advertisement

Table of Contents
loading

Table of Contents