25012 C_North_Star_Pascal_Version_1_Rev_3_Dec79 C North Star Pascal Version 1 Rev 3 Dec79
25012-C_North_Star_Pascal_Version_1_Rev_3_Dec79 25012-C_North_Star_Pascal_Version_1_Rev_3_Dec79
User Manual: 25012-C_North_Star_Pascal_Version_1_Rev_3_Dec79
Open the PDF directly: View PDF
.
Page Count: 333
| Download | |
| Open PDF In Browser | View PDF |
f\JorthSbrCanpulrzrslnc.
1440 Fourth Street
Berkeley, Ca. 94710
North Star Pascal
Version 1
System Reference Manual
PAS-DOC
Revision 3
25012-C
*****************
*
*
*
**
*
*
NORTH STAR PASCAL
version 1
SYSTEM REFERENCE MANUAL
PASCAL-DOC Rev 3 December 79
North Star Computers, Inc.
1440 Fourth Street
BerkeLey CA 94710
*
*
*
**
*.
*
*****************
t:!Q!1fE
North Star PascaL, version 1, is a speciaL release of the UCSD Pascal (TM)
program development system, prepared jointLy by the Institute for Information
Systems, University of CaLifornia, San Diego, and North Star Computers, Inc.
("UCSD PascaL" is a trademark of the Regents of the University of California,
San Diego Campus.) Version 1 is compatible with UCSD PascaL (TM) version 1.5.
This SYSTEM REFERENCE MANUAL is a corrected reprint of the Yf§Q f~§f~l 1.2
§~§1~m M~D~21.
AdditionaL information, incLuding specific detaiLs about the
North Star impLementation are contained in the ADDENDUM TO NORTH STAR PASCAL
SYSTEM REFERENCE MANUAL, which accompanies this volume.
For technical assistance with difficulties encountered while using or
configuring North Star Pascal, consuLt your dealer, or calL the North Star
TechnicaL HotLine in Berkeley, at (415) 524-9202, during the hours of
10:00am-4:00pm Pacific Time.
********************************
* Copyright (C) 1979 Regents of the University of CaLifornia,
*
San Diego Campus. This software, its source, object,
*
and aLL other forms, is the property of the Institute
*
for Information Systems and may be used or copied by
others onLy with written authorization from the Insti*
*
tute for Information Systems.
*******************************
*
*
*
*
*
*
*
*********************
*
TABLE OF CONTENTS
*
*********************
VeT'S i on
I. 5
SECTION
1 THE UCSD PASCAL SYSTEM
1
INTRODUCTION AND ,OVERVIEW
2
FILE HANDLER
3
SCREEN ORIENTED EDITOR
.,
1-
1
INTRODUCTION
31
:2
GETTING STARTED.
32
3b
3
DETAILED DESCRIPTION OF COMMANDS
4
5
REFERENCE...
EXPER I MENTAL LAHGE F
IL~E
VERSIOf\·1
(f,,2)
51,
33
YET ANOTHER LINE ORIENTED EDITOR - VALOE
1.';
'-.. J
DEBUGGER
Ft\SCAL COMP ILER
7
BASIC COMPILER
LIN~~ER
ASSE~!HLER
99
2 THE UCSD PASCAL LANGUAGE
1
INTRINSICS
STRING
1
INPUT/OUTPUT
11 '1
ll9
1~23
Lel·j l.EVEL GRAPHICS
S
6
129
CHARACTER ARRAY
MISCELLANEOUS.
DI~FERENCES
BETWEEN
1 :3:3
ST\t\NDARD PASCAL
1 :35
1.
Cf'\SE STATEMENTS
13:;
2
COMMENTS
3
4·
1 ~J6
136
EOF .
OYNAMIC MEMORY ALLOCATION
EOLI\;
6
7
FILES
GOTO AND EXIT STATEMENTS
8
PACKED VARIABLES
9
PARAMETRIC PROCEDURES AND FUNCTIONS
10
P ROGR AJ'>1 HEAD I NGS
11
REt!\D AND REpiDLN
138
1:3D
149
loll ~
J·!!-4
11~
?
RESET
1 :3
RE~IRITE
14
SEGMENT PROCEDURES
SETS
STRINGS
WRITE AND WRITELN
IMPLEMENTATION SIZE LIMITATIONS
150
151
EXTENDED COMPARISONS
1 ~~tl,
15
16
17
18
1 S'
20
21
22
1 ~)6
LONG INTEGERS
1 ~j6
UNITS .
136
156
.
.
.
TABLE OF UCSD INTRINSICS
3 IMPLEMENTORS' GUIDES
1.
DHA~JLINE
3
FILE FORMATS
SPECIAL UCSD PASCAL SYNTAX (USE OF)
1
SEGMENT PROCEDURES
;;.~
lJN I '1~8 .
..J,
1 1::0
163
165
"J .. ~L.~'
.. f
A
4
3
LONG INTEGERS "
INTERPRETER NOTES "
;5
INTRODUCTION TO '"HE P.<\SCAL
6
BYTE SWAPPING
179
PSEUDO~-MACHINE
183
201
213
4 UTILITY PROGRAMS
CALCULATOR
LIBRAR IAN .
3
4·
SETUP - SYSTEM RECONFIGURATION
BOOTSTRAP COPIER
PATCH/DUI'1?
(::.,
7
8
9
RT11 TO PASCAL CONVERSION KIT
GOTOXY PROCEDURE BINDER
DUPLICATE DIRECTORY
P-CODE DISASSEMBLER
227
229
~2:j3
.235
237
239
LIBRAR'f MAP " .
243
1
2
3
EXECUTION ERRORS
249
251
253
.5
6
SYNTAX ERRORS
ASSEMBLER SYNTAX ERRORS
AMERICAN STANDARD CODE fo~ INFORMATION INTERCHANGE
P-MACHINE OP-CODES
UCSD PASCAL SYNTAX DIAGRAMS
10
8
A
.""..
21.7
221
IORESULTS
UNI TNUt'tBERS
PEN8TATES .
257
261
265
267
26liA
ADDENDA, ERRATA AND NOTES
NOTES ON OTHER MATERIALS AVAILABLE
BRINGING UP THE PASCAL SYSTEM
.t
2
3
4
ON PDP-l j, . . . . . " .
ON 8080/180 SYSTEM WITH CPIM AND 3740 DISKS
DIFFERENCES AMONG IMPLEMENTATIONS FOR DIFFERENT PROCESSORS.
CHANGES MADE IN 1_ 5 FROM (1.4; I.4b) SYSTEMS
B INDEX .
" .
)~
..
~
~
,.:.:, ( .i.
273
277
279
NEW SUBSCRIBERS: See Section A for details of bringing up
UCSD Pascal on your machine.
DISCLAIMER~
These documents and/or the software they describe
are subject to change and/or correction without
notice.
The tJCSD Pascal ProJect cannot be held
responsible for implementations on processors where
the imp lemt.'!ntation work was not done at UCSD,
Users
with systems obtained From sources other than UCSD
must contact their supplier for support.
ACKNOWLEDGEMENTS:
The work described in these notes bas been supported
significantly by the following organizations:
United States Navy Personnel Research and Development
Center, Sp~rry UniVac Minicomputer Operations, EDUCOM,
Di 9 ita 1 Eq u i pmen t C OT'P orat ion, Proc essor Tec hnc 1 og y
Inc., Springer-Verlagl Terak Corporation, General
Automation Corporation, The UCSD Computer Center,
grants from thE University of California Instructional
Improvem~nt Program,
Te~trnnix Corporation,
Micropolis
Inc., Computer Power and Light, Phillips Research Labs,
Lawrence Livermore Labs, Pascal Computing.
The work described in these notes has been made possible
by the drive and direction of the Director of the lIS:
Kenneth L.
Bowle~
Documentation Authors:
Ac k land, S. Ddle Ander, Lucia A. Bennett,
Charles "Chip" Chapin.
Gary ...J,
Julie E. Erwin, Shawn M. Fanningl.
Mary K. Landauer, J. Raoul Ludwi g, Joel J. McCormac k,
Mark D. Overgaard, Keith A. Shillington,
David A. Smi th Roger T. Sumner, Dennis J. Vol peT'.
Gillian M.
Raymond S.
Causey!
o i. smll k eSt
I
Software Authors:
Dale Ander} Marc Bernard, Charles "Chip" Chapin,
Greg Davidson, Barry Demchak, William P. Franks,
C. Richard G'f'unsky, Robert J. Hofkin, Albert A. Ho-Pfman,
Richard S. Kaufmann, Peter A. Lawrence, Joel J. McCormack,
Mark D. Overgaard, David A. Reisner, Keith A. Shillington,
David M. Steinor~, Roger T. Sumner, Steven S. Thompson,
David B. Wollner.
S.
J.
Collected and Edited by:
Keith Allan Shillington and Gillian M.
Ackland.
***************************** ***************
*
INTRODUCTION AND OVERVIEW
* *
Section 1. 1
*
***************************** ***************
VeT'sion I. 5 September 1978
The UCSD Pascal system described in the following document is a
system intended to run on stand alone micro- and mini-computers.
This
system is highly machine independent since it runs on a pseudo-machine
interpreter commonly referred to as the uP-machine".
All the system
softwa~e
is written in Pascal,
except
fo~
the P-machinQ
inta~p~Qt8~
and
a few run-time support routines written in assembler for efficiency,
resulting in relatively straightforward software maintenance and
enh~'lncement.
The system is designed to be used primarily with a CRT teT'min~l
acting as the CONSOLE devicei howeverl the system is flexible enough to
be reconfigured for slower hard-copy terminals.
For further
information rega~ding coropatability between various types of equipment
and this system see the "SETUpu document in Section 4.3.
This docume'(1t
is intended for programmers who are familia~ with the Pa$cal
progi~amming language and have some experience in writing computer
pr ogt'am'5
The following
is
a tutorial book on PASCAL:
Kenneth L. Bowles,
(Microcomputer) Problem Solving Using PASCAL
Springer-Verlag, New York; (c)1977
w~
suggest the following book as a PASCAL reference guide:
Kathleen Jensen and Niklaus Wirthr
PASCAL. U!';er Manual and RepoT't
SpT'ingeT'-VeT'lagi New YOT'k~ (c) 1975
For documentation concerning the differences between UCSD
Pascal and Standard Pascal see Section 2.2.
1. 1. 1
THE UCSD PASCAL SYSTEM: AN OVERVIEW
The structure of the UCSD Pascal system is best
in terms of the "tr.ee-like" stT'uctlJre diagT'am figure 0.1
con~ept(Jalized
at the end of this sub- section.
The diagram in figure 0.1 depicts the outermost level of the
system.
In terms of ~~ "tref!tI OT' structurE d:iagT'f30'b thE IIroot"
C01'T' e S p 0 n d s tot: h e 0 ute r m0 S t I e vel t
wh j. ). e the u 1 ea v e s II (i. e. the box e 5
wit h nob ran c h e s t 0 low tf r 1 eve 1 s) c {) r i' f1' «5 P 0 n d t o t h e 11) wt? l' 1 eve 1 5 0 .p the
sysi~em.
~"hile a user is in a p.ci'rticult3T"- level,
the system dispL~ys a
list o~ available comm~~nd$ cal1~d th~ Hp.,"ompt-ltne
If the system is
running on a CRT screen type terminal, then the prompt-line will
usually appear at the top of the screen.
Commands are usually invoked
by typing a single character from the CONSOLE device.
For example, the
prompt-line for the outermost level of the system is:
H
,
C0 mm ia n d:
E(di t
I
R(
un
I
F ( i 1 it?
C ( 0 mp ,
f
X ( e C 1I t
L. ( ink 1
A ( sse mJ
(:h
D ( e bug ,!
?
[r.
B Y t Y pin 9 ,. F tI the use l' W i l l ;. des c end 11 a .1 eve 1 wit h i nth e
s t T' lJ C t u T' e d i a 9 T' ami n t 0 ale vel calle d the F i 1 e T'
Up 0"" en t e T' i n 9 the
=iler, anothe~ prompt-line detailing the set of commands available at
the Filer level of the system is displ~yed. The Q(uit command causes
the use r toe x i t f l~ 0 m the F i 1 era n d a s r: end
b a c k t o t h e 0 ute l' m0 s t
command level o~ the system.
Now the user is back at the level in the
system from which he started after bootstrapping the machine.
Some
commands within the system prompt the user fo~ the name of some disk
flle
In these [a~e51 the user enters the name of the file followad by
a carriage return.
If an error is made in typing a portion of the file
nam~,
the backspace key (or e~uivalent key depending upon th~ system
II
It
t4
r:onfigIJration) may
bE~
u£.ed
to
;'back
II •
ovwr"
~nd
th~?
eT'Cise
erroneous
delete key (rubout ke~) may ba used to erase the entire
n~me.
thereby allowing the user to compl@te14 start over.
If the
uSe'r d (!' C i d f.." S not t 0 ace e p t iiP"! l:i f i 1 eo n .'71 m f' t;.; h .~r.;::: (\ ~.. v :::t 1"'
l:7 S ·c ape.!t f l' 0 ill t 11 i !.=.
c: 0 roma 1'1 d i -s b IJ en t ~ r i n 9 d f i 1 €I n.a !l'i ~ 0 oF l t~ T' 0 c: h .t':l 'f' act 0 r s , L f!t.. t y p e .
part
File
The
lin~
I
,/
Notp that due to a limited amount of room on the prompt-line)
50me of the infrequently used commands
1 i nfL
A concept
;y~tem
::ar. b::
cent'i'i~l
ma~
to the design of
not appear on the promptth~
entire UCSD Pascal
commi3nd strllctOT'e is the' concept of th.:~ t'uJor~{filer:.
A !iJoT'k-File
th':-;Ught of as a ·!$cT'c."}tch~·pt~d" arf~a used for devt":tlopment of
programs and only one workfil@ is allowed at any ona time. If a us~~
dishes to begin a new workfile, the contents of the old one can be
sa',¥q~r.L
under a sep(.~rate fi Ie n~lm;£I, for 1 af,2T" rBfer-'ence by us ing the
3(ava command in the Filer lev~l of thp s~stpm,
When that file is
lat~;. . retrif?ved for fOT't:her tJJork on th~ contents1
it lE) possibl(~ that a
number of file~ (usually source and code) will be retrieved together
~nd in total they comprise the work-file
5J
1. 1.2
A.
OUTERt10Si LEVEL COMMANDS:.
AN OVERVIEW
E (d i t
Typ lng "Eli wh i Ie at the outel'i-rHJst c.ommand level of the system
the editor program to be brought into memory from disk.
The
use~ maYI
while in the edito~, inse~t or delete text inside his
work file D~ any textfile, along with many other powerful commands. See
Section 1.3 far details. The workfile text (if present) is read into
the editor buffert otherwi~e the Editor prompts for a file.
cau~~s
13
F(iler
HF" places the user in a level of the system called the Filer.
This section of the system contains commands used primarily for
maint~nance of the files stored on the disk.
The L(dir command allows
the user to list the titles and the last modification date, as well as
determine the number of blocks occupied by each file on the disk.
The
TCTBnsfer command is used to copy from either one disk to another, o~
from one area on a pal~ticular disk to another area on the same di~k.
For more documentation on the Filer level including commands associated
with the "getting", "saving", and "clearing" of the user's wOl'kfile see
Section 1. 2.
c.
C (amp
This command initiates the system compiler to compile the users
work-file.
If there is no work-file currently the user is asked '01' a
source text file name.
If a syntax 9rTO~ within the source is
detected, the campile~ will stop and display the error number and the
surrounding text of the program.
By typing a spacek the user can cause
the compiler to continue the compilation, Typing an causes the
camp i leT' to abtirt & return to Command leve 1.
Typ ing 'E' wi 11, if the
system editor is the screen edttorJ call the editor placing the cursor
near the offending symbol.
If the compil,,'ltion is successful, (1. e. no
syntax errors we~e encountered) a codefil~ called *SYSTEM.WRK. CODE is
written out onto the user's disk and becomes part of the workfile.
FoT'
more documentation on the use of the UCSD Pascal compiler see Section
1. 6.
This command causes the codefile associated with the current
to be executed.
If no such code file currently exists, the
compiler is called in the same manner as described in C above.
If the
c6mpilation re~ujres linkage to separately compiled code the linker
will automatically be invoked and will assume the use of the file
*SYSTEM.LIBRARY.
After a successful compilation, the program is
work~ile
executed.
Page 3
E.
X(ecute
This command prompts the user fn~ the filename of a previou.ly
cod~file.
If the file exists, the codefile is executed;
o the T' w i set hem e s sag e
can ' t fin d f i 1 e
i s ret lJ T' ned.
( Not e : the
compiled
tf
P;
".CODEr.~
suffix on such a file is implicit»
I-P all
cod~
necessary to
execute the c:ode-File has not been linked in, the message "file <'Pileid>
not linked in is retu~ned.
It is convenient to X(ecute other prog~ams
which have already been. compiled because otherwise the user would have
to enter the Filer. G(et the file, Q(uit the Filer~ and then RCun the
program.
F.
A( 5sem
Just like C(omp except the
than the system compiler.
G.
sys~em
assembler is invoked rather
D( ebug
This command causes the cu~rent workfile to be executed.
If
the program in the wo~kfile has not been compiled, the compiler will be
called as in the case of the R(un command.
However if a run-time error
occurs.,
or a user-
de.pin~d
bre~lk-pojnt
OT'
halt is encountwred,
the
Debugger program i$ called.
The Debugger is a prog~am which allows the
user to examine the contents of variables within the program.
See
section 1. 5 Debugge~ for more details.
H.
L(ink
This command starts the
syst~m
linker program explicitly to
li-rk "'outi.nes fr-orn libra1"ies c·tf1~T' than
*SYSTEM.LIBPARY.
See section 1.8 for mDr~ inPormation
allol.",
tlSf:"oT'S
1.1.3
to
O~
the linker.
UTILITY PROGRAMS
There are many functions needed by users of any operating
system.
To attempt to make all these functions system functions would
result in a terrible proliferatlon of command letters as the base node
level.
In order to keep the COMMAND llne simple, we hav~ restricted
the functions available on it to what W~ feel i~ the bare minimum for
~rogram and te~t develo~rni?nt.
Th~· oth£'p usefult
but much less often
IJsed functions dT'e available through the X(ecute command.
The sort ofl
Functions which are available are the desk calculato~, the patch/dump
iJtility: the terminal configuration s€'tup prcgramJ a boot~Jtrap mcvel"l a
librarian and many others.
For a complete list of the utility programs
with the UCSD Pa~cal systRm. reFeronce Section 4 1n the
Any programs which you write and -Feel \.t.Jould be a
Jseful addition to our library of utilities will be welcome
:: ontr i b lit;. OTIS
10W avail~ble
rable of Contents.
'age 4
1.1.4
AN INTRODUCTION TO THE UCSD PASCAL SYSTEM
1.5 is the first release which contains the fully intergrated
and implemented concept of sepa~ate compilation and assembly.
I.4b was
the first to support multiple types of processors.
The great bulk of the system 50ftwa~e is written in Pascal and
runs on a ~elatively simple pseudo-machine.
If this pseudo-machine is
emulated by a machine language program on a new real machine, the
Pascal software will also run on that new real machine.
One class of differences among versions of the system is due to
aspects of the pseudo-machine that are not identicaly emulated by the
implementations for different types of processors.
A subsection in
$~ctton A contains a chart of differences between processors the system
currently run~ on.
Another clas$ of differences stems from variations in the
system lID environments rather than in the host processor.
Included
here are diffe~ence in system console terminal types (e. e. hard-copy vs
CRT vs stc~age tube) or command conventions and capabilities (eg.
in tel 1. i 9 en t " v S tl dum bite R T .. 5 >.
The s y 5 t em i s i n ten d edt 0 b e a b l e t 0
cope with this sort of va~iation.
Ver~ion I.4 had some troubles with
teTminals that ge~eTat9Jrequi~e two-cha~acter sequences fD~ some
contT'ols, and single-c:haT'acter sequences foT' othel's.
The utility
progj',am "SETUP" has been complet1i'ly regenerated for 1. 5 (see section
!I
4.3) .
In the PDP-i1 world these mass storage variations are not too
primarily b~cau~e there is considerable motivation to be
compatible with DEC devices and m~dia.
We hav~ written and support
driverg fo~ a few DEC incompatible devices but make no' claim to
SUppOTt users who want to develop their own such drivers.
See section
seriou~J
A f(lT' u,U3;'nings c-lbout
pT"obl~ros
you might encounter.
The situation in the BOaO/Zeo wo~ld is much more chaotic.
Since is wDuld not be practical fo~ the ProJect to write and support
drivers far the vast multitude of soao/zao 110 environments that exist,
we have chosen to take advantage of the wide5pread implementation of
Digital Research's CP/M operating system by structuring the pseudomachine's 110 operations as calls on CP/M's Basic I/O Subs~stem (BIOS)
primitiven.
Thereforel any 110 configuration on which CP/M has been
implem~ntcd should also be able to support the Pascal system.
We do
not gU~T'antee this.
For example·, Intel MDS disk controllers cannot
read disks generated here and some BIOS's we have encountered do not
completel~ meet all the requirements specifi~d for CP/M.
UCSD plan~ to
support some of the larger distribution SOaO-based machines directly.
Our dominant mode of distribution for soao/zao systems will be
on 3740 compatible diskettes,
One of the distTibution diskettes will
be CP/M oriented
This disk will be used, via a somewhat awkward twost~p process,
to bring up UCSD Pascal on a particular CP/M
configuration.
Look to section A for details on this process.
It also
describes tho configuration of a modi~ied BIOS, which will better
support the needs of the Pascal system.
Finally, directions are given
fOT making i t possible to boot directly to Pascal rather than
indirect14 through a CP/M program.
Page 5
A number of files on the disk start with "SYSTEM.'
SYSTEM,
SYSTEM.
SYSTEM.
SYSTEM.
speci~ically:
PVP-11
MICRO
PASCAL
FILER
SYSTEM. COMPILER
SYSTEM. SYNTAX
SYSTEM. EDITOR
SYSTEM. LINKER
SYSTEM. ASSMBL.ER
SYSTEM.SWAPDISK
SYSTEM.CHARSET
SYSTEM.LIBRARV
SYSTEM.WRK.TEXT
SYSTEM.WRK.CODE
SYSTEM. STARTUP
In most cases these files. contain the system segment of the
That is to say that the EDITOR, FILER~ LINKER,
:OMPILER, ASSEMBLER are the files that are invoked by the text editor
"hen 'E', 'F ' , etc. is typed. Some of the files aT'e machine specific.
[NTERP and MICRO are the files which contain the interpreters fo~ the
)articular machine being used.
CHARSET is a file which appears on
jisks meant for TERAK computers only and contains the definition for
the soft character set, and the data for the Triton logo prompt.
_IBRARV is a file containing separately assembled or compiled routines
POl' use by the Linke~ in producing executable code files.
PASCAL
:ontains the operating system, and the Debugger.
SWAPDISK is a file
Jsed by some of the system segments during compilation of "include"
Piles if a memory shortage exists. It is a 2048 byte file which gets a
)ortion of memory swapped to it when a directory needs to be read into
:ore.
When the dir9ctory work is complete, the memory is restored to
Lts original state. STARTUP is a file which can be created at the
J seT' ISO P t ion.
I f i t e xis t $ 0 n a dis k , t h e 0 per at in 9 s Y s t em con s id e r s
It a runnable code-'11el and executes it at initialize time.
This
tllows the user to have a program that runs before the main command
~rompt comes up, and will run anytime the I{nitiallze command is
;yped.
WRK.TEXT and WRK.CODE are the current work-file after some
lction has occurred to the work-file. They appear after having done
~ome text editing on a work-file (SYSTEM.WRK. TEXT) or compiling a workname they carry.
lile (SYSTEM.WRK.CODE).
All other files an the disk a~e user generated (in one fashion
The other important part'S of a disk are relatively
,nvisible to the user.
The directory resides at block 2 on the disk
Ind extends for 4 blocks if it is a single directory, a blocks i. i t is
I duplicated
(backed-up) directory.
The bootst1"ap can reside at any of
I number o~ places on the diskl
depending on the host machine.
In most
ases, blocks 0 and 1 are reserved fa~ the bootstrap.
~T'
anothE'r>'
Page 6
***************
*
FILEHANDLER*
*************~*
*
Section 1.2
*
*************** ***************
Version I.5
1.2.1
September- 1978
FILES
A fi.le is a discrete 'chunk: of information which is stored on
the disk and ~eferenced by a filename.
Each disk has a directory
which contains the filenamRs and locations of each file on the disk.
T h t:' F i 1 e han d 1 e'r
0 r F i b~ 1" ..
lJ S est tl e in f 0 T' ma t ion con t a i ned in the dis k
directory to manipulate files.
J
One of the attributes of a file is its t~pe.
The type of the
file determines the way in which it can be used.
File types are
assigned based on the file name.
Res~rved
type suffixes
TEXT
Fa~
filenames are:
Human readable text.
. CODE
Machine executable code .
. DATA
Data file.
, FOlD
A file containing one TERAK screen-image.
Intended to be a file containing a vector
list of a graphic imagn.
Cur~ently unused.
.8,.\D
1. 2. 2
An unmovable file cov~rln9
damaged aTea of a disk,
8
physically
VDLUt1ES
A volum~ is any 1/0 device; slJch 13B the printer'. the keyboard.
a dis k "
A b 1 t1 r: k - ~i t 'r" to, C t U T' e d" d e vic e i 5 0 net hat can h a v e a
d i r f~ c t n'" y a T'dJ f ~~ 1 e ~ , us tHl 1 1 \J a d j 5 k o.f 5 f.) ttl t"' SO 'T' t ,
A non blotk-structured device does not have internal structure; it sImply
prcduc~s Dr consumes a ~t~eam of characters.
The printer and the
key b car d I f ' 1" E l{ amp 1 ~:
.3 T' e non .- b 1 0 c k - s true t u T' e d .
The tab 1 e bel 0'"
illu.trate9 the reserved volume names used to Tefer to non-blockstf'uctuT'ed devi.ce-51 the 'unit number- i d~~or.iated with each device, and
the unit numbers as~ociet~d with the system (booted) disk and any
0,..
tI
IJ
al,t:;~T'nat~
disk~.
I
Unit Number
1
2
3
4
5
6
8
Volume ID
Description
CONSOLE:
SVSTERM:
GRAPHIC:
:
vDl.uMe
ID
FIGURE 2
)age 8
Volume i. d.
.
vo\nQ.Me
FIGURE 3
Volume names for block-structured volumes can be arbitrarily
assigned by the user.
A volume name must be 7 or less characters long
and may not contai.n '-::::.', '$', '?' or ','. Reserved volume names for
. non- block-structured devices are given in Figure 1.
The character '*'
i5 the volume ID of the 'system disk', the disk upon which the system
was booted. The character ': " when used alone, is the volume ID of the
'default disk'.
The system disk and default disk are e~uivalent unless
the default prefix (see material on P(refix) has been changed.
'.' is
time.
e~uivalent
to the name of the volume in the drive at that
A legal filename can consist of up to 15 cha~acters. In order
for the fil~ to be run the last 5 characters must be . TEXT, ,CODE, OR
. DATA.
Without these suffixes the file may be executed but not put in
the workfile to be run.
Lower-case letters will be translated
to upper-case, and blanks and non-printing characters will be removed
from the filename.
Legal characters for filenames are the
alphanumerics and the special c.haracters '_'i 'I', '\' , .r I, and ' . ' .
These special characteTs may be used to indicate hierarchic
relationships among file$ and/or to distinguish several related files
of di~Terent types.
The 1.5 Filer will not be able to access filenames containing
the charac-ters '$', ': 't '=', '?': and '~',
If files from previous
versions of the system contain these cha~acters, then they should be
removed be~ore attempting to use those riles with the I.5 System.
WARNING:
'=' and '7'1 are used to specify
The Filer performs the requested action on
The wildcard characters,
subsets of the directory.
all files meeting the specifications.
A file specification containing
the subset-specifying string 'DOC=TEXT' notifies the Filer to perform
the requested action on all files whose names begin with the string
'DOC' and end with the st~ing 'TEXT'.
If a '?' is used in place of an
'=', the Filer requests verification before afTecting each file meeting
the specified criteria. Either or both strings may be empty. For
example, a subset speCification of the form '=' or '='
OT' even '=' is valid.
This last case. where both subset- specifying
strings are empty, is interpreted by the Filer to specify every file on
the volume. so typing '=' or '?' alone causes the Filer to perform the
appropriate action on every file in the directory.
Given an example directory for volume MVDISK:
NAUGHTYBITS
6
23-'-'un-54
MOLD. TEXT
USELESS. CODE
MOLD. CODE
NEVERMORE. TEXT
4
29-,,'un-54
10
4
19-May'-54
29-·...Iun-54
12
5
5-Apr-54
lO-Sep-S2
GOONS
~age
10
EXAMPLE:
P~ompt:
Remove what file?
Re$pons~:
Typing
generates the message:
'N=~
MYDISK:NAUGHTYBITS
MVDISK:NEVERMORE.TEXT
Update directo~y?
removed
'removed
(At this point the user can type 'V' to remove or
type
~N"J
in whi.ch case the Tiles will not be
removed.
The Filer always requests verification
on an'J wi ldcard removes. )
Typin9
'N?' generates the
mes~age:
Remove NAUGHTYBITS: ?
After the user types a
respcnse~
the Filer as.ks:
Remove NEVERMORE. TEXT: ?
EXAMPLE:
Prompt.
Dir listing of what vol?
Response:
Typing '=TEXT' causes the Filer to list
f¥tOLi). TEXT
NEVERMORE. TEXT
4
12
29-,Jun--·54
5'-Ap '("-·54
The subset-specifying strings may not 'overlap'.
For example,
would not specify the file GOONS} whereas GOON=S wDuld
GOON~NS
be a valid
(although
pointles~)
specification.
Tha size specification information is predominantly useful in
the
COf~H'Il:;nds
T(rans-PeT' section 1. 2. S. 11 and M(ake section 1. 2.5.17.
Page 11
1.2.5
COMMANDS AND USE
Type "Fit at the
Command level to enter the Filer and the
following prompt is displayed:
Filer: G(et, S(ave, W(hat, N(ew, L(dir .. RCem, C(hng, T(ransl D(atEb G(uit
Typing '?' in response to this prompt displays more Filer commands:
Filer: B(ad-blks. E(xt-dirl K(rnch, M(ake, P(refix, Veals,
X(.amine.
Z(ero
The individual Filer commands are invoked by typing the
letter found to the left of the parenthesis.
FoT' example,
's' would invoke the Save command.
In the File~, answering a Yes/No question with any charact~r
other than'Y' constitutes a 'No' answer.
Typing an will return
the user to the outer level of the Filer.
Fo~ each command requiring a file specification. refer to the
file specification diagram (Figure 2).
In many cases, the entire file
specification is not necessary, and in some case~~ certain parts of the
file specification are not valid.
See the required command in the
following section.
Whenever a Filer command re,uests a file specificationJ the
user may specify as many files as desired) by separating the file
specifications with commas, and terminating this 'file list' with a
carriage return.
Commands operating on single filenames will keep
reading fil~name$ from the file list and operating on them until there
ill' e non e 1 e of t .
Comma n d sop e l' at in 9 0 n t UJO f i 1 ena me s ( s u c has C ( han 9 e
and T(rans) will take file names in pairs and operate on each pair
until only one OT none remains.
If one filename remainsl the Filar
~ill prompt for the second member
the pair.
If an error is detected
in the list, the rest of the list will be flushed.
0'
)age 12
Loads th9 designated file into the
wD~kfile.
The entire file specification is not necessary.
If the volume ID is
not giv(~nl the default disk is a~r.umed>
l,.Jildcaros a~e not allowed,
and the ,sl.ze specification option is ignored.
Given the eXdmple
diTecto~y:
FILERDOC2.TEX'T
t';. OUT. CODE
FS.TEXT
ABSURD. TEXT
HYTYPER.CODE
STASIS. TEXT
LETTER1.TEXT
ASSEM.DOC . TEXT
FILER. DOC. TEXT
STASIS, CODE
EXAMPLE:
P~ampt:
~et
Response:
what file?
STASIS
The Filer responds with the message
'Text and Code file loaded'
since both text and code fil~ exist.
Had the user typed
'STASIS.TEXTt or' 'STASIS. CODE', the result would have been the
same - bath text and code versions would have been loaded.
In
the event that only one of the versions exist~, as in the case
of A.OUTI then that version would be loaded, regardless of
whether text or code was requested.
Typing 'A. CUT. TEXT' in
response to the prompt would gene~ate the message: 'Code file
loaded'.
Page 13
2) S(ave
Saves the workfile under the filename specified by the user.
The entire file specification is not necessary.
If the volume ID is
not given, th2 default disk is assum~d
Wildcards are not a]b;~H?d ..
and the
siz~
specification option
i~
ignOT~d.
~XAMPLE:
Prompt:
Save as what file?
ResponsE':
Type a filen.iame of 10 or le5s chNr,3~tf.\j':;;1
the f i 1 ~ n a tTl e con ve n t ion s i n ~ e c t ion 1. 2. 4 ' FILES
f.
obser·',/ing
T hi;:;.
caus~s the FILER to automatically remDVe any aId file having
the given ndm~. and to save the workfile under that name.
For
e:.BACK
exists.,
then the user is prompted:
Remove . BACK ?
4) G(uit
Return~
the user to the outermost command level.
No file specification allowed.
5)
W(hat
Identifies the name and state (saved or not) of the workfile.
No file specification allow.d.
6) V(olumes
Lists volumes
(devic~~
cu~rently
on-line. with their associated unit
numbers.
Page 15
No
specification allowed.
~ile
A typical display would be:
Volumes on-line:
1
CONSOLE:
2
SYSTERM:
3
4
6
GRAPHIC:
MYDISK:
PRINTER:
8
*
REMOTE:
9 # BIG:
Prefix is - MYDISK:
The system or "boot-disk" volume's name is pl'eceeded by a
'*'.
The system volume
is the default volume unless the prefix (see
PCrpfix) has been changed
Block-structured devices are indicated
by
I'
*
I
aT"
'4*
I ,
7) L(dir
Li'sts a disk directory.,
file specif-ied
or some
subs~t
thereof;
to the volume and
(default is CONSOLE:),
The user may list any subset of the directory, using the 'wildcard'
option! and may also write the directory., Or' any subset thereof~ to
a volume or filename other than CONSOLE.
File specification will
therefore be discussed in terms of source file speci'ication and
destin~tion fil~ specification.
Source file sp@cification consists of a mandatory volume ID,
and
optional subset-spPtifying string~1 which may be empty.
If subset~pecifying strings ara uSRd,
then on~ of th@ wildcard charactRTs
must be US"dH1.
A string <-Por example, the full fil~n(~m~
STASIS. TEXT) mav not be used as part of the source file
specification unless a wildcard character is used~
Source file informatiDn is 5Ppa r ated from destination file
1. nof ormat i on b 4 a c omm~ (~; ~).
Destination file specification consi&ts of a
volume is a block-structured device,
volum~
a filename.
ID,
and,
if the
File size
specifications will bp ignored.
The most frequent use of this command is to list the entire directory
of a volume.
The following display, which represents a complete
directory listing for the example disk MVDISK, would be generated
by typing an~ valid volume In for MYDISK (see Figure 2) in response
to the prompt,
~age
16
Or
Dir listing
what vol?
MVDISK:
FILERDOC2. TEXT
28
1-Sep-78
A.OUT CODE
10
1-Sep-78
F5.TEXT
ABSURD
HYTYPER.CODE
STASIS. TEXT
LETTER1.TEXT
ASSEMDOC.TEXT
8
4
12
8
18
20
1-Sep-78
1-Sep-78
1-Sep-78
1-Sep-78
1-Sep-78
1-Sep-78
FILERDOC1. TEXT
24
1-Sep-78
6
I-Sep-76
STASIS. CODE
10/10 files , 130 blocks used,
364 unused
(The bottom line or the display informs the user that 10 files out
of 10 files on the disk have been listed, that 130 disk blocks
have been used, and that 364 disk blocks remain unused. )
EXAMPLE:
L{di~
t~ansaction
Prompt:
involving
wildca~ds:
Dir listing of what vol?
User response:
#4:FIL=TEXT
generates the 'ollowing display:
MYDISK:
FILERDOC2.TEXT
FILERDOC1.TEXT
2/10 flIes
28
24
1-Sep-78
1-Sep-78
,
52 blocks used,
364 unused
EXAMPLE:
L(dir transaction involving writing the directory subset to a
device other than CONSOLE:
Prompt:
Dir listing of what vol?
User T'e·sponse:
*FIL=TEXT, PRINTER:
causes
IVJYDISK:
FILERDOC2. TEXT
28
1-Sep-78
FILERDOC1.TEXT
24
1-Sep-78
2/10 files , 52 blocks used, 364 unused
to
be w~en
to the
Pnint~.
Page 17
EXAMPLE:
L(dir transaction involving writing the directory subset to a
block-structured device:
Prompt:
Dir listing of what vol?
User response: #4:FIL=TEXTI#5:TRASH creates the file TRASH an
the volume associated with unit 5.
TRASH would contain:
MVJ}ISK:
FILERDOC2.TEXT
FILERDOC1. TEXT
2/ 10 f
8) E(xtended
j
1e5
28
24
1-Sep-78
1-Sep-78
<1 i s ted lin~" d j, r :> t 52 b 1 0 (: k S
U$
e d.,
364 v nus e d
list
Lists the directory in more detail than the L(dir command.
All files and uflused areas are listed along with (in this order>
thei'r block lengthl last modification dat9.1 the starting block
address, the number of bytes in the last block of the file, and the
filekind.
All wildcard options and prompts are as in the L(dir
command.
An f.')(ample displ;ty
MYDISK:
FILERDOC2.TEXT
A,OUT.CODE
F5. TEXT
28
10
8
10
ABSUnD
is shown below.
1-Sep-78
1-Sep-78
1-Sep-78
6
34
44
Textfile
Codefile
512
:512
512
512
512
512
512
Da t ,,:l'f'! i 1 e
Textfil@
52
4
1"-Seo---78
62
HYTYPER.CODE
STASIS TEXT
12
8
1-Sep-78
1-Sep-78
66
78
LETTER1. TEXT
18
1""Sep-78
86
ASSEMDOC. TEXT
20
1-Sep-78
1-Sep-78
104
124
FILERDOC1.TEXT
24
STASIS, CODE
6
1-SRp-78
148
354
154
10/ 10 f i 1 es .( 1 i s ted ./ i n -- d i 'r:>, 130 b '1 0 c k sus e d
~)
512
512
512
I
Cadefile
T£':.;tfi.le
Textflle
Texti'.;ile
Textfile
Codefile
364 :,; n us e d I
354 in 1 aT' 9 est are a
C(hange
Changes
~il~
or voluw@ name.
This command requires two file specifications.
The first of these
specifies the file to be changed, the second, to what it will be
changed.
The first specification is separated from the second
specification by either a -('ret:> OT' a comma (', ').
Any volume ID
info~mation in the second file speciFication is ignored,
since
obviously the 'old file' and the 'new file' are on the same vQlume~
Size specification Information is ignored.
'age 18
Given the example file F5.TEXT,
P~ompt
;
residing on the volume occupying unit 5:
Change what file?
User Response:
#5:F5. TEXT,HOOHAH
changes the name in the directo~y from 'F5. TEXT' to 'HOOHAH'.
Although filekinds are originally determined by the filename,
the C(hange command does not affect the filekind.
In the above
case, HOOHAH would still be a text file.
However, since the
S(et command searches for the suffix '.TEXT' in order to load a
text file into the workfile, HOOHAH would need to be renamed
HOOHAH. TEXT in order to be loaded into the workfile.
Wildcard specifications are legal in the C(hange command.
If a
wildcard character is used in the first file specification, then a
wildcard must be used in the second file specification.
The subsetspecifying strings in the first file specification are replaced by
the analogous strings (henceforward called replacement strings)
given in the second file specification.
The File~ will not change
the filename if the change would have the effect of making the
filename too long (~15 characters). Given a directory of example disk
NOTSANE: containing the files:
POEMS. TEXT
MAUNDER. TEXT
MALPRACTICE
MAKELISTS. TEXT
EXAMPLE:
Prompt
Change what file?
User response: NOTSANE:MA=TEXT;XX=GAACK
causes the Filer to report
NOTSANE:MAUNDER. TEXT
changed to XXUNDER.GAACK
NOTSANE:MAKELISTS. TEXT
changed to XXKELISTS.GAACK
Page 19
The subset-speci~ying strings ma~ be empty, as may the replacement
strings.
The Filer considers the file specification '=' (where b~th
subset-specifying strings are empty) to specify every file on the
disk. Responding to the C(hange prompt with '=,Z=Z~ would cause eve~y
~ilename on the disk to have a
'z' added at 'rant and back.
Responding to the prompt with 'Z=Z,=' would replace each terminal
and initial
'1
~
with nothi.ng"
Given thePilenarnes:
THIS. TEXT
THAT. TEXT
EXAMPLE:
Prompt
U~pr
Change what file?
Response:
T=T.=
The result would be to change
and
'THAT. TEXT' to
~THIS.
TEXTi to 'HIS. TEX',
'HAT. TEX'.
The volum€ name may also be changed b~ specifying a volume
to be changed, and a volume 10 to change to.
ID
EXAMPLE:
Prompt
Change what file?
User Response:
ge~~rates
NOTGANE_,WRKDISK.
the message,
NOTSANE'
changed to WRKDISK'
LO) R(emove
Remov~s
file entries from the dIrectory.
Thi~ command requires one file speci~ication for each file the user
wishes to remove.
Wildcards are legal.
Size speciflcation
information is ignored.
Given the examD12 files (assuming that they
are on the default vDlume):
AARDVARK. TEXT
t.
Wildcards are peTmitted~ and size
specification information is recognized for the destination 'ile.
This ct,mmand 'reQ.uires
that the user wis~e. to transFer the file FARKLE.TEXT
from tne dis~ MYDlSK to the dlSk ilACKUP.
AS6um~
EXAMPLE:
P~ompt:
Uqe~
Transfer what file?
R~sponse:
MVDISK:FARKLE. TEXT
Page 21
Prompt: To where?
(Note: On a one-drive machine, do NOT remove your source disk
until you are prompted to insert the destination disk)
User Response: BACKUP:NAME.TEXT
Prompt: Put in BACKUP:
Type to continue
The user should remove the source disk, insert the destination
disk and type a .
The Filer then notifies the user:
MYDISK:FARKLE.TEXT transferred to BACKUP: NAME: TEXT
The Filer has made a copy of FARKLE and has written it to the
disk BACKUP giving it the name NAME. TEXT.
If the specified
file is large, the user may be prompted to alternately insert
the source and destination disks until the transfer is
completed.
It is often convenient to transfer a file without changing the name,
and without retyping the file name.
The Filer enables the user to
do this by allowing the chaTacter ~$' to replace the filename in the
destination file specification.
In the above example, had the user
wished to save the file FARKLE. TEXT on BACKUP under the name
FARKLE.TEXT, she could have typed:
MYDISK:FARKLE.TEXT,BACKUP:$
WARNING: Pl~ase try to avoid typing the second file specification
with the filename completely omitted! For example, a response to the
Transfer prompt of the form:
MYDISK:FARKLE.TEXT,BACKUP:
generates the message:
Possibly destroy directory of BACKUP: ?
iV' answer causes the directory of BACKUP to be wiped out!
Files may be transferred to volumes that are not block structured,
such as CONSOLE: and PRINTER:, by specifying the appropriate volume
ID (see Figure 1) in the destination file specification.
A file
name on a non- block-structured device is ignored.
It is generally
a good idea to make certain that the destination volumeis on-line.
age
22
EXAMPLE:
Prompt:
Transfer what file?
User Response:
Prnmp t:
FARKLE.TEXT
To whe.re?
User Response:
PRINTER:
causes FARKLE.TEXT to be written to the printer.
The user may also transfer from non-block-$tructur~d devices,
providing they aT~ input devices.
Filenames accompanying a nonblock-structured device 10 are ignored.
The wildcard capability is allowed for TCransfer.
If the source
file specification contains a wildcard character, and the
desti"ation file specification involves a block-structured device.
then the destination file specification must also contain a wildcard
character.
The subset-specifying strings in the SOUTce file
sp~cification will be replaced by the analogous strings in the
destination file specification (henc.fD~ward known as replacement
strings).
Any of the sub~et-5pecifying or r~placement st~ings may
be empty.
Remember that the Filer tonside~s the file specification
!=' t~ speci~y ev~ry file on the volume.
Giv~n
th~
PENALTY,
User
vo]um~ MYDISK containing the files PAUCTTYJ
and the destination ODDNAMZ:
Re~PDnse:
P=TY,QDDNAMZ'V=S
would cause the Filer to
i1VDISV. . : PAUC I TY
MYDISK:PARITY
r1YDISK: PENALTY
PARITY and
~eply:
transferred to ODDNAMZ:VAUCIS
transferred to ODDNAMZ:VARIS
t~an$ferred to QDDNAMZ:VENALS
Using '=' as the source filename sp~cification will cause the Filer
to attempt to transfer eye~y file on the disk.
This will probably
ove~flow th~ output buffer.
(The~e are easier ways to transfer
whole disks.
If you wish to do this, please refer to the material
in this section on volume- to- volume transFers. )
Page 23
Using '=' as the destination filename specification will have the
effect of replacing the subset-specifying strings in the source
specification with nothing.
A brief reminder: '?' may be used in
pla.ce of '='.
The only difference i.s that '?' causes the user to be
asked for verification before the operation is performed.
A file
can be transferred from a volume to the same volume by
specifying the same volume ID for both source and destination file
specifications.
This is frequently useful when the user wishes to
relocate a file on the disk.
Specifying the number of blocks
desiT't:d will cause the Filer to copy the file in the first-ou
area of at least that size.
If no size specification is
given, the file is written in the largest unused area.
If the user specifies the same filename
destination on a same-disk transfer,
TO~
both source and
then the Filer rewrites the
file to the Size-specified areal and removes the older copy,
EXAMPLE:
Prompt:
Transfer what file?
User Response:
#4: GUIZZES. TEXTI #4: GUIZZES. TEXT[20J
causes the Filer to rewrite QUIZZES. TEXT in the first 20-block
area encountered (counting up from block 0) and to remove the
previous version of GUIZZES.TEXT.
WARNING: Wildcard-type specifications do not always work very well
on same-disk transfers.
The results tend to be unpredictable,
the$e operations are not recommended.
so
It is also possible to do entire volume-to-volume t~ansfers.
The
file specifications for both source and destination should consist
of volume ID only.
Transferring a block~structured volume to
another block- structured volume causes the destination volume to be
'wiped out' 50 that it becomes an exact copy of the source volume.
Assume that the user desires an extra copy of the disk MYDISK: and
is willing to sacrifice disk EXTRA:
EXANPLE:
Prompt:
Transfer what file?
User Response:
MYDISK:fEXTRA:
Prompt: Possibly destroy directory of EXTRA:
Page 24
?
WARNING: The~e's no 'possibly' abDut this! If the user types
'V', the directory of EXTRA: !!till. be destT't)l.jed! An 'N'
response will ~eturn the use~ to the outer level of the Filer,
and a 'V' will cause EXTRA to become an exact copy of MYDISK.
Often this is desi~able f.or backup purpo~es, since it is
relatively easy to copy a disk this way, and the volume name
can be changed (see C(hng) iT desired.
Although it is certainly possible to t~ansfer a volume (disk) to
another using a single disk-drive, it is a fairly tedious process,
sine e the i n'~c or'e t,~an$ fer read s up th e i nfol' mat i on in rath er sma 11
chunks, and a g~eat deal of disk Juggling i~ necessary fo~ the
complete transfer to take place.
12)
O(ate
Lists current system date,
PT'omp t:
and enables the user to change the date.
Date Set: <1 .. 31>-- OR 6 the new date will be displayed.
Typing only a return
does not affect the current date.
The hyphens are delimiters for
the day, month and year -rl.eldsJ and it is possible to affect only
one or tWtl of th~se fields.
FoT' example, the year could be changed
by typing "--79',1 the month by typing '-Sep I, etc.
The entire month-
Th~
name can be entered, but will be truncated by the Filer.
Slash
(//') is alsD acceptable as a delimiter.
The most common input will
be a slngle number, which will be interpreted as a new day,
For
example, if yesterday was the 19th of August, the user would want to
type D20, which would have the desired effect of changing the
date tC.i the 20t;h of :'\U9t.'~~t.
The d~Hj'~"month-'ye:·ar' o'rder is inviolate,
h oweve t"
This date will be associated with any files saved during the current
session and will be the date displayed POT those 9iles when the
directory is listed.
13) P(refix
Chan 9 ~\;' the
C i....r 1-
e n t~ d e 'r. a u 1 t t o t h e vol u me s pee i fie d .
This command reqldT'es the 'Jser ·to type a volume ID.
An entire .file
specification may b~ entered, but only the volume ID will be used.
It is not necessary for the specified volume to be on-line.
Page 25
To determine the current defatilt
y61um~1
the user may Tespond to the
prompt wi th f.'
14) BCad blocks
Scans the disk and detects bad blocks.
This command requires the user to type a volume ID.
volume must be on-line.
The specified
Bad blocks scan of what vol?
Prompt:
Response:
Checks each block on the indicated volume for errors and lists
the number of each bad block.
Bad blocks can often be fixed or
marked (see eX(amine).
15) eX{amine
Attempts to physically recover suspected bad blocks.
This command requires the user to type a volume
I~·
The volume must
be on- line,
:::XAMPLE:
Prompt
Examine blocks on what volume?
Response : generates the
Prompt:
Block number-range?
The user should have Just dane a bad block scan, and should
enter the block number(s) returned by the bad block scan.
If
any files are endangered; the fallowing prompt should appear:
Prompt:
File(s) endanger'ad:
T-ry to fix th em'?
Response:
#Y' will cause the FILER to examine the blocks and
return either of the messages:
Block may be ok
in which
~ase
the bad block has probably been
~ixed,
or
Block is bad
in which case the FILER will offer the user the option of
marking the block(s) BAD. Blocks which are marked BAD will
not be shifted during a K(runch, an~ will be rendered
ef~ectively harmless.
An 'N' response to the 'fix them?' prompt returns the user to
the outer level of the FILER.
WARNING: A block which is 'fix~d' may contain garbage.
'May be
ok' should be translated as 'is probably physically ok'.
Fixing a block means that the block is read. is written back
out to the block and i~~read again.
If the two reads are the
same! the message i~; 'may be 0;';
In th@event that the i'e"ads
are different} the block is declared bad and may be marked as
~uch if so desired.
i.
16) K(T'unch
Moves the files on the specified volume
combined at the 'end' of the disk.
50
that unused blocks are
This command r.quiT~5 the U$&T to type a volume 10.
The specified
volume mU5t be on-line.
It is strongly recommended that the user
perform a bad block scan of the vo10me before K(Tunching in order to
avoid writing filps over bad areas of the disk.
If bad blocks are
encountered, the~ must be ~ithe~ fi~ed or marked before the K(runch
(see
~X(,3mirH:),
As each file is moved, its name 15 reported to the console.
If
SYSTEM. PASCAL is mcved, the system must be reinitialized by
b 0 t s t T c\ P P 1 ri 9 .
Don 0 t t 0 U c: h t h t~ diE k r the h [\ Q t -.. S tlI i t c h 0 r the dis k drive door until KCrunch tells you It has completed its task.
t'
EXAMPLE;
Prompt
Crunch what vol?
Response :
causes Filer to prompt with:
Prompt : Are you sure you want to crunch ?
Page 27
Response: 'V' initiates the K(runch. Typing an 'N' will return
the uSer to the outer level oT the FILER.
17) M(ake
Creates a directory entry with the BpecifiedPilename.
This command requires the user to type a file specification.
Wildcard characters are not allowed.
The file size specification
option is extremely helpful, since, if it is omitted, the Filer
creates the specified file by consuming the largest unused a~ea of
the di~k.
The Pile size is determined by following the filename
with the desired number of blocks, enclosed in square brackets
.I
r. /
an d
J'
J;,
Some special cases are:
[0]
e~uiyalent to omitting the size specification.
created in the largest unused ar~a.
The file is
[*l -
the file is created In the second largest area,
largest area, whichever is larger.
or half the
EXAMPLE:
Prompt
Make what file?
Response :
MYDrSK:FAR~LE.
TEXT[28J
Creates the file FARKLE.l"EXT on the volume MVDISK:
unused 28-block area encountered.
18)
Z(ero
Reformats the specified volume.
i rretr ievab 1 e.
The previDus
:::XAMPLE:
Prompt:
Zero dir af what vol?
Response:
PromptResponse:
~ag
in the first
e 28
blocks?
Response: 'N' generates
Prompt: # of blocks?
Response: User will type number of blocks desired
(usually the maximum permitted for the system's disk
recording density, 170 for single-density, 340 for
double-density, and 690 for quad-capacity). Filer
proceeds with sequence below.
'Y' senerates
Prompt: New vol name ?
Response: User types any valid volume name.
Prompt: correct?
Response:
'Y' causes the Filer to respond with the message:
zeroed
Page 29
-t-l~s.
age 30
-.
**************************
*
SCREEN ORIENTED EDITOR
***~*************
* *
Section 1.3.1
*
************************** *****************
VeT'sion L 5
September 1978
This introduction, which describes the idea behind the Editor.
is the first of four sections.
The second section is a tutorial for
the novice"
While the Editor is designed to handle any files. the
tutorial section uses a sample program to demonstrate how to use the
most basic commands to madi'y a file.
The third section contains a
detailed description of each commdnd. with examples, and the fourth is
for tuick reference.
THE CONCEPT OF A 'WINDOW' INTO THE FILE
The Screen Oriented Editor is specifically designed for use
wit h Vi d ~ 0 Dis p 1 a y T e T min a 1 s.
On en t e l' i n 9 any f i 1 e
the Ed ito r
displays the start Or the file in the upper left hand corner of the
SCTe~n.
If the file is too long for the screen, only the first portion
is displayed.
This is the concept of a 'window'.
The whole file is
there and is accessible by Editor commands, but only a portion of it
can be seen through the 'window' of the sc~een.
When any Editor
command takes the user to a position in the file which is not
displayed, the uwindow" is updated to show that portion oT the file
i
THE CONCEPT OF A CURSOR
The cursor represents the exact posl~lon in the file and can be
used to move to any position.
The window shows that portion of the
file near the cursor.
To see another portion of the filel move the
cursor.
Action always takes place at the cursor.
Some of the commands
permit additipns; c:hange~ O'f' deletions of such length that the screen
cannot hold the whole portion of the text that has been changed.
In
those cases, the portion of the screen whe~e the cursor stopped is
displayed.
In no case is it necessary for the user to operate on
portions of the text not seen on the screen, but in some cases it is
cIj:d; i ana 1.
THE CONCEPl OF A PROMPT LINE
The Editor displays a prompt line as the top line of the screen
in order to remind the user of the current mode and the options
available for that mode.
Only the most commonly used options appear on
the prompt line as the following display shows:
:>E d .i t ; A ( d JUS t" C { P Y D ( 1 e t e F (i n ct
! ( Tn; r t
J { fi'I P
i~ P 1 ate
G { iJ i t
X( c h n 9 Z ( a p
NOTATION
The notation used in this ~ection corresponds to the notation
used to prompt the user in the editor.
Any input that is enclosed
between a < and> is requEsting that a particular key be used, not that
the partitule:.7' ;..)01"'0 be
tl~ped
out.
FOT"
~xample ..
(RET)- means that the
return key should tYPBO at that point.
When a particular sequence of
key strokes is required they will be contained within quotes.
For
examplEh ·'FILENAME": refei-s to the typed sequence uFILENAtvIE"
foll{)w~d
by
t;~~ing
th0retu':rn
when typing Editor commands.
l{elj,
Lower
C.i'
upper' case may be used
[ E. 6 -
******************* *****************
*
GETTING STARTED
* *
Section 1.3.2
*
******************* *****************
ENTERING THE WORKFILE AND GETTING A PROGRAM.
On entering the Editor
No workfile is
pre~ent.
File?
for no file)
appears,
There are two ways to answer this question
1) Wi th a name,
-POl"
examp Ie "STRINGl
'(T'et~>~',
The of i Ie named
STRING1 will now be retrieved.
The file STRING! could contain a
program, also called STRING1, as in Fig. 2. 1.
A~ter typing the name,
copy of the text of the 'irst part of the file appears on the SCTeen.
a
Figure 2.1
PROGRAM STRING! ,;
BEGIN
r SE '
)
WR I TE ( ;' YOU ARE')
WR I TELN ( I 1 ' ) i
i
WR I TE (
~
TOO
t~
i
WRITELN( 'TOO WISE');
WRITELN('YOU BE')
END.
2) With a (rEturn'. This implies thclt a new file is to be
started.
The only thing visible on the sc~een after doing this is the
editor prumpt line.
A new workfile is opened and currently has nothing
in it.
Type teI" to begin inserting a program or tE"Kt.
Workfiles: No questions are asked if a workfile already
The work~il~ is displayed and can be modified or can be
cleared, in order to start a file, by using the N)ew command in the
Fi ler.
exists.
Page 32
MOVING THE CURSOR
In order -to edit,
it is necessary to move the cursor.
On the
like triangles)1
which move the cursor. The moves the cursor up one line, the
and the cursor moves to the "W"in "WRITE".
SimilaT'ly at the "W" in "WRITE( "TOO WISE').i It, use '(left-arrow)- to move
to after the liN" in IIBEGIN",
Figure 2.2
BEGIN_
WRITE('TOO WISE ');
BEGIN
wRITE('TOO WISE
the th i
')j
If it is necessary to change the "WRITE('TOO WISE ')i" -Pound in
1 ine to a .lWRITE ( 'TOO SMART I) i u, the cursor must oF i rst be
l"d
moved to the right spot.
For example: if the CUT'SOT' is at the "P" in "PROGRAM STRING1; ",
go dawn two lines by pressing the down arrow 2 times.
To ma~k the
positions the cursor l.Jccupiesl labels aJ b, C a~e used in Fig. 2.3.
"au
is the initial position of the curso'f';
the first ;
"c u
,
"btl is where the cursor is after
after the second .
Figure 2.3
aROGRAM STRINGl
bEGIN
c WRITE( 'TOO WISE ');
Now,
using the right
aT~OWI
move until the cursor sits on the
"Wit of ItWISE".
Note that with the use of the cursor
a p pea r s to be;) u t sid e the t E' X t .
Act u it 11 Y i 't iSiS t the ft WIf i n II WR I T E" ,
so do not be surprised when on typing the first the cursor
j U in pst 0
-f; h e
'J
R II i n
II
WR I TE
If •
USING INSERT
item,
The Edit level prompt line shows that to I(nsrt (insert) an
The CUi"sor must be in the cOT'rect position befor'e
type !tIlt.
typing "Iii.
EaT'lieT'1 the Cl.1T'SOT' was rlH'J'-.ted to the "W" in IITOO WISE";
on t4ping III H , ;Hl in;!i.i::l·tion will be made before the "Wil.
The rest
of the line from the point of insertion will be moved to the right hand
side of the screen.
In the event that the insertion is lengthy, that
nOWI
Page 33
part of the line will be moved down to allow raomon the screen.
t y pin 9 "I u the of" 1 1 0 win 9 p 1" 0 mp t 1 i n e s h \'J U 1 d ap pea ron the 5 C l' e en:
Afte~
If that prompt line did not appear at the top Qf the screen it
is NOT insert mode and a wrong key may have been typed.
If the cursor is at the uWII, and on typing "IH the insert
prompt line appes'f.'e~:L HSMART" ma\J be in~ert~d by typing those five
letters.
They will appear on the sc~een ag th~yaT'e typed.
There remains one more important step.
Th~ choice at the end
of the prompt line indicates that pW$h1ng the key accepts the
insertion, while pushing the key rejects the insertion and the
text remains as it
~as
typir:g
bef.orE'
'11"
BEGIN WRITE( 'TOO SMART
Figure 2.5 (Screen after
WISE
');
~etx»
BEGIN
WRITE( 'TOO SMARTWISE ');
Figure 2.6 (Screen after , 'WISE'
must be deletedMove the cursor to the first of the items to delete
type flD" to put the Edi
line should appear:
and
:> Del e t
e.
(
") ·!:...M c- ''; 1 n 9
tOi'
{~Q ;n fll a rid
s>
into DELETE mode
{< e t x > t 0
del
€I
te,
The f'ollolding prompt
-( esc ). t
Each time is typed a letter disappears.
example typing 4
spaces will
cause
0
abo 1" t }
In this
IIWISE'! to disappear.
Now the same
Type and the proposed deletion
choice must be made as in insert.
is made or type and the proposed deletion reappears and remains
part of the text.
Paae 34
It isl.gal to delete a carriage return.
At the end of the
line, enter DELETE made, and until the cursor moves to the
beginning of the next line.
These are sufficient commands to edit any file desired.
The
next section describes many more commands in the Editor which make
editing easier.
LEAVING THE EDITOR AND UPDATING THE WORi-\FILE
When all the changes and additions have been made,
Editor .and "'save" a copy of the modified program.
typing
"G"
w~ic.h
exit the
This is done by
will cause the pTcmpting displa'J shown in Fig.
2.7.
Figure 2.7
)Quit:
U(pdate the work file and leave
EGuit.
e x pIa ins in
Page 35
************************************ *****************
*
DETAILED DESCRIPTION OF COMMANDS
* *
Section 1.3.3
*
************************************ *****************
COMMAND AND MODE
I~; t
t h i" E ct i t 1 ~ \I ~ J t h t? T' t? i-H' 0 ihH' q I) P tic 1'1 $ • ';;\ 0 me 0 .p "'J 11 i chat r e
referred to as commands and some as modes depending upen the appearance
of 'the prompt. I-f an option executes d task and returns control to ·the
Edit level. that option is called a cnmml~nd. If! an optinn issues a
prompt and gives the user another level of options, i t is called a
mod e . On en t e r i n 9 0 l' T' e t urn t n 9 t () thE? F d i t 1 ~ \/ E' 1 t the E ~ i t (') T' 1"' e dis P 1 ill Y s
the "Edit: I, prompt line.
REPEAT··FACTORS
Many of the commands allOW
Tepeat-facto~s_
A repeat-factor is
applied to a command by typing a number immediately before issuing the
command which is then repeated for the number of times indicated by the
T'epeat--t~act;or.
FoT' eiiample:
tlJping
commma~d to he executed twice, moving the curSDr dawn two
lines
Commands which allow a repeat-factor assume the repeat-factor
to be 1 if no numb~r is typed bef~re the comm5nd.
A 'I' typed before
the command implies an infinite number.
THE CIJRSOR
It $hould be point:ed out that th~ cursor is never really :lata a
character.
The cursor is only allowed to be Hbetween" characters.
For
inst,,3nce, :lof th,.~ curSDr' looks 2.50 tho'-,gh it j.,:, ,3t the letter "R", l.t is
act1Jally between the
letter "R" and
t:hf~
Jettf"'"''
in fT'ont of it.
This is
most clea~ly cn the inse~t cnrnmanrl as it in~erts in front of
the c h a rae t e r the c ~rr ~ 0 r ~\J a s I, _s t " .
Qnt.: h £ S C '["' e e t1 the c U'1" SOT' i s pIa c e d
Hat tl IIR" to make it e-asie~ to display
notic~d
DIRECTION
C e i' t a inc. a mm ~ n G;:; a l' e a f' fee ted t,. !.j d i :" e ;;.: t i I::' ("f , 1 f t h {Z' d i 1"" 0' C t ion
of! 0 T W 2. r d I f: h \~ r"! they 0 (.,-:, !:" t ? f:: f' ~i' '0 r d t ~"; ':'; '.' 9 h. + ~; I~) -f j 1 e . t h ;:3, t h ei. 1"'l 9 ~:. Ii eo
s tan d aT' :j d ire c t; i I) n 0 f ~ - ~ d d 1 n 9 Eng 1 i :5 fL
L ;;i ':: h 1.:J d f' d s i s thE- reverse
direction.
When direct.1on ,aft'!ects the command it is Epec i t~.icall'J
i s
noted.
MOVING COMMANDS
'(d
own-aT' 'f' Ot,:.I)
!'1oves down
Mov'es LIp
-( 1 e.p t--arr ow:>
....c: H or " I U or
or !I.
:').11
11
l'1oves right
Moves left
~:r_'f
or tI+"
Changes the
Changes the
di~Ection
to backward
di~ection
to forward
Moves diT'Ection
Moves l~'ft
<1:ab>
Moves
<,..eturn)-
of 8 spaces from the left side of the screen
Moves to the beginning of the next line
Page 36
di~ection
to the next position which is a multiple
I
ne
a l' r
f)
W
......
~
l..J I
".~.
... . .
....... •• "'
_.
- •• -
r
- - -- . .-
-
-
indicates dir·ection; H<" foT' backward and ")" TO~ forward.
On entering
the Editor, the direction is forward.
The direction can be changed
by typing the appropriate comm~nd whenever the itEdit: II prompt line ],s
pre~ent,
The period and the comma can also be u~~d because on many
standard
key b o~rd S I
case for
iI-(lf.
;:.
II
is 1 O'.i.H~T'-·case for
I I ) II
and
U I
II
i
5
the 1 Qwer-
Repeat-factors can be used with any of the above commands.
For user convenience, the Editor maintains the column position
of the cursor when USiTtg and .
When the CU~SoT'
is outside the text, the Editor treats the CU~SOT' as though i t were
i mme d i a t i? 1.J aft e T' t ~ 0 1 i;,} s t c ha l' act e r t '0 r b e for e the of iT'S t ) i nth e l i n e .
typing
JU!"IP mode< is T'l:acho?tl by
an
>JUMP
ent~rLng
B(eginning ECnd
T 'J P i 1"'9
" B"
end) of the fi!e,
p a 9 fi' 0 f thE': f i. 1 & .
1 i ne'
(o r
foT' ,J(mp while at the Edit
" . j'i
J0MP mode tne following prompt line appears:
M(arke~
/, E Ji)
m(: \.' f!' S
the
C!.J 'j' So 07'
t; 0
the beg j, in! 1 n 9
(o T' the
the edit prompt line and the first (or last)
T y pin 9 It i"'~ :a (:,~ i) ~ e s t h e Ed i t (I T~ to dis pIa y the p or 0 mp t
di;pla~s
The name of the marker must be entered followed by a .
The Editor will then move the cursor to the place in the file with that
n~me~
Ir the
ERROR:
i!H~l"k~n'
is not irithe ftl>? the Editor will display:
Marker not ·there.
rhe
Please press to continue.
instructlofiS fo\' %etting
Mierell~neous
~
ln~.;)\'keT·
are detailed
in SET under
command~
PAGE
IS ex-s![ui:ed by 'typing "P" while at the Edit
Depending on the direction of the arrow at the beginning of the
prompt line, PAGE com~and moves the curSD~ one whole 5creenful up or
dewn,
The CUTsor alw~ys moves to the 3t~rt of the line.
A <~epeat
fact.or) maij be us~d berore this comm~nd ·Fc.r moving several pages.
Pt1tGE cDmmand
le~el.
eQUALS
CCm\l~B·:~,J
li
~i:::CL,-,tt:'d
b;,.
t,ypiny
"::.;~"
while
at
the Edit
It causes the cursor to Jump to the beginning of the last
s~ction of te~t which was inserted,
found or replaced from anywhere in
the file.
Equals wo~ks f~om 3n~where in the file and is not direction
sensitive.
An INSERT. FINO or REPLACE cause the absolute position of
the beginning of the insBrtion. find or replacement to be saved.
TI,Jping "::::" c~uses the Cl!i'sor to Jump to that position.
I f a copy OT' a
deletion has been mad~ between the beginning of the file and that
absolute position, th~ cursor will not Jump to the sta~t of the
insertion as that absolute position will no longer be correct.
level.
Page 37
TEXT CHANGING COMMANDS
INSERT
INSERT mode is reached by typing "I" .par "I(ns .... t ll while at the
Edit level.
On entering INSERT mode the following prompt line appears:
Jlnsert:
Text «bs> a charJ acceptsl escapes]
line}
One of the options here is to type in text followed by .
type .
The INSERT prompt line indtcates
and u a line",
th~se
by
" a char"
Typing INSERT starts a new line at the levQl of
indentation specified by the options turned on in Environment section
of the SET mode.
S~e the section on the SET mode in order to set these
options.
AUTa·~, INDENT
If Auto-indent is True. a causes the cursor to start
the next line with an indentation equal to the indentation of the line
above.
If Auto-indent is False, a returns the cursor to the
first position in the nelCt line.
po~ition
Note:
i~
Filling is True,
the first
is the Left-margin.
FILLING
If
Fil1i~g
is True.
the Editor
fo~res
all
inse~tiDns
to be
between the right and leFt margins by automatically inserting
's between fiwOT'ds whenever 'the T'ight maT'gin would have been
exceeded and by indenting to the Left-margin whenever a new line is
started.
The Editor considers anything between two spaces or between a
space and a hyphen to be a word.
ti
If both Auto-indent and Filling are True, Auto-indent controls
the Left-margin while Filling controls the Right-ma~gin.
The level of
indentation may be changed by using the and ke~s
immediately after a <~eturn>.
Important: This can only be done
immediately after a .
Exa~ple
c"peate $
1: With Auto-indent true,
the following sequence
th e i nd en tat i on sh own in Fig ure 3. 1.
"ONE U ; (return)', i "TWO",
'(T" e turn)'; ,I THREE jJ, ,
<~eturn) causes auto-indentation to level of line above
changes indentation from level of line above
Example 2: With Filling T~ue (and Auto-indent False> the
following sequence creates the indentation shown in Figure 3.2:
"ONCE UPON A TIME THERE- WERE".
(Very n.rrow m.rgins have been used for simplicity. )
Figure 3.2
----_._--------------------------------------------------------------~-
ONCE UPON A
Auto-returned when next word would exceed margin
Auto-returned at hyphen
T It'1E THERE-
WERE
Level of left margin
Filling also causes the Editor to adjust the margins on the
portion of the paragraph following the insertion.
Any line beginning
with the Command character (see SET mode) is not touched when filling
does this adjustment and that line is considered to terminate the
paragraph.
by
The direction does not affect the INSERT mode,
the direction of the arrow on the prompt line.
If an insertion is made and accepted,
available for use in the COpy mode.
However,
is no string available for COPY.
but is indicated
that insertion is
if is used, there
DELETE
DELETE mode is reached b~ typing nOli for "D(lete while at tht!
Edit level.
On entering DELETE mode the following prompt line appears:
ll
>Delete:
< > «etx) to delete, , to abort}
In order to delete, the cursor must be in position at the first
character to be deleted.
On typing "0" and entering DELETE, the
Editor remembers where the cursor is. That position is called the
anchor.
As the cursor is moved from the anchor position using the
normal moving commands. text in its path will disappear.
To accept
the deletionl type i to escape/ type .
When is typedl
del e ted
emp ty.
for COP Y t
0
use;
the Editor saves everything which was
but i f <: e 5 c:> i sty p e d the cop y b u f fer i s
I
Example:
In Figure 3.3:
1) Move the cursor to the liEn
<: n
in END.
T his c han 9 est h e d ire c t ion t 0 b a c k wa r d )
Type 110" to enter DELETE mode.
4) Type .
After the fir~t return the cursor moves to
before the "W" in l..JRITELN and "WRITELN( 'TO BE. ') i ltd isappears. After
the second return the cursor is before the "W" in WRITE and that
line has di5appeared.
5) Now press . The program a~ter deletion appears as is shown in
Figure 3.4.
2)
3)
Ty pe
\I
(
Page 39
The two deleted lines have been stored in the copy buffer and
the cursor has returned to the anchor position.
Now use the COPY
routine to copy the two d~leted lines at any place to which the cursor
is moved.
Figure 3.3
PROGRAM STR ING2i
DEGIN
WRITE( 'TOO WISE
')i
WRITELN( 'TO BE. ')
END.
Figure 3.4
PROGRAM STRING2:
BEGIN
END.
The may also be used to delete several lines as
once by prefacing a or any other of the moving commands with a
while in delete mode.
ZAP
The ZAP command is executed by typing HZ" for Z(ap while at the
Edit level.
This command deletes all text between the start of what
was previously found, replaced or inserted and the current position of
the cursor.
This command is designed to be used immediately after one
of the FIND, REPLACE or INSERT commands.
If more than 80 characters
are being zapped the editor will ask for verification.
repeat
zapped.
Repeat-factors and Zap: If a FIND or a REPLACE is made with a
and then ZAP, only the last find or replacement will be
All others will be left as found or replaced.
f~ctor
Whatever was deleted by using the ZAP command is available for
use with the COpy command.
COpy
The COpy c:ommand is executed by typing "e" for C(py while at
the Edit level.
On entering the Copy mode the following prompt line is
displayed:
>COPY: B(uffer F(ile
To copy text from another file,
will appear:
Page 40
type "F" and another prompt
>COPY: FROM WHAT FILE[MARKERIMARKERJ?
Any file may now be specified, . text is assumed.
In order to copy part
of a file, two markers can be set to bracket the desired text.
If
marker] or [marker, ] is used, the fi Ie wi 11 be cop ied from the
start to the marker or from the marker to the end.
On completion of
the copy command (from file), the cursor returns to the beginning of the
text Just copied from the file.
Use of the copy command does not
change the contents of the file being copied 'rom.
[
I
To copy the text in the copy buf-Fer, type,uB" and the Editor
immediately copies the contents of the copy buffer into the file at the
location of the cursor when ftC" was typed.
0" the completion of the
copy command the cursor returns to immediately before the text which
was copied.
Use of the copy command does not change the contents of
the copy buffer.
The copy buffer is affected by the following commands:
l)DELETE: On accepting a deletion, the buffer is loaded with
the deletion; on escaping from a deletion the buffer is loaded with
what would have been deleted.
2) INSERT: On accepting an insertion the buffer is loaded with
the insertion; on escaping from an insertion the copy buffer is empty.
3)ZAP:
the deletion.
If the ZAP command is used the buffer is loaded with
The copy buffer is of limited size. Whenever the deletion is greater
than the buffer available, the Editor will issue a warning upon typing
with the line:
There is no room to copy the deletion.
Do you wish to delete anyway? (yIn)
EXCHANGE
EXCHANGE mode is reached by typing "X" while at the Edit lev.l.
On entering EXCHANGE mode the following prompt line appears:
>eXchange: TEXT «bs> a char} [ escapes; acceptsJ
EXCHANGE mode replaces one character in the file for each
character of text typed.
For example in the file in Figure 3.5 with
the cursor at the "Wit in WISE, typing "X" , followed by typing "SM·'
will replace the "W" with the "S" and then the "I" with the "Mil le4ilving
the line as shown in Figure 3.6 with the curSOr before the second US".
Figure 3. 5
Figure 3.6
WRITE('TOO WISE ');
WRITE('TOO SMSE ');
Typing a <<:bs» will back the cursor one character
and cause the original character in that position to reappear.
As with
most oth~r commands, when in EXCHANGE mode, leaves the mode
without making any of the changes indicated since entering the mode,
while makes the changes part of the file.
01'
~ 0 t e : E " c h fa n qed n e s not all 0 t11 "J2J!l?_i n 9 . pac; t the end
typing in a carrlage return.
0
f
the lin e
FIND AN.D REPLACE
In both modes the use of a by the prompt
lines, is the target string and is refer~ed to by both command~ while
the other, called by the p~ompt line, is the substitute and is
used only by REPLACE.
ThePollohling rules apply to both these strings.
Delimiters: Both delimiters Qf the string will be the same.
For exampl~: Wher in RrPLACE mcd@ th? following command is valid and
will replace the fi1"st occurrence of th~ churacter "[II with the
character "]": 11«<)])". Here II·C It and It)" are the delimiters,
The Editor considers any character which is nnt a
letter or a number to be a delimiter. is a particularly common
del imi tel'.
Direction~
Both modes operate from the position of the cursor
to scan the text in the direction indicted by the arrow on the prompt
line.
The target pattern can only b~ found iT it appears in that
section of the text.
See the section on direction on order to change
the arrow
Literal and Token mode: In Literal mode, the Editor will look
for any occurrences of the target string. If you are in Token mode the
Editor will look for isolated occurrences of the target string.
The
Editor considers a string isolated if i t is surrounded by any
combination of delimiters.
FoT' examplel in the sentencf' "Put the beok
in the bookcasp.. "; u5ir~g the target st;1"ing "bock!!, literal mode will
find two occurrences of "book" while token mode will find only one} the
word "book" isolated by the delimiters .
To use token mode, type "Til after the prompt line and before
the target string; to use literal model type "L".
The de~ault value
found in the Environment may be over-ridden by typing ilL" or liT" as
appropriate.
Token mode ignores spaces within strings so that both
"( ',' )" and "(', ')" are considered to be the same string.
Paae 42
The Same op tion: In both commands typ ing "S" ind icates to the
Editor that it is to use the same string as used previously.
For
example, typing "RS/l" causes the REPLACE ·mode to use- the
previous target string, while typing "R//S" causes the
previous substitute string to b~ used.
FIND
FIND mbde is reached by typing "F" while at the Edit level. On
entering Find mode one of the prompt lines in Figure 3.7 appears.
Figure 3.7
>Find[ll: L(tt
>FindC1J: Teak
The FIND mode find~ the n-th occurrence of the string
starting with the current position and moving in the direction shown by
thearT'ow at the beginning of the prompt line.
The number "nil is the
and is shown on the prompt line in the brackets He]".
Example 1: In the STRINGl program with the cursor at the first
"P" in PROGRAM STRINGl type "F".
When the prompt appears type
'WRITE"'.
The single tl,uote mal'ks MUST be typed.
The prompt line
should now appear as:
II
)Find(ll: L)it
=~'WRITE!
After typing the last quote mark the cursor Jumps to immediately after
the "E in the fir 5 t WR I TE.
f!
Example 2: In the STRING1 program with the cursor at the "E" of
fiEND. II type: u-(" "3" "FIf.
This will find the 3rd ("3 11 ) pattern in the
reverse ("<") direction.
When the prompt 1 ine appears type IWRITELN/.
The prompt line should read:
-(Find[31: L)it
=>/WRITELNI
The cursor will move to immediately after the liN" in WRITELN.
Figure 3.8
PROGRAM STRINGli
BEGIN
WRITE('TOO WISE ' ) i
WR I TE ( , YOU ARE');
WR I TELN ( " ');
WRITELN('TOO WISE ')i
WR ITELN( 'YOU BE. ')
END.
<*CURSOR STARTS IN THIS LINE*)
Example 3:
the first "WRITE".
~Findr1l:
(*CURSOR FINISHES IN THIS LINE*)
On the first find we type flF/WRITE/".
This locates
Natal typing "FS" will make the prompt line flash:
L)it
=~S
and the cursor will appear at the second WRITE.
REPLACE
REPLACE mode is reached by typing URn while at the Edit level.
On entering REPLACE mode one of the twa prompt lines in Figure 3.9
appears. In this example, a of four is assumed.
Figure 3.9
>Replace[4J: L(it V(fy =)
>Replace[4J: T(ok V(fy =)
Example 1: Type "RL/GX//YZ/" which make the prompt line appear as:
>Replace[lJ: L)it V)fy =>L/GXI/YZ/
This command will change: "VAR SIZEOX: INTEGER; It to "VAR
SIZEYZ: INTEGER; ".
Literal mode is necessary because the string OX is
not a token but is part of the token SIZEOX.
Example 2: In Taken made REPLACE ignores spaces between token~
when looking for patterns to replace.
For example, using the lines on
the left hand side of Figure 3.10 and typing: "2RT/(',' )/. LN ... Th.
prompt line should appear as:
>Replace: L)it V)fy =>/(', ')/. LN.
Immediately after the last period was typed those two lines
would change to those on the right hand side.
WR I TE (
WR I TE (
I:
! I
WRITELN;
J);
~.);
WRITELNi
V)fy: The verify option permits examination of the
string (up to the limit set by the rep@at factor) and deciding if
it is to be replaced.
The following prompt line appears whenever
REPLACE mode has found the pattern in the file and verification
has been requested:
( dOEsn't
T Y pin g a 1': II R II a t; t; h j. ~1 P c :i n t {jj J 1], c au {'; fl i~ rep 1 ace men t OJ h i 1 e
typing a space will cause the REPLACE mode to search for the next
occurrence provided the has not been reached.
The
counts the number of times an occurrence is found, not
the number of times you
ac:tl..I~11y
typ.e
URI!.
Ufif? eI/" as a
'(T'epeat-·f\~r.toT':>
in order to replace every occurrence of the target string.
Editor can no longer find the target string, the prompt:
Once the
ADdUST
15 reached b~ typing HI'"," whi.le at the Edit level of
On entering ADJUST mode the following prompt line appears:
ADJUST. mode
Command.
>AdJust: L «etx> to leave}
The ADJUST mode is designed to make it easy to adjust the
indentation.
On any line the and commands
move tne whole line. Each time a is t~ped the whole line
moves one space to the right.
Each (left-arrow> moves it one tD the
left. When the line 15 adjusted to the desired indentation pres~ <@tx>.
After prs5sing , cannot be used.
1'il
DT'd~:";"
t~1
':;'i,1.JUi;t
~
i.~JhC')l~~
s~~ql}(~r!f"f~
of li.nes;
adjust
one
then use «down-arrow»
comm~nd5 and the line above
will b A automatically adjusted by the s~m~ amount.
C omm·!tf1 d s
Repeat-factors are valid when
wh i 1 e in AD·.)us"r ma de-.
u~ed
linf~§
(below)
before any of the
AD,JUST mode can also center or ,Justi-fy text. Typing ilL" while
in ADJUST mode will cause the line to be left-Justified to the margin
set in the Environment. Similarly typing uR'; right~-Justifies to the sat
ma r gin and t \j pin 9 r. C W 1. l I e ~ u 'S e the 1 i net 0 b e c:: en t e l' 0 d bet l..0 e en the
set m~rgin5. Typing (or li~ .~'~~ I'I:Ui.h d'S pu~,sible withou'c violating
the above t~rep margins
See th~ EnviTonm~nt option under the SET mode
for how to set the margin values,
Example:
Ttt~
t h t'? p i:H'c:\ mf~ t e r son t h
bee n
Ml:'\R G
r N f.! d w t t h t
p":'lI·agi'arh In rl9~q~ ~~. 13 h-.'ds been Ml\RGINed with
1 €' f t w II i 1 e t. h f.:' S ~1!'\;?,' par .:E'q;p'~ ~ phi n F i 9 u r e 3. 1 4 has
l'"l t? p.3 r a In ~.' t f~ T'!~ 0 if the r l. 9 h t.
€'
L f? f' t --, ill::-! ';' 9 i;, :';
Right-·m.;J.rq tTl 1,2
P t:..~ 'r a 9 i' "~ P h _. if; d T q ,1 II
T his q u .~ rtf.? T,
arE-
s\.Ibst~T',t:i.all·y
of T" 0 m p"l' e v i Q tJ S
t; 0 0 k t II f~ ;:
wh (j
Figure
~i,
0.. U c3 i'
L. 1=1f' t·· .iT~'~1 r' gin 1 0
Right-mat'g in 70
a
Paragrdph-m~rgin
t h r~ e n, li i ;:: 1'f\ f! n t
di~'fF'r-0'n~,
:;!~;fd
t
ltl l 1.~
Y0
€' T ': .
0 I., i 'f' S ~.
P '~' f'
\j
i
U
0 ~ t :; ],~
thf:'
j
s d}
P of P T'
c:;"\:}·:-'t::~
b E' m i. s :l e d
toe 1" i e ;; t
~.i
('j
e p. t!
0
t h t? r.
{i
[.r~.!.:3niz\-:;:ti.on
iJ T' S. fl
is
mE:I t ~ r· i a 1 'S
d:i..ff~'l"~nt
if. you d €? P Po n rl up 0 n ·a f! 'r ]. end
v t c t.: h~:: co U T' ~~ if:'
14
thi: equlpment is d.iffeT'ent;, the course materials are
substantially different. and the courne o~9anization is
different from previous quarters.
You will be misled if
you depend upon a friend who took the course previously to
Thi"5 quarter,
GPient
ijou
tc
th:'?
!:OUT;~~.
------------------------------------------------------------------------------------
Pane 46
A paragT~ph is defined to be something occurring between two
blank lines.
To MARGIN a paragraph move the cursor to anywhere in that
paragraph and type "M?!.
Whan doing an exceptionally long paragraph it
may take several seconds before the routine is ready to redisplay the
SC1"'een,
COMMAND CHARACTERS
Portions of the text can be protected from being MARGINed by
the usa of the Command Lharacter.
If the Command character appears as
the first non-blank character in a line then that line is protected
from the MARGIN command.
The MARGIN command treats a line beginning
with the comm.snd characteT" as tlHHJgh l.t were fa blank line, that is, it
will consider that line to terminate (begin) the pa~ag~aph.
Warning: Do nat un~ the MARGIN command when in a line beginning with
the Command character.
MISCELL('~NEOUS
CDNHt-\NDS
SET
SET mode is ent~red by tvp l.ng "S" wh tle at the Ed it level..
The prompt for the SET command does net appear- on the "',)£:d l.t: II pT'ompt
line due to space limitations.
On entering the SET mode the following
prompt line appears:
>Set:
M(a~ker
E(nvironment
M.
so that lower and upper cases of the
same letter are considered to be dlfferent cha~acte~$.
Th~ marker will
f.~ 'f' e d 116 t
t h !E pes i ti (i n Q f the C U f' S 0 'r' i nth e t e ~ t j the i' e ·f Q rei of iT's t
move the cur90~ to the desired position before setting the marker.
(If
bee r; t
the
m~~keT'
alread\l
existed>
i t will be
T'e%·et.)
Only 10 markers are allowed In a fila at anyone time.
"8MH! the prompt:
Ii! on typing
Page 47
Figure 3. 15
Marker ov-F lw.
Which one to replace.
0) name1
1) namp.2
9)namel0
it is necessary to eliminate one in order to replace it.
Choose a number 0 thru 9. t~pe that numb~r and that space will now be
available fa~ use in setting the desired marker.
appears~
If a copy or deletion is made b9tween the beginning of the file
and the position of the marke~f the mar~pr will not subse~u&ntly return
to the desired place ~s th~ absolute position has changed.
E (nvi ronment:
Th. Editor
the us~r to set the environment which the
convenient fQ~ thp editing being done.
When
in the FET modf~ t~jpe "Ell fQ"!"' E or tn le-i,v\?,
ACuto indent True
L(ePt mar-g:in
0
R( i 9ht
p (,:IT';~'l
79
ftH!tT' gin
m·~T' 1.1 i n
C(ommand
en
T(nken dE?f
,'.
Trul:,~
Patterns ~
= 'xyzr, =
'abc'
----------------------------------------------------------------------
Pane 48
B~
be changed.
typing the a.pp~opriate letteTI any or all of the options may
The options shown are the d~fault options for the Editor
on the Terak 8510A.
differ~nt
Implementations for other machines may have
defaults.
The Options;
A(uto indent:
Auto-indent affects only the INSERT mode of the Editor. Auto(tu'rnf:'?o on) h~l tuping "AT" and to False (turned
indent is s8t to Tr'u~
of of) b tj t IJ pin 9 .. AF II •
F(illing:
Filling affects the INSERT mode and allows the MARGIN command
to function.
Filling is s~t to True (turned on) btl typing JlFTJI and to
False by typing "FF".
L(eft fNaT'g:in
R ( i g h t: ffi.-:.'i l' gin
P ( a r a m;:,\ r- gin:
When Filling is
marg ins wh i ch affec t
affect the Cent~r and
t h P. L £? T t; ,- ma T' gin, t q P t~
T~ue
the
the margins set in the Environment are the
INSERT mod e and
the l'1ARGIN command.
They a 1 so
commands in the ADJUST mode.
To set
of 0 1 1. 0 lotH:' d h!.j -::I 13 0 ~ i t 1. ve 1. n t e geT' ,'a n d a <: 5 P ~'a {" @ :> .
Justi~ying
u
LH
The positive integer typed should replace the old value for the L(eft
margin in the prompt shown in Figure 3.16
All positive intege~s with
less than four digit~ are valid margin values.
C(ommand ch:
The Command character affects the MARGIN command and the
Fi 11 ing upt:3.on in the INSERT ITHHie a~ described in those sections.
Change Ct)mmand chaT'actel'$ b~J typing I'C H -folloloed btj any character.
For
example typing '~CH; Il~\.i' will change th~' Comm~nd cha'racter to u*".
This
change will be reflected in the p~ompt.
T( oken der:
This option affects FIND and REPLACE.
Token is set to True
typing "TTl! and to False by typing "IF!!,
If Token is True,
the dei!ault ,-;,nd if Token is False, Literal is the default.
b~
Token is
Page 49
VERIFY
The VERIFY command is executed
Th~~
Edit level.
status of
th~
by
typing "V" while at the
Editor is verified by displaying the
updated screen.
The Editor attempts to adjust the window sa that the
CUT'90r is at the center of the screen.
GUIT
GU I T mod e i
ent~ring
S
T'
e a c h e d b Y t y pin 9
f!
wh i 1 eat the Ed i t I e vel.
GU
On
QUIT mode the screen display is replaced by the following
p1"'ompt:
Figure 3.1"7
~;.G{'J
it:
UCpdate the work file and leave
E(xit without updating
R(etuT'n
to
the e-ditoT' without Upd2;t:i'ng
W(rite to a file name and return
On €I
0
f
t h F,!I f
0 IJ 1"
0
Pt i
Q
n5
m'.J s t
bEts e 1 e c ted
b y t Y pin 9 U, E J R
t} T'
W.
U(pdatf~'
This causes the Editor to
l.4ii'itF:
thE
fi1.~;.
just ffi:')difir:d
into the workfile and store it as SYSTEM. WR~. TEXT.
It is available
for either the Compilp O~ Run option~ o~ for the Save option in the
File"!'
Thp F~1f?7' treat5 SYSTEi1.WR~{ TFX'r ,~'3 +(Ji!r file
E(xit:
This
C2·iiS(;H'.i
the EditoT"
tn
11;?:~\-·E·
l~li
t.hnut
,'!!.;r.JGui t:
Namn of output file
Page 50
«C~>
to return)
-->
The cUr'sor
Gil. wa 5
t'JPing tlG1 1 .
rt
The modified file may now be written to any file name.
If it
is w~itten to the name of an existing file, the modified file will
replace the old file.
This command can be aborted by typing
inste~d of a file name and ~eturn will be to the Editor.
After the
file has been written to disk, the Editor will prompt with the
followin9~
Figure
~J
19
:-;:·Gu i t
Writing .... _
Your file is 1978
Do.
you
Ui ..:\ n
t
lang.
b~tes
toE. (x,Lt f
i" 0
m
0,..'
R ( e t u r' n
t
G
the Ed ita or?
Ttj ping liE" ex its rl'o;n the Ed i tor and 'f'et urns to th e Command
lev(?l while typing "R!' returns the cursor to the exact position in the
of i 1 e as when
Q
wa s 1.; y p e d .
I!
it
********************* *****************
*
REFERENCE SECTION
* *
Section 1.3.4
*
********************* *****************
.(,:: 1 e of t-arT ow:>
lines down
II
I;
1 i nes up
II
H
spaces right
Ii
spaces left
spaces in direction
"
,t
spaces le-pt
ffi0ves <~epeat-factor> tab positions in direction
moves to the beginning of line lines in directic
tI
change dire~tion td backward
change direction to forwaTd
moves to the beginning of what
exchanged
A(dJu~t-
C(opy:
W3S
Just found/replaced/insertedJ
AdJust··~ the ind~~ntation of the line that ·the l::ur$O,- i$ on.
U5e
the ar~DW keys to move. Moving up (down) adjust line above
(below) by sam~ amount of adjustment on the line you were on.
Repeat-f~ctors are valid.
Copies what waG last inserted/deleted/zapped into the file at
the position of th~ cur50~.
D(elete:
Treat·s· the starting position of: the cursor as the anchor.
any moving
commands
to move the. cursoT'.
Use
delates
everything between the cursor and the anchor.
Page 51
F(ind:
Operates in L)iteT'al or Tioken mode.
Rr.pea't-·factol's aT"e
string as b.fore
v/ijlid~
Finds the string.
diT'Ectlon
i~)
applied .
HSU;::;:;
use 'same
Insert15 text, Can use to reJEH:t part of
insertion.
I(nsert:
\lOUT'
.J (ump :
J u mP!i
M(argin:
AdJusts anything b@tw~en two blank lines to the margins which
been set. Command characters protect text from being
margined.
Invalidiltes the COP\} tHd~fl:.. r.
t o t h e beg inn in 9 ten d or
j:H' eo v
i
0 US
1 ~.f s ~ t
rna r k e r' .
hav~
P(age: Moves the cur~or one page in
valid: dIrection is applied.
G ( u it:
R( ep
Lea v ~ 5
the e d i t Gr.
~irection.
Y t) U may U) p d ate.
Repeat-factors are
E ) x i t; I
W) T> i t e
,!
0r
R)
e t tJ r n .
D p to:! 1" ate ~ ! n L < i t. ~ r ,3 l o r T ( 0 ken mQ de. Rep 1 ace s the .( tar g )string with th~ causes the
original Ch,:3T';;:~:t""TL to 'rg-'appe.3r.
mode-.
Z)ap:
Treat. the
position o~ the last thing
as an 2nchor ~nd d@let~s Dverything
between the anchor and the current cursor posItion
~ta~tin2
fnund!r~place1/in~eTted
is any number typed
i n Fin i t f? n U ff) t ~,..' ,
Page 52
befor~
a
comm~nd
Typing a I
is the
************* *****************
*
* *
L2 EDITOR
Snction 1.3.5
*
************* *****************
Version L 5
September 1978
The L2 Editor is being released on an experimental basis.
Not
all option~ a~e yet fully implemented so this section may not be
complete. The main advantage of this version is that it is able to
handle files larger than can fit into the main memory buffer at one
time; the upper limit being determined by the space available on disk.
It al~o automatically makes a backup copy of the file being edited.
In
many Tflspects this Editor wa~ks exactly as this release and displays
the same prompt lin~s.
Whe~a the versions are the same,
the user is
dirncted to read the m0in Editor section,
Entering the
If~
ERROR:
WQrk~ile
and Getting a PrcgTam
on 't;yping E,
th::::re
not enough room on the disk;
i~
Not enough roam far backup!
will be displayed.
This dlSk must then be K(runched in order to
provide reom if that is possible, a file removed or another disk must
be used.
The same prompt line is displayed;
see section l. 3.2.
1) With a name.
If a file is chosen, a backup copy will be
made before the file is available for editing,
:::Ed it;
A·~
in
t his ";' ,~ 1" ).\~ ,;,,:
t. l] T'
s~ction
0 .f!
fi l' 0 m p t
1 in e S I t h ifJ
fir s t
p ~ l' tor
the
t ext
1.3 2.
Th8
pa . tagr~~phs
sectittn 1.3. 2.
~,hould
Ofl
be
mt'hiir'lg
th;;~
curE,OT'·
InffieT't and Delete
in
'f'ead and ar'f! applicable here.
Leaving the Editor and Updating the workfile
When all changes and additions have been made, the Editor is
ex i ted b tJ t ~J ft .i D 9 II Q 1= a 11 r. t h (~ f 0. lID tl:' i n 9 p 'r 0 mp t i s dis pIa y e d.
Figt:re 5.2
U(pd~te the wnrkfile and leave
ECxlt (but workfile not updated)
R(eturn to the Editor without doing anything.
_ _ _ _ _ _ _ , _ _ _ .......... _ _ ,.
_
...... _ _ ~ _ _ _ _ r _ _ _ _' U... _ _ _ _ _ _ _ _ _ _ _ _ _. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ . . , . . _ _ ~ _ _ _ - - - - -
Notice that the Write aptian is no longer available.
One of
these three options must be chosen.
S~e also Miscellaneous commands
in section 1.3.3,
lHpdate:
This works in the same manner, however additional in~ormation
is supplied indicating the name 09 file updated and the length.
When a new file is cTeated,
the fallowing appears:
Figure 5.3
Writing.*
The work~ile,
When an
*SYSTEM.WRK. TEXT,
is n blocks long,
file has been used,
now given:
exi~ting
info~mation
this exarople shows the extra
Figur'e 5.4
Writing.*
The wcrkfile. *X:Fl.TEXT, is 44 blocks long.
The backup file is X:Fl BACK
The newly edited file is referred to as . TEXT, while the . BACK file
cont~ins the original file with no modifications.
E(xit:
This ca~ses the Editor to return to the command level without
making any changes in the workfile.
No . BACK file is made and the
existing . BACK is removed,
For example, if Fl. TEXT is the file being
used, then a copy Fl. BACK will be made an ~ntering the editor and on
leaving by using the E option, Fl.BAC~ will be removed and only Fl. TEXT
HrHJ:evel~,
will remai.n.
since Fl. TEXT is a
will be in different place in the
ropy of the o'''igin4:'11"
it
di~ectory.
R(et.uT'n:
This is the same.
MOVIN(i
c; .:L'
i)
'I
See section 1,3.3.
COt'1t~ANOS
n"
Jump mode displays the same prompt line as befure.
and
" E " r e -f ii! 'f' t o t h e beg inn j n 9 ( en (1
j
(}
f
beginning(end) of the file.
Typing
\lt1"
causes the Editor to display:
In this
the b (J ~ f e'f' not t h it
Jump. to what marker?
It is now possible to use 20 ma~~ers and these will be set in
tl1e ';5·:.?m~ !Af~y as in section 1. 3, 3..
To JDmp to the desired mSr'keT'1 type
in to@. namf:?,
l'r the rnt2r'!Q?r is pT'esent. tht:! Editor will Jump to that
position, otherwisel the Editor' will Jump to the last position of the
CUTSO~ in the file.
If Find needs to search a section 0 ' the file,
o t. 1'1 ~ l' t h -tH1 t h tl b v f of eo r
L e ,3 p i it g. . ' . ., will bed i s pIa y e d' .
BANISH
J
lev~l_
This is a new command and is reached by typing US" at the Edit
This is the p~ompt that will appear:
:> B ':'H'! i
h:
~
Tot h f.To L ( ~... 'F t;
0 T'
R( i 9ht
(esc»
Prior to doing a large insertion or copy, in order to provide
more room in the buffer and avoid buffer overflow, it is possible to
move charactflTs from t~~ buffer into the stack.
There is a left and a
right stackj
left being ahe-c1d of the
and right,
CUT"SOT'
behind the
cursor
The USRr can make the choic~ acco~ding to the current
situ~tion,
In general, the screen is the boundary for the operation.
NEXl
In
ordfi.~r
The following
tp move beyond
p~ompt
the
b~,)lJndc;~
of the bufFer,
type
t'Nti.
will then be displayed:
implicit h.:lni~.d~ nCCt.p"'~; using the r.U'P~fji' {Z\'; thE' point of
e
F' {:'. T' {-n:~:re mp ]. p ; ttl hen ., F II i s t IJ P ~ d ! ~: '\." ~ l' Y t h :i n gab Q v e t h e top 0 of!
the screen is b~"ished to the left stack.
More characters are added to
the bottom of the SCTeen to extend the buffpT in the fD~ward
di·i"'fi'ction.
Wh~n "Ef: .is us~d the charerb?T's tH:lt::lt\,l the CUT'sor ST'e
ban i .~ fl edt c the rig h t s t: a c k and p (~l' t o f t h e ~> Cf' e en w.i 11 bee 0 me b 1 ~3 n k .
l'n!',
"r"
':?' t·
:!'
Mor~
ii~rl
'r' ~~ n
,-;'
charactp~s
Fi gUT'S 5.
aro added above the
'window' of the screen.
SVi'-1BOLIC FILE
t)
lef:t
: B.n r.
~t;,r.!(
in~'.a l' d 'EJ
BUFFER
right stack
FOT'ward
End
Page 55
PAGE
See section 1.3.3.
EGUALS
See section 1.3.3.
TEXT CHANGING COMMANDS
INSERT
See section 1.3.3.
DELETE
See section 1,3.3.
ZAP
See section 1.3.3,
COpy
See section 1.3,3.
EXCHANGE
Sae section 1.3.3.
FIND
Read section 1.3.3. The Editor' wi,ll display:
and if the patte~n is not in the buffer:
End of buffer encDuntered.
Get more
f~Dm
disk?
Finding ...... .
(YIN)
On typing !ly,r, the Edito'f' will move another section of the file
into the buffer to conti.nue searching.
Find is still directional
See section 1.3.3.
FORMATTING COMMANDS
AD.JUST
802
Page 56
$e~tion
1.3.3.
MARGIN
See section 1.3.3.
MISCELLANEOUS COMMANDS
SET
See section 1 3.3.
The same prompt line is displayed.
Read section 1.3.3.
The namos of the markers can be seen by
'POl' Set Environment while at the Edit level.
To set the
marlleT·; tlJPe USt'1".
In the ev~nt that 20 melrkers have already been set,
this will be indicated by:
typing
USE~\
Mar k er over-P 1 00.1.
Which one to replace? (Type in the letter or
E
t (') 1 e 21 \l ~
ACuto Indent False
F(illing True
L('lJP3
August
15,
1978:
Last updated August 15t
1978 (Revision 1).
By typing th9 appropriate letter, an4 or all of the options can
changed.
SeQ section 1.3.3.
Thp arrow before the mark~r name
indicates th~ relative position o~ the marker in the file to the
buffer.
No arrow indicates that the marker is in the current buffer.
Page 57
It is now pt,1ssible to vary the tabstops.
Type usn while in the
environment and the following prompt will appear:
At pregent, the~e are not yet fully implemented so that the effect of
using any of them is to have a variable tabstap instead of being set at
eight characters apart.
VERIFY
See section 1.3.3.
Page 58
******************************************** ***************
*
YET ANOTHER LINE ORIENTED EDITOR - YALOE
* *
Section 1.4
*
******************************************** ***************
VeT'~
S(~P
i on I. 5
t emh el"
1978
This text editor is intended for use on systems that do not
have paw~~ful ~creen terminals.
It is designed to be very similar to
the text-~ditor which accompanies DEC's RT-l1 system.
1 h e e d ito r ass IJ me S J b li t i s n {) t ct e p. E~ n den t 0 rl, the e xis ten ceo f
the workfile text.
Upon reading i t YALOE will proclaim 'workfile STUFF
read
If it does not find such a file,
in~.
file 't"OcHi
in',
This means that
i t will proclaim 'No
you ent;e1"ed YALOE with an empty
wo~k
From this point you may create a file in YALOE; and whpn you
t b Y t Y pin 9 , au ..
you i' l*J t1 f' k f i .1 e w j, 1 1 n c 1 (j n geT' bee mp t y .
wD~~f11e.
e )( i,
I
The editor operates in one of two modes: Command Mode or Text
In command mode all keyboard input is interpreted as commands
inst~urtinq th~ editor to perform some operation.
Wh~n you fi~~t enter
thp editor ~ou will be in the Comma"d Mode.
Thp Text Mode is ent~~ed
wherleY~7 the user type~ a command which must be followed by a text
Mode.
string,
filt~1
the' commf"3nd F(ind,
Af.teT'
G(et.
l is
~'·J(T'it:?
chsr~cteTg
Nnte: Wh~H-' typed echoes a '$".
The terminates the
and causes the editor to re-enter the Command Mode, at
which point ~ll characters are again considered commands.
t~Jped.
t~xt
st~ing
NOTE:
execut~
t'.
Fallow command
them.
st~ings
in YALOE with to
(This is unlike the rest of the systems 'immediate'
ommr:;r;\.i s. j
1, 4. 1
SPECIAL
~EY
COMMANDS
Vi:JT'ious chaT'1:'lctel'5 have special meaningsl
as
dt-~sc"'ibed
below.
of these apply only in YALOE.
Many have simila~ efFects in the
rest of the system; for thesE thp ASCII code to which th~ system
responds as indicated can be changed using the program SETUP, described
inS ~~ c t i "n 4. 3. ( <:: esc. :> i s thE in 0 ~ t P a"f' tic u 1 a 1" an 0 rna 1 y toY ALOE.. )
Echoes a ~$'.
A single ax@cutss the command st~ing.
Som~
RUBOUT
Deletes
<1 int'ch'l>
'(Zt\p'
On hard-copy terminals echoes
return,
On othersl it clears
the current line on the screen.
In both cases the
contents of that line are discarded by the editor.
cu~rent
and
a
line.
st~in!
caT"'r'i~ge
Page 59
CTRL H
Deletes character from the current line.
On hardcopy terminals it echoes a percent sign ¥ollowed by
the character deleted.
Each succeeding CTRL H the
by th. user deletes and echoes another character.
An enclosing percent sign is printed when a key other
than CTRL H is typed.
This erasure is done right to
left up to the beginning of the command string.
CTRL H may be used in both Command and Text mode.
CTRL X
Causes the ~ditor to ignore the entire command
string currently being entered.
The editor
responds with a and an asterisk to
indicate that the user may enter another
command,
For example:
*IDALE AND
KEITH'(CTRL
X>
*
A would cause deletion of only KEITHi
CTRL X
would erase the entire command.
CTRL 0
Will switch you to the optional character set
(i. e. bit 7 turned on).
This works only on the
TERAK 8510A.
The CTRL a is used as a toggle
between the character sets.
NOTE: You may find
while in the editor that weird characters are
showing up on the terminal instead of normal
ones.
It could be because you accidentally
typed CTRL O.
TQ get bac k Just type CTRL 0
again.
All output to the terminal is discarded by the system
until the next CTRL F is typed.
CTRL S
-(-stop)
CTRL S is. typed,
CTRl. F
All output to the terminal is held until another
All ather control characters are ignored and discarded by YALOE.
COMMAND ARGUMENTS
1. 4. 2
Acommmand argument precedes a command letter and is used
either to indicate the number of times thF command should be performed
or to specify the particular po~tion of text to be affected by the
command.
With some commands this specification is implicit and no
a~gument is needsdi
other commands, however, require an argument.
CDmmand arguments are as follows:
P~nn
Lf\
n
n stands for any integer.
It may be preceded by a + or -.
If no sign preced&s n, i t is assumed to be a positive number.
Whenever an argument is acceptable in a command. its absence
implies an argument oT 1 (O~ -1 if only the - is present).
m
m is a number O.. 9.
o
10;
I
I
I'
refe~s
to the beginning oT the current line.
means 32700.
f_/'
means -32700.
It is used for a large
T"€1opeat factoT".
-
1. 4. 3
I~is used only with the J, 0 and C commands and
Tapresents -n, wh~re n is equal to the length of the
lSit text argument used~ for example
*GTHIS$=D$$
finds and removes THIS.
CDMMAND STRINGS
All EDIT command strings are terminated by two successive s.
Spaces, ca~riage returns and tabs (CTRL Il within a command string are ignored
unless they appear in a text string.
Several commanas can be strung together and executed in
sequenc:e.
For'
exampl~:
GTHE INSERTED$
-3CING$
5K
GSTRING$$
As a rul~, commands are separated from one another by a single
-(esc:>.
This separa'ting ; a second
signals the end of a command st~ing; which will then be
execut~d.
When the e~ecutian of the command string is completej the
e d ito 1" p r' G mp t s for' t h 8 n ~ x teo mm.a n d wi -t h I.nlo
J' •
If at any paint in &xecuting the command, an error is
enc{ltJnteT'~,d;
thp comm..:)nd wi 11 be teT"min.;:1ted.
leaving the command
executed only up to that point.
1. 4. 4
THE TEXT BUFFER
The current version of your text i~ stored in the Text Buffer.
This buffer's area is dynamically allocatedi its size and the room laft
for expan&ion may be ascertained by using the? command.
Page 61.
The editor can only work ~n files that fit entirely within th~
Text Buffer.
The Screen Oriented Editor in the next major rele~se will
not have this limitation.
14.4
THE CURSOR
The "cursor" is the position in your text where the next
command will be executed.
In other words it is the current
"pointer" into the Text Buffer.
Most edit commands function with
respect to the cursor:
Moves it.
text from where it is.
U, I ,R ;
Add text to where it -is.
C,X:
Remove and then add text at it.
L,V:
Print the text on the terminal from it.
A,B,F,Q,J:
0,10<.:
1.4.5
R~move
INPUT/OUTPUT COMMANDS
L(ist, V(erify. W(rite, R(ead, G(uit, E(rase, and 0
The L(ist command print~ the specified number of lines on the
console terminal without moving the cursor.
Prints all characters starting at the second
preceding line and ending at the cursor.
*4L$$
Prints all characters beginning at the cursor
and terminating at the 4th .
Prints from the beginning of the current line up
to the cursor.
The V(erify command prints the current text line on the
terminal.
The position of the cursor within the line has no effect and
the cursor is not moved.
No arguments are used.
The V(erify command
is equivalent to a OLL (list) command.
The W(rite command ia of the form
*W$
File title is any legal file title as decribed in Section 1.2
less the file typP.
The editor will automatically append a '.TEXT'
suffix to the file title given unless the filp. title ends with '.',
']', or '. TEXT'.
If the filename end'S in a ' " the dot will be
stripped from the filename.
Page 62
Th. W(rite command will w~ite the entire Text Buffer to a file
with the giv~n file title.
It will nat move the cursor no~ alt~r the
contents of the Text Buffer.
If there is no room for the Text Buffer on the volume specified
giv~~n,
the message:
in the file title
OUTPUT ERROR. HELP!
will be printed.
It is still possible to write the Text Buffer out by writing
it to anothe~ volume.
The R(ead command is of the form
*R$
The editor will attempt to read the file title as given.
In
the event no file with that title is present~ a '.TEXT' is appended and
a new search is made.
The R(ead ~ommand inserts the 3pecified file into the Text
Buffer at the CU~SD~.
The cursor remains in the Text Buffer before the
text in.erted.
If the file read in does not fit into core buffer, the
entire Text Buffer will be undefined in contentl
unrecoverable error.
The Q(uit command has
au
GE
,GR
G
seve~al
i. e.
this is an
farms
Quit and update by writing out a new SYSTEM.WRK. TEXT
Guit and escape session;
do not alter SVSTEM.WRK.TEXT
Don't Q.uit; retu'rn to the edito'!"
A prompt will be sent to the terminal giving all the
above choices) enter option mnemonic (U, E, or R) only.
Executing the OU command is a special case of the write
commandt and the attempt to write out SYSTEM. WRK, TEXT may fail.
In
this ca;e use the W command to w~ite aut your file and then BE to exit
the editoi'.
typed~
The GR command is used on thn occasions when a G is accidentally
and ~ou wish to return to the editor rather than leave it.
The E(rase command (intended for CRT terminals) erases the
Sf:re~n.
The 0 command (also intended Tor CRT terminals) can be used to
have the (ontext around the cursor displayed on the screen each time
the Ct.H;$\H' i.~ mt"!v~H.1,
The argument of the 0 command deter-mines the si ze
(# of lines) in that context.
This aption is initially disabled when
the editor is entered and can be enabled by issuing an 0 command.
A
second 0 command
@nable-,
di~sbles
disabltre etc.
The
the aptian;
CU'rso-r
is
succeeding
denr~ted
'D's successively
as a split in the line.
Pi~g €I
63
1.4.6
CURSOR RELOCATION COMMANDS
J(ump,
A(dvanc:e.I B(eginning,
Q(et .. F{ind
When using character and lina oriented commands, a positive (n
or +n) argument specifies the number of cha~acters or lin~s in a
forward direction, and a negative argument the number of characters or
lines in a backward direction.
The editor recognizes a line 01 text as
a unit when it detects a in the text.
Carriage return character& are treated the same as any othe~
character.
For example assume the cursor is positioned as indicated in
the following text (A rep~esent$ the current position of the cursor and
does not appear in actual use
It is pre~ent here only far
cldrification):
THERE WAS A CROOKED MANA
AND HUMPTY DUMPTY FELL ON HIM
The J(ump command moves the cursor over the specified number of
character$ in the Text Buff~r
The edit command -4J moves the cursor
back 4 characters.
THERE WAS A CROOKEDA MAN
AND HUMPTY DUMPTY FELL ON HIM
The command 10J moves the cursor forward 10 characters and
places it between the 'H' and the 'U/.
THERE WAS A CROOKED MAN
AND HAUMPTY DUMPTY FELL ON HIM
1 ines.
The A(dvance command moves the CUT'$or a specified number of
The cursor is left positioned at the beginning of the line.
Hence the command OA moves the cursor to the beginning of the
current 1 ine.
THERE WAS A CROOKED MAN
·. .·AND HUMPTY DUMPTY FELL ON Hlt1'(CR>
The command -lA (or -A)
mov~s
the cursor back one line.
ATHERE WAS A CROOKED MAN
AND HUMPTY DUMPTY FELL ON H!M
is typed.
The cursor 19 positioned immediately after the last
character of tria insert.
Occasionally with large insertions the
temporary insert buffer becomes full.
Before this happens a message
will be printed on the console terminal, 'Please finish'.
In response
tYPf: two 'SfJcces5ive s.
To continue, type I to return to the Text
mode.
NOTE: Forgetting to type the I command will cause the text
entered to be executed as commands.
The [Helete command removes a s.peciflied numbel' of cha'r.3cters
from the Text Buffer, starting at the position of the cursor,
Upon
completion of the command_ the cursor's position isat the first
charact~r following the deleted text,
Page 65
Deletes the two characters immediately preceding
the cur'soT'.
*B$FHOSE
$=D$$
D@letes the first string 'HOSE · in the Text
Buffer, since =D used in combin~tion with
a search command will delete the indicated
text string.
The K(ill command deletes n lines from the Text Bufferj
starting at the position of the cursoT'.
Upon completion of the
command. the cursor's position is the beginning
the line following
the deleted text.
0'
*2K$$
Deletes characters starting at the current
cursor position and ending at (and including)
the second ~
1',11 COfTH'!H'H1ds are legal in
a macro command string.
Example of a macro definition:
*5M%GBEGIN$=CEND BEGIN$V$'l.$$
This defineG macro number 5.
i t
to i l l
1 t,10 k of! i".H' t h I?
S
t r-:i n 9
, BEG r N
When macro number 5 is executed,
change it to
'END BEGIN'
when defining a marra,
the message
I
v
then display the change,
If an
e~ror
o~curs
'Error in macro definition'
I
and
will be printed, and the macro will have to be redefined.
string.
The execute macro command, NI
The form of the command is:
executes a specfied macro command
nNm$
Here n is simply any command argument as previously defined; m
is the macro number (an int~ger O.. 9) to be executed.
If m is omitted,
1 is assum@d.
Becaus. the digit m is t.chnically a command text
string, the N command must be terminated by an .
Attempts to execute undefined macros cause the error message
'Unhappy macnum'.
Errors encountpred during macro execution cause the
message 'Error in macro'.
Errors encountered in macro command syntax
cause the message 'Error in macro definition'.
The? command prints a list of all the commands and the sizes
of the Text Bufferl Save Buffer, and available memory left for
expAnsion.
Page 68
SUMMARY OF ALL C O~tt1ANDS
1.4.9
n'-
nA:
B:
ne:
nD:
E:
m -
an sT'gument
macT'O number
Advance the cursor to the beginning af the n th line from the
current position.
Go to the Beginning of the file.
Change by deleting n characters and inserting the following
te x t.
Te-rmi nat~ te x t wi th .
Delete n
chal"acteY's.
Er:3se the screen.
nF:
Find the n th occurrence from the current cursor position of
nG:
the following string.
Get
- ditto -
Terminate target string with .
,- i nVlll i d -,
P:
Insert thp following text.
Terminate text with .
Jump cursor n characters.
Kill n lines of text.
If cur~ent cursor position is not
at the start of the line, the first part of the line. remains.
L i 5 t n 1 i n e S 0 f t .~ x t.
Define macro number ro,
Perform macro number m, n times.
On . 0 f 'P t (J f~ g 1. e.
I f! c n ~ n 1 in e t. 0 f ,t ext will bed i s pIa y e d
above and below the cursor each time the cursor is moved.
If the cursor i~ in the middle of a line then the line will
be split into two parts.
The default is whi:ltevf.'T'fills the screen.
Type 0 to turn off.
- invalid -
G:
Quit this session,
1.:
n,,",:
n~.:
nL :
mM:
nNm:
nO:
R:
nS:
U: (pdate
Write out a new SYSTEM.WRK.TEXT
E: {scape
Esc.ape TPom session
R': (~turn
Return to ed i tor
Read this Tile into buf~er (insert at cursor);
'R' must be followed by i
WARNING:
IT the file will not fit into the bUrrerJ the
cont~nt of the bufger becomes undefinpd!
Put the next n lines of text from the cur~or position into the
S-.:lVf.\
T:
U:
V:
W:
nX:
rollol!.Ied by:
Bu.p';~\r
- invalid Insert (Unsave) the contents of the Save Buffer into the text
at the curSQr; does not dpstroy the Save Buffer.
Verify:
display the current line
Write this file (fr'om start of bufrer);
'W~ must be followed by
D~lete n lines of t~xt, and insert the following
texti
terminate with .
Y:
Z:
invalid -- invalid _.
Page 69
-
NOt~~5
-
VUE TO THE LARGE NUMBER OF BUGS IN THE VEBUGGER, WE HAVE OMITTED THE
DEBUGGER, AND ITS CORRESPONDING DOCUMENTATION FROM THE SYSTEM RELEASE.
THE DEBUGGER WILL BE AVAILABLE AT SOME TIME IN THE FUTURE, ANV YOU WILL
BE NOTIFIED OF THIS FACT. PLEASE VO NOT ASK US ABOUT THE DEBUGGER, AS
THE REPLY YOU GET WILL BE THE SAME AS THE MESSAGE ON THIS PAGE.
Thank. you nOlL YOM patienc.e in tlUA mati-elL.
Pag~
ed.
74 thfLough 80 have been omitted.
Pag~
71 .. 7
- note!.> -
Page!.> 72 •• 80
******************* ***************
*
PASCAL COMPILER
* *
*******************
Version 1. 5
Section 1.6
*
********~******
September 1978
The UCSD Pascal compilerA a one-pass recursive descent based on
P2 portable compiler from Zurich, is invoked by using the C(ompile
or R(un command of the DutermO$t level of the UCSD Pascal system. If a
wOT'kfile exists.; it compiles that.
Othe'f'wlse, it prompts the user for
a SOUTce file name.
It generates codef11es to run directly on the
Pascal interp~etive machine.
th~
Unless the HAS SLOW TERMINAL boolean inside the system
(5 e e sec t ion 4. 3) i s t rue l the com pi! e or , d uri n 9 ,t h e
course of compilation. will display on the CONSOLE device output
detailing the progress of the compilation.
This output can be
suppress~d with the G+ compiler option (see section on compiler
options below),
Below is an example of the output which appears on the
CONSOLE device:
corum u n 1 c. a t ion aT' e a
PASCAL complIer [1.5 unit compiler]
0:> . . . . . .
P 1 (7050]
<
19)- ...
P2 (3040)
.(
61>0
~
. :
TEST [30(3)
<: 11 9>, , . . . . , . ,
The identifiers appearing on the screen are the identifiers of
program and its prDcedu~e5.
The identifier ~or a procedure is
displayed at the moment when compilation of the p~ocedure body is
started.
The numbers within [
] indicate the number of (16 bit) words
available for 5ymbol table sto~age at that point in the compilation.
The numbers enclosed within < > are the current line numbers.
Each dot
on the screen represents 1 source line compiled.
th~
! f the compilation is success~ul, that is, no syntax errors
detected, the compiler writes a codefile to the disk called
*SYSTEM. WRK. CODE.
Thls is ths codefile which is executed if the user
had typed the R(un command.
See Section 1.1 INTRODUCTION AND OVERVIEW
for further details an the system commands.
Should the compiler detect a syntax error, the text surrounding
the error and an error number together with the marker 1««
' will
point to the symbol in the source where the error was detected.
In the
event that both the Gaod L options are set, the compilation will
continue, with the syntax e~ror going to the listing file, and the
console remaining undisturbed. The compiler will the give the user the
option of typing a space, an Dr 'E'.
Typing a space instructs
the compiler to attempt to continue the compilation, while escape
causes the termination oT the compilation. and liEU T'esults in a call to
the editor, which automatically places the cursor at the symbol where
the error was detected.
Page 81
Most of the syntax errora detected by the UCSD Pascal compiler
are the standard ones listed in Jensen & Wirth.
A complete list of all
UCSD syntax errors can be found in Table 5.
All error numbers will be
accompanied by a textual message upon enty'y to the editor if the file
*SYSTEM.SYNTAX is available.
1. 6. 1
COMPILE TIME OPTIONS
Compile time options in the UCSD Pascal compiler are set
according to a conventiDn described on pages 100-102 of Jensen and
WiT'th~
where compile time options are se't by means of special "dollar
sign" comments inside the Pascal program text.
The syntax used
in
UCSD's compiler control comments is essentially as described in Jensen
and Wirth.
The actual options and the letters associated with those
options bear only little resemblance to the options listed on pages 101
and 102 of Jensen and Wirth.
If a '+' Dr '- , is not specified after
an option letter, '+' is assumed.
The following sections describe the
various options currently available to the user of the UCSD Pascal
compiler.
D:
This option causes the compiler to issue breakpoint
instructions into the codefile during the course of the compilation in
order that the interactive Debugger can be used more effectively.
See
Section 3.2 uDEBUGGER u for details
Derault value:
D-
D-:
causes the compiler to omit breakpoint instructions
during the course of the compilation.
D+:
causes the compiler to emit breakpoint instructions.
G:
Affects the boolean variable GOTOOK in the compiler. This
boolean is used by the compiler to determine whether it should allow
the use of the Pascal GOTO statement within the program.
Default value:
C:
Page B2
G-
G+:
allows the use of the GOTO statement.
G-:
causes the compiler to generate a syntax error upon
encountering a GOTO statement.
The (*$C eomment*) plae~ the eomment, (80 eh~aet~ maX£mum*) ~n the eode
nile gen~ated. Th-iA option ~ M ed at UCSV to plaee eopYJvtght ~nnoJuna.tA,on
~n the eodenile..
The G-optian has been used at U.C.S.D to restrict novice
programmers from exces5i~e uses of the GOTO statement in situations
wher9 more structured const~ucts such as FOR, WHILE, or REPEAT
statements would be mere approprlate.
I:
When ,an '1'" lS fol1o\ol?d imm£>di-ately by a '+' OT' ' .._', the
control comment will affect the boolean variable IOCHECK within the
compiler
An alt~rnative use of 'I' in a compiler control comment
causes the compiler to include a diffe~ent source file into the
cQ~pilation at that point.
See section INCLUDE-FILE MECHANISM for
s~nta)'.
.IOCHECK. OPTION
1+:
instructs the compiler to generate code after each statement
\J.;hich performs any 1/01 in or'oel' to check to see if the 110
operaticn was accomplished successfully. In the case of an
unsuccessful 110 operation the program will be terminated
with a run time error.
1-<
lnstT'ucts the compiler not to genIS-rate .:irty I/O checking
,~)de.
In the case of an i.Jnsuct::e~sFul 110 operation the
program is not terminat@d with a run time error.
The !~·'option is use~ul f!OT" system level programs which do many
110 operations and also checks the IORESULT function after each 110
operation. The ~y5tem prog~am can then detect and report the 110
€ \" r ':.'i :' 5 •
!,J.d t h .0 U t b ~. .i n g t ~ T- m 1 ro, il t: Ii? d /~ b n !,... 'f' m d .1. 1 i~ ~:J i t h ar' l.J n t i in e error.
HDw~Ve~
tj
would cause the file TURTLE. TEXT to be compiled into the program at
that point in the compilation.
would cause the saUTee file +FARKLE.STUFF to be included into the
compilation.
If the initial attempt to open the include Pile fails, the
compiler concatenates a ". TEXT" to 'the file"-name and tries again.
If
thi. second attempt fails~ or some liD error occurs at some point while
reading the include file, the compiler resp~nds with a fatal syntax
erroT'.
The compiler accepts include files which contain CONST, TYPE,
VAR, PROCEDURE. and FUNCTION declarations even though the original
program has previously completed its declarations.
To do so, the
include compiler control comment must appear between the original
program's last VAR declaration and the first of the original program's
PROCEDURE or FUNCTION declarations.
Nate that an include file may be
inserted into the original program at any point desired, provided the
rules governing the normal ordering of Pascal declarations will nat be
viDlated.
Only when these rules are violated does the above procedure
app 1 y,
Th e camp i 1 er cannot keep tra c k of nested inc 1 ud e C ommentsl i. e.
an include file may not have an include rile control comment.
ThlS
results in a fatal syntax error.
The include file aption was added to the compiler at U.C.S.D in
order to make i t easier to compile large programs without having to
have the entire source in one very large file which in many cases would
be too large to edit in the existing editors' buffer.
L:
Controls whether the compiler will generate a program listing
of the source text to a given file.
The default value Qf this aption is
L-, which implies that no compiled listing will be made.
If the
character following
aL" is Ii+H,
then the compiled listing will be sent
to a diskfile with the title '*5YSTEM.LST.TEXT'.
The user may override
thi~ default destination for the compiled listing by specifying a
f i 1 (-HI ~ mi? fa 1 1 ow i n 9 It L
For e 1. amp 1 a t h e of 0 1 1. 0 win 9 con t r ole 0 mm ~ n t (.IJ ill
0\ •
cause the compiled
i'DEi>101, TEXT't ,
Page 84
listing to be sent to a diskfile called
<*$L DEM01.TEXT*>
To specify a file-name inside a control comments see the
section describing the include file mechanism.
Note that listing files which are sent to the disk may be
edited as .ny other text file provided the filename which is specified
~
ins the
S l)f fix AI. TEXT It •
Wi tho u t the f/ • TEXT" s u f fix t h eo f i 1 e \IIi 1 1
be treated by the system as a datafile rather than as a text file.
con t
The compiler outputs next to each sou~ce line the line number,
segment procedure numbe~, procedure number, and the number of bytes or
words (bytes for code, wOTds fOT data) requir~d by that procedure's
declarations or cade to that point.
The compiler also indicates
whether the line lies within the actual code to be executed or is a
part of the dec: lard';inns for that procedure by Qutputing a uD u for
declaTation and an integer 0 .. 9 to designate the lexical level of
statement nesting within the code pa~t.
If the D+ option is set then
the listing fila will includ@ an asteTisk on each line where it is
appropriate f0T a user to specify a breakpoint while in the interactive
Debugger.
This information can be very valuable for debugging a large
program since a run time error mE~5age will indicate the procedure
iHH1. b tH' 1 and t. Ii e 0 f f 'S e t w her ~ the '::::1' r 0 roc C 1,.11"' 'f iE'd .
G:
The G compiler option is the "quiet compile" option which can
u5?d to supp~es$ the output to the CONSOLE device of procedure names
and line numbers detailing the progress of the compilation.
be
Default value:
is set equal to CUTrent value of the SLOWTERM
attribute of the system communication record
SYSCOM",·.
(actoally SYSCOM ...... MISCINFO. SLOWTERM)
G+"
causes the compiler to suppress output to CONSOLE device.
G-:
causes th~ compil~r to send procedure name and line number
output to the CONSOLE device.
R:
This op~lDn affe~ts the value of the boolean variable
RANGECHECK in the compiler.
If RANGECHECK is true, the compiler will
Dutput additional code to perform checking on array subscripts and
assignments to variables of suDrange types.
P:
TIU..6 option C.a.U6M the. futing to c.ontiYl.u.e. 6Jtom top-06-6ofLm.
i.e.. the. c.ompileJt
dOM:
PAGE(LISTFILE)
Page 85
Default value: R+
R+'
turns range checking on.
R--
turns -range chet.::king
c-ff.
Note that pT'ogT'arn~ compiled with thl!: R-option 'Set will T'un
slightly faster; however if an invalid index occurs or a invalid
assignment is made~
the p~Dgram will not be terminated with a run time
error.
Until ~ program has been completely tested and known tD be
COTTect, it is usually best to compile with the R+ option left on.
s;
This option determines whether the compiler operates in
"swapping" mode.
There are two main parts of the compi.ler':
processes declarations;
moor.-:,
cnly
the other handles statements.
one of these parts
is in main memory at a
one
In swapping
time.
This makes
about 2500 addItional wo~ds available for symbol table storage at the
cost Qf ~lo~~r compilation speed due to the overhead o~ swapping the
cornpilt'?T' segment
in fT'om disk.
On flJllsizel
Single d-:nsity floppy
this amounts to a factor o¥ two reductio" in compile speed.
option must occu~ prior the the compiler encountering any Pascal
di~ks
This
syntax.
Default value:
S-
S+:
puts compiler in swapping mode
S'-;
puts compiler
in non,"swapping mode.
U:
USER PROGRAM OPTION:
ThlS option S2tS the boo12an variable SYSCOMP in the compiler
.j e t f': T' m 1, new h •.?t 1:21' t h 1 S Co iJ mp i 1 Cit t 'i wn .i s
::o!'!qJll~~t;iGn c:f a systf~m program.
h i s v' ~-:; e d b IJ the com p i 1 t? r t Q
a user PT'ogT'.an: compi.lationl or a
ttl hie
\ ,.,1I...
••
u-:
infDrms the compiler that ~hts tompilation
on the user program lex level,
i~
to take place
informs the compiler to compile the program at the system lex
level. This s~tting o~ th~ U compil~ time 0ption also causes
the following options t;J h~! ..set- R-. G+! I-.
PaGe 86
NOTE: This option will generate programs that will not behave
as elpected.
Not recommended for non-systems work without knowing its
method of operation.
USE LIBRARY OPTION:
In this ve~sion of the 'u' optionl the U is followed by a file
name.
The named file becomes the libraTY file in which subsequent
USEed UNITs are sought.
The default file for the library is
*5YSTEM.LIBRARY.
(see section 3.3.2 for more details on UNITs)
Following is an example of a valid USES clause using the
'u'
option:
USES UNI Tl, UN! T2!
A. cong}
.i n ~SYSTEM. LIBRARY.)
UNIT3.,
B. LIBRt'RV}
UNIT4, UNIT5i
Page 87
- Notes -
*********************** ***************
*
UCSD BASIC COMPILER
* *
***~*******************
Section 1.7
*
***************
September 1978
This section has been designed for prDgramme~s who are already
familiar with B~sic.
Its intent is to describe to those experienced
users the details of UCSD Basic in a manner sufficiently detailed so as
to iz:nab 1 e th l \.;jr i t i 1"19 :n~ mnd if i c;:-:t: i on Q-t programs ina manne.r
compati~le with thE UCSD Basic Compiler.
The first section contains a brief description of the features
includ~d
in UCSD
B~sic;
the
-second.
the descriptions of the
~eatu,..es
unique to UCSD Basicl and the third a list of those features which we
intend UCSD Basic to allow, but which are not yet implemented.
The UCSD Basic Compiler has been written in the Pascal
language.
Some of the intrinsics of the Pascal language, which are not
found in standard Basic, are found within the UCSD version of Basic.
Many of these are noted in the first sEction, ~ll of them are noted or
recapped in the second.
The l}CSD BASrC Compiler
i,S
invoked
Just like the Pas1:al
compllerl provided tho compiler code is named *SYSTEM.COMPILER,
Originally it will be named BASIC, COMPILER.
If you want a disk to be
BASIC oT'iented~ you must change the name of, or remove, the Pascal
compiler: arid change the name of BASIC. COMPILER to *SYSTEM.COMPILER.
T tu; t dis k l a n d ,~n y con j e s of it., ld i l l now C Q mp i 1 e BASIC pro 9 't" am s as a
rEsult of the CCompile OT R(un command.
DESCRIPTION OF FEATURES INCLUDED
The BaSiC complier has only real and string variables. When
applying a real to indexing or ether integer purposes the rounded value
of the number is used. In the ~uncticn5 below x and y can be ~eal
variables ar expressions which evaluate to real values. Similarly 51
and 52 can be st~ing variables or expressions which evaluate to a
string.
VAR IABLE Nf\t'lES
Rea 1
'i Q
String
r i
~
b 1 ~"S :
1 et t ~. 1" ( dig i t ) .
lettel'(dig.i"t)$.
\.'=:'11301$5.
The digit is
option~l.
Page 89
INTRINSIC ARITHMETIC FUNCTIONS
ATN(x)
R~turn~
EXP(x)
Returns the base of the natural logarithms raised to the power x.
INT(x)
Returns the value of x rounded to the nearest integer.
LOG(x)
Returns the log (base 10)
the angle in radians whose tangent is x.
0'
x.
Returns the natural log of x.
MOD(x,y>
Returns x modulo y.
SIN(x)
Returns the sine of the angle
COS(x)
Returns the cosine of an angle x.
~.
Where x is in radians.
Where x is in radians.
INTRINSIC STRING FUNCTIONS
CAT$(sl. s2 . . . ) Returns a string which is equal to the concatenation of
all the strings in the parameter list.
COP*Csl, x,q)
Returns a copy of the portion o~ the string sl, 4
chsracte~s,
~t5rting wlth the characte~ at position x.
cD"~ecutive
DEL$(s11 x,y)
RetuTns the contents of the string 51 with y consecutive
characters ~eleted. The deletion sta~ts with the character at
position x.
Returns the contents of string 52 with string sl inserted
immediately hefore t~e ~haracter which is at position x.
INS$(;lts2: x)
LENCsl) R9turns the length Df the string 51.
POS(sl,s2) Returns an integer which is equal to the position of the
first characte~ in the first OCCUT~enre of the string sl in the
string s2.
OTHER FUNCTIONS
ORD(s) Returns the ASCII value of the
~iTst
character of the string s.
STR$(x) Returns the string containing the chSTRcter associated with the ASCII
value x.
Page 90
:ET$ Reads a single character from the keybosrd without prompt or echoing,
and returns it as a string.
GETS requires no arguments.
DLD(c, $;
NEW(c,s) c is a numeric constant without a fraction part, which becomes
3~~ociated with the disk file whose name is in s.
OLD expects that
file to alresdy exist, NEW creates a new one with the name s, removing
any previows file of that name.
These functions must occur before
associated print or input statements.
The numbers may not be
reassigned and must be in the range 1 .. 16. For best results. use only
at the top of a program.
In order that a file created by NEW be
editable with either oT the system editors, '. text' mt..'st be appended to
the file title.
Tn eserunc ti ons return IORESUL T as df;\scr ibed in section 2. 1.
PROGRAMMING STATEMENTS
Arithmetic statements and operations
I
+
subtract/add
I I .*
d i v ide: mu 1 tip 1 Y
Relational
Qpe~ato~s
-c:>
I
<
_>=
<=
I
I
:>-c
=>
:-.:<
equals
not equals
greater than
less than
greater than or equal
less than or equal
INPUT list
or
INPUT #c list
In put s f rom the main system d e vic e U $ U a 11 y the keyboard. I of the
optional 8c is p~e5ent, INPUT inputs from the disk file number
c The input list may contain any combination of real variables and
string vBTiables. When a prDgram expects input the prompt "?II is
printed. Input of real numbers may be terminated with any non-numeric
character. Input of strings must be terminated with a return.
I
PRINT li5t
or
PRINT ftc: li;;t
to the main output device the list following the PRINT command.
If thD optional He is pT9sent, PRINT outputs to the diskfile number c.
The output list may contain ~ny Y~~iable, subscripted aTray variable,
any arithmetic OT' s'cring expl"essionl OT' any literal text. The list may
be sepa~ated b4 commas or semi-colons. If the list ends in a semi-color
W~ites
the carriage return is suppressed. Literals may be enclosed in either
Double quotation marks prints a single
type of quotation marks.
ti!.!otatio'n mSH'!c.
Page 91
FOR val"
= expl
TO exp2 STEP exp3
NEXT var
Each execution of the lOL1p increments the loop countar "varr" by the
amount of expression 3. If the STEP is umitted it is assumed to be 1.
Only increasing STEP values are allowed. Evaluation of limits and
increments is done at the beginning o~ the loop_ Note that RETURN's into
or GOTO~s into a FOR loop may cause the loop to b~ undefinad.
IF expl
(r~l~~ion
operator) eyp2 THEN (line number)
GOTD
Either 'the reserved word
THEN or GOTO can be l}sed
in this st;atement.
lOP
the ~elation b~tween the alpl and exp2 is 'ound to be true the b~anch
occurs, A sti'ing is c>Jnsidered to be less than another string if it is
lexicographically smaller.
IN e j( p GO TO:; 1 re 1.. 1 n 2., .
~
If the eXprp.5stCHj, ~iJh~n rounded, evaluates to 1 it goe's to the f'i,..st
line number (In!) if it evaluates to 2 it goes to 1n2, etc. This is the
only form of the computed GOTO which is available. If the expression is
out of range an error occurs.
DEF FNname(list)=expression
or
DEF FNname(list)
FhiEND
Single Ilne and multi-line functions are allowable. The function name
must be a legal variable name for the tupe of value returned. Functions
;nay be defined recuT'sively. Th p,::'r'~miE:'tt::r lis;.t is called by value) that
is, change$ inside th~ function don't afgect the value of the exteTnal
p ~r ·,!;li'1e t e r.t; .
-E i'.
var ~:p. ~ p
OT"
This command assigns a new valup to the variable
I~
thf\ ~':l:(pT"eSSiDn rJ';ust
evaluation must be to a r~a]
nod if a· real,
;:,f;Ting:
)If"l vaT
?\(a'\Ui.~t;:;,
to
a
~:.tT'ing,
the variable is a
(n 1! n2k . ,
A single or multidimensional ar~3y m3Y be declared with this command.
The variable name determines the type of the a~ray.
The ar~ay indices
3'1"e O. ,n1t 0 .. r.2, ... Both "',",,211 and strii\g multidim~nsional en'rays can be
used. If no dimensions are declared the dimensions are assumed to be
O. . 1 0, ;:;,. 10, 0.. 1, 0.. 1 ,., The n U ii, b e r of dim e n 5 i on s aut £I rna tic a 11 y
declared depends on th~ numbAr of 1im~nsions which are used in the
program, but must be consistant over ~ll uses of any given array.
G08UB linenvmber
a subroutine call. The calling ~ddre5$ is plscsd on the
suhroutine stacIe Subroutd,ne calls may be recursive.
Ex~cute~
RETURN
Returns to the line after the last GOSUB which is still pending.
the top address off the stack and uses it as the return address.
retu~n when no GOSUB's are pending is an error.
I t pop'
A
GOTO 1 lfHH1umb er
Program execution Jumps to the given line number.
REN text
UNIGUE FEATURES OF UCSD BASIC
Any line not beginning with a
Continuation of statements is allowed.
line number
is sesumed to be the continuation of the line above.
Functions: All parameters of functions are call by value. Yau are not
allowed to use the parameters to return values from a function.
Function
call~
,:;,c'e allQwBu
to be
r~cu1·~ive.
Strings: The string functions and
UCSD Pasc~l language.
p~oc91uTes
Print:
IU J
T:::1o
stops
aT'e
not
al1.c!J,1t:~d,
1 i.st
are those found
el~me!1ts
.aT'S.
in the
printed uiithout
s p .a c e s bet ll' e e n them.
as the
la~t
5~mbol
The carriage ret LI l' n can b es u p pre sse d by
in the line.
"i
U
Subroutines: Subroutines may be recursive.
In 1 ine comments may be inserted. The portion of any line
following the @ symbol is ignored by the c om p i 1 e T' •
Comments;
Page 93
PASCAL FUNCTIONs: The code of PASCAL FUNCTIONs may be added to the
nAS ICc 0 mp i 1 e T' a s new s -t a n da T' d 13 AS I C fun c t i {) n s . T his i s
accomplished by a straight-forward addition to the BASIC compiler.
FEATURES
TO
BE ADDED
Certain features of the UCSD Basic compiler are still in the
process of being implemented. The most important of these are listed
belol\l.
Data and Read: The
stan~a~d
initialilation 5tatements.
Matrix statement for standard matrix operations.
Integer variables.
More .tandard functions.
RUNNING A BASIC PROGRAM
CTeate the BASIC program using one of the s~stem text editors.
Once you have ensu~ed that the BASIC compiler has been named
SYSTEM. COMPILER! you can use the commands C(ompile and R(un at the
COMMAND level, Just as if you were using Pascal on a disk which has the
Pascal compiler as its SYSTEM. COMPILER.
For a more detailed
descript.ion of COMMAND see Sec'tion 1. 1
Page 94
************** ***************
*
THE LINKER
* *
Section 1.8
*
************** ***************
September 1978
Vei'S i on L 5
The UCSD LINKER allows the user to combine pre-compiled files,
which maq have been written either in PASCAL or in assembly language,
into the 54stem workfile.
The user may wish to incorporate certain
useful routines into programs without having to rewrite or even
rec'ompile these ,.'outines.
For ex,:ample, one mi.ght wish to use a -Past
ass em b 1 q 1 f.'P1 9 u a g €' 1" 0 u t :i. n e f O'f' so me rea l'~' tim e a p p 1 i cat ion.
T his
routine could be a~sembled ·~epaT'.atelYI stored i.n a Ii.bT'aT'Y, and
eventually acce5~ed via the LINKER
H
U
T 0 1 ink i Tf '1" C;' l' 1; i n e ~ \"i: it; h C 1" P Toe 0 oj U 1" i? S {,} l' .p un c t i '0 n s )
t h eo
call ing pT'tlgr'am dec lal't:s thuse row'tines to be EXTERNAL. much as
PROCEDURES or FUNCTIONS may be declaTed FORWARD (see Section 3.3.1).
j
This notifies the compiler that the rDutines may be called. but are not
provided vet.
The compiler will then infoTm the system that linking is
required before execution.
A UNIT is a
The LINKER can also be uged to link in UNITs.
group of related routin~s which will be used together to perform a
common task.
UCSD TURTLEGRAPHICS is an example of a UNIT containing
procedures and functions with '~;hicha tlt·urtle can be moved on the
scraen
A UNIT can be uged b~ typing the command USES
directly after the PROGRAM
For mo~e information on
Ui'-J ! l' 5
S !? !;;' Sec t i Q n~1. 3., :2;
il
J
Any files which referE!\Ce UNITs or EXTERNAL rQutines and have
not yet been linked may be c0mpil~d and saved. but will need to be
1 i fl ked b e .f 0 '1'" e t ~~; eye ~~ \'1 bee!: e c ~j. ~t a ~l
1. 8_ 1
US ING·
T~!E
L II\W.E.R
If the program in the warkfile contains EXTERNAL declarations.
or uses UNITs, typing R(un will automatically invoke the LINKER afte~
the compiler.
The LIN~ER will search the file *SYSTEM.LIBRARY for the
routines or UNITs specified, and will attempt to link them into the
wo~kfile,
If the UNIT or EXTERNALly dec!a~ed routine is not present in
*SYSTEM_ LIBRARY, the LINKER will respond with an appropriate message:
Prot,
F' unc
Glob·all
I
or Public (identifier> undefined
Page 95
The LINKER may also be invoked explicitly, and,
be invoked explicitly in cases where
in fact,
must
1) the file into which UNITs or EXTERNAL routines are to be
linked is not the
(2)
the
wcn~kfile~
e~ternal
01"
routines to be linked reside in library files
other than *SYSTEM.LIBRARY.
( Not a : I nth e C tJ'f/ 1" e n t 1.11 P 1 e (!H.~; n t a ·t 1. 0 n UN ITs ~'Tl us t T' e sid e i n
*SYSTEM.LIBRARY at the time of compilation in order to be USED by a
PASCAL program. )
In orde~ to e~plicitly invoke the LINKER,
Command level and receives the prompt:
the user types 'L' at
The hostfile is the file into which the routines or UNITs are to be
linked.
The LINKER appends . CODE at all file names typed in except for
*.
Typing a In 1"eHipOnse +:0 thE p;·ompt::,.~U~·H;;;i: the LI!\~KE:R to
use the workfile as the hostfile.
The LINKER then asks for the name(s)
of the libra~y files in wh~ch the UNI1s or EXTERNAL ro~tines are to be
found:
Lib file?
Up to eight library files ma~} be refel"enced.
Typing '*' in
respcnse to a request ¥or a libfile name will cause the LINKER to
reference *SYSTEM.LIBRARV.
The user will be notified about each
library File that is ~uccessfully opened.
Example:
Lib
fi_u~?
*
('l'E-t:)
Opening *SYSTEM.LIBRARY
For information on LIBRARIES and the LIBRARIAN see Section 4.2.
Wh~n all relevant libfile names have b~en entered the user
must type to proceed.
The LINKER will now prompt with:
Map file?
following the owtput ~ile name has been tqpe1.
An em~t4 line, <~et~
onlYI
causes the output Pile to be
~J~·S'l·~~1'" E:M ~ ~~lHl ~\.
'C 0 DE
pl~ced
in the workfile e g.
being linked as well as all external routines being copied
into the output codafile.
The linking process will be aborted
if any
I
required segments or routines are ffilssing or undefined.
The user will
be info~med of their absence with messages as described at the
bpginning of this s~ction.
~~gment5
1" 8 . ;2
NOTES ON LINKER CONVENTIONS AND IMPLEMENTATION
cont~ins
Codefiles may contain up to 16 segments.
Block 0 of a codefile
information regarding name, kindl relative address and length
infof'ma'iJi~)·r.
of each cede ·segment.
This
is ~~p~esentsd as Q ~ecord:
is ":flled the segtable}
and
RE.CORD
RECORD
CODELENG, CODEADDR: INTEGER
SEGNAME:
ARRAY[O .. 153 OF PACKED ARRAY[O .. 71 OF CHARi
:3EG;V~IND
t'RRAVrO,. 15J OF
(LIN~\EDI
HOSTSEGt SEGPROCI tJNITSEG,
SEPHTSEG) ;
END
and CODEADDR give,
~ODELFNG
code
~,egrnent
l.n b4t;esl
and
the
r9;pectival~,
block~rld're~s
of
the length of the
the code
A
$.egment,
descrlption of SEGhINDs folluws:
L I Nrt ED :
Ttl e
c
(1
d ~ ~ e 9 m'E! n t
ts f!II 1 U
~:{ ~ C ',I 't .~
(UNITs or EXTERNALs)
non e tu ere P T' e '5 & n t
re~erences
ti 1 e .
E i t Ii e r a 1 1 ext ern a 1
have been resolved, or
HO~rfSEG':
the 5f:~9kind ~s.sigrH2'q t;o the Quter block of a PASCAL
p r ~. g r {;;j in i F t Ii e pr c, 9 l' ;.:;:Hll has '.!n: t~ e r f"') a 1 l' e fer en c: e s .
SEGPROC:
the
segkind
assign~d
to
\3
PASCAL segment procedure .
t~~
s~gklnd
~ssign0d
to
~
compiled SEGMENT.
UNITSEG:
(see Section
3, 3. 1)
SEFRTSEG:
This
sE'gk~:nd
15
assi.gned
to a separately compiled
procedure or function.
Assembly language codefiles are
aJways of this type. 9S well as Pascal UNITs which are
Page 97
For an unlinked code segment (that is, a segment containing
unresolved external refe~ences) the compiler generates linker
information.
This information is a series of variable-length records,
one for each UNIT, routine or variable which is refe~enced in, but not
defined in the SDurce.
The first 8 words of each recD~d contain the
following information:
LIENTRY=RECORD
NAME:
ALPHAi
CASE LITYPE:
LITVPES OF
UNITREF~
GLOBREFt
PUBLHEF,
PR!VREF,
SEPPREFI
SEPFREFI
CONSTREF:
( FOFt i'1A T :
NREFS:
NWORDS
OPFORMAT;
INTEGERJ
LCRANGE);
(format of lientry.name can be
any of! BIG.. BYTE or WORD. )
(# of rererences to lientry. name in
compiled cDd~ segment)
(size of privates in words>
GLOBDEF:
E X"l""r:'UNC I
SEPFUNC:
CSRCPROC' PROCRANGE;
NPARAMS:
INTEGER);
(procedure number in source segment)
(number of parameters expected)
EOFi1ARK:
(NEXTBASELC: LCRANGE)
(private var allocation info)
END <. 1 i en t r' U ) ;
If the L!TVPE is
!H10
of- tho first r.asi?
v.~Ti~;lt;
thc·'jj following
this portion a' the reco~d is a list of pointers into the code
segment.
Each of these pointers i~ the absolute byte address within
the code segment of a ~eference to the variable, UNIT or routine named
in the lient~y.
These are 8 wD~d ~eccrds, but nnly the first NREFs of
th€ili ar-e valid.
rage 98
***'***.*****4t"*******'!-f*** "",***-*'*,J(.**.******
*
* *
ADAPTABLE ASSEMBLER
*
***************
~**********************
,} e r s ion I. 5
Section 1.9
S.ep tember 1978
Use. 1" '3 .J 'r ~j c ~:,i) ~:\ d S C ~1;. r) C '': ~:';',~, : cc ,:;) 1 1 ~J n e Q d t ,:1 /,\.(r i t eo and
ass ~'m b l:~ 'f' <.) uti n ~ 'S iHT' i t. i.; en :i nth e 1 ~ n 9 wag €I p f: the h 0 S t
s m:3 1 1.
ere cut e
m3 chi n e ,
These routines ~ould be used withl" a Pascal program to p~ovide lowlevel or time critical facilitips.
The UCSD Arlaptable As~embler (in
conJunctl,nn with
the UCSD
Ll.nk~r)
has bEen deSi;;rned
to meet those
The UCSD Pascal Project ~il1 be maintaining all our Pascal
t rd: ~ l' P 'f ~ t; e' 'f' S ",J S 'l n g t'; h t ',; \:; ~j ~-; .:, 1': b 1 ~:::q" j nth~' "'H:3 r of \l t. Ln'" e .
R Y 1; h t;i· pro c e s s
the users of the UCSD Pascal system will b~cDme essentially independent
of any manufacturer's sy~t.m software,
n~eds,
This assembler was mod~lled dfter The Last Assembler (TLA)
deve!opeJ at the University of WateTloo.
The b3Sic concept behind both
the TL{>, r:lna
th{:? Uf.:SD Adaptable
A~S'?lnt.ier5
15
the
~~e
of; a
ce.ntral
machine LndepenJent core that is com~Qn to all versions of the
aBs9mbler
This central core is augmented with machine specific code
t <0 han ri 1 ~ t n e pee 11 ) i aT" i t i ~ s of S!"~ c h i -n (j i v i d I..J.3 1 in ~ r. h i n e '
For the 1. 5 release
PDP-~ll
and Z80
,~5semb
lers wi 11 be
adaptations took longer than one person-
.at
le~st
This
one
ODC!}''ni?qt
'E,HisE~r:d'jltJ
!s inten,jed for
It:lngwagE>
;;
'I'€3df:1"
liJhl;j
l~·
alre~d!J
fluent in
USAGE
BefoT~
~tt~mpting
spf:cifl,t:-: machine;
an
to
opc~d~?
~i?~ute
locat?d on the sqstem disk.
contains the error messages that are
~ 5 $ ~~ iTt b
1.
f.~~ ~
TO
This
riql\t
~i!l
Th
~'~!'1
US€;
+~
t~~
i. SOl) t ;, fi r~ ~ 1 }
1·f
the UGSD ,ass€lmblpr,
SKecu~~
·,,::,t-;~i\,P'-i
i l
of~
SYSTEM, ASSEMBLER,
t;h~
the assembler program for a
1"i Ie Cl80.0PCDDES Ol" 11. OPCODES) must be
The erro~s file (ZBO.ERRORS OT 11. ERRORS)
a~sembler
us~d
t.! r~~.
ed}
for e~rDr flagging during the
i t mtJ s t a l S 0 a p pea l' 0 nth e
tyPf: A( ssem for'om the Command
(T~e
{PDP-1t
user should
~rrange
or 1.80) h.ave t.hat
line.
that the
title.)
The program displaysJ the version of the asssembler being
;:H1 d a s ~ t' ,;l e <; t h ~ t
the CUT' l ' ~ n t '.U 1) or k of! i 1. e i s the 1) net 0 b e
assembled
t f the~e is no (\Jrrert wQrk~ile then the prog~am asks which
e :x e cut e d
fil'.:
is to be
,£j'Ss~mblf;·d,
Page 99
The next prompt line is:
Output file for the assembled listing «CR> for none):
As usual for a console or printer output the wards CONSOLE or
PRINTER nU_Ist b~ f;:.~11Qlnwd b~:3 ':..olu'(u j, f:. CONSDLX':;:'"
I f the cclon is
neglected the uutput is sent to a file of the name given.
At this
point. the pTQg~am reports whether O~ not the output devic~ (if any) is
on line
The assembled code is written out to a file called
*SVSTEM.WRK.CODE which cannot be executed by itself but must be changed
to link in with a host file.
er'i"OT"$
T r. e p T' 0 g T' 2d1~ t h f:HI s t ,;; i' 't ~
they 3re f-ound, If' ,E:t'l
~s
cl $ S
~j
e mb lin 9 the wCl 1'" k f i 1 e
1- 1 ;39 gin 9
other than an 110
j
el't'Qr~
error, is found, a general message indicates the natu~e of the error
and also gives the option to continue or exit.
The error message will
bet a k ~ n f'r om the ER ROR S f i 1 e i f P 0 S sib 1 e. r f t h l~ t i $ not p 0 S s :i b 1 e.. d (J e
to space limitations or the absence of the errors file, the error
message number 15 given. The assembly is aboTted if the 110 error
encountered is not due to data typed in by the user, otherwis~ the user
is prompted to try again.
\S~e the complete list of Assembler syntax
eT''rorg 2!nn ffiitichinc,
dot TOT"
s.pt"?fii:i.c..
eT'T'OT~S
in
l~hle
6,)
The COD$cltl' cii;.;pla\jsl on t:h~ i.;!f-r, hand sid~? of the 'c~C'1'0er~, onf:'
eat:h Ilno cd:> ~~nde as'r:d'~mbled and a l:i'tH~ c.rH}nter ev(,:;.'r.'Y 50 lines.
When an include file
is started,
the console displays:
INCLUDE
At the end
the assembly the assembler program indicates that
tells the user how m~n~ errors were found.
In
addition an alphabetic symbol table i~ generated.
c~
i t is finished and
The
col u mn
symbol table consists of three parts.
The first
t s t tH~ S ~.~ mb t) 1 i d f:.' n t i f i 2;' 'r' ; the 'T:,; e c O~ (1, the 5 tJ (rd1 {J 1 t I:! f.h~
the lotation that it is defined or the value i t has.
refe~ence
T' e p T' e S E\ n
j
and the third,
Actual values are givR~ for the symbols representing absolutes and
definition locations are given for the symbols representing labels.
The location number lS given as a hi-byte first number and corresponds
to the Index numbers on the left hand side of the listing. Only symbols
which have definition locations o~ absolute values have numbers in the
third ccluffi!1i
Pagt: 10!)
othel'
typ,~s
IH~V(~
d,~:)sh'i:'s,o
PAGE -
1
00001
MemoT' y a f
0000:
OOOOi
PRIMARYZ FILE: #5: PRIMARY. Z
PR Il"lARYZ
· PRDC
t~·{'
6068
initi;.all.ldt:ion:
FL.DPP'-{
8F.:Cr-1EM
0000:
· EaU
· EQU
OBFDH
9000H
;Rom-based floopy driver
iFirst location in memory of bo
;Entry point of b~otstrap
;Sector start of second bootstr
t
OOOO~
· EGU
9000H
OOOO~
,EQU
OSH + 1700H
P
0000;
B 1 D~:H-\
.EGU
10H + 1700H
OOOO~
D2D'3it~
.E~U
ISH
L
1700H
OOOOl
0000:
,Sector start of BIOS part 1
iSectcr start of BIOS part 2
;Primary bootstrap for ZILOG DO
10001
1000: FD 21 ~.,***
1004: CD FDOB
1007; FD ",~.L ~;;' k,~t·k
100H: CD FDOH
lOOE: FD ·1 ~..~:.~,"t"
,t'>'j
~
PH IM!''\RY LD
C,!\LL
L.u
C~LL
IV, 'SECREriD
fLUF? '>(
Iy' bth'Ff...,D
J
F~'
LD
IVI
CD FDOB
Cll,LL
10151
l018!
C:'i 0090
JP
FLOPPY
SECENT
~:.. 1-
1002* 181.0
101S:
G£'t block
.'
Gf:'t
,;
Ge-t block for part 2 of BIOS
i
dump into second bootstrap
for
~ec.ond
bootstrap
block rcn" par·t 1 of BIOS
L.. r] F:) F~ \(
1012~
;~\
;.
B~-2nEAD
SECREAD
1018! 00
1019: O!-~
· BYTE $--$
BYTE O(\!·:
· WORD SE:C(o'il::N
lOlA: 0090
10lel 0002
101E: 0000
,
102.0 l
0010
10221
00
· l,.HJRD PR !!"iARY
. IiYTE $-$
· WORD SEe DSI"'..
~~HJR D
· WORD
l023i 0817
200~f
$~"$
I Unus,ed
; Read commtar~d
;Memory location for second boo
jNumbe~ o~ byte5 in boot
;Completion return address
;E~ror in return address
iCompletion result code
iDisk
block of second boot
1009* 2510
B1READ
102;-; ;
· EYTE $-$
1 O;2f,: 00
'lO;?iS i OA
· BYTE
O~\H
. WORD SECMEN+300H
L,·;ilR.D
10~2Dl
OG10
102F; 00
1030; 1017
10a2:
1082:
2(~'/·~·~·~~
. WORD $-$
WORD PRIMARY
,BYTE $-$
· WORD DtDSK
;Unused
i
Head
comm~31"",d
iMemory location or BIOS part 1
; f~J~J;11rJt.~~r n-F bfjtes in 13108 p'-!'irt 1
;Ccmpletion return address
iErro~ return add~ess
;Completion result code
:Disk block of BIOS part 1
B2READ
Of)
10:::-:i3 ~
1034:
;MRmory location cfd BIOS part
;Number of bytes in alaS part 2
;Cumpletion ~eturn address
,ErTor return address
Page 101
103C: 00
· BYTE $ ... $
103D:
· WORD B2DS!{
1817
l03F:
103Fl
;Completion result code
jDisk block o~ BIOS part 2
· END
PAGE-
2 PRIMARYZ FILE: #5: PRIMARY. Z
AB
RF
PB
-
Absolute
Ref
LB
Public
PV
DF
-
Label
un
Def
Private
PR
BIDSK
AB 1"110:
B1READ
FLOPPY
SECENT
AB OBF!)!
PRIMARY
SECMEM
AB 90001.
CS
SYMBOLTABLE DUMP
--
-
Me
Undefined
Fe -
PT'CC
Constant
LB 1025;
LB 1000:
AD 9000;
PRIMARYZ
SECREAD
Macro
Func
AS 1718:
B2READ
PR _._--:
LB 101.8:
SECDSK
LB 1032:
AB 1708:
r. !OTES:
The location
locatlon~
ip
t~G
valu~s
in th? sVmbol
table dump refer to the
listing.
The ****'s in the listing call attentIon to the use of a
label
not yet defirted.
i f a stal' (*> appears after the location number at the left of
the listing . i t indicates that a forward reference occurring earlier in
the ar;semhly ha"3 bf>f'r! resolved.
Then'-lmbf:~'r to thp IBf-t of the
'*' is
t h (~ 1 0 cat ion wh ~H" e +; h r T' ':~ F 2 'f' F' n c F.: 0 C r: ~,) ~, .,.... 2 ~ { t.,! h ... 1 '8' t h 0 ret; rn b {~ T t o t h t:~ i' t 9 h t
is the new contents of that location
HIGH-l.EVEL SYNTAX
L 9. 2
All ob.Jpcts (!!.~':~.a'red
a v ail a hIe of 0 r LI set r. '!" 0 t: g h c tI t
generated before
th~
tfJ:c,re
Lhf::'
at t.he beginnj.ng of each. PROC OT'
FUNC
the- start of the f i r s t . PROC OT' . FUf\V~
Only labels may
begi~
. PROC or . FUNt": are
No cod e i s a l lowed t 0 b e
Fi1'i:;t:
t h f.' ass e in h 1 'J
first .PROC or . FUNC.
tCl
The
symbol table is reduced
thf:'
p0.inf;
where
it
llU~5
at
in the fjrst column and may optionally
be follcbJp.d by a colon.
Local labels most havf? "$' in the first
column and may be up to 8 digits long.
If the statement has no labell
the fiT'st column most contain a space.
All assemblies must end with a END.
. FUNC need not because they ara ended by the
,PROC or . FUNe.
Page 102
Orlly
the
last one need:;
i:i
.
However each. PROC or
of the next
occur~ence
END.
A general railroad diagram for all assembly files looks like:
a.ny nen-cede
genera.ltng
oper'Q.llons
~(
I
/'
.
codeg~nerQttng
operQ.~J.,ons nnd
1 - - -_ _- - - :
....
EHD
dtrecltves
Page 103
The non-code generating operations are:
.EGU, .DEF, . REF, . PAGE, . TITLE, . LIST, . MACRO, . IF
The code generating operations are anv other pseudo-ops and all
assemb1v code for the program.
1. 9. 3
EXPRESSIONS (one-pass restrictions)
Since the Adaptable Assembler makes onl~ one pass through the
source code, something must be assumed (upon encountering an undefined
identifier in an expression) about the nature of the identifier in
order for the assembly to continue.
It is therefore assumed that the
undefined identifier will eventually be d~fined as a label, which is
the most probable case.
Any identifier which is not a label must be
defined before it is used.
Labels may be e~uated to an expression containingeither labels
and/or absolutes.
One must define a label befo~e it is uspd unless it
will simply be equated to another label.
Local labels may not occur on
the left hand side of an equate (.EGU).
Local labels are mainly used to Jump around within a small
segment of code without having to use up storage area needed by regular
l.bel-s.
The local label stack may hold up to 21 labels.
These are cut
back every time upon encountering a regular label and are thus rendered
invalid.
An example of the use of local labels is shown below, the
Jump to label $04 being illegal.
$03
REALLAB
$04
Page 104·
STA
4
JP
NZ,S03
JP
NZ,S04
. EGU $
. EGU $
iLEGAL USE OF LOCAL LABEL
iILLEGAL USE OF LOCAL LABEL
Identifiers a~e character strings starting with an alpha
character.
Other cha~acters must be alphanumeric or the ASCII
underline (' '),
Only the ~irst 8 characters are used by the assembler
even though more may he entered.
The following operators can be used in expressions processed
by
this
assemble~,
For
un~ry
'+'
operations:
plus
,_ I
minus
'''V ,
ones complement
For binary ope~ations:
'+'
plus.
'- ,
minus
exclusive or
multiplication
I '
truncating division
t.. '
remainder division
I ..... f
,~,
(
I
t
I
I
I
I
,
bi·t
&
~
bit wise
eqtJal (v~lid anly in . IF )
=
.... --..
I
I
I .........,'!I I
wis;:~
nat equal (valid only in
IF
All constants must start with an integer 0-9.
All operations are applied to whole words.
The default radix is Hex fDr the leO version and Octal fOT the PDP-l1.
1.9.4 ASSEMBLER DIRECTIVES:
OVERVIEW
Assembler dir-er:tives (also referred to as "pseudo-ops") allow
the programmer to instruct the as~emble~ to do various function5 othe~
than provide direct executable code.
The following directives are
common to all UCSD versions but may differ from manufacturer's standard
syntax.
In the following pseudo-op descriptions s~uare brackets, [l,
are used to denote optional el~ments.
If an element type is not listed
it cannot be used in that situation.
As usual, angle brackets,<>,
denote meta symbols.
FoT"
e~ample:
(label]
. ASCII
"-(char-cater string)-II
indicates that a label may be given but is not necessary
and that between the double quotes must go the character
st~ing to be converted (not necessarily the words
"charar.ter string")_
Page 105
The foll~wing terms represent general concepts in the
explanation of each directive:
value
•
= any
valuelist =
numerical valuel
is a
label,
constant,
expression .
list of one or more values separated by commas.
idlist = a list of one or more identifiers separated bV commas.
expression = any legal
identifier: integer
l~st
expre5~ion a~
=
defined in Section 1.9.3.
a list of one or more identifier-integer
pairs seperated by ~omma~. The
colon-integer is optional in ea~h pair
and the default is 1.
Small examples are included after each p~eudo-op definition to
supply the user with a reference to the specific synta~ and form of
that directive.
The larger examp Ie, inc luded in section 3.3.2, is used
to show the combined use and detailed examples of directive operations.
1.9.4.1
ROUTINE DELIMITING DIRECTIVES
Every assembly must include at least one .PROC o~ . FUNC, and
one . END, even in the case of stand-alone code which will not be linked
into a Pascal host (i. e. an interpreter>.
The most frequent use of the
assembler, hO~lever, will be small routines intended to be linked with a
Pascal host.
In this case, .PROCs and . FUNCs are used to identify and
delimit the assembly code to be accessed by a Pascal external procedure
or function.
The . END appears at the end of the last routine and
serves as the final delimiter.
References to a .PROC or . FUNC are made in the Pascal host by
use of EXTERNAL declarations.
At the time of this declaration the
actual parameter names must be given.
For example, if the Pascal
declaration is:
PROCEDURE FARKLE(X, Y: REAL); EXTERNALi
the associated declaTation for the .PROC
~ould
be
PROC FARKl.E,4
A .PROC, . FUNC, or any assembly routine should be inserted into
the *SYSTEM.LIBRARY (execute LIBRARIAN) 50 that it can be referenced by
the *SYSTEM.LINKER and linked in at run time
An alternate method ~ould
be to execute the LINKER and tell it what files to link in.
Either
method works. Howeverl if the Pascal host is updated and the assembly
routines aren't in the *SYSTEM.LIBRARY, the linker will have to be
executed after each update.
Therefore, we suggest that the routines be
inserted into the *SYSTEM. LIBRARY to avoid this repetition.
If the
Page 106
linker is called auttHhstlcally using the Runc:ommand, it will search
the *SYSTEM.LIBRARY for the appropriate definition of the assembly
routine and link the two together.
· PROC
Identifies a procedure that returns no value. A .PROC is
ended by the occurrence of a new .PROC,.FUNC, or . END.
FQRt'1:
.PROC
C,expression]
[expression) indicates the number of words
of parameters expected by this routine.
The
EXAMPLE:
· FUNC
deft~ult
. PROC
is O.
DLDRIVE.2
Identifies a function that returns a value.
Two words of space to be used fOT the function value
will be placed on the stack before any parameters
A . FUNC is ended the same way as the .PROC .
FORM:
. FUNC
C,expressionl
[exp~essionJ
indicates the number of words
of parameters expected by this routine.
The
EXA!'1PLE~
· END
def~ult
. FUNC
is 0,
RANDOM. ·4·
Used to denote the physical end of an assembly_
1.9,4.2
· ASCII
Converts cha~acte~ values to ASCII equivalent bijte constants
and plac@s the equivalents into the cod~ stream.
FORM:
r. 1 abe 1 )
. AS C I I
<: c h a 'r a. c t e 1" s t T' i n 9 >,.
where is any string of printable
ASCII chaT'acters~ including a space.
The length
of the string mu~t less than 80 characters. The
double quotes are used as delimeters for the
characters to be converted.
If a double quote is
dt?~ired· in the string;
i t must be specifically
inserted ustng a . BYTE.
l!
Page 107
· ASe r r
EXAMPLE:
lIHELLO"
for the in5~rtian of
constructed as:
AB~CD
the code must be
· ASCII
· BYTE
· ASCI I
Note:
The 34 is the ASCII number far a double quote in hex.
The representation actually used will depend on the
default radiI of the particular machine in use .
. BYTE
Allocates a byte of space into the code stream for each value
list~d_
Assigns the assoc:iated label, i-F any, to the address
at which the byte was stored.
Expression must have a value
between -128 and +255.
I' the value is outside of this range
an error will be flagged.
[ 1 abe 1 ]
FORJ1:
. B VTE
rVf.l.luelistJ
the default for no stated value is 0
. BLOCK.
AlloCBt~s
listed
(if
4
TEt1P . BYTE
EXAMPLE:.:
a block of
jnto code stream for ~ach value
Associates the label
with the starting address of the block allocated.
spac~
Amount allocated
pr~sent)
[ 1 f~ bel J
is in bytes.
. BLOC f.<.
<:length:> is thr:> th~ nl~mb·eT' of tH~t~s to held the <:value:>
s pee i fie d
T h P. d f.~ fat! 1. t .p 0" n (1 s t r3 ted v {:t 1 U ~ i sO.
EXAMPLE:
TEMP . BLOCK
4, 6
the a$sociated output would be:
Of;)
06
06
06
Page 108
( f D wr'
hy t
~~ ~
ll,~
i t i l t he val tJ e 06
)
. WORD
Allocates a word of space in the code stream for each value
in the
v~lu~list.
As~o(jatp.s
th€* decla'ration label with the
word space allocation.
FOR~1:
CIa bel]
EXAMPLE:
TEMP . WORD
. WOR D
0,2,4, ...
the associated output would be:
0000
0002
000,,1
EXAMPLE:
Ll
. WORD
(words with these values in them )
L;2
if L.C l!J·mt;; 50 4~t ttH! ,EQU
t h Eo ;~ ~ soc i .;,;y t ~ d Gut; p n t IJJ n v 1 d be:
. EQU
0050
(*
assign(r,t::nt due
0005
(*
a~signment
Assigns a value to a
~?~pT'e!i!:~!:ion
cont~ining
label.
either
to tho L2 valLIe
due to tho
*)
WORD 5 *)
Labels may be equated to an
lables and/or absolutes.
Dne
must deFine a label before it is used unless it will simply
be equated to another label.
A local label may not appear
on the left hand side of an equate ( .EGU ).
FORI'-1:
. EGU
R6
. ORG
~, t h ~ cur T' en t
1 0 cat i 0 it C 0 U T'I t ? r ( L C) t o t h e 'of a 1 u e
It would normally be used in a stand-alone program.
there is one. ORG In the 8G80/Z80 interpreter .
S IJ~ t
0
f
the . OR G .
For example,
. ORG .L6 cuNLenUy impiemented oni..lj 60ft advancing the iocation c..oun..tetL.
not cunnentilj po~~ibie to ~et the iocation count~ back.
It.-iA
Page 109
1.9.4.3
MACRO FACILITY DIRECTIVES,
A macro is a named section of text that can be defined once and
repeated in other plac~s simply by using its name.
The text of the
macro may be parameterized, so th.::1t each invocation results in a
different version of the mac~o contents.
At the invocation point, the macro name is followed by a list
of parameters which are delimited by commas
(except for the
last one, which is terminated by end of line or th~ comment indication
( ' i ' ) >.
At invocation time, the text of the macro is inserted
(conceptually speaking) by the assembler after being modified by
parameter substitution. Whenever i.n (where n is a single decimal digit
greater that zero) occurs in the macro d~'inition, the text aftha nth
parameter is substituted.
Leading afid trailing blanks are stripped
from the parameter before the substitution.
If a reference occurs in
th~ macro definition to a parameter not provided in a particular
invocation, a null string is substituted.
A macro definition may not contain another macro definition.
nit ion can c e r t a i n 1 Y I h owe v e r l i n c 1 u d Po ma c r 0 in v 0 cat ion s .
Th i 5
"nesting" of macro invocations is limited to five levels deep.
d e of i
The expanded macro is always included in the listing file (if
listing is enabled at the pOint of invocation).
Macro expansion text
i s f loa 9 9 e d l i n the lis tin 9 , b y a ' #' JUs t i e f t 0 f e a c hex pan de d line.
Comments occurring in the macro definition are not repeated in the
expansion .
. MACRO Indicates the start of a macro and gives it an identifier .
. ENDM
Indicates the end point of a MACRO .
FORM:
. MACRO
(ma.c1"'O
body)
. ENDM
EXAMPLE:
. MACRO
HELP
STA
'X1
LDA
%2
-( comment :>
<: comment :>
. ENDM
The listing
Page 110
where the macro call is made may look like:
A
HELP
51"1'.,.
LDA
FIRST. SECOND
FIRST
SECOND
The 5tatem~nt HELP, calls th~ macro and ~ends i t two
parameters. FIRST and SECOND.
These parameters are in turn
referenced inside the macro using the identifiers Xi for the
va~iable FIRST,
and 1.2 for the variable SECOND.
CONDITIONAL ASSEMBLY DIRECTIVES
1.9.4.4
Conditionals are used to selectively exclude or include
sections of cod~ at a$sembly time.
When the assembler encounters an
. IF directive, it evaluates the associated expression.
In the simplest
case, if th~ ~xr~eSSiD" is falsel the assemble~ simply di5ca~ds the
text !.inti 1:~
E!\!D( 1.·E 'if~.'Elrhert
If· there is ,~n
ELSE direr.:tivp. bet{z.!fH~n
t h flo
rFan d . ENOC d .1 T' ~ c t: :i \l i~ S i t h e t ext b ~p 0 'r ~ the . ELSE i os s e 1 e r. ted if
thf~ s'q)T't:s<;;, on is t1'U€~.
mnd the t~xt !3ftr~T' the
ELSE if! the condition
is false
The unassembled part of the condition~l will not be included
Conciitjonals may
b~
nested.
sion ti!j~(e~~ one of tldO fOT'ms.
The first
is the no~mbl a~ithm.tic/logical expres~ion used elsewhere in the
assembler.
This typm of exp~essicn is considered false if it
ev~luAte~ tn zerOi
true othe~wise.
The second farm of conditional
Th~
condit
tiJn~l
expr-E'SSlOn is COmf.H~·r'j,son
and ' . "~.: ~
r e ~;q) i? C t i \/ ely 'a~tthmRttc!logical
· IF
ff'XPT8Si
for' equality or inequality
0n€
!(i~;~ ~J
C. 0
mpaT' B
5
t r i n9 s •
(indicated by
c h a rae t e -r' S t
'=1
Of'
expressions.
ldentlfias the beglnning of the conditional_
· ENDC
· ELSE
Identif.:ies
th~
exp~ession
is egual to 0 then the else is used.
FORM:
[lr.ibel]
alte-rn3te to the. IF.
IF
. ELSE
If -the conditionall
(*
only if there is an else *)
. ENDC
Page i i i
where the expression is the conditional expression to be met.
· IF LABELI-LABEL2
iarithmetic exp~ession
This text assembled only if subtraction
result is now zero
EXAMPLE:
IF
"%1" ;:::"STUFF!I
icomparison expression
This text assembled if subtraction above
was true and if text of first parameter
(assume we a~e in macro ) is equal to "STUFF"
.ENDC
iterminate nested condo
· ELSE
This text assembled if subtraction result
i
was zero
· EN DC
iterminate outer level
iconditional
PASCAL HOST COMMUNICATION DIRECTIVES
1.9.4.5
The
di~ective5
.CONST,
. PUBLIC, and . PRIVATE allow the sharing
of information and data space between an assembly routine and a Pascal
host.
These external referenc.es must eventually be resolved by the
Linker.
Refer to Section 1.8 Linker, for further details.
.CONST
Allows access
globally declared constants in the PASCAL host
in a program
to replace 16 bit relocatable obJects.
o~
by the assembly routine . . CaNST can only be used
. PUBLIC
Page 112
FORM:
,CONST
EXAMPL.E:
<* see example after . PRIVATE
Allows
of the assembly routine to be
va~iables
sto~ed
in the
global data segment and yet be inaccessable to the Pascal host.
These
va~iables
retain their values for the entire execution of
the p-rog-ram .
FORM:
. PRIVATE
the integer is used to communicate the number of
words to be allocated to the identifier.
EXl'~lPLE:
(*
for .CONST,
. PRIVATE,
. PUBLIC *>
Given the following Pascal hast program:
PRO(~RAM
EXAMPLEi
CONST SETSIZE=50; LENGTH=80i
VAR I,J.F/HOLD,COUNTER,LDC: INTEGER;
LST1:ARRAY[O .. 9J OF CHAR,
BEGIN
END.
and the following section of an assembly routine:
_ CONST
LENGTH
. PRIVt.. TE
PRT .• LST2: 9
LDCI I I J
. PUBLIC
This will allow the canst LENGTH to be used in the assembly
routine almost as if the line LENGTH. EGU eo had been
written. (Recall the limit~tinn mentioned above for the use
. CONST identifiers. ) The vaT':i~3bles LOC, I. J to be used by both
'the Pase a 1 hO$ t and tile assemh 1 y~. outi ne, and the variables
PRT, LST2 to
be
used only by the assembly routine.
the LST2:9 causes the
va~iable
b fl gin n i n goof a 9 tal 0 1" d b 1 () c~·
segment"
0 oF
Furthe~,
LST2 to correspond with the
spa c e i nth e 9 1 t., b aId a ta
Page 113
1. 9. 4. 6
EXTERNAL REFERENCE DIRECTIVES
The use of . DEF and ~REF is similar to that of . PUBLIC . . DEFs
and . REFs associate labels between assembly language routines rather
than between an assembly routine and a Pascal host program.
Just as
with . PRIVATE and .PUBLIC~ these external references must eventually be
resolved by the Linker.
If such resolution cannot be accomplished, the
Linker will indicate the offending label.
cannot be expected to flag these errors,
other assemblies.
. DEF
. REF
Naturally!
the assembler
since it has no knowledge of
Identifies a label that is defined in the current routine
and availabl~ to be used in other .PROCs or . FUNes.
FORfYi.
.DEF
EXAt1PLE:
<*
see listing in section 3.3.2.3
'O~
example *)
Identifies a label used in this routine which has been
declared in an external .PRQC or . FUNC with a .DEF.
During the linking proce$s~ corresponding .DEFs and .REFs
are rna t
t:
hed.
FORM:
. REF
EXAMPLE:
<* see listing in section 3.3.2.3 far example
*'
Nate: The .PROC and th0 . FUNC directive also generates
a . DEF l~ith the same ntune.
This allows assembly
procedures to call. PROC and . FUNes if they have
been defined in a . REF.
LISTING CONTROL DIRECTIVES
· LIST
&
· NOL.IST
Allow. selective listing of assembly routines.
If no Dutput file is declared then the default is CONSOLE:
when a . LIST is encDuntered. The . NOLIST is used to turn off
the .LIST option. Listing may be turned on and off
rRpeatedl~ within an assembly.
FORM:
· PA(-1E
, LIST
01"
.
NOLIST
Allows the programmer to explicitly ask for top of form
page breaks in the listing.
i6 no ruUng ouitpld nile M ,t,pecJ..6ied then
dhc.e.c.Uvualte .6imply ignoJted.
au. . LIST and
.NOLIST
FORM:
. PAGE
Allows the titling of each page if desi~ed.
The title may be up
to 80 cha~acters in length.
At the start of each procedure the
title is set to blanks and must be T'eset· if title is desired"
. TITL.E
The title;
INTERP
shown in
1, 9.4.8
. INCLUDE
SYMBOL TABLE DUMP
S~ction
1.9.1 was caused by a . TITLE directive.
FORM
<:t i t 1 e:'-'"
. TITLE
where is a string
EXAMPLE
.1ITLE
**
GRC12 interpreter
FILE. DIRECTIVES
Causes the indicatgd source file to be included at that point .
FORM:
. INCLUDE where the file
identifier is any file to be included.
Only spaces
are allowed between the end of the file name and the
end
o~
the
Includ~
line .
CORRECT EXl\MPLE.:
. INCLUDE
SHORTSTART TEXT
CORRECT EXAI'1PLE:
. INCLUDE
SHORTSTART.TEXT
i
IN-CORRECT EXAMPLE: . INCLUDE
For a
m/H~ h j
**
list of
!1 !'.' '! S
:; p ;::,
gene~al
callo; starter
SHORTSTART.TEXT
errors and also notes on the
zao
calls starter
and PDP-11 based
T.3 h 1 e 6.
Note:' The.ti:Ue iJ.> only c.£.eCVted a;t the -6.taJtt 06 .the {yUe. In -6 eetion 1.9. 1 the :ti.:tle
SYMBOL TABLE DUMP Wa6 not f.:,et by a . TITLE cUJtec.:tive. That heading iJ.> a,fu)aY-6
tL6 ed on page!.> c.ontMMng f.:,ymboUabie dump-6.
Upon M-6 emblinga 6wvthetL
pJtoc.edwr.e the heading pJtinted JtetWtn6 to what i l WM f.:,et to be60Jte the
-6ymboltabie dump.
Page 115
- Notes -
********************* ***************
*
SYSTEM INTRINSICS
* *
Section 2. 1
*
********************* ***************
Version 1. 5
September 1978
WARNING
Mast of the UCSD int~insics assume that users are fluent in the
use Or PASCAL and are experienced in the use of the system.
Any
necessary range or validity checks are the responsibility of the useT'.
Since some of these intrinsics do no checking for range validity. they
may easily cause the system to die a horrible death.
Those intrin5ic~
which are part1cularily dangerous are noted as such in thei~
descriptions.
PARAMETERS
Required parameters are listed along with the function/procedure
identifier.
Optional parameters are in [square bracketsJ.
The default
values for these are in {metabrackets} on the line below· them.
NOTE
Following a~e some definitions of terms used in these
documents.
They tend to take th~ place of formal paTameter~ in the
dummy declaration headers that preface each description of a particula~
routine, or set of routines,
ARRAY
a PACKED ARRAY OF CHARacterG
BLOCJ.(.
one dl.·sk blQckl
BLOCKS
BLOCKNUMBER
an INTEGER number of blocks
BOOLEAN
CHARACTER
any BOOLEAN value
DESTIN/,TION
EXPRESSION
FILElD
a nab S \1 11) ted i
'2
{512, bytes}
k b 1 0 c k add T' e s s
any expression which evaluates to a character
a PACKED ARRAY OF CHARacters to write into or
a STRING, context dependent
part or all of an exp~essionJ to be specified
a -filt? identifier~ ~'i:ust be
VAR fileid: FILE OF ;
or
INDEX
NUMBER
RELBLOC~
SIMPLVARIABLE
TEXT;
01'
INTERACTIVE;
OT"'
FILE;
an index into a STRING or PACKED ARRAY OF CHARacters,
context dependent or as specified.
a literal or identifier whose type is either INTEGER
or REAL.
a relative disk black address. relative to the start
of the file in co~textj the fir~t blork beIng
block zero.
any declared PASCAL va~iable which is oT one of the
f (I 1 1 m~J 1. n 9 TYP E s: :
Page 117
BOOLEAN
CHAR
REAL
STRING
SIZE
or PACKED ARRA.Y[ .. ] OF CHAR
an INTEGER number ofbyte~ or characters; any integer
SOURCE
a STRING or PACKED ARRAY OF CHARacters to be used as a
SCREEN
an array 9600 bytes long;
VJ..':jlup.
T'ead-only array,
STRING
TITLE
UN I TNllMBER
VOLID
**
context
d~pendent
or as specified.
**
or as needed.
any STRING, call-by-valuD unless otherwis. specified,
i. e. may be a Q,lIoted stT'ing, or string val'iable
or function which evaluates to a STRING
. a STRING con5t~ting of a file name
physical device number used to determine device handler
used by the interpreter
a volume identifier, STRING[7J
i. e. in .6vung in.tJzA.n.6ieo, SOURCE i.6 go-Lng to have to be a .6;tJU,ng, -Ln A..nvun.6ieo that
deal with pac.ked aJVLay.6 06 c.hafLac.telt-6, it may be eitheJt. A wOJtd 06 c.auUon
about U6ing STRING.6 in {n:tJvtn.6ieothat expec.t c.ha.Jta.c.teJt aJVLay.6, the zeJtoeth
Uement 06 :the .6.tJU.ng -fA the length byte, whic.h may c.aU6 e the pJtogJtammeJt
.6ome unexpec.ted pJtoble.m6. (Wvr.e he not awMe 06 that 6ac.t!) ed.
Pqge 118
********************* *****************
*
STRING INTRINSICS
* *
*
Section 2. 1. 1
********************* *****************
Version l.S
September 1978
FUNCTION LENGTH ( STRING ) : INTEGER
Returns the integer value of the length of the STRING.
Example:
GEESTRING := '1234567';
WR ITELN (LENGTH (GEESTR INC),'
" LENGTH (
I
,
)
);
Will print:
7
FUNCTION POS ( STRING
I
0
SOURCE ) :
INTEGER
This function returns the position of the first occurrence of
the pattern in SOURCE to be scanned.
The INTEGER value of the position
of the first cha~acter in the matched pattern will be returned; or if
the pattern was not found, zero will be returned.
Example:
STUFF := 'TAKE THE BOTTLE WITH A METAL CAP';
PATTERN := 'TAL';
WRITELN(POS(PATTERN,STUFF»;
Will p"rint:
26
FUNCTION CONCAT ( SOURCEs ) : STRING
There may be any number of source strings separated by commas.
ThislTunction returns a
all the str-i.ngs passed to
it.
st~ing
which is the concatenation oT
Ex.ample~
SHORTSTRING := 'THIS IS A STRING';
LONGSTRING : = 'THIS IS A VERY LONG STRING. 'i
LONGSTRING := CONCAT('START ',SHORTSTRING, '-', LONGSTRINO)J
WRITELN(LONGSTRING);
Will print:
START THIS IS A STRING-THIS IS A VERY LONG STRING.
Page 119
FUNCTION COpy ( SOURCE
INDEX
I
I
SIZE ) : STRING
This function return~ a st~ing containing SIZE characters
copied from SOURCE starting at the INDEXth position in SOURCE.
Example:
TL := 'KEEP SOMETHING
WR ITELN (KEPT) i
HERE';
KEPT
COPV(TL,POS{'S',TL),9);
Wi 11 print:
SOME.THING
PROCEDURE DELETE ( DESTINATION ,
INDEX
SIZE )
I
This procedure removes SIZE characters from DESTINATION
starting at the INDEX specified.
Example:
OVERSTUFFED:
=
'THIS STRING
H~~S
F.CtR TOO MANY CHARACTERS IN IT.
'j
DELETE(OVERSTUFFEDJPOS('HAS',OVERSTUFFED)+3,8)~
WRITELN(OVERSTlWFED);
Wj 11 print:
THIS STRING HAS MANY CHARACTERS IN IT.
PROCEDURE INSERT ( SOURCE
I
DESTINATION
I
INDEX
This inserts SOURCE into DESTINATION at the INDEXth position in
DESTINr',T InN.
Example:
ID :
=
I
INSERTIONS' I
MORE := ' DEMONSTRATE';
DELETE (MORE, LENGTHCMORE) , l)i
INSERT O'iOREI ID. POS ( 'IO! 1 10) ) i
WRITELN( ID);
Will print:
PROCEDURE STR ( LONG
Page 120
I
INSERT DEMONSTRATIONS
DESTINATION )
This converts thy lang integer LONG into a st~ing.
The
string is placed in DESTINATION.
See section 3.3.3 for
about the use of long integers.
~esulting
mo~e
Example~
INTLONG ;= 102039503;
STRCINTLONG,INTSTRING);
INSERT( '.
~
I
INTSTRING, PRED(LENGTH( INTSTRING»);
WRITELN( '$', INTSTRING)i
Will print:
$1020395.03
Note about using
st~ing$
and
st~ing
functions:
In order to maintain the integrity of the LENGTH of a st~ing,
only st~ing functions or full string assignments should be used to
alter strings.
Moves and/or single characte~ assignments do not affect
the length of a string which means it probab~ecome$ wrong.
The
individual elements of STRING are of t~pe CHAR and may be indexed
1 .. LENGTH(STRINO).
Accessing the string out~ide this range will have
unpredictable ~e$ults if range-checking is off or cause a run-time
error (1) if range checking is on.
Page 121
- Notes -
age 122
******************************* *****************
*
INPUT AND OUTPUT INTRINSICS
* *
Section 2.1.2
*
******************************* *****************
Version 1. 5
PROCEDURE RESET ( FILEID,
September 1978
[TITLE]
)j
PROCEDURE REWRITE ( FILEIDI TITLE
)j
These procedu~es open files for reading and writing and mark
the file as open.
The FILEID may be any PASCAL structured file, and
the TITLE is a st~ing containing any legal file title.
The difference between them is that REWRITE creates a n.w file
for output filesi RESET slmply marks an already existing file
open for 1/0.
(Note: if the device specified in the title is a nondirectory structured device, e. g. PRINT~R:
th~n the file is opened
Tor in put IOU t put, 0 r bot h in e i the rca 5 e.) 1 f t h e f i 1 e wa sal rea d y
open. and another RESET O~ REWRITE is attempted to it~ an error will be
returned in IORESULT.
The -filei's state will remain unchanged.
on
di~k
I
RESET (FILEID) witho~jt optional string parameter urewinds" the
file by setting the -file pOinters back to the beginning (zero th
~ecoT'd) oT the -file.
The boolean functions EOF and EOLN will now be
set by the implied GET in RESET.
These procedures behave differently with files of type
INTERACTIVE.
RESET on files of types other than INTERACTIVE will do an
initial GET to the file, setting the window va~iable to the first
l' e COT' din the f i 1 e ( as des c rib e din Je n 5 en & Wi r t h ) .
RESE Ton a of i 1 e
of type INTERACTIVE will not do an initial GET.
PROCEDURE UNITREAD
PROCEDURE UNITWRITE
UNITNUMBER. ARRAY, LENGTH,
UNITNUMBER, ARRAYI LENGTH.
[BLOCKNUMBER], [INTEGER] );
CBLOCKNUMBERJp [INTEGER] );
{ sequential} { 0 }
THESE ARE DANGEROUS INTRINSICS
These procedures are the low-level procedures which do 110s to
The UNITNUMBER is the'· integer name of an 110 device.
The ARRAY is anq de~lared packed a~raYI which may be subscripted to
indicate a starting position.
This is used as the starting address to
do the transfers from/to.
The LENGTH is an integer value designating
the number of bytes to transfer.
The BLOCKNUMBER is required only when
u~ing a hlock-structured device (i. e.
a disk) and is the absolute
blocknumber at which the t~ansfer will start from/to.
If the
BLOC~NUMBER i5 left out, 0 is assumed.
The INTEGER value is optional
(assumed 0) and indicates (if 1) that the t~ansfer is to be done
asynchronously.
The blocknumbe-r is not necessary.
A '"Yl.' wut be
varioun d~v,.c.es.
sufficient,
6aUlitieA *)
(See UN!TBUSY and UNITW?,IT.)
(*when
U6iYl.g
the
aoYYl.C.h!tOYl.OU6
I/O
FUNCTION UNITBUSV ( UNITNUMBER ) : BOOLEAN;
This function returns a BOOLEAN value, indicating if TRUE that
the device specified is waiting foT' an 110 transfer to complete.
Example:
UNITREAD(2{non-echoing keyboa~d}jCH[OJf
l{for one character}, {no block no.}, l{async:hronous},);
WHILE UNITBUSY(2){While the READ has not been completed} DO
WRITELN(OUTPUT,'I am waiting for you to type something'};
WRITELN(OUTPUT, 'Thank you for typing a
.. I CH[OJ)i
Execution of this example will continuously type out the line
'I am waiting far you to type something' until a character is struck on
the keybo;:~T'd,
Suppose a ' ! ' were tlJpedo
The me'ssage
'Thank you foT'
typing a · ' will then appear, and program execution will proceed
nOT'ma 11 y.
PROCEDURE UNITWf-\IT ( lINITNUMBER ) i
This waits for the sppci'ied d.vice to complete
It can be simulated by:
th~
110 in
prog~es~.
WHILE UNITBUSV(n) DO {waste a small amount of time};
PROCEDURE UNITCLEAR ( UNITNUMBER );
UNITCLEAR cancels all IIOs to the
hardware to its power-up state.
FILEID,
FILEID,
FUNCTION BLOCKREAD
FUNCTION BLOCKWRITE
ARRAY,
ARRAY,
spe~iFied
BLOCKS.
BLOCKS.
unit and resets the
(RELBLOCKJ )
INTEGER~
[RELBLOC~'{
INTEGER,
J
)
{ sf'quential }
These functions
blocks of data
(1. e. F : FILE;
actll(~lly
).
T Ii f.\
an INTEGER value e~ual to the number of
tT'ansferred.
The FILE must be an untf,~ped file
1 eng tho -f' AR R A V 5 h 0 U 1 d b e ani n t. e 9 Po r mu 1 tip 1 e 0 f
retu~n
BLOCKS is the number o~ blocks you want
tran':;ft:>rr'ed.
RElBLOC!, is the blocknomoC\;, reL:::"tive to the staT't 0; the
file# the zeroeth block being the first block in the file.
If no
RELBLOCK is specified, the reads/writes will be done sequentially.
A
random access 110 moves the file point~rs.
CAUTION should be exercised
when using thesel as the array bounds a~e nat heeded.
EOF(FILEID)
becomes true when the last block in a file is read.
bytes-per-di~k-block.
Page 124
Pf~GCE.DURE
CLOSE ( FILEID OPTION ) i
OPTION may be null or "
',CRUNCH',
LOCK't or "
NORMAL', or "
PURGE', or
(Note the commas!)
If OPTION is null then a NORMAL close is done, i. e. CLOSE
simply sets the file state to closed.
If the file was opened using
REWRITE and is a disk file, it is deleted from the directory.
The LOCK option will cause the disk file associated with the
FILEID to be made permanent in the directory if the file is on a
dfrectD~y-structured device and the file was opened with a REWRITE;
othe~wise a NORMAL close is done.
The PURGE option will delete the TITLE as~ociated with the
FILEID fram the directory.
The unit will go off-line if the device is
not block structuT~d.
T h 1;:' CR UNC Hop t i. 0 n
The intent is to ID~k a
u.eful information.
i
~~
fil~
as y n tun d e fin (~ din
ll' hat
i t
wi 11 do.....
with the minimum number of blocks of
All CLOSEs rega~dlegs of the option will ma~k the file cloned
and will make the implicit variable FILEIDA undefin~d.
CLOSE on a
CLOSEed file causeG no action.
FtJNCTHlt. .l EOF (FILEID)
:
BOOLEAN.;
FUNCTION EOLN (FILEID) : BOOLEANi
If (FILEID) i's nt,1t present, the fileid INPUT is assumed (e. g.
IF EOF THEN ... >.
EOLN and E.OF return fl.~.lHe d'fter the file specified is
RESET.
They both return tr-ue on a c lased fi le.
When EOF (FILEIO) is
t~ue~
FILEIDA is undefined.
When GET (FILEID) sets FILEIDA to the EOLN
character OT the EOF character; EOLN (FILEID) will return true, and
FILE!'fY" (in a FILE OF CHAR) will be s~t; to a bIanlc,
If) while doing
puts or writ.s at the end of a file, tho file cannot be ~~panded to
accommDdate th~ PUT or WRITE~ EOF(FILEID) will return true.
FUNCTION IORESULT
INTEGER;
I~d"t;(?r any I/O opf~r.ations
IORESULT c.ontains an INTEGER value
corresponding to the values given in Table 2.
Page 125
PROCEDURE GET ( FILEID );
PROCEDURE PUT ( FILEID )i
These procedures are used for operations on typed files.
A
typed file is any file for which a type is specified in the variable
dec 1 a rat ion l i e . ' FILE I D : FILE OF <: t YP e"
T his i s a sop p 0 sed to
untyped files which are simply declared as: ' FILEID: FILEi'.
'F: FILE
OF CHAR' is equivalent to 'F: TEXT'.
In a typed file each logical
record is a memD~y image fitting the description of a variable of the
associated .
t •
GET (FILEID) will leave the contents of the current logical
record pointed at by the file pointers in the implicitly declared
"window" variable FILEIDA and increment the file pointers.
PUT (FILEID) puts the contents of FILEIDA into the file at the
location of the current file pOinters and then updates those pOinters.
PROCEDURE READ{LN} ( FILEID, SOURCE )i
PROCEDURE WRITE{LN} ( FILEIDi SOURCE )j
These procedures may be used only on TEXT (FILE OF CHAR) or
INTERACTIVE fi les for. 110.
If 'FILEID, , is omi tted, INPUT OT' OUTPUT
true.
This means that any subsequent READs of
STRING variables will return the null string until a READLN or
READ(chara~acter) is executed.
There are three files of type INTERACTIVE which are
predeclared: INPUT, OUTPUT, and KEYBOARD.
INPUT results in echoing of
characters typed to the console device.
KEYBOARD does no echoing and
allows the programmer complete cont~ol o~ the response to user typing.
OUTPUT allows the user to halt or flu~h the output.
PROCEDURE PAGE ( FILEID );
This prOCedUT'E'1
as described in Jensen & Wirth
P.
*********************************** ***************
*
LOW LEVEL GRAPHICS INTRINSICS
* *
Section 2.1.4
*
*********************************** ***************
Version I. 5
CAUTION
September 1978
(*U,6e.d only with the. TERAK 8510a. miCJtoc.omputeJt*)
Thes~ routines do no range checking of the parameters they are
passed.
If any of the paramteT's are "out of range", these routines
will happily move bit patterns throughout main memory, much to the
dismay of the operating system and your program.
See Table 4 for modes and penstates
fQ~
these intrinsics.
The DRAW intrinsics are available only for the Terak 8510a in
this r~lea5e.
Additional display units will be supported in later
releases, but no details are currently available.
Probable implementat ion ( s ): T e k tor 0 nix 4006.
PROCEVURE VRAWBLOCK(VAR SOURCE; SRCROW,SRCX,SRCY:INTEGERj VAR VEST; VSTROW,VSTX,VSTY:INTEGER;
CNTX, CNTY, MOVE: INTEl
(*
non~
of these are optional *)
This p~o~edure is w~itten for the Terak 8510a graphic displa~
mode.
The TERAK screen displays words consecutively with the most
significant bit of the word on the right.
DRAWBLOCK will work only on
screens who;. graphics operates in
thi~
manner.
WARNING:
No range
checking is performed.
DRAWBLOCK transfers a bit matrix SOURCE, which starts on an
word boundary, to a specified point (STARTY, STARTX) in the bit matrix
SCREEN.
All parameters are integers except SCREEN, which is a bit
matrix o~ width ROWSIZE (1. e. BITMAP: PACKED ARRAY[O .. MAXROWJ OF PACKED
ARRAV[O .. ROWSIZE-IJ OF BOOLEAN;)
The SOURCE is SIlEX bits wide by
SIZEY bits high.
The first COPYX bits of each row are copied into the
destination.
MODE is defin~d in TABLE 4.
PRDCEDURE DRf\WLINE
VAR
(RANGE: INTEGER; VAR SCREEN; ROWWIVTH, XSTART, YSTART, VELTAX,
VELTAY, PENSTATE: INTEGER);
(* none
of these are optional
*)
In order the parameters are: INTEGER IDENTIFIER, ARRAY
IDENTIFIER. and the remaining six, INTEGER EXPRESSION.
RANGE will
contain the results of a Radar scan.
This parameter is untouched
unless PENSTATE is sent as 4.
The value returned is the number of dots
that would hav. be~n drawn before encountering an obstacle.
SCREEN may
be subscriptpd to determine a starting position in the array.
ROWWIDTH
is the width of SCREEN in number of words; this determines how DRAWLINE
will consider the rectangularity of the array.
XSTART is the starting
horizontal coordinate; YSTART is the starting vertical coordinate.
DELTAX is the distance to. move in the horizontal plane.
DELTAY is the
distance to move in the vertical plane.
PENSTATE controls the action
taken; sea TABLE 4.
**fJ 0 te.:
the deelaltation6
a6
in oltdeJt to U,6 e. the6 e. ltO utine6 , the. t.M eJt mt.M t add
above., a.nd the. lte6eJtve.d woltd EXTERNAL;
Page 129
-~ares..
Page 130
-
******************************************** *****************
*
CHARACTERARRAV MANIPULATIONS INTRINSICS
**
Section 2.1.5
*
******************************************** *****************
Version I. 5
September 1978
CAUTI.ON
Th e·s e in t T' ins i c: s aT" e a 11 by teo 1" i en ted.
Use them wit h car e.
Read the descriptions carefully before trying them out as no range
chec.king of any sort is performed on the parameters passed to these
routines.
The p~ogTammer should know exactly what he is doing before
he does it since the system does not protect itself from these
opera'tiofHL
FUNCTION SCAN ( LENGTH,
PARTIAL EXPRESSIONI
ARRAY ) :
INTEGER;
This Funtt10n returns the number of characters from the
starting position to where it terminated.
It terminates on either
matching the specified LENGTH or satisfying the EXPRESSION.
The ARRAY
should be a PACKED ARRAY OF CHARACTERS and may be subscripted to denote
the starting point.
If the exp~ession is satisfied on the character at
whir.::h ARRAY is pointed, the value returned uJill be zero.
I f the length
passed was negative, the number returned will also be negative, and the
function will have scann~d backward.
The PARTIAL EXPRESSION must b~ of
the TOT'm:
OT'
U<::;:-II
11=11
folluwed by
;
MDVELEFT(A[O],A[l],n-l)i
but FILLCHAR is twice as fast,
source.
as no memory reference is needed for a
See the note about word move optimization in the section on
MOVELEFT.
The notes about MOVELEFT also apply to FILLCHAR.
The intrinsic SIZEOF (Section 2.1.6) is meant for use with
it is convenient not to have to figure out or
remember the number of b~tes in a particular ~ata structure.
these intrinsic$j
Page 132
************************** *****************
*
MISCELLANEOUS ROUTINES
* *
Section 2.1.6
*
************************** *****************
Version I.5
September 1978
FUNCTION SIZEOF ( VARIABLE OR TYPE IDENTIFIER ) : INTEGERi
This function returns the number of bytes that the "item"
passed as a parameter occupies in the ~tack.
SIZEOF is particularly
useful fur FILLCHAR and MOVExxxx intrinsics.
FUNCTION LOG ( NUMBER
~
REALi
This function returns the log base ten of the NUMBER passed as
a
paT"amet~r"
PROCEDURE TIME (VAR HIWORD,
LOWORD'
INTEGER);
This procedure returns the current value of the system clock.
It is in 60th? of a s~cond.
(This is somewhat hardware-dependent; we
assume a 16-bit integer size and 32-bit clock word.
The HIWORD
contains the most significant portion.
WARNING! The sign of the LOWORD
may be negativ~ since tile time is represented as a 32-btt unsigned
number. ) Both HIWORD and LOWORD must be VARiables of type INTEGER.
FUNCTION PWROFTEN (EXPONENT:
INTEGER) : REAL;
This function returns the value of 10 to the EXPONENT power.
EXPONENT must be an integer in the range O.. 37.
PROCEDURE MARK (VAR HEAPPTR: AINTEGER)
PROCEDURE RELEASE (VAR HEAPPTR: AINTEGER);
These procedures are used for returning dynamic memory
HEAPPTR is o~ type AINTEGER.
MARK sets
allocations to the system.
HEAPPTR to the curT'ent top-·of-heap.
to HEAPPTR,
RELEASE sets top'-of-heap
pointer
PROCEDURE HALT i
This procedure generates a HALT opcode that, when executed,
causes a nan-fatal run-time error to occur.
At this point in
execution. the D~buggeT' is invoked, theT'efore, if the Debugger is not
in core when this occurs, a fatal run-time errol', #14, will occur.
PROCEDURE GOTOXY{ XCaORD
I
YCOORD );
ThlS procedure sends the cursor to
(XCOORD,
YCOORD).
the coordinates specified by
The upper left corner of the screen is assumed to be
(0,0).
This procedure is wTltten to default to a Datamedia-type
terminal.
If your system uses ather than a Datamedia or Terak 8510a,
you will need to bind in a new GOTOXY using the GOTOXY package
described in Section 4.10.
Pag.e 133
-NO\"ES -
Page 134
********************************************************** ***************
*
DIFFERENCES BETWEEN U.C.S.D.
PASCAL AND STANDARD PASCAL*
*
Section 2.2
*
********************************************************** ***************
Version
.r.
5
September 1978
This section is a summary and quick referrence guide which
notes the areas in which U.C.S.D. Pascal differs from the Standard
Pascal, and refers the user to the appropriate documents which explain
various 5$pects of U. C. S. D. Pascal. The Standard Pascal referred to by
this section is defined in PASCAL USER MANUAL AND REPORT (2nd edition)
by Kath 1 een .Jensen and Ni klaus Wi T'th (Spr i ng er"-Y'er lag, 1975 >.
Many of the differences lie in the area of FILES and I/O in
general.
It is recommended that the reader first concentrate upon· the
sections which describe the diffe~ences associated with the standard
procedures EOF, EOLN. READt WRITE, RESET, and REWRITE.
2.2.1
CASE STAiEMENTS
Jensen and Wirth on page 31,
state that if there is no label
equal to the value of the case statement selector,
the result of the
case statement is undeflned.
U.C.S.D. Pascal defines that if there is
no label matching the value of the case selector then the next
statement executed is the statement following the case statement.
For
example, the following sample program will only output the line "THAT'S
ALL FOLKS·! since the case statement will "fall through" to the WRITELN
statement following the case statement:
PROGRAM FALLTHROUGHJ
VAR CH: CHAR;
BE.GIN
CH:
=: '
A ';
CASE CH OF
. B": WR I TELN