mirror of
https://github.com/PDP-10/its.git
synced 2026-03-27 10:30:50 +00:00
99 lines
3.6 KiB
Plaintext
99 lines
3.6 KiB
Plaintext
This file documents C language support for the TOPS-20 PSI
|
|
(pseudo-interrupt) system.
|
|
|
|
TOPS-20 supports two conceptually different types of software
|
|
interrupts; system interrupts and user interrupts. System interrupts
|
|
are very much like UNIX signals, occurring whenever an error or
|
|
unexpected event happens during the execution of a program. User
|
|
interrupts occur due to actions initiated by the user, such as typing
|
|
a particular character on the job's controlling terminal.
|
|
|
|
The following functions are currently provided for interrupt support.
|
|
These functions are auto-loaded with the standard I/O package. Programs
|
|
which use these functions should have the line
|
|
|
|
# include <int.h>
|
|
|
|
somewhere near the beginning.
|
|
|
|
*Warning* This documentation is currently quite minimal. It will be
|
|
more than helpful to have a basic understanding of TOPS-20
|
|
software interrupts before trying to use these functions.
|
|
This understanding can be gained by reading the relevant
|
|
sections of the TOPS-20 Monitor Calls Users Manual.
|
|
|
|
*Note* all enabled interrupts (except stack overflow, which is
|
|
handled specially by the runtime package) are currently
|
|
at level 3. This means you cannot interrupt an interrupt
|
|
routine...
|
|
|
|
|
|
iset(chan,proc) This function is used to associate a particular
|
|
action with a particular interrupt channel.
|
|
|
|
<chan> may be a system interrupt channel or a user
|
|
interrupt channel. The file c:int.h defines the
|
|
available system interrupt channels and their
|
|
functions. The function ialloc, described below,
|
|
may be used to obtain the next available user
|
|
interrupt channel.
|
|
|
|
<proc> may be one of INT_DEFAULT, INT_IGNORE, or
|
|
the name of a C procedure to execute when the
|
|
interrupt occurs. Calling iset with INT_DEFAULT
|
|
is equivalent to turning the interrupt channel off.
|
|
This will generally result in the interrupt being
|
|
ignored. Program execution will be terminated on
|
|
the occurrence of a "panic" interrupt. (See the
|
|
TOPS-20 Monitor Calls Users Manual for more on
|
|
panic interrupts.) Calling iset with INT_IGNORE
|
|
turns the interrupt channel on and connects it to
|
|
a service routine which does nothing. Thus the
|
|
interrupt will always be ignored. Calling iset
|
|
with a function name causes that function to be used
|
|
as the interrupt service routine for the given
|
|
interrupt channel.
|
|
|
|
onchar(char,proc) Enables the given character as an interrupt
|
|
character and causes the given procedure to
|
|
be executed when this character is typed. Returns
|
|
the user interrupt channel connected to the
|
|
character, or -1 on failure.
|
|
|
|
As in iset, above, the <proc> may be one of INT_DEFAULT,
|
|
INT_IGNORE, or a C procedure name. <char> may be
|
|
any of the legal TOPS-20 terminal interrupt
|
|
characters, as follows:
|
|
|
|
'\000' - '\032' - The corresponding ascii "control
|
|
character".
|
|
|
|
'\033' - The ascii "escape" character.
|
|
|
|
'\034' - The ascii "rubout" character,
|
|
really '\177'
|
|
|
|
'\035' - The ascii "space" character.
|
|
|
|
'\036' - Loss of dataset carrier on a
|
|
remote line.
|
|
|
|
'\037' - Any typein
|
|
|
|
'\040' - Any typeout
|
|
|
|
More information on terminal interrupt characters
|
|
may be found in the Monitor Calls Reference Manual.
|
|
|
|
ialloc() returns the next available user interrupt channel,
|
|
or 0 if there aren't any more. Can be used to
|
|
request a user interrupt channel from the system for
|
|
a non-standard use.
|
|
|
|
ifree(chan) Turns the given user interrupt channel off and
|
|
returns it to the pool managed by ialloc.
|
|
|
|
|
|
That's all for now. More and better support functions will be provided
|
|
as time goes on... Thoughts to JTW@MIT-AI.
|