Intel SIM4-02 Handheld Game System User Manual


 
the
typing
of
some
specializ~d
sequences
of
characters, partial decimal
to
binary conversion
on
input,
and
6-bit
teletype
char-
acter
input
with
control
character
checking. A
test
program
may
use these
subroutines
to
facilitate
checkout
of
complex
programs,
or
the
ROM
may be included
in
the
final program if
teletype
interface and
the
same ancillary
routines
are needed.
The
following
is
a
summary
of
the
subroutines
and
their
calling parameters:
NAME
ADDRESS
(X) FUNCTION
KEY
120
(11-15) This
routine
inputs
one
7-bit
character
from
the
teletype
keyboard,
and
returns
it, left-justified,
in index registers
14
and
15. I ndex registers 12
and
13 are cleared
to
zero.
The
least significant
bit
of
register
11
determines
whether
the
character
is
echoed
back (0 = yes, 1 = no).
The
carry
is
set
if
the
character
typed
in
is
printable.
TTl
117
(11-15) This
routine
inputs
one
7-bit
character
from
the
teletype
paper
tape
reader
or
keyboard
(the
reader
control
is
enabled), and
is
otherwise
exactly
the
same as KEY.
TXX
234
(10, 11, 14, 15) This
routine
examines
the
carry
bit
set
by
KEY
or
TTl as well as
the
accumulator
value
and
the
character
in registers 14
and
15
to
determine
if
one
of
the
following
conditions
obtains:
1.
The
character
is
some
printable graphic
between
"0" and '+".
If
so,
the
character
is
biased
to
a six-
bit
value,
centered
in
the
byte.
The
carry
is
turned
on
if
it
is
a letter. A normal
return
is
taken,
acc=O.
2.
The
character
is
a
control
character
between
null and ETB (control-Y)
or
a printable graphic
between
space
and
slash. An indirect
jump
to
the
address
in
ROM
page 1
contained
in
index registers 10 and
11
is
taken.
3.
The
character
is
a
control
between CAN (Control-X) and
US
(Shift-Control-O). An unconditional
jump
to
location
256
is
taken.
4.
The
character
is
one
of
those
not
generated
by
a KSR33
teletype,
or
a
rubout.
A normal
return
is
taken,
with
the
accumulator
non-zero.
T6R
205
(10-15) This
routine
combines
TTl and
TXX
such
that
normal return
occurs
only
on
characters
"0"
through
'
...
".
Characters
in
group
(4) above are ignored, and
the
alternate
exits
are
taken
for
control
characters
and
delimiters. Note
that
if
the
address
to
which
the
delimiter
return
is
to
be made
is
odd,
no
echo
occurs. On normal return,
the
character
is
right-justified in registers 14 and 15, and
the
carry
is
set
if
the
character
is
a letter
or
higher.
T6l
220
(10-15) This
routine
is
the
same as
T6R,
except
that
on
normal
return
the
carry
is
always zero, and
the
character
is
left-justified
in
registers
14
and
15, leaving
the
lower
two
bits zero. Both
T6R
and
T6l
contain
subroutine
calls nested
three
deep,
and
may
only
be called
from
the
main program,
except
during simulation.
010
183
(4-7, 10-15) This
subroutine
multiplies
the
12-bit
binary
number
in
registers 5-7 times
ten,
and adds
the
number
in register 15
to
the
product,
then
goes
to
T6R
to
input
another
digit. This
routine
may
be
called
repeatedly
to
input
and
convert
to
binary
a decimal
number.
A
terminal
delimiter
takes
the
alternate
exit
in
registers
10
and 11. Register 4
is
used for scratch.
Z47
6 (4-7) This
routine
clears registers 4
through
7
to
binary
zero in
preparation
for
010.
PUN
80
(11-15)
This
routine
prints
or
punches
the
character
in
registers
14
and 15
out
on
the
teletype.
Registers
11
through
15 are cleared
to
zero
on
return.
IPR
70
(11-15) This
routine
does
the
same as PUN,
except
that
if register
11
is
initially even (echo
mode
on
input),
RETN
MSG
SPACE
DIGIT
PDN
BCD
a
15
ms
delay
occurs
to
allow
the
teletype
printer
to
settle.
107
(11-15)
This
routine
types
out
a carriage
return,
a null, and a linefeed. It
may
only
be
called from
the
main
routine.
66
(11-15)
This
routine
types
out
the
character
in
registers
14
and 15,
then
follows it
with
a bell.
63
(11-15) This
routine
types
one
space.
53
(10-15) This
routine
types
an ASCII digit
corresponding
to
the
BCD
number
in
the
accumulator.
If it
is
zero,
and
the
register
10
contains
15, a space
is
typed
instead. Unless a space
is
typed,
register
10
is
incremented.
40
(4-7, 10-15) This
routine
will print,
with
zero
suppression,
the
four-digit decimal
number
in registers
4
through
7.
11
(1-7,10-15)
This
routine
converts
the
12-bit
binary
number
in
registers 1-3
into
decimal,
and
prints
the
four
digits
with
zero suppression.
6