Alto Hardware Manual
SavedCa r
ry:
0
SavedPC: 0
SavedAct
ive:
·0
PCLOC:
ACTIVE:
ChanMask:
500
453
37
Section
3:
Emulator
28
;
contains
ones
for
higher
priority
channels
It
is
customary (though not essential) to
assign
interrupt channel priorities such that channel
15
has the
highest priority and channel 1 the lowest. In this
case,
the ChanMask for channel
ts
interrupt routine will
consist
of
15-i one bits right-justified. In
any
case,
ChanMask
must
contain zero in the bit corresponding
to
the· interrupt channel being serviced.
The code
below
initiates interrupts on the channels corresponding to one bits in
ACO.
It
must disable
interrupts
to
prevent
ww
from being changed
by
microcode-initiated interrupts.
CauseInt:
WW:
COM
0 0
DIR
LDA
1
@WW
AND
0 1
ADC
0 1
STA
1
@WW
EIR
452
AC1
~
ACO
OR
AC1
the
interrupt
happens
after
this
If
a channel's
ACTIVE
bit
is
0 when viewed from non-interrupt
level,
u1.en
u1.e
channel is not in use. The
code below searches
ACTIVE
for the highest priority free channel.
It
is
careful not to assign the parity
interrupt channel. It then initializes an interrupt handler on that channel and returns a word with a one
in the bit position
of
the assigned channel.
It
must not be called from interrupt level.
;
enter
with
ACO
=
the
address
of
the
interrupt
handler
InitChan:
STA
0
INTHANDLER
FFC:
SUB
1 1
SUBZL
0 0
LDA
2
@ACTIVE
MOVZL
0 0
SZC
JMP
fail
INC
1 1
AND#
0 2
SZR
JMP
FFC
LDA
2
INTVEC
ADD
1 2
LDA
3
INTHANDLER
STA
3 0 2
AC1
~
0
ACO
~
1
no
interrupt
channels
free.
free?
no.T
ry
the
next
one
install
handler
in
INTVEC
LDA
2
@ACTIVE
;
turn
on
the
channel
ADD
0 2 ;
cant
carry:
equivalent
to
OR
STA
2
@ACTIVE
;
ACO
=
one-bit
mask
designating
the
assigned
channel
INTVEC:
501
INTHANDLER:
0 ;
temp
The code
below
destroys the interrupt channels corresponding to one bits in
ACO.
It
must not be called
from interrupt level.
DestroyInt:
COM
0 0
LDA
1
@ACTIVE
AND
0 1