Download Print this page

RCA COSMAC User Manual page 46

Hide thumbs Also See for COSMAC:

Advertisement

COSMAC Microprocessor
45
Fig. 51 shows a typical interrupt circuit. The flip-flop is reset during the S3 cycle, but could also be reset
by an output instruction.
TPA
Vee
jlREQUEST
COSMAC
92C5-26484
Fig.
51 -
Typical interrupt circuit_
During the S3 cycle, the current values of the X and P registers are stored in the T register. P is then set
to 1, X to 2, and IE to
O.
Following S3, a normal instruction fetch cycle (SO) is performed. The S3 cycle,
however, changed P to 1, so that next the sequence of instructions starting at the memory location
addressed by R(1) will be executed. This sequence of instructions is called the interrupt service program.
It saves the current state of the COSMAC registers such as T, D, and possibly some of the scratch pad
registers, by storing them in reserved memory locations. DF must also be saved if the interrupt service
program will disturb it. The service program then performs the desired functions, restores the saved
registers to their original states, and returns control to execution of the original program. Special instructions
RETURN, DISABLE, and SAVE (70,71, and 78) facilitate interrupt handling. These instructions were
described in the section on Instruction Repertoire; their use will be illustrated in the section on Machine-
Code Programming.
The COSMAC microprocessor also provides a special one-bit register (flip-flop) called Interrupt Enable
(IE). When IE is set to "0", the state of th!5.interrupt line is ignored. IE is set to "1" by a low on the
CLEAR line. IE can be set to "1" or "0" by RETURN and DISABLE instructions, respectively. It is
automatically set to "0" by an S3 cycle, preventing subsequent interrupt cycles even if the INTERRUPT
line stays low. The program must set I E to "1" to permit subsequent interrupts. Sharing the I NTE R RUPT
line with a number of interrupt signal sources is possible.
When the interrupt facility is used in a system, R(1) must be reserved for use as the interrupt service
program counter and R(2) is normally used as a pointer to a storage area. The latter may be shared with the
main programs if appropriate conventions are employed, as described in the section on Machine-Code
Programming.

Advertisement

loading