Download Print this page

Radio Shack TRS-80 Model II Reference Manual page 254

Disk operating system
Hide thumbs Also See for TRS-80 Model II:

Advertisement

Model II
TRSDOS
Handling Programmed Interrupts
TRSDOS
allows two user-programmed interrupts as described under
SETBRK
and
TIMER.
When either kind of interrupt is received ((BREAK) key is pressed or
TIMER
counts to zero), control transfers to your interrupt handling routine.
Note: System routines called by your program are also subject to interrupts.
Interrupt handlers can also be interrupted.
Upon entry to your interrupt processing routine,
TRSDOS
sets up the registers
as follows:
(SP)
=
The address of the next instruction to be executed when the
interrupt was received
Other registers:
Contents are the same as they were when the interrupt was processed.
Before doing any processing, you should save all registers. When finished
processing, restore all registers and execute a return to continue with the
interrupted program.
It
is good practice to keep interrupt handling routines short; ideally, the
routine simply flags the main program that an interrupt has occurred and
returns. The main program can then respond to the interrupt flag when
convenient.
Always end your interrupt handler with the
RET
instruction and with all
registers intact.
TRSDOS
is serially reusable but not always re-entrant. More specifically, your
interrupt routine should not call
TRSDOS sVC's,
since under some conditions
this will produce unpredictable results.
290

Advertisement

loading