Note: Descriptions are shown in the official language in which they were submitted.
DEMANDES OU BREVETS VOLUMINEI~X
,
LA PRÉSENTE PARTIE DE CETTE DEMANDE OU CE BREVET
COMPREND PLUS D'UN TOME.
CECI EST LE--OME l DE 3'
NOTE: Pour les tomes additi~nel.c~, veuillez contacter le Bureau canadien des brevets
JUMBO APPI ~ATIONS/PATENTS
THIS SECTION OF THE APPLICATION/PATENT CONTAINS MORE
THAN ONE VOLUME
THIS IS VOLUME l_ OF ~
NOTE: For additional v~lumes Flease c~ntac~ the Canadian Pat~nt Office
1046644
BACKGROUND OF THE INVENTION
This invention relates generally to calculators and
improvements therein and mo_e particularly to programmable
calculators that may be controlled both manually from the
keyboard input unit and automatically by a stored
~'
1046644
_ 4 --
program loaded into the calculator from the keyboard input
unit or an external record member.
Computational problems may be solved manually,
with the aid of a calculator (a dedicated computational
keyboard-driven machine that may be either programmable
or nonprogrammable)~ or a general purpose computer. Manual
solution of computational problems is often very slow, so
slow in many cases as to be an impractical, expensive,
and ineffective use of the human resource, particularly
when there are other alternatives for solution of the
computational problemsO
Nonprogrammable calculators may be employed to
solve many relatively simple computational problems more
efficiently than they could be solved by manual methods.
However, the keyboard operations or language employed by-
these calculators is typically trivial in structure, thereby
requiring many keyboard operations to solve more general
arithmetic problems. Programmable calculators may be
employed to solve many additional computational problem~
at rates hundreds of times faster than manual methods.
However, the keyboard language employed by these calcula-
tors is also typically relatively simple in structure,
thereby again requiring many keyboard operations to solve
more general arithmetic problems.
~nother basic problem with nearly all of the key-
board languages employed by conventional programmable and
nonprogrammable calculators is that they allow the character-
istics of the hardware of the calculator to show through to
the user, Thus9 the user must generally work with data
movement at the hardware level, for example, by making sure
~04~;644
-- 5--
that data is in certain storage registers before specifying the
operations to be performed with that data and by performing
other such "housekeeping" functions. In addition, these
languages have been unique to a particular calculator and have
not been generally familiar to those persons skilled in the
computer and calculator arts.
In the past both programmable and nonprogrammable
calculators have generally had very limited memories, thereby
severely limiting the size of the computational problems they
could be employed to solve. Because of these limitations, the
relatively simple structure of the keyboard languages employed
by these calculators and the "housekeeping" requirements
associated with their languages have not heretofore been serious
shortcomings. However, with advances in technology, the cost
of memories has decreased to a point where larger memories
could be economically included in programmable calculators.
These larger memories have allowed larger and more sophisticated
problems to be handled by programmable calculators. As a result
the shortcomings of conventional calculator languages have
become more critical, thereby creating the need for higher
level keyboard languages.
In addition to the foregoing shortcomings, con-
ventional programmable calculators generally have less capability
and flexibility than is required to meet the needs of many
users. For example, they typically cannot be readily expanded
and adapted by the user to increase the amount of program and
data storage memory or to perform many special keyboard functions
oriented toward the environment of the user.
In some conventional programmable calculators a
1046644
program stored within the calculator can be recorded onto an
external magnetic record member and can later be reloaded
bac~ into the calculator from the magnetic record member.
However, data and programs stored within these calculators
typically cannot be separately recorded onto an external
magnetic record member and later separately reloaded back
into the calculator therefrom. Moreover, these calculators
typically have no provision for making a program secure when
it is recorded onto an external magnetic record member. Any
user may therefore re-record the program or obtain an indi-
cation of the individual program steps once the program is
reloaded into the calculator.
Conventional programmable calculators with self-
contained output display units typically have little or no
alpha capability and typically can only display the contents
of one or more selected registers. They are therefore
typically unable to display a line containing an alpha-
numeric statement or an alphabetic message such as might be
use~, for example, to inform the user how to run programs
with which he may be unfamiliar. Such features would be
~ery helpful to the user both in editing programs and in
simplifying their use.
~onventional programmable calculators typically have
little or no capability for editing keyboard entries or pro-
grams stored within the calculator. For example, they
typica~ly have no provision for deleting, replacing, and
inserting information included in or omitted from a keyboard
~ntry or internally-stored program on a character-by-character
or line-by-line basis. As another example, they typically
have no provision for ~ rectly recalling any line of an
-- 7--
1046644:
internally-stored program~ -As a further example, they typi-
cally have no provision for automatically accommodating and
sequencing program statements which are entered by the user
in random orderO Such features would be very helpful to the
user in editing programs.
Conventional computers typically pose an inter-
~acing prob~em between th~ user and the machine~ This
interface re~uirement takes the $orm of a machine-level
operator with special abilities ~or maintaining the soft~
ware system in operative condition for the user Com~
put r time sharing systems comprising a centrally located
computer and a multiplicity of remotely located user
terminals connected thereto by telephone lines have
partially solved the user/machine interface problem. How-
ever, these systems lack the samc ~lexibility as conven~
~ional computers in that they are only programmable and
provide no convenient non~programmable method for per-
forming relatively simple calculations. Both types of
systems lack provision for editing a program statement
from a keyboard without the necessity of retyping the entire
statement,
Summary of the Inventio~
In accordance with one aspect of this invention there
, .
is provided an improved programmable calculator that has more
capability and flexibility than conventional programmable
calculators, that is smaller, less expensive and more effi-
cient in calculating elementary mathematical functions than
conventional computer systems, and that is easier to utilize
than conventional programmable calculators or computer
systems.
1046644
This invention in another aspect provides a
programmable calculator employing BASIC computer language
implemented in a read-only memory (R~AI) that compl~ely
eliminates the user~machine interface re~uirement of ro~
ventional computers and further eliminates the necessity
of learning a non-universal language such as those typically
associated with con~entional programmable calculators,
This invention in another aspect provides a
programmable calculator in which the user may, be employing
a BACK key or a FORIVARD key o~ a keyboardD position a visual
cursor over any character position of a line of information
entered from the keyboard or recalled into the display from
memory to indicate the character which may ~e edited by
simply actuating a key representing the replacement charac-
ter,
This invention in another aspect provides a
programmable calculator in which the user may employ an
INSERT key of a keyboard to insert a blan~ character posi-
~ion imm~diately to the left of the sursor position, and
may insert any character therein by actuating its repre-
sentative key.
This invention in another aspect provides a
programmable calculator in which the user may employ a
space bar of a keyboard when entering a line of information
from the keyboard to introduce blank characters at desired
character positions along the lineO
This invention in another aspect provides a
programmable calculator in which the user may delete a
character from a line of informatio~ entered from the key- - -
board or recalled into the display from memory by actuating
1046644
q
the space bar after positioning a cursor over the charac-
ter to be deleted.
This invention in another aspect provides a
programmable calculator i~ which the user may dele~e a
character from a line of information entered from the key-
~oard or recalled into the display from memory and simul-
taneously move the ri~ht hand portion of that line one char-
acter position to the left to occupy the space resulting
from the deleted character by positioni~g the cursor oYer
the character to be deleted and then simultaneously actu-
ating the INSERT key and a SHIFT key.
This invention in another aspect provides a
- programmable calculator in which the user may move a
displayed ~ine of information either left or right across
a displa~ register independently o~ the location of a cursor
at a particular charactex position thereof~
This invention in another aspect provides a
programmable calculator in which the user may di~play a
~tatement located at a particular line in memory by aotu-
ating a FETCH key of a keyboard followed by the line desig-
nation.
This invention in another aspect provides a
programmable calculator in ~hich the user may ha~t execu-
tion of a program, call various lines of information from
memory into a display register for visual examination, and
thereafter automatically resume program execution at the
point at which the halt occurred by actuating a single
key of a keyboard u~it.
This invention in another aspect provides a
programmable calculator in which the user may call a pa~ticular
- - l o
- 10~6644
line of information from me~lory into a display register
and may then actuate one of two keys sf a keyboard unit
to step to and visually observe the contents of lines pre-
ceding or following the line originally displayed.
This invention in another aspect provides a
programmable calculator in which the user may store into
memory a line of in~ormation residing in a display register
irrespective of the position of that line in the display
register and irrespecti~e o~ the location of a cursorO
This invention in another aspect provides a
programmable calculator in which the user may, by actua-
ting a RECALL key of a keyboard u~it, recall into a display
register the most recent llne of information which was
terminated by eithex an EXEC~TE or END-OF-LINE command~
This invenkion in another aspect provides a
programmable calculator in which a group of keys of a.key-
-board unit, representing various editing commands~ are
provided for conditioning the calculator to perform the
command represented without the necessity of literally
spelling out the command by actuating a sequence of alpha-
betic keys.
This invention in another aspect provides a
programmable calculator in which the user may, by actua-
ting a single key of a keyboard unit, delete a statement
portion of a line of information being entered into a dis-
play register while ret~i ni ~ the line number of that line.
This invention in another aspect provides a
programmable calculator i~ which the user may, by actua-
- . ting a single key of a keyboard unit, erase from memory a line
of information recalled into a display register from the
1046644
memory.
This invention in another aspect provides a
programmable calculator in which the user may selectively
list on an external printing unit an entire file stored
in memory or any portio~ thereof.
This invention in another aspect provides a
programmable calculator i~ whieh the user may designate an
automatic line numbering mode for automatic~lly providing
a line number, according to a selected sequence involving
a starting line number and an increment,~at the beginning
of each line of information e~texed into a display register.
This invention in another aspect provides a
programmable calculator in which the user may selectively
scratch from memory a mainline program, non-common vari-
able~t a symbol table, and the definitions of a group of
user-definable keys.
This invention in another aspect provides a
programmable calculator in which ~he user may, during e~ecu-
tion of a program, designate a trace mode of operation whereby
the line number of each statement executed is printed on an
external output unit as it is executed
This invention in another aspect provides a
prsgrammable calculator in which the user may, prior to
execution of a program and without altering the program,
- designate a line orllines prior to the execution of ~hich
program execution is to be halted~ -
This invention in another aspect provides a
programmable calculator in which the user may selectively
commence execution of a program at either the beginning or --
at any intermediate line and may designate that at such time
- t a~-
~0~6644
all variables are to be either unaltered or set to an unde-
fined state.
This invention in another aspect provides a
programmable calculator in which the user may~ by actua-
ting a single key of a keyboard unit, instruct the calcu-
lator to set all program variables to a~ undefined state
- ~nd to set up array storage for all arrays previously di-
mensioned in a programO
This invention in another aspect pro~rides a
programmable calculator in which the user may designate
any portion of a program as being secure so that a user
may not obtain ~ny indicatîon of the contents of such por-
tion and may not store onto a magnetic record member any
secure program that has previously been entered into the
calculator from a magnetic recsrd member but may observe
the contents of the unsecure portion of any program residing
in memory~
This invention in another-aspect provides a
programmable calculator i~ which a group of ~haracters may
be associated with each one of a plurality of definable
keys of a keyboard unit, may later be displayed upon actu-
ation of the associated key, and, if the group of char
acters represents a~ executable co~n~, may be immediately
executed upon actuation of the associated key.
This invention in another aspect provides a
programmable calculator in which each of a plurality of de-
finable keys of a keyboard unit may be associated with a
single or multiline function of one argument, which function
- may be employed as part of a program or immediately executed
from the keyboard.
- 1046644
This invention in another aspect provides a
programmable calculator in ~hich each o~ a plurality o~
deilnable keys o~ a keyboard unlt may be associated with
a multiplicity of BASIC language prsgram statements and
~he resulting program executed upon actuation oi the asso-
ciated key.
This invention in another aspect provides a
- prsgrammable calculator in which the user may~ when employ-
ing a ~atrix plug-in read-o~ly memory module, ~elec~ as a
~unction the determinant o~ a previously defined square matrix.
This invention in another aspect provides a
programmable calculator in which the user may, by actua~
ting a SHIFT key o~ a keyboard unit, selectively cause
to be printed on an external printing unit either lower
or upper case alphabetic characters,
This invention in another aspect provides a
programmable calculator in which the user may, when the
calculator is used in con~unction with an e~ternal print-
lng unit, desig~ate a print-all mode ~or printlng all li~es
o~ infsrmation entered ~rom a keyboard and termlnated by
EXECUTE or END-OF-LINE commands9 all error messages, and
all lnformation displayed durlng execution.
This invention in another aspect provides a
programmable calculator in which the user may immediatel~
execute any self-contained BASIC language program statement
~rom a keyboard unit.
This invention in another aspect provides a
programmable calculator in which plug~in read-only memory
modules are not uniqueiy associated with a particular group
o~ keys o~ a keyboard unit.
1046644
_1~
This invention in another aspect provides a
programmable calculator in which ~unctions available through
the use of plug-in re~d-only memory modules are selected -
by actuating a series ~ alphanumeric keys o~ a keyboard
unit rather than a single key, thereby allowing the ~umber
of functions available to be independent o~ the number
oi keys availableO
This invention in another aspect provides a
programmable calculator in which the user may create a pro-
gram using ~unctions available from a plurality 4~ plug~in read-only memory modules i~serted into receptacles on
the calculator in a particular sequence, may record such
program onto an external magnetic record member, and may
thereaiter execute such program on another calculator of the
same type con~igured with the same plug-in read-only memory
modules but without observing the se~uence in which they
~ere placed in the receptacles of the first calculator.
This invention in another aspect provides a
programmable calculator in ~hich khe user may7 when the
calculator is con~igured with a plotter plug-in read-only
memory module and an external X-Y plotter, speci~y an of~-
set oi g and Y coordinates to be applied to all subsequent
coordinate speci~ications7
This invention in another aspect provides a
programmable calculator in which the user may, when the
calculator is con~igured with a p~otter plug-in read-only
memory module, and an external X-Y plotter, incrementally
plot, in user units, points relative t~ a current pen posi-
tlon.
This invention in another aspect provides a
10~6644
~5--
prsgrammable calculator in which the user may, when the
calculator is configured with a plotter plug-in read-only
memory module and exter~al X-7 plotter9 plot rectangular
coordinate axes by specifying in user units starting and
ending coordinates for each axis, a coordinate at which
each axis intersects the other axis, and a tick mark spac-
ing for tick ma~king along each axis in elther directio~
~rom a starting point
This invention in ano~her aspect provides a
programmable calculator in which the user may, when the
calculator is configured with a plotter plug-in read-only
memory module and an e~ternal ~Y plotter, plot labels
Qccording to the ~ormat oi a standard BASIC language print
-~tatement or accordlng to a referenced format statement
of a program, speci~y the height o~ characters contained
ln such labels, specl~y a character aspect ratio (ratio
of height to width) ~or the characters contained ln such
la~els, speci~y an angle o~ rotation in either degrees,
radians or grads at which such labels are to be plotted~
and specify a paper helght~o-width ratio ~or assuring
character uniformity regardless of plot a~gle
This invention in another aspect provides a
programmable calculator in which the user may, when the
calculator is configured with a plotter plug-in read-only
memory module and an external X-Y plotterJ incrementally
plot characters according to character size units for
facilitating pen placement at the beg~ nn~ ~g of plotter
labelling operationR.
This invention in another aspect provides a
programmable calculator in which the user may, when the
a
~6
1046644
ca~culator is configured with a plotter plug-in read-onl~
memory module and an external X-Y plotter, plot characters
as ~he ~-orresponding keys of a keyboard input unit are
actuated and use UP, DOWN, LEFT, and RIGHT ARROW keys of
the keyboard input unit ~or controlling the position of
the plotter pen.
This invention in another aspect provides a
programmable calculator in ~hich the user may, when the
calculator is configured with a terminal plug-in read-only
memory module and an exter~al modem for transmitting and
receiving information over telephone lines, select ~rom
a keyboard unit a~y baud ra~e ~rom a continuously vari-
able range of baud rates~
This invention in anothe~ aspect provides a
programmable calculator ln which the user may, when the
calculator is configured with a terminal plug-i~ read-only
memory module and a~ external modem fcr transmitting and
receiving data over telephone lines, sele~t by actuating a
~ing~e key of a keyboard unit either odd or eve~ parity
of ~ra~smitted data.
This invention in another aspect provides a
programmable calculator in which the user may, when the calcu-
lator is conflgured with a terrin~ plug-in read only
memory module, enter free text information from a key-
board l~put unit, an external magnetic record member, or
any peripheral input unit, edit such information on
a line-by-line or character-by-character basis, store
such information on an external magnetic record member,
and thereafter transmit such information, for .example,
to a remotely located time-sharing computer system
_ ~q_
10~6644
This in~ention in another aspect provides a
progra~mable calculator in which the user may, when the
calculator is configured with a terminal plug-in read-o~ly
memory module, generate and transmit a~y ASCII eodes~
This invention in another aspect provides a
programmable calculator in which the user may7 when the
calculator is conXigured with a terminal plug-in read-only
memory module and an external modem for transmitting and
receiving information over telephone lines, make calcula-
tions and run programs locally at the ~ame time as, ~orexample, the calculator is on~ e with and rlln~n~ pro-
grams through a remotely located time~sharing co~puter
system.
This invention in another aspect provides a
programmable calculator i~ which the user may, whe~ the
calculator is con~igured with a terminal plug-in read-on'y
memory module, recei~e BASIC la~guage programs from remote
locations and thereafter ru~ them locall~ on the calculator.
This invention in another aspect provides a
~0 programmable calculator in which the user may, whe~ the
calculator is co~figured with an extended input~output
plug-in read~only m~mory module, from a keyboaxd unit or
under program control, generate and transmit to any of a
plurality of input-output channels any twelve-bit code
This invention in another aspect provides a
programmable calculator in which the user may, when the
calculator is con~igured with an e~tended input-output
plug-in read-only memory module, ~rom a keyboard unit or
. Under program control, read an eight-bit character from a
30~ designated input-output channel.
10~6644
-18
This invention in another aspect provides a
programmable calculator in which the user may, when the
calculator is configured with a~ extended input-output
plug-in read-only memory module~ from a keyboard unit or
under program control, read the status of a designated
external input-output unitO
This invention in anothex aspect provides a
programmable calculator ln which the user may, when the
calculator is configured with a~ exte~ded input-output
plug-in read-only memory module, ~rom a keyboard unit or
under program control; perform bit manipulation on si~teen-
~it l~eger data a~eordlng to the ~unctions oi ROTATE,
AND, and OR.
This invention in another aspect provides a
pro rammable calculator in which the user may, whe~ the
calcuLator is configured with an extended input-output
plug-in read-only memory module7 from a keyboard unit or
under program control, convert bet~een var~ous multi-bit
~ata codes and the ASCII code of the calculator for allow
~~ ing the calculator to eommunicate with peripheral units
haYing operating codes other than ASCII~
This invention in another aspect provides a
programmable calculator in which the user may, when the
calculator is configured w~th an extended input-output
plug-in read only memory module, from a keyboard unit or
under program control, write into a string ~ariable any
iniormation which may be transmitted to a~ QUtpUt u~ito
This invention in another aspect provides a pro-
grammable calculator in ~hich the user may, from a key- -~
board or under program control, by means of a single
10466~4
_/ q
command which may involve parameters~ max~ a magnetic tape,
stored either on an internal tape cassette or on one of
a pluralit~ of external tape cassettes, into a designated
number of files each being o~ a designated lengtL
This invention in another aspect provides a
programmable calculator ln which the user may designate
that a particular file s~ored on a magnetic tape cassette
is to be used ~or either program storage or data storage
and in which he is subsequently pre~ented from attempting
to access data from a flle designated for program storage
and ~ice versaO
This invention in another aspect provides a
programmable calculator i~ whlch ~he user may7 from a
keyboard or under program control, access a file stored
on a magnetic tape cassette, by means o~ a single command
indicating a file number, which ~ile number may be the
result of an arithmetlc expressionO
This invention in another aspect provides a
programmable calculator in which only complete files o~ a
~0 designated length may be marked on a magnetic tape, thus
preventing the existence of a partially complete file near
the end of a tape because of an insufficient amount of tape.
This invention in another aspect provides a
programmab,e calculator in which the user may, by means
of a single command entered either from a keyboard or en-
countered under program control, list on an external print-
ing unit certain information with respect to each ~ile
- stored on a magnetic tape cassette, such information being
- the iile number, the amount of information currently stored
thereln, the iile type, the maximum file length, the starting
10466~
~ ~o-
and ending line numbers o~ program stored therein9 the
number of words of common data storage associated with a
program stored therein, and the form of data stored therein.
This invention in another aspect pxovides a
programmable calculator in which the user may, from a key-
board unit or under program control~ chain one or more
program segments stored on a magnetic tape cassette to a
program residing in the calculator memory and may use the
same variables in each segment without declaring common
! 10 storage for the varlablesO
This invention in another aspect provides a
programmable calculator i~ which the user may, from a
keyboard unit or under program control, insert a program
or a program segme~t stored o~ a magnetic tape cassette
a~ any line number of a program residing in the calculator
memory,
This invention in another aspect provides a
progra lable calculator in which the user may specify a
line number ln memory at which a program or a program seg-
ment loaded from a magnetic tape cassett~ is to begin andin which, if the resulting line numbers differ ~rom those
of the program or pxogram segment as it resided on tap~,
reierences within such program or program segment are auto-
matically modified to reflect the current line number se-
~uence.
This invention in another aspect provides a
programmable calculator in which the user may~ irom a key-
board unit or under program co~trol9 selecilvely store any
portion of a program residing in the calculator memory onto
30 ~ magnetic tape cassette. -
~46644
This invention in another aspect provides a
programmable calculator in which the user may, from a key-
board uni~ or under program control~ store the definitions
associated with all keys sf a group of user-de~inable keys
into a file on a magnetic tape cassette,
This invention in another aspect provides a
programmable calculator in which the user may, from a key-
board or under program control, load from a file on a mag-
netlc ~ape cassette the definitions as~ociated wlth all
~eys of a group of user-definable keys~
This invention in another aspect p-rovides a
programmable calculator i~ which the user may, ~rom a key-
board unit or under program-control, load, store, merge7
or chain programs or functions residing or to reside on
a m~gnetic ~ape cassette and associated with or ts be
associated with any key o~ a group of user-definable keys~
Thi~ invention in another aspect provides a
programmable calculator in which the user may, ~rom a key-
koard unit or under program control~ load into the calcu-
lator memory from a magnetic tape cassette or store ontoa magnetic tape cassette from the calculator memory all
common data defined in the program residing in the calcu-
lator memory without specifying individual variable names
and by means of a single command.
This invention in another aspect provides a
- programmable calculator ~n which the user may load prere-
corded assembly language programs cont~;nin~ c~m~n~,
statements, or ~unctions whieh expand the capabilities
of the calculator and which may be selected for execution
by the user just as though the same commands, statements,
1046644
or functions had been made available to the user ~y means of
a plug-in read-only memory module.
This invention in another aspect provides a programm-
able calculator in which the user may~ from a keyboard unit or
under program control~ search a magnetic tape cassette in either
forward or reverse directions for locating a particular file at
the same time as the calculator is executing program statements
or keyboard commandsO
Other and incidental aspects of this invention will
become apparent from a reading of this specification and an
inspection of the accompanying dra~-ingsO
In general, in accordance with this invention there
is provided electronic data processing apparatus comprising:
keyboard input means ~or entering lines of one or more
zlphameric characters ~ach into said electronic data processing
apparatus;
~said keyboard input means including insertion control
means for controlling the insertion of one or more characters
into a line of one or more alphameric characters;
first memory means for storin~ lines of one ox more alpha~
meric characters each;
~econd memory means, coupled to said keyboard input means
.... ~
and first memory means, for storing a line of one or more alpha-.
meric characters entered into said electronic data processing
apparatus from said keyboard input means or recalled from said
. first memory means;
display means, coupled to said second memory means, for
visually disp~a~ing a line o~ one or more alphameric characters
stored in said second memory means,
said display means including means for visually displaying
a cursor for designating any character position of the displayed
line of one or more alphameric characters,
said keyboard input means including cursor control means
for controlling the position of said cursor: and
-22-
- ~3 -
104~S44
logic means, coupled to said keyboard input means,
second memory means, and display means, for positioning said
cursor to designate any character position of tne displayed
line of one or more alphameric characters in response to
actuation of said cursor control means;
said logic means being responsive to each actuation
of said insertion control means for shifting selected ones of
the alphameric characters in the line of one or more alpha-
meric characters then stored in said second memory means and
displayed by said display means to insert a blank character
at the character position then designated by said cursor.
In the illustrated preferred embodiment of this
invention there is employed a keyboard input unit, a magnetic
tape cassette reading and recording unit, a solid state output
display unit, an optional external output printer unit, an
input-output control unit, a memory unit, and a central pro-
cessing unit to provide an adaptable programmable calculator
having manual operating, automatic operating, program enter-
ing, magnetic tape reading, magnetic tape recording, and
alphanumeric display and print modes. The keyboard input
unit includes a group of data keys for entering numeric
data into the calculator, a group of control ~eys for con-
trolling the various modes and operations of the calculator
and the format of the output display, a group of alpha-
numeric keys arranged as a typewriter keyboard for entering
statements, and a group of user-definable keys. All of the
data and alphanumeric keys and some of the control keys may
also be employed for programming the calculator.
The magnetic tape cassette reading and recording
unit includes a reading and recording head, a drive mechanism
~~3 A -
- ~0~6644
for driving a magnetic tape past the reading and recording
head, and reading and recording drive circuits coupled to
the reading and recording head for bidirectionally
trans~erring information between the magnetic tape and the
calculator as determined by keyboard commands or commands
which are part of a stored program.
1046644
The lnput-output control unit includes a sixteen-
bit universal shift register serving as an input-output
register into which information may be transferred serially
~rom the central processing unit or in parallel from the
keyboard input and magnetic tape cassette reading and re-
cording units and from which information may be transferred
serially to the central processing unit or in parallel to
the solid state output display, magnetic tape cassette
reading and recording, and output printer units, It also
includes control logic responsive to the central process-
ing unit for controlling the transfer of information be-
tween these units. The input-output control unit may
also be employed to perform the same functions between
the central processing unit and peripheral units including,
~or example, an external printing unit, a digitizer, a
marked card reader, an X-Y plotter, an external magnetic
tape unit, a disc, a typewriter, and a modem A plurality
of peripheral units may be connected at the same time to
the input-output control unit by simply plugging interface
modules associated with the selected peripheral units into
receptacles provided therefore in a rear panel of the cal-
culator housing.
The memory unit includes a modular random-access
read-write memory having a dedicated system area and a
separate user area for storing program statements and/or
data The user portion of the read-write memory may be
expanded without increasing the overall dimensions of the
calculator by the addition of a program storage module,
Additlonal read-write memory made available to the user
3~ is automatically accomm~dated by the calculator, and the
1046644 5_
user is automatically informed when the storage capacity
o~ the read-write memory has been exceeded.
The memory unit also includes a modular read-only
memory in which routines and subroutines o~ assembly lan-
guage instructions for performing the various ~unctions
o~ the calculator are stored. These routines and subrou-
tines of the read-only memory may be expanded and adapted
by the user to perform additional ~unctions oriented to-
ward the speciiic needs of the user. This is accomplished
by simply plugging additional read-only memory modules
into receptacles provided therefore in a side panel o~ the
calculator housing. Added read-only memory modules are
automatically accommodated by the calculator and are ac-
cessed by the calculator through a series o~ mnemonic tables.
These tables contain mnemonics which are additions to the
calculatorr-s programming language.
Plug-in read-only memory modules include, ~or ex-
ample, a matrix module, a string variables module, a plot-
ter module, an extended input-output module, and a termi-
nal module, The matrix module makes available to the user
standard BASIC language matrix functions plus an additional
function which returns the determinant of a previously
defined square matrix. The string variables module makes
available to the user standard BASIC language string vari-
ables operations. The plotter module enables the user to
conveniently plot and label on an external X-Y plotter.
The extended input-output module allows the calculator
to be used with a wide variety o~ peripheral input-output
unlts. The termlnal module facilitates lnterfacing the
calculator wlth a modem ~or communicating, ~or example,
-~ ~046644
- a,6-
wlth remotely located time-sharing computer systems. It further
allows free text editing and storage.
The memory unit ~urther lhcludes a pair of recir-
culating sixteen-bit serial shift registers. One of these
registers serves a~ a memory address register for serially
recelving information from an arithmetic-logic unit inclu-
ded in the central processing unitJ for parallel address-
ing any memory location designated by the received informa-
tion back to the arithmetic-logic unit. The other of these
registers serves as a memory access register for serially
receiving i~formation from the arithmetic-logic unit, for
writing information in parallel into any addressed memory
location, for reading information in parallel from any
addressed memory location, and for serially transferring
information to the arithmetic-logic unit. It also serves
a~ a four-bit parallel shift register for transferring
~our bits of binary-coded-decimal information in parallel to
the arithmetic-logic unit.
~ The central processing unit includes four recir-
culating sixteen-bit serial shift registers, a four-bit
serlal shift register, the arithmetic-logic unit, a pro-
grammable clock, and a microprocessor. Two of these sixteen-
bit serial shift registers serve as accumulator registers
for serially receiving information from and serially trans-
ferring information to the arithmetic-logic unit. The
accumulator register employed is designated by a control
flip-flop. One of the accumulator registers also serves
as a four-bit parallel shift register for receiving four
bits of binary-coded-decimal information in parallel from
an~ transferring four bits of such information in parallel
~046644
--~7-
to the arithmetic-logic unit. The two remaining sixteen-
blt serial shift registers serve as a program counter
register and a qualifier register, respectively. They
are also employed for serially receiving information from
and serially transferring information to the arithmetic-
logic unit. The four-bit serial shift register serves as
an extend register for serially receiving information from
either the memory access register or the arithmetic-logic
unit and for serially transferring information to the
arithmetic-logic unit.
The arithmetic-logic unit is employed for perform-
ing one-bit serial binary arithmetic, four-bit parallel
binary-coded-decimal arithmetic, and logic operations. It
may also be controlled by the microprocessor to perform
bidirectional direct and indirect arithmetic between any
of a plurality of the working registers and any of the
registers of the read-write memory.
The programmable clock is employed to supply a
variable number of shift clock pulses to the arithmetic-
logic unit and to the serial shift registers of the input-
output, memory, and central processing units. It is also
employed to supply clock control signals to the input-output
control logic and to the microprocessorO
The microprocessor includes a read-only memory in
which a plurality of microinstructions and codes are stored.
These microinstructions and codes are employed to perform
the basic instructions of the calculator. They include
a plurality of coded and non-coded microinstructions for
transferring control to the input-output control logic,
for controlling the addressing and accessing of the memory
1046644
unit, and for controlling the operation of the two accumu-
lator registers, the program counter register, the extend
register and the arithmetic-logic unit. They also include
a plurality of clock codes for controlling the operation
of the programmable clock, a plurality of qualifier selec-
tion codes for selecting qualifiers and serving as primary
address codes for addressing the read-only memory of the
microprocessor, and a plurality of secondary address codes
for addressing the read-only memory of the microprocessor.
In response to a control signal from a power supply pro-
vided for the calculator, control signals for the pro-
grammable clock, and qualifier control signals from the
central processing and input-output control units, the
microprocessor issues the microinstructions and codes
stored in the read-only memory of the microprocessor as
required to process either binary or binary-coded-decimal
information entered into or stored in the calculator.
In the keyboard mode, the calculator is controlled
by keycodes sequentially entered into the calculator from
the keyboard input unit by the user. The solid state out-
put display unit displays either the alphanumeric repre-
sentation of the keys as they are depressed or a numeric
representation of output data or alphanumeric user instruct-
ions or program results. An external output printer unit
may be controlled by the user to selectively print a nu-
meric representation of any numeric data entered into
the calculator from the keyboard input unit, a numeric
representation of any result calculated by the calculator,
or a program listing on a line-by-line basis of the state-
ments entered
~046644
When the calculator is ln the keyboard mode, it
may also be operated in a print-all printing mode. The
output printer unit then prints out each program line as
it is entered by the userO
In the program running mode, the calculator is
controlled by automatically obtaining an internal repre-
sentation of the program statements stored in the user
storage section of the read-write memory, During automatic
operation of the calculator, data may be obtained from
the memory unit as designated by the program, from the
keyboard input unit while the operation of the calculator
i9 stopped for data either by the program or by the user,
or from the magnetic tape cassette unit as designated by
the program.
When the calculator is in the program running mode,
the user may also selectively employ a trace mode to check
the execution of the program line-by-line in order to
determine whether the program, as entered into the calcu-
lator, does in fact carry-out the desired sequence of state-
ments~
In the program entering mode, statements are se-
quentially entered by the user into the calculator from
the keyboard input unit and are translated into an inter-
nal stored format which consists of a series of operation
codes and operand names and are thereafter stored as state-
ments of a program in the user storage section of the read-
write memory.
The magnetic tape cassette reading and recording
unit may be employed by the user to separately load either
data, BASIC language programs, assembly language programs,
1046644
-- 3O--
or sets of user-deflnable ~ey definltlons lnto the calcu-
lator from an external magnetic tape cassette.
The magnetic tape cassette reading and recording
unit may also be employed by the user to separately re-
cord either data, BASIC language programs, or sets of user-
definable key definitions stored in the user section of
the read-write memory onto an external magnetic tape cas-
sette. Programs, or portions thereof, may be coded by
the user as being secure when they are recorded onto an
external magnetic tape cassette. The calculator detects
such programs when they are reloaded into the calculator
and prevents the user from re-recording them or obtain-
l~g any listing or other indication of the individual pro-
gram steps contained in the secured portions of such pro-
grams.
Description of the Drawings
Figure 1 is a front perspective view of an adapt-
able programmable calculator according to the preferred
embodiment of this invention.
Figure 2 is a rear perspective view of the adapt-
able programmable calculator of Figure 1.
Figures 3A-B are a simplified block diagram of
the adaptable programmable calculator of Figures 1 and 2.
Figures 4A-F are a memory map of the memory unit
employed in the adaptable programmable calculator of Fig-
' ures 1 3.
Figure 4' is a diagram showing the arrangement
of Figures 4A-F.
Figures 5A-B are a detailed memory map of the system
read-write section of memory as shown in Figure 4A.
3 1
1046644
Figure 5' is a diagram showing the arrangement
of Figures 5A-B.
Figure 6 is a detailed memory map of the user
read/write section of memory as shown in Figure 4F.
Figure 7 is a simplified operational logic flow
chart illustrating the operation of the microprocessor
employed in the central processing unit of Figures 3A-B.
Figure 8 is a plan view of the keyboard input unit
employed in the adaptable programmable calculator of Figures
1-3B.
Figure 9 is an overall firmware block diagram for
the adaptable programmable calculator.
Figures lOA-C are flow charts of floating point
add and subtract routines selectable by the execution monitor
of Figure 9.
Figure 11 is a flow chart of a floating point
multiply routine selectable by the execution monitor of
Figure 9.
Figures 12A-B are a flow chart of a floating
point divide routine selectable by the execution monitor
of Figure 9.
Figures 13A-C are a flow chart of a floating
point square root routine selectable by the execution
monitor of Figure 9.
Figure 14 is a flow chart of a store routine
selectable by the execution monitor of Figure 9.
Figure 15 is a flow chart of a rounding routine
employed in connection with several of the routines select-
able by the execution monitor of Figure 9.
Figures 16A-B are a flow chart of a tangent X
~0~6644
- 3a--
routine selec~able by the execution manitor of Figure 9.
Figures 17A-B are a flow chart of an arctangent
X routine selectable by the execution monitor of Figure 9.
Figures 18A-B are a flow chart of an e routine
selectable by the execution monitor of Figure 9.
Figure 19 is a flow chart of a natural logarithm
X routine selectable by the execution monitor of Figure 9.
Figure 20 is a flow chart of a subroutine employed
by the tangent X and ex routines of Figures 16A-B and
18A-B, respectively.
Figures 21A-B are a flow chart of a subroutine
employed by the tangent X and arctangent X routines of
Figures 16A-B and 17A-B, respectively.
Figures 22A-B are a flow chart of a subroutine
employed by the ex and natural logarithm X routines of
Figures 18A-B and 19, respectively.
Figure 23 is a flow chart of a subroutine employed
by the arctangent X and natural logarithm X routines of
Figures 18A-B and 19, respectively.
Figure 24 is a flow chart of sine and cosine rou-
tines selectable by the execution monitor of Figure 9.
Figure 25 is a flow chart of an X power routine
selectable by the execution monitor of Figure 9.
Figure 26 (27th sheet of drawings) is a flow chart
of a logarithm to the base ten routine selectable by the
execution monitor of Figure 9.
Figure 27 is a block diagram of the microprocessor
of Figures 3A-B.
Figures 28A-D are a detailed schematic diagram
of the microprocessor of Figures 3A-B and 27.
~0~6644
-3 3-
Figure 28' is a diagram showing the arrangement
of Figures 28A-D.
Figures 29A-H are detailed flow charts illustra-
ting the operation of the microprocessor of Figures 3A-B,
27, and 28A-D.
Figures 29' and 29" are diagrams showing the arrange-
ment of Figures 29A-H.
Figure 30 is a block diagram of the programmable
clock of Figures 3A-B.
Figures 31A-C are a detailed schematic diagram of
the programmable clock of Figures 3A-B and 30 and of a
portion of the input-output control unit of Figures 3A-B.
Figure 31' (55th sheet of drawings) is a diagram
showing the arrangement of Figures 31A-C.
Figure 32 is a waveform diagram illustrating the
operation of the programmable clock of Figures 3A-B, 30,
and 31A-C.
Figures 33A-D are a detailed schematic diagram
of the shift register and arithmetic logic units of Figures
3A-B.
Figure 33' is a diagram showing the arrangement
of Figures 33A-D.
Figure 34 is a block diagram of the arithmetic
logic unit of Figures 3A-B.
Figure 35 is a block diagram of the memory unit
of Figures 3A-B.
Figures 36A-B are a schematic diagram of the read-
write memory of Figures 3A-B, 4A-F, and 35.
Figure 36' is a diagram showing the arrangement
of Figures 36A-B.
. 1046644
~,.
Flgures 37A-B are a schematic diagram of the op-
tlonal add-on read-wrlte memory of Figures 3A-B, 4A-F,
and 35.
Flgure 37' is a diagram showing the arrangement
of Figures 37A-B.
Figure 38 is a schematic diagram of the basic
read-only memory of Figures 3A-B, 4A-F, and 35.
Figure 39 is a schematic diagram of the optional
add-on read-only memory modules of Figure 35 that may be
plugged into the calculator to increase the number of
functions available to the user.
Figure 40 is a detailed schematic diagram of the
buffer circuitry associated with the read-only memory mod-
ules of Figure 39.
Figure 41 is a block diagram of one of the read-
only memory chips of Figures 38 and 39.
Figures 42A-D are a schematic diagram of one of
the read-only memory chips of Figures 38 and 39.
- Figure 42' is a diagram showing the arrangement
of Figures 42A-D.
Figure 43 is a memory map of the memory unit of
Figures 3A-B and 4A-F illustrating how it is partitioned
into the read-only and read-write memory chips of Figures
36A-B through 42A-D,
Figure 44 is a flow chart illustrating how the
row members of the lists stored in the read-only memory
chips are computed.
Figure 45 is a table of bit numbers and actual bits
used in connection with the flow chart of Figure 44.
Figures 46A-B are a detailed schematic diagram of
- 3 ~ -
~046644
the memory address register of Figures 3A-B and 35 with
its associated control circuitry.
Figure 46' is a diagram showing the arrangement
of Figures 46A-B.
Figures 47A-B are a waveform diagram and state
sequence charts illustrating the operation of the control
circuitry of Figures 46A-B.
Figure 47' (65th sheet of drawings) is a diagram
showing the arrangement of Figures 47A-B.
Figures 48A-B are a detailed schematic diagram
of the memory access register of Figures 3A-B and 35.
Figure 48' is a diagram showing the arrangement
of Figures 48A-B.
Figures 49A-D are a detailed schematic diagram
of the input-output register and gating control circuits
employed in the input-output control unit of Figures 3A-B.
Figure 49' is a diagram showing the arrangement
of Figures 49A-D.
Figure 50 is a schematic diagram of the source
and relationship of the input-output party lines connected
to the peripheral interface module receiving receptacles
of Figure 20.
Figure 51 is a waveform diagram illustrating the
operation of the control section of the input-output con-
trol unit of Figures 3A-B and 32.
Figure 52 is a flow chart illustrating the opera-
tion of the control section of the input-output control
unit of Figures 3A-B and 31A-C.
Figure 53 is a diagram showing how a one-of-ten
decoder is employed to address peripheral input-output
1046644
- 3~-
units to the calculator through the input-output control
unit of Figures 3A-B,
Figure 54 is a waveform diagram of some of the in-
put signals employed by the input-output control unit and
associated interface modules of Figures 3A-B.
Figure 55 is a waveform diagram of some of the
output signals employed by the input-output control unit
and associated interface modules of Figures 3A-B.
Figure 56 is a waveform diagram of some of the
high speed input signals employed by the input-output con-
trol unit and associated interface modules of Figures 3A-B.
Figure 57 is a waveform diagram of some of the
high speed output signals employed by the input-output
control unit and associated interface modules of Figures
3A Bo
Figure 58 is a waveform diagram illustrating the
operation of the interrupt mode of operation of the input-
output control unit of Figures 3A-B.
Figure 59 is a schematic diagram of logic that
may be used to interface an X-Y plotter to the input-output
control unit of Figures 3A-B.
Figure 60 is a schematic diagram of logic that
may be used to interface a printing unit to the input-
output control print of Figures 3A-B.
Figure 61 is a schematic diagram of logic that
may be used to interface a modem to the input-output con-
trol unit of Figures 3A-B.
Figure 62 is a schematic diagram of logic that
may be used to transfer any eight-bit code into or out
of the input-output control unit of Figures 3A-B.
104~6~4
- -31-
Figure 63 is a detailed schematic diagram of the
keyboard input unit employed in the adaptable programmable
ealculator of Figures 1-3B.
Figure 64 iS a block diagram of the magnetic tape
eassette reading and recording unit employed in the cal-
culator of Figures 1-3B.
Figure 65 iS a detailed schematic diagram of the
interface block of Figure 64.
Figures 66A-B are a detailed schematic diagram
of the eontrol logic block of Figure 64.
Figure 66' is a diagram showing the arrangement
of Figures 66A-B.
Figures 67A-B are a detailed sehematie diagram
of the read-write bloek of Figure 64.
Figure 67' iS a diagram showing the arrangement
of Figures 67A-B.
Figures 68A-B are a detailed sehematie diagram
of the motor eontrol bloek of Figure 64.
Figure 68' iS a diagram showing the arrangement
of Figures 68A-B.
Figure 69 iS a detailed sehematie diagram of the
intereonneet bloek of Figure 64.
Figure 70 iS a detailed schematic diagram of the
head driver and preamp blocks of Figure 6 4.
Figure 71 iS a bloek diagram illustrating how the
magnetie tape eassette reading and reeording unit of Figures
64-70 interaets with the ealeulator of Figures 1-3B.
Figures 72A-B are a detailed sehematie diagram of
the output display unit employed in the adaptable program-
mable ealeulator of Figures 1- 3B.
104~644
-38-
Figure 72' is a diagram showing the arrangement
of Figures 72A-B.
Figures 73A-B are a detailed schematic diagram of
the control logic circuit associated with the output dis-
play unit of Figures 72A-B.
Figure 73 ' iS a diagram showing the arrangement
of Figures 73A-B.
Figure 74 iS a block diagram of the power supply
system employed in the adaptable programmable calculator
of Figures 1- 3B .
Figures 75A-B are a detailed schematic diagram
of the power supply system of Figure 74.
Figure 75 ' is a diagram showing the arrangement
of Figures 75A-B.
Figures 76A-B are a block diagram of an interface
module that may be employed to interface a typewriter to
the adaptable programmable calculator of Figures 1-3B.
Figure 76 ' iS a diagram showing the arrangement
of Figures 76A-B.
Figures 77A-B are a flow chart of an input-output
routine performed when a typewriter is employed with the
programmable calculator of Figures 1-3B.
Figure 77 ' iS a diagram showing the arrangement
of Figures 77A-B.
Figures 78A-D are a detailed schematic diagram
of the control logic block of Figures 76A-B.
Figure 78 ' is a diagram showing the arrangement
of Figures 78A-D.
Figures 79A-B are a detailed schematic diagram
of the power gates of Figures 76A-B.
1046~;44
_ ~q_
Figure 79' (133rd sheet of drawings) is a diagram
showing the arrangement of Figures 79A-B.
Figures 80A-B are a simplified logic diagram show-
ing state qualifiers and instructions relating to the
flow chart of Figures 77A-B.
Figure 81 is a detailed schematic diagram of the
ROM, data latch, and compare circuitry of Figures 76A-B.
Figure 82 is a detailed schematic diagram of a
power supply that may be employed to power the typewriter
interface circuitry of Figures 78A-D, 79A-B, and 81.
Figure 83 is a flow chart of the turn-on routine
which is a portion of the system monitor of Figure 4B.
Figures 84A-D are a flow chart of a routine com-
prising another portion of the system monitor of Figure
4B.
Figure 85 is a flow chart of the system table scan
routine of Figure 4D.
Figure 86 is a flow chart of a subroutine called
by the routine of Figure 85.
Figure 87 is a flow chart of the table search rou-
tine of Figure 4A.
Figures 88A-G are a flow chart of the keyboard
input routine and special keyboard functions routines of
Figure 4A.
Figures 89A-B are flow charts of subroutines called
by the routines of Figures 88A-G.
Figure 90 is a flow chart of the clear subroutine
called by various ones of the routines of Figures 4A-F.
Figure 91 is a flow chart of a subroutine called
by the routine of Figure 88F.
~046644
~ --~o--
Flgure 92 is a flow chart of a ~ubroutine called
by the keyboard input routine of Figures 4A and 88A-G.
~ igure 93 is a flow chart of a keyboard driver
subroutine called by the subroutine of Figure 92,
Figures 94A-F are flow charts of some of the gen-
era~ system subroutines of Figure 4Ao
~ igure 95 is a flow chart of the error routine
of Figure 4B.
Figures 96A-D are flow charts of the program memory
manager routines of Figure 4B.
Figure 97 is a flow chart of another of the gen-
eral system subroutines of Figure 4A which is also
called by the routines of Figures 96A-D~
Figure ~8 is a flow chart of another of the gen-
eral system subroutines of Figure 4A~
Figures 99A-F are flow charts of the user-definable
key routines of Figure 4A.
Figures lOOA-D are flow charts of the execution
monitor and keyboard execution control blocks of Figure 4C~
. Figure 101 is a flow chart of the load execution
routine of Figure 4D~
~igure 102 is a flow chart of the store executio~
routine of Figure 4D~
Figure 103 is a flow chart of the merge execution
routine of Figure 4D~
Figure 104 is a ~low chart of the link execution
routine of Figure 4Do
Figure 105 is a flow chart of the find execution
routine of Figure 4D~
Figures 106A-D are flow charts of subroutines
- 10~6644
~1
called by the execution routines of Figures 101-104.
Figure 107 is a flow chart of the load data execu-
tion routine of Figure 4D.
Figure 108 is a flow chart of the store data execu-
tion routine of Figure 4D.
Figure 109 is a flow chart of a subroutine called
by the routines of Figures 107 and 108.
Figure 110 is a flow chart of the load key execu-
ti~n routine of Figure 4D.
Figure 111 is a flow chart of the store key execu-
tion routine of Figure 4D.
Figure 112 is a flow chart of the load bin execu-
tion routine of Figure 4D.
Figure 113 is a flow chart of the mark execu-
tion routine of Figure 4D.
Figure 114 is a flow chart of a subroutine called
by the routine of Figure 113.
Figure 115A is a flow chart of the list execution
routine of Figure 4D.
Figure 115B is a flow chart of a subroutine called
by the routine of Figure 115A.
Figure 116 is a flow chart of the secure routine
of Figure 4D~
Figures 117A-B are a flow chart of the interrupt
routine of Figure 4D.
Figures 118A-B are a flow chart of a routine for
performing an OFFSET command selectable when the plotter
plug-in read-only memory module is employed with the cal-
culator.
Figure 119 is a flow chart of a routine for
1046644
performing an IPLOT command selectable when the plotter
plug-in read-only memory module is employed with the calculator.
Figure 120 is a flow cha~t of a routine for per-
forming a LABEL command selectable when the plotter plug-
in read-only memory module is employed with the calculatorO
Figure 121 is a flow chart of a routine for per-
forming a LETTER command selectable when the plotter plug-
in read-only memory module is employed with the calculator.
Figure 122 is a flow chart of a routine for per-
forming a CPLOT command selectable when the plotter plug-
in read-only memory module is employed with the calculator.
Figure 12~ is a flow chart of a subroutine employed
by the routine of Figure 122.
Figure 124 is a flow chart of a routine for per-
forming XAXIS and YAXIS commands selectable when the plotter
plug-in read-only memory module is employed with the cal-
culator,
Figures 125A-C are flow charts of subroutines
called by the routine of Figure 124.
Figures 126A-C are flow charts of subroutines
called by the routines of Figures 118-124,
Figure 127 is a flow chart of a primary entry rou-
tine employed when the terminal read-only memory module
is plugged into the calculator.
Figures 128A-W are a flow chart of a keyboard input
and editing routine employed when the terminal read-only
memory module is plugged into the calculator.
Figures 129A-B are a flow chart of a modem inter-
rupt service routine employed when the terminal read-only
memory module is plugged into the calculator.
- 104664~4~ -
Figure 130 is a f~ow chart of a secondary entry
routine employed when the terminal read-only memory module
is plugged into the calculator. ~
Figure 131 is a flow chart of an output statement
routine employed when the extended input-output read-only
memory module is plugged into the calculator.
Figures 132A-D are flow charts of subroutines called
by the routine of Figure 131.
Figure 133 is a flow chart of a BIN command selectable
when the extended input-output plug-in read-only memory
module is employed with the calculator.
Figure 134 is a flow chart of a CHAR command select-
able when the extended input-output plug-in read-only memory
modu~e is employed with the calculator.
Figure 135 is a flow chart of a STAT command select-
able when the extended input-output plug-in read-only
memory module is employed with the calculator.
Figure 136 is a flow chart of binary ROTATE, AND,
~o~ ~a,,~s
and OR ~omman~ selectable when the extended input-output
plug-in read-only memory module is employed with the calcu-
latorO
1046644
Description of the Preferred Embodiment
GENERAL DESCRIPTION
Referring to Figures 1 and 2, there is shown an
adaptable programmable calculator 10 including both a key-
board input unit 12 for entering information into and
controlling the operation of the calculator and the magnetic
tape cassette reading and recording unit 14 for recording in-
formation stored within the calculator onto one or more ex-
ternal tape cassettes 16 and for subsequently loading the
information recorded on these and other similar magnetic tape
cassettes back into the calculatorO The calculator also in-
cludes a solid state output display unit 18 for displaying
alphameric information stored within the calculatorO All of
these input and output units are mounted within a single cal-
culator housing 24 adjacent to a curved front panel 26 there-
of.
As shown in Figure 2, a plurality of peripheral
input and output units including, for example, a line printer,
a digitizer, a marked card reader, an X-Y plotter, a type-
writer, a teletypewriter, an extended read-write memory unit,
a magnetic disc reading and recording unit, and a modem for
connecting the calculator via telephone lines to a remotely
located computer, may be connected to the calculator at the
same time by simply inserting interface modules 30 associated
with the selected peripheral units into any of four receptacles
32 provided therefor in a rear panel 34 of the calculator
housing. As each interface module 30 is inserted into one
of these receptacles, a spring-loaded door 38 at the en-
trance of the receptacle swings down allowing passage of the
interface module. Once the interface module is fully inserted,
- 104664~
a printed-circuit terminal board 40 contained within the
interface module plugs into a mating edge connector mounted
inside the calculator. If any of the selected peripheral
units require AC line power, their power cords may be
plugged into either of two AC power outlets 42 provided
therefor at the rear panel of calculator housing 24.
Referring to the simplified block diagram shown in
Figures 3A-B, it may be seen that the calculator also in-
cludes an input-output control unit 44 (hereinafter referred
to as the I/0 control unit) for controlling the transfer of
information to and from the input and output units, a memory
unit 46 for storing and manipulating information entered
into the calculator and for storing routines and subroutines
of basic instructions performed by the calculator, and a
central processing unit 48 (hereinafter referred to as the
CPU) for controlling the execution of the routines and sub-
routines of basic instructions stored in the memory unit as
required to process information entered into or stored within
t-he calculator. The calculator also includes a bus system
comprising an ~-bus 50, a T-bus 52, and an ~-bus 54 for
transferring information from the memory and I/0 control
units to the CPU, from the CPU to the memory and I/0 control
units, and between different portions of the CPU. It further
comprises a power supply for supplying DC power to the calculator
and peripheral units employed therewith and for issuing a
control signal POP when power is supplied to the calculator.
The I/0 control unit 44 includes an input-output
register 56 (hereinafter referred to as the I/0 register),
associated I/0 gating control circuitry 58, and input-output
control logic 60 (hereinafter referred to as the I/0 control),
- 104~
I/0 register 56 comprises a universal sixteen-bit shift re-
gister into which information may be transferred either
bit-serially from CPU 48 via T-bus 52 or in parallel from
keyboard input unit 12, magnetic tape cassette reading and
recording unit 14, and peripheral input units 28 such as the
marked card reader via twelve input party lines 62. Informa-
tion may be transferred from I/0 register 56 either bit-
serial~y to ~PU 48 ~ia ~-bus 50 or in parallel to magnetic
tape cassette reading and recording unit 14, solid state
output display unit 18, output printer unit 20, and peripheral
output units 28 such as the X-Y plotter or the typewriter
via sixteen output party lines 640
I/0 gating control circuitry 58 includes control
circuits for controlling the transfer of information into
and out of I/0 register 56 in response to selected I/0
qualifier control s~gnals from CPU 48 and selected I/0
control instructions from I/0 control 60. It also includes
an interrupt control circuit 65, a peripheral control circuit
669-a printer control circuit 68, and a display control
circuit 69 for variously controlling the input and output
units and issuing control signals QFG and EBT to I/0 control
60 via two output lines 71 and 72. These last mentioned
control circuits variously perform their control functions in
response to control signal POP from the power supply, I/0
qualifier control signals from CPU 48, I/0 control instructions
from I/0 control 605 and control signals from keyboard input
unit 12. Interrupt control circuit 65 initiates the transfer
of information into I/0 register 56 from keyboard input
unit 12 or interrupting peripheral input units 28 such as
the marked card reader and issues a qualifier control signal
~046644
QNR to CPU 48 via output lines 73. Peripheral control
circuit 66 enables interface modules 30 plugged into the
calculator to respond to information from I/0 register 56,
control associated peripheral units 28, transfer information
to and/or receive information from associated peripheral
units 28, and in some cases initiate the transfer of infor-
mation to I/0 register 56 from the interface modules them-
selves. Printer control circuit 68 and display control cir-
cuit 69 enable output display unit 18, and output printer unit
205 respectively, to respond to information from I/0 register
56.
When a basic I/0 instruction obtained from memory
unit 46 is to be executed, CPU 48 transfers control to I/0
control 60 by issuing a pair of I/0 microinstructions PTR
and 2~ thereto. In response to these I/0 microinstructions
from CPU 48, control signal POP from the power supply, control
signals QFG and EBT from I/0 gating control circuitry 58,
and I/0 qualifier and clock control signals from CPU 48, I/0
control 60 selectively issues one or more I/0 control in-
structions to gating control circuitry 58 as required to
execute the basic I/0 instructions designated by CPU 48 and
issues control signals, ~T~, XTR, QRD, and SCB to CPU 48 via
output lines 74-77. The I/0 qualifier control signals
issued to I/0 control 60 and gating control circuitry 58
by CPU 48 are derived from the basic I/0 instruction to be
executed. Those qualifier control signals issued to I/0
control 60 designate the specific I/0 control instructions
to be issued by I/0 control 60, while those issued to gating
control circuitry 58 designate selected control circuits to
be employed in executing the basic I/0 instruction.
- ~046644
-~a-
Memory unit 46 includes a modular random-access
read-write memory 78 (hereinafter referred to as the RWM),
a modular read-only memory 80 (hereinafter referred to as
the ROM), a memory address register 82 (hereinafter referred
to as the M-register), a memory access register 84 (herein-
after referred to as the T-register), and control circuitry
85 for these memories and registers. The RWM 78 and ROM 80
comprise MOS-type semiconductor memories. As shown in the
memory map of Figures 4A-F the basic RWM 78 contains a
dedicated system storage section of 256 sixteen-bit words
extending from address 1400 to address 1777 and a separate
user program and/or data storage section of 1792 sixteen-
bit words extending from address 40400 to address 43777. Al
addresses on the memory map are represented in octal formO
An optional 2048 sixteen-bit words of RWM may be
made available to the user at address 44000 to address 47777.
This is accomplished by removing a top panel 90 of the
calculator housing shown in Figure 1, and inserting an ad-
ditional printed circuit board containing the optional
memory. The additional RWM is automatically accommodated
by the calculator.
As shown in the more detailed memory map of Figures
5A-B, the RWM dedicated system storage section includes 52
words (addresses 1400-1463) containing information in the
form of mnemonic variables which is employed by the firmware
routines shown in Figure 9. A more detailed description of
these mnemonic variables is given on page 21 of the calculator
basic system firmware listing located elsewhere in this
specification. Addresses 1466-1477 and 1701-1737 are used as
temporary storage by the various routines shown in Figure 9.
1~46644
--4'q -
Addresses 1500-1550 comprise a 41-word buffer used to contain
the input characters during syntax analysis, Addresses
1551-1621 comprise a 41-word buffer used by the single line
display refresh routine of Figure 9. These 41 words along
with 42 additional words (addresses 1622-1673) are used as a
syntax buffer during syntax analysis. Four of these words
(addresses 1622-1625) are used as temporary registers by
severa~ of the statement execution routines of Figure 9.
Eight words (addresses 1630-1637) are used as two temporary
floating point number registers by the formula evaluation
routines of Figure 9. Addresses 1640-1677 comprise 32
words wh~ch are used by the statement execution routines of
Figure 9e Eight words (addresses 1744-1747 and 1754-1757)
are employed as "ARl" and "AR2" four-word working registers
for perfQrming binary-coded-decimal arithmetic. An additional
eight words ~addresses 1740-1743 and 1750-1753) are employed
as working data registers ''Xc'' and "Yc" for implementation
of the trigonometric functions. These sixteen words (addresses
1740-1757? are used as temporary storage registers by all the
routines of Figure 9 except the statement execution and
formula evaluation routines. A variable-length "system sub-
routine stack" (addresses 1760-1772) is employed for storing
return addresses required by programs stored in ROM 80. Four
words (addresses 1773-1776) are used to store the result of
the latest keyboard computation. The last word in the system
~WM (address 1777) is used to store a pointer indicating the
next available location for the return address of the next
subrout~ne call within the basic system. A complete assembly
language description of the system RWM is included in pages
21-24 of the calculator basic system firmware listing.
1046644
--~o--
As shown in the memory map of Figures 4A-F and the
more detailed memory map of Figure 6, user program and/or
data storage section of RWM 78 contains 1760 words available
to the user (as user addresses 40440-43777) for storing pro-
grams and/or data, 20 words dedicated for use by the interrupt
routine of Figures 9 and 117A-B, and 12 words available for
use by plug-in read-only memory modules. An additional 2048
sixteen-bit words may be made available to the user (as user
addresses 44000-47777).
Also, as shown in the memory map of Figures 4A-B,
the basic ROM 80 contains 7680 sixteen-bit words extending
from address 0000 to address 1377, from address 2000 to ad-
dress 16777, and from address 40000 to address 40377. Rou-
tines and subroutines of basic instructions for performing
the basic functions of the calculator and constants employed
by these routines and subroutines are stored in these por-
tions of ROM 80. An additional 8192 sixteen-bit words of
ROM may also be added at addresses 20000-37777 in steps of
512 and 1,024 words. This is accomplished by simply inserting
plug-in ROM modules 92 into receptacles provided therefor
within the calculator which are accessible through a door in
the left panel of the calculator housing as illustrated in
Figure 1. As each plug-in ROM module 92 is inserted into one
of these receptacles a printed circuit terminal board 96 con-
tained within the plug-in ROM module plugs into a mating edge
connector mounted inside the calculator. A handle pivotally
mounted at the top end of each plug-in ROM module 92 facili-
tates removal of the plug-in ROM module once it has been fully
inserted into one of the receptacles.
Routines and subroutines of basic instructions
0~6644
5~ -
(and any needed constants) for enabling the calculator to
perform many additional functions are stored in each plug-in
ROM module 92. The user himself may therefore quickly and
simply adapt the calculator to perform many additional
functions oriented toward his specific needs by simply
plugging ROM modules of his own choosing into the calculator.
Added plug-in ROM modules are automatically accommodated by
the calculator.
Referring again to Figures 3A-B, M-register 82 of
the memory unit comprises a recirculating sixteen-bit serial
shift register into which information may be transferred
bit-serially from CPU 48 via T-bus 52 and out of which in-
formation may be transferred bit-serially to CPU 48 via
~-bus 50. Information shifted into M-register 82 may be
employed to address any word in RWM 78 or ROM 80 via fifteen
output lines 106.
T-register 84 of the memory unit comprises a re-
circulating sixteen-bit serial shift register into which
,
information may be transferred either bit-serially from CPU
48 via T-bus 52 or in parallel from any addressed word in
RWM 78 and ROM 80 via sixteen parallel input lines 108. In-
formation may be transferred from T-register 84 either bit-
serially to CPU 48 via ~-bus 50 or parallel to any addressed
w o ~ d
in RWM 78 via sixteen parallel output lines llO. The
four least significant bits of information contained in
T-register 84 may comprise binary-coded-decimal information
a~
*ff~ may be transferred from the T-register in parallel to CPU
48 via three parallel output lines 112 taken with ~-bus 50.
The control circuitry 85 of the memory unit controls
these transfers of information into and out of M-register 82
-5~-
1046644
and T-register ~4, controls the addressing and accessing of
RWM 78 and ROM 80, and refreshes RWM 780 It performs these
functions in response to memory microinstructions, memory
clock pulses, and shift clock pulses from CPU 48.
CPU 48 includes a register unit 114, an arithmetic-
logic unit 116 (hereinafter referred to as the ALU), a pro-
grammable clock 118, and a microprocessor 120. Register unit
114 comprises four recirculating sixteen-bit shift registers
1225 124, 126, and 128 and one four-bit shift register 130.
Shift registers 122 and 124 serve as sixteen-bit serial ac-
Gumulator registers (hereinafter referred to as the A-register
and the B-register, respectively) into which information may
be transferred bit-serially from ALU 116 via T-bus 52 and out
of which information may be transferred bit-serially to ALU
116 via R-bus 54. The four least significant bit positions
of A-register 122 also serve as a four-bit parallel accumulator
register into which four bits of binary-coded-decimal infor-
mation may be transferred in parallel from ALU 116 via four
parallel input lines 132 and out of which four bits of binary-
coded-decimal information may also be transferred in parallel
to ALU 116 via three parallel output lines 134 taken with ~-bus
54~
Shift register 126 serves as a sixteen-bit system
program counter (hereinafter referred to as the P-register)
into which information may be transferred bit-serially from
ALU 116 via T-bus 52 and out of which information may be
transferred bit-serially to ALU 116 via R-bus 54. Informa-
tion contained in the least significant bit position of
P-register 126 may also be transferred as a qualifier control
signal QPO to microprocessor 120 via output line 135.
1046644
53-
Shift register 1~8 serves as a sixteen-bit qualifier
register (hereinafter referred to as the Q-register) into
which information may be transferred bit-serially from ALU
116 via T-bus 52 and out of which information may be trans-
ferred bit-serially to ALU 116 via ~-bus 54. Information
contained in the five least significant bit positions of
Q-register 128 is transferred to I/0 gating control
circuitry 58 as five one-bit I/0 qualifier control signals
Q00-Q04 via five parallel output lines 136, and information
contained in the six next least significant bit positions
of the Q-register is transferred to I/0 control 60 as six
one~bit I/0 qualifier control signals Q05-Q10 via six
parallel output lines 138. Similarly, information contained
in the seven least significant, the ninth and eleventh
least signifiGant, and the most significant bit positions of
Q-register 128 and information derived from the thirteenth,
fourteenth, and fifteenth bit positions of the Q-register
may be transferred to microprocessor 120 as eleven one-bit
microprocessor qualifier control signals Q00-Q06, Q08, Q10,
Q15, and QMR via eleven output lines 140. Information con-
tained in the twelfth through the fifteenth least significant
bit positions of Q-register 128 may be transferred to micro-
processor 120 as a four-bit primary address code via four
parallel output lines 142.
Shift register 130 serves as a four-bit serial
extend register (hereinafter referred to as the E-register)
into which information may be transferred bit-serially either
from ALU 116 via T-bus 52 or from the least significant bit
position of T-register 84 via input line 144. Information
may also be transferred out of E-register 130 to ALU 116
10466~4
5~
via ~-bus 54.
Register unit 114 also includes control circuitry
146 for controlling the transfer of parallel binary-coded-
decimal information into and out of A-register 122 and the
transfer of serial binary information into and out of A-
register 122, ~-register 124, P-register 126, Q-register
128, and E-register 130. This is accomplished in response
to register microinstructions from microprocessor 120,
control signals ~T~ and XTR from I/0 control 60, and shift
clock control pulses from programmable clock 118. Control
circuitry 146 includes a flip-flop 148 (hereinafter referred
to as the A/~ flip=flop) for enabling the transfer of in-
formation into and out of either the A-register 122 or the
B-register 124 as determined by the state of the A/B flip-
flopc The state of A/B flip-flop 148 is initially determined
by information Qll transferred to the A/B flip-flop from the
twelfth least significant bit position of Q-register 128 but
may be subsequently complemented one or more times by micro-
instruction CAB from microprocessor 120.
~LU 116 may perform either one-bit serial binary
arithmetic on data received from T-register 84 or M-
register 82 via S-bus 50 and/or from any register of
register unit 114 via R-bus 54 or four-bit parallel binary-
coded-decimal arithmetic on data received from T-register
84 via output lines 112 taken with ~-bus 50 and/or from A-
register 122 via output lines 134 taken with ~-bus 54. It
may also perform logic operations on data received from
memory unit 46 and/or register unit 114 via any of these
lines. The arithmetic and logic operations performed are
~0 designated by ALU microinstructions from microprocessor 120
10~6644
- --55--
and are carried out in response to these microinstructions,
shift clock control pulses from programmable clock 118,
and control signal SCB from I/0 control 60. Information is
also transferred from ALU 116 to A-register 122 via output
lines 132 or to I/0 register 56, M-register 82, T-register 84,
or any register of register unit 114 via T-bus 52 in response
to microinstructions and control signals applied to these
registers. If a carry results while ALU 116 is performing
either one-bit serial binary arithmetic or four-bit parallel
binary-coded-decimal arithmetic, the ALU issues a corresponding
qualifier control signal QBC ~ QDC to microprocessor 120
via one of two output lines 152 and 154.
Programmable clock 118 includes a crystal-controlled
system clock 156, a clock decoder and-generator 158, and
a control gate 160. System clock 156 issues regularly re-
curring clock pulses to clock decoder and generator 158 via
output line 162. In response to these regularly recurring
clock pulses from system clock 156 and to four-bit clock
codes from microprocessor 120, clock decoder and generator
158 issues trains of n shift clock pulses to ALU 116, M-
register 82, T-register 84, and all of the registers of
register unit 114 via output line 164. These trains of n
shift clock pulses are employed for shifting a corresponding
number of bits of serial information into or out of any of
these registers or for shifting a carry bit in the ALU. The
number n of pulses in each of these trains may vary from
one to sixteen as determined by the number of bits of serial
information required during each operation to be performed.
In response to a control signal CC0 from microprocessor 120,
control gate 160 prevents any shift clock pulses from being
- ~0~6644
~ ,
applied to the ALU or any of these registers. Upon completion
of each train of n shift clock pulses, clock decoder and
generator 158 issues a ROM clock pulse to microprocessor 120
via output line 166 and an I/O clock pulse to I/O control
60 via output line 168. In response to the regularly re-
curring clock signal from system clock 56, clock decoder and
generator 158 also issues correspondingly regularly recurring
memory clock pulses to memory unit 46 via output line 1700
Microprocessor 120 selectively issues two I/O
microinstructions to I/O control 60 via two output lines
~72~ six memory microinstructions to memory unit 46 via
six output lines 174, thirteen register microinstructions
to register unit 114 via thirteen output lines 176, and
five ALU microinstructions to ALU 116 via five output lines
178. It also issues a four-bit clock code associated with
each of these microinstructions to clock decoder 158 via
four output lines 180. These microinstructions and associated
clock codes are issued as determined by the control signal
POP from the power supply, the eleven microprocessor qualifier
control signals from Q-register 128, the four-bit
primary address codes from Q-register 128, and the five
microprocessor qualifier control signals from I/O control 60,
interrupt control 65, ALU 116, and P-register 126.
As shown in the simplified flow chart of Figure 7,
microprocessor 120 executes a hardware diagnostic routine
(stored within the microprocessor itself) in response to
the control signal POP. Upon completion of this diagnostic
routine, ALU 116 issues the qualifier control signal QBC
indicating whether or not the diagnostic routine was suc-
cessful. Microprocessor 120 thereupon responds to this
1046644
- -57-
qualifier control signal ~y entering the basic machine operating
loop and issuing microinstructions causing a sixteen-bit
instruction stored in ROM 80 to be,loaded into T-register
84 and transferred from there to Q-register 128. Micropro-
cessor 120 thereupon sequentially responds to one or more
additional qualifier control signals by issuing micro-
instructions and associated clock codes for executing the
instruction then contained in Q-register 128 and causing
another sixteen-bit instruction stored in ROM 80 to be
loaded into T-register 84 and transferred from there to the
Q-register. When an instruction requiring multiple branching
is contained in Q-register 128, microprocessor 120 issues a
pair of microinstructions ~ and XTR causing the micro-
processor to respond to a four-bit primary address code
from the Q-register by issuing additional microinstructions
and associated clock codes for executing the instruction
contained in the Q-register.
As illustrated by the basic machine operating loop
shown in the flow chart of Figure 7, microprocessor 120
initially responds to the qualifier control signal QNR
either by issuing microlnstructions and associated clock
codes for interrupting the basic machine operating loop and
executing an I/O service routine or by issuing microinstruc-
tions and associated clock codes for loading A/B flip-flop
148 with the information Qll contained in Q-register 128.
The manner in which microprocessor 120 responds is deter-
mined by the condition of the qualifier control signal QNR,
which in turn indicates whether or not the basic machine
operating loop should be interrupted.
3G Assuming the basic machine operating loop is not to
1046644
--58-
be interrupted, microprocessor 120 loads the information
Qll into A/~ flip-flop 148 and responds to the qualifier
control signal QMR either by iss~ing microinstructions for
transferring an address portion of the instruction contained
in Q-register 128 from T-register 84 into M-register 82 or
~y responding to another qualifier control signal Q15.
Again, the manner in which microprocessor 120 responds is
determined by the condition of the qualifier control signal
QM~s which in turn indicates whether or not the instruction
1~ contained in Q-register 128 is a memory reference instruction.
Assuming the instruction contained in Q-register
128 is a memory reference instruction, microprocessor 120
transfers the required address information into the M-
register 82 and responds to qualifier control signal Q10
either by issuing microinstructions and associated clock
c~des to select the base page of the memory (iOe. page 0)
or by issuing microinstructions and associated clock codes
to select the current page of the memory (i.e. the page
from which the instruction contained in Q-register 128 was
o~tained)r In either case, the microprocessor then issues
microinstructions as required to read data from the preset
page of the memory at the address designated by the address
information last transferred into M-register 82. Upon
completion of this operation, microprocessor 120 responds
to qualifier control signal Q15 by issuing additional micro-
instructians and associated clock codes to execute an in-
direct memory access operation if the condition of t liS
qualifier control signal indicates that the address informa-
tion contained in M-register 82 is indirect.
~0 Assuming the address information contained in M-register
'~ 1046644
~ 9 _
82 is direct (or upon completion of the indirect memory
access operation), microprocessor 120 issues micro-
instructions and associated clock codes causing the micro-
processor itself to respond to a four-bit primary address
code from the Q-register. The microprocessor responds by
issuing additional microinstructions and associated clock
codes for executing whichever one of ten possible memory
reference instructions is contained in Q-register 128 and
designated by the four-bit primary address code. Following
execution of the designated memory reference instruction,
microprocessor 120 issues microinstructions and associated
clock codes causing another sixteen-bit instruction stored
in ROM 80 to be loaded into T-register 84 and transferred
from there to Q-register 128, thereby beginning another cycle
of the basic machine operating loop.
~s illustrated by other possible paths of the basic
machine operating loop shown in Figure 7, microprocessor 120
sequentially responds to other qualifier control signals
when other types of instructions are contained in Q-register
128. For example, when an I/O instruction is contained in
Q-register 128, microprocessor 120 sequentially responds to
qua~ifier control signals QNR, QMR, Q15, Q10, and QRD by
issuing microinstructions and associated clock codes to
execute the I/O instruction. It should be noted that the
microprocessor qualifier control signals not shown in the
simplified flow chart of Figure 7 are variously contained
within those flow chart blocks requiring decisions as will
hereinafter become apparent.
The calculator firmware operational diagram of
Figure 9 illustrates the basic components of the calculator
~046644
~ --~o-
firmware. These components comprise routines which reside in
the calculator ROM 80 and serve to implement the definition
of the calculatorO Control information passing between routines
is represented by solid lines on the drawing.
Referring to Figure 9, it is shown that the calculator
hardware units are controlled by firmware routines contained
in ROM 80 These units comprise an on-off power switch 182,
an alphanumeric keyboard input unit 12, a display unit 18, and
a magnetic tape cassette reading and recording unit 14. The
firmware routines also control an external printer 20, external
tape cassette reading and recording units 14, and various
other external input-output devices 244.
Operation of the calculator is begun by placing the
on-off switch in the ~'on" position, thus forcing the hardware
internal to the calculator to execute the instruction located
at address 0000 of ROM 80. This instruction directs control
to the start-up routine 200, which is shown in the flowchart
of Figure 835 and described in detail on page 53 of the basic
system firmware listing. The purposes of this routine are to
initialize RWM 78, set the stack pointer address at location
1777, set the keyboard execution numeric output format to
float 9, initialize certain variables in the system RWM area
for later use by other firmware routines, and initialize the
various read-write pointers to the user read-write memory area
shown in detail in the memory map of Figure 6.
~fter completion of the start-up routine, control is
passed to the keyboard monitor routine 202 shown in the flow-
chart of Figures 84A-D and detailed on pages 53-56 of the
basic system firmware listing. This routine initializes
certain variables in the system RWM 78
~046644
for use by the keyboard illpUt routine 204. It also outputs
the automatic line number if necessary. It then calls for an
input record from the keyboard input routine 204. When the
keyboard input routine returns with a record the keyboard
monitor routine searches the mnemonic tables in the assembly
language program area shown in Figure 6. It then searches
the mnemonic tables in each of the plug-in read-only memory
modules of Figure 4E and finally searches the mnemonic tables
of the main system ROM 80. A complete assembly language
listing of each of the tables in read-only memory is given in
the firmware listings. The subroutines which do the search
of the mnemonic tables are detailed in the flowcharts of
Figures 85~ 86, and 87 If a match is found between the
~haracters of the input record and any of the mnemonic tables,
the keyboard monitor branches through a jump table to the
appropriate syntax routine 210 for syntax analysis if the
mnemonic is a statement, or branches through a jump table
for execution if the mnemonic is a system command. A separate
syntax analysis routine is provided for each statement and a
separate execution routine is provided for each system command.
Syntax and execution routines for statements and commands on
an optional read-only memory module are contained in the firm-
ware of that module. The assembly language program area is
handled in the same fashion as the plug-in read-only memory
module. If no mnemonic is found, control is passed to the
implied LET syntax routine.
The keyboard input routine 204 is detailed in the
flowcharts of Figures 88A-G, 89A-B, and 90-93. It calls on
the display refresh routine 206 to refresh the 32 character
single line display 18 between key entries. The display
104.~6~ ~
refresh routine is detailed on page 35 of the firmware listing.
When a key is entered through the alphanumeric keyboard 12,
the interrupt circuitry causes the calculator to execute the
instruction at address 00002. This instruction causes a
jump to the interrupt routine 208, which is detailed in the
~ 5~ 8
flowchart of Figures 117A-B and pages ~7 ~ of the firmware
listing. The interrupt routine 208 saves the keycode in a
,
memory location of the system RWM 78 and returns. The key-
board input routine 204 reads this memory word and decides
what operations need to be performed for that particular
keycode. The shift bit is stripped from the keycode and
stored as a flag in a temporary location in system RWM 78.
If the key requires that a mnemonic name be displayed, the
single line display buffer shown in Figures 5A-B is cleared
and the mnemonic name is entered. If an editing function is
required, a routine is called to perform the editing function.
If a user-definable key f0-f9 has been given, the user-
definable key routine 228 is called. If an alphanumeric key
has been given, the shift flag in RWM 78 is tested, and, if
the shift has been given, the keycode is converted to the code
for the shifted key. Then the keycode is inserted into the
single line display buffer shown in Figures 5A-B, either at
the end of the line or at the cursor position, if the cursor
is within the line.
The user-definable key routines 228 perform the
special operations for keys f0-f9. They are detailed in the
flowcharts of Figures 99A-F and pages 43-47 of the firmware
listing.
The syntax routines 210 translate the characters of
the input record into an internal format which is more easily
1046644
~andled by the execution routines. If a syntax error is
encountered control is passed to the error routine 238 which
outputs an error message. The error routine is shown in the
flowchart of Figure 95 and the firmware listing at pages 58
and 59. If no error is found, control is passed to either
the memory management routines 236, if the statement is to
be stored in memory, or to the routine for initialization for
keyboard execution if the statement is to be executed. The
memory management routines are shown in the flowcharts of
Figures 96A-D, 975 and 98 and pages 16 and 60-62 of the firm-
ware listingsc The routine 230 for initialization for keyboard
execution serv~ to initialize the run time stacks shown in the
memory map of Figure 6~ This routine is detailed in the flow-
chart of Figure lOOC and pages 109-110 of the firmware list-
ing ~
When the RUN command is given, or if the INIT key is
actuated,control is passed to the pre-execution processing
routines 232. These routines are detailed in pages 65-77 of
the firmware listing. They serve to initialize the symbol
table and non-common value table areas of the user read-write
memory shown in Figure 6.
Control is next passed to the execution monitor 214,
which is detailed in the flowchart of Figures lOOA-B and
pages 108-110 of the firmware listing. This routine initializes
the run time stacks in the user read-write memory of Figure 6
and initiates execution of a stored program beginning at the
line number given by the user. After each statement is exe-
cuted control is returned to the execution monitor, which prints
the line number of the next line if the program is being exe-
cuted in the trace mode. Step, stop, or error conditions are
- 1046644
checked and program execution is terminated if any of these
conditions exist If program execution is to be continued,
the jump address of the execution routine for the next state-
ment of the program is computed, and control is passed to
that routine.
Several of the statement execution routines 240
require evaluation of arithmetic functions and expressions.
This is done in the formula evaluation routines 242.
Several of the statement execution routines 240 require in-
put from or output to various external input-output devices
20 and 244. This is done by calling the standard output
driver 224 or an optional special I/0 driver 234. Several
of the statement execution routines require input from or
output to an internal or external tape cassette unit 14.
This is done by calling the tape cassette drivers 226. The
statement execution routines for the statements that com-
municate with the tape cassette units are detailed in the
flowcharts of Figures 101-115 and pages 250-276 of the firm-
ware listing.
The list routine 220 is used when listing stored pro-
grams on either the single line display 18 or an external
ASCII output device 20. The list routine is detailed on
pages 78-82 of the firmware listing. Its function is to
translate the stored program from the internal stored format
into a string of ASCII characters which can be printed or
displayed. To print a line of translated characters, the
list routine calls on the standard output driver 242 which
is detailed in Figure 94E and pages 20 and 33 of the firmware
listing.
Detailed assembly language information relating to
1046644
--65--
all of the firmware routines and subroutines herein des-
cribed may be obtained by referring to the memory map of
Figures 4A-F and the basic system firmware listing located
at a later point in this specification.
Communication with the routines in the various plug-
in read-only memory modules is accomplished through a series
of mnemonic tables and Jump tables. The standard firm-
wareS the cassette operating firmware, and each of the plug-
in read-only memory modules all contain the following tables:
(1) A statement mnemonic table
(2) A statement syntax jump table
(3) A statement execution jump table
~4) A system command mnemonic table
(5) A system command execution jump table
(6) A function mnemonic table
(7) A function execution jump table
(8) A non-formula operator mnemonic table
All of these tables, with the exception of the state-
ment execution jump table, may appear anywhere within a
memory module. The last five words in each module are used
by the table scan routlnes of Figures 85-87 to find the
actual location of the tables. The last word of each module
contains a unique operation code word for that particular
module. The second from the last word contains a relative
address of the statement mnemonic table. The third from the
last word contains a relative address of the system command
mnemonic table. The fourth from the last word contains a
relative address to the function mnemonic tableO The fifth
from the last word contains a relative address to the non-
formula operator table. The jump tables for statement syntax,
- ~0466~4
system command execution, and function execution are located
directly above their respective mnemonic tables. The state-
ment execution jump table is located directly above the fifth
from the last word of each module. The complete set of tables
for the standard firmware is shown in the firmware listings at
pages 48-49, 103-104, 131, and 141.
Each of the mnemonic tables consists of a string of
seven-bit ASCII character and six-bit operation code characters
packed two characters per sixteen-bit word. The eighth bit of
each character is used to indicate whether that character is
ASCII or an operator code. A zero in the eighth bit indicates
ASCII and a one indicates an operation code. The seventh bit
of each operation code character is used to indicate whether
that operation code is the last character in that tableO The
jump table address for each mnemonlc is found by subtracting
the operation code for that mnemonic from the starting address
of the associated mnemonic table. The internal stored format
for program statements consists of a series of operation codes,
operand codes, and other special codes. The first word of
each statement contains the line number of that statement in
binary format~ The second word contains both the operation
code for that particular statement mnemonic and also the length
of the statement. The length information is used by various
firmware routines to scan from one statement to the next. The
third word contains the operation code for the table or
optional read-only memory module, and it also contains the
first operand code. The remainder of the statement is stored
with one operator code and one operand code in each word.
Formula operation codes from the table on page 132 of
the firmware listing and mnemonic operation codes are stored in
'' 104~644
-G7-
a five-bit field, bits 10-14. The operand codes are stored
in two five-bit fields Bits 5-9 are used to store the operand
name. The name consists of an ASCII letter, A-Z, with its
sixth and seventh bits removed. For example, the ASCII code
for A is 1000001 and the five-bit operand code for A is 00001.
Bits 0-4 are used to store the operand type. Bit 15 is used
as a special flag bitc When bit 15 is set, the operand field
is interpreted differently than when it is not set. The
following table shows the various operand types and the
special codes.
~O/Ui64~.
--~,8:--
OPERAND OPE~AN~ TYPEMEANING IF BIT 15=1
TYPE CODE (BIT 15=0)
Full PrecisionConstant follows
Variables .in next word
OOOOO Simple variable
OOOOl Array of 1 dimensionFixed point decimal
OOOlO Array of 2 dimensionsFloating point decimal
OOOll Array of unknown dimension Binary integer
Split Precision
Variables
OOlOO Simple variableBinary line number
OOlOl Array of 1 dimension
OOllQ Array of 2 dimensions
Integer Precision
Variables
OlOOO Simple variable
OlOOl Array of 1 dimension
OlOlO Array of 2 dimensions
Full Precision
Variables
Letter followed by digit
:LOOOO 0
10001
lOOlO 2
lOOll 3
lOlOO 4
lOlOl 5
lOllO 6
lOlll 7
llOOO 8
11001 9
llllO String Variable
rBit~ 5-9 contain the
11111 User defined function ~operation code of a
~function in ROM
1046644 ~
_ ~,q_
As an example, the internal stored format for the
following statements is shown in the table below:
DIM A[5]
LET B=C+FND~E)
30 GOTO 100
14-lO 4-5 4-0
O 0000000000 01010 10
O OOOlO OOOOO OOlll DIM op-code -- Length 7
O OlOlO OOOOl OOOOl Table op-code -- A ¦dimension
1 lOlOO OOOOO OOOll [ -- integer follows
O OOOOO OOOOO OOlOl 5
O OOlOl OOOOO OOOOO ] -- null operand
O OOOOO OOOOO lOlOO 20
O lOllO OOOOO OOlll LET op-code -- Length 7
O OlOlO OOOlO OOOOO Table op-code -- B
O 00111 00011 00000 = -- C
O OlOOl OOlOO 11111 + -- FND
O lOlOl OOlOl OOOOO ( -- E
O OOlOO OOOOO OOOOO ) -- null operand
O OOOOO OOOOO llllO 30
O OOllO OOOOO OOlOO GOTO op-code -- Length 4
1 OlOlO OOOOO OOlOO Table op-code -- integer follows
O 0000000011 00100 100
- 10~6644
- 7
~ K~Y~OARn ~P~I~A~I~N,S
All ope1ltiol1s pe1f:orlne(1 by th~ c~lc~ tor m.~y ~c
controlled or initi~tcd by thc keybo.lrd input unit al1d/or
by keycodes enterccl into the calc~ tor from 1hc ~ey~olrd
c~
input un1t, the magnetic tap~ c~sse;tte rcading ~ recordin~
unit, or peripheral input units such as the m~rkcd card reader
and stored as program steps in tlle program storage section of
the R~ An operational dcscription of the kcybo~rd input
unit is therefore now given with speci~ic re~erence to the
perspective view of the calculator as in Figure l and the
plan view of the keyboard as in Figure 8, except as otherwise
indicated.
Line Switch
An on-off line switch 182, which may be considered
as part of the keyboard input unit, controls the application
of power to the calculator and hence initiation of the control
signal POP from the power supply.
As shown in Figure 2, tl1e calculator may be operated
at 240, 220, l2b, or lO0 volts ~5%, -10% as determined by a
pair of line voltage selector switches mounted at rear panel
34 of the calculator housing and at a line frequency witl1in
the range of 48 to 6~ Hertz. The calculator is provided with
a 6-amp fuse and either a l-amp fuse for operation at a line
voltage of 220 or 240 volts ~5%, -10% or a 2-amp fuse for
operation at a line voltage of lO0 or 120 volts ~5%, -lO~o .
It is also provided with a tl1ree-conductor power cable 18
which, whcn pluggccl into an oppropriate AC power o-~ltlet,
grounds the calculator housing. Th~ m~ximum power consumption
of thc calcul~tor is 150 vol~amps. No morc thall a ~otal of 610
voltamps ma~ be drawn fro~ ~C power outlets ~2 providcd for
pcripher.11 units.
~046644
EXECUTE ql
The EXECUTE (often referred to as EXEC) key, when pressed, will perform the
indicated operations previously keyed in, if any, and display the result of
any arithmetic statements on the 32-character display. (Although the display
is only 32 characters, an 80-character line can be keyed in with automatic
scrolling both for programs and for keyboard operations.) Most keys, when
pressed, immediately cause their mnemonic to be displayed. However, pressing
certain keys, such as PRT ALL (to be discussed later), allows a particular
mode to be in effect till that mode is overridden.
FIXED N, FLOAT N
Immediately after either turn-on or SCRATCH EXEC, the user read/write
memory area is cleared; numerical calculations that are executed will be
displayed in float-nine notation. The values 2 and 12 in float-nine notation
would appear as 2.000000000E+00 and 1.200000000E+01, respectively. Float 9
refers to the nine digits succeeding the decimal point; E symbolizes x 10
raised to the power of the two digits following the E.
NOTE
In this text, individual keyboard operations will be identi-
fied by being underlined; e.g., 3 + 2 EXEC. (On the display
would appear 5.000000000E+00.)
You can specify the desired notation by pressing FIXED N or FLOAT N followed
by the appropriate number from 0 through 11. The designated 'N' indicates
the number of digits to be displayed to the right of the decimal point after
exec~ltion.
For example:
FIXED N 7 EXEC,
then 1 2 3 4 5 6 . 7 EXEC, displays 123455.7000000
or, _ 2 3 4 5 6 7 8 9 . 1 2 3 4 5 6 7 8 9 EXEC, displays 123456789.1230000t_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- q/ A-
~0~G;6~
FLOAT N S EXEC,
then _ 2 3 . 4 EXEC displays 1.23400E+02_ _ _ _
or, . 1 2 3 4 5 6 7 EXEC displays 1.23457E-01tt
In fixed-n notation, a maximum of 12 digits will be displayed to the left
of the decimal point; beyond that value the calculator reverts to float-n
notation, with the number of digits displayed to the right of the decimal
point determined by the particular fixed-n.
tThe machine calculates to 12 significant digits regardless of the display
length.
~Since only five digits can be displayed to the right of the decimal point
the fifth digit is rounded.
1046644
The FIXED N and FLOAT N keys are not programmable; that is, they can be used
only in keyboard operations. Output formatting under program control is
accomplished by a format statement, which is discussed below.
The calculating range of is: -9.99999999999 x 10 through -10
0, and 10 through 9.99999999999 x 10
CLEAR, DELETE LINE
Pressing either CLEAR or DELETE LINE will erase whatever previously had been
displayed during keyboard operations. Pressing either key will cause ~-(the
Lazy T) to appear on the far left of the display, indicating that the calcu-
lator is available for new inputs. The difference between the two keys
occurs when a stored program line is displayed; DELETE LINE will erase the
line from the stored program, whereas CLEAR will only erase the display and
not affect the program line itself. (A program line can also be deleted by
keying in the line number followed by END OF LINE.)
RECALL
Pressing RECALL during keyboard operations allows the last line that was exe-
cuted to be recalled to the display; pressing RECALL during program-inputting
operations allows the last program line that was input to be recalled to the
display. If an error message appears on the display when an attempt is made
either to execute a line in keyboard mode or to input a program line into
memory, pressing RECALL will allow the original line to be reviewed for edi-
ting purposes.
RESULT
Pressing CLEAR RESULT EXEC displays the numerical value of the last arith-
metic statement that was executed. The RESULT key not only allows the result
of the previously executed statement to be reviewed, but also can function as
an "accumulator" during arithmetic operations; e.g., by pressing
qa A-
1046644
2 + 4 EXEC (in FIXED 2 notation) displays 6.00, then pressing
3 + RESULT EXEC displays 9.00, then pressing
4 + RESULT + RESULT EXEC displays 22.00.
Keying in either R E S or R E S U L T has the same effect as pressing the_ _ _ _ _
RESULT key.
PRINT ALL
By pressing PRINT ALL, you can determine whether or not the calculator is in
print all mode. If ON appears, both the expression and the result of any
executed calculation will be typed on whichever printing device is plugged
into the calculator; if OFF appears, the information will appear only on the
display. Pressing the
- ~1 3
~046~;~4
PRINT ALL key a second time causes the alternative mode to be in effect. In
the print all mode, each program statement is printed when END OF LINE is
pressed. All error messages are also printed.
BACK, FORWARD, INSERT
The BACK and FORWARD keys can be used to edit expressions on the display.
Successive presses of the BACK key will move a blinking cursor to the desired
location within the display. Editing can then be performed at this location.
The FORWARD key performs the same function as the back key, but in the oppo-
site direction.
At the location of the blinking cursor, the following editing can be performed:
1. A character can be inserted by pressing INSERT. (This opens up a space to
the left of the cursor, thereupon moving the cursor to the location of
the space; additional presses of the INSERT key will open up more spaces,
with the cursor always positioning itself in the left-most space, thus
allowing for the immediate insertion of more than one character.)
2. A character can be changed by overscoring it with another character.
3. A character can be deleted by pressing either the space bar or SHIFT
INSERT, the only difference being that pressing SHIFT INSERT will close
up the space of the deleted character.
Holding either BACK or FoRwARn down for approximately 1.5 seconds will cause
the cursor to move in rapid succession in the chosen direction.
Once a line is appropriately edited, it can be immediately executed without
having to move the cursor to the end of the line.
~ , ~
When a line that is greater than 32 characters (80 characters maximum) is
being input, the characters to the left of the display are pushed out of the
display region to make room for the additional characters. To view the be-
- '13A-
~046644
ginning of the input, press ~ (the right arrow); this operation moves the
characters in the display to the right. Pressing ~ (the left arrow) per-
forms the reverse operation.
Either arrow key, when held down for approximately 1.5 seconds, will repeat
its operation in rapid succession.
ARITHMETIC
There are five basic numerical operators: add (+), subtract (-), multiply (*),
divide (/), and exponentiate (~). The order of execution, known as the
hierarchy, is identical to the BASIC hierarchy described below. The BASIC
functions
f
~ ~ _7~_
: 1046644
described below are available on the Calculator
simply by keying in the appropria~e mnemonics. In addition, the value of
can be obtained by keying in P I.
~.
When operating on trigonometric functions, the calculator assumes the angle
to be in radians unless otherwise stated. To express an angle in either
degrees or grads, first clear the display, then press either D E G EXEC or
G R A D EXEC, respectively; then key in the expression. To revert to radians,
clear the display, then press R A D EXEC. Radians, degrees, and grads are
also programmable commands.
VARIABLES
The simple "scalar" variables are A through Z and A~ through Z9 (286 total).
Simple variables can be used in keyboard operations; e.g., pressing A 3 _ 7
EXEC assigns the value of 7 to A3. Unless the value of A3 is then changed
or erased from memory, pressing 4 * A 3 EXEC will display 28. If a variable
is undefined, any attempt to use this variable in an expression (other than
by assigning a value to it) will result in an error message.
An array is an ordered collection of numerical data. An array ~subscripted)
variable can have either one or two dimensions as indicated by the subscripts,
which are presented as numbers within parentheses. A(n) is a one-dimensional
array (or column vector) where m designates the row of the element; A(m,n) is
a two-dimensional array where m designates the row and n designates the column
of the element.
The maximum si~e of an array is limited by the available calculator memory.
At normal 12-point precision, the effective memory limitations would be approx-
imately a (30, 30) array.
Arrays should be referenced in either a common statement or a dimension state-
ment before use in a program; if not, the program defaults to either a 10
element array for a singly subscripted array, or a 10 by 10 array for doubly
subscripted arrays.
~046644
TAPE CASSETTES
The present Calculator is capable of operating with 10 tape cassettes:
One cassette is available through the built-in (internal) cassette drive.
Four peripheral cassette drives can be connected directly to the calculator
through the four I/O slots in the rear panel.
Five more peripheral cassette drives can be added if the user has an I/O ex-
pander box (in all, 11 peripheral devices can be added by having an expander
box).
SYNTAX
The tape cassette commands have general syntactical rules which will be
briefly described. The general command form, with the minor variations, is:
CO~MAND [UNIT] [FILE], or
COMMAND [UNIT] (FILE) [LNX1 [LNX2]]
Brackets [ ] indicate that the enclosed information is optional; parentheses
( ) indicate that the enclosed information is required with the particular
command.
COMMAND - The various commands will be individually discussed.
UNIT - Individual units are referenced by the number sign, #, followed
by the select code; the internal cassette is designated by #10
(if no select code is given, the internal cassette is assumed);
the nine peripheral cassettes are identified by #1 through #9.
FILE - Files within individual cassettes are identified by file numbers;
if no file is identified by number, the scratch-pad (or default)
file, file 0, is assumed.
LNX1 ~ indicates the beginning line number to be affected by the command.
LNX2 - indicates either the line number where program execution is to
begin following the command implementation, or the ending line
~ - 75'A-
iO4664~
number to be accessed in the command. In any command whose
syntax allows LNX1 and LNX2, in order for LNX2 to be designated,
LNX1 must have been specified.
All information to be input following the command must be separated by
commas.
In keyboard mode, press EXEC after fulfilling the syntax requirements of a
particular command to implement the command.
104664~
PREPARING A FRESH CASSETTE
To prepare a fresh cassette (one which has no markings), first open the cas-
sette door by pressing downward on the switch on the far right of the keyboard;
then insert the cassette (print-side up) into the slot built into the door;
be certain that the tape is wound around the left spindle - if it is not,
but you wish to prepare that side of the cassette anyway, simply close the
door and press REWIND.
To store information onto the cassette, first mark the files that are to be
used.
PROGRAMMABLE COMMANDS
The following tape cassette commands are programmable: mark, store, load,
merge, store key, load key, store data, load data, load binary, rewind, find,
and tlist. These commands can also be used in the keyboard mode. The secure
command, on the other hand, can be used only in the keyboard mode.
MARK
The mark command produces the designated number of files and defines the file
lengths (by the number of 16-bit words per file).
~yntax: MARK [UNIT] (No. of FILES) (LENGT~)
e.g., _ A R K # 1 0 , 5 , 1 0 0 0 EXEC - since unit #10 identifies_ _ _ _ _ _ _ _ _ _ _ _
the internal cassette, including it is superfluous; the '5' indicates
the number of files to be made available; the '1000' signifies the
number of 16-bit words per file.
Successive files on the tape can be marked with different word lengths as
shown in the following example; MARK 3, 1000 EXEC then, MARK 2, 2000 EXEC will
mark files 0, 1, 2 of the internal cassette with 1000-word lengths and will
mark files 3, 4 of the same cassette with 2000-word lengths.
1046644
The length of a file can be changed; however, changing it will affect all
the files following it by distorting their contents. To change the length
of a particular file, first position the cassette at that file by using
FIND (FIND will be discussed more thoroughly, later); then mark the file
with the desired length. For Example: to mark file 12 of the internal
cassette with 1000 words, press
FIND 12 EXEC then press,
MARK 1, 1000 EXEC
_ q~_
1046644
To mark files not previously marked (virgin files), first perform a TLI~; TLIST
will be discussed thoroughly later; but for now, merely knowing that TLIST ~UNIT]
EXEC will list all the marked files, is sufficient. To mark virgin files, it is
first necessary to mark the last file listed in ~LISTt, As Previously discussed,this file is located bY the find command. Beainning with thls file, successive
virgin files can be marked by the methods previously discussed.
To mark the beginning of a tape, be certain that the tape is completely rewound.
STO~E
The store co~mand will take the program line numbers in read/write m~mory, and
put them in the desiqnated tape location where thay will be saved.
Syntax: STORE [UNITI [FILE] or
STORE [UNIT~ (FILE) rLNXl [LNX2]]
e.q.,
S~O~ _ , 3 EXEC: select code X2 designates which casse~te is being accessed;
the ~rogram will then be stored on that cassette in file number 3.
In the store cc~and, LNXl a~d LNX2 are used to store a ~ortion of the program:
LNXl specifies the beqinning line number to be stored; LNX2 specifies the endinglir.e numher to be stored. If LNX2 is not specified, the last line to be stored
is assumed to be the highest-numbered program line.
For LNX2 to be given, it is always necessary to have LNXl; this is true for any
cassette command. In addition, whenever LNXl is to be given, the file to be
accessed must be identified; e.g.,
STORE 3 , 60 , 150 EXEC: file 3 of the internal cassette is located; program
lines 60 through 150 in memory will then be stored into file 3.
tThe number of files referenced in TLIST is always one more than the num~er rnarked
by the user.
-q8-
1046644
Note
Once a cassette has been marked, any file that has been
marked can be accessed by giving its designated file num-
ber in a command; e.g., if five files are marked, informa-
tion can be stored in file 4 even though file 3 is a virgin
(empty) file, by pressing STORE 4 EXEC.
LOAD, LINK
The load command will take a program that is stored on a cassette and put it
into the memory area.
Syntax: LOAD [UNIT] [FILE] or,
LOAD [UNIT] (FILE) [LNX1 [LNX2]]
e.g.,
LOAD EXEC assumes the internal cassette, default file (file 0) is to be loaded
into the calculator; any program previously in the 9830A memory will be erased.
LOAD 5 , 40 , 10 EXEC locates file 5 on the internal cassette; the entire pro-
gram on this file is renumbered beginning at line number 40, and then the
program is loaded into memory; program execution is initiated at line number
10. All program line numbers beginning at line 40, that were previously in
memory, will be erased and replaced by the program being loaded; if the memory
previously had line numbers 10, 20, 30, it will retain them.
In both the load and the merge command, the use of LNX1 and LNX2 can have
various results. Rules for predicting the results are given at the conclu-
sion of the merge command discussion.
By substituting LINK for LOAD in the previous syntax, the user can implement
the link command. This command operates identically to the load command with
one exception:
--78~-
1046644
During program execution, if a load statement is encountered, the calculator
functions as though R EXEC were pressed - that is, the old symbol table is
destroyed and a new symbol table is built; on the other hand, if a link com-
mand is encountered, the calculator functions as though CONT EXEC were
pressed - that is, all variables retain their previous values.
_ qq_
1046644
MERGE
The merge command attempts to take program line numbers from the cassette and
position them in read/write memory in front of the program currently there,
between consecutive line numbers in the program currently there, or behind
the program currently there. However, if any line number of the program to
be entered matches a line number currently in the program, an error will
result. In addition, if the line numbers of the two programs are interwoven,
an error will occur; e.g., if the program currently in memory has line num-
bers 10, 20, 30, 40 and if the program to be merged has line numbers 15, 25,
35, the merge command will cause an error message to occur even though no
two line numbers matched.
Syntax: MERGE [UNIT] [FILE] or,
MERGE [UNIT] (FILE) [LNX1 [LNX2]]
e.g.,
MERGE _ , 1 , 200, 100 EXEC - file 1 of the cassette with select code #2 is_ _
located; the entire program on this file is renumbered beginning at line num-
ber 200 (LNX1) and then it is combined with the program currently in memory.
Following implementation of the command, program execution will begin at line
number 100 (LNX2).
Either the merge or the load command can be used for stacking programs in
read/write memory. The major difference between the two commands is as
follows: LOAD will erase the line numbers previously in memory, beginning at
the designated LNX1; MERGE, on the other hand, will retain all line numbers
previously in 9830A memory.
In both the load and the merge command, LNX1 and LNX2 are predictable. Regard-
less of the mode, LNX1 renumbers the program line numbers of the accessed file
to begin at LNX1; the spacing between consecutive line numbers remains the
_ qqA-
10466~4
same; all GO TO statements, etc. are properly adjusted to reflect the new
line numbers; this program is then loaded into user memory.
In program mode:
1. If LNX2 is given, program execution will continue at LNX2.
2. If LNX2 is not given, program execution will continue either at the
next higher line number of the original program or at LNX1, whichever
comes first.
In keyboard mode:
1. If LNX2 is given, program execution will begin at LNX2.
2. If LNX2 is not given, the calculator will halt after loading in the
program.
~ - ~o -
1046644
STORE REY, LOAD KEY
The store key command will take all user definable keys (upper left-hand
region of the keyboard) that have been defined and put them on a cassette
file, which wil be tagged as a key file.
The load key command takes the user definable information from the cassette
and positions it in memory such that each user definable key performs the
same operation that it previously did before being stored on tape.
Syntax: STORE ~EY [UNIT] (FILE)
LOAD K~Y [UNIT] (FILE)
Spacing may arbitrarily be left between the words STORE and REY and the words
LOAD and KEY. In general, the ~P Lasic language ignores blank spaces (except,
of course, in a quote field where every character and space is duplicated).
STORE DATA, LOAD DATA
The store data command takes a block of data from memory and puts it on a
cassette. Normally, only arrays can be stored using this command; however,
if no array is specified in the command, all data in the common statement
of the program can be stored. The calculator allows simple variables in the
common statement, as well as arrays in fact, the common statement can accept
simple variables, array variables, integer arrays and variables, and split
arrays and variablest-
The load data command takes the data that was previously stored on a cassettefile, and loads t into mainline memory. If an array has been stored, then
LOADDATA must specify an array; if LOADDATA does not specify an array, an
error will result. If, on the other hand, the common area will be retrieved
by the load data command (in this case, no particular array can be specified
in the command, lest an error occur).
Syntax: STOREDATA [UNIT] (FILE) [ARRAY]
LOAD DATA [UNIT] (EILE) [ARRAY]
-80 A-
'l~J46644
he common statement acts like a dimension statement with the additional
feature that data in common is saved from program to program.
10466~4
e.g., '
STORE DATA 6 , B EXEC will locate file 6 on the internal cassette; then the
B array in the current program will be stored in this file. (A simple vari-
able cannot be stored in this manner.)
LOADDATA 6 , B EXEC can then retrieve the B array and load it into memory
whenever it is needed; the following command could be given, also:
LOADDATA 6 , C EXEC: this would retrieve the B array and load it into memory
in place of the C array, provided B and C are the same size and type.
Assume the common statement in a program looks like this: 1 COM A(8), B~5,5),
D3, E.
Pressing: STORE DATA 2 EXEC will store all the common statement variables into
file 2 of the internal cassette. Both the array variables and the simple
variables will be retrieved by pressing: LOAD DATA 2 EXEC.
Pressing: LOAD DATA 2 , A EXEC is illegal and causes an error since no parti-
cular array can be retrieved from a file if it was stored in common.
In all store and load data commands, the file to be accessed must be identi-
fied, even if it is the default file (file 0).
LOAD BIN
The load binary co~m~nd will transfer binary information - assembly language
program - from the cassette to the user memory. The assembly language
program may be a system diagnostic, an I/O subroutine, or a simulated "option
block" designed to perform some sPecific function.
The assembly language program cannot be listed or displayed.
Syntax: LOAD BIN [UNIT] (FILE)
Note
Files on cassettes are tagged as: pro~ram files, key files, data
files, or binary files. If an attempt is made to load from a par-
ticular file and the load command incorrectly identifies the file
tage, an error will occur; e.g., pressing LOA~ KEY 1 EXEC when file
1 is a program file, causes an error message to appear.
-81-
1046644
REWIND
Pressing the REWIND key, located on the right-hand side of the keyboard,
immediately rewinds the internal tape cassette to the clear leader.
To rewind any other cassette, R E W I N D must be typed in, followed by
the select code of the particular cassette. (The internal cassette can
also be rewound by typing in R E W I N D EXEC.)
R E W I N D must be typed if the command is to be used in the programming
mode.
Syntax: REWIND [UNIT]
e.g.,
_ E W I N D #2 EXEC will rewind the cassette with select code #2._ _ _ _
FIND
The find command ~previously mentioned in conjunction with the mark command)
is used to locate a particular file. While the cassette is searching for
the file number, a "lazy T" appears on the display. During this interval,
the cassette is searching under interrupt control, thus returning control of
the calculator keyboard to the user. This feature allows for the execution
of one portion of a large program, while another portion is being found -
thereby improving access time.
When the specified file is found, the cassette tape halts.
Syntax: FIND [UNIT] tFILE)
e.g.,
FIND #3 , 2 EXEC causes the cassette with select code #3 to search until file
number 2 is located.
Syntax: TLIST [UNIT]
The information for each file, on the designated cassette, is printed out on
one line. There are no column headers identifying the information in each line;
the assumed headers are:
-82-
1046644
File No. File Typet Absolute Actual Program Line Nos. Common Area
(Code no.) File Size File Size (Begintling) (Ending) (in words)
(in words) (in words) (LNXl) (LNX2)
tThe code numbers identifying the file types are as follows:
1 binary
2 data
3 program (source)
4 key
In addition, if the file is secured, the number 2 appears in front of the
code number (this applied only to binary, source, and key files); e.g., if
"24" appears in the second column, the file is a secured key file.
If a file is a data file, LNX1, is superfluous; in this case the data is
described in this column as:
0 full precision
1 split precision
2 integer precision
3 common
If the file is not a program file, the last two columns will contain no
information.
NoN-pRoGRAMMAsLE COMMA~DS
SECURE
This command has the capability of concealing program lines from potential
users; that is, your program could be given to another, and that person could
load and run it - however, he would not be able to fetch particular program
lines for viewing purposes nor could he store the program on any other cas-
sette file.
~J -83-
~046644
An attempt to fetch a secured program line will result in the line number
appearing on the display, followed by an *; attempts to list the program
will result in the secured line numbers appearing followed by an *.
If any lines in a program are secured, the entire program is considered
to be secured; that is, even though certain program statements are visible,
none of the program can be reproduced onto another cassette file.
-83a-
10~6644
Syntax: SEC [LNX1 [LNX2]] or SECURE [LNX1 [LNX2]]
It is therefore, possible to secure specific lines within a program; e.g.,
pressing:
SEC _ , 80 EXEC, followed by_
STORE 2 EXEC secures lines 30 through 80 of the program in memory and then
stores both the secured and unsecured portions of the program into file 2
of the internal cassette.
When a program is initially secured, it can still be reproduced onto as many
files as necessary; however, once the program is scratched from memory, (even
though it can be loaded back into memory) it cannot be reproduced onto any
cassette files.
When program lines are secured, the entire calculator is in the secured mode.
Therefore, afteL the secured program is stored away, the user should press
SCRATCH A before inputting other programs - thus, avoiding "secured program"
errors.
User definable keys (when not being used as typing aids) can be secured, too.
Just press FETCH (particularkey) SEC EXEC and the designated key will be
secured.
Note
To protect all the information on a particular cassette, break
one of the tabs on top of the cassette; this makes the cassette
inaccessible for further stOrage.
-84-
1046644
PROGRAMMING
The programming language of the Calculator is, with minor varia-
tions, BASIC as described below.
:
Instructions to the computer within a program are provided by program state-
ments. Each statement in Basic has an associated line number which must
appear in the left-most portion of the statement.t Statement line numbers
appear in ascending order with 9999 being the largest possible line number.
A program statement, which has been correctly keyed in, can be stored in
read/write memory by pressing the END OF ~INE (EOL) key. This key is situ-
ated in an area corresponding to the carriage return/line feed key on a
teletype keyboard.
AUTO #
As previously mentioned, statement line numbers can be automatically input.
In its simplest form, pressing AUTO # ExEc causes line number 10 to immedi-
ately appear on the display awaiting the program statement. The line numbers
of additional statements will be in ascending order with a spacing of ten
between consecutive line numbers. The AUTO # ~AUTO) syntax and the examples
to follow present some of the alternatives in automatic line numbering.
Syntax: AUTO # [LNXl [Spacing]]
LNXl is the beginning line number to be automaticaLly input; the desired
spacing between lines can then be input if r,Nxl is given. If no spacing is
indicated, a spacing of 10 is assumed.
e.g.,AUTO # 30 EXEC AUTO # 4 0 , 2 EXEC AUTO # EX EC
1 0
42 20
44 30
.
When AUTO # is pressed, AUTO appears in the display.
tThe length of a statement, including the line number and including appro-
priate spacing, can be up to 80 characters.
-85-
10~66~4
Note
Although the CLEAR and DELETE LINE keys have pre-
viously been discussed, the following point should
be made. If a program line currently being keyed in
is found to be totally unacceptable (not worth
salvaging by using the editing keys), it can be erased
by using either the CLEAR or the DELETE LINE keys.
However, if the program line numbers have been
automatically input, pressing CLEAR not only erases
the entire display but also eliminates the AUTO #
mode, whereas pressing DELETE LINE erases only the
program statement without affecting the line number
itself.
PROGRAM VIEWING
There are two methods of viewing a program that is
currently in memory:
1. List it on a printing device.
2. Bring it line-by-line to the display.
LI ST
The list command has two specific applications: it
can be used to provide a total listing of the programs in read/
write memory, or it can be used to indicate the read/write
memory available for inputting; e.g.,
LIST EXEC lists all program lines that are in memory on the
user's standard printing device.
LIST #3 EXEC lists all program lines that are in memory on the
peripheral with select code #3.
LIST 9999 EXEC causes the number of 16-bit words available in
memory to be displayed.
~0 ~ ,~
If a specific program line is in the display, pressing
~ (down arrow) displays the nex~ higher-numbered program line,
t pressing ~ ~up arrow), on the other hand, displays
- 86 -
1046644
the next lower-numbered program line. When no program line is currently in
the display, pressing would display the successively higher line from the
one most recently displayed, whereas would display the successively lower
line.
FETCH
In addition to viewing a program line-by-line, specific program lines can be
immediately brought to the display by using the fetch command.
..
Syntax: FETCH [LNX1]
Mhere LNX1 is the specific line number to be accessed;
e.g.,
FETCH EXEC always displays the lowest-numbered program line.
FETCH 300 EXEC displays line 300 if it exists; if line 300 is not available
(and there are other higher-numbered lines), the line immediately higher than
300 will be displayed; if there are no line numbers as high as 300, the
highest-numbered line available in memory will be displayed.
PROGRAM EDITING
Any displayed program line can be edited by using the BACK, FORWARD, and
INSERT KEYS.
The RECALL key, previously discussed, need only be briefly mentioned. A pro-
, ... ~.
- gram line is keyed in; if an error message appears on the display when EOL is
pressed, the program line can be reviewed by pressing RECALL. Appropriate
editing can then be performed on the program line. The previously input line
can always be recalled by pressing RECALL whether or not an error appears.
,, . ,, _ .
CLEAR and DELETE LINE have already been thoroughly discussed. Xowever, to
reiterate, there are two methods of deleting a program line currently in memory:~
1. If the line is currently in the display, pressing DELETE LINE will
erase it from memory (CLEAR only clears the display).
2. Any line in memory can be immediately deleted by keying in the appro-
priate line number followed by EOL.
-87-
DELETE 1~466~
The delete command (to be distinguished from DELETE LINE) can selectively
delete program lines.
Syntax: DELETE [LNXl [LNX2]] or DEL [LNXl [LNX2]]
Where LNXl is the first line to be deleted and LNX2 is the last line to be
deleted:
e.g.,
DELETE EXEC deletes all program lines;
DELETE 40 EXEC deletes all statements beginning at line number 40;
_
DELETE _ , 80 EXEC deletes all lines numbered 50 through 80._ _
SCRATCH
The scratch command can erase a variety of things from memory:
e.g.,
SCRATCH EXEC erases all program lines and variables;
~CRATCH A EXEC erases everything from memory - program lines, user definable
keys, variables (identical to turning the calculator off, then on
again);
~CRATCH K EXEC erases all user definable keys (user definable keys will be
discussed later);
~CRATCH V EXEC erases all variables;
~CRATCH (particular UD key) erases the particular user definable key that was
pressed - pressing EXEC is not required in this case.
Scratch can be accessed either by keying in the seven letters or by pressing
~CRATCH.
RENUMBER
~he renumber command will take all the program line numbers and renumber them.
Synta~:: REWUMB13R I LNXI I SPAC INGI I or R'N f LNX ~ ISPACIIIGII
~ -88-
1046644
Where LNX1 will be the new line number of the first program statement, and
SPACING will be the spacing consecutive line numers:
e.g.,
REN EXEC will renumber all statements by numbering the first statement '10'
with a spacing of 10 between statements;
-88a-
1046644~ENUMBER _ EXEC renumbers the first statement '30' with a spacing of 10
between statements;
REN _ , 20 EXEC renumbers the first statement '45' with a spacing of 20_
between statements.
All statements in the program that reference another line number are appro-
priately corrected with the renumber command; e.g., GO TO 80 would be corrected
to reference the line that replaced 80.
PROGRAM DEBUGGING
NORMAL, TRACE
The TRACE key can be used to determine the order of statement execution for a
program that is currently running. Pressing TRACE during program execution
causes the line numbers to be printed in the order in which they are accessed;
then pressing NORMAL reverts the calculator to the normal mode. Thus, when
a program is running, both TRACE and NORMAL are immediate execute keys.
When no program is running, to revert to either trace or normal mode requires
pressing the appropriate key followed by EXEC. Trace mode can be set up to
trace specific line numbers.
Syntax: TRACE [LNX1 [LNX2]]
Where LNX1 is the first line number to be traced, and LNX2 is the last line
number to be traced;
e.g.,
TRACE 20 EXEC will trace beginning at line number 20 when the program is
running.
TRACE 50 , 60 EXEC will trace beginning at line number 50 and ending at line
~ number 60, each time these line numbers are executed in the program.
STOP
The stop command can be a statement withi~ a program (to be discussed later)
and can be used as a debugging tool.
'~
~046644
As a debugging tool, STOP is extremely valuable. A program that is running
can be stopped at any time by pressing STOP (the current line number of the
program will be displayed). If any program lines are then edited, the pro-
gram must be rerun from the beginning, using the RUN key. If no editing has
been performed, the program can continue where it left off if the CONT key
(to be discussed in detail later) is pressed.
While a program is stopped, the values of variables can be checked to deter-
mine if the program is doing what was intended; e.g., pressing A EXEC would
determine the present value of the simple variable A.
.......
While a program is stopped, SToPt, can have another function. Pressing STOP
displays STOP; then keying in either one line number or two line numbers
separated by a comma - indicates that the caluclator should stop program
execution at these line numbers. Pressing CONT EXEC will then start program
execution; e.g., STOP 80 EXEC then CONT EXEC or RUN EXEC will cause the pro-
gram to halt at line number 80. Once a program is running under these con-
ditions, there is one way to revert to normal program execution: After the
program has halted, press STOP EXEC, then CONT EXEC, and the program will no
longer stop at the give line numbers.
STEP
After a program is halted by a stop command, execution can continue by
pressing STEP. STEP is always immediate execute; it causes the program to
execute the appropriate statement and then to halt. Therefore, after each
statement is executed, it can be checked to ensure that it performed the
required function. When a particular function is considered satisfactory,
either CONT or STEP can be pressed; COWT will execute the rest of the program
while step will execute the next program statement only.
RUN, CONTINUE
Pressing RUW EXEC causes a program to begin execution at the first statement
regardless of whether the program had previously been halted by a stop command;
however, if the program had been halted by a stop command, pressing CONT EXEC
will begin program execution where it had previously halted.
~, _go_ ;
.~
1046644
tWhen a key is not being used as an immediate execute key, whether the key
itself is pressed or whether the letters displayed on the keys are individu-
ally keyed in, is generally arbitrary.
,
, _
-~ ~;
-9Oa-
1046644
As previously mentioned, if a program is edited after it has been halted,
program execution is reinitialized at the first line by RUN EXECt. However,
if, during the halt, the values of variables are changed or other internally-
programmed conditions are changed, then CONT EXEC must be pressed to keep
these newly adjusted conditions intact. The following things can be done to
the program while it is halted if, upon completion, the program is executed
by pressing CONT EXEC:
1. Variables can be changed; e.g., B - 5 EXEC sets the simple variable
B equal to 5.
2. Angular units in trigonometric functions can be changed to measure
in radians, degrees, or grads, depending on the user's requirements;
e.g., DEG EXEC will assume all angles to be in degrees.
3. Write, print, and display statements can be input from the keyboard
(these statements will be discussed later).
4. The data pointer, which indicates the next datum to be encountered,
can be reset to the beginning of the data by typing R E S T O R E
EXEC.
5. The program can go to a particular statement and be available for
execution there, e.g., GO TO 80 EXEC sets the program line counter
to 80 for either step-by-step or continuous execution. 7If con-
tinuous execution is desired at line number 80, the continue command
can be employed, as discussed below.) IF ... THEN can also access
a particular line number.
6. Any calculator-keyboard statements can be executed.
A halted program can be executed beginning at any line number by using the
continue command; e.g., CONT 95 EXEC will continue execution starting at line
number 95.
tThe initialize command, to be discussed later, is also legitimate.
1046644
A program can be run beginning at any line number; e.g., RUN 110 EXEC will
begin program execution at line number 110
NOTE
The major difference between RUN and CONT is that RUN
initializes all variables in the program and reverts to
all normal program modes, while CONT neither affects
any variables nor affects any current program modes.
PROGRAM STATEMENTS
; LET
As in Basic LET A = 6 is a legitimate statement; however, the implied let
statement is also allowed. Thus, A = 6 is the same as LET A = 6.
GO TO, GO SUB
The GO TO and GO SUB statements are the same as in Basic; however, each state-
ment has one additional feature called respectively, the computed GO TO and
the computer GO SUB. In either case an expression is evaluated and the
rounded integer value of the expression is determined; the integer then acts
as a pointer to a particular line number from a parameter listing in the
statement. Some examples should explain this feature more clearly: ;
tIn all examples, the present value of T will be 2.)
'20 GO TO T~2-3 OF 250, 350, 450
Slnce the integer value of the expression is one, the first parameter following
"OF" will be accessed (line number 250).
80 GO SUB T12.5 OF 130, 260, 330, 370, 490
The rounded integer value of the expression is 5; therefore, the subroutine
beginning at line number 490, the fifth parameter following "OF", will be
accessed. tDecimal value of .5 and above are always rounded) to the next
higher integer value.)
-92-
~046644
Any legitimate expression can be used; if the rounded value is either less
than 1 or greater than the number of parameters following "OF", then the line
number following the GO TO or Go SUB statement is executed.
~.
PRINT
The caluclator has one feature in the print statement not generally available
in BASIC. Alphabetic information in a quote field can be printed in either
upper or lower case letters. Printing in lower case is just the opposite of
that on a regular typewriter; with shift or shift lock pressed, letters in-
side the quote field will be printed in lower case (the display, however,
will still appear in upper case). If the "at" symbol (@) is required, press
SHIFT RESULT.
-
Quote fields in both the format and write statements also have this "lowercase" feature available.
DISP~AY
The display statement performs the same
function as a print statement; the difference is that the information appears
on the display rather than on a printing device. Thus, when a permanent
record of the information is desired, the print statement should be used.
The syntax used is DISP.
FORMAT, WRITE
The format statement is a means of structuring program printouts in a speci-
fied manner. The write statement defines the variables, constants, etc. that
will appear on the printout~ it also determines the device to be printed upon
and the particular format statement to be followed. The following examples
should adequately explain the features in both the format and the write
statements:
e.g.,
5 FORMAT P10.2
6 WRITE ~15, 5) .7
printout will be ~ 0.70 where the "~" indicates a blank space.
-93-
~046644
F10.2 - the "F" refers to fixed-point format; "10" refers to the total field
. width reserved for the printout "2" refers to the number of digits
to the right of the decimal point. Excess space to the right of the
decimal point will be filled with zeros; one space is reserved for
the decimal.
,-- .
~ ,
-93a-
1046644
point; two spaces are reserves to the left of the decimal point,
one for a digit preceding the decimal point, another for a sign
(however, only minus signs are printed).
t15, 5) - in the write statement, the information within parentheses is re-
quired. "15" refers to the printing device to be used (select code
15 referes to the standard printer); "5" refers to the line number
of the format statement that is being accessed (in this case line
number 5). The format statement, which is being accessed, can
appear anywhere in the program listing.
7 - in the write statement, the information following the right paren-
thesis is to be printed according to the designated formats. The
value is always right-justified within its field width.
e.g.,
20 A = 62.4
1 2 3 4 5 6,8 9 10
25 FORMAT ~ , ~.3, ~, ~.1, ~ 2F4.0, ~ E9.0
~ 260 WRITE (15, 25) 231, 61, -12 4, ~ " IS~THE~VALUE~OF~A~, 4
_~- 1 2 4 6 7 8 10
printout will be:
1 2 3 4
S~THE~VALUE~OF~AA~0~A~A~7.E+01
6 7 8 9 10
The format statement, the write statement, and the printout all have individual
fields referenced; nterlinking fields are represented by corresponding refer-
ence numbers.
Since the write statement references the format statement numbered 25, values
in the write statement will be formatted a,s specified in this format statement.
-94-
104~;644
REFERENCES
1 E12.2 indicates exponential (floating-point) notation with a field width
of 12 and two digits to the right of the decimal point. The printout
displays the exact form. Remember the field width must be large enough
to include a leading sign, the decimal point and E+XY. Since printouts
from the write statement are right justified and since "231" takes up
only 8 of the 12 character field width, the four blank spaces are to
the left of the value.
2 The value "-61" in the write statement totally fills the F7.3 field,
therefore there is no space between this value and the previous value
in the printout. Since F7.3 indicates three digits to the right of the
decimal point, zeros are supplied in this case.
3 "X" indicates a space between values; therefore, the values supplied for
the F7.3 and E8.1 formats will be separated in the printout by at least
one space.
4 The value, -12.4 totally fills up E8.1, in fact, the last digit is sup-
pressed since, with this field designation, only one digit can follow
the decimal point.
"/" tells the printing device to skip one carriage return to the beginning
of the next line.
6 2F4.0 specifies two consecutive fixed-point formats of F4.0 to be used
for values in the write statement. The first format is for the value of
A, which from program line number 20 is 62.4; when a fixed-point format
specifies zero digits to the right of the decimal point, the value
supplied is rounded to be an integer and the decimal point is suppressed
-- 62, in this case. Since the carriage return had previously been spe-
cified, this value is printed on the beginning of the next output line.
~ -95-
104~;644
7 Quote fields are printed in the sequence in which they occur. Since
this quote field is in the write statement, it is printed immediately
after 62.4 is printed in F4.0 format. Note the space in front of "IS";
without this space, the printout woul1 read 62IS instead of 62 IS.
Quote fields can appear in either the format or write statements.
8 The value, .4 is also to be printed in F4.0 format. ~he rounded inte-
ger value of .4 is 0 -- hence, the printout.
9 "3X" indicates there should be three spaces between the values supplied
for the F4.0 and the E9.0 formats.
Expressions can be specified in write statements. The value of A+3 is
65.4; however, with this format, it will be rounded to 7.E+01. The
decimal point is not suppressed in floating-point notation when zero
is specified as the number of digits to the right of the decimal point.
\
-9Sa-
46644
If there are more values presented in the write statement than there are for-
mats in the referenced format statement, the formats will be repeated; e.g.,
10 FORMAT F6.2, E10.2
. .. ,,,,,~
20 WRITE (15, 10) 18, 21, 19.3, 29.6, .71
printout will be:
A18.00~A2.10E+01
~19.30~2.96E_01
~0.71
After the first two values are printed according to the specified formats,
the output printer's carriage return is activated, then two more values are
printed according to the same two specified formats, etc.
Formatting Rules:
In fixed-point format, Fm.n, m stipulates total field width and n sti-
pulates the number of digits to the right of the decimal point. If N>0,
the minimum field width allowable is m = n + 3; e.g., F4.1 for a value
of -.6 would print -0.6, which takes up the total field width of 4. If
n = 0, the minimum field width is m = 2; e.g., F2.0 for a value of -7
would print -7, thus taking up the allotted field width.
In floating-point format, Em.n, m and n are the same as in fixed-point
format. However, the minimum field width allowable is always m = n + 7.
The following are all allowed in format statements:
Fm.n - fixed-point formats;
Em.n - floating-point formats loften called exponential or scien-
tific notation);
X - space;
/ - carriage return (for printing device);
"****" - quote field;
: B - binary format (where write statement could have octal num-
ber, the binary equiv'alent would be output).
All of the above can be duplicated any number of times by leading the symbol
with the appropriate number.
1~)46644
The following are all allowed in write statements: constants, variables,
expressions, and quote fields. It should be noted that a write statement
can be input from keyboard mode; that is, the write statement can reference
the line number of a format statement in memory without being in the pro-
gram itself.
The maximum width of both the fixed-point and the floating-point fields is
9,999. However, the programmer is effectively restricted by the allowable
characters per line of the printing device.
The information in the format statement must be separated by commas.
The information in the write statement must be separated either by commas or
semicolons; generally it makes no difference. However, one additional fea-
ture of the write statement is that it can perform the identical operations
as the print statement; the benefit is the ability of the write statement to
select the device to be printed upon. To write up a punched tape photoreader
with select code ~, the write statement could be set up in the following
manner:
30 WRITE (2, *) A; B; C, D
The "*" indicates that no format statement is referenced; thus, WRITE acts
like a PRINT statement: data will be left justified, semicolons pack the
output fields, commas spread out the fields, etc.
P TAPE
As in BASIC , PTAPE causes the computer to read in a program from the punched
tape photoreader. If the photoreader select code is 5, then pressing either
., . _
-- PTAPE #5 or PTA #5 will perform this task unless no photoreader is connected
to the calculator. If a photoreader is not connected, the calculator will
wait till one is hooked up to complete the command. During this time the dis-
play will be blank.
"
.~
-97-
10466~4
During the implementation of this command, lines being loaded into memory
have their syntax checked; if a line is in error, it will be rejected - thus,
only those lines with correct syntax are loaded into the calculator. To
obtain a record of the rejected lines, it is necessary to put the calculator
in the print-all mode prior to pressing PTA #5; in print-all mode, all rejec-
ted lines are printed.
.
Note
To punch information onto paper tape, use the list command as
discussed earlier.
~- :
,
-97a-
,
~t~
:1046644
MULTILINE FUNCTIONS
Multiline functions serve the same purpose as single-line functions with the
added capability of heing able to describe more sophisticated functions.
In single-line functions the general form of the de-
fining function is:
statement number DEF FN single letter A to Z tsimple variable)t - expression
_
In multiline functions, the general form is the same aside from the equal
sign and the expression; for in a multiline function, the expression can be
spread out ove. many statement numbers. Thus, an extremely complicated
expression can appear in a more simplified manner; additional flexibility
is also gained in that the value of any variable within the expression can
be computed for a given value of the argument of the function; e.g.,
10 W = .5 When this program is run, D will return a
20 Y = 2 value of 32. The return statement returns
30 PRINT FNA (3) the result of FNA (X) which, in this case,
40 STOP is equal to D. Line 40, the stop statement
50 DEF FNA (X) is needed to keep the calculator from try-
60 Z = X~2 + Y~2 ing to re-execute lines 50 through 90 after
70 Q = Z + 3 D is printed; without STOP in line 40, an
80 D ~ Q~W error occurs in line 60 since a second pass
90 RETURN D beginning at line 50, would be made with
100 STOP X undefined.
Any variable evaluated in the expression can be returned by the return state-
ment, and multiple return statements are allowed; e.g.,
10 X = 3 100 RETURN Z
20 INPUT Y 110 Q = z~2
30 WRITE (15,900) FNG (Y) 120 IF Q < 100 then 150
40 END 130 PRINT "Q ="
50 DEF FNG (Y) 140 RETURN Q
~ -98-
~046644
\
60 Y = Y + l 150 PRINT "Z IS"
70 Z = Y~2*X 160 RETURN Z
80 IF z < 100 THEN 110 900 FORMAT F12.1
90 PRINT "Z =" 1000 END
tThe simple variable is a dummy variable which indicates where the actual
argument of th- ~unction is used in the defining expression.
,
-98a- -
1046644
In this example, a variable can be returned from three different lines (100,
140, 160) depending on the initial value of Y; Z can be returned from both
lines 100 and 160 if the value of Y meets certain criteria.
Caution must be taken as to the placement of the statement that calls the
function (in both examples, statement 30), and it is generally advisable
to put a stop statement immediately after this statement (as in line 40 of
both examples); otherwise, an undesirable loop may develop.
If correctly entered, the function of a function can be evaluated.
STOP, END
STOP was previously discussed, with emphasis on its program debugging capa-
bilities. Now it will be discussed as a program statement, emphasizing the
differences between it and the end statement.
When the program encounters a stop statement, it halts and is waiting; if
CONT EXEC is then pressed, the program will continue with the statement
following the STOP. This is not true if an end statement is encountered;
the program will halt, but if CONT EXEC is pressed, the calculator will
revert back to the lowest-numbered statement in memory. Therefore, the stop
statement should be used between stacked programs that are to be run sequen-
tially. When STOP is used in this manner, the values of simple variables can
be passed from program to program.
A program should be terminated by encountering either a STOP or an END.
The highest-numbered program statement need not be an end statement.
INPUTTING DATA
Program data can be input in three ways: the input statement, the read and
data statements, and the initialize command. The input statement and the
read and data statements are thoroughly discussed below.
_99_
1046644
INITIALIZE
The INITIALIZE key, when pressed, allocates storage space in memory for
array variables. After the required data is keyed in, the program can be
executed by pressing CONT EXEC, remember - RUN EXEC erases the values of
all variables, thereby
-99a- ,
1046644
requiring all variables to be defined in the program itself.
Simple variables can always be input in keyboard mode without using the
INITIALIZE key, as long as CONT EX~C is pressed to run the program. Since
array variables can be input in keyboard mode by using the initiali~e com-
mand, it is not necessary to define any variables in the program itself.
It is still necessary, however, to identify arrays in either a dimension
or a common statement.
-100- ~
,
1046644
USER - DEFINABLE KEYS
There are ten user-Definable Keys (UDK) in the upper left-hand block of the
keyboard. There are, however, effectively 20 accessible UDK's since each
key can be accessed normally or with the shift key held down.
To enter UDK mode, press FETC~ (particular UDK); the display will then read,
KEY indicating the mode. To exit from UDK mode, press CLEAR E N D EXEC;
the scratch command can also be used to exit from UDK mode - this command
will, of course, erase certain information in the process. UDK mode is
automatically exited when certain sequences are followed; these cases will
be discussed later.
The user-definable keys can be used effectively in three ways:
1. to represent text (where text can be used as a typing aid);
2. to represent functions (where different values can be passed to
the function);
3. to represent programs.
REPRESENTING TEXT
If a key represents text, merely pressing the key will immediately display
the text without erasing anything that was previously on the display. Thus,
commonly used words and phrases can be put on keys to serve as typing aids.
Text can be put on a key in the following manner.
First, access a key by pressing FETCH (particular UDK). Then~ press * fol-
lowed by a character stringt and finally EOL. Besides inputting the charac-
ter string, pressing EOL in this sequence takes the user out of UDK mode.
Any time the programmer wishes to use a character string, he must press the
key into which the desired character string was input.
If, for example, a key was accessed by FETC~ (particular UDK); then *
FORMAT F10.2,X, EtO 1 EOL was input. If subsequently program line number 60
-101-
.~ ~
1046644
needed this format, pressing 60 (particular UDK) EOL will put line number 60
into memory with the required format.
tThe maximum length for the character string (including the *) is 80 charac-
ters.
-lOla-
~046644
A typing-aid key can be used as an immediate execute command if an * is
placed both in front of the text and following the text;
e.g.,
FETCH (UDK) * LOADDATA #4, 6, B * EOL
This command will be immediately executed whenever the UDK is pressed.
To use a key that has text, merely press the key. Pressing FETCH
(particular UDK) will display the * with the text; however, text can be
edited if the fetch command is used. Pressing FETCH and then * will erase
the old character string and then wait for new text to be input.
REPRESENTING FUNCTIONS
A user definable key can be used to represent functions - either single or
multiline. In either case, after the key is accessed, the function must be
preceded by a line number - input either manually or automatically.
After a key has been accessed, the following function could be input:
10 DEF FNA (X) = 7 * X -3 EOL
Whenever a value is to be passed to X (the argument of the function), first
press the appropriate key; the display will read FNA. Then key in the
appropriate value of the argument, which can be either a constant or an ex-
pression (e.g., 20), and press EXEC; the value of the function will then be
displayed (in this case, 137). The same result could have been achieved by
using the fetch command; however, FNA would not appear automatically on the
display; it would have to be keyed in along with the argument; e.g., FETCH
(UDK) FNA 20 EXEC would also display 137.
If a multiline function, DEF FNB (Z), has been input, pressing the appropriate
UDK causes FNB to be displayed; as before, passing a value to the argument, Z,
and then presslng EXEC will compute and display the value of the function.
Functions in màinline memory and in a UDK can he called, regardless of the
current operating mode.
-102-
~046644
If a function in the calculator is defined in more than one place, the first
function found with the designated name will be accessed. If the user is
in UDK mode, the calculator will search for the function in the following
order:
1. The current UDK program will be checked.
2. The first line of each key (in the order defined) will be checked.
3. Mainline memory will be checked.
If the user is not in UDK mode, the order of the search will be steps 3 and
2, 'respectively.
REPRESENTINS PROGRAMS
A UDK can be used to represent an entire program. Programming rules in UDK
mode are consistent with those discussed above. There is
one restriction, however; if a common statement is used, its size must be
less than or equal to the size of the common statement in the mainline pro-
gram - for there is only one common area allocated to memory.
To run a program that is represented in a UDK, it is advisable to press RUN
(particular UDK) or FETCH (UDK~, then INIT (particular UDK). The program
can be continued merely by pressing the (particular UDK); but if there are
array variables in the program, pressing only the key will cause these vari-
ables to be undefined (similar in this respect to the continue command,
which neither destroys the old symbol table nor builds a new one). After
executing the program, the calculator will exit from UDK mode.
Programs represented on a UDK generally use only simple variables for the
obvious ease of handling.
To list program lines on a particular UDK, press:
LIST (particular UDK);
pressing LIST EXEC in the UDK mode will list the program lines on the key
currently being accessed. To selectively list particular lines on the UDK,
~ -103-
t
~046644
t it is first necessary to FETCH a key; then use the list command as discussed
below.
To load a program from a cassette file onto one particular key, first FETCH
the key, then give the load command followed by EXEC. Program lines on a
particular key can be
-103a-
1046644
stored onto the cassette in the same manner; text (as a typing aid), however,
cannot be stored in this manner.
STORE KEY and LOAD KEY can be used for any UDK regardless of the information
on the key. The use of these keys is discussed below.
-;.
--1 0~--
lb~66~4
SrA I ~M EN l-.S
,
~.
This is a 3A~IC stctem~nt:
1,~ Ii~PUT A,B,C,D,E
COM~1E~TS
A statement corît~ins a maximum of ~0 characters
A statem~nt may also be called a line.
.
-1 0S - ~
1046644
STATEM ~1~1T N Ul'A B~:RS
Each BASIC statement begins with a sta ~ment_umb~r (in
this example~ 20):
2~ LET S-(A+B~C+D+E)/5
t ~ ~- ~ ~
COMMENTS
The number is called a statement number or a line number.
The statement number is chosen by you, the programmer. It
may be any integer from 1 to 9999 inclusive.
Each statement has a unique statcment number. The con-lputer
uses the numbers to keep the statements in order.
Statements may be entered in any order; they are usually
numbered by fives or tens so that additional statements
can be easily inserted. The computer keeps them in numeri-
cal order no matter how they are entered. For exanlple, if
statements are input in the sequence 30,10,2~; the computer
arranges them ln the order: 1~,2~,30.
-106- 1
~ - -
104~644
INSTRUCT~01'~$
2~ ~ tr ~ ur ~
The statement then gives an l-n~t~u~ oA to the
~omputer (in this example, PRINT):
30 PRINT S
: COMM~NTS
~nstru¢tlons are sometimes called statement types
because they identify a type of statement. For
example, the statement above is a "print" statement.
~ '
.,
:
~ I '
J
~ ~ -107_
. ~, . . . .
1046644
O PE t~f~N D~
If the instruction requires further details, op~ra~ds
~numeric details) are supplied (In this example, 10;
on the previous page, "S"):
4~ G0 T0 1
,
- OOMMENTS
The o~erands specify what the instruction acts upon; for
example, what is PRINTed, or where to G0.
. . -108-
.. .
iO~6644
P ~ A M
The sequence of BASIC statements 1~ INPUT A,B,C,D,E
given on the previous pages is 2~ LEI S=(A+B+C~D+E)/5
called d program. 30 PRINT S
The last statement in a program, 40 GO TO 10
as sho~n here, is 50 END
an END statement.
,
CO~lENTS
The last (highest nun~ered) statement in a program
must be an END statement.
'~ The END statement informs the computer that the
program is fSnished.
~ -1 09- /
' _
. . .:. ~ -
104~i644
FREE-F0 R~A ~T L~N~i UAt~
BASIC is a "free format" language--the computer
ignores extra blank spaces in a statement. For
examp1e~ these three statements are equivalent:
3~ PRINT S
3p PRINT S
3~PR~NTS
~ ( .
COMMENTS
When possible, leave a space between words and
numbers in a statement. This makes a program
easier for people to read.
~ .
-110-
.
.
1046644
TERM: SI~PLE VAR~Bl..
DEFI~ED IN BASIC AS: A letter (from A to Z); or a
letter immediately followed
by a digit (from 0 to ~).
EXAMPLES: A0 B
5 C2
Z9 D - -- .-
COMMENTS
Yariables are used to represent numeric values.
F~r instance, in the statement:
10 LET M5 = 96.7
M5 is a variable; 96.7 is the value of the variable
M5.
There is one other type of variable in BASIC, the
array (subscripted) varia~lei its use is explained
in Section IV.
....... ~ ..................................................... ,
-Ill-
10~644
T E R M ~ B E R
OEFINED IN BASIC AS: A decimal number (tt,e sign ~s opticnal) bet~een
lE-99 and 9.999999993999E+99
Zero is included in this ranse.
EXAMPLES:
-10008 5 3.14159 lOE+37
126.257 O lO E37 lOE-37
16.01 .06784-lO E37 l.OE+2
--
- TERfV3 ~ OTAT10 N
~EFINED IN BASIC AS: A means of expressing numbers having more than six
decimal digits, ;n the form of a decimal number
raised to some power of 1~. ;
EXAMPLES: 1.000~0E~06 is equal to 1,~0,000 and is read: "1
times 10 to the sixth power" (lx106).
2000E+04 is equal to 1~,200
1.02000E-04 is equal to .0~01~2
,
COMMENTS
"E" notation ~s used to prlnt numbers ha~ln~ more than six signiflcant
digits. It may also be used for input of any number.
When entering numbers in "E" notation, leading and trailing zeroes may
be omitted from the number; the ~ sisn and leadir,g zeroes may be omitted
from the exponent.
The precision of numbers is 12 decimals digits
-112-
~0~;64
X P ~ I~ S S I t~
DEFINED IN EASIC AS: A co~bination of variables, con- ' -
stant,s 2nd operators which eval-
uateS t. ~ numeric val~e.
EXAMPLES: (P + 5)~27
(where P has previously been
assigned a numeric value.)
Q - (N + 4)
(where Q and N have previously
~ - been a,ssigned numeric values.)
TERM: ARIT~METIC EVALU~TION
DEFINED IN BASIC AS: The process of calculating the
value'of an expression.
-113-
~046644
~. .
TI~E ASSII~;NN5EN-r OP~Al O~
SYMBOL: =
EXAMPLES: 1~ LET A = B2 = C = Q)
20 LET A9 = C5
30 LET Y = (N-(P.~5))/T
~ 4~ LET N5 = A + B2
5~ LET P5 = P6=P7=A-3=~8.fi
GENERAL FORM: LET variable-- expression
,
PURPOSE
Assigns an arithmetic or logical value to a variahle.
COMMENTS
When used as an assignment operator, = is read "takes
the value of," rather than "equals". It is, therefore,
possible to use assignment statements such as:
LET X = X+2
~ .
This i5 interpreted by BASIC as: "LET X take the value
of (the present value of) X, plus two."
Several assignments may be made in the same statement, as
in statements 1~ and 5~ above.
See Section V, "Logical Operations" for a description of
logical assignments.
.
--1 14--
~046644
l AT3 ~ N A ~ Q P~ ~AT0 RS
SY,YBOLS: = ~ '> > ' '= ~= '
EXAM~LES: 10~ IF A=6 THEN 9~0
110 IF A+B >C THErl ~10
120 1 F 4 ' .B C+~ .E~ 920
~ 130 IF C>=D*E T~lEi! 930
140 IF C9-= G~H IHEN 9'~
15~ I F P2 ','C'9 Tl-IE~ 95~1
16~ IF J ~' K THcN 95ja
PURPOSE
._.. _~7_.................. Deterinines the logical relationship between two expressions, as
equality:
inequality: # or <>
greater than: >
~ less than: <
greater than or equal to: ~=
less than or equal to: <=
COMMENTS
NOT~: ~t is not necessary for the novice to understand the nature
of logical evaluation of relational operators, at this point.
The com~ents below are for the experienced programmer.
- Expressions using relational operators are logically evaluated, and
assigned a value of "true" or "false" tthe num2ric value is l for
"true," and 0 for false).
When the = symbol is used in such a way that it might have either an
assignment or a relational function, ~ASIC assumes it is an assignment
operator. For a description of the assiynment statement using logical ~ -~
operators, see Section V, "Logical Operations " .J
-115-~
10466~4
ARIT~ IC OPER~TO~S
c SYMBOLS: ~ * / ~ -
EXAMPLES: 4~ LET Nl = X-5
5~ LET C2 = Nt3
6~ EET A = (B-C)/4
70 IET X = ((P~2)-(Y*X))/N~Q
PURPOSE
Represents an arithmetic operation, as:
exponentiate:
multiply: *
div;de:
add:
( subtract:
COMMENTS
The "-" symbol is also used as a sign for negat;ve numbers.
It is good practice to group arithmetic operations with
parentheses when unsure of the exact order of precedence.
The order of precedence (hierarchy) is:
t
/,
with ~ having the highest priority. Operators on the same level
of priority are acted upon from left to right in a statement.
_- See "Order of Precedence" in this Section for examples.
-116-
10 16~;44
ARIT~IMETIC OPERATOF~), CON~ lUED
The symbols + and - are also used ..c, indicate unary plus
and unary minus. For example, negative numbers may be
expressed in a statement ~lithout using parenthesis:
10 LET Al= -B
20 LET C2 - D ++E.
30 LET B5 = B --C
See "Order of Precedence" in this section for examples
- - or ho~l unary + and unary - are interpreted. .
-117_
iO~6644
THE ~ND OPERATOR
~''- SYMBOL: AND
EXAMPLES: 6~ IF A9~Bl AND C~5 THEN 1,00
7,0 I F T7#T AND J=27 THEN 150
80 IF Pl AND R>l AND N AND V2 THEN 10
90 PRINT X AND Y
PURPOS E
Forms a logical conjunction between two expressions. If both are
"true," the conjunction is "true"; if one or both are "false," the
conjunction is "false."
~OTE: It is not necessary for the novice to understarld how this
opera tor works . The comm~nts below are for experienced
- progralr2mers.
COMMENTS
The numeric value of "true" is 1, of "false" is 0.
All non-zero values aré "true." For example, statement 90 would
print either a 0 or a 1 (the logical value of the expression X AND
Y) rather than the actual numeric values of X and Y.
Control is transferred in an IF statement using AND, only ~hen all
parts of the AND conjunction are "true." For instance, example
statement 80 requires four "true" conditions before control is trans-
ferred to statement 10.
See Section V, "Logical Operations" for a more complete description
of logical evaluation.
--1 18 -
10~66~4
T~ E ~ F~ O P~ ~ h~O
SYMBOL: OR
EX~MPLES~IF /\>1 ~P~ B<.5 T~,LN 5~,e
11,~ PRJNT C OR D
120 LET D - X OR Y .-
130 Ii (X ANU Y3 OR (P AND Q) THE~I 60
PURPOSE
Forlns the logical disjunction of two expressions. If
, . . . . .
either or both of the expressions are true, the OR dis-
junction is "true"; if both expressions are "false," the
OR disjunction is "false."
NOTE: It is not necessary for the novice to understand how
this operator wor~s. ~he comments below are for
; experienced programmers.
COMMENTS
The numeric values are: "true" = 1, "false" = ~.
~; .
' All non-zero values are true; all zero values are false.
Control is transferred in an IF statement using OR, when
either or both of the two expressions evaluate to "true."
.: ,
See Section V, "Logical Operations" for a more complete
description of logical evaluation.
.' '' ' ' ' .
, -119- 1
, .
. , .
,; .
10~66~
Tll E ~ OT 0 PL l:~AT0 R
- SYMBOL: NOT
EXAMPLES: 30 LET X = Y =. 0
35 IF ilOT A THEN 3~ -
~5 IF (NOT C) AND A THEN 4
55 LET G5 = ~OT P
65 PRI NT NOT (X AND Y)
7~ I F NOT (A=B) THEN 5,~
~~
PURPOSE
Logicall~ evaluates the complement of a given expression.
NOTB. It is not necessary for the novice to understand
how this operdtor works. T~e com~ents below are
lntended for experienced programmers.
(
- COMMENTS
If A = ~, then NOT A = l; if A has a non-zero value,
NOT A - 0.
'
; The numeric values are: "true" - 1, "false" = ~; for
example, state~ent 65 above would print "1", since the
expression NOT (X AND Y) is true.
i~
! Note that the logical specifications of an expression may
be changed by evaluating the complement. In statement 35
above, if A equals zero, the evaluation would be "true"
~1); since A has a numeric value of 0, it has a logical
~ value of "false," making NOT A "true."
( - See Section V, "Logical Operations" for a more complete
description of logical evaluation.
'. ' I
~; - 1 2 0 -
... .
- - .
iO~6644
OF~DE~ OF Pr~C~:~)ENCE
The order of per,ornling oporctions is:
t high~s ~ prec~dence
NOT unary + un~ry -
,
+
Rela tional Opera tors
AND
OR lowes t pr~!c~dence
COMMENTS --
If two operators are on the same level, the order of
execution is left to r;ght~ for example:
5 + 6*7 is evaluated as: 5 ~ (6x7)
7114*2/5 is evaluated as: (7/14~x2
Parentheses override the order of precedence in all cases,
for example:
~ 5 +- (6x3) is evaluated as: 5 + l8
and
3 + (6+(2~2)) is evaluated as: 3 + (6+4)
Unary + and - may be used; the parentheses are assumed by
- BASIC. tor example: . .
A + + B is interpreted: A ~ (+B)
C - + D -5 is interpreted: C - (+D)-5
Leading unary + signs are omitted from output by BASIC, but
remain in program listings.
--121--
1046644
ST~TEM ~ITS
Statements are instructions to thecalc~lator ~h~y are contain~d
in numbered lines within a program, and execute in the order Oc
their line numbers. Statements cannot be executed without run-
- ning a program. They tell the c~lculator what to do while a pro-
gram is running.
Here are some examples mentioned in Section I: -
LET
PRINT
INPUT
Do not attempt to memorize every détail in the "Statements"
( - subsection; there is too much material to master in a single
- session. By experimenting with the sample progranls and at-
tempting to write your own programs, you will learn more
quickly than by memorizing.
-122_
.. . : . ,
~0~6644
THE: LET ~TA-r~M~ T
_
EXAMPLES: 1~ LET A = 5.~2
2~ LET X - Y7 = Z =
30 LET B9 = 5~ !X~2)
40 EET D = (~*C2~N)/(A*(N/2))
GENERAL FORM r
statem~nt number LET variable -- number or expr~ssion or variable...
PURPOSE
.
Used to assign or specif~y the value of a variable. The value
may be an expression, a number, or a variable.
COMMENTS
The assignment statement must contain:
1. A statement number,
2 . L,ET i s op t i ona l
3. The variable to be assigned a vaiue (for example, B9
in statement 30 above),
4. The assignment operator, an = sign,
5. The number, expression or variable to be assigned to
the varidble (for example, 5*(X~2) in statement 30 above).
Statement 2~ in the example above sho~s the use of an assignment
; to give the same value (0) to several variables. This is a use~ul
featùre for initializing variables in the beginning of a program.
.. .
,' ~ .
'' ' ' ! )
. .. I
, -123- 1
lO'~fi644
REM
EXAMPLES:1~ REM--THIS IS ~N EXAMPLE
2~ REM- OF REM STAIEMENTS
- 3~ REM-----/////i;;**l!!!!!
40 REM. STATEMENTS ARE NOI EXECUT'-~ BY BASIC
GENERAL FORM: _ ate.ment number REM any remark or series of characters
~ .
PURPOSE
- Allows insertion of a line of-remarks or comment
in the listing of a program.
. . -- ~ .
COMMENTS
Must be preceded by a line number. Any series of
characters may follow REM.
REM lines are part of a BASIC program and are printed
when the program is listed or punched; however, they
are ignored when the program is executing.
Remarks are easier to read if REM is followed by d
punctuation mark, a~ in the example statements.
.
--1 24 -
~ r~
10~6~;44
P RI NT
This sample program gives a variety of examples of the PRINT statement.
The results are sho~n below~
1e) LET A=B=O=l
20 LET Dl-E9=2
30 PRINT A, e,C,Dl,E3
40 PRINT A/ B,B/C/Dl~ E9
50 PRINT "NOTE TIIE PO~:!ER TO EVALUATE AN EXPP.ESSION AND PRINT THE"
60 PRINT "VALUE IN THE SAI~E STATE~lENT.'
70 PRINT
80 PRINT
90 REIM* "PRINT" ~IITH NO OPERAI'ID CAUSES THE TELEPRlNlER TO SKIP A LINE.
100 PRINT "'A' DIVIDED BY 'E9' ="iAjE9
110 PRINT "11111", "22222", "33333", "44444", "55555", "66666"
120 PRINT "11111"; "22222", "33333"; "44444"; "55555"; "66666"
130 END
-- RESULTS ----------------------------
RUN
10 20 20
20.05
NOTE THE POI~ER TO EVALUATE AN EXPRESSION AND PRINT TIIE
VALUE IN THE SAME STATEMENT.
'A' DIVIDED BY 'E9' = .5
11111 22222 33333 44444 55555
66666
111112222233333444'~45555566666 ~ -
NOT~: I17e ", " and "; " used in statements 11~ and 12,~ have
very different effects on the fo~mat.
-125-
': , ' ''
i
10466J~4
PRINT, CONl~INUED
. ~
GENERAL FORM:
statement number PRI ~T ex~ression ~ expression , ...
or
statement number PRINT "an~_text" , expression ; ...
or
statement number _ RINT "text" , expression , ''t_xt" , "text" , ...
or
statement nùmber PRINT an~ co.~ination of text and/or expressions
or
statement number PRINT
PURPOSE ' -
Causes the expressions or "text" to be output to the Printer
Causes the printer to skip a line when used without an operand~
COMMENTS
Note the effects of , and ; on the output of the sample program. If a com~d
ls used to separate PRINT operands, five fields are prlnted per printer
line. If semicolon is used, up to twelve "packed" numeric fields are output
per .printer line (72 characters).
~ Text in quotes is printed literally.
~OTE: A ~a~iable name is considered as a simple expression by ~ASIC For
example, a statemen~ for the first general form shown above ml'ght be:
10~ PRlNT A1, ~2, C3
or
. 110 PRINT A, 2, X, T9
where the variables ~epresent numeric expressions.
Remember that variable values must be defined in an assignment, INPUT, READ
or ~OR st~tement before being used ~n a' PRINT statement.
-126-
1046644
P~ T, CONTlNlj~:D
Ending a PRINT statement ~lith a semicolon causes the o~tput
to be printed on the same line, rather than ~enerating a
return linefeed after the statement is executed. For example,
the sequence:
20 LET X = 1
30 PRINT X;
40 LET X=X+l
50 G0 T0 30
,
produces o~tput in this format: .
1 2 3 4 5 6 -7 8 9 10 1i 12
13 14 15 16 17 18 19 20 21 22 23 2~
Similarly, ending a PRINT statement with a comma causes output to
fill all five fields on a line before moving to the next line.
The trailing comma in statement 30 in the sequence:
2~ LET X = 1
30 PRINT X,
4~ LET X=X+l
- 50 G0 T0 30
produces output in this format:
1 2 3 4 5
6 7 8 9 10
11 12 13 14 15
A PRINT statement without an operand (statements 70 and 80 in
the sample program) generates a ~et~n linefe~d.
~127-
lo46644
GO TO A~D ~iULTlBR~!NCI~ GO TO
~.,.
~ EXAMPLES: t0 I ET X = 20
.
40 GO TO X+Y OF 41~,420,430 ..
50 GOTO 100
80 GOTO t 0
- 9~ GO T() N OF 10~,150,1~0,190
GENER~L FORi î: - '
sta~ement number GO TO statement n~lrber
state~ent num~er GO TO expression OF sequence of statement numbers
PURPOSE
GO TO transfers control to the statement specified.
- ~,6,.,
GO TO expressio~...rounds ~he expression to an integer n and transfers control
to the nth statement number follo~ing OF.
CO~l~lENTS
GO TO may be written: GOTO or GO TO.
Must be followed by the statement number to ~hich control is transferred, or
expression OF, and a sequence of statement numbers.
GO TO overrides the normal execution sequence of statements in a program.
If there is no statement number corresponding to the value of the expression, the
GO TO is ignored.
Useful for repeating a task infinitely, or "jumping" (GGing TO) anotiler part ofa program if certain conditions are present.
GO TO silould not be used to enter FOR-~'EYT locps; doing so ~ay produce unpredict-
able results or fatal errors~
. "' . I
--1 2 8--
.. ..
10~664
OS U ~ U
'
!i EXAI~PLE: 50 READ AZ
.~ 6~ IF A2<100 TH-N 80
70 GOSUB 400
380 ~TOP (STOP frequently precedes the first statement o~
a subroutine, to prevent ac~idental entry.)
390 REM--THIS SU-ROUTINE hSKS FOR A l OR 0 REPLY.
400 PRINT "A2 IS>100"
410 PRINT "DO YOl WANT TO CONTINUE";
420 INPUT N
430 IF~ N ~0 THE~I 45
440 LET A2 = 0
450 RETURN
60~ END
GENERAL FORM: statement num~er GOSUB statement number starting subroutine
statement number RETURN
PURPOSE
GOSUB transfers control to the specified statement number.
RETU2N transfers control to the statement follo~ling the GOSUB - .
statem~nt ~lhich transferred control.
GOSUB...RETU2l'l eliminates the need to repeat frequelltly used
qroups of statements in, a pi~ogram.
~' .
-129-
.~
'
10~664d,~ .
~ULT36~.ANC~ ~OSU~3
~ EXA~IPLES: 20 Go$UE 3 OF 10~ 20~ 3~ 4~ 5~0
- ~ 60 GOSUB N+l OF 20~ 21~ 22
- 7~ GOSUB r~ OF 8~ 2Z~ 380.~8~ 58
GErlEi~A~ FORM:
state~ent num~er GOSUB fxpression OF seq~cnc~ of statement nu~b~rs ...
PURPOSE
, .
GOSUB espression rounds the expression to an integer n and transfers
control to the nth statement lumber follo~ing OF.
COMMENTS
Subroutines should be exited only ~lith a RETURN statement
The expression indicates which of the specified subroutines will be
executed. For example stat~ment 2~ above transfers control to the
subroutine beginning ~lith st~atement 3~0. The expression specifies which
statement in the sequence of~five statements is used as the starting one
in the subroutine.
The expression is evaluated as an integer. Non-inteoer va!ues are
rounded to the nearest integer.
If the ~xpression evaluates to a number greater than the number of state-
ments specified or less than 1 the GOSUB is ignored.
.
Statem~ent numbers in the sequence follo~ling OF must be separate~ by comnlas.
.
,~
.; .. ~ .
,
~ -130-
,
."
10~ 4
I F. ..T~
SAMPLE ~ROG~.AM: 10 L~
20 RE~D X
30 IF X <=N THErl 6~
40 PRINT "X IS OVFR", N ---
50 GO TO l00 --
60 PP~INT "X IS LESS THAN OR EQUAl TO"; r~
70 GO TO 20
Q~ ~TnP
GENER.~' FORM:
statemen1: number IF exPression relational op expression THEN statement nu~7ber
PURPOSE
Transfers control to a specified statement: if a specified condition is true.
COI~MENTS
.
Sometimes described as a conditional transfer; "GO TO" is implied by IF...THEN,
if the condition is true. In the example above, if X<=l~, the message in
statement 60 is printed (statement 60 is executed).
Since numbers are not always repre ented exactly in the computer, the = oper-
ator should be used carefully in I-...THEN statements. Limits, such as <=,>=,
etc. should be used in an IF expre-sion, rather than =, whenever possible.
If the specified condition for tralsfer is not true, the program will continue
executing in sequence. In the exanple ahove, if X~l~, the message in state-
ment ~0 prints.
The relational operator is optional in logical evaluations.
See Section V, "Logical Operations," for a more complete description oflogical evaluatior,.
-131-
10~;64~
FOR...I~EXT
EXAMPLES~ FOR Pl = 1 TO 5
1 l e) FOP~ Ql = N TO X
12~ FOR R2 = N TO X STEP 2.5
130 FOR S = 1 TO X STEP Y
14~ NEXT S
15~ NEXT R2
160 NEXT Ql
17~ NEXT Pl
~ o ~ _~ _ _ _ _ _ _ ~ _ _ _ _
Sample Program - Variable Number Of Loorfi
40 PRINT "HOW MANY TIMES DO YOU WANT TO LOOP";
5~ I NPUT A
- - 6~ EO R J = 1 TO A
7~ PRINT "THIS IS LOOP"; J
8~ READ N1, N2 , N3
-- 9~ PRINT "THESE DATA ITEMS l~lERE READ:" N1; N2; N3
1,~0 PRINT "SUM ="; (Nl+N2+N3)
NEXT J
120 DATA 5, 6, 7, 8, 9, 10, 11, 12
~ 130 DATA 13, 14, 15, 16, 17, 18, 19, 2,0, 21
140 DATA 22, 23; 24, 25, 26, 27, 28, 29, 30
15~ DATA 31, 32, 33, 34
16~ END
~ GENERAL EORM:
- statement number FOR simple variable -- initial val_e TO ~inal value
or
~---- statement no. FOR simple var. -- initial value TO final value STEP step value
.
statement number NEXT slm~le variable
~OT~: The sam~ simple vàriable must be used in both ~1e F~R and N~XT state-
; ments of a loop.
, -132-
~0~6644
F O ~ r C O N~TI N U ~ D
PURPOSE
Allows controlled repetition of a group Gf statements within a program.
COI~'lEN TS
Initial valuet final value and step value may be any expression.
S~EP and step value are optional; if no step value is specified, the computer
will automatically increment ~y one each time it executes the loop.
How the loop works
The simple variable is assigned the value of the initial value; the value of
the simple variable is increased by 1 (or by the step value) each time the
loop executes. When the value of the simple variable passes the final value,
control is transferred to the statement following the "NEXT" statement.
The initial, final, and step values are all evaluated upon entry to the loop
and remain unchanged after entry. For example,
FOR I = l TO I + 5
goes from l to 6; that is, the f;nal value does not "move" as I increases with
each pass through th~ loop~
For further details on the STEP feature, see "FOR...NEXT with STEP" in
Section III
Try running the sample program if you are not sure what happens when FOR.o.
NEXT loops are used in a program.
~,
-133-
. .
10~6644
NESTiNG ~O~..NEXr LOOPS
.
Several FOR...NEXT loops may be used in the same program;
they may also be nested (placed inside one another). There
are two important features of FOR...NEXT loops:
1. FOR.~.NEXT loops may be nested.
----1 0 FO R Al = 1 TO 5
Range of loop Al - ~20 ~OR B2 = N TO P
-3~ FOP~ C3 = X TO Y STEP R
Range of loop B2 ~ ~
Range of loop C3 ~ -8p NEXT C3
9,~ NEXT B2
- 1~0 NEXT Al
2. The range of FOR...NEXT loops may not
overlap. The loops in the example above
are nested correctly. This example shows
improper nesting.
10 FO R I = 1 TO 5
.
~;
--30 tOR J = 1 TO N
; ~he r~nge of loops
I and J overlap. ~50 NEXT I
.
- - 9~ NEXT J
'
. . I I
--1 ~4-
.
10~664~
~ ~, . .
~ ~A~, ~ATA AND R~:S 3 CRE
Sample Program using READ and DATA
l5 FOR I=l TO 5
20 READ A
4~ LET X=A~2
4~ PRINT Ai" SQUARED =";X
50 ~EXT I
55 DATA 5.24,6.75,30.8,72.65,89.72
6~ END
... 7~.. .. , ~ .. . . .. ...
.
" Each data item may be read only once in this progral~.
TSE keeps track of data ~lith a "pointer." ~Ihen the
~ first READ statement is encountered, the "pointer"
fndfcates that the ffrst item in the first DATA state-
ment is to be read; the po;nter is then moved to the
second item of data, and so on.
In this example, after the loop has executed five
times, the pointer remains at the end of the data
lis~.' To reread the data, it is necessary to reset
the pointer. A RESTORE statement moves the pointer
back to the first data item.
.
( ') .
-135-
..
10466~4
~EAD, DATA AND RE~iT~RE, CONT~NVEl:)
Sample Program Using READ, DATA and RESTORE
2~ FOR I=l TO 5
30 REA~ A
~2 40 LET X=A~2
5~ PR~l A; "SQUARED -",X
6~ NEXI I
80 RESTORE c
100 FOR J=l TO 5
11~ READ ~ - -
120 LET Y=B~4
. 13~ PP~INT B; "T~ THE FOURTH POWER =";Y
~ 140 NEXT J
150 DATA 5.24,6.75,30.8,72.65,89.?2
160 END
GENERAL FO~:
stateme.~t number READ vari~bl~ , variable ,...
s~eement number DATA nun~er or string , number or string ,...
sta~ement number RESTORE
statement ~umber RESTORE sta~eme~t number
PURPOSE
The READ statement instructs TSB to read an item from a ~ATA statement.
The DATA statement is used for specifying data in a program. The data
is read in sequence from first to last DATA statements, and from left to
right within the DATA statement.
~ The RESTORE state,llent resets the pointer to the first data item, allowing
data to be re-read.
RESTORE follo~led by a statement number resets the pointer to the first
data item, beginning at the specified statemen~.
. . .
. -136-
. ~ ~ .--
4664~
~EA~, ~)A~ A~iD R~:S~OF~E:, CGN I II~UE~)
:~ .
CON~IENTS
READ statements require at least one DATA
Std tement in the same program.
Items in a DATA statement must be separated
- by comnas. String and numeric data may ~e
mixed.
. .
DATA statements may be placed anywhere in 2
program. ~he data items will be read in se-
quence as required.
DATA statements do not execute; they merely
specify data.
. ,,. ,~ .
The RUN command automatically sets the pointer
to the first data item.
If you are not sure of the effects of READ,
OATA, and RESTORE, try running the sample
programs.
",~ :
--137-
rv,.;. ~i~ ?, ~ , r rrl ' r ~ ~; ~?:': ' r A;~
10~6
WAIT
EXAMPLE 9~0 WAIT (10~0)
~90 WAIT (3~0)
GENER~L FORM: s~c:atement nur~ e~ _lAIT ~ ~xpres~ion max. value of 32767 )
'
PURPOSE
Introduces delays into a program. WAIT causes the program
to wait the specified number of miiliseconds (maximum 32767
mitliseconds~ before continuing execution.
COMMENTS
The time delay produced by WAIT is not precisely the number
of milliseconds specified because there is no provision to
account for time elapsed during calculation or terminal-
computer conmunlcatton.
One millisecond - l/lOOO second.
-138-
~'. ,
~g
----
~04664A
TE~M: ROU~INE
DEF~NED IN BASIC AS: A sequer,ce of program statements
which produces a certain result.
~ ~s~"~
PURPOSE
Routines are used for frequently perforined
operations, saving the programlner the work
of defining an operation each time he uses
it~ and saving computer memory space.
COM~ENIS
A routine may also be called a program,
subroutine, or sub-program.
The task performed by a routine is defined
by the programmer.
-139-
~' _
.- ~
~0~6644
T ~ S~ R I ~l G
DEFINED IN BASIC ~S: 0 to 255 printer characters
enclosed by quotation marks
(one line on a tele~rinter terminal).
COMMENTS
. , ~ -5 --
Sample strings: "ANY CH~RACTERS'?*/~
"TEXT l234567,.."
Quotation nlarks may not be used within a string.
Strings are used only in PRINT statements.
The statement number PRINT, and quotation marks are not included
in the 65 character count. Each statement may contain up to 72
characters. Maximu!n string length is 72 characters minus 6
characters for "PRINT", two for the quotation mar~s, and the num-
ber of characters in the statement number.
TEI~M: FUNCT10~
~ ~..... ~..... .......
DEFTNED IN BASIC AS: The mathematical relationship between
two variables (X and Y, for examp~e)
such that for each value of X there is
one and only one value of Y.
CO~lENTS
Thc independent variable in a function is called an argument;
the dependent variable is the function value. For instance,
if X is the argunient, the function value is the square root
of X, and Y takes the value of the function, -~
,'
-140-
~0'~664~
TER1~: A R ~\Y 0F~ ~lQTRlX
DEFINED IN BASIC AS: An ordered co11ection of nume1~ic data
(nilmbers ) .
COM~ENTS
Arrays are divided into columns (vertica1) and rows (hcri~ontal):
C R~W.S
U
N
S
Arrays may have one or two dimensions. For example,
1 0
~ 3.2
C 4.3
is a one-dimensional array, while
6 , 5 , 4
3 , 2 , 1
9 8
is a two-dimensional array.
Array elements are referenced by their row and column Position
For instanceJ if the two examples above were arrays A and Z
respectivel~, 2.1 would be A(2); similarly, ~ wou1d be Z(3,1).
The references to array elements are called subscripts, and
set apart with parenthéses. For example, P(1,5) references the
fifth element of the first ro~ of array P; 1 and 5 are the sub-
scripts. In X~11,N) M and N are the subscripts.
--141--
'
10'~644
TE~M: WORl)
,
~EFINED IN BASIC AS: The amount of computer memory
space occupied by two teleprinter
characters.
COMMENTS
Numbers require th'O words of memory space when stored as
numbers.. When used within a string, numbers require 1/2
word of space per character in the number.
--142 -
109~644
SUE~ROU~IN~S AND.l~INCTIONS
The follo~ing pages ex~l~in BASIC ,eatures useful for re-
petitive operations -- subroutines, programlller-defined
functions and standard func-tions.
The program~1ler-defined f~ature~, such as GOSUB,
FOR...NEYl with STEP, and DEF FrJ become m~re useful as
the user gains experience and learns to use them as
shortcuts~
Standard mathematical and trigonolnetric functions are
convenient timesavers for programmers at any level.
They are treated as numeric expressions by BASIC.
-143-
.
10~66~
FOR...NEXT WIT~I ST~P
EXAMF'LES: 20 FOR 15 = 1 TO 20 STEP 2
40 FOR N2 = 0 TO -10 STEP -2
80 FOR P = 1 TO N STEP X5
90 FOR X = N TO W STEP (N~2-V)
.
GENERAL FORM:
statem~nt no. FOR simple var. = expression Tn exp~ession STEP expression
PURPOS E
Allows the user to specify the size of the
increment of the FOR variable.
COMMENTS
The step si~e need not be an integer. For instance,
100 FOR N = 1 TO 2 STEP .01
~s a valid statement which produces approximately 100
loop executions, incrementing N by .Ol each time.
A step s;ze of 1 is assumed if STEP is omitted from a
FOR statement.
A negative step size may be used, as shown in statement
40 above.
--1 44--
10~fi4~
GENERAL M~THEMATlCAl. FU~ICTIONS
EXAMPLES 642 PRI'lT EXP(N); ABS(N)
652 IF RND (0)~=.5 THEN 9
662 IF INT (R) # 5 THEN 91
~72 PRINT SQR (X); LOG (X)
GENERAL FORM: The general mathematical fur,ctions may be used as
expressions, or as parts of an expression.
~ PURPOSE
Facilitates the use of common mathematical functions by pre-defining thern as:
ABS (expression) the absolute value of the expression;
EXP ~expression) the constant e raised to the power of the expression
value (in statement 642 above, e~N)
( INT (expression) the largest integer < the e~pression;
LOG ~expression) the logarithm of the positively valued expression to the
base e;
RND (expression) a random number between 1 and 0; the expression is a
dummy arsumenti
SQR (expression) the square root of the positively valued expression.
,,
COMMENTS
: T~e RND function is restartablei the sequence of random numbers using RND
is identical each time a program is RUN.
-145-
,.~ . / _
... . ..
10a~6644
TRIGO~IC)MET :~IC t~lJNCTION~
EXAMPLES: 500 PRINT SIN(X) COS(Y)
510 PRI~T 3*SI~,(e); TAI~I (C2)
520 ~RINr AT~l (22.3)
53~ IF SI~i (A2) <1 THEN 80~
5~0 IF SIN (B3) = 1 ArlD SI~!X) <1 THE~ ~0
PURPQSE
-Facilitates the use of comnon trigcnometric functions by -
pre-defining them, as.
S~N (exp~ession) the sine of the express;on
COS ~xp~ession) the cosine of the expressicn
TAN (ex~ression) the tangent of the expression
ATN (exPression) the arctangent of the expression
COMMENtS
The function is of the value of the expression (the value in
parentheses, also called the argument).
The trigonometric functions may be used as expressions or parts
of an expression.
The angle o~ ~he trlgoIlometric functions can be specified
as radians, degrees, or grads by exccuting a RAD, DEG~ or
&RAD statementO The calculator assumes radians if no~
specified.
-146-
1046644
THE TAB AiYD SGN FUNC:T!ONS
EXAMPLES: 500 IF SGN (X) ~ 0 THEN 8~0
510 LET Y = SGrl(X) ~
52~ PRINT TAB (5); A2; tAB (2~)"1EXT"
530 PRINT TAB (N),X,Y,Z2
540 PRINT TAB (X+2) 'iHEADINIG''; R5
GENERAL FO~ The TA~ and SGN may be used as expressions,
or p~rts of an expression. The function
forms are:
T~5 ( expression indicating nurilber of spaces to be moved )
SGN ( expression )
PURPOSE
TAB (expression) ;S used only in a PRINT statement,
and causes the terminal typeface to move to the space
number specified by the expression (0 to 71). The
expression value after TAB is rounded to the nearest
integer. Expression values greater that 71 cause a
return linefeed to be generated.
SGN (expression) returns a 1 if the expression is
greater than 0, returns a 0 if the expression
equals 0, returns a -1 if the expression is less
than 0.
-147-
~0~664
SE:C~ION 1
M~ I ~ICES
This section explains matrix manipulation. It is intended
to sho~ the matrix capabilities of BASIC and assurnes that
the programnler has some knowledge of matrix theory.
TE~M: M~T~,X (A~RAY)
DEFINED IN BASIC AS: An ordered collection of numeric data
(nurnbers).
Matrix elements are referenced by subscripts following the
matrix variable, indicating the ro~ and column of the ele-
ment. For example, if matrix A is:
2 3
4 5 6
8 9
the element 5 is referenced by A(2,2); likewise, 8 is A(3,2).
I See Section XlI,"Vocabulary" for a more complete description
of matrices
( . ! ~
-148--
,; .. ~ _~
' . ~ . .
10~66
Dlr~
EXAMPLES: 110 DIM A (5~), B(2~,2~)
120 DIM Z (5,2~)
130 DIM S (5,25)
140 DI~ R (~
GENERAL FORM:
st~temeAt n~mber DIM matrix variahle ( inteae~ )
or
- statement number DIM m~trix variable ( in~eger , ~nteger )
PURPOSE
Reserves working space in memory for a matrix.
The maximum integer value (matrix bound) is 255.
.
COMMENTS
The integers refer to the number of matr;x elements if only one dimens;on
~s supplied, or to the number of rows and columns respec~ively, if two
dimens;ons are given.
A matrix (array) variable is any single letter from A to Z.
Arrays not mentioned in a DIM statement are assumed to h~ve lO elements
~f one-dimensional, or lO rows and columns if two-dimensional.
The working size of a matrix may be smaller than its physicdl size. For
example, an array declared 9 x 9 in a DIM statement may be used to store
fewer than gl elenlents; the DIM statement supplies only an upper bound
on the number of elen1ents.
The absolute makir,!u;n matrix size depends on the melnory size of the computer.
-149_ '
~046644
MAT...;Z~
EXAMPLES: 305 ~lAT A = ZER
310 ,~lAl Z - ZER (N)
315 MAT ~ - ZER (3~
32~ MAI R = ZER (N, P)
GENERAL ~ORM:
statcment number MAT matrix variable - ZER
. _ _ _ _ _ _
or
stat~nent numb~r MAT matrix variabl~ -- 7ER ( expr~ssion )
or
state~ent nu~ber ~4T matrix variable - ZE2 ~ expression , ex~r ssion )
PURPOSE
Sets all elements of the specified matrix
equal to 0; a new working size may be
established.
COMMENTS
The new working size in a MAT...ZER is an
implicit DIM statement, and may not exceed
the limit set by the ~IM statement on the
total number of elements in,an array.
Since 0 has a logical value of "false,"
MAT...ZER is useful in logical initialization.
-150-
I
~0~66
M ~T.. .C0 N
~,~.. , ,.,,~, . -~r~T~ ~ ~
EXAMPLES: 205 MAT C = CON
210 MAT A = CON (N,N)
220 MAT Z = CON (5,20)
230 MAT Y = CON (5~)
GENERAL FORM:
stateme~t ~umber MAT matrix variable _ CON
~ ~ or
statement number MAT matrix variable _ CON ( expression )
or
statem~nt numher MAT matrix variab~ = CON ( expressio~ , eYpr~sion )
_ _ _ _ . _ _ _
PURPOSE
Sets up a matrix with all elements equal to 1,
a new working size may be specified, wl~hin the
limits of the original DIM statement on the total
number of elements.
~ COMMENTS
The new working size (an implicit DIM statement)
may be omitted as in example statement 205.
Note that since 1 has a logical value of "true,"
the MAT...CON statement is useful for logical
initialization.
The expressions in new size specifications should
evaluate to integers. Non-integers are rounded
to the nearest integer value.
'
--151-
~0~669~
P~INTIl~G Sll~!GL~ MATRIX ELEr~'i'EN~S
... ... .~ .
EXAMPLES: 8~0 PRINT A(3)
81~ PRINT A(3,3);
820 PRI,~T F(X) jE; C5;R(N)
83~ PRINT G(X,Y)
840 PRINT Z(X,Y), Z(1,5), Z(X~), Z(Y~
GENERAL EORM:
statement number PRINT matrix variable ( expressi~n ) ...
_ _ _ _ _ _ _
or
statement number PRINT matrix varic~ble ( expression , expression ) ...
PURPDSE
.
Causes the spec;fied matrix element(s) to be printed.
COMMENTS
Expressions used as subscripts should evaluate to
integers. Non-intégers are rounded to the
nearest ;nteger value.
,
A trailing semicolon packs output into twelve
elements per teleprinter line, if possible (statement
810 above). A trailing comma or retu~n prints five
elements per line.
Expressions (or subscripts) following the matrix
variable designate the row and column of the matrix
element. Do not confuse these with new working
size specifications, such as those following a MAT ~~
IDN statement.
-152-
10'~6~i44
t
INPU-~rrlNG 5EI'~'~;LE ~.91~TRIA ELE~ NTS
EXAMPLES: 6~ INPUT A(5)
610 I~lPUT e(5,s)
620 INPUT R(X), N, A(3,3),S,T
630 INPUT Z(X,Y), P3, '~I
64~ INPUT Z(X,Y), ~(Xll, Y+l), ~Xt-R3, YTS2)
GENERAL FORM:
stat~rnent nurnber I-l-p-ul ma_ri.x_variahle ( ex~r~s~c~n
or
statement number INPUT ~ tri~ variab.le 1 e~pre~sslon, ~xp.r~ssion 1 ...
,
PURPOSE
Allows input of a specified matrix element
from the ~c~bo~rd,
COI~ ENTS
- The subscripts (in expressions) used after the matrix
variable designate the row and column of the matrix
~ element. Do not confuse these expressions with work-
tng size specifications, such as those following a
AT READ statement..
Expression used as subscripts should eva1uate to
integers. Non-integers are rounded to the
nearest integer value.
Inputting, printing, and reading indi\~idual array
elements are logically equivalent to simple vari-
ables and may be intermixed in INPUT, PRINT, and
READ StatelnentS.
--153--
MAT PRINT
<IMG>
PURPOSE
Causes an entire matrix to be
printed, row by row, with double
spacing between rows.
COMMENTS
Matrices may be printed in "packed"
rows up to 12 elements wide by using
the ";" separatos, as in example
statement 5~5.
10~6~Gi44
READING ~i~TRIX ELE~ 5TS
EXAMPLES: 9~0 READ A(6)
91~ REA~ A(9,g)
920 READ C(X); P; R7
93~ READ C(X,Y~
940 READ Z(X,Y), P(R2, S5), X(4)
GENERAL FOP~M~
statem~nt nun~er READ n1atrix variable ( expression
or
statem~!nt rlumber READ ma~:rix variable 1 expression, cxpre~,sion ) ...
PURPOSE
Causes the specified matrix element to be
read from the current DATA statement.
COMMENTS
~xpressions (used as subscr;pts) should
e~aluate to integers. Non-int~gers are
rounded to the nearest integer.
Expressions following the matrix variable
designate the row and cc1umn of the matrix
element. Do not confuse these with working
size specifications, such as those following
MAT READ statement.
The MAT READ statement is used .to read an
ent;re matrix from DATA statements. See
details in this section.
-155-
~0~66~4
1'~1RT RER9
. ~ EXAMPLES: 350 MAl READ A
370 MAT READ B(5',C,D
38~ MAT READ Z (5,8)
39a t~,AT READ l~ (P3,Q~)
GENERAL FORM:
statcment numl~er ,~AT READ matr.ix variable
~ or
statem~nt nu~r MAT READ matrix variable ( expression ) ...
or
statement num~er MAT READ matrix variab~e ( ~xpressio~ , e~pression ) ...
PURPOSE
Reads an entire matrix from DATA statements.
A new working size may be specified, within
the limits of the original DIM statement.
COMMENTS
MAT READ causes the entire matri~ to be filled
; from the current DATA staten1ent in the row,
, column order: 1,1; 1,2; 1,3; etc. In this
~ case, the DIM statement controls the number of
elements read.
-156-
10~ 6~91
MATR3~ h.D~lT5C~N
EXAMPLES: 310 MAT C = R + A
32~ MAT X = X + Y
330 MAT P = ~ + M
GENERAL FORM:
statement number MAT matrix variahle - matrix varia*le + matrix variable
PURPQSE
Establishes a matrix equal to the
sum of two matrices of identical
dimensions; addition is performed
element-by-element.
COMMENTS .
....
~ The resu~ting matrix must be previously
ment;oned in a DIM statement if it has
more than lO elements, or lO x lO ele-
ments if two-dimensional. Dimensions
must be the same as the operand matrices.
The san~ matrix may appear on both sides
of the = sign, as in example statement 32~.
-157-
104~6~
MQTR3X SllÇ3~RAC-l~lCN
EXAMPLES: 550 MAT C = h - B
560 MAl B = B - Z
570 MAT X - X.- A
GENERAL FORM:
stat~nent nwl~er MAT mat~ix var_kle - mat~ix va~ le - matri.Y varlable
PURPOSE
Establishes a matrix equal to the difference
of two matrices of identical dimensions; sub-
traction is perforlned element-t)~-ele,llent.
' CO~lMENTS
The resulting matrix must be previous1y
tnentioned in a DIM statement if it has more
t;lan lO elements, or IO x lO e1ements if
two-dimensiona1. Its dimension n'ust be the
same as the operand matrices.
The same matrix may appear on both sides of
the = siqn, as in examp1e statement 560.
-158-.
~04~644
A-r R I Y~ M ~J LTI PL~ CATI O N
EXAMPLES: 93~ ~lAT Z = B * C
940 MAT X = A *h
950 ~IAT C - Z * B
GENERAL FORM:
statement number MAT matrix variable ~ mat~ix variable * matrix va~iable
PURPOSE
Establishes a matrix equal to the product
of the two specified matrices.
COMMENTS
Follow;ng the rules of matrix multiplication,
if the dimensions of matrix B = ~P,N) and ma-
trix C - (N,Q), multiplying matrix B by matrix
C results in a matrix of dimensions ~P,Q).
Note that the product matrix must have an
appropriate working size.
The same matrix varlable may not appear on
both sides of the = sign.
--159 _ , , ,
10~6644
SC~ R 1~LTIPLIC/~ rlOI~I
EXAMPLES: 110 MA~ A = (5) * B
115 MAT C = ~1~) * C
12~ I~AT C (N/3) * X
130 M~T P = (Q7*N5) * R
GENERAL FORM:
stat~ment nurnb~r MAT matrix variable - ( ~xpression ) * matrix va~iable
PURPOSE
.- Establishes a matrix equal to the pro-
~ duct of a matrix multiplied by a speci-
fied expression (number); that is, each
element of the original matrix is multi-
plied by the number.
COMMENTS
The resulting matrix must be previously
mentioned in a DIM statement if it con-
tains more than 10 elements ( 10 x 10
if two-dimensional).
The same matrix variable may appear on
both sides of the = sign.
.
Both matrices must have the same working
size.
-160-
10~644
COPYING 1~ M~TRIX
EXAMPLES: 405 MAT B 'A A
41~ MAT X = Y
420 MAT Z = B
GENERAL FORM:
statement ~lumber MAT matrix variabl~ = matrix variable
PURPOSE
--
Copies a specified matrix into a
matrix of the same dirnensions;
copying is performed element-by-
element.
COMMENTS
The resulting matrix must be previously
mentioned in a DIM statement if it has
more than 10 elements, or 10 x 10 if two-
dimens;onal. It must have the same di-
mensions as the copied matrix.
. , ~ . ~ , .
..
.
., ~
.:
--161 -
10~bi644
NT~TY MAT~IX
EXAMPLES: 205 MAr A = IDN
210 MAT B - IDN (3,3)
215 I~T Z = IDN (Q5, Q5)
220 MAT S = IDN (6, 6)
GENERAL FORM:
s~atement numher MAT arrav variable - IDN
~r
stateme~lt number MAT _ r~y ~ariable - IDN ( x~res.sion , e~pression )
~ PURPOSE
Establishes an identity matrix (all 0's, with
a diagonal from left to right of all l's); a
new workin~ size may be specified.
(,
COMMENTS
The IDN matrix must be two-dimensional ana square.
Specifying a new working size has the effect of a
DIM statement.
Sample identity matrix: l 0 0
~ 1 0
0 0 1
-162-
~04~;644
RI~ T~A~YSPOSITION
EXAMPLES: 959 MAT Z - TR~ (A)
969 MhT X = TRN (B)
G79 MAT Z = TRN (C)
GENERAL FORM:
stat~ nt numb~r MAT mat:rix variahle ~ TRN ( matrix variable )
__ _ _ __
PURPOSE
Establishes a matrix as the transposition of . ~
a specified matrix (transposes rows and columns).
. COMMENTS
,
Sample transposition:
Original Transposed
l 2 3 l 4 7
4 5 6 2 S 8
7 8 9 3 6 9
Note that the dimensions of the resulting matr;x
must be the reverse of the original matrix. For
instance, if A has dimensions of 6,5 and MAT C =
TRN (A), C must have dimensions of 5,6.
Matrices cannot be transposed or inverted into
themselvesO
-163-
104~644
M/~T~5~ IN~'~RSIO~Y
EXAMPLES: 38~ MAT A = INV(B)
390 MAT C = INV (A)
400 M~T Z = INV (Z)
G ENERAL FORM:
statem~nt number MAT matrix varic~ble ~ INV ( mat:rix varia~le
PU RP OS E
Establishes a square matrix as the inverse of
the specified square matrix of the same dimensions.
COMMENTS
The inverse is the matrix by ~hich you multiply
the original matrix to obtain an identity matrix.
For example,
Original Inverse Indentity
/1 0 O~ /1 0 O~ ~1 0 O~
I " ol x 1-~ ~ ~J = (~ ~ ~~
\l 1 1/ \0-1 1/ \o o 1/
-
Number representation in BASIC is accurate to 6 7
decimal digits; matrix elements are rounded
accordingly.
-164-
10~644
S~'llO~
LOGIC~L O~ ATION5
LOGIGAL VALUES A~D NUMERIC VALUES
A distinction should be made between logical values and
the numeric values produced by logical evaluation, when
using the logical capability of BASIC.
......
The logical value of an expression is determined by defi-
- nitions established in the user's pro~ram. - -
The numeric values produced by logical evaluation are as-
signed by BASIC. The user may not assign these values.
~ogical value is the value of an expression or statement,
u5in9 the criteria.
( any nonzerc expression value = "true"
any expression value of zero = "false"
When an expression or statement is logically evaluated,
it is assigned one of two numeric values, either:
19 meaning the expression or statement is "true",
or
meaning the expression or statement is "false".
-165- -
10~;644
I~EL~TIO~ .L OPEF~ATO~S
,.
There are two ~lays to use the rel2tional operators in logical evalua-
tlons:
l. As a simple check on the numeric value of an expression.
EXAMPLES: l50 IF B=7 THEN 6~
2~0 IF A9~27.65 THEN 700
300 IF (Z/l0),~ THEN 80~
When a statement is evaluated, if the "IF" condition is currently
true~(for example, B - 7 in statement 150)l then control is trans-
ferred to the spec;fied statement; if it is not true, contro~ passes
to the next statement in the program.
Note that the numeric value produced by the logical evaluation is un-
important when the relational operators are used in this way. The
user is concerned only w;th the presence or absence of the conditon
indicated in the IF statement.
-166-
664
RELATIONQL OPEF~/~TOR~, col~l ri
2. As a check on the numeric value produced by logically
evaluating an expression, that is: "true" = 1, "false" = 0.
EXAMPLES 610 LET X=27
615 PRI~T X=27
620 PRINT X~27
630 PRINT X>=27
,
The example PRINT statements give the numeric values produced by logi-
cal evaluation. For instance, statement 615 is ir,terpreted by BASIC
as "Print 1 if X equals 27, 0 if X does not equal 27." There are only
two logical alternatives; 1 is used to represent "true," and 0 "false."
.
'- The numeric value of the logical evaluation is dependent on, but dis-
tinct from, the value of- the expression. In the example above, X equals
27S but the numeric value of the logical expression X=27 is 1 since
it describes a "true" condition.
,.
167- .
._
There are two ways to use the Boolean Operators.
1. As logical checks on the value of an expression or expressions.
EXAMPLES: 510 IF A1 OR B THEN 670
520 IF B3 AND C9 THEN 680
530 IF NOT C9 THEN 690
54~ IF X THE~ 7~p
~ , . . ..
Statement 510 is interpreted: "If either Al is true (has a non-zero value) or
B is true (has a non-zero value), then transfer control to statement 67~
Similarly, statenlent 540 is interpreted: "If X is true (has a non-zero value),then transfer control to statement 700."
The Boolean operators evaluate expressions for the;r logical values only: these
arc "true" = any non-zero value, "false" - zero. For example, if B3 ~ 9 and C9
= -~, statement 52~ would evalua~e to "true," since both B3 and C9 have a non-
zero value.
2. As a check on the numeric value produced by logically evaluating an expres-
sion, that is: "true" - 1, "false" = 0.
EXAMPLES: 4g~ LET B ~ C - 7
5~ PRINT B AND C
510 PRINT C OR B
520 PR~NT NOT B
Staten~ents 500 - 52~ return a numeric value of either 1, indicating that the
statement has a logical value of "true", or 0, indicating a logical value of
"false".
~ote that the cr;teria for determining the log;cal values are:
true = any non-zero expression value
false = an expression value of 0. ~
The numeric value 1 or 0 is assigned accordingly. . ~'
-168-
lO ~ ;4~
SEC~ION Vl
SYF~TA)~ ~EQUI~ NTS I~F B~SIC
.. r
LEGEND
::= "is defined as..."
¦ "or"
< > enclose an element of BAS~C
LANGUAGE RULES
lo The <com statement>, if any exists, must be the first statement
presented and have the lowest sequence number; the last state-
ment must be an ~END statement~.
(
2. A sequence number may not exceed 9999 and must be non-zero.
3. Exponent integers may not have more than tl~o digits.
4. A formal bound may not exceed 255 and must be non-zero.
5. A subroutine number must lie between l and 63, inclusive.
.
6. Strings may not contain the quote character (").
7. A <bound part> for an IDN must be doubly subscripted.
8, An array may not be inverted or transposed into itself.
An array may not be replaced by itself multiplied by another array.
(
-169-
10~;44
SYNTAX R ~Q U I R E r~s ~ N TS
(l)
<basic progra~ <program statement>¦<basic program><program statement> ~,
<program staten~nt~ ::= <sequence number><basic statement>carriage return
<sequence number> ::= <integer>
<basic statement> ::= <let statement>¦<dim statement>¦<com statement>
" ' <def statement~l<rem statement>l<go to statemen~>
'' <if statement>l<for statement>l<next statement>
<gosub statement>¦<return statement>l<end statement>¦
<stop statement> <wait statement> <call statement>l
~data statement> <read statenlent~ <restore statement>¦
<input statement: ~I<print statemen,>l<mat statement>
~let statement> ~ let head><formula>
~let head> .:= LET<variable>=¦<let head><variable>=
<formula> ~:= <conjunction~¦<formula>OR<conjunction~
cconiunction> .:- <boolean primary>¦<conjunction>AND<boolean primary>
~boolean primary> ~ arithmetic expression>¦~boolean primary>
~relational operat~r><arithmetic expression>
! <arithmetic expression> := <term>¦<arithmetic expression> + <term>¦
arithmetic expression> - <term>
<termP o:- ~factor>l<term~*<factor>l<term>/<factor>
<factor> ~ ~primary>¦<sign><primary>¦NOT<primary>
<prim~ry~ operand~¦<primary>~<operand>
<relational operator> ~ <=1-1#1~>
coperand> ~:- <variable>¦<unsigned number>¦<system function>¦
~function>l<formula operand>
<variahle> o:- <simple variable>¦<subscripted variable>
<sim~le variable~ ::= <letter>¦<letter><digit>
<subscripted variable> ::= <array identifier><subscript head><subscript>
<right bracket>
. . <array identifier> ::= ~letter>
~ <subscript head> ~:- <left bracket>¦<left bracket><subscript>
~subscript> .:= ~formula>
<letter> ' :- A¦B¦C¦D¦~¦F¦G¦H¦I¦J¦K¦L¦M¦N¦O¦P¦Q¦R¦S¦T¦U¦V¦~¦X¦Y¦Z~digit> o.= 0¦112¦3¦4¦516¦718¦9
<left bracket> ~:= (I[
~right bracket~ 1]
<sign>
<ulsigned number, ~ = <decimal part>¦<decimal part><exponent>
, J
-170-
~0'~66~4
~ . .
SYNT~.X REQUIF'EMENTS, CONTlNUE~;n
.: ..... .
' ,... - f ,.
.-. - .-- cdecimal part> ::= <integer>l<integc~>.~integer>l.<integ~r~ -
~- : <integer~ ::= <digit>¦~integer><digit~
<exponent< ::= E~integer>¦E<sign><integer,~3) ;~
<system function> ::= <system function name~par2meterpart~
cSyStem function name> ::= SIN¦COS¦TAN¦ATN¦EXP¦LOGIABSlSQRlINTlRNDlSGN
<parameter part~ s <left bracket><actual parameter>~right bracket~
<actual parameter> ::= <formula~
~function~ ::= FN<letter~<parameter part>
formula operand> ::= cleft bracket><formula><right bracket>
<dim statement~ ::= DIM~formal arra~ list>
<formal array list> ::= <formal array>l~formal array list~,<formal array>
cformal array> ::= <array identifier><formal bound head~<formal bound~
<right bracket>
cformal bound head> ::= <left bracket>¦<left bracket><formal bound>,
<formal bound> ::= <integer> ~4)
<com statement> ::= COM~formal array list~
.- <def statement> ::= DEF FNcletter><left brac~et><formal paranleter>
<right bracket>=cformula>
cformal Darameter> ' :-= <sim.nle Y2ri.2ble?
crem stateMent> ::= REM<character string>
<character string> ::= any teletype character except carriage return, alt mode,
escape, rubout, or line feed, or null, control B,
control C, left arro~
<goto statement> ::= GO TO<sequence number>
cjf statement> ::= IF<formula>THEN<sequence number>
<for statement> ::= ~for head>¦<for head>STEP<step size>
~ <for head> ::= FOR<for variable>=<initial value>TO<limit value>
<for variable> ::= <simple variable>
<initial value> ::= <formula>
<limit value> ::= <formula>
<step size> ::= <formula>
<next statement> ::= NEXT<for variable>
C9osub statement ::= GOSU8<sequence number>
<return statement> ::= RETURN
<end statement> ::= END
( <stop statemcnt~ ::= STOP
-171-
~0~6~
SYNTAX F~EQU I R~M ENTS, CONTINUED
~ait statement~ ::= WAIT<parameter part~
<call statement~ ::= CALL<call head~<right bracket>
~call head~ ::= <left bracket><subroutine number~l<call head>,
<actual parameter>
~subroutine number> ::= <integer>(5)
<data statement~ ::= DATA<constant>¦<data statement~,<constant~
<constant~ ::-. <unsigned number~¦<sign>~unsigned number>
<read statement> ::= READ<variable list~
<variable list> :::= <variable>¦~variable list>, <variable>
<restore statement> ::= RESTORE
<input statement> ::= INPUT<variable list~ -
<print statement> ::= <print head>¦<print head><print formula>
<print head~ ::= PRINT¦<print head><print part>
<print part> ::= <string>¦<string~<delinliter>¦<print formula>
<delimiter>l<print formula><string>
<print formula~<string><delimiter>
<string~ ::= "<character string>"(6)
<delimiter> ::= ,1,
<print formula~ ::= <formula>¦TAB<parameter part>
<mat statement~ ::= MAT<mat body>
<mat body> ::= <mat read>¦<mat print>¦<mat replacement>
<mat read> ::= READ<actual array>¦<mat read>, <actual array~
<actual array> ::= <array identifier~¦<array identifier><bound part>
<bound part~ ::= <actual bound head><actual bound><right bracket~
<actual bound head> ::= <left bracket~¦<left bracket><actual bound~,
cactual bound~ ::= <forn,ula~
<mat print> ::= PRINT<mat print part>¦PRINT<mat print part><delimiter~
mat print part~ ::= <array identifier~¦<mat print part><delimiter~
<array identifier>
~mat replacement> ::= <array identifier>=<mat formula~
~mat formula> ::= <array identifier>¦<mat function>¦<array identifier>
<mat operator><array identifier>l<formula operand~*
<erray identifier~
I
~.. . . . ..
-1 7 2 -
104664 !/~
SY~ i A~ F; E~2UI ~l~M ~N~ , CON ~INUED
<mat funct;on~ ::= <mat initialization> <mat initialization>cbound part~¦
INV<array parameter> TRN<array parameter>
<mat initialization> = ZERlcoNlIDN(7)
<array parameter~ ::= <left bracket~array identifier><right bracket>(8)
<mat operator> . = +I-I*
, . .
-173-
, . _
~046644
STRINGS PLUG-IN READ-ONLY MEMORY MODULE
The strings plug-in read-only memory module makes
available t~ the user all of the string variables functions
and operations associates with standard BASIC programming
language. Two additional functions not usually provided
in most versions of BASIC language have been implemented.
These include a POS function for determing the position of
a substring within a string and a VAL function for deter-
mining the position of a substring within a string and a
VAL function for determining the numeric value of a string.
A discussion of these and other string functions and op-
erations follows.
String
"- ~ A set of 1 to 255 characters or the null string (no
-- characters).
e.g. "ABCDEF"
"12345"
.. ..
String Variable
A variable used to store strings; consists of a single
letter (A to Z) followed by a $.
e.g. A$; B$; Z$
Substring Variable
A single character or a set of contiguous characters
from within a string variable. The substring is defined by a
subccripted string variable. A single subscript specifies the
first character of the substring and implies that all characters
following are part of the substring. Two subscripts specify the
first and last characters of the substring.
e.g. A$ = "ABCDEF"
A$(4) = DEF
A$(1,3) = ABC
DIM Statement
General Form:
stmt # DIM string var ( #chars in string )
Purpose:
Reserves storage space for strings longer than 1 character.
-174-
~046644
Comments:
The number of characters specified for a string in its
DIM statement must be expressed as an integer form 1 to 255.
Strings not mentioned in a ~IM statement are assumed to have
length 1. The length mentioned in the DI~ statement specifies
the maximum number of characters which may be assigned and is
known as the physical length. The actual length is the actual
number of characters which has been assigned.
e.g. DIM A$(1~), B(5,5), B$(25S)
Source String Semantic Description
A source string is an entity from which a string value
is extracted. If no substring designator is specified for a
string variable, the value of the source string is the entire
logical string curretnly assigned to it. Substring designator
expressions must be at least 1 in value and the second may be no
smaller than one less than the first. If one subscript is given,
the value is the entire logical string beginning at the character
specified by the subscript. The subscript may be no larger than
the actual length of the string plus 1. I~ two substring expressions
are given, the source string value is the substring whose first and
last characters are designated. If the specified substring extends
beyond the logical length o~ the string, spaces are used to fill out
the substring.
Assignment Statement
General Form:
line # [LET] destination string = source string
Destination String:
A destlnation string is an entire string variable or
part of a string variable into which a source string is to be
copied. ~he definition of the action depends on the number
of substring subscripts specified in the destination string.
If no subscript qualifier is specified, the entire
de~tination variable is replaced by the source string. The
physlcal length of the destination string must be large enough
to accommodate the entire source string.
If one substring subscript is specified, the entire
value of the destination variable, beginning at the designated
charact-r, i8 replàced by the source string. That part of the
sCriPt Value must be nO mor Suhscript value is Unchan d
actual length of the destination variable.
u b s r l p t m u s t b e n o m o r e t h n o n ~ g r e t e r t h a n t h e 1 o g i c a l
-1 75-
.~
1046644
must be no greater than the physical length of the destinationvariable. The specified section of the destination string is
replaced by the source string. If the source string is longer
than the destination, it is truncated on the right. If the
source string is shorter, as many trailing blanks are appended
as necessary. The new actual length of the destination string
is the larger of the old actual length and the second subscript.
String Input Statement
General Form:
stmt # INPUT string or substring variable
Purpose:
Allows string values to be entered from the keyboard.
Comments:
Numeric variables may be used in the same input statement
as string variables. Placing a single string variable in an input t' ~;
statement allows the string value to be entered without en~
closing it in quotation marks. If multiple string variables are ;--
used each string value must be enclosed in quotation marks, and
the values separated by commas. ~ ~-
' . -'; '~
e.g. 10 INPUT A$, B$, C, A1, A$(1,5) ;~
String Print Statement
General Form: - ~-
stmt # PRINT string or substring variable, --
Purpose:
Causes the current value of the specified string orsubstri~g variable to be output on the standard output device.
Comments:
Strings and numeric values may be mixed in a print statement.
8telng var1ables are specified identically to numeric variables,
They are prlnted under the same format rules as quote fields
string and substring variables are printed as source strings
A maxlmum of 72 characters can be printed using the
pti7n2t statement, i.e., all strings ~72 characters are truncated
~ '
-176-
lO~j6~ ~
String Read Statemell-t
General Form
stmt # READ strillg or substring variable
Purpose:
Causes the value of a specified striIlg cr substring
variable to be read from a data statement.
Comments:
Mixed string and numeric values may be read~ If the
wrong data type is given in the data sta~ement an error is given.
e.g. lO READ A, B$(1,1~), C$, B
String If Statement
General Form:
stmt X IF str.~ar. rel.oper string THEN stmt #
Purpose:
Compares two strings. If the specified condition is
true, control is transferred to the specified statement.
Comments:
Strings are compared one character at a time, from le4t
to rlght; the first di~ference determines the relation. If one
string ends before a difference is found, the shortest string is
considered the smaller one.
Characters are compared by their ASCII representations.
The relational operators allowed are~ , <, >, <=,
>-, O
e.g. 10 IF A$ - ~SA~ THFN 20
Strin~ Data Statement
General Form:
stmt ~ DA~A ~'strilg t~xt", "string text", --
-177-
,.
i ~()46644
Purpose:
Specifies data in a program (string or/and numeric)
Comments:
String values must be enclosed by quotation marks and
separated by commas.
Steing and numeric values may be mixed in a single
data statement.
e.g. 10 DATA "ABC", 1.2, "DEF"
String Write Statement ~~~
General Form:
stmt # WRITE ( device # , format stat #
string or substring variable
Purpose:
Similar to the print statement but allows the specifi-
cation of the output device and format statement. No field
specifications are made for string variables in the format
statement. They are treated identically to string constants
(quote .fields).
String Display Statement
General Form:
stmt # DISP string or substring variable
Purpose:
Identical to print statement except output device is
32 character display.
LEN Function
General Form:
LEN stringor LEN (string)
Purpose:
Obtain the length of a string for use in an arithmetic
'
-178- - ~
.:
10 ~6644
Comment:
The actual letlgtil is found ~tliC~l is not necessari]y
the same as the physical length reserved in the DI~I statcment.
e.g, LE~ (r~ABCD") = 4
POS Function
General Form:
POS string , string or POS ( strin~ ~ string )
Purpose:
Determine the position of a substring ~Yithin a string,
Comments:
If the second string argument is a part of the first,
the value of the function is the position in thc- first string
at which the second string starts. If the second string in
the argument is not a part of the first, the value of the func-
tion is zero.
e.g. POS (~ABCD~' , "C") = 3
VAL Function
General Form:
VAL string or VAL ( string )
Purpose:
Determine the numeric value of a string~
~~ Comments:
The VAL functi.on converts a strin~ of di~its into a
number, The string is converted into a number by the same
rules used in a numeric input statement,
e,g. VAL ("123") = 123
_1 79 _ .
::
., . ~.. . t
lV46644
ERROR ~ESSAGES FOR STRING OPTION BLOCR
70 - string IF error
71 - string function syntax error
72 - negative string length
73 - non-contiguous string
~74 - string overflow
75 - data is of wrong type
76 - VAL function argument not numeric
-180-
1V46644
BNF SYNTAX DESCRIPTION
<literal string~ ::="<character strinq>"
~character string~ ::=<character~¦~character string>
~character~
~character> ::= any ASCII character except NULL,
LINE FEED, RETURN
<letter> ::= A¦B¦ ~-- X¦Y¦Z
~sublist) =<expression>¦<expression~,<expression>
<string variable> ::=~simple string variable>~
Csimple string variable>(<sublist>)
<simple string variable> ::=<letter~$
~relational operator~ ::=C~ #~
~assignment statement> ::=LET~destination string~=<source strin~
T ~destination string~=~source string>
<destingation string> ::=~string variable>
~source string~ string variable>~literal string~
CIF statement~ IF~destination string>~relational
operator~ ~source string>THEN~line
number>
~data statement> ::=DATA<constant>l~data statement~,
<constant>
~conqtant> ::=~numeric constant>¦<literal string>
~read statement~ ::=REA~<variable list>
~variable list> ::<read variable>l~variable list~,
~read variable~
~read variable> ::=~numeric variable> ¦~string variable>
<input statement> ::=INPUT~variable list~
<print statement> ~ print ~>¦ ~print 2>
<print 1~ ::=printl<print 2>,j<print 2>;~<print 3>
-181-
:
~6644
~print 2~ print 1><~rint expression~¦
Cprint 3
~rint 3> ::=(type statement><literal string~
<print expression> =~expression>¦<source string>
WRITE and DISP statements have
the same syntax as the PRINT
statement.
~LEN function> ::=LEN~source string>¦LEN(~source string>)
<VAL function> ::=VAL~source strin~jVAL(~source string>)
<POS function~ ::=POS<source string~,<soUrce string>l
POS(~source string~,~sc,urce string>)
'~ '.
r -,
-182-
- -
10~66~
EXTENDED INPUT/OUTPUT PLUG-IN READ-ONLY MEMORY MODULE
The extended I/O read-only memory module (hereinafter
referred to as the extended I/O ROM) provides additional
functions and statements so that the calculator can be made
compatible with a wide variety of peripheral devices. Added
functlons include decimal-to-binary and octal-to-decimal
conversion, status code inquiry for peripheral ~evices,
control of spacing and line feeds in output records, and
- others Use of these functions requires no special
programming techniques; once the ROM is plugged in, its
functions and statements become a part of the calculator,
in the same way as, for example, the square root function
is part of the calculator.
Some read-only memory units decrease the amount of
programmable memory available to the user by automatically
requiring a portion of that memory for their own internal
usage, but the extended I/O ROM has no such requirement and
does not affect memory availability.
The following table describes the extended I/O ROM
functions and statements Parameters shown underlined in
the table are explained immediately following the table.
Parameters shown in brackets may or may not be included as
parts of a statement.
\
-183-
10~i6~
- - .
.
~~ FUh'CTION ~E~IONIC DESCRIPTION OF FUNCTION SYNTAX
BIN Converts declmal expression to its binary BIN exp
. equlvalent. For use ln output-to-blnary
stora~e device; also provides increased
control of print format.
OCT Converts octal expression to decimal OCT exp
equivalent. For use in construction of
I code conversion tables; see "Conversion
Tables".
~TAT Returns code of operational status (on, STAT select code
off, wait, etc.) for the device specified
by the select code.
CHAR Returns one byte of data from the device CHAR select code
specified by the select code regardless
oi the data structure.
L'~' Advance~ printer or tyPewriter the number LIN exp
of lllles represented by the expression.
SPA Advances printer or typewriter carriage SPA ex~
the number of spaces represcnted by the
expresslon.
ROT Converts expression 1 to binary equiva- ROT(exp l,exp 2)
; lent; performs rotation right the number
of positions represented by expresslon
2; returns decimal equivalent. For use '
ln special input or output code trans-
--- latlon,
INOR Comblnes binary equivalents of expres- INOR(exp l,exp 2)
sion 1 and expression 2 in an "inclusive
or" lo~lc operation. Returns decimal
equivalent. For use ln special input
or output code translation.
-184_
10~;644
-
_ .L 1 . ' '
.
- ~ FUNCTION b~EUONIC DESCRIPTION OF FUNCTION SYNTAX
: : BIAND . Combines binary equivalents of expression BIAND(exp 1, exp 2)
1 and expression 2 in an "and" logic
operation Returns decimnl equivalent
For use in special input or output trans-
lation.
STATEb~NT SYNTAX ¦ DESCRIPTION OF STATE.~NT
ENTER (select code or string name, format~,conversion table~)
list r. FOR function¦ ~
--L J
Inputs data from named device or string with optional -~
conversion to ASCII code; includes capability for iteration.
OUTPUT (select code or string name, format [, conversion table~ ) list
Outputs data to named device or string with optional
conversion to ASCII code,
-185-
-
10 ~;44
:: PARA~TER EXPLANATION
exp Expression
- selcct code A numcric code, from 1 to 15, uniquely representing
the input or output device, as follows:
select code 1-9 User assignable.
select code 10 Cassette Memory.
- - select code 11-13 reserved.
select code 14 Plotter.
select code 15 Typewriter or Printer,
string name A single letter followed by a "$". Valid only when
String RO~I is also plugged ln. -~
format To reference a FORh~T statement, the line number of that
.. ~..
statement is shown; for free-form data, an asterisk ($~
is shown.
conversion table The variable or array name given to a conversion tahle
See heading "Conversion Tables".
list A list of variables, literals, expressions or numerics
separated by commas
FOR functions To input multiple data items from one record into
an array, Syntax as follows:
(FOR var 1 exp TO exp, [(FOR var 2- exp TO exp,] name(var l[,var 2~ )[)] )
-186-
10~
CONVERSION TABLES
Using a pre-established conversion table, a string of
characters or an array of data can be converted from one code
to another. The calculator makes use of standard ASCII~ codes.
Let us refer to all non-ASCII representation codes used by
printers, card readers, paper tape readers, punches, type-
writers, etc. as "foreign codes."
A conversion table is defined in the BASIC language
program DIM statement. Only single-dimensioned integer arrays
are considered valid for use as conversion tables. In the
following DIM statements, A and B are valid array structures
for conversion tables, but C, D, and E are not.
DIM AI (150), CI(20, 30)
DIM BI ( 80), D(200), E(15, 15)
In order to insert conversion table information in
the array, the foreign code must first be ~own Suppose your
paper tape reader uses EIA** coded tape. The chart following
shows symbols and the equivalent tape punches for EIA code, with
the octal code equivalent for each symbol.
* Amerlcan Standard Code for Information Interchange.
** Electronic Industries Association Standard Code.
-187-
~0~66~4 - 188-
STANDARD TAPE
cHANriEL AIUMBERS E I A
SY14BOL OCTAL CODE
a 7 6 5 4 '~ 3 2 1
(2ERO) 0 ) 040
~ 1 ~ 001
~ 2 - @ 002
3 - i 023
~ ~ 4--S 004
~ ~ ~ S - / 025
6 - ~ 026
~ 7 - 6 007
~ ~ 8 - ~ 010
~ ~ . ~ 9 - ( 031
a --A 141
- ~ ~ ~ ~ b --13 142
~ c - C 163
~ , d - D 144
~ ~ ~ ~ ~ ~ e - E 165
f --F 166
O ~ <~ --G 147
~ ~ ~ ~ h --H 150
~ - - - - ~ i --I 171
~ ~ ' ~ i --J 121
~ ~ . ~ Ic --it 122
~ ~ ~ O1 - 1, 103
S ~ ~ ~ m --M 124
~ ~ - ~n --N 105
~ ~ o o ~ - O 106
p--P 127
~ ~ Q ~ ~ - Q 130
r - R 111
5 _ 5 062
~ . ~ ~t - T 043
~ - ~ - U--U 0~4
~ ~ ~ ov - V 045
W 046
x _ X 06/
~ ~ ~ ' Y --Y 070
2 051
. ~ , SPAC~ 020
- ~ 100
~ -. ~/ _ ? 061
~ ~ ~ ~STOP 013
~~ ~ . ~ ~ 133
~ ~ ~ . ~ ~' - ' 073
~ _ ~ 153
~ ~ - ~ P(iNCII ON 114
~ ~c ~ . ~ UPPER CASE 174
160
~~. ~ . ~ -- TAB 076
~ ~ ~ ~ COh-~ROL 016
~ ~ . ~ ~ ~PUNCII OPP 067
~ ~ ~ ~ ~ DATA SELECTOR(AUX.3) 037
OI~I PEED (AUX. ~ 117
~ ~ . ~ BACK SPACE 062
~ ~? ~ . - ~
~ -- ~
~ ~ ~ ~ ~ ~ ADDRESS IDEN.(AUX~! 135
~ ~ ~ ~ . ~ LOWER CAS~ 172
~ -- ~ ~ ~ .
O ~ . ~ -
~ ~ O ~ ~ ~ ~ ~ I~APE PE~D 177
. CAR. RE~. 200
. . I
o
~D
v 11 ~ ~ ~ W ~I O~ ~ n oT
~ f)
- -
co. 1-'
I; - . ~n O
cr~,
0 z 3 r 7c ~ T C) ~rl m O ('I W p
~ ~; ! u
_ _ _ _ _ _ _ _ _ _ _ _ n ~
lO~
The following charl; shows the information to be pro-
grammed into the conversion table.
sp O~0 ~ ) oLJ(~ r~
oL~ (3 /Y 7 . !.(~2~. . .. :
~ 3 C /~3 /a3 . .
g Oy~l 3 t jty
~~ / 0~ , _ _ _ _
7 _ _ _ f 0 7
_. . _ .. . . . . ., .. . . . . .. .. .. / _ . . . _ . .. . .... _. _ . .
... .7 . . . ~ ~ 2 / ~ 2 _ ~
. . . _ . .~.. ~ Z . i~ /22 //3_ _ _
L / ~ 3
_ .. . . . . ... _ . . . ... _ _ . _ _ .
',G7~,, ' 0~ 2y ~ r ' ~ ~
-~ C0 ' C~ ~J ~~ OS' ~6
3 ~ ,Z ' ~ (~) '' /QC~ 7
,, 6~ .--------~J-~7---- /27 / 20,
. . , ~ Q / 3~ ~ 2~ ~ i
L~o ~ i 2 2
------ --- ' I . ~~~6'-4!' ~ S 62 1 i23
., . ,., Z ,,o,o~0'6,~ T' ,~3
__3 o 23,___. ~OZ3 _ (J _ 6~ '2
r- . 4 oa~ .
. . . 5~ ~ 2 5--~ O ~ 2
.... 6 . ~ o .. ~~~~. X 67 ~ 30 __
7 0 7_ o 6 ~ . . 7~ . _ _ . . . . _ . . _
a 7~ Z ~7 J 32~ _
~ ~ f0 7,/
.. . . . _ . . . . . , . .. , .. .. . ., . .. _ . ~ ~
. . .. . ~ _ . . . .. .. . .: . . . . .. . . . . ., . . . ~ . . . .. _ _ , _ . . . _ _
.. . ... __~ _ . ~ _-- \. ).~3
.. . . . . _ .. _ _ . _ . .... . . . _ _ . . _
~ 73 ~ /3~
.C a?Y; ~3~-
~ . ~ 7 ~
i~ ~7.7G . . . ....... . . .. ....
i? ~7,~
C~R~ _ 20~ d/2
~ . . .... ....
--19 O-
10'16644
The conversion table portion of a BASIC program is
shown on the chart below. Each statement defines one element
in the conversion Table A with the use of the OCT function: the
octal notation does not need to be translated to decimal. If
decimal notation was supplied in the symbol tables, the OCT
function could have been omitted; however, it is common to
obtain symbol tables in the octal form rather than in decimal form.
10 DIM AI~128]
2~ A OCT20]=OCT40
30 A-OCT73]=OCT54
40 A OCT1~0]=OCT55
50 A-OCT153]=OCT56
6~ A OCT61]=OCT57
7~ A OCT40]=OCT6
8~ A OCTl]=OCT61
9~ A OCT2]=62
1~ A OCT23]=OCT63
110 A-OCT4]=OCT 64
120 A OCT25]=OCT65
130 A OCT26]=OCT66
140 A OCT7]=OCT67
15~ A-OCTl~ =OCT7
160 A OCT31 =OCT71
170 A OCT201 =CCT12
180 A OCT141 =OCT101
19~ A-OCT142 =OCT102
200 A OCT163 =OCT103
21~ A OCT144-=OCT104
~ 220 A OCT165 =OCT105
23~ A:OCT166-=OCT106
24~ A OCT147 =OCT107
25~ A OCT15~-=OCTll~
260 A~OCT171 =OCTlll
270 A OCT121 =OCT112
28~ A-OCT122 =OCT113
290 A OCT103 =OCT114
3~0 A rOCTl 24 =OCT115
31~ A~OCT105~=OCT116
32~ A OCT106 =OCT117
33~ ArOCT127 =OCT120
34~ A OCT13~ =OCT121
35~ A OCTlll =OCT122
36~ A OCT62-=OCT123
37~ A OCT43 =OCT124
38~ A OCT64 =OCT125
390 A OCT45 =OCT126
4~0 A OCT46-=OCT127
410 A OCT67-=OCT130
42~ A OCT76-=OCT131
430 A OCT51 =OCT132
1 91
10~6644
ENTER
When a CHAR rcquest is keyed into the calculator for
the paper tape reader, conversion is not done and the calculator
will display t,le decimal equivalent of the EIA octal code for
the symbol taken from the paper tape. In order to have automatic
code conversion, the program must contain an ENTER statement.
410 ENTER (9r 420, A) B
B will be read and its ASCII equivalent found in the conversion
table A. If data contained in a string is to be converted to
ASCII code, the string name is used instead of the select code,
and in this way conversion can be done internally as well as
at time of input or output.
OUTPUT
For output of data in a foreign code, automatic code
conversion is invoked by use of the OUTPUT statement.
500 OUTPUT (8, 510, A) B
The ASCII B will be found in the conversion table A and changed
to the foreign code equivalent before output. Notice that the
same conversion table A is used for input and output. The ENTER
~0 ~tatemont caus~s the calculator to look for ASCII code, (on the
right of the equals (=) signs in the table), and assume that it
is receiving foreign code; whereas the OUTPUT statement causes
the calculator to assume it has ASCII code, and to look for the
foreign code (on the left of the equals (=) signs in the table)
above.
ERROR CODES
Program diagnostic or error conditions found in the
Extended I/O ROM:
NVMBER EXPLANATION
30ERROR 83 End of data reached or data contains more than
ten (10) blanks in a row.
ERROR 84 Invalid format specification: format must be
free format (*), E format or F format.
~ - 192 -
-- 104~i~44-
ERROR 85 Num~ric input syntax error: multiple decimal
poiLts, more than one E in E format, etc..
ERROR 86 Conversion table.not found. Check for integer
initialization in DIM statement.
- Iq~
10~ 44
TERMINAL PLUG-IN READ-ONLY MEMORY MODULE
The terminal plug-in read-only memory module that is
available with the calculator allows the user to enter, store,
and edit free-text. It also allows the user to communicate,
either directly or through an external modem, with another
calculator, a computer or a time-sharing computer system
The calculator may transmit or receive BASIC language programs
or free-text
To put the calculator into terminal mode, the user
types in TERM and actuates the EXECUTE key If he wants to
use the calculator for data transmission, he can specify one
or two optional parameters following the TERM mnemonic The
first parameter is the select code of the modem interface
module. If another select code is not specified the calculator
assumes select code four The second parameter is the baud
rate of the transmitted dataO If not specified, the calculator
will assume 110 baud which is the same rate as a standard
ASR232 teletypewriter. For example, to transmit or receive on
select code six at 300 baud, the user enters TERM,6,300
followed by actuation of the EXECUTE key The selectable baud
rate is continuous in integer increments from 3 to 300. The
conversion of characters from parallel to serial format is
done automatically within the calculator firmware, so the
modem interface circuitry is simplified and no switches are
required to change baud rate~
While the calculator is operating in the terminal
mode, lines of text may be entered from tlle keyboard and
terminated with the END-OF-LINE key These lines must be
preceded by a line number, but there is no syntax requirement
for the remainder of the line. All of the line-by-line and
-193-
iO ~i644
character-by-character editing features o~ the calculator
are available in this mode. These include listing, backspace,
forward space, insert character, delete character, and
display shift control. Automatic line numbering is also
available. In addition, the tape cassette commands, the
PTAPE command, the PRINT ALL command, and the LIST command
operate normally. The LIST command syntax has been ex-
panded to include LISTX, which means list without line numbers,
as well as LIST#SC or LISTX#SC where SC is the select code of
the modem interfa~e, which means transmit the information
through the modem to the remote system
WLen the calculator is operating in the terminal mode,
five of the user-definable keys take on special meaning
Key f5 becomes a teletype shift key and f6 becomes a teletype
control ~ey These keys and the lower case shift key allow
the user to generate any seven-bit ASCII code. To generate a
teletype shift or control character, the user first actuates
the f5 or f6 keys and then actuates the appropriate key on
the alpha section of the keyboard. For example, to generate
a ~control C", the f6 key and the C key are actuated sequen-
tially. No character is entered into the display until after
~ c~
the chosen alpha key is ~ht The character entered into the
display may or may not be the same as the alpha character
For instance a ~'shift O" generates the symbol ~
Key f8 is used in the terminal mode to select even or
odd parity for transmitted characters When the terminal mode
is first entered, even parity is assumed. The user may then
convert to odd parity by actuating key f8. The display will
then indicate ODD. To revert back to even parity the user
actuates key f8 again, and the display indicates EVEN.
-194-
44
.
Key f9 is used in the terminal mode as a transmit key.
To transmit a message through the modem inter~ace, the
message is typed into the display from the keyboard, and then
~ c~
the line is terminated by hittin~ key f9 The calculator
g then serializes the characters entered, and transmits them at
the selected baud rate For example, to obtain a listing of
a program from a remote time-sharing computer service, the
user enters LIST f9. The transmit key may also be used to
enter the responses in a sign-on procedure for a time-sharing
service.
Key f7 is used to place the calculator into a mode
for saving, in memory, an incoming program. For example, to
receive and store a program from a time-sharing computer
service, the user actuates key f7 followed by LIST f9. As
the program is listed from the time-sharing service, the lines
are stored in the calculator's user memory as free-text. If
the f7 key is not actuated just prior to entering LIST f9,
the program will be printed on the external line printer.
Once a program has been entered as free-text, either
from a remote source or from the keyboard, and if it is a
BASIC program, it may be checked for syntax errors and con-
verted to BASIC program format in memory. This is done by
typlng COMP ~ollowed by actuation of the EXECUTE keyO Any
syntax errors will be listed, and only the lines which have
correct BASIC syntax will be translated. Incorrect lines will
remain in ~ree~text format. After a program has been trans-
lated by the COMP command, it may be executed locally using
any of the normal execution commands, i.e. RUN, CONT, etc.
An attempt to execute an untranslated line will cause an error
message (ERROR 79) to be displayed.
-195-
iO4~
The receiving section of the modem driver routine
operates under interrupt control which allows the user to
execute programs locally and remotely at the same time, For
example, the user may want to run a program on a time-sharing
computer sy~tem that may take several minutes to complete,
He may start that program by transmitting a RUN command.
While that program is being executed, the calculator is
free for normal keyboard operation or program execution. The
~ ;s
only limitation in the mode is that ~h~ calculator may not
use the display or printer at the same time as it is receiving
information from the remote program.
.
-196-
10~6~i44
PLOTTER PLUG-IN READ-ONLY MEMORY MODULE
The plotter plug-in read-only memory module enables
the calculator to control an Hewlett-Packard 9862A calculator
plotter, providing permanent graphic solutions to problems
solved by the calculatorO
In general, the plotter command set can be considered
as consisting o~ two ~roups plotting commands and writing
commands. The user can specify any plotting units he pleases,
the calculator then automatically scales those units to fit
the chosen plotting area. Also, the calculator keyboard
characters can be drawn in different sizes and directions.
The 'plotting~ commands enable the system to automati-
cally scale user-units; draw X and Y axes of any length, any-
where in the plotting area; make any desired tic-marks on the
axes; plot points or functions; lower or raise the pen, either
before or after movement; temporarily translate the established
origin to any point within the plotting area and then plot,
still in user-units, with respect to the new origin; plot in
increments (that is, in user-units, plot any point with respect
to the current pen position).
The Iwriting' commands enable most calculator keyboard
characters to be 'printed' on the plotter. The user can specify
the position, height and width of the characters, and the
di~ection in which they will be printed. A 'centering' com-
mand ~CPLOT) enables labels to be centered on some particular
point, thus simplifying labelling of axes and of specific
points on the graph. The format of labels and numbers - field
width, fixed or floating point, the number of digits following
the decimal point, etc. - is specified by standard FORMAT
statements. In addition, a unique LETTER command establishes
-197-
. _
10~ 44
a 'typewriter' mode enabling the plotter to be controlled and
positioned from the calculator kcyboard, on a character-by-
character basis; this allows the user to add extra labelling
or individual comments to his graphs.
INITIALIZING THE PLOTTER
Before plotting, the plotter must be prepared and the
physical limits of the plotting area must be established The
front-panel controls on the plotter are used for this purpose.
LINE AND CHART HOLD
The LINE pushbutton is the power switch for the plotter;
press it to apply power, and press it again to remove power;
the white LINE lamp lights whenever the plotter is ON.
Pressing CHART HOLD activates the electro-static paper
hold-down mechanismO Pressing CHART HOLD again deactivates
it. The plotter will not plot or letter, and the pen holder
and arm will move freely in all directions when CHART HOLD is
deactivated~
LOADING PAPER
To load paper, release CHART HOLD and manually move
the pen arm all the way to one side of the plotter. Lay a
sheet of paper on the plotting surface and smooth out any ir-
regularities in the papér (you may also wish to ensure that
the paper is squarely against the ridge at the bottom of the
plotting surface); then activate CH M T HOLD.
GRAPH LIMITS
The graph limit controls are used to determine the
physical size of the plot.
LOWER LEFT and the two knobs to its left are used to
determine the physical location of the lower left hand corner
of the plotting area
-198-
10 1tjt~4
UPPER ~IG}IT and the two knobs to its right are used to
determine the physical location o~ the upper right-hand corner
of the plotting area. Together, the upper right-hand corner
and the lower left-hand corner determinc the size of the
plotting area.
Also, altering the lower left-hand setting will trans-
late the upper right-hand setting by the same direction and
amount.
To specify the lower left-hand corner of the plotting
area, press LOWER LEFT; the pen will move (without touching
the paper) to the lower left-hand corner of the plotting area
This point can be set anywhere within the lower left-hand
quarter of the plotting surface (platen) by adjusting the two
knobs associated with LOWER LEFT, Once the lower left-hand
corner has been set, the upper right-hand corner is set in the
same general way by pressing UPPER RIGHT and adjusting the two
knobs associated with it Once the plotting area has been
determined, it can be relocated by moving the position of the
lower left-hand corner - the upper right-hand corner will
'track' the changec
PLOTTING COMMANDS
NOTES: 1. All commands can be activated either from the
keyboard or from a program except where noted
2 All values in the following statements can be
numbers, variables or expressions except where
noted.
3 Any parameter enclosed in square brackets is
optional as far as the statement containing it is
concerned. However, program sense may dictate that
the parameter be present in specific cases
--1 9 9--
- - - - - - - ---
THE SCALE STATEMENT
SCALE Xmin, Xmax, Ymin, Ymax
Examples:
SCALE -10, 10, -5, 5
SCALE-4PI, 4PI~ 3, 1.1
establishes the full-scale units for the plot. Xmin to Xmax
and Ymin to Ymax correspond exactly to the limits of the
horizontal and vertical edges, respectively, of the plotting
,
area (the area is established mechanically as previously
described). This also establishes the point, on or off the
plotting area, where the original of the graph (0, 0) is
located.
A SCALE statement must be executed before any plotting
can occur~ Once established the scale remains established
until one of the following occurs:
~ new SCALE statement is executed.
The program is initialized.
A SCRATCH or SCRATCH A or SCRATCH V is executed.
The calculator is switched off.
The parameters (X, Y, etc.) in the SCALE statement
must be given in the correct order. If the minimum or maximum
values are switched no ÉRROR message will occur; however, sub-
sequent plotting commands may not be executed properly.
The SCALE statement has no effect on the position of
the pen.
THE PEN STATEMENT
PEN
The PEN statement is a 'stand-alone' instruction re-
qulring no parameter. It raises the pen without otherwise
changing its position relative to the plotting area,
-200-
Instructions to raise or lower the pen, either before
or after movement, can ~e easily included in several other
statements (see PLOT and IPLOT) so there is no special 'lower
pen' instruction.
THE OFFSET STATEMENT
OFFSET X, Y
Example: OFFSET 3, -3
Temporarily offsets the origin (point 0, 0 established
by the previous SCALE statement) by an amount, and in the
direction, determined by the values (in user-units) of X and
, , ~
Y. All future plotting commands are then made with respect to
the new origin until such time as that origin is again changed
by means of, for example, a new OFFSET or a new SCALE state-
ment
The OFFSET statements are not accumulative; that is, a
new 'offset' is with respect to the original origin and not
with respect to the last offset origin
Offsetting greatly simplifies plotting, from the
user's point of view, when it becomes necessary to divide the
plotting area into several smaller segments and then make a
separate plot in each segment. As the plot is made in each
segment it is not necessary for the user to 'correct' each
point before plotting; instead OFFSET statement moves the
origin to some convenient point within that segment so that
the calculator automatically makes the necessary 'corrections'
for each point plotted
THE AXI S STATEMENT
X AXIS Y-offset [, itic [, start point, end point]]
or Y AXIS X-offset [, +tic [, start point, end point~]
X AXIS 3, 1, -4, 4
--2 01--
1 O L~
Draws an X-(or Y-) axis according to the parameters given in
the AXIS statement. The pen is automatically raised both be-
fore and after drawing the axis,
(NOTE: The following describes the X-axis; the same information
is applicable to the Y-axis if 'left' and 'right' for
the X-axis are read as, respectively, 'bottom' and
'top' for the Y-axis,)
1, ~f no optional parameters are given, draws a straight
line from left to right across the complete plotting area
~from Xmin to ~max), The line crosses the Y-axis at a
point determined by the value of "y-offset',
2. If a 'tic' parameter is included then tic marks are made
along the axis as it is drawn; the value for 'tic' deter-
mines the spacing9 in user-units, between tics, The first
tic is drawn at the starting point of the line. The tic
parameter is usually positive (the sign is not required),
but occasionally a negative tic spacing is useful - see
4, below.
3. If the start point/end point parameters are given, then the
axis is drawn only between the points specified - from the
start point to the end point.
4. a, A negative tic spacing when no start point/end point
parameters are given results in a tic only at the left
end (Xmin) of the axis.
b. If the start point parameter is more poaitive than (i.e.,
to the right of) the end point parameter, then the
axis is drawn from right to left; in this case,
negative tic spacing results in normal tic marks
being drawn along the axis.
3D c, With the start point/end point parameters the same as
-202-
10~ i4-~
in b above, a positive tic spacing results in a tic
only at the ri~ht end (Xmax) of the axis.
THE PLOT STATEMENT
PLOT X, Y ~, control pen]
PLOT SIN(X), COS(X), -2
Moves the pen to the co-ordinate specified by the value of
X and Y.
When no optional 'control pen' parameter is given:
If the pen was raised, it moves to the point specified and
then lowers.
If the pen was lowered, it remains lowered while moving to
the point specified, thus drawing a line on the plotting
surface.
The 'Control Pen' Parameter
The value and sign of this parameter in the PLOT
(and IPLOT) statements determines whether the pen will be
raised or lowered before or after it moves to the specified
point.
If the parameter is:
negative - control occurs after movement;
positive - control occurs before movement;
odd - raises pen if it was lowered;
even - lowers pen if it was raised
The value of the control parameter can be any number
in the range i32767. If the value is not an integer then it
is automatically rounded up or down according to the value of
the fractional part of the number; that is up for .5 or greaterS
or down for less than .5 (Rounding is the same as the
standard rounding in the calculator; it is not the same as
the INT function, where the value becomes that of the next
lower integer )
-203-
THE IPLOT STATEMENT
IPLOT deltaX, deltaY ~, control pen]
IPLOT 2, -3A/4, 1
Moves the pen (from its current position) in the X direction
and in the Y direction, by the amounts specified by 'deltaX'
and'deltaY', respectively.
The 'control pen' parameter is optional and operates
exactly as described previously - sèe the PLOT STATEMENT.
Notice that the action of the IPLOT statement is such
that it is as if, during the execution of that statement
only, the origin (O, O) of the graph is offset to the current
position of the pen. Pen movement is then related to that
offset origin.
The IPLOT statement is most useful when drawing regular
geometric shapes such as, for example, a swastika (~). In
this case each point is more easily plotted with respect to
the previous point, rather than with respect to the origin
of the graphO
THE LABEL. STATEMENT
LABEL (FORMAT statement number or *[, character
heigth in %, Aspect ratio, angle of rotation
r, paper heigth/paper width]~) print list
Examples: LABEL (x, 2, 2, 0, 8 5/11) "PLOTTE~"
LABEL (100) 1, A, SIN(X)
The LABEL statement is used to write alpha and numeric characters
with the plotter. Several parameters are allowed which can be
used to control the size, shape, and angle of rotation of the
character printed. The character height can be specified in
percent of the paper height. The aspect ratio is the ratio of
ao the character height to the character width before any rotation.
-204-
~O ~t;6~4
The angle of rotation of characters printed can be given
This parameter can be given in degrees, radians, or grads and
is dependent on a previously given DEG, RAD, or GRAD state-
ment. A fourth parameter can be specified. This is the
ratio of the actual measured height of the plot paper to the
measured width as set by the upper right and lower left posi-
tions. This parameter is necessary to keep proper aspect
ratio of characters printed on an angle on a non-square plot.
. . .
If not specified, the calculator will assume character height =
2.5%, aspect ratio = 2, rotation = 0, and paper ratio = 1.
The format specification and the print list are the
same as a WRITE statement. If a FORMAT statement number is
- specified, the print list is written on the plotter using the
specification given in the FORMAT statement. All sec~fications
are allowed except "B". If an "*" is used, the print list will
be written according to standard format. This includes the
normal definition of comma and semi-colon spacing, string fields,
TAB, etc.
- The LABEL statement will start printing characters at
the current pen position. Anytime an end of line is needed,
the plotter pen will return to the character position directly
below the first character of the current line, simulating a
carriage return, line feed.
If the string variables option block is also plugged
into the memory, then string variables are allowed in the print
list~
THE LETTER STATEMENT
LETTER
When the LETTER statement is executéd, the calculator enters a
unique 'typewriter' modc with the plotter as the printing device
-205-
While in this mode when the user hits any printing character
on the keyboard, that character is immediately printed on
the plotter at the current pen position. An EOL or EXECUTE will
cause a carriage return, line-feed to be simulated In ad-
dition, while in this mode the t, 1, ~, and ~ keys can be
used to position the pen The t and 1 keys can cause the pen
to move up or down one character position The ~ and ~ keys
cause the pen to move left or right one character position.
If the shift key is held down at the same time as a pen control
key, the pen will move one~tenth of a character position.
Character size, aspect ratio, and rotation can be specified
by giving a LABEL statement prior to the LETTER statement.
THE CPLOT STATEMENT
CPLOT delta X characters, delta Y characters
Example: CPLOT 5, - 3
The CPLOT statement is similar to the IP~T statement in that
it moves the pen to a position relative to the current pen
position. The difference is that the delta X and delta Y
values are specified in character size units In the example
above the pen would move five character position down This
statement is particularly useful in positioning the pen when
labeling a plot using the LABEL statement
One character space is defined as follows:
1 ~ ~ Lower-left corner
.- of character above
, The LETTER ~A~' for
- example
-~ ~ Lower-left corner of
next character
-206-
, ....
lO~fj6~
The error messages givcn by the plotter module are:
~RROR 80 - No scale statement executed before PLOT, IPLOT,
OFFSET, or AXIS.
~RROR 81 - Character size too large (limited to = 20%) or
binary mode not allowed.
~RROR 82 - OFFSET, POINT 1, or POINT 2 out of range during
axis execution or tic increment in axis statement
is too small.
-207-
10~6~;4~
MATRIX PLUG-IN READ-ONLY MEMORY MODULE
The Matrix read-only memory module enables the cal-
culator to understand the MAT statements of BASIC. These
; statements facilitate the matrix operations of addition, sub-
traction, initialization, scalar multiplicationj matrix multi-
plication transposition, and inversion. A function additional
to standard BASIC language matrix operations is provided for
computing the determinate of a square matrix. The MAT READ
and MAT PRINT commands facilitate entering data into an array
and the prirting thereof. The MAT INPUT command which appears
in some versions of BASIC is not allowed. The matrix operations
are allowed on split precision or integer arrays as well as
full floating point arrays~
The operations performed by this matrix module are
summarized below and additional information is provided above
on pages 148-164.
A. MAT READ
reads numeric information from DATA statements into an array
MAT READ A
MAT READ A(3,5)
MAT READ B,W(8),X,Y
B~ MAT PRINT
prints complete arrays
close pac~ing specified with a semicolon
MAT PRINT A
MAT PRINT A,
MAT PRINT R,S;V;W
C ZER, CON, and IDN operations
ZER: initialize an array to all zeros
CON: lnitialize an array to all ones
IDN: initialize an array to the identity matrix
-208-
: '
104~;644
MAT A = ZER
MAT Q = CON(9)
MAT I - IDN(4,4)
D, MAT assignment statements
assign to a matrix the result of a MAT operation
1) MAT A = B
assigns elements of A from array B
.- 2) MAT A = B ~ C
performs indicated addition or subtraction and assigns
result to A
any of A, B, and C may be the same matrix
3) MAT A = B * C
performs indicated multiplication and assigns result to A
array A must be distinct from B or C
4) MAT A = (expression) * B
performs the indicated scalar multiply (each element of
B is multiplied by the value of the expression) and
assigns the result to A
5) MAT A = TRN(B)
assigns the transpose of B to A
array A must be distinct from B
6) MAT A = INV(B)
assigns the inverse of B to A
A and B may be the same matrix
E. DET operation
calculates the determinant of a square matrix
MAT D4 = DET(A)
-209-
104~;44
KEY CODES AND MNEMONICS
All of the keys of the keyboard input unit and their
associated mnemonics and binary keycodes are listed in the
Table below~ Every key has one mnemonic and two keycodes,
(namely, a shifted keycode and an unshifted keycode). Key-
codes are applied to the CPU in eight-bit binary form. The
first four bits of each keycode are given in the left-most
vertical column of the table below and the next three bits
of each keycode are given in the uppermost row of the table
-- ~ 10 below. The eighth bit of each keycode is the shift bit and
is determined by whether or not the shift key of the key-
b~ard input unit is depressed. Keycodes entered into the
CPU from the keyboard input unit or from the program storage
section of the memory unit are processed by the keyboard in-
put routine 204 as generally described above in connection
with Figure 9 and as shown in detail in Figures 88A-G.
KEYCODE AND MNEMONIC TABLE
D0 Dl D2 D3 D4 D5 D6 D7
b6 0 0 0 0
b5 0 0 1 1 0 0
b4 0 1 0 1 0 1 0
b3b2blbO
O O O O f O RECALL SPACE 0 p PA
0 0 0 1 fl FETCH 1 A Q STOP
O O 1 0 f2 BACK 2 B R EOL
_~. O O 1 1 f3 FWD 3 C S DL
O 1 0 0 f 4 1 4 D T FXD
O 1 0 1 f5 t 5 E U FLT
O 1 1 0 f 6 ~ 6 F V SCRATCH
0 1 1 1 f7 ~ 7 G W AUTO
1 0 0 0 f8 LOAD ( 8 H X
; 1 0 0 1f 9 STORE ) ~ I Y
1 0 1 0LIST INIT X J Z CLR
1 0 1 1EXEC / + K RESULT
1 1 O O CONT , L
1 1 0 1STEP STD - - M
1 1 1 0 TRACE NORMAL . N
1 1 1 1 RUN INSERT / O hN
EXp
-210-
104~644
BASIC INSTRUCTION SET
Every routine and subroutine of the calculator comprises a
sequence of one or more of 71 basic sixteen-bit instructions
listed below. These 71 insturctions are all implemented
serially by the micro-processor in a time period which varies
according to the specific instruction, to whether or not it is
indirect, and to whether or not the skip condition has been met.
Upon completion of the execution of each instruction, the program
counter (P register) has been incremented by one except for
instructions JMP, JSM, and the skip instructions in which the
skip condition has been met. The M-register if left with
contents identical to the P-register. The contents of the
addressed memory location and the A and B registers are left
unchanged unless specified otherwise.
Memory Reference Group
The 14 memory reference instructions refer to a specific address
in memory determined by the address field <m>, by the ZERO/CURRENT
page bit, and by the DIRECT/INDIRECT bit. Page addressing and
indirect addressing are both described in detail in the reference
manuals for the Hewlett-Packard Model 2116 computer (hereinafter
referred to as the HP 2116).
The address field <m> is a 10 bit field consisting of bits O
through 9. The ZERO/CURRENT page bit is bit 10 and the
DIRECT/INDIRECT bit is bit 15, except for reference to the A
or B register in which case bit 8 becomes the DIRECT/INDIRECT
bit. An indirect-reference is denoted by a <,I> following the
address <m>.
REGISTER REFERENCE OF A OR B REGISTER: If the location <A> or
<B> is used in place of <m> for any memory reference instruction,
the instruction will treat the contents of A or B exactly as it
would the contents of location <m>. See the note below on the special
restr1ction for direct register reference of A or B.
ADA m,I Add to A. The contents of the addressed memory
location m are added (binary add) to contents of the
A register, and the sum reamins in the A register. If
carry occurs from bit 15, the E register is loaded with
OOOl, otherwise E is left unchanged.
ADB m,I Add to B. Otherwise identical to ADA.
-211-
104~64~
Memory Reference Group (continued)
CPA m,I Compare to A and skip if unequal. The contents of
the addressed memory location are compared with the contents
of the A register. If the two 16-bit words are different,
the next instruct;on is skipped; that is, the P and M
- registers are advanced by two instead of one. Otherwise,
the next instruction will be executed in normal sequence.
CPB m,I Compare to B and skip is unequal. Otherwise identical
to CPA.
LDA m,I Load into A. The A register is loaded with the
contents of the addressed memory location.
LDB m,I Load into B. The B register is loaded with the
contents of the addressed memory location.
STA m,I Store A. The contents of the A register are stored
into the addressed memory location. The previous contents
of the addressed memory location are lost.
STB m,I Store B. Otherwise identical to STA.
IOR m,I "Inclusive OR" to A. The contents of the addressed
location are combined with the contents of the A register
- as an "INCLUSIVE OR" logic operation.
ISZ m,I Increment and Skip if Zero. The ISZ instruction adds
ONE to the contents of the addressed memory location. If
the result of this operation is ZERO, the next instruction
is skipped; that is, the P and M registers are advanced by
TWO instead of ONE. The incremental value is written back
into the addressed memory location. Use of ISZ with the
A or B register is limited to indirect reference; see foot-
note on restrictions.
AND m,I Logical "AND" to A. The contents of the addressed
location are combined with the contents of the A register
as an "AND" logic operation.
DSZ m,I Decrement and Skip if Zero. The DSZ instruction
subtracts ONE from the contents of the addressed memory
location. If the result of this operation is zero, the
next instruction is skipped. The decremented value is
written back into the addressed memory location. Use
of DSZ ~ith the A or B register is limited to indirect
reference; see footnote on restrictions.
-212-
104~644
JSM m,I Jump to Subroutine. The JSM instruction permits
jumping to a subroutine in either ROM or R/W memory. The
contents of the P register is stored at the address
contained in location 1777 (stack pointer). The contents
of the stack pointer is incremented by one, and both M
and P are loaded with the referenced memory location.
JMP m,I Jump. This instruction transfers control to the
contents of the addressed location. That is, the referenced
memory location is loaded into both M and P registers,
effecting a jump to that location.
Shift-Rotate Group'
The eight shift-rotate instructions all contain a 4 bit variable
shift field <n> which permits a shift of one through 16 bits;
that is, 1 < n < 16. If <n> is omitted, the shift will be
treated as a one bit shift. The shift code appearing in bits
8,7,6,5 is the binary code for n-l, except for SAL and SBL, in
which cases the complementary code for n-l is used.
M R n Arithmetic right shift of A. The A register is shifted
right n places with the sign bit (bit 15) filling all
vacated bit positions. That is, the n+l most significant
bits become equal to the sign bit.
ABR n Arithmetic right shift of B. Otherwise identical to AAR.
SAR n Shift A right. The A register is shifted right n places
with all vacated bit positions cleared. That is, the n
most significant bits become equal to zero.
SBR n Shift B right. Otherwise identical to SAR.
SAL n Shift A left. The A register is shifted left n places
with the n least significant bits equal to zero.
SBL n Shift B left. Otherwise identical to SAL.
M R n Rotate A right. The A register is rotated right n
places, with bit O rotated around to bit 15.
RBR n Rotate B right. Otherwise identical to RAR.
, -213-
1046644
Alter-Skip Group
The sixteen alter-skip instructions all contain a 5-bit
variable skip field <n> which, upon meeting the skip condition,
permits a relative branch to any one of 32 locations. Bits
9,8,7,6,5 are coded for positive or negative relative branching
in which the number <n> is the number to be added to the current
address, (skip in forward direction), and the number <-n> is
the number to be subtracted from the current address, (skip in
negative direction). If <n> is omitted, it will be inter-
preted as a ONE.
<n>=O CODE=OOOOO REPEAT SAME INSTRUCTION
<n>=l CODE=OOOOl DO NEXT INSTRUCTION
<n>=2 CODE=OOO10 SKIP ONE INSTRUCTION
<n>=15 CODE=Ollll ADD 15 TO ADDRESS
<n>=-l CODE=lllll DO PREVIOUS INSTRUCTION
<n>=-16 CODE=10000 SUBTRACT 16 FROM ADDRESS
<n>=nothing
CODE=OOOOl DO NEXT INSTRUCTION
The alter bits consist of bits 10 and bits 4. The letter <S>
following the instruction places a ONE in bit 10 which causes
the tested bit to be set after the test. Similarly the letter
<C> will place a ONE in bit 4 to clear the test bit. If both
a set and clear bit are given, the set will take precedence.
Alter bits do not apply to SZA, SZB, SIA, and SIB.
SZA n Ski~ if A zero. If all 16 bits of the A register are
zero, skip to location defined by n.
SZB n Skip if B zero. Otherwise identical to SZA.
RZA n Skip if A not zero. This is a "Reverse Sense" skip of SZ.
RZB n Skip if B not zero. Otherwise identical to RZA.
SIA n Skip if A zero; then increment A. The A register is
tested for zero, then incremented by one. If all 16 bits
of A were zero before incrementing, skip to location
defined by n.
SIB n Skip if A not zero; then increment B. Otherwise identical
RIA n Skip if A not zeroi then increment A. This is a
"Reverse Sense" skip of SIA.
RIB jnd Skip if B not zero; then increment B. Otherwise
SLA n,S/C Skip if Least Significant bit of A is zero If the
least significant bit (bit O) of the A register is zero,
skip to location defined by n. If either S or C is
present, the test bit is altered accordingly after test.
-214-
4~
Alter-Skip Group (continued)
SLB n,StC Skip if Least Significant bit of B is zero. Other-
wise identical to SLA.
SAM n,S/C Skip if A is Minus. If the sign bit (bit 15) of the
A register if a ONE, skip to location defined by n. If
either S or C is present, bit 15 is altered after the test.
SBM n,S/C Skip if B is Minus. Otherwise identical to SAM.
SAP n,S/C Skip if A is Positive. If the sign bit (bit 15) of
the A register is a ZERO, skip to location defined by n.
If either S or C is present, bit 15 is altered after the
test.
SBP n,S/C Skip if B is Positive. Otherwise identical to SAP.
SES n,S/C Skip if Least Significant bit of E is Set. If bit
O of the E register is a ONE, skip to location defined by
n. If either S or C is present, the entire E register is
set or cleared respectively.
SEC n,S/C Skip if Least Significant bit of E is Clear. If
bit O of the E register is a ZERO, skip to location defined
by n. If either S or C is present, the entire E register
is set or cleared respectively.
Complement-Execute-DMA Group.
These seven instructions include complement operations and
several special-purpose instructions chosen to speed up printing
and extended memory operations.
CMA Complement A. The A register is replaced by its One's
complement.
CMB Complement B. The B register is replaced by its One's
complement.
TCA Two's Complement A. The A register is replaced by its
One's Complement and incremented by one.
TCB Two's complement B. The B register is replaced by its
One's Complement and incremented by one.
EXA Execute A. The contents of the A register are treated as
the current instruction, and executed in the norma1 manner.
-~ ~ - The A register is 1eft unchanged un1ess the instruction
code causes A to be altered.
EXB Execute B. Otherwise identical to EXA.
DMA Direct Memory Access. The DMA control in Extended Memory
is enabled by setting the indirect bit in M and giving a WTM
instruction. The next ROM clock transfers A~M and the
following two cycles transfer B+M. ROM clock then remains
inhibited until released by DMA contro1.
-215
\ 104~ii644
Note: Special Restriction for Direct Register Reference of A or B
For the five register reference instructions which involve a
write operation during execution, a register reference to A or
B must be restricted to an INDIRECT reference. These instructions
are STA, STB, ISZ, DSZ, and JSM. A DIRECT register reference to
A or B with these instructions may result in program modification.
(This is different from the hp 2116 in which a memory reference
to the A or B register is treated as a reference to locations O
or 1 respectively.) A reference to location O or 1 will actually
refer to loca~ions O or 1 in Read Only Memory.
Input/Output Group (IOG)
The eleven IOG instructions, when given with a select code, are
used for the purpose of checking flags, setting or clearing flag
and control flip-flops, and transferring data between the A/B
registers and the I/O register.
STF <SC> Set the flag. Set the flag flip-flop of the channel
indicated by select code <SC>.
CLF <SC> Clear the flag flip-flop of the channel indicated by
select code <SC>.
SFC <SC> Skip if flag clear. If the flag flip-flop is clear
in the channel indicated by <SC>, skip the next
instruction.
SFS <SC> H/C Skip if flag set. If the flag flip-flop is set
in the channel indicated by <SC>, skip the next
instruction. H/C indicates if the flag flip-flop
should be held or cleared after executing SFS.
CLC ~SC> H/C Clear control. C1ear the control flip-flop in the
channel indicated by <SC>. H/C indicates if the
flag flip-flop should be held or cleared after
executing CLC.
STC ~SC> H/C Set Control. Set the control flip-flop in the
channel indicated by <SC>. H/C indicates if the
flag flip-flop should be held or cleared after
executing STC.
OT* <SC> H/C Output A or B. Sixteen bits from the A/B register
are output to the I/O register. H/C allows holding
or clearing the flag flop after execution of OT*.
The different select codes allow different functions
to take place after loading the I/O register.
SC=OO Data from the A or B register is output
eight bits at a time for each OT*
instruction given. The A or B register
is rotated right eight bits.
, -216-
,5
10~64~
- Input-Output Group (IOG), continued
SC=Ol The I/O register is loaded with 16 bits
from the A/B registers.
SC-02 Data from the A/B register is output one
bit at a time for each OT* instruction for
the purpose of giving data to the Magnetic
Card Reader. The I/O register is unchanged.
SC-04 The I/O register is loaded with 16 bits
from the A/B register and the control flip
flop for the printer is then set.
SC-08 The I/O register is loaded with 16 bits
from the A/B register and the control flip
flop for the display is then set.
SC=16 The I/O register is loaded with 16 bits
from the A/B register and then data in the
I/O register is transferred to the switch
latches.
LI* <01> H/C Load into A or B. Load 16 bits of data into the
A/B register from the I/O register. H/C allows
holding or clearing the flag flop after Ll* has
been executed.
-- LI* <00> The least significant 8 bits of the I/O register
are loaded into the most significant locations in
the A or B register.
MI* <01> H/C Merge into A or B. Merge 16 bits of data into the
A/B register from the I/O register by "inclusive
or". H/C allows hold;ng or clearing the flag flop
after Ml* has been executed.
MI* <00> The least significant 8 bits of the I/O register
are combined by inc1usive OR with the least
significant 8 bits of the A or B register, and
rotated to the most significant bit locations of
the A or B register.
-217-
10'l~;6~
MAC Instruction Group
A total of 16 MAC instructions are available for operation
(a) with the whole floating-point data (like transfer,
shifts, etc.), or
(b) with two floating-point data words to speed up digit
and word loops in arithmetic routines.
NOTE: <Ao 3> means: contents of A-register bit O to 3
AR 1 is a mnemonix for arithmetic pseudo-register
located in R/W memory on addresses 1744 to
1747 (octal)
AR 2 is a mnemonix for arithmetic pseudo-register
located in R/W memory on addresses 1754 to
1757 (octal)
D. means: mantissas i-th decimal digit;
most significant digit is Dl
least significant digit is D12
decimal point is located between Dl and D2
Every operation with mantissa means BCD-coded decimal
operation.
RET Return
16-bit-nulnber stored at highest occupied address in stack
is transferred to P- and M-registers. Stack pointer
(=next free address in stack) is decremented by one.
- <A>, <B>, <E~, unchanged.
MOV Move overflow
The contents of E-register is transferred to A . Rest of
A-register and E-register are filled by zeros.~ 3
<B> unchanged.
CLR Clear a floating-point data register in R/W memory on
location <A>
ZERO~cA>, <A>+l, <A>+2, <A>+3
<A>, >B>, <E> unchanged
XFR Floating-point data transfer in R/W memory from location
<A> to location <B>
Routine starts with exponent word transfer
Data on location <A~ is unchanged
<E> unchanged.
....
-218-
lO'~t;~;44
MRX ARl mantissa is shifted to right n-times. Exponent
word remains unchanged.
<Bo 3>= n (binary coded)
1st shift: <A0-3>~Dl; Dj~j+l; D12 is
jth shift: ~t ~ Dl; Dj~Dj+l; D12 is lost
nth shift: ~ Dl; Dj~j+l; D12 ~ Ao 3
O ~ E, A4 15
each shift: <Bo_3> - 1 ~ Bo 3
<B4_15> unchanged
MRY AR2 mantissa is shifted to right n-times.
Otherwise identical to MRX
MLS AR2 mar. issa is shifted to left once.
Exponent word remains unchanged.
D~2; D; ~ Dj_li Dl ~ Ao 3
<B> unchanged
DRS ARl mantissa is shifted to right once
Exponent word remains unchanged
Dl; D; ~ Dj+l; D12 ~ Ao 3
ZERO ~ E and A4 15
<B> unchanged
DLS ARl mantissa is shifted to left once. Exponent
word reamins unchanged.
<Ao 3> ' D12; Dj ~ D; l; Dl ~ A3 3
E, A4 15
~B> unchanged
FXA Fixed-point addition
Mantissas in pseudo-registers AR2 and ARl are added
together and result is placed into AR2. Both exponent
words remain unchanged. When overflow occurs "OOOl"
is set into E-reg., in opposite case <E> will be zero.
<AR2> + <ARl> + DC ~ AR2
DC = ~if <E> was OOOO before routine execution
DC = 1 if <E> was 1111 before routine execution
<B>, <ARl> unchanged
-219-
104~;64~
FMP Fast multiply
Mantissas in pseudo-registers AR2 and ARl are added
together <Bo 3>-times and result is placed into ARa.
Total decimal overflow is placed to Ao 3. Both ex-
ponent words remain unchanged.
<AR2> + <ARl> * <Bo 3>+DC ~ AR2
DC = O if <E> was 0000 before routine execution
DC = 1 if <E> was 1111 before routine execution
ZERO ~ E, A4 15
<ARl> unchanged
FDV Fast divide
Mantissas in pseudo-registers AR2 and ARl are added
together so many times until first decimal overflow
occurs. Result is placed into AR2. Both exponent
words remain unchanged. Each addition without over-
flow causes +l increment of <B>.
1st addition: <AR2> + <ARl> + DC ~ AR2
DC = O if <E> was 0000 before routine execution
DC = 1 if <E> was 1111 before routine execution
next additions: <AR2> ~ <ARl> ~ AR2
ZERO ~ E
<ARl> unchanged
CMX lO's complement of ARl mantissa is placed back to ARl,
and ZERO is set into E-register. Exponent word remains
unchanged
<B> unchanged
CMY lO's complement of AR2 mantissa.
Otherwise identical to CMY
MDI Mantissa decimal increment.
Mantissa on location <A> is incremented by decimal ONE
on D12 level, result is placed into the same
location, and zero is set into E-reg.
Exponent word is unchanged.
When overflow occurs, result mantissa will be
1,000 0000 0000 (dec)
and 0001 (bin) will be set into E-reg.
<B> unchanged.
NRM Normalization
Mantissa in pseudo-register AR2 is rotated to the left
to get Dl ~ O. Number of these 4-bit left shifts is
stored in Bo 3 in binary form (<B4 15>=0)
when <Bo 3> = 0,1,2,. . . . 11 (dec) -~ <E> = 0000
when <Bo 3>= 12 (dec)=~ mantissa is zero, and <E> =0001
Exponent word remains unchanged
~A> unchanged.
-220-
,,
10~fà644
The binary codes of all of the above instructions are listed
~,n the following coding table, where * implies the A or B
register, D/I means direct/indirect, A/B means A register/B
register, Z/C means zero pace (base page) (current page, H/S
means hold test bit/set test bit, and H/C means hold test bit/
clear test bit. D/I, A/B, Z/C, H/S, and H/C are all coded as 0/1.
CODING TABLE
GROUPOCTALINSTR 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MEMORY o---- AD~ D/lo o 0 AIR Z/C ADDRESS--
REFERENCE - ---- CP- Dl ~ n I A/B 'IC
GROUP - LD' ~/ t 0 A/B IC
-,--- ST~ ~/ o I A/B .IC
- 10 ~ ~/ o O o /~
-~--- 15~ O./C
-~-- - A~ B ~/ 0 0 ./C
- --- D'- ~1 0 ./C
~ JiS~p ~/ n ~ /cc
SHIFT 0 --0 A'R 0 A/E SHIFT .000
ROTATE 07---2 S~R 0 1 1 1 A/B- CODE -- 0 1
GROUP 07 -4 S~L 0 1 1 1 A/B -- - 0 1 0
07---6 R~R 0 1 1 1 A/B -- ~ ti I I
ALTER- 07- 0 SZ' 0 1 1 1 A/B O SKIP 0 o 0
SKIP 07 - 0 RZ' 0 1 1 1 A/B I CODE 0 o 0
GROUP 07---0 Sl' 0 1 1 1 A/B o I I t 0 0
07---0 Rl~ 0 I II A/B I I 1 0 0 0
07---1 ~3L' 0 1 11 A/B H/S HIC i 0 0
07---2 S~M 0 1 11 A/B H/S H/C i o I
07- J S~P 0 1 11 A/B H/S H/C i o I
07 --~ SES 0 1 11 A/B H/S H/C I 1 0
07 - 5 SEC 0 1 11 A/B H/S H/C i 1 0
REGISTER07 17 ADA 0 1 1 1 A/8 D/l 0 0 0 0 1 1
REFERENCE07 37ADR ~ I I I ~/B ~ D/l 0 0 0 1 1 1
t;ROUP 07 -57 CPA 0 1 1 1 A/B - D/l 0 0 1 0 1 1
07 -77 CPB 0 1 1 1 A/B -- DEi 0 0 1 1 1 1
07--17 LDA 0 1 1 1 A/8- D/iO I 00 1 1
07 37 LDB 0 1 1 1 A/B .. D/l 0 1 0 1 1 1
117557 STA 0 1 11 A/8 101 101 I I
07.577 STB 0 1 Ir A8 1 0 1 1 1 1 1 1
0--17 IOR 0 1 11 A/8 D/l 1 0 0 0 i I I
117 1~1~ISZ o I II A/8 -- I 1 0 0 1 1 1 I
07.. 57 AND o II I A/R D/l 1 0 1 0 1 1
1\7.1177 DSZ O I I I AIP. I I O I I I I
07 717 JSM O I I I A/B - I I 1 0 o I I
07- 37 JMP o I I I A/B DA I 1 0 1 1 1
-221-
10~6~ ~ 4
., . . .. . . . .. . .. ... . _ ... ... ... .
CoOlNG tA~L~ - CO~tltv UL-t:~
G~o~lp acrqL I~STR IS ~ 9 6~ ~ ~ s ~ 3-! 2 1 0
C ~ ~q P O -~ - o I fi ~: X ~ ~ / ~ / % ~ o
EX~C~IJE O 7 o o 3 ~, D~ A o / / / O - -- _ _ o
oMfl o 7 - o, 6 C t~
O ~ - o 7 G T C ~,~O I I I /B / I / I I /
I N P v~ 1 7 2 7 - -5 r~ I I I I ~ / o - / / / / ~-SEL~Cr _
oVrPur ~ 7 ~ 7 - -C L 1~ I t t I - I I / I I I
GA~oP ~ 7 - ?- - S t CI I I ~ c I / I O
. ~ . 1 7 - ~ ~ - 5 F SI I I / - I /~c I ~ I t~
7 ~ ~ ~ C ~t t / ~ ~c / C~ / I
1 7 ~ 6 - --5 T CI I I I ~ /c / ~ ~ O
/ 7 ~ O T ~i~t I t I /)/~ ~ ~/~c. o O I /
7 2 ~ /A~B I ~/c ~ / ~ I
7 - C~ t / t ~ /c O O o /
MAc !70 L~G2 R~rI / I I o ~ Q ~ O O ao o I O
~1~0~ 7~ Ot~2 ~VI I I IO C~ o o O O O~ O o I
i7 ~~~~ C~RI I I I ~ oO ~ ~ O O oo C~OO
/7000L~ XFP~I I I I~o~ oO o ooo / oo
17Y~l ~o I'IRXI I I II o o I u c~ o I I C) O o
17Yy70 1''1,~y1 / I I I oo t O O - I / I ~ O o
1 71 ~ 0 01~1 L SI I I I O O I I ~ O o t~ O o O
1 7t~ YI o D~ SI I I I t~ O ~ I t~ v o O I . O o o
1 75 ~¦ t7 t~C~ ~ 51 ¦ I / / O ~ ~ O O O C) o O G O
I 70 56~ flI I I I C~ t) O I o l l I O O t O
~ 71 46 ~ ~-~1 PI I I Io o I I o o I I C~ o G O
~~ 17~42t) FD~.~I I I IC)oC~ I C)O C) I t~ ooc~
1 7L~OO C M,'CI ~ 0 l o o o oCJ OO C~
/70yoo ~M'I'/ I I I0~O 10 ~ ~~~ ~~~
1 70 S ~It~~1 D ~:I / I I t~ C70 I O / / C~O OOC~
) 7/ ~ 1'3 1;~ ;11 1 1 1 0 0/ 1 O O / O l ~ ~ O
~' ,
- --222--
io~ t;~
DETAILED LISTING OF ROUTINES
AND SUBROUTINES OF BASIC INSTRUCTIONS
A complete listing of all of the routines and sub-
routines of basic instructions employed by the calculator
and of all of the constants employed by ~hese routines and
subroutines is given below. All of th~se routines, subroutines,
and constants are stored either in the basic ROM or in the
plug-in ROM modules employed therewithO Each page within the
listing is numbered at the upper left-hand corner, and its number
within the specification as a whole is indicated at the bottom
of the page. Each line of each page is separately numbered in
the first column from the left-hand side of the page. This
facilitates reference to different parts of the listing. Des-
criptive headings are also provided throughout the listing to
identify routines, subroutines, groups of constants, different
portions of the ROM, the plug-in ROM modules, etc. Each instruc-
tion of each routine or subroutine and each constant stored in
the ROM or plug-in ROM modules is represented in octal form by
six digits in the third column from the left-hand side of the
page, and the address of the ROM location in which each such
instruction or constant is stored is represented in octal form
by five digits in the second column from the left-hand side of
the page.
Mnemonic labels serving as symbolic addresses or names
are glven in the fourth column from the left-hand side of the
page for most of the constants and many of the instructions to
facilitate references to these constan's and instructions and
associated instructions. The mnemonic codc- of each basic
instruction and of each pseudo instruction is given in the
fifth column from the left-hand side of thc page. As noted
above, each basic instruction is employed as a step in a
--223-
r
~0~ 4~
routine or subroutine of one or more basic instructions
and therefore has an address in the ROM. Pseudo instructions
such as ORG, EQU, etc. which appear (and are recognizable as
not being one of the 71 basic machine instructions listed above)
are used for control of the Assembler, which translates the
symbolic/mnemonic coding of the fourth, fifth, and sixth
columns into the address and contents of ROM registers which
appear in the second and third columns. (See chapter 4 of
the Hewlett-Packard "Assembler Programmer's Reference Manual"
of April~ 1970.) They are not employed as steps in the
routines and subroutines performed by the calculator and
therefore have no addresses in the ROM. Mnemonic operand
codes are given in the sixth column from the left-hand side
of the page, and descriptive comments are given to the right
of the sixth column The format, assembly, and use of the
listing is explained in greater detail in the above-mentioned
Hewlett-Packard "Assembler Programmer's Reference Manual".
In addition, cross-reference symbol tables are included
directly below each group of routines and subroutines for pro-
viding an alphabetical listing of each of the mnemonic labels
and operands. The number contained in the first column to the
right of each mnemonic in the cross-reference table represents
the line in the associated routine or subroutine listing at
which that mnemonic appears as a label in column four. Sub-
sequent columns beyond the first column to the right of each
mnemonic in the cross-reference table represent the line in
the associated routine or subroutine listing at which that
mnemonic appears as an operand in column six.
-224-
10~ 4
PAGE 00~2 #el 9R30 ~ S~S~M SOFtWARE
~001 A5M8-A~L~C
~3~ MAIN SYST~M ~IR~W~E L~StING 3-27-72
0004- ,,
~005 ~O000 O~G 0
~006~
0007 O0000 164121 J~p START-I START OF ~ONITOR
0008 60001 043060 0CT ~3060 CONSTANT NEE0E0 ~Y PQocEssoQ
~009 Z0002 161463 JSM lNtEL .1 I~TERRUP~
10~
0011 e0003 ~fl0000 Ch OC~ O ONE
~012 ~0004 t~l0000 OCT O1000~ 0000
13 ~o0~s ~o~0 OCt O 0~0
~14~
~015 ~0Q6 O0~000 C5 OCT a~e0~0 P~2
~016 ~B007 01~560 OCT 1256~ 1570
e017 C0010 074543 OCT ~q4543 7963
~01~ ~Q011 ~232e0 OCt 0~32a~ 2680
C101S~
~020 C0012 ~00B01 .1 DEC I
~021~ ~
oa22 ~0013 g004~0 C7 0CT ~604~ 0~PI
4023 ~0al4 ~53451 OCT 053451 5729
0024 ~0015 C53571 0CT 053571 5779
~025 ~0016 ~50450 0CT o~0450 5128
e026~
0~27 e0Q17 ~0gae2 .2 DEC 2
802a ~0020 ~0003 .3 ~EC 3
a029 ~21 ca~004 .4 ~EC 4
e030 ~ 20~22 ~ 005 ~5 DEC 5
a031 00023 000006 .6 DEC
ed32 ~oa24 aaQ~07 .7 DEC 7
G033 a0025 ~0001C .B DEC 6
e034 00026 600011 .9 OEC ~
~035 Q~02~ ~Oa~13 ~11 DEC 11
e036 e~030 ~B0al4 .12 DEC ~2'
~037 ~0~31 ~aOO15 CRT~ OCT 15
d038 00031 EOL EQU CRTN
0039 ~0031 ~ 13 EQU C~T~
~ ~4 0 * * ~ ** ~
ff041* PQlNTE~S TO FUNCTION5 C~STANTS
~042-
0043 00027 DPE~R ECU ~11 PO~NrER TO lO00PI
6044 00~23 Pl~2 ~au ~6 PO~TER TO PIo2
045 eo0Z0 ONE E'CU ~3 POI~TER TO THE Co~sT~NT ONE
O047**~***~****~4~**~*~
004B 0~032 ~02017 .15 DEC 15
1JO49 ~OJ33 00002C .16 DEC 16
B050 00034 000025 .21 DEC cl
~051 0~035 ~a0026 .22 DEC 22
~052 20036 600027 .Z3 ~EC 23
0053 oOa37 00~j4 .28 ~EC 2a
~54 eOa40 ~00037 .31 DEC 3~
~055 eO041 1~00040 .32 DEC 32
~1056 eO042 eao041 .33 DEC 33
~057 00043 ~0~042 .34 DEC ~
Z25
lo~t;~ ~
.
PAGE OC03 ~01 9~30 MAIN SYSTE~ SOF7~ARE
~058 e~044 ~00045 ,37 DEC 37
~059 00045 ~0a050 .40 ~EC 40
d060 QOO46 S0a051 .41 9EC 41
e061 00047 ~00053 .43 DEC 43
ca62 e~os0 o00aSS .45 DEC 45
0063 OaOSl 000056 .46 DEC 46
0064 e~052 eOO060 .48 OEC 48
~065 e0053 oao072 .58 GEC 5~
~066 a0054 ~00077 .63 ~EC ~3
0067 00055 400111 I OCT 111
C068 000~6 ~23420 .lE4 DEC 1000a
oa69 O~05~ oal7s0 .1000 DEC 1000
0070 ~0060 000144 .100 DEC 100
~071' 00061 ~0~al2 .10 ~EC 10
0~7Z 0~061 LNFD Eau .10
0073 eO062 100000 fLG9T OCT 100000
0074 OBa63 ~00143 .99 DEC 99
a075 00064 100094 INTFL OCT 100004
~076 00065 a7660~ OP~SK OCt 76000
~077 00066 077777 INF OCT 77777
4078 00067 100037 TYPFL OCT 100a37
0079 00070 101777 OPOM~ OCT 101777
~080 a0071 Oael05 E OCT 105
C081 C0072 ~00106 F OCT 106
~082 00073 ~a0123 S OCT 123
ao83 80032 91~ EQU .15
G084 e0033 B20 ~CU ~16
~085 00074 0aO022 B22 OCT 22
ao86 90~75 oa0a23 ~23 OCT Z3
~087 aO035 ' ~26 ~OU -22
~088 ~0036 B27 ~QU .23
eoa~ ~076 000036 836 OCt 36
090 ~0040 837 FCU ~31
~091 ~0043 942 ~OU .34
0092 O00~7 e00044 944 OCT 44
C093 ~0100 ~0~052 ~52 OC~ 52
~a94 00053 B72 ~GU .S8
O095 ~0101 ~ealaO 910~ OCT 10
~96 Z0102 ~0~133 8133 OC~ 133
0097 00103 ~0P14a B140 0C~ 140
0098 Oolo4 000177 B177 OCT 177 ~,~
~099 00105 000377 ~377 OCT 377
dl00 80Z13 9400 EOU C~ . i
4101 0OlO~ 000177 B?7? OCT 7?7
4I02 00107 001000 B1000 OCT 100a
~103 ~0110 0014a0 B1400 OCT 1400
~I04 00111 001740 B1740 OCT 1740
~105 eO112 ~1760 ~1760 OCt 176
0106 00113 001774 B1774 ~CT 1774
~107 Z0114 Oal775 B17~5 OCT 1775
olOB ~0115 001777 P1777 ocr 1777
6109 eoll6 e02000 QTOP OCT 2000
0110 ~0117 a~2400 ~24ao OCt 2400
~1 00120 ~0~00 ~3000 OC~ 3000
fll 12 00121 0~4000 9400H OCl' 4000
~113 Qal22 ~06000 ~6K OCt o0a0
~t~
10~
PAGE Oa04 ~01 9830 MAIN S~STEM SOFTWARE
~114 ~0a04 ~10~ EOU C6~1
~115 00~04 QPOP ECU Bl~
~116 80123 0120a0 ~12K OCT 12000
~117 00123 R~OP ~OU ~12K
OllB ~0124 J320a0 EXPOP OC~ 3200
~119~ a0125 C500Q0 LROP OCt 50000
el20 00126 OS~O~0 LPOP OCT 52a~0
el21 20127 1700~0 B170K OCT 17000a
~122 ~0130 013777 FRO~A OCT 13777
C123 Cal31 37777 LQOMA OC~ 37777B LAST RO~ ~LOCK
~124 00132 177777 ~1 DEC -1
0125 00133 177776 M2 GEC -2
0126 0~134 t?7775 M3 DEC -3
~127 0O135 177774 M4 DEC -4
0128 00136 177773 M5 DEC -5
0129 ~al37 177772 M6 DEC -6
0130 00140 177767 ~9 DEC -9
~131 80141 177766 M10 DEC -la
tl32 00142 177765 Mll DEC -11
el33 Cal43 177764 M12 ~EC -12
~134 OQ144 177763 ~13 ~EC -13
el3s 0al4s 177762 M14 DEC -14
C136 ~0146 177761 M15 ~EC -15
~137 ~0147 177751 M23 ~EC -23
~138 O0150 177747 M25 DEC -25
0139 60151 17774B ~32 DEC -32
el40 e0152 177734 M36 DEC -36
~141 ~0153 177720 M48 DEC -48
4142 ~0154 1777~0 M64 ~EC -64
gl43 ~0155 177660 M80 DEC -80
~144 e~l56 177634 M100 DEC -100
dl45 ~C157 177400 M256 ~EC -256
C146 6al60 176000 M1024 ~EC -1024
~147 Q0161 1s436a MAXSN DEC -1000e -(MAXIMU~ ALLOWA~LE LINE NU~RER)
~148 00162 043116 FN ASC l.f~
~I49~
~150~ MAtH CONSTANtS T~T A~E NEEOED ON BASE PAGE
elsl~
~152 00163 1774~1 ZAP OCT 177401
C153 a0164 ~63440 MASKl OCT 06344a
~154 eO165 461400 ~ASKS 0Ct 06140~
2~7
; .
PAGE 0005 ~01 9q30 MAIN S~STEM SOFTWAQE
~156-
~157 C0166 40440 F~A~ DEF 40440B FI~St WOQD R/W
015B ~0112 RStKA EQU B176~ StAQT OF QETUQN StACK
el59 ~0167 ~02454 W~ItE DEF WRIT PRINTER ~ND DISPLAY DRIVER
0160 e0170 ~02533 CLERA ~EF CLEbR CLEAQ QEFRESH BUFfER
el61 0all6 REED EGU UTOP KEy~oARD DRIvER aTOP IS = 2~00
~162 00121 START EQU B4000
0163 ~01tl 004741 QUNA DEf RuN P~ASE 2~ S~MBOL TbBLE
0164 ~0172 ~10012 XEC4A DEF ~EC4 STATEMENt E~ECUTION EXIT
0165 Q0173 004044 PEX~A DEf PEXMK
~166 ~0174 ao4037 RDYDA DEf RDYPT
~167 a0122 LISTA EaU B6K
al68 e0175 003072 tSRHA GEF T~SQH TA~LE SEARCH
0169 00176 e07450 ELINA DEF OLINE OUTPUT I/O BUFFER
al70 a0177 ~053Q5 SSrMA DEF SSYMT
el71 00200 011433 OPC~A DEF OPC~K CHECK FOR UNDEFINED OPERAND
0172 ae2dl 01~563 FOR~A DEF FORMX EVALUATE FORMULA
~173 002a2 ~12040 FSCA ~EF FSC
al74 ~203 004511 ACTSA DEF ACt5T
0175 30204 ~04500 DELSA 0EF DELST
~176 202~5 ~04355 AERRA DEF AERR
~177 e0206 eo4360 EQQA ~Ef ERROR
C178 ~0207 ~00000 INTEA BSS 1 KEyBQARD INTERRUPT L~NK
~179 Oa210 ~00090 OUTIA ~SS 1 OUTPUt AN INTEGER
2180 86211 003200 .~UFA DEF IO~UF~IOBUF FIRST CHAR OF I00 BUFFER
dl81 00212 023322 .SLBF DEF RBUFF~R~UFF FIRST CHAQ OF REFQESH BUFFER
dl~2 e0213 001744 ARlA DEF ARl
0183 ~0214 601754 AR2A DEF AR2
Q184 00215 ~01773 TMPOP ~EF RES REsuLT QEGISTER POI~tE~
4145 0d216 O00d~0 .FADA BSS 1 ADD
61~6 ~0217 00aOa0 .FSBA HSS 1 SUBTRACt
alS7 ~0220 a00000 .FMPA ~SS 1 MULtPY
218a 00221 000000 .FDVA ~SS 1 ~IVIDE
OlB9 ~0222 005447 ENTFA DEF ENTfN
0190 3d223 ~O~O .FSR ~S5 1 SOUARE Root
~191 20224,~a0000 UPAQA OSS 1 UP ARROW
el92 ~0225 O000Q0 FLTQA ~SS 1
01~3 00226 200B00 fLtFA ~SS 1
~194 e0227 ~0a00a fXFLA ~SS 1
OI~S 30230 e~0000 FLTSA BSS 1
~196 ~0Z31 a0a0~0 SPL~A ~SS 1
al97 00232 ~0a000 SNFLA ~SS 1
~198 00233 ~01551 BEND DEF RBUfF I~O ~UFFER END
~1~9 FOZ33 S~UFA EOU 9EN0
a200 00234 e06353 NMOtA DEF NMOUT NUM~ER OuTpuT ROUTINE
~201 a0235 007027 FiLLA D~F flLL OUTPUT ~LA~KS
0202 00236 003442 SLEND ~EF RBUFF~R9UFF~80 REFRESH 9UFFEQ END
~203 50111 TMPA E~U B1740
e204 OOllQ 9ADRP EOU 91400 POI~TE~ POINt~R TO I~O BUFFER
e206 e0123 FOPBS ECU B12K
0207 eO237 ~16516 SALTA DEF SALT
~208 ~0240 405257 MDIMA DEF MDI~
0209 00241 C19413 SYTSA DEF S~TSH
~210 00242 ~5711 DCOMA DEF DCO~P
0211 0024~ ~0~000 NU~CA HSS 1
2~j
~0~644
PAGE OeQ6 ~01 9R30 MAI~ SYSTEM SOFT~ARE
~212 e0244 eoa0~0 NU~OA BS5 1
0213 00245 ~1656 G~STA DEf GE~S~
a214 ~0246 ~12231 VAROA D~F VAROP
e215 00247 010112 ECALA DEF ECAL E~ECUTE CALC ~O~E
ff216 Ofl250 004625 OVCHA OEF OvcHK
~217 e0251 004575 CLPlA DEF CLPRl
~218 0~252 e05416 E~tEA DEF ENTER
~219 C0253 607672 CHRSA DEF CHRST
e22a 00254 0~3317 XSC~A DEF XSCRl SCRATCH KEYS
B221 00255 ~lQ040 XEC6A DEF ~EC6
a222 ~0256 ~1~425 FOAAA DEF FDATA
0223 8~257 a0566D FNOAA DEF fhD~D
2224 eO26a 005671 fNDlA UEF Fh~Al
0225 eO261 ~0?547 IOSTA OEf IOST I~O STATUS CHECK
~226 0C262 61Q467 I~REA O~F I~REt
0227 d0263 0C3336 SUMPA DEF SUMP
~228 e0264 ea2504 CQCKA DEf CRCHK OUTPU~ SUPRESSED CREF
~229 OD265 el5501 IOHEA D~F IOHED
d230 e0266 ~07249 QTCHA.OEF aTcH~ CHECK FOR STRI~G
6231~*~*~**** 4~*~*O~4*~ *~*
~232
a233 e0267 ~00900 BSS 1 CHECKSUM ~ORD******~***~*~
. .
10~)644
. ~ .
.. .. .
.
PAGE O~lo? 1101 9830--EQROU TA~LE
G235 ~02~0 ~0062s El D.F SYSER ROM CONFIGURATION ERRoR
0236 eo2-1 000561 D.F FSCE4 MEMoQy OVERFLOW
02;7 ~02-2 004l77 D.F NCALC StMT NOT ALLO~ED IN CALC MOOE
~2_8 s02-3 000726 D:F SYE25 YISSING OQ BAD TNTEGFP
0 3~ t0 ~4 004243 ES. D.F NSTMT NO STATEMENT OR CO~MAND RECOGNISED
e 4a 0o ~s 012134 DEF FSCE3 UNQECOGNISED OPERAND
~~4 0~l-6 001152 DEF NOEOF CHARS FOLLO~ StMT LOGICAL END
J-4~ -7 ~04307 DEF syEls MISSIN6 pRlNT DELIMETER
G~4D o~ a 0042s3 DEF UKERR IMPROPER TrplNG AID ASSIGNMFNT
0244 Ctl3~1 003ls5 E10 DEF KERR KEr UNDEFlNED
~24s 00302 ~oooo0 ~ss l
~246 ~0303 ~o~ooo ~ss l
e247 00304 001165 OEF SYE12 51GN GIVEN BUT NO NUM~ER
0248 00305 000511 DEt COMCE~l UISSING COMMA
G249 00306 000s22 EIS DEF FSCEI NO LEFT PAQEN
02s0 00307 000s3s DEF FSCE2 NO RIGHT PAREN
d251 eo310 OlS432 DEF ARREI MlSSING SUBSCRIDT
e2s2 eo311 012452 DEF STRNP STRING NOT PERMITTED
02s3 00:12 0076~0 DEF NOST MISSING OQ BAD STRING
e2s4 ~0.l3 00?665 E20 DEF SYE14 NO CLGSING OuoTE
o255 eo~l4 J12433 DEF syNE4 MlSSING OR BAD FUNCTION l-D-
02s6 eo31s 012515 OEF syNEs MlSslNG PARAMEtER
0 5? ~~~.r ~03s04 D.F NDAT~ M-SSING OR BAD DATA ITEM
C~58 o~- oa-?23 D.F SYNE7 M'.'SING THEN
~ 59 ~ 0-s6s E25 D.F MlsoF M-~ SING OF
0 60 ~D~ Olh461 DF.F SYE:3 M-~slNG VARlABLE
o~61 0~3-l 0 ~464 D_F s~N-s M-~SING FoR vARlAsLE
0-62 to3~: 0 473 DEF SYN-9 MISSING T0
0~63 003-~4 t.2s00 DEF SYE.~ MISSING STEP
o~64 003-5 F.2522 E30 DEF S~N-6 MISSING ASSlGNMENT IN FOR STMT
0~6s 00~6 004273 DEF S~N~2 LET STMt HAS NO STORE
a~6~ o B-7 ~r3531 DEF fMT-R IMpRopER FORMAT SPEC
o~h' 0~ d ~43~ O F srNE3 MJSPLACED COM STATEMENT
~d ~ I ~ o~~ D-: CMEQR IMPROP :Q COM DECLARATION
IJ' E:15 D ~ hERS APQAr ~IOU9Lr D~FINED
~ Op~ D.- ssr~3 PRECIS-ON DOuBLr DEFINED
~ 7 ~ 0 1~ S~ME2 INCO~J5 STENt DlMENsloNs
ERl~ ARRAr HAS UN~NOWN DIMENSIONS
aol~ ~0~? ~ D~F MERs DIMENSIONS TOO LAQGE
7~ ~0 3 ' ~ 44~ E40 ~:F EQ8 OPERAND IS UNDEflNED
~ 7r ~ ~4~ ~o~L2 ~ .F NlNtT APRAY OQ STRING NOT lNlrrALl2ED
~ 7~ D'4 ~ ''4 1 I~:F ER~, SU~ icpl~T EXC E~S BOUNDS
7 ~ 4 ~o- 17 u f SCGRP s-L .Ct ConE LESS T~AN I OR GT~ THAN lS
n4 E45 D~ F TAIEQ S-A EM .NTS US G FORMAT CANNOT USE TAB
-O ~343s ~ F ~EI~R ouT OF D A TA
E50 U:F MEQll LAST STYT IS NOt ~END~
D_oa0 Ei~ S I
. 14 ~ 000 ~SS I
0 15d ~ ~ S ~HqOOO DSS 1
~_ 2~ ()
. .
~O~ 4~
PAGE 0~0~ ~el BASE PAGE ~OUTINES
OE290~
0291~ ~1ULTI EXIT PoINT REtURNS
d292~
e293 ~0356 B60365 RETN3 JSM RET2 RETuRN TO P~3
~294 e03s7 e314~1 RETN2 STA RS~VF RETUQN TO P~2
IE295 0~360 ~21777 LDA RSpTQ
~296 e036l ~00132 ADA M1
a297 oa362 ~70637 IS2 A~I INCREMENT RETURN ADDQESS
~298 eo363 0214al LDA R5A\lE RESTORE (A)
e299 ~0364 170402 RET
e3~0~
~i301 0036s a3l4el QET2 STA QsA\lE
0302 00366 e21777 LDA KSPTR
~303 eo367 000133 ADA M2
e304 eo370 070637 IS~ A.l INCREMENT QETuRN ADDRESS
630s 00371 e214sl LDA RSAVE RESTORE (A)
17a4~2 RET
~307~
~308 BO373 ~24212 IC~'l' LDB ~SLBF GET SINGLE LINE C\lARACTER COUNT
e309 eo374 ~174117 W~3UfF LDA a
i~310 ea375 ~7~76 TcA
~311 ~0376 oal4e0 AOA BAt)DR COMPUTE CHAR COUNT
~312~377 1704d2 ~E~
~313~
~314~ GET A PARAMETER IN ~B) fROt~ P 1
a3ls~
~316 ~04~e ~25777 GPAR~ LOB RSPTR
e3170e4al oa4133 ADB ~2
~318~0402 ~74637 ISZ a I
~31g00403 074537 LDE3 E~ ~ I
~32000404 065375 J~p FIX~4
e32l~ .
0322~ T~ANSfEq FROY AR2 TO ARl
~323~
e324co40s ~24213 XFARl LDB AR1A
S325e04t,6 020214 LDA AR2A
6326004a? 1700~4 XFR
~327~0410 004134 ADB M3 QESTORE ~)
~328eo4 ~ 402 RET
132g~'
,- 0330~ CONVERT AND StORE Ah OPERAND VALUE
~331-
~332- AQ2~ SOURCE
0333~ ~A)~ DESTlNAtlON ~YPE
334 ~Q) ~ DESt~NAtlON ADof~Ess
Q336 90412 125413 RSULT LDB HSTPT~I
0337 OD413 045413 ISZ HSTPT
a338 ~ fl414 121413 LD A HStPr.I
0339 ~0415 045413 JS2 HSTPT
~340 00416 0~0206 StOQE R~Q S IF flIT 4-1
a3342 ~0420 0?~602 SZA 13 NO~ ET PQECISTO~ flITS
3344 0422 35727 SIB ~IN2 SAVE ADD ESS
~1
-- ..... .. _. __.. _____............................................. _ ~ _
.
~V~
.
PAGE 0009 ~01 BASE PAGE ~OUTINES
~34~ e~4~4 ~444 JMP STOR2 YES
~34 ~4lr ~040~ STORI JSM XFARI INTEGER~ SAVE IN ARI
~34B 1104 t~ hO2Z JSM FLTRA~l CONVERT INTEGER
~34~ 0~4 ~ 1 ~443- J~P INTOV OVERFLO~ EXIT
~35~ e '430 3572 SIB MBIN2~l STORE INTEGER
~35 eO43 ~64444 JhP XFAR2 RESTORE AR2
~ 5 0043 60205 INTOV JSM AERRA,I EMIT OVERFLOW
035- 0043; ?7~27 DEC -105 INTEGER OVERFLO~
~3~4 ~04.4 a24a66 LDE INF SPT ~AXIMUM POSITIVE INTEGER
0 5 ~0435 021744 LDA AR~ GET 4ANTISSA SIGN
03 6 00436 07~ SLA STORI~3 POSITIVE?
63e7 004 7 074076 TC8 NO
~3~0 00440 064430 JMP STORI~3
~359 00441 ~604~5 STOR2 JS4 XFARI SAVE IN PRI
0360 00442 ~25727 LD8 MRIN2 RECALL AnDRESS
~361 00443 16a230 JSM FLISA I CONVERT TO SPLIT AND STORE
~3~2-
S363 00444 ~20213 XFAR2 LDA ARIA
~364 00445 824214 L08 AR2A
0365 ~0446 170004 XfQ
4366 00447 170402 RET
C367- STORE AN OPERAND NAhE AND T~PE
0368~
0369- (A)r ASCII CODE FOR LETTER
~37Q- ENTER AT STROP~1 ~ITH PRE AOJUSTED OPEQAND TYPE
~371- EXIT- ~A)- CO4PLEIEU OPER~TOR-OPERAND PAIR
~372-
6373 CO4-O 004151 STROP ADE M32 NUMERICA~LY ADJUST OPERAND TYPE
~374 004 1 000154 ADA M64 GET 5 ~IT CODE FOR OPERAND NAME
OJ75 ~04-2 070544 SAL 5 COMDINE THE
C376 ~04-3 ~74217 IOR a T~O OPERAND PARTS AND THE
0377 ~0454 141706 IOR SBPTR I OPERATOR-OPERAND PAIR
~378-
~379- UPDATE SYNTAX 8UFFER POINTEP AhD CMECK FOR OVERFLOW
~ IBD-- .
0455 131706 STA SaPTR I STORE ~A) PEFORE UPD~TE
0456 045706 S9PUU IS2 58PTR UPDATE POINTER
~.~1 QO457 131?06 StA SBPT5.1 SAVE lA)
a-dL eO460 17a402 R~T
~ FIND ANU STORE ONE-CHARACIF5 OPEPATORS
~~ ~ (A)-SOURCE CHARACTER
J~B- (P)5NUM9EP OF ENTRlEs TO PE SEARCHED
- P~l-STARTING TA8LE ADDRESS-I
~ 0462 ~64464 SrMC2 LD3 2 ALTERNATE ENTRY TO SPARCH TWO SY~P,OL5
C ~3 00463 ~24012 SYMC1 LDS .1 ALTERNATE ENTRr TO SEARCH ONE SYM80L
t39' ~0464 ~3S466 SYMCK STa LOCLI SAVE ~ TO PE SEARcHEn
439~ ~0465 ~31467 STA LOCL2 SAVE SOURCE CH4RACTE5
~39 eO46~ ~60400 JSM GPARM GET STARTING ADDRESS
~9 ~047; ~745770 SYMl SIR ~1 INCRE ENT TA3LE ADDRESS
6400 ~047 ~70342 SAR 8 POSITION It
0401 ~047 011467 CPA LOCL2 MATCH SOUPCE CH~R?
23,
.. ...... .
,
._.,~
~0~6~
PA6E 0010 ~01 BASE PAGE ROUTINES
2402 e~473 064500 J~P SYM2 YES
4403 00474 es5466 DSZ LOCLl NO~ CONTINUE SEARcH?
~404 00475 064467 JMp SYMl YES
O405 GO476 ~21467 LDA LOCL2 NO- RESToRE C~ARACTER
~406 ~0477 17q4B2 RET RETuRN TO P~2- NOT FOUND
~407 e0500 0201?3 SYM2 LOA FOPBS COMPUTE
0408 ~0501 67~076 TCA
~409 e05~2 ~74~17 ~A B OP-CODE
~410 Y0503 ~64543 Jhp STSRH~4 SHIFT-SToRE-RETURN Tn P~3
6411'
e412- CHEC~ FOQ A COM~A
~413~
0414 eOS04 060463 COMCK JSM SYMCl C~ECK FOQ
Q415 e0505 012001 CEf 12001R COMMA-l
a416 ~0506 170402 KEt NOT FOU~n - QETURN TO P~l
~417 0~507 064357 J~p RETN2 FOUND- RETURN TO P~2
4418~
a419 0~510 ~60504 COMcE JSM COMCK C~ECK FOR COMMA
0420 00511 16~2Q6 JSM ERRA~I ERROR If NoT FouND
~421 00512 170402 ~ET
~422~
a423~ C~ECK FOR LEFT PARE~THESIS
~424-
0425 00513 ~60461 LpcK JSM SYMC2 LEFT PARFN
~426 00514 012023 DEF 12023~ ~BRAC-l
~427 e0515 170402 RET NO~ QETURN TO P~l
e428 e~S16 02B126 LDA LPOP YES- RECODE A LEFT
0429 0~5]7 064544 J~p STSQH~5 P~QEN AN~ RETURN ~O P~2
~430~
~431 00520 061055 JSM GNEXT GET NExt CHAR
~432 ~0521 B60513 LPC~E JSM LPCK DEMAND A
~433 80522 160206 FSCEl JSM EQQ~-I LEFT PARE~ OR BRACKET
B434 ~0523 1?04B2 QET
~435-
~430~ C~EC~ FOR RIG~T PAQENTHEsIs
~437
d438 00524 060461 QPCK JSM 5Y~C2 RIGHt P~RE~
~439 605~5 ~12003 ~Ef 1200~ PQAN-l
0440 oa5~6 17~402 ~ET NO- RETURN TO P~l
~441 ~0-~7 020~04 ~CA RP~p YES. RECODE A RIG~T
~442 OO''30 660455 JSM SBRUD-l PAQEN AND INC S~PT~
~443 ~O'': l 061055 J5M GNEXT GET NEXT ChAR
444 OO':2 ~64357 JMp RET~2 RETURN TO P~2
~44~ ~0533,~61055 JSM G~EXT GE~ NEX~ CHAR
J44 60S34 06e524 RPC~E JSM RpcK DEMA~D A QIGHT
44 ~0535 160206 FSCE2 J5M ERR~-I LEET PAREN OQ SRACKET
045~
~451 S~ARC~ TA~LE ~N~ SIORE OP CODE IF FOUND
C453 ~0537 160175 STSQM JS TjR A~I SEARC TABLE
23~3
10~64~
pAGE Oell #~1 ~ASE PAGE RouTINEs .
~458 e0544 131796 stA S~PTQ.I SToQE OP CODE
~459 e0545 C6'3~ ~Mp RET~2 REtURN TO P~2
a460~
~461- SEARCH TABLE AND STORE EXPA~DED OP CODE
~462~
0463 ~546 16~175 STEXP JSM TsRH~I SEARC~ TA~LE
~464 00547 17~402 QET
C465 aO550 070544 SAL 5 ASSE~PLE AND
0466 ~o551 ~4G065 IOR OP~SK STORE
0467 00552 864544 J~p StSRH~5
~468~
0469~ BUMP H-ST~CK POINTER AND CHECK fOQ OVERFLOW
e470~
0471 ~0553 655413 ~STP DSz HSTPT ~I~C PnI~TER
0412 ~0554 ~25413 L~9 HSTPT
~473 40555 074076 TCP
0474 ~0556 005412 ADB LSTPT
0475 ~0557 004017 AD8 .2
~476 00560 e75012 S8M StsQ~l oVERLAP? RETuRN IF NOT
~477 Ga561 160206 MER~ JS~ ERRA.I
0478
~479 00561 FSCE4 EGU ~ER~
a48
0481- STACK l~) ON L-sT~cK A~D C~ECK OVERFLO~
~482~
0483 00562 ~25421 L~B PRADD
~484 00563 445412 SLWST 152 LSTP~ ~NC Po~Tf~
~4aS t0564 135412 SIH LSTPT-I STORE V~LUE
~486 eO565 064554 JhP ~HSTP~l CHECK FOR OVERFLOW
~487~
04B8~ FETC~ TOP OF L-STACK
0489~ ,
~49~ 00566 031421 StA PRA~O
0491 00s67 121412 UNSTK LDA LSTPT.I
0492 ~570 ~55412 DSZ LStPt
0493 ~¢571 170402 RET
e494~
~495~ PREPARE fOR SR4NCH THROUG~ ~8LE
0496~ -
8497 e~S72 0254Zl LD9 PRA~D
~498 ~0573 ~3S472 STB TEMPS
~499 ~0574 12s472 NEXTL L~B TEMPS,I QEAD AND SAvE
~500 ~0575 074073 S~P ~1-C CLEAR SECURlTr ~IT
~501 ~0576 035427 S~B ~LNUM CURRENT LINE ~UMBEQ
02 e0577 e2s472 LD9 TEMPS FlND ADDRESS
es03 e~600 661a07 JSM NEXTA OF NEXT STATE~ENt
t504 S0601 ~35421 STB PRADD SAVE IT
e505 t0602 045472 ISZ TEMPS
dS06' Q0603 125472 LDP TEMRS,l READ OP CoDE
~5~7 ea604 074073 S~P *~l-C
e5~8 ~06~5 645472 ISZ T~MPS
65Q9 00606 074442 NEXTl SHR 10
~510 e0607 674076 TC~ GET NEGATIVE OF OP CODE
~511 00610 635466 S7B LOCLl SAVE -~OP CODE)
eS12 Q0611 121472 LGA TEMPS~I
CS13 00612 ~5~065 AhD OPMSK GET PAGE
231
104~i~4~
PAGE 0gl2 #el BASE PAGE QOUTINES
fS14 00613 ~24130 FPAGE L~9 FROMA GET fIRSt tA8LE ADDkESS
~515 00614 e744s7 CPA B-I IS THIS THE PAGE?
~516 eo61s 170402 ~ET Y~S. ~B) = LAST WORD OF PAfiE
~517 e0616 ~14131 CPB LROMA ALL ROM'S SEARCHED?
~518 00617 064622 JMp FPAGl YES- CHECK BINARY AQEA
f51g f0620 ~04116 ACB ~~P NO. CHECK NEXT ROM
a520 00621 Q64614 J~p FPAGE~l
es21 00622 e2s4f3 FPAGl LOB MAW
C522 f0623 111403 C~A MAW-I IS CODE JN R/W?
23 ~0624 170402 RET YES. (B) = MA~
~524 ao62s 160206 SYSER JSM ERRA-I NO~ THE PRopER BLOC~ IS NOT IN
e52s~
~5
~527~
Q528~ SAVE B~DQ AND SBPTR
~529~
oa626 ~2s400 SAV~P LDB BADOR
~531 00627 ç3s71s S~B SBADR
G532 oa630 G25706 LDB SBPTR
G533 e0631 G35716 StB SSBPT
es34 ~2632 17~4~2 RET
e53s-
0s36~ REStORE BADDP AND S~PT~
e537~
G533 00633 021715 RESBl LDA SBADQ
0s39 ~634 f31400 STA ~ADDR
0540 f~635 021716 LDA 558Pt
e541 C0636 8317~6 SIA sapTR
es42 00637 17f402 RET
as43-
GS44 00640 G60633 RESBP JSH RESBl
4s4s BO641 1217~6 LUA SBPTR.I E~ASE
4546 f0642 f50065 ~o OPMSK OPERAN~
~547 00643 131706 STA SBPTR~I
G548 00644 170402 REt
as4s-
4550~ SCRATCH SYM~OL TA0LE AND I~ITIALI2E StACKS
~551-
ess2 oa64s ~2s4f4 MlNTt LD9 LWAM
~553 00646 ~3s407 STB 5Y~tP
e554 e0647 C35406 StB VALuE
0555 00650 664653 JMp INITS~2
~556~
tS57~ lNItlALlZE STACKS fOR SYNtAx
C55B-
f559 e0651 020662 INITS LDA HFLGA
0560 00652 l70000 CLR CLEA~ HALt AND TRACE FLAGS
0561 eo6s3 025426 LOB PaPTO SCkATcH L-STACK
0562 a0654 ~f4132 AD8 Ml
~56~ ee655 ~35412 st~ LSTPt
~564 f0656 ~25407 INITl LDB SYMTP SCQATCH H-sTAcK
0565 e0657 ~74f70 SIB *~1
es66 00660 f35413 St8 ~STPt
4567 00661 164242 J~p UCOMA.I QESET DATA PoINtERs
~568 eO662 ~al436 HFLGA 8EF HFLGI
~569~
2~
10~
PAGE 0e13 #0l BASE PAGE KOUTINES
es70~ SUBROUTINE To BUILD A PROGR~M INTEGER LESS THAN 10000
as71~
057Z 00663 655490 GSZ ~ADDR ~ACK UP POINTER
~573 00664 024161 LNU~ LD9 MAXSN CALL PGINT WIT~ 000
6574 ~d665 145706 IS2 5BPTR.I F~AG FOR QESEQUENCAeLE INTEGER
C576 SUBQOUTI~E TO BUILD A PRo6RAM INTEGER AND SToQE IT
0577~ I~ THE S-~UFFER A~D FLAG T~E PREvIous WoRD
a57B~ tM~XlMUM ALL0~ABLE I~TEGER)
0579~
SS80 e0666 121706 PGINT LDA S~PTR.I SEt
~581 4~667 ~72053 SAP ~ S "INTEGER
0582 00670 ~00a20 ADA .3 FOLLOWS"
o5B3 eG671 e6~45s JSM SaPUn-l FL~G
~584 a0672 ~35477 STB TEMP4 SAVE UPP~R ~IMIt
~ ~585 eo673 G61055 ~SM GNEXT
0586 e0674 664677 J~P INTCK~1
~587~
858B~ SUB~OUTINE TO BUIL~ AN INTEGER AND STORE IT IN SBUFFER
~589~ (~)=F~RST CHAQACtER
e590~ IMAXIMUM ALLOw~aLE I~TEGEQ)
es9a-
~592 00675 C24161 LOB MAXSN ~UILD A LINE #
t 0593'
~594 Q0576 03S477 INTCK S~ TEMp4 SAVE UPPER LIMIT
~595 e0677 e74742 SBR 16 INITIALIZE
0596 ~0700 035722 STB I~TGR PAQTIAL REsuLT
~597 00701 ~6a750 JSM DIGC~ IST C~AR A DIGIT?
~598 Q07~2 064725 J~p SYE25-l NO
6599 e07~3 060750 INTCl JSH ~lGCK DIGIT?
060~ ~9704 ~64716 J~P INTC2 NO
~601 00705 821722 LDA I~TGR QECALL PARTIAL QESULT
Q602 50706 035722 STB INTGR SA~E LATEST DIGIT
~603 e0707 e24061 LO9 ~10 MULTIPLr PAQTIAL
Q604 ~0710 ~612~1 JSM I~PY RESULT BY 10
Ç605 e0711 ~01722 ADA INtG~ A~D LATEST DIGIT
0606 eO?lZ e7aSS2 SA~ SYE25~1 SKIR IF nVERfLo~
~607 e0713 ~31?22 stA I~TGQ StOQE PARTIAL RESULT
0605 t0714 ~61055 - USM GNEXT GET NEXT CHARACTEQ
~609 00715 ~64703 JMP I~TCl
e610 00716 t25722 INtC2 LOB INTGR SKlP THQoUGH LINK
~611 00717 135706 STB S~PTR~I STORE INTEGER
0612 ~0720 C74~5Q S2~ SyE2s-l IF ZERO
C613 00721 005477 AO~ TEMP4 SUBTRACT LIMIt
~614 ~3722 076153 SBp SYE25-l.S SKIP IF TOO L~QGE
~615 90723 ~25?22 LOB INTGR QEtUR~ WITH
~616 6~?24 964456 J~P SBPUD INtEGEQ IN ~B)S NEXt C~AQ IN ~A)
061B Q0726 16B206 SYE25 JSMZ EFLRAAGI RETURN ON ERROQ FLAG SET?
e619 ~0727 064357 JMP RET~2 YES. QETuQN TO P~2
e621 GET ADDQESSES FOR S~STE~ Co~MAhDs
0623~ RETUR~s tE~P4= ADDRESS OF FIRst LINF~
B624 (~)= A~DRE55 OF LAST LINE~l
23~,
10~i64~
/
PAGE 0014 ~01 P~AsE PAOE ROUTINES
~626 00730 074070 GETAD SIB ~~1 ADD 1 TO SECOND TO
~62? 00731 035477 STB TEMP4 MA~E ADD~Ess INCLUSIVE
~628 0B732 074076 TcB IS fIQST
0629 00733 070037 ADB A GREATER
063~ e0734 C75513 S9P SYE25 THAN SECoND
0631 ~0735 661075 JSM F~DPS FIND ADDRES5 OF flRST
~632 00736 064740 J~P ~2
G633 Q0737 Q64740 J~P ~1
e634~
0635~ C~LL FNnPS AND RETURN TO P~1
0636~
~637 00740 021477 LOA TEMp4
4638 ~0741 63547? 51B TEMP4
; ~639 00742 ~61~75 FND JSM fNDPS
D640 e0743 170402 RET
C641 ~0744 170402 RET
C642 00745 170402 ~ET
~643~
~644~ C~ECK IF CHAQ IN (A~ IS A DIGIT
~645* RETUQN TO P~1 IF ~OT FOUND
~646~ QETURN TO P~2 If FOUNDt ASCII IN (~); DIGIT IN (B)
~647~
6648 00746 a3a071 DLIMT OCT 30071 a-s
0649 00747 040532 LLIMt OCT 40532 A-Z
a650 e075Q 824746 DIGCK LDJ DLI~T LoDA LIMITS FOR DIGITS
0651 eO751 S64753 JMp LIMIT CMECK LIMITS AND RETQUN
~652
C653~ CHECK IF CHAR l~ (A) IS A LETTE~
C654- RETURN TO P-1 IF hOT FOUNn
0655* RETUR~ TOP~2 IF FOUND
0656~
~657 ~0752 e24747 LETC~ LDB LLIMT LOAD LIMITS FOR LETTFR
0658~ ENtEQ INtO LIMIt DIREcTLy
~659~
~660 ~C753 ~35466 LJMIT ST~ LOCL1 SAVE LIMIT5
~661 e0tS4 ~74346 ~R a
0662 0a755 074342 5~R 8 GET UPPER LIMITS
~663 ~756 ~74056 C~
~664 00757 070037 AO~ A CODE EXCEEDS
~665 ~0760 B75253 SBP FND~3 UPPER LIMIT?
C666 0076l 625466 LOB LOCL1 NO
~667 00762 074342 S~R 6 GET LOWER LlMlT
~~66B e0763 Ct4076 TCL
0669 ~0764 070037 ADB A CODE LESS THAN
~670 00765 e75012 S~M FhD~3 LO~EQ LIMIT
~671 e0766 67a137 LD~ A NO- CODE IN LIMITS
~672 ~0r67 Oa4153 AOp M48 YES. RETURN TO P~2
4673 00770 e64357 JMp RETN2
~674~
C675~ GET OPERAND
~676*
0677 00771 121472 GTOPP LOA TE~PS I
~678 ~0772 ~50070 AhD OPD
0679 00773 170402 RET
~680~*~
a6~l*
23 'jt
10~64 ~
PAGE Oe15 #01 84SE PAGE ~OUtINES
06~2 907?4 O00000 6SS 10
0683
~6~4-~
~6~5
~686
~687~
9688~ CoMPUtE ADDRESS OF NExT LINE
68g~
~690 ~1a06 ~35466 STfl LOCL1
0691 a1007 074117 NEXTA LOA B SAVE ADDRESS Of CURR~NT LINE
~692 e1~1Q 670070 SIA ~1 GET
C693 41011 070517 LDA A-I ST~TEMENT
0694 31012 05a104 AhD B177 LENGTH
0695 01013 670037 ADa A CO~PUTE A~DREss OF ~EXT LI~E
~696 ~1014 1704a2 RET
~6~7~
0698-
a699- T~IS SU9ROUtINE SloRES A CHARAcTER
0700~ IN A 9UFEER. THt BuFFEQ POINTEQ
0701- IS USCD TO INDICAlE WMF-RE IN THE
~702~ BUFFEQ THE CHARACTEP IS TC 9E STORED
e703- THE R,UFFER IS UNDIST(JR9ED EXCEPT
t704~ WHERF T~E POINTER PO1NTS.
~705-
~706~
~707~ E~tRY CONDItIONS:
o?0a- t~)=BU~FE~ POINTLR POI~TER
o709~ (Al=CHARACTE~ tO B~F STOR~6
e710~ RIGHT JusllFIED WITH LEADIN5 ~S
.~711
e7l2~
0713-
~714-
0715 e1015 e20041 06LNK LDA ~32
0716 ~1016 ~2411Q O~tXT LDP ~A~qP OPTION~L ENTQr POINT
¢717 C1017 031467 OUTCR 514 LOCL2 S~VE CHAR~cTEQ TO BE STOREn
t718 el02a ~74517 LDA ~.1 FETCH BIJFFER PoINTEQ
0719 Q1021 011623 CPA PEND ~T 1~0 F~n?
~720 R1022 170402 REt YES
e721 01023 074637 IS2 ~-I RU~P ~UFFER PoINTER
C722 01024 070137 ~6 A
~723 21025 ~74006 R~R 1
~724 21026 ~70002 SAR 1
C725 01027 07aS17 LDA A-1 FETC~ flUF'ER ~ORD
~726 01~0 ~74112 5~
e727 01031 079346 ~AR 8 SET A TO STORE IN LEFT HALF
~728 ~1032 050157 A~D ~256
C729 e1033 ~41467 iOR LOCL2
a730 a1~34 074132 SeM ~2-C
0731 01~135 070346 f~AR ~ RotATE IF FLAG I~AS SEt
d732 1036 ~174557 S-IA ~- I STOI~E NFW BUFFER WORD
~1735-
0736~ T~t 15 SUF~ROUT I NE F~ tCHF S
~737- A CH~RACTER FQ0~4 ~ RUFFER
Z30
i4~
PAGE 0~16 #~1 ~ASE PAGE ROUTINES
873
~73g~
0~40~ ENTRY CONDItION5
0741- t~ UFFER P0INTEQ PnINTEQ
0742
e743~
~744~ EXIt CONDITIONS:
~745~ (A)=R-BIT CHARACTER
G746~ tPJ)=BUfFEQ POINTER POTNTER
~747
0748
~749~
G750 el040 G24110 LD~ BADRP GET NEX~ CHAR FROM I/O ~UFFER
~751 P1041 Q35466 GETCH STB LOCLI SAVE POI~TEQ POINTER
~752 0l~42 ~74517 LDA B-I FETCH BIJFFER POINTEQ
~753 e 1043 otRoa2 SAR 1
~754 01044 G70517 LOh A.I FETC~ TWO CHARACTERS
a7ss e 1045 074537 LOB B I
~756 ~lt~46 074111 SLB GEt1 TOP ~ALF WORD?
4757 01047 ~70346 RAR 8 NO MovE QIGHT HLAF Tn LEFT
0758 el~50 ~7a342 GET1 SAR 8 TA~E TOP ~ALF
0759 e1051 145466 ISZ LOCLI.I BUMP PoINTER
~76~ 01052 1?0402 RET YES
e76l~
C762 OlZ53 ~24111 GTMP LDB TMPA
d763 eleS4 a65041 JMp GETCH
~764
~765
0766 ~1055 ~24110 G~EXT LDB BA~RP GET CHAR. AND CONVER~
0767 Q1~56 061362 JSM GTCON
G768 01057 011707 CPA ~LANK BLANK?
0769 01060 065055 JMp g-3 YES. IGNORE IT
~770 elB61 1704~2 RET rEs~ RETUPN TO P-l -
~771~
~772~ GET CHAQACTER ROUTI~ES
~773~
~'774 ela62 020233 GFRST LDA S3UFA
G775 ~1063 031706 STA jBPTR INITIALIZF SYNT~X 9UFFER POINTEQ
~776 el~64 G~211 L~A ~BUFA SET BUFFER POINTER ~O STAQT
~777 0l06s 031400 STA ~AD~R OF I~O BUFFER
G77B ~la66 061B55 GETSK JSM GNEXt GET A CHAQACTER
~t79 01067 Q10031 CPA EOL END OF L~NE?
~780 ~1070 170402 RET rES- RETU~N TO P-l
78i 01071 Gh4357 JMp RET~2 NO- RETUQN TO P~2
7B3 FTNO SEQUENTIAL POSItION OF LINE ~ GIVEN IN tA)
~7B5- RETUQN P-l :BErOND ~ND OF PROGRA~
B7B6~ P-2:eETWEEh LINES
G787~ P~3:FOUND
77B8 TEMP3=tB)=~DDRESS OF LINE OR ~EXT LINE IN SFQUENCE
LSTLN=LINE NUMBEQ OF PQEVJOUS LINE
07~ 72 12a233 LOA SBUFA~I GET SYNTAX SEOUENCE ~
B793 81074 031427 SlA CLINE SAVE FOR LIsT ROUTINE
23.)
- 10~6~4~
PAGE 0017 ~01 BASE PAGE ~cuTIN~s
~794 e1075 e31476 FNDPS S~A TEMp3 SAVE SEQUENCE
~795 e 1016 ~25424 LCB PBUFF
~796 G1a7t 015423 FNDP1 CP9 PBPTQ ENO OF PROGR4M?
~797 O1100 665117 J~P FNDP4 YES- RETURN TO P~1
t798 e1101 074517 LDA B-I GET CURR~NT #
~799 e1102 67G073 SAP ~1.C CLEAR SEClJRE BIT
~800 S1103 07aS10 52A F~DP2 EXIT P~3 IF TypING ATD KEY
~801 ~1104 07fl~76 TCA SUBTRACT CuRRENT ~ FQOM
~802 O1105 e~01476 ADA TEMP3 DESIRED Y
0803 01106 070412 5AM FhDP3 CURRENT>oESIRED? IF YES. P~2
08a4 01107 a70330 SIA FNDP2 EOUAL? TF YES~P-3 (a)=1
~805 O1110 074517 LDA B.I SAVE
~806' ~1111 ~70a73 SPp ~1.C
Q807 Q1112 631720 STA LASTN CURRENT LINE
~808 ~1113 C610e7 JSM ~EXTA CO~PlJTE AD~REss OF ~EXT LINE
~8~9 e1114 C65077 J~p FNDP1
~810 elll5 ~6e36s FN~P2 JSM RET2 P~3
~811 el116 ~693fis FN~P3 JSM RET2 P~2
~812 el117 035476 FNDP4 SIB TE~P3 P~1~ SAVE STATE~ENT ~DDRESS
~813 ~112~ 1704a2 KET
Q814~
0815~ MovE WOQDS TO HIGHER MFMORr
esl6-
~817- TEMP2=LASt ~ORD~1 OF SOURCE
~818- TEMP3=FIRST WOQD OF SOURCE
~819- T'EMP4-LAST WORD-1 OF DESTTNATIO~
~820-
~821 01121 ~25475 ~VTOH LCB TE~P2 FETCH SOU~CE ADD~ESS
0822 81122 015476 ~ C~B TEMP3 ALL RELOCATION DONE?
ff823 01123 170402 REt
~824 ~1124 ¢55477 ~52 TEMP4, RACK UP DESTI~ATION POINTEQ
e825 e1125 004132 4DB M1 RACK UP SOuRcE POINTFQ
~826 e1126 074517 LOA B-I ~OVE
Q827 e112? 131477 STA tEMP~.T WORD
~828 ~1130 ~65122 JMp MVtOM~1
B829-
as3~ fETC~ ~N TNTE~EQ ~LLOWING 7FRO
es3l~
0832 e1131 620132 PGIN0 LOA Ml FLAG tO ~ETURN
~833 P1132 a31724 S~A GFL4r~ ON OVERFLOW o~ 0
~834 ~1133 060666 JSM PGINT FETCH INTEG~ER
~835 e1134 170402 RET WITHIN LIMITs
~836 ~1135 445706 ISZ S9PtQ OVERfLO~ oR ZEQo: UP~AtE POTNtER
~837 ~1136 075710 SZ~ ~-2 SKIP If ZERO
088339~ e 1 137 064726 J~P SYE2S ~USt BE ovERFL
~840~ ~ETC~ A LETTER
0841~ EXIT:D~I IF NExT CHAR IS NoT ~ LETtERsCHAQ IN (A)
842 P~2 IF L~TTE~: LETTEQ IN TEMP1: ~ExT CHAR IN ~A) AN~ TE~P2
~B44 O114~ 061ass LTQ JSM GNEXT
e~4s ~1141 060752 JSM LEtCK LEttEQ?
4846 e1142 17~4O2 STA TEMPI NO- REtURN TO P~1
e~49 t1145 031475 S~A TEMP2 SAVE SECnND CHAQACTEQ
2~
10~;69~
PAGE 0el9 ~Pl BASE PAGE QOUTINES
01146 6643s7 J~p RETN~ RETUQN To P~2
~851~
essz~ E~D AND RESTORE STA~EMENT SYNTAX
OB53~
~8s4 01147 86l0ss ENDS JSM GNEXT CHECY FOP ADDITIoN~L CHARACTERS
~855 6lls0 945706 ISZ SBPTQ
ess6 ellsl ~6ll53 EOST JSM EOLCK
~8s7 ~1152 168206 NOEOF JSM ERRA~I
~8s8~
osss~ SUBQOUTINE TO CHECK FOR EOL
es60~
~861 alls3 G10031 EOLCK C~A EOL EOL?
~862 ~1154 1642e3 J~p ACTS~-I YES~ JUMP DIREcTLy To ACTST
~B63 ~llSS I 704a2 QET
~864~
C865~ INPUT A CONSTANT
~866~
0867 ~1156 S61166 CONST J5~ GSIGN GET SIGN
ea6~ ~1157 G~5721 StB SIGN STORE IT
es69 el 16Q 160243 JSM NU~CA~I FETC~ UNSIGNED Nu~BEQ
0870 ell6l o6slh3 JMp CONS3 NONE FOUND
~871 ell62 0643s7 JMp RETN2 FQU~D. RETURN TO P~2
z872 ~1163 ~2s72l CONS3 LDB SIGN
~873 C1164 ~746l0 SZB GSIGQ SKIP IF NO SIGN GIVEN
~874 01165 16a206 SYE12 05M ERRA-I SIGN GIVFN WITMouT NU~BER
as7s-
ds76~ GET THE SIGN OF A NUM9ER
~8?7-
~878 ell66 ~61055 GSIGN JSM GNEXT
~879 ell67 a74742 S~R 16
es80 01170 ~10047 CPA ~43 "~"?
esel ~1171 874236 SI9 GSIGl~l YES
~882 ell72 OlO050 C~A ~4s ~-"?
ess3 ell73 C24132 LD8 Ml YES
~B84 01174 074210 GSIGl SZB GSIGR SKIP IF Nn SIGN GIVEN
C885 e117s G35470 StB L2Tl SAVE SIGN
~ C886. ell7~ 061055 JS~ GNEXT GET CHARACTER FOLLOWI~G SlfiN
eBs7 01177 C25470 LCB L2Tl RECALL SIGN
essB ~120~ 1704~2 GSI6R ~ET
~99-
~890~ ~ULTIPLr 2 INTEGFRS rN ~A) ~ND ~) AND RFTURN
8892 QESULT IN ~A)S IF PQODUCT ~ 32K~ 0
0893 el201 031466 IMPY StA MC~ND SAVE MULTIPLIC~ND
~~94 ~1202 670742 SGQ 16 INITIALIZE PRoDucT
6~9s ~1203 074151 zMprl SLS *~3 SKIP IF MULTIPLtEQ 91T IS ZEQ
as96 G1204 00l466 AOA ~CAND ~Dn MULTIPLICANn TO PRODUCT
0~97 ~1205 071552 S~M IMPYR SKIP IF RFsuLT >32K
y900 e 12~17 ~ 75450 5~R I S4VF PRonuCT
~901 ~1211 ~214h6 LDA MC4Nn ~ULTIPLY
0902 01212 001466 ADA MCAND MULTIPLTCA~D
B904 1213 e71252 S~A MC4ND SKIP IF RESULT ~32K
~905 al215 ~21467 LDA PRoD PEC4LL PRODUCT
Z~l l
10'~
PAGE 0019 #01 B~SE PAGE ~OUTINES
eg06 el216 0652~3 J~P IMPYl
0907 el200 IMPYR EQU GSIGR
~9a8~
~90g~ EVALUATE FORMULA 4ND FETC~ ~ESULT TO AR2
0910~
~911 01217 16~201 FETCH JSM FOR~A-I EVALU~TE F~RMULA
~912 01220 160200 JSM OPCHA-I fiET ADDQFSS OF RESULT
e913 ~1221 ~45413 ISZ HSTPT
~914 el222 045413 ISZ ~STPT REMOVE FROM STAcK
~91S el223 074117 LGA a
0916 01224 064445 J~P XFbR2~1 TRANSFER TO AQ~
~917~
~91B~ SUOROUTINE TO LEAVE KEY DEFINITION MODE
e9ls~
~920 el225 02142Z LDEF LDA ~KPTP
~921 el226 070410 SZA *~B
eg22 el22~ 0214~5 ~OA P~UFO
4923 elZ30 031424 SlA PBUFF RESTORE P~UFF .
~924 el231 021426 LDA R~P~O
e925 C1232 ~31423 SIA P~pTR ~ESTOQE PBPTR
e926 el233 07e742 S~R 16
ag27 01234 e31422 SIA U~PTR CLEAR USEQ KEY FLAG
~92a ~1235 C31432 SIA ORosT CLEAR nATA REQUEST FLAG
~929 01236 170402 RET
~930
~531~
~932*****~*~**~**~**~ *
~933'
~934~ MATH ROUTINES
~35
S936~
~937~ STnRE ROUTINES
es3s~
0939 ~-1237 E74117 STAR2 LDA B bDD THE FXPoNENT OF
a940 01240 e01744 ADA ARlF AR1 AND THE ~ REGI5T~R,
e941 C1241 C5el63 A~D ZAP CLEAR OO~ ~ITS 1-7 A~D
~942 ~1242 e31754 STA ARZE STORE IN AR2
~943~
0944 el243 874040 A~R 2 OFFSET THE TWO ABOVE
0945 ~1244 ~21744 LOA ARlE OuANTITIEs ANn RE-~DD
~946 e 1245 070040 AAR Z TO CHECK FOR A
o947 el246 074017 ADA B MAXIMUM E~PONENT
a94~ ~1247 e7~137 LD8 A SAVE THE SIGN OF THE EXPONENT
~949 el250 070113 SPP ~2 IF IT IS POSITIVE
0950 21251 070076 TcA COMPLEMENT IT
~951 Q1252 000164 AOA MASKl AOD A POsITIVE 10~ To IT
~952 el253 ~70312 5A~ OF SKIP IF AN OVERFLOW ~AS nCCURED
~953~
~ ~954 21254 025755 ZONK LDB AR2E ~1
e9s5 01255 076150 R20 ZONK 1
~956 01256 ~20214 CLAQ2 LDA AR2A CLEAR AR2
~957 ~1257 1700a~ CLR
~958 el260 17~40Z ~O~Kl ~ET
0959
g6
~961 ~1261 ~21754 OF t OA AR2E OTHERWISE SET UP BI~S 0 ANn 15 OF
24 ,j
"~
~r - . . . _
10~
PAGE Oe20 ~01 ~ASE PAGE ~OUTINES
0962 Z1262 070111 SLA ~2 FOR M~X OR MIN ANSWER
0963 91263 ~76e51 SL~ ~l S AND ITS SIGN
~964-
~565 01264 074213 S~P OVF~
~966-
d967 ~1265 160205 UNFW JSM AERRA,I
e96B e 1266 177633 DEC -101
~969 01267 ~65256 J~P CLAR2
es70-
0971 el270 G61274 OVFw JSM STM~X
0972 01271 1602fl5 JSM AEQQA,I
~973 01272 177634 DEC -100
~974 01273 1704Q2 RET
a975-
Og76 0l274 061256 STMAX JS~ CLAQ2
0977 el275 074352 S~u .OVER
9978-
~979 el276 ~45757 ISZ AR2E~3
~980 el277 17040B CMY
~981 Q1300 020165 LDA MASKS
~982 el301 031754 S~A AR2E
09R3~ 01302 F74111 SLP ~ 2
~984 e 1303 045754 ISZ AR2E
~985 01304 170402 .OVER REt
~986~
s987 01305 47Q742 ROUND S~R 16 CLEAR THE A REGIsTER AND
09~S el3~6 174470 URy PERFOQM A RIGHT SHTFT ~ TI~ES
~9~9 el307 000136 ADA ~5 IF THE LAsT SHIFT~D
~90 01310 070175 SEC ~3 C OUT DIGIT IS =>5 I~NCQEMENT THE
e991 01311 t20214 LDA AR2a
~932 01312 17P540 MDI MANTISS~
~993 01313 ltO4Q2 ~ET THEN RETURN
~994~
a995-
~996~ **~**~*~ *
~997~
~99~-
~999~
1000 ~1314 ltl400 ODGIT MLS
1001 ~1315 000052 ADA .4~
1002 ~1316 065016 J~P ONEXT
1003-
1004 el317 a7as37 SGNS LOB A I GET EXPO~ENT WORD
~0~5 0132a ~700~0 SIA ~~1
,1006 ~1321 a7~51? LDA A I GET MANTISSA
1007 01322 070210 SZA ~4 C~ECK IF ~ANTISSA WAS ZERO
100S el~23 02P012 LOA .1
1009 01324 0?4111 SLB ~2 SKIp IF SIGN IS 0
1010 el325 e2P132 LDA Ml oTHERWIsE SET A - -1
1011 ~1326 a7~137 IDB A TRANSFER A INTO B
1012 8l327 170402 ~ET
1013~
1014 ~1330 031466 .NPWR STA LOCLl
1015 el331 e21450 LDA PMoDE
1016 el332 031702 S~A NpRIN
1017 81333 021466 LOA LOCLl
24'~
:
lOl~tJ~4~
PAGF 0e21 ~01 ~A5E PAGE RouTINEs
1018 el334 164167 JhP WRITE.I
la20 el335 3357OZ NPWRT Sl~ ~PRI~
1021 51336 164167 J~p ~RITE.I
1023 01337 d35701 NDWQT Sla NDISP
1024 01340 164167 Jhp ~ITE.I
1025~
1026 01341 160170 JSM CLERA.I
1027 ~1342 021450 CRLF LCA ~MoDE
1028 01343 ~72450 R2A CRl
1029 91344 42P031 CRLFl L~A CRTN
1030 el345 ~61353 JS~ TTY OUTPUT CRTN
1031 Q1346 07a74Z S~R 16
1032 01347 160261 JSM IOSTA.I STOP KEY?
1033 el359 e2a040 LD~ ~31 YES- SET CPLF SUPRESSE~ FLAG
IQ34 el351 0316Z2 S~A TERM
1035 el352 020061 L~A LNFD OUTPUT LINE FEEn
1036~
1037~ GENERAL DRTVER
1~38~
1039 el353 16~261 TTY JSM IOSTA,I STOP KEY?
1040 el354 17fl4~2 CRl RET YLS
la41 91355 ~41447 IOR SLCO~
1042 01356 172741 SIF 1
1043 ~1357 172141 OTA 1
1044 91360 1736~1 S~C l~C
lU45 ~1361 170402 RET
1~46~ .
104?~ CONVERT F~OM LOWER CASE
104B~
1049 ~1362 051041 GTCON JSM GETcH
1050 el363 070137 LCB A
1~51 el364 e5~1~3 a~D ~140
1052 al365 el01e3 C~A ~140
1053 01366 ~04151 A~B M32
1054 ~1367 t~74117 LOA
lQ55 9137~ 17e4a2 RET
1056~
1057~ TEMPl IS POINTI~G AT AD~RESS oF THE VARIABLF JN SYMOBL TABLE
lU58* ON RETURN ~A) = TYPE CODE
1059* tB) = ADDRESS
1060~
1061 al371 C25474 FIX L~B TEMPl
lU62 ~1372 074517 LDA B-I
1063 el373 ~5~040 A~D B37
1064 01374 004132 ADB Ml
1065 ~1375 ~74537 LOB B-l
1066 el376 170402 RET
1057~
1068~*~**~****~***~*s****~**a~sss***~s**~**~****
1 ~6g~
1070 el377 60a000 BSS 1 CHEC~S(JM WoRD FOR 4DD.~S 100tA TO 1377
1071~
1072~'**~**~*~*g****~************************,,.*
1073~
2'1 '
.
10~6ti~/~
PAGE OQ22 ~01 9830--BASE PAGE REA~-~RITE ~EMORr
1075 el400 ~ O~G 1400~
1076 Q1400 000000 BADDR ass 1 0URRENT CHAR PoINTER
1077 al401 02Q0a0 RSAVE BS5 1 SAVE (~) IN REtN2
la7B el402 G~a000 OTPTR ~SS 1 REF~ES~ PoINTFR
1079 01403 ~000a~ ~AW BSS 1 LAsT WORD Of R/W MEM
1080 el404 o00~e0 L~AM BSS 1 LAST WORD AVAILABLE FOR ~SFR
1081 ~1405 Gaa000 FWUP BSS 1 FIRST WOQD OF COMMO~ OR M~INLINE
1082 C1406 Q000e0 VALUE BSS 1 FIRST WO~D -1 OF VALlJE TA~LE
1083 01407 O00000 SYMTP BSS 1 FIRST WOR~ -1 oF sr~oL TABLE
1084 ~1410 00a000 LSTA~ BSS 1 FIRST ~OQD OF OpERAToR STACK
10g5 01411 4a0000 TSTPT BSS 1 TEMPO~ARY STACK PoINTER
1096' 81412 e00000 LSTPT BSS 1 OPERATOR STACK PoINTER
1087 el413 G000a0 HSTPT 855 1 OPEQAND STACK POINTER
1~8B ~1414 e0Q0Q0 DSTPT ~SS 1 ~ATA STATE~ENT
1089 tl415 ~a0~00 NXTDT BSS 1 POI~TERS
1090 el416 ~000~0 M0DE ~SS 1 PROGRAM=0: KEYBOARD=I
1091 ~1417 9C0~00 PAR~A ~SS 1 P~RAMETEU ADDRESS
1092 el420 80 W90 PARMN BSS 1 PAQAMETER NAME
10~3 01421 aoa0D0 PRAD~ ~SS 1 LAST WORD~l OF CURRENT ST~T
1094 01422 00~0fl0 UKPTR BSS 1 USER KEY POINTER
1095 Q1423 O000~0 PBPTR BSS 1 LAST WORD OF CuRRENT PROGQAM
1096 01424 o0aa00 PBUFf BSS 1 FIRST wORn OF CURRENT PROGRAM
1097 01425 ~000~0 PBUfO BSS 1 FIRST ~ORD OF ~AINLINE
la~B el426 O00aB0 PBPTO BSS 1 LAST WORD~l OF MAINLINE
10g9 01427 ~a0000 .LNUM BSS 1 CURRENT LINE NuMBER
1100 01430 ~a000 LNI~C BSS 1 auTO LINE I~CQE~ENT
2101 01431 O0Q000 CLINE BSS 1 CURQENT LINE FoR LIST
ilO2 Q1432 000000 DRQST BS5 1 INP~T ST~T FLAG
1103 01433 o0P0e0 TFLAG Bss 1 PTAPE FLAG
1104 el434 oa0~00 UNITS BSS 1 TRIG UNITs
1105 el435 0~40~0 SEC BSS 1 SECURE PQOGRA~ FLAG
L106 01436 a0G0P0 HFLGI BSS 2 STOP ADDREssEs
1107 el440 c00~a0 TFLfil BSS 2 TQACE LI~IT AnnREssEs
1108 01442 ~O0000 STPFL ~SS 1 ~TnP fLAG
1109 el443 G00Q00 KEYFG BSS 1 ~FYBOARD FLAG
1110 ~1444 ~00000 SAVEA BS5 1 INTERQupT
1 l l l e 1445 ~300Q0 SAVE~ ~SS 1
1112 ~1446 O00000 ~DRSS 8SS 1 TEMPOQARIES
1113 ~1447 eoQ00o SLCOD ~SS 1 SELECT CODE
1114 Q1450 a0a0~0 PMODE BSS 1 CQINT-ALL FLAG
1115 01451 c000a0 CTYPE ~SS 1 KErBOAQD -
1116 el452 0000~B CPLAC BSS 1 FORMAT FLAGS
1117 01453 ca0000 PQFLG ~SS 1 PRINT~DISP FLAG
1118 el454 800000 RCOUt BSS 1 FORMAt
1119 01455 P0Q000 FORMT ~SS 1
1120 ~1456 ~0QO00 FOR~S BSS 1
1121 C1457 OQ0000 FOQME BSS 1 5T~tEMENT FLAGS
Ll22 01460 00~000 FTMPl ass 1 CURQENT OPER~TOP CODE
1123 01461 O00~00 FTMP2 HSS 1 CUQRENT OPERATOR PREcEDEN~E
1124 01462 a000ae REEDL ~SS 1 KEYPOARD DRIvER LINK
1125 0l463 a00000 INTEL hSS 1 INTEQRUPT LINK
1126 01464 P0a~a0 ~ss 2 UNUSED
1128~ TEMPORAQIES
1129~
1130 01466 ~0~0~0 LOCLI ~S5 1
2 ~
10 ~t;6~4
PAGE 002~ *01 9830--B~SE PAGE PEAO-WRITE ME~ORY
1131 51467 eaP~0~ LOCL2 ~SS 1
1132 D1470 ~00~g0 L2TI BSS 1
1133 01471 ~0e~0Y L2T2 ~SS 1
11~4 01472 ~00a~0 TE~PS ass 1
1135 el473 0~00C0 TEMP BSS 1
1136 el473 M~OXl EQU TEMP
~137 el474 000000 TEMPl ~SS 1
1138 ~1475 ~00000 TE~P2 ~SS 1
1139 el476 a00000 TEMP3 ~SS 1
1140 ~1477 00~0~0 TEMP4 BSS 1
1141~
1142~ BUFfERS
1143~
1144 O1500 ~00~Q0 IO~UF ffSS 41 INPUT AN~ REcALL BUFfEQ
1145 elS51 O00000 PPUFF ~SS 41 SI~GLE LINE REFREsH RUfFER
1146~
1147~ PRINT ROUTINE FLAGS
1148-
~149 el622 000000 TERM ~SS 1 CRLF FLA6
1150 B1623 O0Q000 PEND BS5 1 RUFFEQ OvERFLOw FLAG
llSl 01624 000000 PPFF qSS 1 9UFFER PolNTER OR TA~ ELAG
1152 Q1625 000090 FIQST 8SS 1
1153 el62~ a0~a~ ~SS 2 U~USED
1154~
1155~ ~T~ TEMPORARIES
~156~
1157 01630 ~000~Q TQE0E 8SS 4
1158 gl634 e00000 QSLTE ass 4
115g~
1160~ STATEMENT SYNTAX AND E~ECUTION TE~POQARIES
1161~
1162 el64~ ~0~0~e ST ~SS 32
1163~
1164~ SYSTEM Sy~tAx ~ND EXECUTION TEMPORARIES
1165~
1166 01700 ~00000 ~55 1 5~VED FOR PRocEssoR
1167 017~1 fla~e NOJSP ~SS 1
1168 el702 B000~ NPRIN ~SS 1
1169 91703 000000 PLACE ~SS 1
1170 el704 0000e0 ~IOTH HSS 1
1171 P1705 000~0~ FLOAT ~SS 1
11~2 ~17~6 a0a00~ S~PTR ~55 1
1173 ~170? ~0~ee0 ~LANK RSS 1
1174 0171~ ~00e00 MSFLG BSS 1
1175 ~1711 000000 DFLAG ~SS 1
~176 e 1712 00~000 PFLAG ~SS 1
1177 el713 QO00Q0 UFLAG ~SS 1
1178 P1714 ~000~ SfLAG ~SS 1
11?9 01715 e0~a00 S~DR HSS 1
lla~ ~1715 ~0a090 SSBPT ~SS 1
1191 0171~ e00000 NUM t~SS 1
11~2 01717 OPTYP FQU NUM
1183 ~1720 ~a009 LASTN flSS 1
1184 01721 ~QO000 SIGN BSS 1
lleS el721 MAXIN ECU SIGN
1186 01722 o000a0 EXP BS5 1
24a;
lO'~b~
PAGE OQ24 ~01 9R30--BASE PAGE QE~-wRlTE ME~OQY
1187 01722 INtG~ EOU EXP
1188 C1723 0000~0 ARYAD BSS 1
1189 ~1724 O00000 GFLAG BSS 1
1190 01725 ~00000 NXTST YSS 1
1191 ~1726 ~00000 ~INl BSS 1
1192 el727 00009e MBIN2 BS5 1
1193-
1194- A~ITHMETIC QEGISTE~S AND QETUQN STACK
1195
1196 el740 0~G 1740
1197 el740 oa0000 XC ~SS 4
1198 ~1744 ~00000 ARl BSS 4
1199 0175~ o~a0 YC ~SS 4
1200 ~1754 e00000 AR2 BSS 4
1201 el760 ~000e0 RSTAK BSS 11 RETURN STACK
1202 el773 ~000Q0 RES BSS 4 RESULt REGISTER
1203 ~1777 8000e0 RSPTR BSS 1 REtURN ST~CK PoINTER
~ ~r~
~ --
10'~
PAGE 0a25 #01 EQUATES
1205 el466 ~CAND EQU LOCLl
1206 e1467 PROD EGU LOCL2
1207 ~1744 ARlE ECU ARl
129~ ~1754 AQ2E FQU AR2
1209 01730 CO~L ECU ~BIN2~1
1210 el731 TYPE EOU M~IN2~2
1211 C1640 TEPPP ~au St
1212 01641 SPRDD EGU ST~l
1213 01642 SAVE EQU S~2
1214 el453 AQW EOU PRFLG
1215 tl740 tMP EQU ~C
1216 ~1741 TMPl EQU XC~l
1217 01742 tMP2 EQU XC~2
1218 0174~ tMP3 EGU XC~3
1219 0175Q tMP4 EQU YC
1220 0l75l t~P5 EGU YC~l
1221 el706 TMP5 ~OU S~PTP
1222 el752 TMP6A EQU YC-2
1223 01460 TMP7 EGU FTMPl
1224 21474 tMP9 EGU TEMPS~2
1225 01475 TMPl~ EQU TEMP5~3
1226 el476 TMPll EQU TE~PS~4
1227 el477 TMP12 EQU TEMps~s
1228 Q1461 TMP13 EQU FTMP2
1229 91473 CCNT EGU TEM
1230 ~1704 ~KPt~ EQU ~IDT~
1231 Ql?41 R EQU TMPl
1232 e 1742 L ECU TMP2
1233 01751 DIGIt ECU T~P5
1234 01743 INDEX EGU T~P3
1235 ~1750 R~ASE EGU TMP4
1236
1237~ '
12~ e004~ PLUS ECU ~43
1239 e0aS0 MINUS EOU ~45
1240 00051 POINT EQU ~46
1241 ea052 ~6~ EOU .4A
1242 e0053 COLON EQU .58
1243 e0a77 DOLA~ EOU 344
1244 00116 ~2~ EOU QToP
1245 eo004 XECA ECU ~10K
2'~
1046644
PAGE 0~26 ~1 KEY~OARD EN~RY AND nISPLAY
1248~
1249~ REED SU~R0UTINE
1250~
1251~ ENtRY CONDItIONS: NONE
1252-
1253- EXIT CONDITIONS:
1254-
1255- AN INPUT RECORD IS IN THE I~O
1256~ BUFFEQ. tllE LAST CHAR IS AN EOL-
1257-
1258~
1259~ IF A ~ELETE LINE IS HIT
1260- PETUQ~ TO P~l- oT~EQwIsE
1261- RETUR~ tO P~2.
1262-
1263~
1264 02000 ORG 2000~7
1265-
1266-
1267 e2000 ~20236 REEDl LDA SLEND
1268 52001 031623 StA PE~D
1269 g2002 620062 LOA FLC-7R7T
1270 02003 e31416 S~A MO~E SET TO PQOGRAM SYNTAX
1271 02004 ~21433 LOA TFLAG
1272 a2005 ~7Q110 52A ~2 PTADE COMUAND?
1273 02006 96~6 7 Jhp PREED
1274 B2007 031473 S~A CCNT
lZ75 ~2910 93l704 SIA ~7KPTR
1276- G~T fIRST KEY
lZ77 02011 ~63046 REEDE JsM CALLK GE~ FIR5T KEY
l278~2Q1 2 966~11 J~P *-1
127902013 013127 CPA DELIN
12a0e2014 P6f7223 J~P DELl
12~71e201s g25430 LDB LN I NC
12B2e20l6 ole074 CPA B22 F7'ACt~SPACE?
lZB3C2017 a74112 S~M REE YES ~ SK I P I F L I sr I NPUT
e74e2Q20 ~66032 J~P REED7
e21 0ss400 RFE ~sz ~7ADDQ ~ES- ~7ACKUP POINTEQ
12B6e2022 It45623 ISZ PE~D
1287e2023 a20041 LDA ~32
l2e7802024 ~61016 J5M ONEXt
12890202s 055400 DSZ t~ADDQ W1~7E OUT LAz'~-t
.29002026 0ss623 ~sz PEND REStoRE E~D OF ~U~FER POINTFR
02027 070742 SPR 16
292e2030 ~31430 StA LNINC GEt our OF AUTO
29302~31 ~66~745 J~p RE~n~7
1294 ~2a32 a62s33 REED7 JSM CLE~R CLEAQ T~E DISPLAY
1295 Q2a33 ~21430 LDA LNINC
1296 02~34 970153 SAp REEn4 LIST WAS LAST~7
1297 02035 ~7a742 S~R 16
129B e2a36 ~31430 S~A LNINC 0ET OUT OF AUTO
1299 02037 07021e REED4 S2A REE~6-? AUTO LI~F.?
130002040 0Z5427 LOp .LNU~ YES OUTPUT
1301c2a4l 160210 J5~ OUrlA~I
1302o2042 04s400 ISZ ~ADD~ oUTPuT A P~LANK
130302043 ~21751 LOA T~p5
2~ '~
.
~O'~ti6~
PAGE 0e27 #~1 ~EYBOARD ENTRY AND OISPLAy
1304 e2044 ~66047 J~p REEDG
1305~ GET NEXT KEY
1306 e2045 ~63046 REED6 JSM CALLK GET NEXT ~Er
13e7 e2046 a66045 J~P ~-1
13Q8 e2047 alOO74 REEDG CPA B22 BbCKSPACF?
~309 82QSC 066707 O~P BKSP
1310 02051 ~10075 CPA B23 FOQWARD?
1311 02~52 ~66725 0~p FOR~n YES
1312 e2053 ~12436 CPA B152 CLEAQ?
1313 02054 ~67665 J~P ECLP YES
1314 ~2055 OlgO27 CFA ~11 EXECUTE KEY?
1315 c2a56 045416 ISZ MoDE YES
1316 e2057 0501~3 AN~ MSK65
1317 e2060 ~72510 R2A REED2 BITS 5~6=0?
131B ~2061 021751 LDA TMPS YES
1319 e2~62 O0al41 ADA Ml0
1320 e2063 ~70413 SAp REED2~1 ~EF KEY?
1321 C2064 C25706 LCB TMP6
1322 Q2~65 074210 SZ~ ~4
1323 C2C66 C2'751 LDA TMP5
1324 e24~67 S4~101 IOR ~100 SET S~IFT 4IT FOR DEF-KEYS.
1325 ~2070 031751 STA T~PS
1326 e2071 067131 JMp KEYPR
1327 e2072 Olal~3 REED2 CPA MSK65 8ITS 5~6=1?
1328 C2073 ~66103 . J~P REEo3 YES
1329 02~74 ~21706 LDA TMP6 NO
1330 e2Q75 07~610 SZA REEDs S~IFTED?
1331 e2~76 ~21751 LDA THPS
1332 a2~77 ~6e752 JSM LETCK YES. LOWFQ CASE LETTEQ?
133-~ e2100 066103 J~P REEn3 ~O
1334 021C1 440041 IOR .32 CONVERt CODE
1335 e2142 ~66110 J~P REED
1336 02103 026412 REED3 LDB VALUD
1337 e2104 ~63071 JS~ T~SQl CODE IN VALUE TABLE?
1335 42105 066124 J~P REEDn NO
1339 e21a6 010022 CFA .5 ENTEQ EXPO~ENT?
1340 a2107 ~a41Cl ADA ~100 YES- FOQM ~SCII E
1341 e211~ 0317Sl S~A TMPS
1342~
1343~ ALL CO~VERSIONS COMPLETE
1344 e2111 021751 PEEn5 LDA TMPS
1345 t2112 ~10031 CFA CRT~
1346 C2113 666172 J~p EOLL EXECUTE OQ STORE
1347 ~2114 ~257~4 LOB BKPTQ
1348 e2115 ~74210 52D REEDs CURS
1349 e2116 027122 LD~ ~KPT4 YES
1350 0211? 061017 J5M OUtCR REPL4CE CHARACTFR
1351 e2120 06673B Jhp FORW0~3 SCROLL IF NECES5AQr
1352 e2121 ~61C16 REED9 J5u O~EX~ PUT CHAR aT END OF LTNE
1353 ~2122 962737 JSM LEFT SCROLL IF NECESSARY
1354 e2123 a66045 J~P REED6
133556 e2124 2h373 REEDD LOEI EXPTq SEARCH F~R MuLTI-cH4Q KEY
1358 e 2126 666213 JMP REED~ ~~
1359 62127 631751 StA TMPS
?~j()
10'~64~
PAGE 0e28 ~01 KEYBOARD EN~RY AN~ ~ISPL~Y
\
1360 e2130 062521 JS~ CLRST CLEAR FLAG IF "STOP"
1361 ~2131 062533 JSM CLEAQ
1362 ~2132 026443 LD~ COMT4
1363 e2133 ~21751 LOA TMP5
1364 02134 162441 JSM MOUT~I OUTPUT FPOM SYSTEM CO~MAND TABLE
1365 22135 e66045 JMp REED6
1366 ~2136 ~62533 PRALL JSM CLEAQ CLEAR BUFFER
1367 ~2137 ~21450 LDA PMO~E
136B e2140 07el30 SIA ~2
1369 e2141 070742 SAR 16
1370 02142 a31450 StA PMODE
1371 92143 02'444 LDB OFF~ GET ~DDRFSS Of "OFF"
1372 ~2144 ~72110 R2A ~2 O~?
1373 ~2145 ~0402fl ADB .3 YES. GET ADDRESS OF "ON "
1374 e2146 020020 LOA ~3
1375 e2147 S61335 JSM NPWQt
13t6 0215a ~66QIl J~P REEnE GET FIRST KEY AGAIN
1377~
137B' STEP AND CONT EXECUIION
1379-
1380 e2151 031442 STEP STA STPFL SET POSITIVE NO~-ZEQO
1381 e2152 070742 SAR 16
1382 e2153 ~25421 CONT LDB PRADD
~3B3 e2154 074273 SBP CO~Tl.C HAS AN EDIT OCCURQEO?
1384 e2155 072110 RZA CO~TK YES- LINE ~ GIVE~?
13~5 Q2156 ~74517 LDA ~-1 NO. EXECUTE FRO~ BE0IN~ING
1386 e2157 631725 CONTK SIA ~XTST YES- EXECUTE FROM 8EGINNING
1387. e2160 1640~4 JMP XEC~.I
13~8 02161 ~7~250 CONTl 52A ~S LINE ~ GIVEN~
1389 e2162 061075 JS~ F~DPS YES~ FIND ADDRESS
1390 02163 164174 JMP RDyDA,
1391 e2164 ~6~165 J~P 4-1
1392 e2165 D35421 S13 PRADD StORE AD~QESS
1393 e2166 662533 JSM CLEAQ
1394 ~2167 ~31416 StA MODE SET TO PRoGRAM EXECUTION
1395 e2170 B25421 LD9 PRADD
1396 02171 164255 JMP ~EC6A.I CON~INUE EXECUTIO~
1397~
1398~ ~Q~CESS EXEC OQ STOQE
1399 ~21t2 ~45623 EOLL ISZ PEND GUAR~NTEE ~OOM FOR EOL
1400 e2173 061~16 JSM O~EXT
1401 e2174 a24233 LOB aE~D
1402 e2175 035477 STB TEMP4
1403 02176 024233 LDB SBUFA
1404 02177 ~35476 StD TE~P3
1405 ~2200 004046 GDB ~41
1406 ~2201 661122 JSM MVtOH~l MOVE INPUT RECoQD tO I/O ~UFF
1407 e2202 060373 JS~ IC~T
1408 02203 ~0~132 ADA ~1
1409 02204 07~250 S2A REEDt SKIP IF NULL REcoQD
1410 e2205 ~2545e LDB PMODE
1411 022~6 ~76150 R~ REEDt
1412 e2207 ~24211 LCO .BUF~
1413 62210 061337 JSM ND~QT
1414 ~2211 F62502 REE~T JSU CQC
1415 C2212 ~64357 Jhp ~ETN2
2~i
10 ~644
PAGE Qe29 ~01 KEY~04QD E~IRY 4ND ~ISPLAy
1416~
1417 02213 013124 REEn8 CPA B33 DIVIDE?
1418 e2214 ~22437 LDA ~57 rES. GET ~5CII
1419 02215 ~26361 LDB EDlt2
1420 e2216 663072 JSM TBSRH CODE IN E~IT T4BLE?
1421 02217 ~66110 J~P REE~5-1 NO
1422 92220 ~440 ~A BE~
1423 e2221 ~7a737 JMp A I
1424~
1425- DELETE LINE
1426 ~2222 170402 DEL2 RET
1427 02223 ~21430 DELl LDA LNINC
1428 e2224 071713 SAP DEL2
1429 02225 021431 LDA CLINE
1430 e2226 130233 SIA SBUFA I
1431 02227 070742 S~R 16
1432 02230 ~3143Q STA LNINC
1433 e2231 164204 J~P DELS~I
1434~
1435~ RECALL
1436~
1437 e2232 ~62533 EREC JS~ CLEAR
1438 ~2233 ~55473 DS2 CCNT SET PEcALL FLAG
1439 e2234 024211 LDfl BUF4
1440 02235 ~35740 RSLTI Sl~ TMP . GET ST4QTING bDDRESS OF IO BUFF
1441 C2236 ~66a45 J~P REED6
1442-
1443- I~ITIALTZE V~RIA~LES
1444~
1445 e2237 020056 I~'ITV LDA .lE4
1446 e2240 164171 JMP R~A,t RUN 100~0
144t~ QESUL~ KEY
1448 0224l 020101 RSLT LDA ~10a CODE FOR
1449 e2242 ~25706 LO~ TM~6
1450 ~2243 074110 S2B ~2 SHIFTED?
1451 e2244 J66110 J~,P REE05-1 YES
1452 02245 026445 LO~ RES4
1453 Q2246 ~20020 RFNXl LGA .3
1454 02247 S31473 STA CCNT COUNT=3
1455 ~2250 ~66235 J~p RSLtl
1456-
1457~
145a 02251 666136 P~L J~P PR~LL
1459 ~2252 666151 StPL J~,P ST~P
2~,'
10 ~ti644
PAGE 0~30 #~1 KEYBOARn ENTRY A~n OIsPLAy
1461~
1462~ FETCH EXECUTION
1463~
1464 e2253 000132 EFET ADA M1
1465 e2254 031431 SlA CLINE
1466~
1467- ThIS ROUTINE LIsTs ONE LINE
1468~ Of T~E PROGRAM, ThE FIRST
1469~ LI~JE TO 9E LISTED IS THE FIRST
1470~ LINE OF THE PRoBRAM.
1471
1472~
1473 e2255 062353 DNARW JSM SAROW CHECK FOR NULL PROGRAM
1474 02256 ~74310 S2B ~4 SKIP IF TY~ING AID KEY
1475 e2257 ~70079 SIA ~1
1476 e2260 0610?5 J5~ FNDPS fIND LINE
1477 e2261 066277 JMp U3 P~ST END oF PRoGRAM
1478 02262 066301 Jhp U5-1 BET~EEN LINEs
1479 e2263 0663~1 JMp U5-1
l4e0-
1481~ T~IS ROUTINE LIsTs ONE LINE
1482~ OF t~E PROGRAM. ThE FIRST LINE
1493~ TO BE LISTED IS ThE LASt ~INE
1484~ OF T~E PROGQa~.
1485
1486-
1487 C2264 ~Z1424 U4 LDA PBUFf GET FIRST LINE
1488 e2~65 ~663~2 J~p US
14B9 e2265 ~6Z353 UPARW JSU SAR0W CHECK fOR NULL PROG
- 1490 ~2267 ~75650 52B U4 SKIP IF TYPING AID
1491 02270 ~72110 RZA u1 CLINE =0?
1492 C2271 62~056 LDA . lE4 YES- FINn LAST LI~JE OF PQOG
1493 e2212 061a?5 U1 JSM FNDPS FI~D LI~E
1494 02273 066277 JMP U3 PAST END oF PRoG
1495 e22?4 S66275 J~p 4~1 qETWEEN LINEs
1496 ~2275 ~15424 CPB P3UFF FIRST LINF?
1497 e2276 a66301 JMP uS-1 YES
1498 e2~?7 ~21720 U3 LDA LASTN GET PREVTO~S LI~E
1499 e2300 ~60742 JSM FND
1500 02301 ~74117 LOA 9 GET ADDRFSS IN ~A)
1501 ~2302 074742 US 59R 16
1502 02303 ~35453 STB ARW FLAG LIST ~ouTINE
1503 02304 635460 SlB TMP?
1504 02305 167120 JMp LISTQ I
15oS~
1506~ T~SERT ~Nn DELETE ChAQActER
1507~
1508 e 2306 066045 J~P REED6
1509 02307 0257a4 INSRT LDB 9KPTR
1510 02310 ~75710 S29 INSRT-1 ANY BAcKspAcE YFT?
1511 02311 625409 LD9 ~ADDR
1512 e2312 021706 LDA T~P6
1514~ DELETE S2A INS0 SHIFT FLAG SET?
1516 2315 ~25704 LD9 hKPTR YES. DINC END OF LINE POI~TER
25'3
10'~ 4-~
PAGE Oe~l ~01 KEYBOARD EN~RY AND OISPL~y
1517 e2316 ~35740 SIB TMp SET ~OINTE~ TO CURSOQ CH~RACTEQ
151B ~2317 ~25740 DELCl LCB TMP
1519 02320 0154a0 CPB ~ADDR LASt CHAR~
1520 02321 ~66347 JMp INS2~1 YES- OUTPUT A BLANK
1.521 t2322 ~45740 ISZ TMP
1522 22323 ~61053 USM ~tMP GET CHARACTEQ
1523 02324 ~55740 GSZ TMP
1524 e2325 ~55740 DSZ TMP
1525 e2326 ~24111 LDB TMPA STORE SHIFTED LEFT O~E
1526 e2327 ~61017 JSM OUTCR
1527 ~2330 ~66317 JMP ~ELCl
1528~ INSERT
1529 e2331 B14236 INS0 CPB S~END
1530 ~2332 ~66045 JMp REED6 LINF FuLL
1531 02333 004132 AD9 Ml
1532 ~2334 ~35740 INSl S~ TMP
1533 e2335 ~61053 JS~ GTMP GET C~ARACTER
1534 02336 025740 LDB TMP
1535 e2337 OlS704 CPB hKPTR ~T CuQsoR PosITloN?
1536 02340 466346 J~P INS2 YES
1537 92341 ~24111 LD8 TMP~ NO, MOVE R~G~T 1 PLACE
1538 e2342 661017 JSM OUTCR
1539 e2343 e2s740 LDB T~P
1540 C2344 004134 A~a ~3 BAC~ UP PoINTER TO hEXT
1541 02345 066334 JMP INSl C~AR LEFT
1542 e2346 645400 INS2 ISZ ~ADnQ UPD~TE END OF LINF POINTER
1543 e2347 62004} LDA ~32
1544 ~2350 a24111 LD~ T~P~
1545 02351 n61~17 ~SM OUTCR INSEQT A ~LANK
1546 e23s2 666045 JMp REED~
1547-
154B- SUBROUTIN,E FOR UP A~D DowN ~RROW ROUTINE5
1549-
1550 C2353 021424 S~ROW LDA PBUfF
1551 C2354 011423 CPA PBPTR
1552 62355 164174 J~p RDYD~I NULL PROG~M ABORT
1553 e2356 ~21431 LOA CLI~~
1554 e2357 125424 LDB PBUfF,
1555 62?160 170402 R~T
251
6~
PAGE 0632 #01 KEY~OARD E~RY A~n ~IsPLay
1557~
1558~ T~IS SECTION CoNT~INs TABLES
1559- POINTERS USED I~ IHE b~OVE ROUTINE
1560
1561~
~562{
1563-
1564 ~2361 ~04744 ~DIT2 DEF ~ 2
1565 e2362 012643 DEf 12600R-EE~UPARW
1566 e2363 012232 ~EF 12200~-EEB~D~ARW
1567 e2364 ~15214 DEF 15200B-EEB~INITV
1568 ~2365 065616 DEF ~s6Q0~-EEB~RsLT
1569 e2366 C06627 DEF 6600~-EE~STPL
1570 Q2367 017664 DEF 17600q-EEB~INsRT
1571 ~237a 07160~ DEF 7160~9-EEB~DELI
1572 02371 a70226 DEF 702e0a-EEB~pAL
1573 e2372 ~103Q7 D~F 103009-EEB~EREc
1574 02223 EEB EO~ DELl
1575-
1576-
1577' EXPA~DI~G DEY TABLE
1578~
1579-
15A0 52373 004770 EXPt~ DEF ~ 2
1581 e2374 ~P76el ~CT 7~el R~l~
1582 e2375 ~14600 OCt 14600 STORE
1553 e2376 ~1422~ OCT 142Z0 LO4D
1584 e2377 0172e7 OCT 17207 ~9R~AL
1585 ~24a~ 006212 OCT 6212 CONtINUE
15~6 ~24al ~07226 OCT 7Z26 T~ACE
1587 624a2 ~77637 OCT 77637 STOP
158B 02403 ~17216 OCT 1721fi ~oRMAL
1539 e2404 al0604 OCT 1~6a4 FETC~
1590 62405 072214 OCT 72214 ~IXE~
1591 e2406 ~72615 OCT 72615 FLOAT
1592' 32407 ~05Z03 OCt 5203 LIST
1593 22410 Q732e2 OCT 73202 SCRATCH
1594 e2411 0737~5 OCT 73705 ~UTO
1595
1596-
1597~ KEY V~LUE tABLE
1598-
1599 ~2412 OZS026 VALUP DEF ~ 2
1600 02413 ~05615 OCt 5615 FOL
1601 O2414 ~71215 OCt 71215 STORE
160Z ~241S 020240 OCT 2~40 ~L~NK
1603 ~2416 ~3a641 nCT 30641
1604 e2417 032244 OCT 32244
1605 ~2420 03~645 OCt 32645
1606 02421 ~676~5 OCt 67605
1607 O2422 ~31643 OCT 31643 #
1603 02423 031242 OCT 31242
160~ 02424 ~33246 OCT 33246
1610 e2425 e33647 OCT 33647
1611 e2426 034250 OCT 34250
1612 82427 e34651 OCT 34651
25~)
:~OL~t;6~4
PAGE ae33 ~01 KEYRO~RD ENTRY AND BIsPLAy
1613 e243a OZ7677 OCT z7677 ?
1614 e2431 ~26274 OCT 26274 <
1615 t2432 027276 OCT 27Z76 >
1616 e2433 435252 OCT 35252 4
1617 O2434 ~35653 OCT 35653
1618 e2435 e30355 OCT 3~1355
1619-
1620
1621~
1622 Oal03 MS~65 ECU 3140
1623 ~2436 ~00152 ~152 OCT 152
1624 Q2437 600057 B57 OCt 57
1625 e2440 ~02223 ~EEB DEF EE~
1626 e2441 ~06326 ~OUTA ~EF MCOUT
1627 e2442 0034~2 ~PtR DEf R~uFF~RBuFF~48
1628 02443 oa7062 CO~TA DEf L~Ll~L9L1~0
1629 02444 e05117 OFF~ DEf ~*~7
1630 ~2445 905114 ~ESA ~EF ~ 2
1631 e2446 051105 ASC 4.QESnFFON
e244~ 051517
92450 ~43106
e2451 ~47516
632 02452 02a04e~ TOBLN OCT 20~4
1634~
1635 a2453 o~00a0 ~SS 1 ***** CHEcKsu~***~*
~C;'
~ t~
PAGE 0~34 #01 KEYBOARD E~TRY AND DISPLAy
1637~ WRI~E SUBROUTINE
1638-
1639~ ENTRY CONDITIONS
1640-
1641~ (A)=CHAQACTER COU~T
1642- (~)=POI~TER TO FI*ST CHAQ
1643~ NPQIN~ FOR PRINT ABO~T
1644~ N~ISP#0 PQI~T O~LY
1645-
1646-
1647 82454 07a410 WRIT SZA RIT3L SKIP IF NULL COUNT
1648 02455 ~31741 STA TMPl
1649 22456 ~35740 ST~ TMP INITIALIZE PoINTER
1650 e2457 861053 RITEl JSM GT~P GET CHARACTER
1651 0246~ ~10027 C0A .11 EXECUTE?
1652 e2461 ~20100 LDA BS2 YES CHA~IGE TO * FOR KEY
1653 e2462 025701 LD~ ~OISP
1654 22463 010~31 CPA CRTN CRTN CHAR~CTEQ?
1655 ~2464 C66476 RIT3L JMp RITE3 YESt ABORT
1656 e24fiS ~t631~ RZB RITE2-1 DISPLAY ~ISABLED?
1657 024~6 ~70150 SZA RITE4 NO NULL~
1658 e2467 661016 JSM JNEXT OUTPUT TO DIspLAy 3UfFER
1659' ~247e ~21467 LDA LOCL2 QECALL C~ARAC~EQ
1660 a2471 S25702 RITE4 LD9 NPRI~
1661 e2472 ~76110 ~ZB RITE2 PRINT DIS~BLED?
1662 e24?3 ~61353 JSM TTY hO. PQINT CHAR
1663 02474 ~55741 RITE2 DS2 TMPl MORE CHARAcTERs?
1664 e2475 ~66457 U~P RITEI YES
1665 62476 ~7~742 RJTE3 SAR 16 RESET fLAGS
1666t2477 031702 STA NPRIN
166742500 ~31701 S~A NDISP
1668~2591 17~402 RETA RE~
1669~
167002502 025450 CRC LDB PMODE
1671025~3 074350 SZB CQCl PRINT ALL?
1672 e2504 625450 CRCHK LDB Q~ODE
1673~2505 e74150 5Z9 CRC2 PRI~T ALL?
1674Q2506 ~25453 LDB PRFLG
167592sa7 C74352 S~ CTERM
1676~2510 8Z5622 CQC2 LDB TERM
1677~2511 a75410 SZ~ RETA
167802512 172700 CQCI SFC ~ WAIT UNTIL "STOP~ KEY
1679~2513 066512 ~P ~ S QELFASED
1680e2514 G62521 0SM CLRST CLEAR ''STOP~ FL~G
16Sle2515 e61344 JSM CQL~I
1682~
1683 02516 ~74742 CTEQM 53R 16
1684 02517 035~22 STB TER~
1685 ~2520 1734a2 RET
1686-
1687 82521 P25442 CLRST LO~ STPFL
16a8e2522 ~14040 CRB 31 SET FROM KEYBOARD?
16892523 866525 J P ~2 YES. CLEAQ IT
1691e2525 ~74742 S~ 16
1692e2526 635442 SIB STPFL
25',
~o'~
PAGE 0e35 ~01 KEYBOARD ENIRY AND ~IsPL~i
1693 e2521 e35433 STg TFLAG
1694 e253a 17~402 REt
1695
1696~
1697 02531 027117 GTMPZ LOB T~P2A
1698 02532 065e41 J~p GETC~
1699
1700~
1701~ THIS SUBROUTI~E CLE~Rs t~E DISPLAr
17~2-
1703 02533 C70742 CLEAR S~R 16
1704 e2534 ~31704 SIA B~PTR
1705 e2535 ~2~212 LDA .SLPF
1706 02536 031402 STA OTPTR
1707 e2537 4314C0 STA B4~0Q
1708 ~2540 ~31625 STA PIRSt
1709 02541 ~24233 LDB BENn
1710 e2542 022452 LDA ToBLN
1711 e2543 674557 CLE1 STA B-I
1712 ~2544 ~17123 CP8 E~DW
1713 e2545 ~66476 J~P RIT~3
1714 22546 C77670 ~I~ CLE1 NO
1715~
1716~ I~Q STATU5 CHEC~ ~OUTINE
~717~
1718 02547 e25442 IOSt LDB STPFL
1719 B255G 01404e CPF .31 STOP fL~G?
1720 e2551 17G402 RET YES
1721 e2552 e-2s447 LD~ SLCOn NO
1722 ~2553 172741 STF 1 TURN INTERRUPT OFF
1723 ~2SS4 17~141 O~
1724 e2555 172741 S~F 1 GET STAtUS IN I~O REG
1725 e2556 177241 L15 1-C tUR~ INTERRupT ON
1726 e2557 0744~6 ~e~ ~
1727 02560 G75353 S~P IOSt ~EVICE ~uSY?
1728 e2561 ~64357 J~P ~ET~2 NO
25~
- lO'~
PAGE Ot36 #Ol KEYBO~D ENTRY ~N~ ~ISPLAy
1730~
1731-
1732~ THIS SU~ROUTlNE REFREs~Es
1733- THE SINGLE LI~E ~ISPLAY
1734-
1735 ~2562 e2l4B2 REFRS LOA OTPTQ
1736 e2563 ~31740 STA TMP
1737 ~2564 e00033 ~CA .16
173B C2565 931742 STA TMP2
1739 C2566 074742 S~R 16
1740 ~2567 ~35741 RE1 ST~ TMP1
1741 ~2570 624111 LDB TMP~
1742 02571 661362 JSU GTcnN
1743 02572 ~703a4 RE3 SAL 10
1744 ~2573 ~31743 StA T~P3
1745 ~2574 ~2?117 LOB TMP2A
1746 02575 ~61362 JS~ ~TCON
1747 Q2576 ~50054 RE4 A~D .63
174B e2577 0706C4 ~AL 4
174~ ~2600 ~41743 IOR T~P3
1750 02601 ~41741 IOR TMPl FORM OUTPUT WORn
1751 02602 173750 CLF & Tl)RN DISPL~Y OfF
1752 82603 173741 CLF 1 INTERRUPT ON
1753 02504 ~25443 L~ KEYFB
1754 e2605 172741 SIF 1 INTERRUPT OFF
1755 02606 674353 5~p RE2 INTERRUPT OCCURRED?
1756 ~2607 ~25741 ~~B T~Pl
- 1757 C261e ~14a33 CP~ .16
-1758 Q2611 066615 U~P RE2
1759 e2612 ~74~70 SIB ~1
1760 02613 172150 OTA 8
1761 ~2614 ~66567 JYP RE1
1762 02615 173741 RE2 CLF 1
1763 C2616 170402 RET TURN INTERRupT ON
2S~
10~6~;~4
PAGE 0037 #al ~EY~OARD ENtRY ~ND ~lSPLAy
1765~
1766~ PTAPE COM~ANn EXECUTION
1767
1768' T~TS QOUTINE RE~D5 P~OGR~S FRo~
1769~ TH~ P~OTO?EADER. 10 OR ~O~E NULLS
1770~ CONSTltUT LE~DE~ OR TRAILER w~ICH
1771~ ARE THE P?OGRAM DELIMITER5.
1772~
1773~ INPUT COD-S
1t74~
1775~ DATA 64 ASCII SET
1776~
1777~ CO~TROL
1778-
1779~ 176 ALT MODE=DELETE LINE
1780~ - 33 E5C MODE=DELEtE LINE
17B1- 137 LEFt AQRO~=DELETE CHAR
1782~ 177 RU801JT= IGNORE
1783~ 15 CRTN= IG~ORE
1784~ 12 LNFD= END OF RECORD
1785~ RETUQN TC
1786~
1787~ P~1 IF NULL REcoRD
1788~ P~2 C~HER~lSE
1789 025l7 07~2~4 PREED SAL 12
1790 02620 031447 S~b SLCOD
1791 02621 ~20211 LDA .BUFA
1792 02622 6314a- STA BADDQ
1793 ~2623 ~20132 LDA M1
1794 ~2624 031751 STA T~P5 CLEAR DELETE LINE FLAG
1795 ~2625 02F141 LDA M1fl
1796 ~2626 031741 51A TMPl SET FEEO HOLE COUNTER
1797
1798~
1799- GENERAL INPUT POUTINE
1BO0-
~801 02627 B62547 P1 JSM IOST STOP KEY?
1802 e2630 ~6~704 J~P P7 rES
1803 J2631 ~2Q1~1 LDA B40a0 GET INPUT STATus 9I~ .
'804 ~2632 061355 JS~ CR1-1 CALL FOR INPUT
~805 02633 ~62547 JSM lOST
806 ~2634 e66704 P4 JMp P7 STOP
807 ~2635 074117 - LCA
808 t2636 G7B3~6 RAR 7
8B9 e2637 eS0104 A~D ~177
1810 ~2640 67231B R2A P3 NULL?
1811 e2641 045741 I52 TMP1 10 FEED HoLEs?
1812 ~2642 Q66627 J~p P1 NO
1813 02643 021742 LDA tMP2
1814 e2644 ~7'4i3 S~P P4 TQA~LER?
lB15 e2645 S6h625 J~p P1-2 ~O~ LEADER
~B16 e2646 ~31742 P3 SIA TMP2 RESET LEAOER FLA6
lB17 02647 010104 CPA B177 RUBOUT?
1818 92650 G66625 Jhp Pl-2 YES
1819 e2651 010031 CPA CRTN CRTN?
182B e2hS2 ~66625 JhP P1-2 YES. IGNORE
2~i~
~0~6644
PAGE 0~38 ~01 KEYBOARO ENIRY AND DISPL~Y
.
BZl 026s3 Cl312O CPA B137 LEFT ARROW~
~6670 JMP PS YES. BACKSPACE
18Z3 02655 ~12061 CPA LNFD LINE fEED?
1024 e26s6 C2C03 LDA EOL YES- CH4NGE TO END oF Lin~ ch~r~ct~
~825 e26s7 ~1312~ CFA B33 ESCAPE MODE?
lB26 t2660 a66624 J~P Pl-3 YES. SET DELETE FLA6
e2661 01312 CPA B176 ALT MODE?
lB28 02662 06662~ JMP Pl-3 YES. DELETE
lB29 e2663 06101O JSM ONEXT
1830 02664 ~21467 LDA LOCL2
lB31 C2665 ~1003 CPA EOL END Of RECORD~
1832 e2666 066673 JMP ~2 YE~
lB33 e2667 ~2540~ LDB BADDR
lB34 e26t0 01713~ CPB IGE~D FULL?
~1835 e2671 ~ss40- P6 DS2 BADDR
1836 02672 06662~ JhP Pl-2
lB37 e2673 J20127 P2 LOA ~170~
~B3s e2674 e3144- S~A ~LCOD SET TO STANDARD PRINTER
1039 6267s ~457s: ISZ TMP5 C~ECK ~ELETE FLAG
1840 02676 170402 RET DELETE
1041 e2677 06435' JMP RETN2 ACCEPT
1842 e2700 ~2s4a~ P5 LDB 8ADDQ
1843 6270l ~1421 CPB .~UFA RUFFER EMPTY~
1844 ~2702 ~6662~ ~p Pl-2 rES- IGNORE
lB45 a2703 06667 J~p P6 NO~ BACKSPACE
1846 02704 J2003 P7 LDA EOL
1847 027as P6101~ JSM ONEXT PUT EOL CHAR IN ~UFFEQ
ls4B 02706 16417- J~p R~YDA-I EXIT PTAPE MoDE
-
b ~
10'1t~4 ~
PAGE 0039 ~al KEY~BOARD ENTRy AND ~TSPLAy
lBS0~
1851~ B~CKSPACE
1852~
1853 02707 ~21704 PKSP LDA BKPTR
1854 e2710 ~72350 Q~A B~2 FIRST BAC~SPACE?
1855 e2711 U21400 LDA 8ADOR YES
1856 e2712 ~10212 C~A ~SLBf NULL RECORD?
BS7 e2713 ~66045 JMp REED6 YES
185B e2714 G21400 LOA ~ADDQ
1859 02?15 a31704 S~A BKPTR
1860 e2716 G66723 J~p BKl-l PUT POINTER AT LAST CHAR
1861 e2717 ~10212 BK2 CPA .SL~ ALREADY ~T FIRST CHAR?
862 e2720 ~66045 J~p REED6 YES
1863 e2721 U114a2 CRA OTPTR LEFTMOST ON SCREEN?
1864 92722 GS54~,2 DSZ OTPTR YES- SCROLL
1865 e2723 ~55704 DSz BKPTR BACKSPACE CURSoR
1866 e2724 U66045 BKl J~p REED6
1~67~ ~
1868~ FORW~RD S¦PACE
1869~
1870 e2725 02~7~4~FORWn LDA BKPTR
1871 02726 070310 S~A F~l S~IP IF NO BACKSPACE HAS OCCURRED
1872 02727 0457a4 ISZ BKPTR
1873 02730 021402 L~A OTPTR
1874 02731 ~a2c41~ ADA .32
1875 e2732 ~117041 CPA aKPTR ON QIGHT OF SCREEN?
1876 02733 011400 C~A BADDQ YES~ LINE FULL?
1877 ~2734 066045 FWl J~p REED6
lB78 e2735 ~454a2 ISZ OTPTQ NO- SCROLL
1879 22736 066~45 J~p ~EED6
18B0
881~ LEFT SU~ROUTINE
lB82-
1883~ SHTFr THE 32 C~ARACTER DISPLAY LEFT
18B4~
lB~S e2737 ~21400 LEFT LOA ~ADDR IS THE LAsT CHAQ
18B6 ~,Z740 ~00151 AOA ~32 ALREAnY TO THE LEFT OF
1887 PZ741 07ff0~6 TCA
18B8 ~2742 u014e2 ADA OTPTP THE EN~ OF DISPLAY~
lBB9 ~2743 970113 SAp *~2
IB90 ~2744 ~454d2 lSZ OTPTR NO~ SC~OLL
1891 CZ745 170402 RET
892~
lB93~ QIGHT S~G~OUTINE
1894~
1895~ SHTFT THE 32 CHA~AC7ER DISPLAY RIGHT
1896- ONE POSITION. IF THE FIQST CH~QACTEQ
lBB987 IS IN THE LEFT~OST PosITloN~ A~OQT.
lB99 Q2746 a21402 RIGHT L8A OTPTQ
1900 62747 ~10212 CPA ~SL~F
1901 e2750 17a402 ~ET
1902 e2751 GS5402 0S2 ~TPTQ NO
1903 Q2752 17a402 ~ET
Z~,'
~0'~6~;44
PAGE 0040 #01 KEYBOARD E~tRr A~D ~ISPLAy
1905~ KEYI~ SU~ROUTINE
1 ~06~
19~7~ THIS SU9RCUTINE ScANS ALL
1908~ INPUT DEVlCES SEAQCHING FOR
1909~ A~ INPUT CO~E. IT REFRESHES
1910~ THF DISPL~Y ~HILE ~AlTIN~
1911~ EXIT WITH CODE IN ~Al
1912~
1913 ~2753 0?4742 KEYIN SBR 16
1914 62754 021400 LDA BADDQ
l91S e2755 ~11704 C~A aKPTQ CURSOR PAST END?
1916 02756 035704 5-B BKPTQ YES~ CLEAR POINTER
1917 02757 621473 KEYN7 LDA CCNT
191B ~2760 0?2110 ~ZA ~2
1919 02761 ~67002 JMp KEY~l -
19~0 ~2762 061~53 05M GTMP GEt CHAQACTE~
1921 e2763 ~31751 STA T~PS SAVE UNco~vERTED C~AR
1922 t2764 ~70550 SZA KEyNl-3 EMpTy ~uFFER?
1923 02765 061363 JSM GTCO~- l CONVERT
1924 62766 C11751 CPA T~PS ~ID CO~VERSION DCCURR?
1925 ~2767 066771 JMp ~2 NO
1926 e2770 ~43121 IOR B200 YES. SET SHI~T BIT
1927 e2771 025473 LD~ CCNT
1928 B2772 ~19031 CPA EOL E~D OF LINE?
1929 e2773 ~74212 sa~ ~4 RECALL MO~E?
1930 e2774 ess473 DSZ CC~ NO- DINC PoI~TEQ
1931 e 2775 170402 RE T
1932 e2?76 17e4~2 REt RETURN ~ITH CHAR I~ ~A)
1933 02777 ~74742 se~ 16
1934 03000 035473 Sla CCNt QESET POTNTER
1935 93aal 066756 ' J~P KEy~7-l
936 03002 01175~ KEY~1 StA TMP4 SET CURSnR COUNTER TO ZERD
.937 ~3003 963024 JSM KEYN6
_938 ~3004 02'7~4 LDB BKPTQ
_939 03005 e74250 SZB KEY~3 CURSOR?
1940 e3006 ~2?122 LCB BKPTA YES
1941 63007 061a41 J~M GETCH
1942 03010 031751 STA TMP5 SAVE CHAR ~T CURSOR POSITIO~
1943 e3011 055704 DSZ ~KPTR
1944 Q3012 ~25443 KEY~3 LDB KEYFG
1945 ~3013 ~74612 S6~ KEYN2 HAS KEY INpuT OCCURRED?
1946 e3014 fl21704 LDA ~KPtQ YES
1947 ~3015 Q?0250 SZA KEY~5 CURSOR?
1948 03016 ~21751 LDA TMP5 YES. RESTORE CH~RACTER
1949 e301t ~2712Z LDB aKPtA
1950 03~20 ~61017 JSM OUTCR
l9S1 ~3a21 ~55704 DSz BKPTR
1952 ~3022 ~21443 KEY~5 LDA ~EYFO.
1953 e3a23 JS~105 AhD d377
1954 03024 e~24132 ~EY~6 LCB M1
1956 03a26 17a402 5IB KEYfG RESET KEY ~ CCURREr) FLAG
1957 e3027 ~2S704 KEY~2 LDB ~KPTQ
1958 ~3a30 ~74610 52B KEYh4 CURSOR?
1959 e3031 G2S750 LDB TM~4 YES
1960 ~3032 ~04132 ADB Ml
26~
lO~
PAGE Oe41 ~01 KEYBOARD ENTRy A~D DI8PLAy -
1961 93033 6}4136 CPB ~5
1962 oe3~34 ~24a61 LGB .10
1963 ~3035 ~35750 SIB TMp4
1964 e3036 a21751 LDA ThP5
1965 03037 ~74113 S~P ~2
1966 t3040 a2~037 L~A .28
1967 C3a41 027122 L~B ~KPTA
1968 03042 061017 JSM OUTCR RE~LACE CHARAcTER ~ITH CURSOR
1969 ~3043 0ss7a4 DSZ a~PTR
1970 e3044 ~62562 ~EYN4 JSM REFRs
1971 63045 067012 JMP KEYN3
1972~
1973* CALL KEYIN AND EXEC~TE RIGMT AND LEFT ARROWS
1974*
1975* P~l5ARR0w5 P~2=OTHERWISE
1976 e3a46 ~62753 C~LLK JSM KEYIN
1977 ~3047 ~74742 S~R 16
1978 C3050 ~70346 KAR ~
1979 03051 ~70133 S~P ~2.C SHIFTED?
1980 e3052 024132 LOB Ml YES
1981 53053 e3s706 SIB T~P6
1982 03as4 ~70346 ~R 8
1983 a3055 031751 S~A TMp5
1984 e3056 010036 CPA B27 RIGHT ARROW
1985 e3~57 C66746 JMp ~IGHT YES
1986 03060 ~10035 CPA B26
1987 ~3061 J65737 J~P LEFT LEFT ARROW
1988 e3a62 064357 JMP RETN2
~6~1
1 0 ~
PAGE Oe42 ~01 KEy OARD EhTRr AND ~IsPLAr
1990~
1991~ TABLE SEARCH ROUtI~E
1992~
~9g3-
1994~ THIS SUBROUTINE COMPARES T~E
1995' INPUT STR-NG ~ITh ST~INGS IN
1996~ A TA~Lt. IF A S~CCESS~UL Co~pARE
1997~ I5 MAOE AN 6-~IT CODE I5 ~ETuRNED
1998'
19994 ENTRY CONDITIONS:
2000- (A)=FIQST CH4~ACTER OF INpuT STRIN~
20a1~ (~)=POINTEQ TO FIRST C4AR OF TABLE
2002~
2003~ EXTT CO~DITIONS:
20044 IF MATrH, REtlJ~N TO P~ ~ITH CODE
2005~ IN A OTHERWISt ~ErURN 70 P~1
2006
2007~
2006 e3Q63 ~62531 TB56 J5~ GTMP2
2009 ~3064 a70306 RAR 7
2010 e3a65 C70511 SLA TBS5 oP CODE?
2011 e3066 07040Z SAR 9 YES- RIGHT JusTIFr
2012 Q3~67 CS0054 AN~ .63
2013 e3070 064357 J~P RETN2
2014 Q3071 e21751 TBSR1 LDA TMPS
2015 ~3~72 03'750 T~SRH S~A T~P4 SAVE INPUT CHAR
2016 83073 035742 51~ TMP2 I~ITIALIZE TABLE POINTER
2017 e3~74 925400 LO~ BA~DR
201~ 03075 035752 SIB TMP6~ SAVE INPUT PoINTER
2019 Q3076 067101 JMP THS2
2020 e3077 055742 T~55 GS2 TMP2
2021 631a0 061055 JS~ GNEXT FETCH NEXT INPUT CHAR
2022 e3101 C31743 T~52 5lA TMP3 STORE C~AR~CTER
2~23 e31~2 ~62531 JS~ P2
2e24 23103 ~11743 CPA t~D3 CHAR~CTE~S ~ATC~?
2025 23104 e67063 J~p TBSh YES- C~TINUE
2026 03105 ~25752 LCR T~P6~ N~- PESTO~t BADnR
2027 e3106 ~35400 STB ~A~nR
2~28 e31a7 062531 J~ GT~p~
2029 03110 a7~306 RAQ 7
2030 03111 071711 SLA 4-2 CMA~ IS OP CODE?
2031 ~3112 070153 S~P T~S4 LAST ENtRY?
2033 e31143 121750~ LCA TM~4 REtlJRN tO P~1
2034 03115 ~2175e T~S4 LDA TMP4
2035 03116 067101~ JMp T~S2 CONTINUE
26~)
10'~ 4 i
PAGE 0043 ~01 KEYB~OARn ENTRy ~ND DISPL~Y
2037~
203B~ CON5T4NTS~ TE~PORARIES- EtC.
2039~ USED IN AIOVE ROUTINES
2040-
2041~
2042 Q3117 001742 TMP2A UEF T~P-2
Z043 0312a aO6006 LISTR DEF LISTl
2044 e3121 0~02a0 8~00 OCT ~a0
2~45 03122 aO1704 8KPTA DEF ~KPTP
2046 03123 ~0l62l~ENDw ~EF RBUFF~40
2047 03124 000033 833 OCT 33
2048 03125 000176 9176 OCT 176
2049 03126 400137 B137 OCT 137
2050 03127 O~el63 DELIN OCT 163
2051 C3130 eO33Zl;lOEND DEF IoEuF-loEuF~3
~6(.
644
PA~E 0~44 #01 DEFI~E-A-KE~-ROUTINES
2~53
2054~ DEFINF-A-KEY-QOUTI~E~
2055~
2056- THE FIRST WORD OF EAC~ DEFI~ITION CO~TbINS THE
2057~ KEYCODE OF tHAT KE~. rHE SFCOND WORD CONTAINS THE LE~GTH
2058~ OF THE DEFINIrION RLus 1. ~HILE IN DEFINITION McDE
2059~ "UKPTQ" POINTS THE THE LE~G~H WORD.
2a60-
2061 ~3131 06a62~ KEYPR JSM SAV~P SAVE BADDR
2~62 03132 02a212 LDA .SL!BF
2063 03133 031400 STA ~ADDR
2064 03134 ~61055 JSM G~EXT SET UP FOR TA~LE SEARCH
2065 03135 B27152 LDB K~BA
2066 ~3136 160175 JS~ TSRHA~I SEARC~ TABLE
2067 a3137 ~67153 J~p RCAL NOT FOUND
2068 03140 ~74742 SER 16
2069 e3141 03~432 5IB D~QS~
2070 J3142 ~50024 AND .7
2071 03143 ~03145 hCA JTBA A-PEG ~AS OPCODE
20?2 03144 079737 JMp A~I
2073~
2074 Q~3145 103145 JT~A DEF JTBL-l,l
2075 e3146 ~03253 JT~L DEF XRU~ RUN
2076 03147 003310 DEF XSCR SCRATCH
2077 ~3150 ~03330 DEF ~LST LIST
2078 ~3151 a03261 DEF XKEY FETCH
2079~
20B0 ~3152 OB7155 KTBA DEF KTBL~KTBLll
'; 267
10~ 4
PA5E 0Q45 *fl1 DfFINE-~-KE~-ROUTINFS
20~2 e3153 ~60633 RCAL JSU ~ES~l RESTORE HADDR
20~3 e3154 063346 J~U HUN~ FIND T~E LOCATION
2084 a3155 160206 KERR JS~ ER~A.I NOT FOUND~ EQROQ
2085 03156 ~74517 L~A B~l
2a86 03157 ~31466 S~A LOCL1 SAVE LENGTH WORD
2087 0316a ~70744 SAL 1
208B a3161 0~0136 ACA M5 AssuME oD~ COUNT
20~9 23162 ~72113 SbP ~2 ~ULL DEFINITION?
209~ 03163 ~66045 J~p REED6 YES~ IG~OPE
2091 e3164 ~31473 S~A CCNT SAVE CHAR~CTER COUNT
2092 ~3165 035470 BT9 L2T1 SAVE LOCATION
2093 03166 ~74070 SI~
2094 03167 0?4517 LDA B-I LOnK AT LI~E #
l 2095 ~317~ ~74070 âl~ *~1
~ 2096 a3171 e7011C 52A ~'2 IS THIS ~ TypING AID?
2Q97 03172 067222 J~p KF~X NO -
2098 e3173 074744 SBL 1 YES
2~99 ~3174 635740 SlB TMP SAVE C~ARACTER PoINTEQ
2100 e3175 ~74002 S~R 1
2101 U3176 e05466 A~B LOCL1
2102 03177 ~04134 AD9 M3
2103 032~ ~74517 LDA ~-I LOOK ~T LAST WORD
2104 C3201 ~50105 AND B377
2105 032a2 a704~0 SZA 4-9
21~6~
2107 e3203 Q45473 IS2 CCNT CORRECT COUNT
2108 03204 Q10100 CPA AST~1 CHECK FoR
2109 ~3205 067207 J~P ~-2
2110- 032~6 666045 J~P REED6
2111 ~3207 ~74517 LDA B-I
2112 03210 a50157 A~D M256
2113 A3211 ~40027 IOQ AIEX1 IEX CO~F
2114 ~3212 ~67220 JMP ~6
2115~
2116 93213 ~74517 LOA B-I
2117 ~3214 ~13362 CPA ASTQ2 C~ECK Fn
2118 03215 ~67217 J~P ~'2
2119 e3216 ~65045 J~p REED6
2120 63217 J2~363 LDA AIEX2 IEX CODE
2121 ~3220 074557 SIA B-I
2122 03221 0~6~45 J~P REE~6
2123
2124 03222 a74517 RfNX LDb B-I C~ECK FDR LEGITIM~TF FU~CTIO~
Z125 e3223 ~50065 - AND K1 (0760afl)
2126 ~3224 olaJo4 C~A K2 ~0100~fl)
2127 e3225 076130 RI8 ~'Z
2128 ~3Z26 067246 JMP RRU~ NOT DFF
2129 03227 074517 LDb B-I
2130 e3230 053.357 A~D K3 (176037~
2131 e3231 ~1336~ C~ ~4 (01~037)
2132 ~3232 ~67234 J~P ~Z
2133 e3233 067246 J~P RRUN ~OT DEf
2134 ~3234 32C16Z LOA F~
2135 ~3235 831754 S~A AQ2 ~FN~
2136 e3236 07451? LDA B-I
213~ G3237 ~?0202 SAQ 5 E~TRACt THE LETTER
26l~
10~;44
PAGE 0046 ff01 DEFINE-A-KE~-ROUTINFS
2138 ~3240 650040 AhD ~31
2139 ~3241 ~401al IOR B100
2140 ~3242 ~70404 S~L ~
2141 e3243 e31755 S~A AR2-1 "~("
2142 ~3244 027361 LD8 ALCLl GET POINTFK
2143 ~3245 a66246 J~p RFNXl SET UP coU~T
2144~
2145 G3246 061225 QRUN USM LDEF LEAVE DEF MODE
2146 e3247 ~25470 LD8 L2Tl YES. CAN RUN
2147 e32s0 063336 JSM SUMP
2148 ~3251 ~70742 SAR 16
2149 G3252 ~66157 J~p CONTK CONTINUE F~OM BEGIN~ZNG OF KEY
2150-
2151 63253 ~61225 XRUN JSM LDEF INSURE NnT IN KEY MOnE
2152 e3254 063346 JSM HU~T
2153 Q3255 ~67155 ~p KERR KEY U~DEFINED
2154 e3256 063336 JSM SUMP SEt UP PROGRAM POINTERS
2155 03257 67a742 S~R 16
2156 ~3260 16~171 Jhp RU~.T RUN
2157~
2156~ . -
2159 03261 ~61225 XKEY JSM LDEF INSURE NnT IN DEFINITION MODE
2160 03262 063346 JSM ~UNT FIND THE LOCATION
2161 e3263 ~63270 JS~ NEWK NOT FOUND- NEW KEY RE~UIQED
2162 ~3264 063336 JSM SUMP
2163 a3265 G60651 JSM INITS INITIALI2E STACKS
2164 C3266 ~70742 SAR 16
2165 e3267 Q66254 J~p EFET~l FETCH FIRST LINE
2166~
2167 ~3270 160242 NEWK JSM DcoMA~I DECOMPILE PRoGRAM
2168 ~3271 G21405 LCA FWUP ADD A NEW KEY TO DEFINITIO~ ARE4
2169 e3272 031476 SlA tEMp3
2170 ~3273 ~20017 LDA ~2
2171 ~3274 160250 JSM OVCHA~I CMECK FoQ OVERFLO~
2172 ~3275 ~61121 JSM MVtOH M0VE COQE
2173 h3276 021751 LOA TMPS
2174 ~3277 1314~5 STA FWUP-I STOQE ~F~I KEY
2175 ~3300 ~45405 ISZ FWUP
2176 e3301 ~254es L~8 F~UP
2177 ~3302 045405 lSZ FWUP UPDATE FWUP
2178 C3303 ~2aO12 LDA .1
2179 03304 074557 S~A 8~I INITI~LIZE LENGTH ~ORD
2140 ~3305 045424 ZSZ P~UFF
2141 ~3306 045424 ~EWKI iSZ PBUFF UPDAtE PBUFF
21B2 e3307 170402 QET
~6~
lV;~
PAGE 0e47 ~01 nEF'NE-A-KE~-ROUTI~FS
2184~
21BS~ SCRATCH ~ KEY
2186-
21B7 e3310 ~61225 XSC~ JSM LDEf I~SURE NOT IN DEf I~ITION MODE
21B8 B3311 160242 JSM DCO~I nECO~PILF
21B9 03312 ~63346 JSM HUNT FIND THE LOCATION
2190 ~3313 164174 J~P RD~DA,I NOT FOUND- IGNORE
2191 03314 074117 LDA B
2192 03315 c7a437 ADB A-I END OF A~EA
2193 63316 ~00132 A~A Ml STAPT OF AREA
2194 ~3317 031477 XSCQl SIA TEMP4
2195 ~332~ 160251 JS~ CLPlA.I CLOSE UP AREA
2196 ~3321 ~2;405 LGA FWUP
2197 ~3322 074017 ADA B
219B ~3323 03140' SlA F~UP UPDATE FWUP
2199 C3324 ~05424 AD~ PBUFF
2200 03325 e3s424 SIB P~UFF UPDATE PBUFF
220~1 ~3326 ~6~651 JSM INITS INITIALIZE STAC~S
22~2 e3327 164174 J~ip RDYD~.I RETURN TO MONITOR
2203~
2204~ ~IST A DEFI~ITION
2205~
2206 e3330 05334h XLST JSM ~u~t FI~D ~E LOCATION
220~ e3331 ~6761~ J~p XLSTl~l NOT FOUND
2208 ~3332 074117 LDA ~
2209 03333 07043' A~B A-I ENO OF ~REA
2210 ~3334 e7a07i~ SIA ~1 START OF AREA
2211 e3335 ~67614 J~P ~LSTl LIST DEFJ~ITIO~
221Z-
2213~ SET UP MISC-LLANEOUS PoI~TERS
2214~
2215 ~3336 021424 SU~P LDA PBUFF
2216 e3337 03142' STA PQUFO SAVE OLD P~uFF
2217 e3340 03542~ STB UKPt~
221B ~3341 ~35424 S~Q PBUFF
2219 Q3342 ~74517 LOA B.l
2220 e3343 C70~3' ACQ A
2221 ~3344 ~3542~ Sl~ PBPTP ESTABLIS~ NE~ PBP~Q
2222 e334s 06730~ J~P ~EWKl
?70
10~ 64~
PAGE 0~48 #01 DEFINE-b-KFY-QOUTINFS
2224~
2225~ SUBQOUTI~E TC FIND A DEFINED KEr AREA
2226-
2227~ ~EtUQN TO P~ IF NoT FOU~
2228- QETUQN T0 P~ IF FOU~D WITH P-REG = A~DRESS OF L~NGTH WORn
2229~
2230 ~3346 ~24166 HUNT LO~3 FWA~ START SEARCHING 4T FhAM
2231 ~3347 ~15405 HUNl CP~ FWUP
2232 ~3350 170402 ~ET UNDEFINED
2233 a3351 074517 LDA B I
2234 a3352 074070 SIB ~ 1 EXTQACT THIS KEYCODE
2235 e3353 011751 CP~ TMP5 AND Co~pAQE WITH DESI~ED
2236 ~3354 B64357 JMp ~ETN2 FOUND IT
2237 e3355 074437 AOB a- I
223B B3356 067347 JMp HUNl
22~9-
2240~ CO~S~ANTS
2241-
2242 eo065 Kl EGU 0PMsK ~076000)
2243 eO004 ~2 EGU ~10K ~0100~0)
2244 a3357 176e37 K3 OCT 176a37
2245 03360 612037 K4 OCT 012037
2246 03361 003730 ALCLl DEf ~2~AQ2
2247 801¢0 ASTQl EOU B52
224B 63362 625000 ASTQ2 OCT 025000
2249 ff0a27 AIEXl EQU 11
2250 ~3363 ~QS4¢g AIEx2 OCT 005400
271
l~ fi44
PAGE 0~49 ~el SYST~M ~A~LEs
2252~
2253~ NON-FOQ~ULA OPEQ~T0~S
2254'
2Z55 ~3364 052110 -OP13 A5C 2 tH~N
e3365 04?516
2256 e3366 l5all7 OCT 150117 tHENS 20
2257 23367 C43321 ¦ OCT Q'l3321 Of 21
2258 e3370 0432~3 FtA~E OCt 43203 F 3
2259 03}71 042704 OCt 42704 E 4t EOT
2260 63372 ~41206 OCt 41206 B 6
2261 03373 ~542~7 OC~ 542~7 X 7
2262 g3374 027710 OCT 27710 ~ 10S EOT
2263 ~3375 027311 OCt 27311 .3 11~ EOT
2264 ~3376 ~51524 ¦FOPST ASC 2 StEP
~3~77 ~4Z52~ -
2265 ~3400 156524 OCT 1$6524 STEP 35
2266 03401 047736 OCT ~47736 TO; 36
2267 63402 047522 OR ASC l OQ
226H e3403 1131~1 OCT 113101 OQ; 26
2269 034~4 047104 ASC l ND
2270 e3405 153516 OCT 153516 AND; 27
2271 B3406 04~524 ASC l OT
2272 -~3407 154076 GTE ~Ct 154076 NOT; 30
2273 e341C C36631 OCT 035631 >=; 31
2274 03411 ~36075 A5C 1.<=
2275 ~3412 ~15~74 OCt 115a74 ~= ~2
2276 B3413 S37320 OCt 03732fA <~; 20
2277-
2~t8~ SYSTFM COMM ~ND JU~P TABLE
2279
2280 C3414 C04322¦ A~5 FLt-~
2281 e3415 0043221 A~S Fl~ED~~
2242 e3416 o0e437l ~S Pt~P~
22B3 B3417 176534¦Lf3Ll A~S CON~-~
2284 ~3420 ~01237 A~S DELEt-*
2Z85 Q3421 B01244l A~S RENUM-~
2286 03422 ~4335 A~5 t~OQ~L-~
Z2~7 Q3423 ~04331 A~5 TQACE-~
2288 ~3424 O~P151 A~5 AUTO-4
2289 e3425 1766261 A~S EFET-~
2290 93426 000155 A~S LISTC-g
2291 e3427 OQlZ12 A95 SCQAT-~
2292 C3430 ~01311 A~S RUN-~
2293~
2294~ SYSTE~ COMMA~D ~A~E TA~LE
2295~
2296 03431 Ç511R5 C~D13 ASC l RE
2297 C3432 ~4721~ 0CT 4721R QEN; 001000
2298 03433 ~42105 ASC l~DE
2299 C3434 ~462~1~ OCt ~46271 DELETE; 1
2300 93435 Ç50124 A5C I PT
2301 03436 e4065~ OCT 4~653 PTAPE; 1011011
2303 03440 ~154214 OCT 54214 FI~E~)~ 00~100.
2304 e3441 ~143114 ASC 1 ~FL
7305 B3442 li52215 OCT S;2215 FLO~T; 001101
27~
lO~f;644
PAGE OOS0 ~Ol SYSTEM TA~LES
2306 03443 052122 ASC 2.TQbC
B3444 ~4a5~3
2307 C3445 042666 OCT 4266~t TRACF; 110110
2308 ~3446 ~47117 ASC 3.NOR~AL
e3447 651115
a34s0 a40sl4
2309 Q3451 1035e3 OCT 103503 NOQMbL: 000111
2310 03452 047516 ASC 1 ~O~
2311 63453 ~52252 . OCT 52252 CONT: 101010
2312 C3454 651524 ASC 2~sTop
~3455 B47520
2313 03456 1375Ql OCT 137501 STOP; 111111 t~o JUMP)
2314 ~3457 ~52524 ASC l -UT
2315 03460 0476e5 OCT 47605 AUTO 000101
2316 C3461 051524 ASC 2.sTOR
a3462 047522
2317 e3463 042600 OCt 42600 STO~E; a00000 (NO JUMP)
2318 C3464 046117 ASC 2~LOAO
a3465 040504
2319 e3466 110114 KTBL OCt 110114 LOAD; 010000 ~NO JUMP)
2320 Q3467 ~44523 ASC 1 ~ IS
2321 03470 ~52203 OCT 52203 LISTs 000011
2322 03471 051125 ASC l-RU
2323- ~3472 047241 OCT 047241 QUN~ 100001
2324 e3473 oslse3 ASC 3,SCPaTC
e3474 ~51101
~3475 ~52103
2325 e3476 644202 OCT 44202 SCRATCH: 000010
2326 ~3477 0431e5 ASC 2.fETC
~3s~a ~52103
2327 83501 ~44344 OCT 44344 FETCHS 100~00
273
lO~j6~4
!
PAGE 0eSl #91 SYNTAX
2329-
2330~ DATA STATEM-NT SyN~hx
2331~
2332 23502 ~45706 DATAS lSZ SBPTQ
2333 B3~a3 061156 JSM CO~ST LOOK FOR ~ NuM~ER
2334 23504 160206 NDATA JSM ERRA~I NOt FOU~D
2335 ~3505 169244 JSM NUMOa,l FOUND: SToRE lN SYNt~X PUFFER
2336 83506 0605a4 DATA2 0SM COMC~ COMMA?
2337 e35a7 065151 JMp EOST ~~
2338 B351a ~67502 J~p UATAS
2339
2340~ FORMAT ST~TE~ENT SY~TA~
2341~
2342 ~3511 e61QS5 F~TS JSM GNEXT GET FIRST CMAR OF ~EXT SPEC
2343 03512 060750 JSM DIGCK DIGIT?
2344 e3513 067521 JMp FMTF NO
2345 e3514 ~35724 STB GfL4G YES~ SET FOR EQROR O~ OVERFLO~
Z346 83515 ~55400 DSZ BADDR FETCH AND
2347 e3516 024161 LDP MAxs~ STORE
2348 03517 c6e666 JSM PGI~T QEPEAT FIELD
2349 e3520 ~67522 JMP *~2
2350 e3521 6457a6 FMTF ISZ SBPtR ~OVE TO NEw WOQD
2351 e3522 a27ss2 LDB FADD LOOK FO~
2352 e3523 06as46 JSM S~EXP "F" OQ "E"
2353 e3524 G67537 J~p FMTB NOT FOUND
2354 ~3525 G24161 LDP MAXS~ FOUND$ FETCH AND
2355 e3526 06~666 J5~ PGIh~ STORF FIELD ~IDTH
2356 e3527 C2755: L~ ~ A~D LOOK FOQ
2357 G353~ ~60546 JSM STEXP
2358 a3531 16a206 FMTER JSM ER~A-I NOT FOU~D
2359 e3532 ~24161 FMTD LD~ MAXS~
2360 33533 861131 JSM PGIN0 FE~C~ D~GIT FIELD. ALLOW 0
2361' ~3534 261153 FMTC JSM EOLCK EOL?
2362 03535 06a51l' JS~ CO~CE NO. DEMAND A CO~MA
2363 03536 067511 J~p FMTS GET MEXT SPEc
2364 03537 027554 fMT~ LDB BADD
2365 e3540 06~546 JS~ STEXP SE4RCH FOP "B", ~lX'~, OR
2366 ~3541 06754 JMP FMTOT ~OT FOUNO
2367 O3542 ~61QS' JSM GNEXT FOUND
2368 t3543 045706 ISZ SBPtR
2369 Q3544 06~534 JhP FMTC DEMAND CoMMA O~ EOL
23?0 ~3545 al0a43 FMTOT CPA B42 oUOtE?
2371 ~3546 ~67550 JMp ~2
23?2 O354? ~6?531 JMp FMTER NO
2373 ~355~ 16Q245 JSM GtStA~I YES- GET ~UOTE FIELD
2374 ~3551 &67534 J~P fMTC
Z375 e3552 60676Q fADD DEF FTA~L~FTABL
2376 O3553 ~06772 .ADD DEF fTAqL~FTABL~l~
2377 ~3554 006764 BADD DEF FtA~L~FTABL~4
2379 GOTO AND GOSU~ STATEMENt SY~TAx
2381 ~3555 ~6a626 GOtOS JSM SAVFP SAVE BAnDQ AND S~PTR
2384 03560 G67572 JSM L~U LOO~ FOR A LINEONNUQROR FR~M INtCK
27~ :
10~ 4
PAGE 0~52 #Bl SYN-AX
Z355 Q3561 a6~640 GOTOl JSM RES8P RE~JOQE POINTERS
2386 ~3562 16~20Z Ja~ FSCA.I FETCM FORMULA
23~7 ~3563 P27574 LD~ OfA
23S8 e3564 B6~546 JSM STEXP STO~E "OF" AS EXPANDFD OPEQ~tOR
23B9 ~3565 1602~6 MISOF JSM ERRA,I NOT FOUNn
2390 e3566 J6~664 GOTO2 JSM LNUM FETCH LINE NUM8ER
2391 Q3567 C61153 Ja~ EOLCK EOL?
2392 G3570 ~6a51 a JSM COMCf DE~ND A CO~MA
2393 e3571 ~675~6 JMp GOrO2
2394 e3572 G61153 GOTO3 JSM EOLC~ EOL~
2395 ~3573 067561 JMP GOTOl ~O- TRY FOQ A FORMULA INSTEAD
2396 03574 B06755 OfA DEF FOP13~FOP13~5
2397~
2398~ AUTO SYSTEM COMMAND
2399-
2400 035?5 C63647 AUTO JSM GETLN GET oPTIoNAL PA~AMETER5
24~1 e35?6 020061 LCA .10
2402 ~35?7 524061 LD8 .1~
2403 23600 ~3142? S~A .LNU~ SET INITIAL LINE NUM8ER
24~4 ~3601 03543~ ST~ LNINC SET INCREMENT
2405 23602 164173 JMp PEXMA~I
2406~
2407~ LIST EXFCUTION
2408~
2409 23603 a61055 LISTC JSM GNExT GET NExt CHAQACTEP
2410, ~3604 G13627 CPA 843 l~"?
2411 a3605 067623 J~P LSTC2 YES.
2412 g3606 ~55400 DSZ BADDR RESET Po~TER
2413 e3607 ~53647 LSTCl JSM GETL~ GET OPTIONAL LINE #~S
2414 03610 670742 SAQ 16
2415 036ll 224a56 LD,B ~lE4
2416 ~3612 G60730 JSM GETAD GET ~DD~ESSES
2417 23613 ~21477 L~A TEMP4
241S D3614 160122 XLSTl JSM LIStA~I LIST
2419 ~3615 160170 JSM CLERA.I CLEAQ BUFFER
2420 03616 025412 LD8 LSTPT
2421 Q361? 074~76 TCB
2422 03620 0~5413 AD~ HSTPT COMPUTE WORDS 8ETWEEN STACKS
2423 e3621 160210 JSM OUTIA~I PUT I~ RUFFE~
2424 03622 164173 J~P PEx~A~l
2425 03623 06~664 LSTC2 JSM LhUM FETC~ SE~ECT CODE
2426 e3624 574204 S~L 12
2427 e3625 ~35447 St8 SLCOD
2428 e3626 067607 J~P LSTCl
2429 P3627 40a~43 ~43 OCT 43
2430~
2431~ STOP ST~TFMENT SYNTAX
2432~
2433 e3630 g65147 J~P ENDS
2434 e3631 C21416 STOPS LOA MODE
2435 e3632 C71711 SLA STOPS-I SKIP Tf P~OG
2436 e3633 063647 JSM GETL~ GET P~RAMETERs
2437 ~3634 ~2~56 LDA ~lE4
2438 e363s e24d56 LDB ~lE4 SET DEFAULT PARA~ETEQs
2439 63636 ~6~741 JSM fND-1 FIND ADDQESS OF flRST
2440 e3637 ~15423 CPB P8PTQ PAST END nF PRoG?
\
275
644
PAGE 0~53 #~1 SYN-AX
2441 ~3640 ~74742 SeR 16 YES- CLEAP FLAG
2442 e3641 035436 STB ~fLGl
2443 R3642 ~6074~ JSM FND-2 FIND ADDQESS OF SECOND
2444 e3643 ~15423 CPB PBPTQ
2445 ~3644 ~74742 53R 16
2446 ~3645 ~35437 SIB HFLGl~l
2447 C3646 164174 J~p RDYDA.I
244
2449~
2450- SU9ROUTINE -O BUILD AND STO~E N>0 LINE NUMPERS
2451- RETUR~ TO P~l~NONE GIVEN
2452~ P~2:1 GIVEN ~A)=NUM8ER
2453~ P~3:2 GTvEN (A)=FIQST~ (B)=SECOND
2454~ NUM8EQS A?E STOQED SEPARA~ED ~Y COMMAS IN S-~UFFER
2455~
2456 ~3647 e61066 GETLN JSM GETSK GET NEXT CHAQ
2457 03650 170402 ~Et ~ONE GIVEN
2458 ~3651 06~750 JSM DIGCK DIGIT?
2459 03652 067647 J~P GETLN NO- IGNOR IT
2460 e3653 ~60663 JSM L~UM-1 ~UILD FIQST INTEGER
2461. 03654 ~35720 Sl~ LAStN SAVE lST ~
2462 ~3655 610031 CPA EOL END OF LINE?
2463 03656 a67662 J~P GETL2 YES-RETURN TO P~2
- 2464- e3657 060365 JSM ~ET2 INCREMENT RETuRN ADDRESS
2465 Q3660 G6a510 JSM COMCE FINV AND RECORD A CO~A
2466 ~3661 06a664 JSM LNUM GET NEXT LINE NUM~ER
2467 ~3662 ~21720 GETL2 LDA LASTN MOVE'TO (A~
2468 e3663 064357 5ETLR J~P RETN2 RETURN TO P~2 OR P~3
~ 2469~
2470 03664 OOOO0~ ~SS 1 }**~*~*CMECKSUM*******
2471~ ,
2472~ CLEAR ROUTI~E
2473
2474 e3665 ~70742 ECLR SAQ 16
2475 03h66 C31430 STA LNINC CLEAR AUTO MODE
24~6 t3667 17~402 ~ET PErUR~ To P~l
2477~ 3677 ~S L4S~
247q~ M~rH tA9LES ~EQE
.
27~:;
10 ~t~6'~
PAGE 0~54 ~01 983~--MONIIOR
24~0
2481 ~400~ OkG 40~0~
2483 ~,4a0a 02a116 ENTRY LDA Q~OP CLEAR THE BASE PAGE
2484 84001 170000 CLR
2485 e4002 000135 ADA M4
24a6 04003 a7371~ ~ZA ~-2
2487 e4004 ~24066 LC3 INF DETE~MINE THE
24~P e4005 004160 M~wCK AOB M1024
2489 ~4006 ~74577 STB B-l
2490 04007 074477 CPB B-I LAST ~ORD Of R/W
2491 0401a ~66012 JMp ~-2 YES , IT WAS
2492 e4011 066005 JMp MAWcK C~ECK NEXT PAGE
2493~
2495' 04012 074557 S7A B-I INITIALIZE LAST WORD
2496 ~4013 ~35423 S~B MAW
2497 04B14 ~04132 ~CB Ml SET THE POINTER
2498 04015 ~35404 57B L~A~ TO THE LAsT AVAILA~LE WOQD
2499 a4~16 ~24116 LOB REED
2500 04017 e35462 ST9 QEEOL INITIALIZE KEY~OARD LINK
2501 04020 g24207 LDB INTEA
2502 04021 ~35463 STB INTEL IhITIALIZE INTERRUP7 LINK
2503 e4~22 ~20026 LDA ~9
2504 04023 e31452 57A CPLAC SET DECIM~L SETTING TO 9
2505 e4024 ~31451 SlA CTYPE SET MODE TO "FLoAT"
2506 ~4025 ff45434 ' ISz UNITS INITIALIZE TO Q~DI~NS
2507 ~4026 e45450 ISZ P~ODE INITI~ALIZE TO N0RMAL
250~ Q4027 02q166 KILLK LOA F~AM INITIALIZE STAQT OF
2509 04030 0314a5 57A F~UP USER PROGRAM(SCRATCH KEYS)
2510 ~4031 ~20112 KILLP LD~ ~STKA INITIIALIZE RETuR~
2511 ~4032 a31777 57A RSPTQ POINTER
2512 e4033 062734 JSM 5CQP INITIALI7E PROGRAM POINTEQS
2513 04034 ~6i233 JSu LDEF-fi RESET USEQ KEY POINTEQ
2514 04035 ~60645 KI-LV JSM hINlT INITIALIZE SYMBOL TA~LE
2515 ~4036 060651 JSM INITS INITIALIZE STACKS AND fLAGS
2516 04037 ~?a742 ROYPT SAQ 16
2517 ~4040 e31433 ~A TFLAG CLEA~ PT~PE FL~ç
2518 e4a41 031430 SIA L~INC SET TO ~A~AL
2519~
2520 ~4042 16a170 JSM CLER~I CLE4R DlsPLAY
2521 ~4043 ~31622 5lA TERM QESET CRLF FLAG
2522 Q4044 ~0742 PEXMK SAR 16
2523 04045 ~31701 S~A NDISP
2524 ~4046 031702 5~A NpRIN
2525 04047 021432 PEXM2 LDA DRQST
2526 0405a ~70510 S~A PEXM3 SKIP IF NoT DAT~ QEOUEST
2527 04051 d20012 ~DA .1
2528 e4P52 026267 LD~ ~MRKA PQINT A ?
2529 ~4053 061330 JS~ .~PWQ
2530 O4054 066100 ~MP REX~I
2531~ PTAPE SYSTEM CO~MAhO
2532 04055 e31433 PT~PE STA TFLAç StORE DEVTCE CODE
2533 ~4056 07~110 ~ 2
2534 C4057 ~64726 JMp SYE25 SELECT ConE NOT GIVE~
2535 e4062 G20132 LDA M1
277
10~ 4
PAGE 0~55 #01 ~30~-MoNIToR
2536 04061 ~31742 STA TMP2 SET FLAG FOQ L~ADEQ
2537 ~4062 0?0742 'EXM3 SAQ 16
2538 e4063 631442 STA STPFL CLEAP THE STEP-5Top FLA6
2539 e4D64 ~20127 LoA B170K
2540 04065 ~31447 5lA SLCOD SET TO STANDARD PRINTER
2~41 Q4066 ~21420 LDA BADDR
2542 04067 ~10212 CPA .SLBF BLAN~ SCREEN?
2543 e4270 066072 JMp ~2 YES
2544 ~4~71 066100 JMp ?EXMI
2545 ~4072 026264 LOB LTADn GET ADDRESS OF LA2Y-T
2546, ~4073 ~21422 LCA UKPTQ
2547 04~74 ~70170 SIA ~3 S~IP IF NoT KEY ~ODE (A)=l
2548 ~4075 ~4134 ADB M3 GEt ADD~FSS Of KEY-LAZY-T
2549 e4076 020021 LCA .4
Z550 ~4077 ~61335 JSM NPWQT WRITE ON DISPLAY
2551~
2552 e4100 e24112 PEX~l LDB RSTKA
2553 84101 035777 5~B RSPTQ QESET STAcK
2554 ~4102 020041 AL~UM LOA .32
2555 Q4103 0317~7 STA BLANK SET TO IGNOR ~LANKS
2556 ~41a4 ~21430 LDA LNINC
2557 041a5 070410 52A GTRCl SKI3 IF MANUAL
2558 ~4106 621701 LDA NDISP
2559 Q41a7 672350 k~A GTRCl~l SKIP IF MEssAGE ON SCREEN
2560 C4110 160170 JSM CLERA.I CLEAP OFF LAZY-T
2561 04111 025427 LO~ .LNU~
2562 a4112 160210 JSM OUTIA.I .PUT LINE # IN BUFFER~
2563 C4113 ~45400 ISZ BADDR oUTPuT A SPAcE
2564 e4114 066116 J~P ~2
2565 e4115 0~1427 GTQCl SlA .LNUM SET LINE # IF MANUAL
2566 ~4116 1614h2 GTRCD JSM REEDL~I READ ~ECORD
2567 04117 ~66042 ~p PEXMK-2 ~ULL RECORD
2568 04120 ~61062 JSM GFRST GET FIRST CHAR I~ (A)
2569 ~4121 e66042 J~p PEXMK-2 NULL RECOR~
2570 e4122 074?42 S9Q 16
25~1 e4123 G35724~ ST~ GFL~G SET FLAG ~OR INTEGER ERQOR
25?2 t4124 C25432 LDB DROSt
2573 e4125 0?4730 SI8 CKRCD SKIP IF NoT DAT~ REOUEST
2574 ~4126 ~35642~ STB SAVE SAVE QETIJRN ADD*ESS
2575 e4127 074742 SBR 16
25?6 ~4130 035432 ST~ ~ROST CLEAR THE INPUT ~LAG
2577 04131 035416 STB MOD~ SET TO PRO~.RAM EXECUtION MODE
2578 04132 160Z37 JSM SAL~A.I STATEME~T GIVEN?
2579 04133 066260 JMP GTRC2 ~0
25a0 04134 e20127 GTRC3 LDA ~170K YES
2582 4136 22270 STA SLCOD SET TO STA~DARO PRINtER
2g84 34140 061062 JS~ GFRST SET TO CALC SYNTAX MODE
2585 a4141 ~00a00 . NOp '~ CHECKSlJM
25S6 04142 ~65154 JMp S~NTX
2587 d4143 e25416 CKRCD LCB MODE
2588 ~4144 074111 SLB ~'2 SKIP IF EOL
2589 04145 ~66154 JMP SrNTX EXECUTE? DONT ALLOW LINE #
a4146 0101~0 C~A STAQ FI~ST CMA~ AN "*"?
2591 04147 066251 J~P UKDEF YES
27~3
:10~;44 1 . - - -
PAGE 0056 ~01 9530--MONITOR
2~92 04150 060675 JSM INTC~-I BUILD A LTNE Y
2~93 ~4151 035427 5IB .LNUM STORE LINE #
2 94- tA) CONTAINS NEXT CHAR
2'~95 04152 010031 CRA EOL END OF LINE?
2~96 e4153 066500 ~hP DELST YES DELETE LINE FROM CODE
2~97-
2 9B 04'5L 025426 SYNTX ~OB PBPTO GET MAINLINE END POINTEQ
2 99 ~4 S~ 015424 I_PB PaUFF NULL PROGQAM?
2600 04 SO ~62734 JSM SCRP YES INSURE NO SPURIOUS COU~ON EXISTS2601 ~4 5' 6'4026 LDEI 9 SET STORE FLAG FALSE
2602 64 hrJ ~ ',710 SIB MSFLG ~DONT RECOGNISE AS516NMENT)
2603 ~4 6' 0'5413 LOfl HSTPT INITIALIZF
2604 ~416~ 6R4132 ~05 Ml THE S-STAC~
2605 e4 6. 035472 stg TEMPS POINTER
2606 ~4 64 0-4742 SEIR 16
2607 64 65 035711 ~IE DFL~G CLEAR DEFINE FL4G
2608 ~4 66 035714 ~B SFLAG
2609 04_b7 160237 STMT JSM SALTA~l SEARCH TAPLES FOR STATEMENT26 0 e4''0 06h201 Jhp CMND NoT FOUND
26 1 e4 ~I J45706 ~5,7 S9PTR
26_2 ~4_~2 135706 '~lR 59PtR,I STORE THE PAGE
26 3 64 ~3 0'54'6 _DB MODE
~6 4 04 74 ~42 1 LB STMTI SKIP IF PRoGRAM MODE
'6.S ~4 75 ~703~4 ;~L 1~ SHIFT OP CODE
'6 6 ~4 76 ~01 2 ;AM STMTI SKIP IF STMT TYPE IS ALLOwFD
''6 7 64 77 ~623OO NCALC JSM ERROR STMT NOT ALLOWEO IN CALC
'61B C4~0a '65471 STMTl JMP TEMp~t ~RANCH TO CODE POR STATEMENT
~619 ~4'0_ ~241.~ CMND _GF Ml SEARCH TABLES FOR
'6''~ ~4'~'' 6e23~ JSM SALTA~I SY5TEM COMMAND
6 54 ~ 0662' jMp ILET NOT FOUND
''6 ~ 04~~4 07474' CMNDF SlR 16
~6 ~ e4'd5 03543 S 1 CLINE RESET POINTER FOR LIST
Rh''4 04''~h 03~43O S I LNINC RESET AUTO
~6~ r4~ 41h S~q MODE SET T0 PROG
'~ ~4 o ~' 442 S~P SIPFL CLEAQ "STEP" FLAG
h 4~ 0~'4 SAY 4 GET ~ OF PARAMETEQS ALLO~ED
D ~4 ~n 1 52A JCMND 9QANCH IM~EDlATELy
4 q4 _ 6- 3~ JSM GETLA,I GET LINE ~ PARAMEtEQ5
h 1~ i 4 4 ~'~74' SAR 16 NONE GIVFN~ASSUME a
b~4 5 ~24aSh LOB IE4 ONLY ONE GlvENl ASSUME INFlNlTy
b~ 1'4 6 ~1473 JCMND JSM TEMP I RRANCH To CoMMAND ExEcuTloN
0-3- A_ COM~ANO JllMP TO PEAM~ o~ QD~PT EXCEPT fETCH
' h3~- ~MI~H JUMPS tO QEADI THE FOLLOWING TWO INSTQUCTlONs
\ O~'~ AQE REtuRN EXltS FOR READ
~b3b 042l7 G66042 JhP PEX~-2
~03' ~4220 066120 JMp 6TRCD-2
6~8-
~6~4 e4221 070742 ILET SAR 16 GFT SPElcAL CHAR fOR IMPLIED LET
~64~ ~4222 066164 JMP STMT-~ FIND 9LOCK FOQ IMPLIEO LET
~4 -
~4' ~4''3 ~5~4'~ ILETS USZ BADDR
64~ 14' ~ Q6 0 JSM BNEXT RECALL CHARActER
044 ~4-~r ~5r41 d ~5Z 9ADDR
645 ~4 ~6R7' JSM LETC~ LETtER?
646 ~4 ~6h2~ JhP ILETl~l NO~ tRY INPLlEo DISP
~647 ~4 10 ~6~6~6 J5M SAVRP SAVE POINTERS
.
F~ ~ ...... .
10~6fi44
PAGE 0~57 #01 9B3~--MoNlToR
264B e4231 G62274 JSM LETS~ TRY "LET" SNTAX
2649 ~4232 066244 J~iP NSTMT~I OK- CHECK FOR EOL~
265~ 04233 ~6a640 ILETl JSM REsqP QESTOQE PolNTERs
2651 e4234 e20125 LDA P~roP STO~E CODE FOR
2652 ~4235 ~55706 GSZ SBPTR
2653 e4236 131706 STA SBPTR,I IMpLIED LET
2654 ~4237 645706 ISZ SBPTR
2655 e4240 025416 LCB MODE
2656 24241 ~74111 SLB ~ST~T S~IP IF PROG
2657 ~4242 ~62315 JSM PRNTS TRY l'PRINT" SYNTAX
2658 Z4243 062360 NSTMT JSM ERROR NO STATEMENT TYPE C~N BE FOUND
2659 64244 ~61153 JSM EOLCK END OF LINE?
2660 e4245 ~21416 L~A MO~E NO
2661 a4246 670111 SLA ~-2
2662 04247 ~66233 J~p ILE~l TRY PQINT SYNT~X IF CALC ~onE
2663 ~4250 665152 JhP NOEOF
26644
2665 04251 021422 UKDEF LOA UKPTR IN KFY DFfINITION MO~E?
2666 24252 ~72110 RZA ~2
2667 e4253 16C2a6 UKERR JSM E~RA.T NO~ DEFINITIoN NOT ALLOWED
2668 ~4254 ~74742 SBR 16
2669 e4255 1357P6 SIB SBPTQ~I SET A 0 LINE NUMBER
2670 e4256 160253 JSM CHRSA,I ACCEPT AN ASCII STRING
2671 C4257 ~6652~ J~p ACTKY ACCEPT nEFINITIoN
2672~
2673 0426a 024132 GTRC2 LOB Ml
2674 ~4261 16~237 JSM SALTA~I SYSTEM COMMAND IN "INPUT"?
2675 a4262 165642 JMP SAVE-I NO~ RETURN ~ATA TO INPUT ST~T
2676 e4263 066134 Jhp GTRC3 YES- A~ORT INPUT
a677~
2678 C4264 010555 LTADD DEf ~*~S
2679 ~4265 045505 ASC l-KE
2680 e4266 ~54437 OCT 54437 Y-L~ZY-T
2681 04267 C~131 OURKA DEF .63-.~3~1
2652 a42?0 1~0001 CALSN OCT 100001
26S3 00116 IMPOP ECU ~ToP oP CODE 1
2684 ~0125 PQTOP EGU LaOP oP CODE 24
2685 O0100 STAQ E~ BS2
2686 C0123 STDPG EOU RBOP
2687~
26S8~ LEt STATE~ENT SYNTAX
2689~
2690 04271 e62274 LETS JSM LETSN
2691 04272 065151 J~P EOST
2692 04273 160206 SYNE2 JS~ ERQ~.
2693-
2694~ LET SYNTAr $UBQOUTINE
2695~ EXIT P~lS StoRE OCC~RRED
2696~ P~2S NO SToRE OCCU~RED
2697~
2698 a4274 eSS710 LETSN ~SZ MSFLfi ENABLE AssIGNME~T
2699 Q4275 16~2e2 JSM FSC~I GET FOR~ULA
2700 ~4276 025714 LDF SFLAG
2702 B4300 170402 CPB M2 DID A STORE OCCUQ
2703 e4301 ~64357 JMp RETN2 NO
280
104t~6~4
PAGE~Oes8 #01 s830--hoNIToR
2704~
2705~ WRITE AND PRINT StLTEMENT SYNTAX
27a7 e43~2 160265 ~ITF JSM IO~EA-I GET DEVICE AND FORMAT
2708 ~4303 ~6~534 JsM ~PC~E GET QIG~T PAREN
2709 ~43~4 0ss400 DSz ~ADDR
2710 943~5 ~5s706 ~SZ SBPTR
2711~
2712 04306 062315 PQINS JSM PRNTs CHEcK SyNTA~ ~Tn ACTST IF ~K)
2713 ~43~7 16~206 SYElS JSM ERRA,I IMPROPEQ SYNTAX
2714~
2715~ PRINt STATE~ENT SYNTAX SUBROUTINE
2716~
2717 ~4310 010043 PRINl CPA B42 QUOTE?
2718 e4311 066325 J~P PRlN2~4 YES
2719 ~4312 060461 JSM SYMC2
2720 a4313 6120el DEF COMMA-l COM~A OR SEMICo~oN?
2721 04314 ~66321 J~p PRIN2 NO
2722 04315 ~24132 PRNtS LD9 M 1
2723 ~4316 035712 STB PFLAG ENABLE FOR~ULA AND TA8
2724 Q4jl7 ~61e66 JSM GETSK
2725 04320 ~65150 J~P EOST-l
2726 a4321 610~43 PQIN2 C~A B42 QUOTE?
2727 ~4322 ~66324 JMp ~2 YES
2728 a4323 ~66334 J~p PRIN3 NO
2729 ~4324 045706 ISZ SBPTR
2730 ~4325 160245 JSM GTSTA,I RECORD STRING coNstANT
2731 Q4326 ~61153 JSM ~OLC~ EOL?
2732 e4327 074742 S~Q 16
2733 04330 135706 STB 58PtR.I CLEAP OUT NEXT ~ORD
2734 ~4331 ~24132 LOB Ml
2735 a4332 635712 SIB PFLAG ENABLE FORMULA
2736 04333 066310 J~p PRINl
2737 D4334 ~45712 PQIN3 ISZ PfLAfi~ t~F~ OR FOQMULA PEQMItTED?
2738 ~4335 170402 RET NO- RETUQN- IMPQOPER SYNTAX
2739 e4336 026354 LDB TA~A
274~ a4337 16~175 JS~ TSQMa,I LOOK FOR ~TAB"
2741 ~434fl ~66350 Jhp PRIN4 NO
2742 ~4341 070544 SAL ~
2743 04342 G40067 IOQ TYPFL SET PQE-DEFINED FUNCTION FLAGS
2744 e4343 C60454 JSM SBPUD-2 STORE CODE FOR TAB
2745 04344 024133 LDB RBOP
2746 e434s 1357a6 ST~ SBPtQ.I
2747 D434h 16P2~2 JSM FSCA . I GET T~B FORMULA
2748 ~4347 ~6635~ JMp PRIN5
2749 ~4350 1~554~a PRIN4 D52 8ADDR PIACK UP P~)INtER
2750 04351 16a202 Js~ FSCA.2 FETC~ FORMULA
2751 a4352 061153 PRIN5 JS~ EOLCK EOL?
2752 ~4353 ~66310 J~p PRINl NO
2753 04354 ~23?73 Tb8b DEF Tb9~TAR~l
281
1046644
PAGE 0eS9 #01 9830--MoNIToR
275s~
27s6~ OUTPUT EQROQ # ~ 'l P~ l
2757-
2758 e435s G6Q405 AERR JSM XFARl SAVE AR2 IN ARl
27s9 ~4356 06~400 JSM GPAR~ GET ERROR ~ IN ~B)
2760 e43s7 056370 JMp ERR
276l~
2762- OUTPUT ~RQOR # fRO~ ERRoR TA~LE
2763~ .
2764 e4360 05s777 EQQOR DSZ RSpTQ
276s 04361 121777 LDA ~SPTR,I ERROR SOUQCE IN ~A)
2766 OE4362 ~26476 LDB ERBs TABLE ADDRESS IN ~B~
2767 a4363 G74070 518 *~1 INC ADD2FSS
2768 84364 ~744s7 CPA ~-I MATCH?
2769 Q4365 ~74~76 TC~ YES
2770 a4366 e7s6s3 s~p ~-3 CONT INUE IF NO ~AtC~
2771 04367 006476 ADB ER~S COMPUIE NEGATI~E OF ~RROR #
2772 ~43?0 G35706 EQRl SIB SBPTQ SAVE -~ERROR #
2773 04371 02l450 LOA PMODE
774 04372 072350 R~A E~R2
277,s ~4373 G21433 LOA TFLAG
2776 ~4374 6702s0 52A ERR2 SKIP IF NoT PTAPE
2777 0437s 02~60 LDA .10a
2778 e437~ 624211 LDB .BUF~
2779 G4~77 66l337 JSM NDWQT PRI~T LI~E IF PTAPE ~ND P-ALL
2780 ~4400 ~61344 JSM CRLFl
2781 ~4401 02~4l6 EQR2 LDA MODE
2782 ~4402 070112~ SA~ ~z SKIP IF SYNTA~ ~onE
27~3 e44~3 160264 JSM CQCK~I TER~INATE CURRENT LI~E
2784 ~4404 160170 JSM CLFRA,I CLEAR BUFFER
27S5 Q440s 03s622 S~R TERM SET UNTEP~INATE~ FLAG
Z786 e4406 G2~127 LDA B17~K
2787 e4407 b31447 STA SLCOD SET TO STANDAR~ PRINTER
278B ~4410 ~20023 LDA ~5
27es 04411 e26464 LD~ EMSfiA
27g0 04412 C61335 JSM ~PWRt PUT "ERQOR" I~ ~UFFEQ
2791 B4413 0257n6 LDB SaPtR
2792 04414 0?4076 TcB
2793 04415 160210 J5M OUTIA,I ouTPut PosITIvE EQROR #
2794 e4416 92s427 L~ .LNU~ IS A LI~E ~U~BEQ
2795 e4417 ~74310 SZB ERR3 ' APPLICA~LE
2796 a4420 020026 LOA ~9
2797 04421 e264~s LOB L~SGA
27g8 e4422 ~61335 JSM NPWR~ PUT "I~ LINE " IN BUFFEQ
2799 e4423 e2s427 LD8 ~LNU~
2800 04424 160210 JiM OUTI~I OUTPUT LINE
2801 ~442s ~454C0 ERQ3 I~2 BADDR
2802 a4426 04s4a0 ~sz BADDQ oUtPUT ? FLANKS
2803 ~4427 ~21433 LDA TFLAG
2804 ~443a C72110 R2A ~2
2805 e4431 e72~53 SAP ~l-S SET TO ~PPI~T" IF PT~PE
2806 e4432 031453 SIA PRFLG SET "DISP"FLAG
2807 e4433 160176 JSM ELINA~I ouTpuT ERQOR
2808 e4434 160264 JSM CRC~A~I GlvE CRLF IF P-ALL OQ PT~PE
2809 ~443s 0257C6 ERR4 LOB SBPTQ QECALL - (EQROR
2B10 e4436 ~!114132 ~f:E~ Ml ERROR l?
28~
DEMANDES OU BREVETS VOLUMINEUX
11~ PRÉSENTE PARTIE DE C I I E DEMANDE OU CE BREVET
COMPREND PLUS D'UN TOME.
CECI EST LE OME i DE
-
NOl E: Pour les tomes additionel~, veuillez contacter le Bureau canadien des
brevets
JUMBO APPL CATIONS/PATENTS
THIS SECTION OF THE APPLlCATlON/iATENT CONTAINS MORE
THAN ONE VOLUME
THIS IS VOLUME I _ OF ~'
- NOTE: For additional volumes ~clease c~ntac~ the Canadian Patent O.ffice