Os-9 User Notes Volume 1

Transcription

Os-9 User Notes Volume 1
05-9 User Notes
Volume One
By: Peter C.
Copyright
9
Dibble
Peter C. Dibble and The Computer Publishing Center
Peter Dibble
05-9 User Notes Volume I
April 1985
ii
OS-9 User Notes Volume I
CONTENTS
Part 1:
Columns
I n troductions
3
5
5
Column O ne
Opening Remarks
IS
GIMIX-IlI 05-9
A Null Device
6
7
7
9
Documenta t io n for Nu l l Device Descriptor
Null P rogram
Column Two
. . . . .
05-9 Level Two VerS i on 1.1
Ge nera ting a New Boo t s t rap
Buil d i ng a New S y s tem Disk
Using Mu l t i p l e Prooe s s e s
. . . .
. . . . .
Co l umn Three
The FORK Super v i ser Serv i ce Request
Communica tions Via t ne Parameter Area
A s semb l y Language Procedures for FO RKing Processes
S tr t T a sk - O ne
Driver O n e
Co l umn. Four
B a s ic/Basic09
Interproc e s s Commu n i eat ion
Communic a tion v i a the Parameter Area
Dat a Modules
. . . .
Loek i ng D a t a Modules
Locker Program
Ca l c Program
Driver Program
C o l u m n Five
More Abou t Locking
Ge t t i ng a Good " M i x"
An A s sembly Language Program Which Se t s P r i n t er O p t i ons
Tne OS-9 User ' s Group
The Fut ure of th1s Co l umn
P Opt Program
. . . . . .
Co l umn S i x
. . . . . .
Ne w Release of M i croware P a sca l
05-9 Director i es
S tandard Term i na l Support for OS-9
. . . . . . . . . .
Co l umn Seven
. . . . . . . . . .
A Le t t er
Le t ter from Bengt-A l la n Bergva l l
Parammod
He 1 p_B
. . . .
Co l umn Eight
. . . .
The 0 5- 9 User Sem i na r
Shell Commands
A Log i cal Dev i ce Dr i ver
VelA Dev1ee Dr1ver
Co l umn Nine
. . . .
Protection
The "Suspend S t at e·
Co l umn Ten
. . . . . .
More Abou t Comput ers a t Schoo l
P i pe s
. . . . . . . .
A More Advanced ApproaCh t o Pipes
Ins talla t i on
. . . . . . .
Oper a t io n and Mod i f i ca t i on
Welcome COCO
The Users Group
BWord
CharC t
Grapher
Str t T a sk
R a st
Column Eleven -- The OS-51 1/0 System
The Un i f i ed Input/Ou tput Sys tem
Changing 05-9'5 D evi ce Support
Co l umn Twe l ve -- The CoCo
No'tl!! s 0" Compl.. serve
Thank You GIMIX
A Handy Shortcut
Co l umn Thirteen
B i g Sys t em Hardware
B i g Sys t em Software
The Campuserve 05-9 SIG
Contents
9
9
9
10
11
11
11
i1
13
14
15
15
15
15
16
16
1S
21
22
25
25
25
27
29
29
30
35
36
36
39
41
42
42
44
45
47
47
48
48
51
55
55
57
59
59
59
60
61
62
62
62
63
64
66
67
70
73
73
74
77
77
78
78
81
81
81
81
iii
OS- 9 on the Color Computer
I n s t a l la tion of Beep/Beeper
81
App1 ica t ions for
82
83
83
84
86
87
87
87
/Beep
The U s e r s Group
Sound
Beeper
Te s t Beep
Co l umn Fou r t ee n
Mor e ADout t he CoCo D i s k D river
Whe r e Nex t?
More Noise f r om t he CoCo
This Mon th's Driver
The Users G r oup
6eeper2
TBeep2
. . . .
Column Fif t een
The OS-9 Seminar
O F l ex
New Manua l s
C F unct ions
The Bu t terf l y
Dynaspell
A Nice Experience
Tricks f or L evel Two
TISt SSig
'.
FRexp
Modf
Co l umn Sixteen
S t anda r d s
S t andards t h a t a r e t h e User's Responsibili t y
The U s e r s G r oup
Column Seven t een -- The F i r s t S t ep I nto DS-9
Format
Backup
Oil'
Chx and Chd
Oops
Co l umn Eight een
My L i f e
No n-st andard Hardwa r e
Directo ries a s Files
O L 1 s t P rogram
D Li s t 2 Program
l d Program
DFormat Program
Co l u mn Nineteen
More Games with Directo ries
Dr Program
Di rSqz Program
. . . . . .
Part 2:
Revtews
.
.
A Rev1ew of D-F
. . . . . .
General Sys tem Description
Limi t a t ions
O pe r a t 1on
. . . . .
Eva l ua t i on
. . . . .
Summar y
. . . . .
Review of 05-9 CIS COB O L
Overview
Enhancement s
L 1m; t a t ions
Benchma rks
Summa r y
COBOL Tes t p r og r a m
COB O L Sieve
COBO L Benchmark progr a m
Review of So�tware by ClearDrook Sof t ware Group
DEdi t
. . . .
O"erview
Det ails
Limi t a t ions
Summar y
BT9
Overview
Details
L 1mi tat i ons
Summar y
O-Series U tiitties -- DO I R . D D E L . DCOPY a nd DATTR
Overv i ew
iv
OS-9 User Notes Volume I
82
89
8e
89
90
92
95
95
95
96
96
96
96
97
97
99
100
100
101
101
102
102
103
103
104
104
105
105
107
107
107
107
109
i10
111
112
113
113
115
118
118
121
121
121
121
121
122
123
123
123
124
125
125
126
128
129
131
131
131
131
131
131
131
131
1 3i
132
132
132
132
Detail s
P ro b l ems
S umm a r y
and
1 32
1 32
L i m i tations
1 33
Recons i de r a t i on
A Rev i ew of D y n a C a l c for 05-9
Overv i ew
Some D e t a i 1 s
L i m i t a tions a n d P r ob l e m s
Summ a r y
R ev i ew o f Dynam i t e
O v e r v i ew
Some D e t a i l s
Ope r a t ion
1 33
1 35
1 35
1 35
1 36
1 36
1 37
1 37
1 37
1 38
1 38
L i m i t a t i ons
Summ a r y
1 38
141
141
141
1 4 :2
1 4:2
1 45
1 45
1 45
1 46
1 46
1 47
1 47
A Rev i ew of R M S
Over view
S ome Det a i 1 s
Flaws
Summ a r y
Review of R M A a n d RL I NK
O v er v i ew
Some D e t a i l s
The Separ ate Assembly Facil i t y
Some I nte rna l s
L 1 m i t ations
Summa ry
Index .
.
.
.
.
.
149
FIGURES
1 .
E xecu t i on Sequ e nce for Lockout
25
:2 .
O u t put o f D I R Command
55
3 .
Samp l e Startup f i l e
56
4 .
Password F i l e E n t r y
57
5.
Samp l e
6.
Hex
7.
Oynacalc Terminal
8.
Samp l e R M S Defin i tion
141
9.
RMA
145
I nput f o r
dump of
r a s t p r o gra m
6:2
1 08
a dire c t or y
1 35
Support
Macro
TABLES
Def i n 1 t ions
:2 .
Dynam i t e Label Classes
137
3.
Dynam i t e Ad d ressing Modes
1 37
files
rout inely
in
1 .
included
.
assemblies
Contents
27
v
vi
05-9 User N o t e s Volume I
Part
1
COLUMNS
Columns
1
2
05-9 User Notes Volume
I
INTRODUCT I ONS
I
features
wished
for
the original column.
the
column,
but
when
I
was
preparing
The contents
the presentation
are from
Is
differ­
at the University of
Roches­
ent.
This
book
is
an
anthology
of
all
nave
written for 68 Micro Journal since I start­
ed writing the 05-9
User Notes column in
February 1 9 83.
Some errors in spelling and
grammar have
have
crept
forced
made.
ceen
in
to
removed
take
(1
I
tem.
mistakes that I
footnotes
have
ful.
their
myself to leave in
The
most
glaring
imagine others
The
place.).
but
pointing out the truth.
people
ter Computing Center deserve speCial thanks
for their help with this document.
This
book pushed some of the limits of the sys­
They
The
were
index
is
helter-skelter
This
document
was
prepared
using Water­
loo Script and a Xerox 9 700 Laser Printer.
This I et me add footnotes. figures. boxes,
and an index to the columns.
All the foot­
notes are additions I made whi 1e preparing
this
anthology.
The
figures
and
boxes
are
bearable.
always
Each
an
friendly
attempt
arrangement
month
I
and
to
of
write
the
help­
make
the
columns
about
what
my fancy.
Somet tmes
I
wr i te about
several things.
Columns written like that
don't combine
into
a
cohesive
book
very
well.
1 hope the index wi 1 1 guide you to
takes
the information you need wherever it hides.
Introduc t i on s
3
OS-9 User Notes Volume I
COLUMN ONE
use
t h at
po wer
to
�give
same poor ser vic e , ,but
one u ser
we 1 I
P I eased
s everal
OPEN I NG REMARKS
ThiS is t h e f ir s t of what I hope w i l l be a
l ong
s er i es
of
co l umns
about
05-9
L evel
Two .
I p l an on d i s c us s ing some int er es t in g
aspect
of
p r o g r amm i ng
in
eac h c o l umn .
I
al so int end to u s e t his as a soap box f o r
my r ad i c a I
ideas about comput i n g in hopes
of s t ir r i ng up some con t r over s y. My compu t ­
er was f i n an c ed l ar ge l y DY teach i ng compu t ­
e r science.
a f it
of
Please bear with me when I
have
t e ac hing.
F i r s t , by w ay of int roduct ion ,
work
as
a s y s t ems
p r og r ammer
on
a var i ety of
mach i n es .
I t e ac h compu t er science cou r s es
at a l oc al t ec hnic a l co l l eQe , and t ak e com­
put er sc i ence cours es at the l ocal univer­
I wor k ed my way up t o my j ob as a
s i ty .
sys t ems prog r ammer t h rough years of work on
payro l l ,
s tu d en t s ys t ems ,
and other b u s i­
ness p r o g r amming
t yp e t h ings
you
m i ght
say I paid my d u es . I got s t ar te d on micro­
compu t er s by bu i l d ing S WTPC's 6809 comput e r
kit.
I now o w n t wo mong r e l comput ers ,
one
smal 1 , running o n l y F L EX , and s e l dom u s ed ,
t h e o t h er
Iar g e and f requent Iy u s ed .
My
l ar g e compu t er
h as a GI MIX OMA disk con­
t ro l l er ,
and a GI MIX 6809 CPU boar d ,
two
eight inch disk d r i ves , 344K of u s ef u l mem­
ory ,
and asso r t ed
I / O boards.
I t can run
05-9 Level T wo or F LEX .
I have a c o l l ec t ion of s t rong opin i ons
about comput i ng in gener a l ,
and microcom­
put ing
in
par t icu l a r .
The
mo s t
r el evant
opin i o n i s t ha t I t hink t he s t agger ing s um
I spent to buy OS-9 Level T wo t ogether wit h
l anguages
and
u t il it i es
was
money
t hat
cou Id not have been be t t e r spent t hough I
do
wi sh
the
p r ic e s
we r e
l ower .
I
t hink
everyone shou l d get to wat ch t heir computer
s eem to come a l iv e ,
not j us t t ho s e p eop I e
who ar e w i I Iing to w o r k t wo j obS and 1 ive
on p as t a to save enough money . I be l ong t o
t h e schoo l
of
r ad ic a l s
who
bel ieve
t hat
B as i c is bad f o r your brain .
I l ik e Pas ­
cal ,
but f ind it
a l it t l e du l l .
Assemb l y
l anguage is l o t s of f u n , but s l ow going . I
am look ing f o rward t o ge t t ing C; it soundS
promis ing .
t h ink it
is
p r ac t ica l l y imm o r a l
to
f or c e even t wo peop l e t o a t t empt t o u s e a
6809
at
t h e s ame t im e .
T he f act
t hat
it
somet imes does a passab l e job w i t h s eve r a l
us ers i s not a s ig n t hat t here i s p l ent y of
power f or seve r a l user s . The 6809 o n l y runs
j u s t so f as t . No operat ing sys t em c an make
it
run
f as te r .
Digita l
Equipment
Cor p .
se ems to t h ink it s smal l VAX i s probab l y a
good s i ng l e user machin e .
I
have not iced
t h at t h e Xerox S t ar is ver y s l ow when it 'S
ed it ing .
B oth of
t hose c omput ers
can run
c irc Ies around any 6809 mach in e ( and cost
far more). Bot h of them run sof twar e w r it ­
ten b y t op qu al ity programmers . The dif f er ­
ence i s t h at t hOs e compu t e r s are expected
to
make
t h ings
as
easy
as
poss i b l e f or
t h e i r u s ers at any reasonab l e expen s e. Peo­
pl e
who
use
and
pr og r am
microcomput ers
don ' t
expect
t h at
much
out
of
thei r
mach i nes .
Our mach ines ar e m i crocompu t er s .
We e xpect
t hem
to
do
t h e s am e k inds
of
t hings
o t he r
m ic rocompu t ers
do.
Our
mac h i nes ar e smal l , but t h ey are part of a
new
generat i on.
T h ey
can do
t he w o r k
of
s ever al of l as t generat ion ' s micros . We can
som ewhat
s eve r a l
use r s
the
I wou l d r at her s ee
by a compu t er t han
d i s s at is f ied u s er s .
T h ere is some t r ul y exce l l ent sof t w ar e
avai l ab l e f or t h e 6809. I wou l d r at e M icro­
ware's Pascal as o n e of the best P as cal s I
have u s ed on any machine . A l ot of f eat u r es
ar e miss i ng f rom 05-9 Lev el
Two,
bu t what
is t h er e is up t o t h e highest st and ar d s and
it
shou l d be easy
to
add mos t
of
what 's
miss i ng .
F rom
my
r eading
of
t he m anual ,
B as ic09 s eems to be an exce I 1 e n t
l anguage
( as BaSic goes ) . I own 8 great deal of
sof t ware f o r F L E X and OS- 9 ,
but
I
can ' t
t h ink of any o t h er programs in t h at l e ague.
I am open t o sugges t ions . The chal l enge is
t o b e at l east �s good as any simil ar p ro ­
gr am on ANY MA CHI NE .
F o r examp l e ,
I wou l d
l ov e t o f ind an ed i t o r t h at qu al if i es .
My
l if e wou l d be much eas ier i f I cou l d r u n an
edit o r comparab l e t o .EMA CS ,
XEOI T , S PF , o r
S E D on my m i c r o .
DYNA CA LC seems ,
f rom it s
adver t is em ent s , to be as good as any of t h e
Visic l ones,
maybe t he best of
t hem .
I am
hol ding
a
grUdge
again s t
t ha t
p r o g r am
becaus e it on I y s uppo r t s 3000 ce I Is (under
05-9
Lev el
Two )
That ' s
as
good
as
m o st
Visic l ones,
but
I have enough memor y f o r
much mor e t han t h at . T h e chance t o b e t h e
f ir s t
spr ead
s h eet
program
to
suppor t
al most a megabyte of s to r ag e (maybe 30000
cel l s ) in memor y on a micro w as onl y a f ew
hu nd r ed ins t r uc t ions away ,
and t h ey didn ' t
do it . I wou I d l ik e t o propos e some p r o ­
gr a�ming chal l enges t o t h e 6809 communit y .
I have used spel l ing c hecker s t hat can
as k ed f or a l is t of sugge s t ions f or t h e
ape 1 Iing o f a qu es t: i o n ab l e word . T he good
ones w1 I I provide synonyms on demand t oo .
Oo i ng t h is at
a decent c l ip ,
a n d f i t t ing
t he d ic t ionary on a f l oppy disk shou l d be
an int erest ing c h all eng e .
be
I don ' t know of any h igh l ev e l l anguage
f o r t h e 6809 t hat can use mor e t ha n 64K
even
with
r es t r ict i on s .
No ,
I
t ak e
t ha t
back .
M ic r owar e ' s Pascal c an u s e a s o r t of
v ir t u a l
s t orage scheme t o dea l
with mo r e
t han 64K of COde, but t her e is n o easy way
t o u se more t h an 64K of da t a . Wha t I had in
mind was a l anguage t hat cou l d make u s e o f
extended addr es s ing . T h e r e ar e l o t s o f u s e­
ful
t r i ck s ,
p l aying
with
t he O A T ,
U Sing
sof t ware
int errupts
c l ever ly ,
or
Simp l y
r unn ing a 1 1 procedu res (subr ou t in es if you
l ike
t hat
term
bett e r )
as
FORKed
t as k s .
Minicomputers u s ed to be Iimited to a 64K
a ddres s space. Some of t he t r icks u s ed t o
f it big programs lnto t hem can probably be
adap t ed to our probl ems .
A
s t at e-o f - the-ar t
edit o r
wou l d go
a
l ong
w ay
toward
p romot ing
the
6809.
As
bas ic reQuiremen t s ,
s uch an ed i t or shou l d
b e a screen
ed i t or
capab l e of
us ing
any
avail abl e
memo r y .
It
shou l d
inc l ud e
the
abil i t y t o ed i t mu l t ip l e f il es of a r bitr ary
s ize
without
resort ing
to
the
"new·
or
" mo r e" k l udg e .
I t should
i nc l ud e t he b es t
of Wy l bu r ,
t o rs .
E MACS ,
a nd
t h e ot her
common
edi­
I f I s eem 8 l it t l e s h ril l
about s of t ­
w ar e ,
it
i s becau s e I see m y be l oved 6809
mach i n e being sQu eezed ou t by t he f l ood of
high qu al ity m i cr ocompu t ers on t he mark et .
From my point of v iew , t h e bes t f e at u r e of
t he 6809 i5 it s el egant archit ec t ur e. I t is
Column One
5
�o easy to program that it should be pull­
'ng ahead of the field with a flood Of
superb software. I see only a trickle.
GIMIX-III 05-9
Ok. now 1'1 I get off the soap box and
down to business. I am thinking of selling
both my computers. I positively lust after
the new GIMIX CPU board and "level Three"
system.
I l'
there
is
another
ope rat i ng
microcomputer en the market that does what
it does, I haven't heard of it. Large com­
puters such as IBM 370 architecture, and
large-DECs can cause attempts to write into
"protected
storage"
or
execute
inval fd
instructions to fal1.
Special code is exe­
cuted whenever a program attempts either of
these activities. Usually the program that
did it Is stopped.
Microcomputers don't do
that kind of thing_ The computer will do
something (maybe something ridiculous such
as "halt and catch fire") with any data its
program counter is pointed at.
This can
cause a faulty program to go out of control
In unpredictable ways. There is no way for
the
microprocessor
to
know
that
it
shouldn't write into some part of memory.
If you want you can wri te your name all
over the Bas lc09 ; nterpreter. The resul ts
of that kind of thing are disastrous, par­
ticularly if you are Sharing the interpret­
er w; th someone.
You just have to make
very sure programs you wri te never try to
execute.
or
WI" ite
'I nto
anythi ng
they
shouldn't. Of course that is just gOOd pro­
gramming.
The new board from GIMIX was desi gned
to work with 05-9. It i8 alleged to support
protected storage and to prevent invalid
operations
from
being
presented
to
the
microprocessor.
This
should
prevent
any
program from
Interfering with any other
program, even. 1n many cases. 1 tse1 f . For
those of you who try to support aeveral
users, if
you
use the new
GIMIX
hard/
software no user shOuld be able to cause
the system. or another u.er's program to
fail. Even people like me who don't share
time with anyone can gain a lot from this
kind of safety net. SametilleS when I am
debugging a program everything just comes
to a stop and 1 have to re-boot in order to
continue. It Is even worse when there Is a
long pause then the disk starts seeking. I
haven't had any data destroyed that way
yet, but I worry. This new hardware should
give everyone who can afford it a lot of
peace of mind.
GIMIX has also been able to
remove every trace Of the operating system
from each task's address space. Programs
can be run with up to 64K. The board and
accompanyi ng software have lots of other
features. but the other one that excites me
a lot 1s the memory-to-memory DMA. A lot of
time is spent moving data from one address
space to another in 05-9 Level Two. This
involves several operations for each byte
and slows I/O operations and other inter­
task communications down quite a lot. The
specia 1 hardware on this new CPU board can
move blocks of data at 2 cycles per byte.
At two megahert:z that comes to one miIlion
bytes per second. I understand that, all
th ings taken together. the new system runs
05-9 substantially faster than what I have
now. I want to find out for myself. If you
see an advertisement from me in the classi-
6
OS-9 User Notes Volume I
fied section you will know I brok� down and
got a new. faster, better 6809 computer.
A NULL DEVICE
One of the nicest features of 05-9
(both levels) is the relative ease with
wh I ch it can be adapted to new hardware.
For example.
there is a module included
with the operating system called ACIA which
is responsible for interfaCing the rest of
the system with ACIAs (AsynChronous Commu­
nications Interface Controllers, or serial
ports). There is another module called PIA
which
does
a
similar
job
for
parallel
ports. and another module which deals with
whatever type of disk controller you have more modules if you have more than one type
of disk control1er. If you feel the need
you can add more Device Drivers (the name
of this type of module) any t'1me you 1 ike.
If you want to write your own driver, it 1s
good to have an example to work from. The
source for AelA and PIA (available from
Microware) are both good starting places
though I found ACIA more useful.
There is a rather odd sort of device
which is available with most operating sys­
terns. but not 05-9. I have seen 1 t ca lIed
DUMMY and NULL. Thi5 device makes anything
WI" i tten to it disappear.
and returns an
endfile if it 1s read from. It is surpriS­
ing how often it 1s nice to have any easy
way to throw data away.
The Null Device Driver that I am going
to present here is a SCF (Sequent ia1 Char­
acter File) type device. The requirements
for this kind of driver are given in the
05-9
System Programmer's
Manual,
but in
general there are six entry pOints: Ini­
tialize device,
read.
write.
get device
status.
set device status. and terminate
the device. This driver 1s so simple that
of those six, five Just clear the carry bit
and return.
Read is the only operation
requiring more than two lines of code. Read
is supposed to return wi th the character
read in accumulator A. If an error takes
place, the carry bit should be turned on,
and the error code placed in accumulator B.
We want to return end-of-file, which is an
error, and I have found that Is a good idea
to return null (ChI"( 0»
as the character
read even if it is end-of-file. I return
the end-of-f l1e from the driver though it
is usually generated by the SCF file manag­
er. .I f you want to mod i fy the program such
that the fl1e manager is the module that
generate5 the end-of-file, load accumulator
/>. with the end-file character which can be
found in the path d escriptor (pointed to by
v) and return with carry clear.
A Device Driver may be used for aeveral
devices provided that they use the same
hardware.
Each
individual
device
is
described by a "Device Descriptor" which
includes everything unique to a particular
dev; ce such as the addres 5 of the dev ; ce .
The NI... device descriptor is at the bottom
of the program. It will be loaded into mem­
ory at the same time as the Driver although
it will show up as a separate module in the
module directory.
DOCUMENTAT I ON FOR NULL DEV I CE
DESCR I PTOR
type
I f the fi le Null is l oaded and the modvle
NL
is l1nked a new device called /NL 10'111
become available for 1nput and output.
059 Load Null
059 L i nk NL
The deviCe NL will
accept
input in any
quantity and simply make it disappear. If a
read is directed at 1t. it wi 1 1 reply <end
Of f i le > .
Other tnan eating data witnout a
sign
it
acts
11ke
a
perfectly
normal
device.,.
a
very
fast
and
efficient
one!
SCF
Examp l e:
OS9: a5m MyProg
0
#48k >/n i
&
Would
assemble MyProg
In
baCkground
and
make all its (non-error path) output disap­
pear.
Note:
Be
careful
when
using
/NL
for
input. Some programs (such as debug) d on't
respond to <End of F 1 1 e> - these programs
will
act
very
oddly
input device for
1f
them .
/NL
is
used
as
the
NULL PROGRAM
Hi croware 05-9 Assembler 2.1
08/05/84 22:40:30
Dummy I/O dr i ver - Def i n i t i ons
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00E1
0082
0000
D OOlD
D OOlD
OOOD
W
W
W
W
W
W
OOOE
0011
0012
0012
OOlS
0018
001B
001E
0021
NAM
Dummy I/O dr i ver
D e fin i t io ns
TTL
*------------------------------------------------------*
* Dummy
1July82 Pe t er D i bb l e *
* ret urn end of file to any read
*
* Put any output down the b i t bucket.
*
* No error returns
*
* Pub l ic Domain soft ware as of 19Feb83.
*
*------------------------------------------------------*
IFP1
use /DO/DEFS/Defslist
ENDC
DRIVR+OBJCT
Typ e
set
REENT+2
R evs
set
HOD
Dummyl ,DumNam, Typ e ,Revs , Ent ry,Memsi ze
87CD002E
V.SCF
l eave space for SeFman overhea
ORG
Hems i ze equ
fcb
READ.+WRITE.+EXEC. driver mode
07
TTL
Dummy' I/O Driver
fcs
/nmy7
DumNam
446DF9
Edi t i on number
feb
1
01
E n try
Ibra Init
16000F
Ibra Read
16000E
l bra Wri t e
160009
Ibra GetStat
160006
Ibra PutS t a t
160003
Ibn Term
160000
00029
00030
00031
00032
00033
00034
00035
0024
0024
0024
0024
0024
0024 SF
0025 39
Init
Write
GetStat
Put S t a t
Term
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
0026
0026
0027
0028
002A
002B
002E
Read
oon
0000
OOOD
OOOE
0011
0013
0015
0018
0018
OOIE
Page 001
elrb
rts
zero return code
Do no thing
clra
set carry flag
comb
return end of f i le
l db
#E$EOF
return
rts
emod
*
Dummy1
egu
TTL
Deviee Desc r i p t or
*----------------------------------------------------*
*
* NL deviee descriptor
*--------------------------------------------_._-----*
DEVIC+OBJCT
Type
set
DDend,DDNam,Type�Revs,FMNam.DRVNam
mod
87CD001E
feb
READ. +WRITE. +EXEL. modes
07
PORT ADDRESS OF 0
$Ff,O�O
fcb
FFOOOO
Options
l,DT.�CF
feb
0100
DDNam
fcs
/NL/
device name
4ECC
FHNam
fes
/SCF/
F il e Manag er Name
5343C6
DRVNam
fes
/Dmy/
446Df9
emod
BD5979
*
equ
DDend
4F
53
C6D3
39
848D35
Column One
7
8
05-9 User Notes Volume I
COLUMN TWO
bootstrap
thing.
just
installed
OS-9
Level
Two
Finally
it's
not
"prel iminary·
any
Since OS-9 never was very unreliable
able,
but it
it 1s hard to tell whether it is more reli­
is
program.
data
day
It
or
1
very
pr intel
1
appreciate
spent months writing
execut ion
maybe
easy to
the
name
of
di rtlctory.
could
sell
that
the
the
a PWD
some­
program.
Well,
it,
a
command
called
about
IDENT
modules
which
fil.
to
S-Record
checks
and
from
format.
disk
correctly,
Motorola
DCHECK,
structure,
and
DSAVE,
the
now
a
the
messages,
wasn't
An
important new
support for XON/XOFF.
set
which
match
the
WhiCh dem't
characters,
speed
at
be
it,·
deal
it"
able
and
with
to
tell
the
computer
whiCh
to
-hold
go ahead."
If the computer can
XOn/XOff protocol. it 101111 "hold
•
whenever
it
rece i ves
an
XOff.
and
•
go
ahead"
whenever it r.ce i ves an XOn.
There
are
quite
a
few
terminals
and
printers
around whiCh run much better when they are
attached to a computer which supports XDn/
XOff.
It
;5
Interest ing to note that XOff
(often called
and XOn (DC1)
this
protocol
DC3) is entered as <CTRL>S.
i IS <CTRL>Q.
In order to use
you've
acter
other
than
"Quit"
character.
got to find some char­
<CTRL>Q
to
use
as
the
I
wonder
whether
Frank
Hogg is going to be able to adjust DynaStar
so it can live without <CTRL>Q and <CTRL>S.
of
the
version
strap.
of
first
OS-9
There
is
the
bootstrap
but
I
have
Drivers.
probably
and
thing!:.
Is
own
even
would
do
with
a
put together a new
nothing
that
my
I
really
comes
with
Device
if
want
I
to
with
system,
Descriptors
didn't
new
boot­
wrong
the
the
Say
to
you
the
put
bootstrap
a
file
they
other
P-Code
when
you
a utilities fl1e and load it using a
command in the startup file. Since my
allocates
memory
in
blocks
of
4K.
hunks.
the
should
be
.12e
of
the
group
of
programs
chang.d to ref1ect the new con­
Users of Level One flystems don't
any Of this stuff.
generated a new boot­
bit intimideting. It is
I
important to realize that, provided you are
choco 1ate
margina 11y careful
(don't IIpi 11
milk on an important diflk • • tc.). to. worst
you can dO is waste your time. If you don't
have II lot of memory the chance to remove
unused
device
descriptors from the
boot­
strap may be worth the troub1e Involved in
running
OS9GEN.
instance),
�...ou want to
If
mOduleS
which
(addr.....
in
chenge
any
are
In
the
bootstrap
Oevice
Descriptors
for
the
cleanest way
to
do
it
i.
to
mOdify them them with DEBUG, save the modi­
fied modules.
fix
their CRC
with VERIFY,
and build a new bootstrap with the modified
modules. A module must be saved on disk in
Order to be Included in the bootstrap.
You
should use the SAVE Icommand to crellte files
containing each module you might want in
the new bootstrap.
Build a file with the
names
into
of
those
the
new
f11es
you
bootstrap.
of f nes as input to
OCOPY to copy II 11 the
want
end
to
use
combine
that
list
OS9GEN,
F 1na11 y use
other file. on your
system disk over to the new one.
BUILDJRGA HEW SYSTEM DISK
I have many file. on my system disk that
are not part of the 0$-9 oPerating system.
An Important part of installing a new ver­
GENERA�lNG A NEW BOOTSTRAP
One
in
the boot
storage,
attached
boot.
The first time
strap was a little
the terminal
can receive.
In
general you
can't do that,
but often it is sufficient
to
the
straints,
have to worry about
terminal which usually runs at 19.2KB. bUt
can only accept input at about 200 charac­
t .rs per second When it Is In Insert mode.
it would be nice to be able to constant1y
adjust the speed at which the computer Is
to
permanently
in
in
in
use
m.mory
more
efficiently,
essentially
keepi ng two or more programs 1 n the space
normally allocated 'to one.
If your version
of 05-9 allocates memory in different sized
but still
have
defined meanings.
XON and
XOFF
are
among
the
more
useful of the.e
special codes.
If, for instance, you have a
transmitting
it!
Modules
permanent1 y
small programs l1ke COpy and PWD only wa ste
memory if they are loaded by themselves. By
collecting grou!:lS of !:lrograms together you
feature
in
05-9
is
The ASCII character
space
(S08) and escape ($18)
generally
r epreeent· printable
also
system
32 .pecial codes such as back­
includes
are
into
LOAD
work
dist I' i bution
my
are
memory with COPY.
The best way to handle
commonly
used
commands
is
to
merge
just
less than some small multiple of 4K of them
whiCh
to
command
on
the
command such as COpy. you may find that you
can only use a relatively small amount of
file
constructs a procedure fi1e to copy groups
of files,
has been substantially enhanced,
but Level
Two users will have to continue
to live with numeric error messages. A com­
mand called PRINTERR, which is supposed to
instruct the operating system to use text
.rror
disk.
of
bootstrap
expect to link to Should not be included in
the
bootstrap.
If
you
include
ill
utility
standard
program
seems
the
with it. If you have a 4SK bootstrap you
would only be able to run programs which
use
you
up
to
about
12K
total.
ModuleS
comparison utility called CNP, and two com­
mands called BINEX and EXBIN which convert
a
principle
in
link to that module in order to use it, you
drag everything else in the bootstrap along
displays
fi185,
in
Don't do
not on 1 y
interpreter
Microware beat me to it.
The new versions
of OS-9 include PWD and PXD. Print Working
Directory
and
Print
eXecution
Directory.
They
also
a dded
a
DELDIR
command
which
deletes a directory witr. all the files in
information
ry.
are
programs
current
hoped
1
the
made permanent. It sounds as though, if you
have enough memory, it would be a good idea
to include in the bootstrap f1le all the
modules you would like permanently in memo­
Version
1.1.
more.
new utilities.
on
modules
automatically
loaded
when
the
system
is
booted. packed efficiently into memory. and
OS-9 LEVEL TWO VERSION 1.1
1
just
The
need
and
to.
re-generate
I
the
s10n
of
OS-9
manua Is
you
15
need
onto
d1scovered
ine
mo.t
Which
an
of
mentioned
the
new
system
way
to do
you
about
year
I
disk.
this.
OS-9
users
wish
someone
ago.
By
in
non-05-9
your
but
I!I
not
a11
easy
this trick.
it
is
copyi ng
I
running
have
I 1mag­
already
had
the
f il es
know
told
me
DSAVE
on
Column Two
9
your
old
system
�ontai 1"11 ng
a
disk
copy
you
can
command
create
for
each
a
of
fi le
the
files
on your old system disk. If you add a
as one of the first few lines in that
f i 1e
, t won't quit if one of t he commands
fa,'s. The copy commands for files that are
already on the new disk will fail. but the
procedure w,ll precede to the next command
instead of quitting.
The result is a disk
with all the files you want on it.
'-x"
USING MULTIPLE
PROCES S E S
Most o f the programming I d o is o n machines
with far more than 64K available to each
program.
It is easy to get used to hav i ng
effectively unlimited memory. The 6809 can
only use 64K,
but with the help of
OS-9
Level Two (not Level One) it is possible to
more
memory
than
most
people
can
use
afford.
Over the next few months
I expect
to spend some time discussing various ways
of do,ng this.
One
of the
basiC
facilities in
05-9
(ano
most
other
sophisticated
operating
systems) is called FORK
The effect of �ORK
is to set a program up and start it running
w,thout interfering with the program which
FORKed ,t. Each FORKed program is called a
Process or a Task.
A process can run for
all practical purposes at the same time as
the program that FORKed it. Pa�t of setting
a process up is f I ndl ng e,",ough memory for
It
to
run. In OS-9 Leve 1 Two each process
runs ,n its own "address space" ... that is.
no user process shares any memory 101 ith any
other process except by speCial arrange­
r.lent,
I f you have enough memory. each pro­
can occupy
all of
its 64K
address
cess
space except a shred reserved for OS-9.
have been
spending a lot of
time
wr·tin9 a program
whiCh 1
call a
"smart
terminal" program. It started out as a pro­
gram
to allow me
to
communicate
with
a
variety
of
computers
without
having
to
unhook my terminal from my computer.
and
fuss with half/full duplex.
It just keeps
grow,ng.
One
thing
I
decided
to
do
was
include a way of prInting a screen full of
data.
You can't just stop everything and
it would take so long to
print the screen;
print that the input buffer from the modem
would overfloW. and at best data would be
lost. A solution is to use a FORKed prOcess
to print the screen, Once I realized that I
could start a process to print the screen,
carried
it
a
step
farther and
1
fixed
things so I can ask to have lots of screens
prtnteo.
start a process for each screen.
and 1 et them queue up for a chance at the
pr Inter whi 1 e the process do; ng the smert
terminal
bit
runs
along.
At
p heerfully
about 4K per process
(the minimum alloca­
tion on my Level Two system) I can Queue up
about 20 screens in the 200K ! usually have
available. Using the more efficient alloca­
tion of storage available under Level One I
could
probably
have
queued
up
about
10
I admit this is a
screens in a 56K system.
trivial
example
of
the
use
of
extended
storage.
but the point is that this
Is a
simple example of the kind of thing you can
do \>lith extended storage.
It is easiest to
The
module
is reentrant.
so
only
the
variable storage needs to be allocated
for each process beyond the first.
10
OS-9 User Notes Volume
I
use
mul t iple
storage
can run
processes
wnen you ca'i
1n isolat10n
to
get
at
lots
of
sp i n off a task that
Commun,catlng between
processes is a harder prOblem than runn,ng
them in isolat,on.
Several method for com­
munication WIll be developed In later col­
umns.
COLUMN THREE
by�va1ue
THE FORK SUPERVISER SERVICE
REQUEST
A large number of the exciting things that
can be
done with 05-9 involve processes
Every program running under 05-9 is a pro­
cess.
Each process runs as if it had the
machine to itself (except for speed).
When
a new process is start ed,
05-9 loads the
Program
module for
the
process
if
1t
lsn't
already in core, creates a Process Descrip­
tor for it. allocates the necessary amount
of memory, gives it standard input and out­
put fi 1 es.
and
lets the new process go.
One of the ongo i ng tasks of the operating
5ystem i5 to divide proce5sor time between
all processes 80 that the system's resourc­
es are used as efficiently as poSSible, and
all
the
processes
run
without
too
many
noticeable
jerks.
You
can
tell 05-9 to
favor a process by giving it iii high priori­
ty
(with the
SETPR command),
or you can
give a process a low priority if you don't
much care how quickly it runs.
A new process is created wlth the 05-9
service
request
F$Fork.
Before
iSSUing
this service request you must eet up the
registers as fol lows:
x
y
u
A
8
Address
of
the
name of
the
Module you want to FORK or tne
file that contains the mOdule.
ThB
area
size
of
tne
parameter
The beginning address
f:!arameter area.
parameter
Changes
don't
get
back to the invok i ng process.
5t i 11.
for
many jobs, the one time, one way communica­
tion afforded by the parameter area is suf­
fiCient.
of
the
The Language/Type code.
That
is,
the
type
of moaule
you
want to fork.
BaslcOS has to
be
treated
differently
from
object code.
The amount of optional storage
to give the new process.
COMMUNICATIONS VIA THE PARAMETER
AREA
When the FORI< Service reCluest is used to
start a new process 05-9 is able to send a
block of data to the new process using the
parameter area.
The new process wi 11 be
started with X f:!olntlng to the start of a
copy of the parameter area and 0 contalnlng
the length of the parameter area.
In lan­
guages other than assemb 1er. the parameter
area can be found by noting that the param­
eter
area
is
the
place
where
the
shell
places the command
11 ne parameters for a
program. The she 11 usual 1y starts programs
by FORKing them, so in any language, if you
can get to the command line parameters, you
can get at parameters passed through Fork
in the same way.
By uslng the
parameter area you
can
pass a lot 01 information to a new process,
but you can't get anything baCk through the
parameter area.
R emember that the parame­
ter area gets copled into the new process's
address space.
It is like a Pascal pass-
ASSEMBLY LANGUAGE PROCEDURES FOR
FORKING PROCESSES
Neither 6aslc09 nor Pascal has
essary functions for dealing
all the nec­
with
forked
processes, but they can be reached through
assemb1 y
subrOut i nes .
I
have
1 anguage
included two short assembly language sub­
routines which should he1f:!.
StrtTask. and
Wa 1 tTask
are
meant
to
be
called
from
Bas 1 c09. though modifled versions Cou1 d be
called from Pascal or any other normal lan­
guage.
StrtTask starts execution of a pro­
cess, and WaitTask wa its unt 11 a ch 11 d of
the
calling
proce5s
completes
before
returning
to
the
caller.
These
aren't
examples of elegant coding.
but they are
good
enough
to
play
around
with
from
Bas ic09.
The Basi c09 programs Or iver. and
BTest
are
respectively
a driver
for the
assembly language modules and a stub for
teSting them.
a
StrtTask
is
an
interface
between
Basic09 program and the 05-9 Fork service
request.
Normally. a fork is done with the
SHELL
statement
in
8asic09.
By
using
StrtTask Instead of SHELL to start ·child"
processes,
a program can gain better con­
trol of the parameters.
StrtTask allows
full control of the F'fork system service
rBQuest.
The
first
parameter
which
StrtTask
expects
il5 the name of the Module to be
started.
It Should be passed as a charac­
ter string with a terminator.
such as a
space or carriage return,
after the last
character of the module name.
If the mod�
ule might not be in memory. the name of the
file which should be loaded to get the Mod­
ule should be the first parameter instead
of just the module's name.
The FSFork Sys­
tem service reQuest description in the OS-9
System Programmer's Manual ha5 more details
about thiS,
and all the other para.meters
for StrtTask,
The
second
parameter
Is
the
process
number of the new task.
It is a byte field
which need not be initialized.
StrtTa.k
will place the process nuMber of the newly
started process in this byte.
This is t he
only
parameter
which
is
returned
from
5trtTask.
The process number is useful if
you want to communicate w ith the new pro­
cess, or to wait for a particu lar process
to complete.
The third
parameter
is
the
language/
type byte whleh deseribes the 1II 0du 1 e you
The easi­
want to !"Un as a child process.
eSt way to discover the prOf:ler va 1 ue for
this byte is by checking
tne 1II 0dule you
want to fork.
You can ISee tne 1 anguage/
type byte for a module by loading it and
doing a MOIR E command. or by dOing a IDENT
command
on
the
file
the
module
is
in.
Remember that this
byte
is displayed in
hex.
Object code programs (generated from
assembly
language)
generally
have
a
language/type byte of 'ii, or deCiMal 17.
Column Three
11
The fourth and fifth parameters are the
'ength of the parameter area to be passed
the forked process.
and the parameter
',0
'I rea itse 1 f ,
The paramet.er area can be any
':ype of data you want to pass to the new
process.
The 1 ength of the parameter area
is
passed as an integer.
If you j nvoke a
module which 1s usually started from the
she" , the parameters should be a character
string terminated with a carriage return.
I f you want to invoke a modu 1 e wh i ch runs
under Basic09. it is particularly important
t.o include the carriage return at the end
of the parameter area (which contains the
name of the Basic09
I-code module to run
and any parameters for it).
Strange things
happen if you don't.
last
parameter
is
the amount
of
The
optional storage space you want to g1ve the
new process.
Th1s
1s the number usually
placed after the
"/I"
on a shell
command
1 i ne.
The number can range from zero to
255 (it is a byte field), and may only be
in units Of pages, not Kbytes.
If the fork serv1ce request itself gets
a bad return code. it 1011 1 1
be returned to
the calling program as an error.
In gener­
al the new process 1011 1 1
still be running
when StrtTask returns to the cal" ng pro­
gram, so t.here 1S no way to know what the
completion
code
of
the
new
process
is
(going to be).
Sometimes you may want to start a pro­
cess going and continue without waiting for
the new process to complete.
but you may
need to wait for 1t to complete at some
point.
Th1s is where WaitTask comes in.
WaitTask w1 1 1
wait (just sit there) until
one of its ch1 1 dren (a ch1 1 d of the program
that called WaitTask) cOlllpletes.
If there
are several children, the first one to com­
plete will let Wa;tTask return to its call­
er.
If
there are
no
Children,
WaltTask
If a child pro­
will return with an error.
cess terminates before it is waited for,
load StrtTask and WaitTask
load
Strtiask
or if you are still in Basic09
$load Strtiask
Type in
program)
Dr;ver
{the
bas1c
driver
run Driver
There are a lot of ;nterest1 ng thi ngs
that can be done with these modules.
You
can fork any program you want,
not
just
packed
Baslc09
modules,
but
the
speCial
features of the shell, such as I/O r
irec­
tion.
aren't provided by
StrtTask.
You
don't need to lola; t for the new process to
complete,
but if the new process does I/O
to standard paths. it can be very hard to
tell what ilS going on on the screen.
If
you haven't made a mistake that causes sev­
eral processes to use the terminal for I/O
at the same time yet,
you should.
It is
educat.ional.
�
The thing about new processes that par­
ticularly excites me is that under
Level
Two each new process gets a new address
space with up
to 64K.
The rnain prob 1 em
with the modules 1ncluded with this column
is that there is only One-lola)' communicat10n
with forked processes.
The parameter area
goes from the parent to the child, but the
child only sends a completion code baCk to
the parent.
There are easier ways to com­
municate.
We'll get to them later.
its process descriptor w1 1 1
linger around
in
memory
until
a
wait
18 done by the
parent process.
WaitTask has two parameters,
both of
which
are
set
by
WaitTask.
The
first
parameter Is a byte conta;n1ng the process
number of the procesS whose completion let
Wai tTask return.
The second parameter 1 IS
the completion code of that process.
If
there are several children that might ter­
minate, the process number parameter can be
used to cause the cal 1 1 ng program to keep
ca 1 1 ; ng Wa 1 tTask unt 1 1
the necessary pro­
cess completes.
To
use
this
(StrtTask, WaitTask.
package
of
modules
Driver. and BTest):
Assemble a
file
and WaitTask
asm StrtTask
containing
StrtTask
0 #24k
Save the paCked form of BTest
BASIC09
in BTest
save
paCk
12
OS-9 User Notes Volume I
2
A version of StrtTask with
p1pes appears in Column Ten.
support
for
STRTTASK-ONE
ttl Start a subtas k (called from Bas i c09)
nam S t r t Task
* --------------------- -------------------------------- *
*
*
StrtTask i s a sub r ou t i ne for Bas i c09.
*
*
Start a named modu l e as a subtas k .
*
*
Let the new task run asynchronous l y.
*
*
r eturn the new tasks pro cess number, and the
*
*
cond i t i on code f rom the Fork.
*
*
Ca l l i ng sequence :
*
*
run StrtTask (Name , Process Num, Lang Type,
*
*
Param L , Param , Opt s i ze)
*
*
Name is any l eng th,-but has a va l Id termi nator
*
(h i gh b i t set on last byte, or delim i ter after it) *
*
*
*
P r o c ess Num byte fie l d, p r o cess number o f new task . *
*
*
Lang Type byte f i eld, l anguage/ t ype byte f o r
*
*
f orKed module .
*
*
Param Lt integer f i eld, l ength of par ameter area.
*
*
Param- f le l d o f any type, parameter area t o b e
*
*
pa s s ed t o forked proces s .
*
*
Opt S i ze byte f i e l d, opt i ona l data area s i ze in
*
*
pages.
*
*
P r o c ess Num, and Return C ode are a ltered by
*
*
StrtTask no other parameters are.
* ------------------- -- ------------------------- ------ *
IFPl
use /HO/DEFS/defs l ist
ENDC
Type set SBRTN+OBJCT
Rev s set REENT+l
mod TLen , S trtTask , Type,Revs,SEntry,O
StrtTa s k f c s / StrtTasi/
f cb I version
S Entr y
l dd 1 S get param c ount
cm p d
are there 6 p arams ?
b ne BadE x i t no; l eave now.
ldx
S a dreSS of mod u l e name
l dy
i6,5
l ength o f parameters
Ida
12 , 5 type o f module to invoke
24�S
optiona l da t a area s i ze
l db
pOlnter to parameters
ldu 20,�
059 F$Fork start the new process
b c s aadEfi t2
save new process number
sta LB,S
c l rb c l ear carry
r t s return
BadE x i t
coma set carry
BadE x i t2
r t s r eturn
EMOD
TLen equ *
t t l Wa i t for a (chi l d) process to compl ete
nam Wa i tTa s k
,
1 j
#6
Column Three
13
*
-------- ------------ - - - - -- ------- - - - - - - - - ---- - - - - - - *
*
• --- W
a i tT a s k i s a subrout i ne f or Basi c 09
�
*
Wa i t for the a c h i l d p r oc ess t o c ompl ete .
-
Re t u rn the p r o ces s I D o f the pro ces s that c omp l eted·
*
in p ar ameter one .
*
Return the c ompet i on c ode o f the process
*
*
in parameter two .
*
*
Th i s sub r outine wi l l wa it using no CPU t i me unt i l
•
*
a chi l d pro cess c omp l etes .
*
*
I f a ch i l d c omp l eteo j us t bef ore Wa i tTask wa s
*
*
c a l l ed , i t wi l l ret urn a l mo s t i mmed i at l y .
*
I f t here are no chi l dren , an error wi l l be returned *
*
*
wi th a pro ces s number o f O.
*
*
C a l l i ng s equen ce :
*
*
RUN W a i tTask (Process No , Comp C ode)
*
*
b o t h process no and C omp Code are BYTE var iab l es .
*
*
---------------=-----------=-------------------------Type set SBRTN+OB JCT
Revs set REENT+ I
mod WLen z Wai tTask , Type , Revs , WEntry , O
Wai tTask t c S /Wa i t TasK/
f c b 1 edi t i on
WEn try'
c l r [425] zero the process I D
l dd 2 � param . count
1 f not exac t l y 2 param s then
cmpd
bne WBEx it2 the caller i s mak i ng a b ad m i s t ake
OS9 F$W a i t wa i t f or a chi l d
t
sta 4 , 5 return the p r o c ess I D
stb
8 , 5 return the c omp l et i on c ode
rts return
WSE x i t2
c oma s et c a r ry
WBEx i t
rts return
*
*
#2
bcs [SEXj"
EHOD
WLen equ *
end
DR I VER ONE
DIHIH
DD!:Hs��::;:�����if�;�;�T��k-�hi�h-�ill-f�;k-�h:-���:d--------:1
PROCEDURE Dr i ver
DIH process No , Comp C ode , Opt S i ze , Lang Type : BYTE
Parm L : TNTEGER name:5TR I NG
*
* modu l e , p a s sing i t the p ar ameter s tr i ng in Parms .
*
*
---------------------------- --------- ---- --------- --n amez " Basi c09 "
pro cess No"O
Opt 5 i ze=O
Lang Type- $ l l \ ( * a t tr i butes of f orked modu l e (object code , p rogram)
Parms" " BTest "+CHR$ ( 1 3 ) \ ( * The parms must end w i t h <CR> f or BaS 1 c09
Parm L-LEN (Parms) \ ( * The length of the parameters must be correc t
{* (* Ca l l assemb l er subrout i nes t o Fork and wa i t f or the started
(* pro cess
-
tUN S t r t Task (name , pro cess N o , Lang Typ e , Parm L , Parms , Opt S i ze)
tUN Wa i t Ta sk (proces s -No , COmp-Code)
y*
� * Acknowl edge t h a t everyth i ng i s done
;*
R INT "Forked task c omple t e "
PR I NT "Comp l et i on code f or proces s " ; process_No ;
�
P
14
OS - 9 User Notes Vol ume I
" was It ; Comp_Code
COLUMN FOUR
s y s tems
wh i ch
ca l l
spawns
t he
oper a t i on
a
new
proc e s s
FORK .
BAS I C/BAS I C 0 9
A mon t h ago I
i ns t a l l ed Bas i c09 on my
mach i ne .
r have been p r oud of no t ha v i ng a
B a s i c on my compu t e r , bu t OF ( An O S - 9/ F l ex
requ i r e s B a s i c09 , so r swa1 copy p r ogram )
I have
l owed my p r i de a nd i n s ta l l ed Bas i c .
spent t oo many hou r s br eak ; ng s t uden t s of
t he bad hab i t s t hey l ea r ned i n e l eme n t a ry
compu t i ng
cou r s e s
t aug ht
u s i ng
Bas i c
to
have a n y a f f e c t i on
at
al l
f or t ha t
l an ­
guage ,
but I
t h i nk
I c ou l d l ea r n t o l ove
� a s i c09 .
It
is
ab l e
to
masquerade
as
Bas i c ,
bu t
it
f ee l s
j us t
l i ke
a
modern
s t ruc t u red p r og ramm i ng 1 anguage to me .
I
am
su re
t ha t
t he r e
were
va l i d
marke t i ng
reasons f o r i nc l ud i ng " ba s i c "
i n t he name
of Ba s i c09 ,
bu t
w i s h t hey had named i t
Advanced P r ogramm i ng Language o r some t h i ng ;
I wou l d f ee l much more comf o r t ab l e l ea r n i ng
to l ove t he l anguage i f i t had a d i f f e rent
name .
I NTERPROCESS COMMUNICATION
Las t
Co l umn
prom i sed
to
cont i nue
w r e s t l i ng w i t h t he prob l em o f commun i ca t i on
be t ween proce s s e s
Wr i t i ng aoout pro­
cesses
w i t hout
US i ng
t echn i ca l
t e rms
is
ge t t i ng t o be t oo much f o r me .
I am go i ng
to g i ve
l oose def i n i t i ons of
some of
t he
i mpo r t an t t erms here .
Process
or
Ta.k
A modu l e ( P rogram , subrou t i ne ,
or whateve r ) wh i ch t he ope r ­
a t i ng
s y s t em
v i ews
as
an
i ndependent p i ece o f wo r k .
A
i s usua 1 1 Y a process
program
t hough some t , mes a program i s
d i v i de d i n t o several proces s ­
es .
Concurrent p�••••
S t r i ct l y
speak i ng
concur rent
processes must ac tual l y run a t
t he same t i me .
Th i s requ i res
a separa t e proce s so r
for each
proces s .
The
t e rm
is
some­
t i mes l oose l y app l i ed to pro­
cesses ( l i ke 0 5 - 9 ' s ) that are
ac tua l l y u s i ng one processor
i n t u r ns , but seem to be run­
n i ng at t he same t i me .
D i spatch
G i ve a p r ocess access
to t he
The
opera t i ng
proces s o r .
s y s t em
wi11
d i spatch
each
act i ve process i n t u r n .
Onl y
one process can be r unn i ng a t
any
t i me ,
so
t he
operat i ng
s y s tem
mu s t
have
a
way
of
i nt er rupt i ng a process as wel l
as d i spa t Ch i ng i t .
SchedU l e
C l ose l y
rel ated
I f t he operat i n9
any i nt e l l i gence
process
wh i ch
nex t ,
it
can
schedu l e t hem .
Spawn
to d i spat c h .
s y s t em shows
a t a l l about
to
d i spatc�
be
sa i d
to
Crea t e a new pr oces s .
Th i s i s
a more gene ra l t e rm t han FORK
because
no t
al l
operat i ng
Parent/Chi l d
T h e process t ha t spawns a new
proce s s
i s ca l l ed t he Parent
( u sed to be f a t her ) of t he new
proces s .
The new process
is
sa i d t o be the ch i l d ( u sed t o
b e son ) Of t he proces s wh i c h
spawned
it.
T he f am i l y t ree
ana l ogy can be t a ken as f a r a s
you 1 i ke ;
proce s s e s c a n have
s i b l i ng s ,
ances t o r s ,
descen ­
da n t s . . .
Asynchronous
Not
depend i ng
c l ock .
on
t he
same
Don ' t
t ak e
t hese
def i n i t i ons
as
gospe l .
T hey a r e supe r f i c i a l - - bare l y enough to be
usef u l i n t he cont e x t Of . t h i s co l umn .
COMMUN I CAT I ON VIA THE PARAMETER
AREA
P a s s I n9 a parame ter a rea t o a
FORKED
process
i s S i mp l e ,
b u t o f l i m i t ed u s e f u l ­
nes s .
The 1 i m i t a t i o ns a s s oc i a t ed w i t h com­
mun i ca t i on w i t h processes v i a t he parame t e r
a rea are t ha t t he commun i ca t i on i s genera l ­
l y one way , a nd t ha t , s i nce a copy o f t he
parame t e r area i s made f or t he new proce s s ,
parame t e r a re a s w i l l
use
a
l ot
of
l arge
memor y , and i ncrease t he l ength of t i me t he
FORK
opera t i on
takes .
Under
05-9
Leve l
One .
al l
proces se s
shl!lre one
64K add r e s s
space a l ong w i t h a l l
the assor t ed s y s tem
ov er head
( 05-9
i t se l f ,
III8IIIO ry mapped I / O ,
etc ) .
Spawn i ng I!l new process w i t h a 201<
parame t e r area w i 1 1 cos t 401< j u s t for t he
parame t e r a rea
( 201< f or the o r i g i na l
and
201< for t he new process ' s copy ) .
That k i nd
of
t h i ng can chew up a l ot of
memory
in
Sho r t o r de r .
W 1 t h Leve l
Two ,
t he memory
prob l em i sn ' t so i mpor tant , but , u n l ess you
have the G i m 1 x I I I vers i on of 0 5 - 9 ,
it
is
t i me consum i ng
t o copy a
1 arge parame t e r
a rea i n t o a new addre s s space .
Some
of
t he
characte r i s t i c s
of
t he
pl!lrame t e r
a rea
ml!lke
it
poss i b l e
for
new
f am i l i es
of
bugs
to
creep
i nt o
programs
t ha t use them f or i nt er -process commun i ca ­
t i ons .
Under OS - 9 Leve l Two , each new p r o ­
c e s s get s i t s own address space .
Thera i s
no
s i gn
of
any
o t he r
process
in
t ha t
addresS space except a copy o f t he parame­
ter
aree. pas sed f rom the pl!lrent
proces s .
I f t he parame t e r area i nc l udes any address­
es ,
t hey w 1 1 1
be po i nt i ng t o p l aces t ha t
wer e
s i gn i f i cant
in
t he parent ' s
address
space .
I n the new pr ocess ' s address space
t hose
addresses
may
be empty
or
con t a i n
some t h i ng
unexpec t ed .
The
t r i ck y
t h i ng
about
this
is
t ha t ,
under
Leve l
One ,
addresses
i l'l t he par ameter area a re mel!l n ­
i ngf u l .
S i nce
t here
i s on l y one add ress
space ,
t he addr es s es
j u s t reach out
i nto
t he paren t ' 5
memory and grab .
or change .
t he dl!l t a t he pl!lrent po i nt ed them a t . Be i ng
a b l e to read and Change dat a i n t he parent
proce$s ' S memory i s a m i xed b l es s i ng .
Let ' s say you want t o pr i n t
t he con­
t e n t s Of an a r ray w i t hout s t opp i ng t o wa i t
A very good way t o do
f or
the pr i n t er ,
t h i s i s to spawn I!l t a sk to do i t .
I f you
pa s s t he a r ra y t o t he new task a s a parame-
C o l umn F o u r
15
ter ,
if
eve !" y t h i n g
t he
array
memo r y .
on l y
If
t he
wi 1 1
you
be
t hat
wh i l e
f i ne
you
con s e r ve
of
f i ne
the
except
may
run
memo r y
of
changes
ar ray
Level
(e.g
.
One )
by
•
pro­
t he
t he
s t a r t i ng
to w o r k on new da t a ) t h e c h i l d w i l l
changes ,
and pr i nt
a n a r ra y
that
t he o l d one
and part
data
L I NK
pass i ng
e v e r y t h i ng
a rray ,
it
i s very l i k e l y
for
t he p a r e n t .
If
t he
the
of
mOdu l es
s ee t he
i s part
t he n e w one .
T he L I NK request
t he
modu l e
r e t u rns
t he
t he
wou l d
not
be
reason
for
t hat
but
there
1s
i ng ,
f o rm
f i nd
II 1 so
t oo
hard
k i nd
an
of
space
t he addre s s .
of
o r de r
to
t r ack
gar b 1 e d
espe c i a l l y
somet i mes
of
doesn ' t
te s t i ng
S hOW
and
up
l oo k s
down
pr i n t ­
v i r u l ent
ha r d to
it,
but
under
mo st
s u s p i c i ou s l y
l i ke a hardwa r e g l i t C h .
T he opera t i ng s y s ­
t e m l et s each p r o c e s s r u n f o r a f r a c t i on of
a second . t hen i n t e r r upt s i t and d i s p a t ches
a n o t he r
a no t her
put
it
proce s s .
If
you
read
some
of
p r oce s s ' s da t a ,
t he n change i t a n d
back
( s omet h i ng
1 i k e A " A ...
1 .
in
t he
to
the
way
OS-9 ' s
wor k s .
addr ess .
L I NKed
b l ock
i nto
t he
it.
By
to
of
t he
a
L I NK
way
acce s s i b l e
mak i n g
a
" reent ­
wi l l
be
t he mod­
appear
a
to
modu 1 e
in
to
seve r a l
reentrant
f e r i ng
t i m i ng
1s
F i nd i ng
never
and
what
f i x i ng
you
th i s
want
k i nd
of
to s how
I S ) t he
it
to
bug
be .
is
k i nd of t h i ng t ha t makes ill p r ogramme r
to j O i n a commune and r a i se c or n .
w i th
one
a n o t he r .
U s ua l l y
If add res ses a re i nc l uded
a r ea . and y o u a re US i ng
process
can
chang i ng
the
send
data
pa r e n t ' s
to
its
i nto
perent
If
by
you
t o bu i l d a modu l e
s e rv i ce
reques t
prOCess
The
path
a r ea
is
certa i n l y
i n t e r -process
a re a r e seve r a l
powe r f u l
too l
commun i ca t i on
da ta modu l e
u l e t ype
l ect i on s
16
for
there
most
date
than
i nc l ude
i n memory , but t he s y s t e m
wh i c h
f o rc e s
OS-9
to
t he IIIO du l e
i n
i ts
d i rectory o f
mod­
u l es
in
memor y
is
a
supe rv i sor
state
r eq u es t .
I t i s pos s i b l e to c i rcumvent t h a t
res t r i c t i on , but t h e met hod i s t oo i n vo l ved
to tack l e t h i s mont h .
with
I t i s p r ac H ca l
to have
t w o o r more
· wr i t er s "
a d a t a modu l e
because
t he re
a r e ways to · l ock " a d a t a modu l e .
A l ock
i s a s y s tem for cheCk i ng that a r e s ou r ce i s
f ree . t hen ,
if
it
i s f r ee .
mar k i ng
it
" In
use .
E ve r y
p r ogram
t ha t
uses
a
shared
U
r e s o u r ce mus t check and respect t he l ock
order f o r i t t o be effect i ve , b u t t he r e
n o way
t o enforce t he
l ock i ng
in
such a
in
is
way
t hat no program can get at the s h a r ed mod­
u l e w i t hout g o i ng t h rough t he l oc k i ng pro­
t oco l ( G I M I X I I I m i ght prov i de a wa y t o do
thi S ) .
The eaS i es t way to l ock a modu l e
( or anyt h i ng e l se )
I S t o w r i te
oper at i ng
sys t em
serv i ces
to
a pa i r of
l oc k
a nd
u n l ock
These
a ny
speC i f i ed
resource .
se r­
v i ces a r e usua l l y ca l l e d ENQ/ O E Q a f t e r t he
sens i b l e E ng l i Sh words enqueue and dequeu e ,
o r P / V a f t e r two Dutch words .
D l j kstra i s
V
parameter
but
T he
t h i Ii>
but
for
the
P/V
t e r m i no l ogy ;
I BM
may have thought up ENQ/OEQ .
P e r haps I ' l l
w r i te t h e OS-9 funct i on hand l er s f o r P and
DATA MODULES
t i on ,
ods .
proces ses ,
A
r a t he r
annoy i ng
p rob l em
w i th
data
mOClu 1 es
i s that
they m u s t b e l oaded f r Om
I t i s poss i b l e
Cl i s k l i k e any o t her modu l e .
r espons i b l e
s i mp l e s t
many
LOCK I NG DATA MODULES
prudent l y
don ' t
use
t hat
quest i on ab l e
t r i Ck ,
t h i s type of commun i ca t i on i s
l 1 ke
h e r ed i t y : s t r i c t l y f r om pa rent to C h i l d .
The
by
r equ i res caref u l
management .
T he p r ob l ems
One u s e r s
p l ay i ng
wh I ch can p l ague Leve l
w i th
two
way
commun i c at i ons
t h r ough
t he
want
i n the pa ram­
Leve l
One ,
a
var i ab l es .
t hat
In
t he
i s some­
If you
t i me s a good i dea t o 1 I e to 0 5 - 9 .
a
S i ng l e
proces s
change
a
r e ent r a n t
l et
d a t a modu l e wh i l e ot her processes o n l y read
what ' s t he re .
there
i s not much chance of
g e t t i ng i n t o t r oub l e .
Data modu l e s can b e
t he
OS -9 Leve 1
Two p revent s
th1 8
k i nd
of
t r OUb l e w i t h t he paramet e r a re a by mil k i ng
addresses
i n t he p a r ame ter a rea unusab l e .
Some programmers work i ng 1 n 05-9 Level One
w i t hou t
a
c ry s t a l
ba l l
to
p re d i c t
t he
na t u re of Leve l T wo p a s s ed a dd re s s to o t her
p r o cesses .
T he i r
p rogram s
(I
b e l i eve
DYNASTAR/DYNAFORM
is
an
examp l e )
have
r es t r i c t i o ns when t hey are used under 0 5 - 9
Leve l
Two
because
under
Leve l
Two
t hose
addresses a re not m ea n i ngf u l .
eter
y ou
means
nobody changes
t he modu l e .
c a s e of a s h a r ed data modu 1 e
it
parameter
a r ea
all
app l y
�o
shared
modu l es wh i ch are w r i t t e n I n �o b y more
one proce s s .
k i nd of e r r o r
be i ng wha t i t
a
pro­
assure
the
operat i ng
system
t ha t
severa l
p r ocesses can u s e the modu l e w i t hout i n t e r ­
you w r o t e i t u n l e s s you have masked i n t e r ­
r u p t s f o r t he d u r a t i on o f the operat i on .
If
some p r ocess changed t h e va l ue o f A i n t he
very p rec i se for t h i s
up . and ( Murphy ' S Law
IS
make
wr i t ten
taken
togethe r ,
they
are
Chaos .
If
you
change a p rogram w i t h t h i s k i nd of e r r o r .
even t o adCl
d i agnos t i c s ,
t he p r ob l em may
seem to d i Sappea r .
T he t i m i ng has
to be
t he
wh i ch
wh i Ch reads A . adds 1 t o i t , and s t o r e s t he
resu l t
in A) ,
you c an ' t be S u r e
that
t he
o t her
proces s
ha s n ' t
changed
t he
da ta
between t h e t i me you read i t and t he t i me
m i dd l e of the add .
the new va l ue of A ... i l l
be w i ped out when t he resu l t of
t he add i ­
t i on
i s put
i nt o A .
E ve r y proce s s
l oOkS
ent i re l y
i nnocent
when
v i ewed a l one ,
but .
in
m e a n i ngfu l
process
is
put
address
IIa r ke d
wi l l
each
Th i s
memory
cesses .
does
is
m us t
t he
p r ov i de
modu l e
l i n ked
to
that
to
Two
s y s tem
memory
map
t he memor y con t a i n i ng
space
of
Level
abl e
If
b e i ng
bu t
ques t i o n
proces s
be
r a nt . "
the
a d j us ted so
ule
o f that bug w h i ch no t o n l y i s
once you set out t o l ook for
f orms
f rom
re t u rns t he a d d r e s s of
to .
L eve l
One s i mp l y
1 i nk
you
modu l e
add r e s s
It
s t ems
sys tem s er v i c e request
by
ar r ay ,
( under
that ,
out
n e i t her
p r oce s s
changes
t he c h i l d I s r u n n i ng .
If
c h i l d c hanges t he
t o be a s u rpr i se
parent
be
l a rge ,
a dd r e s s
sti 1 1
v i ded
a r ray
wi l l
is
is
t he
t he
commun i ca ­
o t he r met h­
for
i nt e r ­
" data
be u se d to s t o r e co l ­
da ta .
T he usef u l ness
05- 9 U se r Not e s Volume
I
but
6809
unt i l
modu l es
ef fect ; ve 1 y . 1 n
g r am .
mOdu l e . "
I S a r a t her mys t e r i ou s mod ­
i ntended t o
of cons t a n t
someda y ,
ava i l ab l e ,
any
memory
A l t e r i ng
a
b yt e
al l
by
serv i ce s
l oc k e d
be
a s s emb 1 y
T he r e a r e severa l
i ns t ruct i on
set
wri te
those
can
a re
qu i t e
1 anguage
pro­
i ns t ruct i ons
In
wh i ch
can
read
in
one
r e a d 1 ng
t he
and
i ns t r u c t i o n .
and
wr i t i ng
it
i n one i ns t ru c t i on p r eve n t s any o t he r pro­
cess f r om acces s i ng t he b y t e i n t he m i dd l e
T he mach i ne
o f t he a l t e r a t i on .
i ns t r u c ­
t i on s t h a t r e a d a n d w r i t e i n o n e i ns t ruc­
t i on
are :
shift
i ns t r u c t i on s .
rotate
i ns t r u c t i on s . i nc remen t . decreme n t . comp l e­
ment ,
and nega te .
T he i ns t ruct i on s wh i ch
are u s ua l l y u sed f o r " l ock i ng " e modu l e a r e
i nc rement a n d decreme n t .
T he bas i c i de a i s
t ha t you s e t a s i de a l oc k i ng b y t e i n t he
da t a modu l e w i t h an i n i t i a l va l ue of - i .
To
l ock
t he modu l e ,
i nc rement
the byte ,
a nd ,
if
i nc reme n t
r e t u rns
w i t h t he zero
f l ag set . cont i nue ;
t he modu l e i s l ocked .
I f the zero f l ag i s not set some o t he r p ro­
cess ha s t he modu l e l ocked ,
s o decrement
t he l OCk i ng by t e , and s l eep for a w h i l e . . .
t hen t r y a ga i n .
See t he a s s emb l y l anguage
modu l es Lock . and U n Lock ,
for examp l es of
t h i s p r ocedu r e .
T he L I NK s e r v i ce request I s on l y a b l e
t o f i nd modu l es t ha t a r e a l ready i n memory .
I f t he modu l e i s n o t I n memory i t m u s t be
l oaded f rom d i sk u s i ng
the
LOAD
s e r v i ce
reques t .
T h i s p r ob l em cou l d be dea l t w i t h
by wr i t i ng two a s s emb l y
l anguage subrou ­
t i ne s ,
one t o do L I NK s .
t he o t he r to do
LOADs .
T h i s o f f e r s t he mos t f l ex i b i l i t y ,
but requ i re s t he c a l l i ng program t o k now
more about O S - 9 t ha n I 1 i ke .
T he a s sembl y
l anguage program t h a t accompan i es t h i s c o l ­
umn a t temp t s to l oa d a modu l e f rom t he exe­
cu t i on d i r ec t o r y i f
i t can ' t be f ound i n
memo ry .
The p r ob l em w i t h t h i s approach i s
t hat t he f i l e wh i ch conta i ns t he data mod­
u l e must have t he same name a s t he modu l e .
T he d a t e modu l e I t s e l f i s c re a t ed by
t he a s semb l er .
T he ma i n d i f f e rence between
e data modu l e and a p rogram modu l e i s t ha t
a da t a modu l e has no permanent s t orage s i �e
i n t he modu l e header ,
and no exec � tab l e
code .
I u s e t he execu t i on o f f set f i e l d i n
t he modu l e header t o po i n t t o t he beg i nn i ng
of t he shareab l e da tIl .
By conven t i on ,
I
u s e t he f i r s t byte i n t he s ha reab l e d a t a a s
a l ock i ng byte .
F o r OS-9 Leve l One users ,
I t i s good to keep t he modu l . t o a mu l t i p l e
Of 2 5 6 b y t e s .
Under Leve l Two , a modu l e
l oaded b y i t s e l f w i l l use a mu l t i p l e of the
page s i ze ( us ua l l y 4096 or 2048 bytes ) . but
a modu l e l oaded f rom a f i l e conta i n i ng sev­
e r a 1 modu 1 e s w i l l share a page w i th o t he r
modu l es f rom t ha t f i l e i f i t can .
Toge t he r , t he a ssemb l y l anguage modu l es
S L i nk . SUn l i nk . l.oc k , and U n l ock . prov i de
t he t oo l s nec e s s a r y f or a Bas i c09 program
to use s ha reab l e data modu l es .
Before a
d a t a modu l e can be u s e d . i t must be l i nked
t o ; S L i nk r e t u r n s t he address at Wh i Ch O S - 9
p l aced t he dat a modu l e .
T h i s a dd r e s s w i 1 1
be usab l e unt i l
t he modu l e i s U n L i nked .
Before any data i n the modu l e i s used or
changed .
t he modu l e shou l d be
l ocked by
ca l l i ng Lock .
Lock w i l l not retu r n con t ro l
to t he c a l l i ng program un t i l i t has cont r o l
o f t he d a t il modu l e .
I t wou l d b e pOS s i b l e
t o rewr i te l oc k s o i t wou l d ret u r n w i t h an
e r r o r code i f some other process had con­
t ro l o f the da ta mOdu l e . a l l ow i ng t he c a l l ­
i ng program t o choose to do some t h i ng o t he r
t han wa i t i f t h e modu l e i s not ava i l ab l e .
AS soon as POS S i b l e a f ter l OCk i ng t he deta
modu l e .
1 t shou l d be u n l OCked t o r e l eese
other proce s s es wa i t i ng for t he da t a mod­
ule.
Bef ore s t opp i ng . a program that l i nk s
a modu l e shou l d u n l i nk i t .
OS-9 ma i nt a i ns
a counter of how meny t i mes a modu l e has
been l i nked t o , and de l e t e s t he modu l e f rom
memory when i t s l i nk count goes t o z e r o .
I
have
i nc l uded
t wo
tri vial
B a s i c09
programs
to
demon s t r a t e
mOdu l e
l OCk i ng .
Ca l c on l y ca l cu l a t es t he s u m of t he squares
Of a 1 i s t of number s , but 1 t cou l d be t he
ma i n s t a y of iii ma i l s y s t em . a ma t r i x man i pu­
l at i on rout i ne , o r iii p r i nt spoo l e r ( t o name
iii f ew POS S i b i l i t i es ) .
O r ; ver2 i s a p r og ra m
who ' s
grea test
v i r t ue
is
that
it
cal l s
Ca l c .
T he r e a r e two f o rm s of l ock i n g g o i n g
on i n the Dr i ver -OetaMod- Ca 1 c s y s t em :
t he
f i rs t byte of d a t a i n De t a Mod i s u s ed by
Lock .
Tl'1e second byte of det a i n Oa t aMod
i s used f o r commun i ca t i on between Or i ver2
and Ca l c .
Each p rocess wa i t s for t h i s byte
to take on a va l ue set by t he o t he r p r oc e s s
bef ore
it
accesses
t he r e s t
of Dat aMod .
T h i s i s a very s i mp l e p r o t oc o l w h i c h can
o n l y be used i n t r i v i a l cases such as S i g­
na l i ng between t wo modu l es .
In t h i s case ,
the ma in l ock i s used to prevent severa 1
modu l es f rom t ry i ng to Change t he commun i ­
cat i ons byte a t t he same t i me .
Once iii pro­
cess gets t he l ock . n o o t he r p rocess can
get i t unt i 1 t he proce s s ho l d i ng t he l ock
rel eases
it.
The process wh i c h has
t he
l oc k can u s . t he commun i ca t i on s b y t e . and
t he res t o f t he data modu l e .
t o ca l l for
the serv i ce s of C a l c i n an o rgan 1 �ed f ash­
i on .
u s e a modu l e f rom l a st mont h ' s c o l umn
c a l l ed S t r t Task
i n t h i s set of p r o g rams .
I f you a re espeC i a l l y i nt e re s t ed i n memory
ef f i c i ency , merge t he f i l e conta i n i ng t he
S t r t T a s k modu l e w i t h t he f i l e conta i n i ng
thi s
mont h ' s
a s semb l y
l anguage
modu l es .
Ca l c: mus t be paCked i n o rder t o work ( a t
any ra t e , I can ' t pu%% l e out any reasonab l e
way t o use i t i n source f o rm ) .
T o make the
con t rap t i on go .
l oad t he f i l e cont a i n i ng
SL i nk .
SUnL i nk •
LOCk .
a nd
UnLock .
If
S t r t T a s k i s i n a sepa r a t e f i l e you m i ght
want
to
l oad
t hat
too ;
t hen
start
up
Bas i c09 end run D r i ver2 . D r i ver2 w i l l pause
�or a wh i l . , s t a r t i ng up Ca l c , t hen a s k for
a number f i ve t i mes .
G i ve i t sma l l numbers
- - t he y heve t o f i t i nt o byte va r i ab l es .
When a l l
f i ve numbers are entered .
Ca l c
wi l l
ca l cu l ate the sum of
t he i r square.
wh i ch w i l l be d i sp l ayed by Or i ve r 2 .
I f you
want to t r y i t aga i n . rep l y Y to the nex t
prompt .
T he
l as t t h i ng Dr i ve r 2 w i l l
do
be f o re end i ng I s ask whet ner you wa n t t o
shut down Ca l c .
Y o u do .
I n a s y s tem w i t h
severa l processes u s i ng Ca l c you w ou l d want
t o l eave i t runn i ng .
but .
w i th o n l y one
process US i ng C a l c . i t w i 1 1 j us t be a nU i ­
sanoe i f i t i s not c l eaned up when i t s one
user t e rm i nates .
C o l umn F o u r
17
LOCKER PROGRAM
NAM S L i nk
*-------------- ------ --- - - ----------------------------- *
*
*
S L i nk
'it
*
Attempt to l i nk t o a modu l e .
'*
*
I f i t i sn ' t f ound attemp t to l oad i t .
*
*
R e t ur n the addr e s s o f the m odul e h e ader, and the
*
*
e n t ry a ddr e s s .
*
*
E r r or s :
*
*
1
W� ong numb e r o f ar guments i n par amete r
'*
.,<
IlSt .
*
*
o th e r
R e t urn c od e f r om F$ L i nk , or F$L oad .
*
*
*
*
C a l l i ng s equen c e (from Ba s i c09) is :
*
*
RUN LinK (Modu l e N ame, Modu l e Type,
*
*
Header-Addr , En t ry Xddr)
*
*
Modu l e Name i s a cna r a cter s t ring c onta i n i ng the
*
-name o f the modu l e wh i ch s h o u l d be l lnk ed *
'*
*
t o . It s h o u l d b e t e rm inated w i th a <CR > .
*
*
Modu l e Type i s a byt e c onta i n i ng the l anguage/
Z
*
*
*
*
*
-�to�
Header Addr
o f t h e m odu l e . A da t a modul e wou l d b e :
i s the addre s s o f the modu l e h e ad e r o f *
*
-the l i nk ed modu l e . I t i s r e t ur n ed f r om
*
L in k . I nteger f i e l d .
*
Ent ry Addr i s an lnteger f i e l d whi ch i s u s ed t o
*
r � t ur n th e addr e s s o f the entry p o i nt o f
*
l lnked modul e .
-
*
* - - ------- ----- - ----------- -- - - - - - - - --- - - - - - ---- - - - ---- *
i fp l
u s e /hO/de f s /defs l i s t
endc
TTL Subrou t i n e c a l l ab l e f r om Bas i e09 to d o L in k S SR
MOD LinkEnd L in kNam, SBRTN+OBJCT,REENT+ l . L i nkEnt,LnkMemS
L inkNam f c s , S L i nk /
f eb 1 v e r s i on
LnkMemS egu .
L i nk Ent
l dd 2 S get parameter c ount
J
mus t be f our
cmpd U4
bne LlnkE r r l
l dd 1 4 A S get l ength of entry addres s f i e l d
cmpd t!�
bne LlnkEr rl
l dd 1 8 A S g e t l ength of h e ader addr e s s f i e l d
cmpd I!�
bne LlnkErrl
l dx 4 � S �odu l e name ' a addr e s s
I da l� , SJ Type/ Language
ahs U
g S9 F$ L i nk
b e e L i nkRtn Carry c l ear ; c l e an r e turn
puI s U
cmpb tE$NEMod N on-ex i stent modu l e ?
b r a LlnkEr r 2 n o ; b a d e r r o r was bne
l dx 4 A S �odu l e name ' s addr e s s
I da [� . SJ Type/Language
pshs U
059 F$ L oa d
b c c L inkRtn
puI s U
LlnkErr2
c oma
r t s r eturn w i th e rror c ode i n B and c a r ry s et
L i nkErr l
l db #$FE e r r o r c ode of 1
c omb s et c ar ry
rts
L i nk R n
s tu
1 4 . 5] Header addre s s
1 8,S] data addr e s s
s ty
puI s U
c l rb c l ear c ar r y
r t s r eturn
EMOD
t
18
05-9 U se r Notes Vol ume
I
L i nkEnd e q u *
NAM SUnL mk
* -----------------------------------------------------_+.
*
*
SUn l i n k
U n l i nk a L i nk ed Modu l e .
*
+.
C a l l i ng s eq u e n c e ( f r om B a s i c09) .
*
*
RUN Unl i nk (Heade r Add r )
*
*
E r r or s :
*
*
1
Wr ong n um b e r o f a r g umen t s 1n p a r ame t e r
'*
*
l is t .
*
*
o th e r
E r r o r c ode f r om F$Un l i nk .
*
*
*
+.
Header Addr i s t h e i n t eg e r a d dr e s s o f the h e a de r
-
+.
+.
r e t urned f r om t he l i nk r eq u e s t f o r the
m o du l e you want t o un l in k .
+.
*
* ------------------------------------------------------ *
TTL Subr o u t i n e c a l l ab l e f rom B a s i c 09 t o do Un l i nk S SR
MOD Un l k En d Un l kNam S B R TN+OB JCT , REENT+ l , Un l kEnt . ULkMemS
Unl kNam f c s , S Un L i nk ,
f c b I v e r s i on
U LkMemS equ .
Un l kEnt
l dd 2 S g e t p arame t e r c o un t
cmpd
mus t be one
bne U L nkEr r l n o t one ; e r r o r
pshs U
I du [6 , S] g e t modu l e header ' s addr e s s
OS9 F$Un l i nk un l i nk the m o du l e
p u I s U r e c ov e r U
* r e t urn c od e an d c a r r y s e t by F$Un l i nk
r t s r e t urn
#1
ULnkErrl
I db t;$ FE
c omb
rts
£HOD
Un l ltEnd equ *
HAM Lock
* ------------------------------------------------------ *
*
+.
l o ck
Lock p r o t o c o l
*
* Wa i t f o r a " l oc k " byt e t o i n d i c a t e un l ocked , t hen
* l oc k t h e byt e .
*
*
* Ca l l i ng s e quen c e :
*
*
RUN Unl ock (Lock Addr )
+.
* E r r or s :
*
*
I
Wr ong numb e r o f a rgument s 1 n parame t er l i s t .
*
*
*
* Lock Addr i s t h e i n t eg e r addr e s s o f t h e byte used
*
*
f or the l OCk i ng p r o t o co l .
* ------------------------------------------------------*
-
TTL S ub r o u t i n e c a l l ab l e f ro m B a s i c09 t o p e r f orm " l o ck " pro t o c o l
MOD L o c kEnd LockNam , SBRTN+OBJCT , REENT+ l , LockEnt , L okMemS
L o c kNam f c s , Lock/
f cb 1 vers i on
LokMemS equ
L o c k En t
I dd 2 S g e t p a r ame t er c ount
1
cmpd vI mus t be one
bne L o c k Er r l n o t one ; e r r or e x i t
L o c k Lq,op
I dx L4 , S] g e t a d dr e s s o f l oc k byt e
inc , X t es t and s e t i t
b e q Locked
.
dec
X c an ' t ge t i t
l dx 1 2 i n t erval f or b r i ef s l eep (tunab l e)
OS9 F $ S l e e p
b ra L o c kL o o p
L o c k ed
c l r b t u rn o f f c a r ry
r t s return
LockEr r l
I db I;$FE
c omb
r t s r e t urn
EMOD
Loc k End equ *
NAM UnLock
•
*------------------------------------------------- *
*
*
UnLock
P e r f o rm t h e Un l o ck p r o t o c o l
*
*
Res t or e t h e " l o c k " byte t o t h e un l ock ed
*
*
s ta t e .
C o l umn F o u r
19
'*
-(L��k.
Addr )
L o c k Addr i s the int e g e r addr e s s
u s e d f o r t h e l oc k i ng p r o t oc o l .
RUN UnLock
*
*
*
of
t h e byt e *
*
* ------- ------------------------------------------*
TTL S ub r ou t i ne c a l l a b l e f r om B a s i c 09 t o p e r f o rm UnL o c k
MOD ULokEnd ULokNam , SBRTN+OB JCT , REENT+ l , ULok En t , U L o kMemS
U L okNam f c s ; UnLo c k /
f eb 1 v e r s i on
U L o kMemS e g u
U L ok En t
l dd 2 S g e t p arame t er c oun t
1 mus t b e one
cmpd
bne Q L o k�rr l n o t o ne ; e r r o r ex i t
l dx l 4 , S] g e t a d dr e s s o f l o c k byt e
d e c , X r e l e a s e t h e l ock
•
#
c lrb s e t carry b i t o f f
r t s r e t urn
UL okE r r l
I db #$FE e r r o r c od e
c omb s e t c a r ry
rt s
E110D
ULokEnd e q u
NAM
*
of
1
Da t aMod
TTL A L o c k ab l e dat a modu l e
*-------------------------------------------------*
*
*
Th i s a g e ne r i c d a t a modu l e .
*
*
I t c on t a i n s a l o ck ing byt e and up t o 2 32
*
*
byt e s o f un s pe c i f i ed dat a .
*------------- ------------------------------------*
MOD ModEnd MOdNam , DATA , REENT+ l , LoekByt e , O
ModNam f c s ) D at aM o d/
f c b 1 e d i t i cn
L o c k By t e f cb - 1
UnSpe c f c c / 1 2 3 4 5 6 78 9 0 1 2 3456789 0 1 2 3456789 0 1 234567890/ 4 0
f c c / 1 2345678901 2 3 4567890 1 234567890 1 2 3 4567890/ 8 0
f c c / 1 2345678901 2345678 9 0 1 2345678 9 0 1 2 34567890/ 1 20
f c c / 1 23 4 5 6 78 9 0 1 2 3 456 78 9 0 1 2 3 4567890 1 234567890/ 1 6 0
f c c / 1 23 45678901 2 3456789 0 1 2 34567890 1 2 34 56 7890/ 200
f c c / 1 2345678901 234567890 1 234567890 1 21 2 3 2
EMOD
ModEnd equ
20
*
05 - 9 U s e r N o t e s Vol ume I
CALC PROGRAM
PROCEDURE C a l c
*
* Ca l cu l at e the s um of t h e s quar e s o f the numb e r s
* s t o r ed in Da t aMo d .
* A p r o c e s s s i gna l s t h a t i t wan t s s e rvi c e b y s t o r i ng a
* hex 01 in the byt e one o f f the s tar t o f d a t a in Dat aMod .
* Wh en C a l c s ee s a ! in that byt e , i t c a l cu l a t e s the s um o f
* the squa r e s and put s i t a t 7 and 8 o f f t h e s t ar t of dat a i n
* Da t aMo d l t hen s e t s t h e s t a t us byte ( 1 o f f the s ta r t ) t o hex 00
* ind i c a t l ng that c a l c u l at i on i s done .
*
DIM Modu l e N ame : STR ING
DIM Hodu l e- Type : BYTE
DIM Header-Addr , Da t a Addr : INTEGER
DIM S t a t u s -Addr , Ar r ay Addr , Re t urn Add r : INTEGER
DIM s um , i : INTEGER
�:
S e t up
M o du l e Typ e -S40
Modu l e-Wam e "' ' 'Dat aMod''+CHRS ( 1 3 )
RUN S L!nk (Modu l e Name , Mo du l e Type , Header Addr , Da t a Addr)
S t a t us Addr"'Da t a-Addr+ l
Array Addr-Da t a Addr+2
R e t urn Addr�Data Addr+7
P
a
r
r wo r k )
e
i
�� a ��:
e
:� a�: :� :_�::
i nd i c a t e that an o p e r at i on i s wa i t i ng t o be d one .
-
l
:
-
::: :: �::::: : :
WH I LE PEEK ( S t a t u s Addr) < > 1 DO
SHELL "SLEEP 2 " ENDWH I LE
WHI LE PEEK (S t a t u s Addr ) - ! DO
s um-O
FOR i -O TO 4
sum-s um+PEEK (Ar ray Addr + i ) * PEEK (Ar ray Addr+ i )
NEXT i
(* The c a l c u l a t i on i s d on e . Save the r e s u l t
POKE R e t urn Addr , s um/256
POKE R e t urn-Addr + 1 . MOD ( s um , 256)
(* and indiEa t e tha t the r e su l t s are r eady
POKE S t a t us Addr , O
WH I LE PEEK (Et at u s Addr ) -O DO
SHELL "SLEEP 2 " ENDWHI LE
ENDWHI LE
POKE S ta t u s Addr , O \ ( * we ' re dead
RUN SUn L inklHeader Addr)
BYE
Column Four
21
DR I VER PROGRAM
P O
V
l� �:��:: �:� �:�
>:
,,<
C k er I I
Demons t a t e s s i mp l e M o du l e l o c k / un l o c k
'* Ope r at i on :
* L l n k t o Dat aMod
* F o r k C a l c ( a s i mp l e p r o c e s s f o r d em on s t r a t i on p u rp o s e s )
* Wa i t f or t h e s ec ond Data byt e in d a t amod t o b e c ome SOO
* i n d i c a t i ng t hat C a l c i s r unn i ng .
* S t a r t of Loop
* L o ck Da t aMod
* S t or e d a t a i n t o bytes 2 . 3 , 4 , 5 , and 6 o f f t h e s t a r t of
* d a t a in Dat aMod
* · Ch ange the byt e at I o f f t h e s t ar t o f dat a i n Dat aHod t o $01
* i nd i ca t i ng that there is da t a i n the modu l e to b e o p e r a t ed on
* Wa i t f o r the s e c ond da t a byt e t o c hange SOO
* Get t h e r e s u l t of the c a l ul a t i on ( an l n t e g e r ) a t 7 and 8
* o f f t h e s t ar t of data in Dat aMod .
,� UnL o c k Dat aM o d
* L o o p unt i l e n d i s c a l l e d f o r
*
* L o c k Dat aMod
* Change the the f i r s t da t a byt e t o $02 (wh i ch t e l l s c a l c to s t op)
* Wa i t f o r the f i r s t da t a byt e i n Da t aM od to change to a $00
* UnL o c k Da t aMod
* UnL i nk Dat aMod
* Al l done
DIM
DIM
DIM
DIM
DIM
DIM
DIM
DIM
Header Addr , i : I NTEGER
P r o c e ss Num , Modul e Typ e : BYTE
P a ram Len , Da t a AddF : INTEGER
Opt Slze , op : B YTE
NumTINTEGER
P arams : STR I NG
M o du l e Name : STR INC
NY : STRTNG
M o dul e Typ e - S 40
Heade r-Addr-O
Da t a A'Qdr-O
M odule Name-"Da t aM o "+CHRS (S80+ASC ( " d " »
R U N SLlnk (Modul e Name , Mo du l e Type , He a d e r Add r , Da t a Addr)
(* S e t up for FORK opera t i on-
M o du l e Type-S 2 l \ ( * Sub r out i n e / Obj e c t c ode
.
P arams-" C a l c "+CHRS ( 1 3)
P a r am Len-LEN ( P a r ams)
Op t Slze- l O
M o dul e Name= "Bas i c 09"+CHR$ ( 1 3)
RUN S tFtTask (Modul e Name , Pr o c e s s N um , Mo du l e Type , P ar am Len , Pa r ams v , Opt S i ze)
Ca l c i s s t a r t i ng-now
*
* Wa i t f o r the f i r s t d a t a byt e i n Dat aK o d t o b e c ome z e r o
* t h e f i r s t da t a byt e
i s l oc a t ed a t t h e addre s s i n Da t a Addre s s
1*
*
-
COSUB 1 00 \ C* wa i t
�:
Ca l c i s runn i n g .
f o r c a l c t o s end r eady
-
S end i t dat a
R EPEAT
RUN Lock CDat a Addr)
l oad Da taHOd wi th da t a
�:
FOR i - 2 TO 6
INPUT 'tEn t er a numbe r C 1 . . 255) , o r 0 t o s t op) : " , Num
POKE Dat a Addr+ i , Num
NEXT i
POKE na t a Addr+ l ! l \ C * mark t h e modul e " r e ady f o r ope r a t i on"
COSU3 1 00-\ C * w a l t f o r cal c t o i ndi c a t e r eady
PR INT " S um of s qua r e s i s " ; PEEK (Da t a Add r+7) *25 6+PEEK (Da t a Addr v+8)
RUN UnLo ck (Dat a Addr)
INPUT "Mo re ca lcul a t i ons ? (Y , N) : " , NY
UNT I L NYzo I1N " OR N Y- li n "
INPUT "Shut Down Ca l c Modu l e ? (Y , N) : " , NY
I F NY-"Y" OR NY" "y" THEN
RUN L o c k (Da t a_Addr)
-
22
05- 9 U s e r Not e s Vo l ume I
POKE Da t a Add r + 1 , 2 \ (* c ommand f o r s t op
WH I LE PEEK (Da t a Addr+ 1 ) < > 0 DO
SHE LL " S LEEP 2 "ENDWH I L E
RUN UnL o c k (Da t a Addr )
RUN SUn L i nk (Heaa e r-Addr)
ENDIF
END
(* Wa i t f o r t h e s t a t u s b y t e
(* i nd i c a t e r e ady
WHI LE P EEK (Da t a Add r+ 1 ) < > O DO
1 00
1n
Dat aMod t o
SHE L L " S LEEP 2 "ENDWH I L E
RETURN
C o l umn F ou r
23
24
05 - 9 Use r Not e s Vo l ume
1
COLUMN F I VE
wh i ch p r o c e s s runs and f o r how
l o ng ) .
]t
i s your j ob to pr,event a cer t a i n pr o c e ss
MORE ABOUT LOCK I NG
Last mo n t h I d i s c us sed shared da t a modu l e s ,
and
demons t r a t ed
a
l oc k i ng
met hod
wh i ch
cou l d be u sed to per m i t o n l y one pr o ces s a t
a t i me
to acce s s a da t a modu l e ,
or ,
for
that ma t t e r , any shareab l e resource .
l ast
is
The
l ock i ng
pr o to co l
mon t h h a s t wo s e r i ou s
onl y
a
prob l em
for
t hose
demon s t r a t e d
prob l ems .
One
who ,
l i ke
most
of us , can on l y run mo re t han one p r oces s
by s ha r i ng a proces s o r be t ween severa l p r o ­
cesses .
T he o t h e r prob l em l i m i t s t he u s e ­
f u l nes s
of
concu r r e n t
pr oces ses .
Both
prob l ems have s o l u t i ons .
f r om ever g e t t i n9 t he l oc k .
Y o u may ru n
any mi x of programs you 1 i ke any way you
l i ke except t ha t t he process you are t r y i ng
to prevent
f rom get t i ng t he l oc k m u s t be
a l l owed to run every now and t hen .
If
1t
i s poss i b l e
t o prevent
t hat
p r ocess
f r om
ever
ge t t i ng t he
l ock ,
t here
is
l oc k o u t .
The
seQuence of
events
that
demon s t r a t e s
t ha t l OCkout i s poss i b l e for t he a l go r i t hm
I
gave
1 a s t lIIo n t h i s :
Two processes
are
runn i ng , A and B . B o t h processes are s 1 mp l e
programs
wh i ch
j us t
get
re l ease i t I!l ga i n and aga i n .
t he
l oc k
t hen
E i t he r pr o c e ss
cou l d
be
l ocked
out ,
bu t
t he
" execut i on
sequence "
in
f i gu r e
F i gu re 1
on l y
demon­
s t ra t e s t ha t proces s B can be l ocked out .
S tart
T he
l ock i ng
a l gor i t hm
I
demo n s t r a t e d
l ast
mon t h u s e d I!l
techn i Que cl!l l l ed
"busy
wa i t i ng . " T h i s i s u s ua l l y t he eas i es t way
t o make a process wa i t u n t i l some t h i ng hap­
pen s ,
but
i t w a s t e s p rocessor
cyc 1 es .
I
t r i ed to reduce the amount of t i me w l!l s t e d
i n t he l o ck i ng modu l e a s m u c h as po ss i b l e
by pu t t i ng a · s l eep " i n i t s wa i t l oop , bu t
t he
s o l u t i on
I
gave
was ,
neve r t he l es s ,
i nef f i C i en t .
I f wa i t i ng f o r t he l ock u s e s
proces sor t i me ,
even very s l ow 1 y ,
al l
you
have
to
do
is
l i ne
up
enough
processes
wa i t i ng f o r t he l ock a n d y o u c a n s l ow t he
compu ter down to a c raw l .
Y ou m i g h t t h i nk
t ha t you cou l d a l ways make t he wa i t i ng p r o ­
c e s s e s a s cheap to r u n a s nece s s a r y by pu t ­
t i ng a l onger S l eep i n t o t he wa i t l oop , bu t
i f t he s l eep i s made v e r y l ong ,
t he r e may
be a S i gn i f i cant t i me du r i ng wh i ch t he l oc k
i s o f f a n d t he a l l t he p r ocesses w h i c h want
i t a r e s l eep i ng .
I f t he goa l
is p e r f o rm­
ance ,
( us i ng per f ormance i n t he same sense
as
"h i gh perf ormance car · )
it
i s no t good
t o 1 eave I!l scarce resource 1 i ke t he
l ock
unused f o r a ny l engt h o f t i me .
fhe goa l i s
t o des i gn an a l gor i t hm w h i ch a l l ows wa i t i ng
proce s ses
to be comp l et e l y i d l e u nt i l
t he
l ock i s ava i l ab l e , then awakens one proces s
and g i ves i t t he l ock .
You see that by a l l ow i ng proces s A t o r u n
l ong · e nough 5 0 t ha t c a n get t he l oc k a ga i n
each t i me i t re l eases i t I can s hut proce s s
B ou t
comp l e t e l y .
Th i s may seem unfa i r ,
but
it
shows
t hat
t he
a l go r 1 t hm
perm i t s
l ockout .
Murphy ' S
l aw ce r t a i n l y d i c t a t e s
t hat i f i t i s poss i b l e t o prevent a p r o c e s s
f rom e v e r ge t t i ng t he l ock ( and y o u w a n t i t
t o get the l ock ) , the i mprobab l e execut 1 0n
seQuence wh i ch l eads to l ockout w i l l happen
a t t he wo r s t pos s i b " e moment .
Th i s i s one
of t he k i nds of pr ob l em that cause s t range
behav i or 1n comp l i cated systems .
I f each process i s runn i ng on i t s own
p roces sor , the p rocessor runn i ng a wa i t i ng
process has not h i ng be t t e r to do t han Z i p
around t he wa i t
l oo p .
Some peop l e t h i nk
bus y
wa i t i ng
is
bad
even
t he n .
I
t end
t oward t he oppos i te ext reme .
The prob 1 ems
w 1 t h bUSY wa 1 t i ng are obv 1 0us , the a l t e r na ­
t i ves have t r 1 ck i er p ro b l ems .
The
i ssues
i nvo l ved i n choos i ng a busy wa i t i ng a l go r ­
There ar e many ways to do l oc k i ng t ha t
don ' t u s e busy wa i t 1 ng or have dead l ock .
I
am not go 1 ng to d i scuss t hese t r i c k s t h i s
IIIO nt h , but I w i l l l eave you w i t h t wo h i n t s .
The
0 5 - 9 S E ND serv i ce request o f f e r s an
a l t e r na t i ve to busy wa i t 1 ng . Lock 1 ng can be
done w i t hout dea d l ock by us i ng any of sev­
era l
a l gor 1 t hml5
i nc: l ud i ng
one
ca l l ed
the
Doorman A l gor i t hm .
i t hm over a more soph i s t i ca t ed one a r e much
1 i k e t hose
i nvo l ved
i n choos i ng a bubb l e
sort
ove r
one
of
t he
f l a s h 1 er
s o r t i ng
a l gor 1 t hm s ,
t hat
is ,
f o r a s ml!l l l
p robl em
the s i mp l e a l gor i t hm w 1 1 1 do f i ne .
The
o t her
prob l em
w i th
t he
l ock i ng
a l gor i t hm I gave 1 . t ha t 1 t perm i t s " l oc k ­
ou t , " i e .
a process c a n wa 1 t forever w i t h ­
o u t ever get t 1 ng t he l ock even when no o t h ­
er
process
hol ds
t he
l ock
f orever .
If
t here w i l l s e l dom be a process wa 1 t i ng f or
t he l oc k ,
l ockout 1 s n ' t a b i g prob l em , but
f or
l ocks
t ha t usua 1 1 y have a process or
mo,'" wa i 1. : ng for t hem l ocko ut i s a n i mpor­
tant cons i derat 1 0n .
It
1s
a l go r i t hm ,
f i nd i ng i t
l i ng
t he
t r i Ck y t o detec t
l ockou t
i n an
bu t h e r e a r e t he bas i c r u l e s f o r
:
I mag i ne t ha t y o u a re c o n t r o l ­
compu t e r ' s
d i spa t cher
( dec i d i ng
l o ck
B : trr to l ock
A:
l ock
B : try t o l ock
A : l o ck
etc .
A:
A:
F i gUf"e
un
1 :
oek
E xecu t i on
f o r Lockout
Sequence
GETT I NG A GOOD ft M I X ft
T he s t andard use f or' mul t i p l e processes i s
t o make max i mum use of a proce s s o r when t he
work to be done i nvo l ves a l o t of wa 1 t i ng
for out s i de even t s , such as t er m i na l i npu t .
A
process
cou l d
spend
most
of
1 ts
t i me
wa i t i ng f o r i npu t f r om a t e rm i na l , and de l ­
ega te any maj or work t o Ch i l d pr oce s se s .
Th i s way t he program wou l d a l mo s t a l way s be
ready
t o accept
i nput f rom t he term i na l ,
even when some prev i ous p i ece of work was
s t i l l 1 n progress .
Us i ng a spec i a l process
t o pr i n t a screen i s a pa r t i cu l a r l y apt use
Of t h i s pr i nc i p l e .
There i s rea l l y no r e a ­
s o n w h y someone shou 1 d have t o wa 1 t f o r a
pr i n t
request t o comp l ete be f o re con t 1 nu ­
i ng , a n d t here
i s usua l 1 y n o need f o r t he
C o l umn F i ve
25
p roce s s t h a t i s d o i ng t he p r , n t i ng to com­
mun i ca t e w i t h i t s parent pr oc es s .
The pr o­
cess
t ha t
is
dr i v i ng
t he
pr i nter
spends
mos t of
i t s t i me w a i t i ng f o r t he pr i n t e r ,
a n d t he proc e s s t ha t i s respo ns i b l e for t he
screen
15.
very
l i ke l y .
s pend i ng most
of
i t s t i me wa i t 1 ng f o r i nput f r om t he t e rm i ­
T hese t a s k s c a n be i n pr ogr ess at t he
na l .
same
t i me
w i th
a l most
no
e f f ect
on
one
a n o t he r
When one process
i s wa i t ; ng f o r
somet h i ng . t he o t her proce s s c a n r u n W i t h ­
o u t i nt e r f e r e nc e .
W i t h t a s k s l i k e pr i nt i ng
a nd
s c r ee n
hand 1 i n9 ,
t he
compu t e r
w i. l 1
spend most of i t s t i me w i t h b o t h pr oce s s e s
wa i t i ng .
Some programs r u n we l l
t og e t he r , other
p r ograms
i nt e r f e r e bad l y wi t h each o t he r .
F i nd i ng good s e t s of pr ograms to run at t he
same t i me ,
and adj U s t i ng t he i r pr i o r i t i e s
so t hey a l l w i l l r u n as f a s t as POSS i b l e i s
ca l l ed f i nd i ng a good " m i x . · Tun i ng h a rd ­
ware and s of t w a re s o a s i n9 1 e program can
run a s fast a s pos s i b l e i s a comp l i ca t e d
j ob , b u t choos i ng g roups o f programs wh i ch
w i l l r u n we l l t o ge t her . and t u n i ng t he s y s ­
tem so t he groups w i l l r u n a s f a s t as pos ­
1 1 1 ke t o
s i b l e i s more o f a b l ack a r t .
keep m y pe r s ona l
compu t e r
r a ther
l i ght l y
l oaded ( no more t h a n two o r t h r ee p r oces s e s
act i ve a t a t i me ) , b u t i t
i s gOOd quest i on
j us t how much t i me a compu t e r shou l d spend
wa i t i ng .
I f you g i ve t he mach i ne so much
work t o do that 1 t never h a s to wa i t , e a c h
p rocess w i l l
r u n s l ow l y .
A compu t e r t ha t
has n o resou rces
i n r e s e r ve i IS s a i d t o be
saturated .
Cons i de r t he case of a program wh i ch i s
read i ng f r om t he t e rm i na l .
Usua l l y .
in a
s a t ur a t e d compu t e r . t he re a r e seve r a l pro­
cesses wa i t i n g f o r proce s s o r
t i m. at
any
T he proce s s wa i t i ng f or t he i nput
momen t .
character 101 i l l
have to lola i t
for at
1 eas t
one process , maybe .evera 1 ,
to have t he i r
t u r n b e f ore i t w i l l get a chance to r u n .
I f each process get s a t u r n one t ent h of
second l ong .
and t he r e a r e a n avera� o f
two proce s s e s w a i t i n g t o run . t h e n a pro­
c e s s w i l l take about two t en t h s of a second
to
respond
to
a
S i mp l e
k e y s t rok e .
T ha t
comes t o 5 c ha r ac t e r s per .econd .
or 300
F o r perspec t i ve . my
charac t e r s per m i nu t e .
t e rm i na l repea t s at
10 characters per sec­
ond .
programs
runn i ng
under
For tuna t e l y ,
0 5 - 9 don ' t a c t ua l l y d o any I / O .
OS-9
is
a r ranged s o t ha t i np u t a n d output are done
by 0 5 - 9 ra t he r t ha n by user programs .
The
dev i ce d r i ve r s a re responS i b l e for a l l I /O .
05-9
a l ways
g i ves
very
fast
ser v i ce
to
dev i ce
d r i ve r s .
A l mo s t
anyt h i ng
wi l l
be
i nt e r rupted
to
a l l ow
a
dev i ce
d r i ve r
to
dea l
w i th
i np u t
or
ou tput .
Some
dev i ce
dr i vers have a r e s ervo i I' f o r
100
( or s o )
ch arac t e r s wh i c h t hey can save up and g i ve
to a process i n a bur s t ne�t t i me the pro­
cess i s s t a r t ed .
the
best
p e r f o r mance
a
For
computer
shou l d be ke p t i d l e m o s t o f t he t i me , t hat
way i t w i l l
i mmed i a te l Y j ump on any work
you g i ve
it.
It
wou l d be
n i ce
t o have
enough money t o buy overpowered COlIIPu t e r s
s o t he r e wou l d be
l o t s of
i d l e t i me a n d
exce l l en t pe r f ormance ,
bu t
i f money
is a
concern
you
have
to
s t r i ke
a
comprom i se
between get t i ng f a s t response . and get t i ng
t he
max i mum
amount
of
wor k
oui
of
your
mach i ne .
26
05 - 9 User Notes Vol ume I
It
'5
p o s s i b l e t o speed up
i mpo r t a n t
processes by Chang i ng t he i r pr i or i t y .
T he
heav i er t he
l oad on a compu t er ,
t he more
i mportant
it
is
to f us s w i t h pr i or i t i es .
An e d i t s eS S i on , a l i s t i ng t o t he p r i nt e r .
and an a s s emb l y can s ha r e t h e mach i ne very
n i ce l y i f the pr i or i t i es ar'e proper l y s e t .
T he
ed i t
s e s s i on
is
i n terac t i ng
with
an
i mpat i ent huma n .
s o i t shOu l d have a h i gh
p r i or i ty
a s s i gned
to
1t .
S i nce
ed i t i ng
usua 1 1 y ; nvo 1 ves a l ot of dead t i me wh i 1 e
the human do i ng t he e d i t i ng s t a r e s 8 t t he
screen ,
t he ed i t o r w i 1 1
a c t ua l l y u s e v e r y
l i t t l e p r ocessor t i me .
T he p roce s s t ha t i s
p r i n t i ng 1 s very much the same s to r y .
It
1 s n ' t i n t e ra c t i ng w i t h a human . b u t even a
200 character per second p r i n t e r i s s l ow b y
comput er
s t a ndards .
T he
process
t ha t
i s
dr i v i ng
t he
p r i nter
shou l d
be
g i ve n
an
i n t ermed i at e p r i o r i t y 5 0 i t w i l l b e ab l e t o
run
t he
p r i nter
at
a
goc,d
cl ip
w i t ho u t
1 n t e r f e r 1 ng t o a n y g r e a t e x t en t
101 i t h
t he
ed i t proce s s .
The a s semb l y shou l d be g i ve n
a very l ow p r i or i t y .
A s semb l i es
are the
type o f t h i ng t ha t w i 1 1 u s e a l o t o f pro. cessor t i me i f t he y a r e a l l owed .
Even i f
it
i s g i ve n a
l ow p r i or i t y .
t he a s semb l y
wi l l
get
t i me
t ha t
the
ot her
proce s s e s
don ' t want .
so s i n ce bot h w i l l u s u a 1 1 y b e
wa ; t i �g f o r
some t � l ng ,
t he
a ssemb l y
wi l l
get p l ent y of t i me .
Most bus i ness programs , as we l l as com­
p i l er s ,
a s s emb l e r s .
a n d d i sk u t i l i t y pro ­
grams , spend a l ot of t i me wa i t i ng f o r t he
d i sk t o dO some t h i ng .
T he sound o f a d i s k
c l uck i ng
and
buzz i ng
is
a
p l eas a n t
busy
sound.
but
it
a c t ua l l y
S i gn i f i es
wasted
t i me .
\IIh i 1 e t he d i sk
i s do i ng mechan i ca l
t h i ngs 1 i ke s t a r t i ng ,
seek i ng ,
l oa d i ng t h e
head .
and e v e n t ur n i ng ,
some
program
i s
l i kel y
to
be
wa i t i ng .
OS-9 makes
s ome
e f f ort to speed d i sk access , but w i th sev ­
.ra l processes wan t i ng to access t he same
d i s k the prob l em i s more than a s ma l l ope r ­
a t i ng s y s t em c a n hand l e .
There a r e s t a n ­
da r d t r i ck s f o r r educ i ng t he amoun t of t i me
a
program
spends
wa i t i ng
for
t he
d i sk
d r i ve .
The eas i es t of t hese for a regu l a r
us er t o get a t i s t he u s e o f l ar g e buf f e r s .
Most programs t ha t acces s t he d i sk w i l l r u n
f as ter i f t he y a r e g i ve n enough s tor age s e
they c a n read a n d w r i t e
1 a r ge b l o c k s o f
dat a .
I f you wan t t o h e a r some very bus y
no i ses f rom your d r i ve s , s t a r t a COp y w i t h
on l y a l i t t l e b i t of memory , t hen do a D I R
f o r a l a rge d i rectory on t he same d i sk you
are COPY i ng on .
The d i s k dr i ve w i l l chuck ­
l e mad l y as i t s hu t t l e s back and f o r t h f rom
d i rectory t o f i l e
1 n a n a t t empt
t o s e rve
both t he copy pr ogra m and t he D I R command .
Sw i t Ch i ng f r om f i l e to f i l e on a d i s k ( even
a W i nChes t e r )
is
s l ow .
T he
t:>es t way
to
dea l w i t h t h i s
i s t o avo i d t he p r ob l em b y
not runn i ng more t ha n one program a c c es s i ng
a par t i cu l ar d r i ve a t a t i me .
I t w i l l be
obv i ous 1 f t he r e i . a prOb l em .
I f p r ograms
ar e
run
1n
t he
wrong
comb i nat i on s .
t he y
wil l
r u n very
S l ow l y ,
a n d t he d 1 sk
wi l l
sound very act i ve .
I f you have t o make the
bes t Of a bad m i x , g i ve proces s es a s much
memory as you can .
We 1 1 des i gned programs
can
use
ex t ra
s t orage
to
cut
down
d i sk
u s age , or to t r a n s f e r ( read or wr i t e ) more
da t a f or each t u r n t hey g e t .
AN ASSEMBLY LANGUAGE PROGRAM
WH I CH SETS PR I NTER OPT I ONS
I
j us t
er ) .
w i th
wou l d
be
co n t a i ned
wou l d
to
the
t he
have
new
been
pr i nter
on
my
can
f1 1e
good
to
by
excuse
by
Of
t yp i n g
remember
t he
ass8mb l i es
It
p r i nter
t y p i ng
t he
the
/dO/compr i n t .
but
a
new
to
f i nd
Epson
con t r o l
pr i n t e r
a
be t t er
seemed
There
way
f i l es ;
of
se t t i ng
t he p r i n t e r
opt i ons .
The program
POpt
is
the
f i rst
comp l e t e a s semb l y
l a n­
guage
p r og r a m
I
have
publ i s hed
he r e .
I
hope you f i nd i t as u s ef u l as I do .
POpt
do e s n ' t
exc 1 t i ng ,
bly
but
l anguage
do
is
it
a ny t h i ng
techn l ca l l y
a
f a i r l y S i mp l e a s sem­
wh i ch i nc l udes mos t of
p r ogram
t he e l e me n t s
f ound
i n as semb l er
programs .
I am go i ng to go t h rougn the i n t e r e s t i ng
po i nts of t he p rogram mov i ng genera l l y f rom
t he beg i nn i ng
The
NAM
to
a nd
t he end .
TTL
s t a teme n t s
in
t he
f i rs t
t w o l i nes O f t he prog r am a r e p u re l y cosme t ­
ic.
They
p r ov i de
i nf Orma t i on
w h i ch
t he
a s semb l er p u t s
i n the page head i ng s .
T he
b l ock
f o l l ow i ng
t hose
t wo
l i nes
is
the
i n t rOduc t o r y comment f o r the program .
Al l
comment s
m i gh t
be
cons i dered
OS 9Defs
OS 9SysDefs
OS9 IODefs
OS 9RBFDefs
OS9SCFDefs
w h i ch
i nvok i ng
the
cosme t i c .
bu t
t he y
don ' t
genera te
any
code ,
I
a 1 t hough
t h i nk of t hem as assent i a l pa r t s of a s se m ­
b 1 Y 1a n g u a g e p rogram s .
Any
I i ne
w i t h an
it
l oo k
are
a
a
l ot
of
prog ram
symbol s
w i th
t he
in
ful l
al l
set
t hose
of
def i ­
n i t i o n f i l es genera l l y needs
t o be a s sem­
b l ed i n a reg i on of a t l ea s t 24K to accom­
moda t e t he l a rge symbo l t ab l e .
I f you want
t o use your memory more econom i ca l l y ,
c re­
a t e a s t r i pped down def i n i t i ons f i l e w i t h
onl y
t he
def i n i t i on�
you
expect
to
use .
and
new o n e
;f
you get
a new v e r s i on of
opera t i ng s ys t em .
Leve l
One and L e ve l
t he
Two
d ef i n i t e l y
and
use
i t
i ns teiSd Of t he s t andard f i 1as ;
but
be pre pa red to scrap you r f i l e a nd bu i l d a
have
d i f f erent
def i n i t i o ns ,
i f you d i g a r ound deep enough i n t he ope r ­
a t i ng
sys tem .
i t
is
unw i se
to
count
on
t h i ng s s t a y i ng f i xed even f r om ver s i on to
vers i on .
A
MOD
t he
few
l i nes
down
s t a t ement .
05-9
f rom
Th1 s
mOdu l e
w h i c h 05-9 needS .
header a r e :
t he
ENDC
s t atement
header .
The
a
b l ock
f i e l ds
is
t he
gene r a t e s
of
in
t he
T ry i ng to f i l l i n a num�er
f oo l i s h .
The assemb l e r
can
da t a
modu l e
PROGRAM LENGTH
a s ter i sk
i n ca 1 urnn one
is a
comment ;
t he
bOX
I
draw a round the comment
i s j us t
to
make
f i l es
Def i n i t i o ns
rout i ne l y
i nc l Uded
1n
sys­
> /p " .
Of
set
mode
i ns t ead
I n st a l l i ng
a
" d i sp l ay
p r i n t i ng
never
code s .
ca l l ed Compr i n t
poss i b l e
command
procedure
l i ke
fi le
command
comp r e s s ed
d i s p l ay
I
a
an O k l da t a M i cr o 1 i ne 92
( n i ce pr i n t ­
I used t o s e t t he opt i ons on m y MX80
iii group Of
p rocedure f i l e s .
An exam­
tem .
pl e
i ns t a l l ed
1 :
T ab l e
n i ce .
here
be
wou l d
f i gure
t he l en g t h of t he modu l e f or you .
symbol
Pgml e n
1 s def 1 ned i n t he
l a s t 1 1 ne of t h i s prog r a m .
ou t
I f you a r e l OOk i ng a t t he ou tput of t h e
a ssemb l e r ,
t he t wo
1 i nes a f t e r t he i n t r o ­
duc t o r y commen t a re I F P 1 and ENDC .
I n t he
o r i g i na l
source
t he r e
is
a
l i ne
be t we e n
t hese , · us e /dO/def s /d e f s l i s t " , wh 1 c h ca l l s
i n a l i s t of USE commands wh i ch make f i l e s
c o n t a i n i ng
of
t he
make
al l
t he
p r og r a m .
t he
These
res t o f
the
if
t he
s y s t em
er
s i m i l ar
i nc l uded
i n
rest
of
set
t he
t he
def i n i t i on s
program
words
Prgrm+Ob j c t
T he
r e p l aced w i th t he much
$11
def i n i t i ons
system
more
second pass
file.
n i t i ons
I
used
t he
t he a s semb l e r
any
in
memory
t he
so
t he
l ocat i on
I i ke
oth­
•
def i n i t i o ns
f i l es
don ' t
pr i n t
bot h
because
bly
d i rect i ve
as semb l e r
encou n t e r s
not
-1
pr i nt
wh i ch
d i rec t s
any t h i ng
u nt i l
t he
i t
O P T I d i rect i ve .
The def i ­
I rout i ne l y i nc l ude i n a s s em­
b l i es a re 1 i s te d i n t ab l e T ab l e i .
n l t i on s
t he
OP T
to
f i l es
-Name "
i tsel f ,
to ass i gn
t he name .
f or
that
to
I
l oc a ­
conven i en t
f or
you
to
l i ke
to
def i ne
t he
modu l e
t ype
as
a
symbol
before
the MOD
s t a tement
and
j us t p u t t he symbol her e .
The modu l e
t ype t e l l s OS-9 wha t k i nd Of t h i ng t o
expect t h i s nodu l e t o do .
T h i s modu l e
is
a
program
( not
a
SUbrou t i ne
or
da t a ) , a n d i t cons i st s of obj e c t code
( no t data or some sort of i n termed i a t e
code ) .
no
t hey aren ' t read on t he second pa s s ( when
output i s gener·ated ) , and because t he f i r s t
l i ne i n t ne de f i n 1 t i on s f i l e i s t he a s s em ­
conta i n i ng
name
name
choose
MODULE T YPE
I
r e a s o n f o r t he a s semb l e r to read i t on both
t he f i r s t and second passes ; not read i ng I t
d u r i ng t he second pass saves a gOOd d e a l o f
t i me . a n d p re v e n t s t he l i ne s i n t he def i n i ­
t i ons f rom be i ng i nc l uded i n t he program ' s
1 ; ne
numbe r i ng .
The
1 i nes used f ro m t h e
t he
program
you
mOdu l e i f i t i s
dO i t t h a t way .
t h rough
1 15
name
T he prog r am ' IS n a m e i s u s u a 1 1 y
t i on .
p l aced c l os e to t he modu l e header , b u t
1t
Can
be
pl aced
e l sewhere
in
t he
s y s t em def i ­
there
the
he l p
symbo l s
t a kas
i Sn ' t
the
of
def i n i t i ons ,
weren ' t
program .
Throughout
the
No s ta tement
def 1 n e s
Tni s
readab l e .
o r some
S¥MBOL USED FOR PROGRAM NAME LOCA T I ON
but
wou l d
have
to
be
l eSS unde r s t andab l e
def i n i t i ons .
program
t ne
-
pa r t
def i ne d i n t he def i n i t i on s f 1 1 es ( a nd a f ew
a dd i t 1 0n a l
SET
commands
in
the
program
i tse l f )
wnenever
I cou l d .
The
I F P 1 /ENOC
1 s
w rapped around t he use s t a t ement
w h i ch
p r e ve n t s t he ex t ra f i l es f rom be i ng read on
t he
The
•
REV I S I ON
Th i S
f ield
con t a i ns
t wo
t ypes
of
i nf o rma t i on .
I t i nd i ca t es Whet her t h e
modu l e i s reent r a n t , u s ab l e b y seve r a l
d i f f er e n t users a t t he same t i me , a n d
g i ve s
gram .
the rev i s i on number Of the p r o ­
Mos t we l l
w r i t te n p r og rams a re
ree n t ra n t , 50 . s i nce 0 5 - 9 u s e s reen t ­
rant
modu l es
non-reentrant
more
ef f i C i en t l y
modu l es ,
mos t
t ha n
programs
Column F i ve
27
S hou l d
be
l abe l ed
reent r a n t ,
T he
r ev i s i on number i s u se d when � mOdu l e
is
l oaded
f rom
d i sk
to
d e t e r m i ne
whe t he r
t he modu l e s hou l d rep l ace a
rnodu 1 e
by
t he same
name
a 1 ready
in
memo ry .
A modu l e w i t h a h 1 gher r ev i ­
s i on number w i l l r ep l ace a modu l e w l t h
l ower
number , T h i s
is
p a r t i cu l ar l y
a
usef u l
i f you wa nt t o ove r r i de a m o d ­
ule
wh i ch
has
b e e n p l aced
in
ROM ,
U n l e s s you want to supers ede a modu l e
i n memory t he re V i s i o n shou l d be i .
ENTRY PO I N T
name
a s s i gned
to
t he
f i rs t
T he
i ns t r u c t i on i n t he p r ogram .
I u s ua l l y
i ns e r t
a
l i ne
b ef o re
t he
f i rs t
i ns t ruct i on i n t he p rogram w i th t h i s
name on i t .
T h i S saves a l i t t l e b i t
o f t yp i ng i f I
want t o a d d i ns t ruc ­
t i ons b e f o r e t he f i rs t i ns t ru c t i on i n
a program .
M I NIMUM AMOUNT OF PE RMANENT STORAGE
REOU I RED
•
T he amount of s t o r a ge t he p r og ram w i l l
need i n add i t i on t o t he s t o r age used
f or t he modu l e i t s e l f .
T h i s numbe r ,
1 i ke t he program l engt h , can be ca l ­
cu l a ted by t he a s semb l er - - n o t e t he
a few
MemS l ze equ .
T he l i ne a f t e r t he M O D s t a t ement t e l l s t he
a s s emb l er t o reserve space f or one b y t e o f
s t orage .
T h e next
t wo
1 i nes r e s erve 2 5 5
more bytes ,
T he t o t a 1 m e m o r y r e q u i remen t s
o f t h i s p r o g r am a r e one b y t e f o r t he p r i nt ­
e r ' lII pa t h numbe r ,
and 255 b y t e s f o r t he
stack .
The s t ack prObab l y doesn ' t neea t o
b e t ha t l a rge f or t h i s S i mp l e program . bu t
0 5 -9 i s go i ng to a l l oc a t e memory i n 256
byte u n i t s even o n a l eve l I sys t em . s o I
p l ayed i t saf e and squandered t he memo r y o n
t he s tack .
T h e r e su ' t s of a ' l oca t i ng t oo
l i t t l e spaoe � o r t he s taok a re very u np l ea ­
sant ,
The equa te a f t e r t he rmb f o r t he s ta c k
u s e s t he
" .
spec i a l
s ymbo l
w h i c h means
t he ou rrent o f f se t i n t he data def i n 1 t i ons .
T h i s i s an easy way t o g e t t he a s s e mb l er t o
te l l u s how mUCh s t o rage t he p r og r am w i l l
need f or use 1 n t he MOD s t a t emen t .
The next
two
l i ne s
a r e t he modu l e ' S
name ( pO i n t ed t o by t he modu l e name f i e l d
i n t he modu l e header ) . and t he v e r s i on num­
The modu 1 e name m u s t be def 1 ned 101 1 t h
ber .
a FC5 III t a t ement .
T h i s t ype of dat a def i n i ­
t i on c l o s e s t he s t r i ng i t
1 111 def i n i ng by
se t t i ng t he h i gh order b i t on 1 n t he l a s t
byte
"t"
is $F4
i ns tead o � $ 7 4 .
Th i S
l e t s 05-9 know Where t he e nd o f t he name
is.
T he byte a f t e r t he name i s by conve n ­
t i on
t he vers i on
number
of
t he
program .
Some u t i 1 ; ty programs d i Sp l BY t h i s numbe r ,
but
1t
1 s op t i ona l ,
No t h i ng
awf u l
wi l l
happen 1 f you s ta r t r i ght i n w i t h aa t a o r
program a f t e r t he p rog ram name .
The ve r s i on number i s t he l as t overhead
unt 1 1
the ve r y end o f
t he p rogram .
T he
f cc ' s and f eb ' s f o r t he n e x t 40 or 111 0 l i ne s
def i ne
con s t a n t s
needed
in
t he
program .
AOout the on l y i nt er es t i ng t h i ng abou t t hem
i s t ha t each of t he s t r i ng s def i ned w i t h a
fcc
i s f o l l owed by f eb C$eR ,
a ca r r i ag e
r e t u rn .
At
f i rs t
it
l OOks
1 1 ke
I c ou l d
have saved space by u s i ng one < C R > f o r a l l
the
s t r i ng s ,
but
it
t u r ns
out
t ha t
t he
28
OS - 9 U s e r N o t e s Vo l ume
I
extra
COde
needed
mor e
memory
r e t u r ns .
than
for
that
t he
a pproach u s e s
ext r a
car r i age
The prog ram s ca ns t he parame t e r s t r i ng ,
and i f c e r t a i n cha r ac t e r s are f ou n d . sends
cha r a c t er
s t r i ngs
to
t he p r i n t e r .
T here
are t hree phases :
f i r s t t he i nput l engt h .
i n 0 , i s checked .
I f i t 1 s one ( o r l o we r )
t he r e i s no parame t er s t r 1 ng ; 1 n t h i s c a s e
d i sp 1 ay a menu o f o p t i ons, .
Second ,
scan
t he pa ramet e r s t r i ng for t he cha ract e r " I "
wh i ch deno t e s a dev i ce name .
I f t he r e i s a
dev i ce
name
in
t he paramet e r .
open
t hat
dev i ce a s t he p r i nt e r . o t herw i se open t he
dev i ce
IP .
T h i rd ,
scan
t he
parame t e r
s t r i ng a ga i n i gnor i ng a n y c ha r a c t e rlll i n a
dev i ce name .
T ra n s l a t e each c h a r ac t e r t o
upper case a n d compare t he t ra n s l a t ed C ha r ­
Each
a c te r t o e a c h s i gn i f i ca n t charac t e r .
t i me
a
s i gn i f i ca n t
charac t e r
is
found ,
t ransm i t
t he appropr i a t e charac t e r s t r i ng
to
t he p r i n t e r ,
and
send ' a
l i ne t o
t he
s tandard ou t pu t
pa t h d e s c r i b i ng
what
ha S
been done ,
There
are a coup l e o f
s i mp l e
t r i ok s
wh i ch a re u se f u l wh i l e scann i ng t he pa r am e ­
ter
s t r i ng ,
T he
s he l l
a l ways
t e rm i na t e s
t he
p8 r amet e r
s t r i ng
w 1 th
a
ca r r l age
retur n .
Thi s
l et s me t e rm i na t e t he scan
when I e noou n t e r a ca r r i age r e t u r n i ns te a d
of hav i ng t o count bytes .
Da t a b y t e s m a y
have t he par i t y b i t on o r o f f .
I r e move
t he par i t y b i t
w i t h H anda N $ 7 F . ·
I f t he
pa r i t y b i t i s l ef t on . t w i ce as many c o m ­
par i sons n e e d t o be done .
F o r examp l e . " a "
cou l d b e $6 1
o r $E 1 .
In
thi s
case ,
I
t hought
it
wou l d
be
bes t
to
t reat
bo t h
upper
and
l ower
callie
c h a rac t e r s
as
t he
same .
T he eaS i es t way t o do t h 1 s
i s to
t ran s l a te a l l
l ower callie l e t t e r s t o upper
case ( or v i ce versa i f you l i k e ) .
Once you
deter m i ne that a charac t e r i s a n upper c a s e
l e t t e r i t c a n be t rans l a te d t o a l ower c a s e
l e t t e r by subt ract i ng $ 2 0 f r om i t , o r and­
i ng % 1 1 0 1 1 1 1 1 w 1 t h i t .
T he r e a re t wo sec t i ons o f t h , s p r ogr am
respons i b l e
for
ou tput .
Common 1
wr i tes
s t r i ng s t w o bytes l on g t o t he p r i n t e r .
It
uses
t he
l $W r i te
serv i ce
requ e s t
w h i ch
a
s p ec i f i ed
number
of
charac t e r s
wr i tes
w i t hout any e d i t i ng . T he r e 1 5 n o t h i ng spe­
c i a l abou t two byt e s : i t i s j u s t t he l eng t h
o f t he l ongelll t c o n t r o l s t r i ng I want e d t o
b e a b 1 e t o send t o the pI" j n t a r .
1 padded
t he shor t e r con t r o l s t r i ng s t o t wo byt e s by
add i ng
a $00.
a
nul l ,
to
t he m .
Common2
wr i t es up to SO charac t e r s to t he III t a nda r d
output
pat h .
Common2
uses
t he
I$Wr i t Ln
serv i ce request wh i ch t reat s the ca r r i ag e
r e t u r n a s a spec i a l case .
When i t encou n­
t e r s a c a r r i age return i t does whateve r t he
pa t h des c r i pt o r i s l e t up to do on end o f
l i ne ( normal l y • •nd <CR><U:»
a n d re t u r n s .
T h i S means t ha t by t e r m i na t i ng each s t r i ng
t o be wr i t t e n by Common2 W i t h a <CR> I maKe
i t unnec e s s a r y to k now t he l engt h o f a ny o f
t he s t r i ngs .
ThiS
program
ends
in
e i t he r
of
t wo
p l ace s .
I f t he r e a re no e r r or s . a f t e r t he
second scan t he program b r anches
to Ex i t
wh i ch c l e a r s t he .ca r r y b i t i n t he cond i t i on
code
and
pe r f o rms
the
F$E x i t
aer v i ce
requ e s t
r e t U r n i ng
con t r o l
to
OS-9 .
If
t he r e i s a n e r ro r . oon t ro l goes t o E r rX i t
wh i Ch s e t s t he c a r r y b i t and r e t u r n s c o n ­
t ro l
to 05-8 .
You m i gh t expect that t he
best way to set or c l ear t he c a r r y b i t i n
t he
cond i t i on
a n dce
and
COde
o rce
reg i s t e r
1 15
i ns t ruc t i on s .
w i th
t he
T hos e
i ns t r u c t i o n s c e r t a i n l y are a b l e t o t u rn t he
c a r r y b i t on a n d o f f . b u t t he COM i ns t r u c ­
t i on t u r n s t he ca r ry b i t o n f a s t e r ( a nd t he
e l l<
i ns t r uc t i on t u r n s
i t off faster )
t han
t h e obv i ou s i ns t r u c t i on .
Whenever t he A o r
B accumu l a t o r i s f ree . i t i s f a s t e s t to s e t
or c l ea r t he c a r r y f l a g by p l ay i ng w i t h t he
accumu l a t o r .
At
t he v e r y e nd of P O p t t he r e a r e t wo
f i na I
I i n e s of o v e r h ea d .
The E MOD d i r e c ­
t i ve
causes
t he
a s s emb l e r
to
gene r a t e
a
chec k s u m
for
t he
mOdu l e
wh i ch
is
used
When
t h i s p rog r a m i s
run
to make c e r t a i n t ha t
the
modu l e
Is
va l i d
a nd
u n damaged .
The
1 i ne w i t h
" "gmlen
equ
.. ..
ca l cu l a t e s
t he
l en g t h of
t he modu l e f o r u s e
i n t he MOD
s t a t ement a t t he v e r y beg i nn i ng of t he mod­
ule.
THE 05-9 USER ' S GROUP
A n O S - 9 U se r ' s G r oup was f o r med 1 e s t sum­
mer .
I cou l dn ' t s a y i t ' s t h r i v i ng , b u t i t
i s com i ng a l on g .
The c l ub ha s a t e l ephone
bu l l e t i n
boa r d ,
a nd
l ot s
of
dreams .
It
i s n ' t go i ng t o go a ny w h e r e u n l e s s p l e n t y o f
0 5 -9 u s e r s j o i n i t .
Membe r sh i p i s $ 2 5 f o r
i nd i v i dua l s
( payab l e
to
OS-9
Use r s
G r oup
c/o T e r r y S t r e eh l ey 1 005 Roo l e lane . S e n t a
B a r b a r a C A 9 3 1 03 } .
I s t r o ng l y s u gge s t t ha t
a l l O S - 9 u s e r s j O i n t h e g r oup .
E ve n w i t h
t he r e l a t i ve l y s ma l l
membe r s h i p t h e g r oup
now has ,
a l ot of
i n t e r es t i ng
i n f o rm a t i on
p as s es t h r ough t he b u l l et i n b o a r d .
I f we
al l join,
t h i s g r oup cou l d become a g r e a t
resou rc e .
THE FUTURE OF TH I S COLUMN
T h e re
i s enough ma te r i a l
for
a no t he r s i x
mont h s o r mor e o f cO l u m n s abou t concu r r e n t
p r oce s s e s .
but
I a m go i ng t o move o n t o
I t seems
some o t h e r s ub j e c t s f o r a wh i l e .
t he r e a r e a g r e a t many new O S � 9 users o u t
t here , some o f w hom have w r i t t e n to me a s k ­
i ng f or he l p w i t h t h e f undamen t a l s of t he
sys tem .
T he p r o g r a m t h i s mon t h i s a f i r s t
a t temRt t o he l p t he s e p e o p l e .
I ' l l t ry t o
devo t e a t l ea s t pa r t o f t h i s co l umn t o O S - 9
baS i c s f o r t he n e x t f ew m o n t h s .
C o l umn F i v e
29
POPT PROGRAM
M i c r oware 05-9 As s emb l er 2 . 1
08/05/84 2 3 : 06 : 3 2
POp t - Change P r i nt e r S e t up Op t i on s f o r ML 93
P age 00 1
NAM
P Op t
0000 1
TTL Change P r i n t er S e t up O p t i on s f or ML 9 3
00002
*-------------------------------------- ---------------- *
00003
*
*
P r i n t e r S e tup Op t i on s
00004
*
*
c
C o r r e s p on d e n c e Qua l i t y
00005
*
*
00006
*
,,<
0
Ten CPI
00007
*
'*
2
12 C P I
00008
*
*
7
1 7 CP I
0 0009
*
7:
Doub l e W i d t h Char a c t e r s
000 1 0
*
*
5
Five CPI
000 1 1
.,.
7<
6
S i x CPI
000 1 2
*
*
8
E i gh t CP I
000 1 3
*
*
000 1 4
*
*
r
r e s e t t o i n i t i a l c ond i t i ons
000 1 5
*
*
000 1 6
*
*
Lead i n f or a l t erna t e p a t h nam e . D e f au l t
/
0 00 1 7
*
*
i s / P . The p a t h name mu s t e i t he r b e t h e
000 1 8
*
l a s t parame t e r , o r s epar a t ed f r om the n e x t *
0 00 1 9
'*
.,.
par ame t e r by a d e l imi t e r .
00020
*
*
0002 1
*
*
The opt i ons are s p e c i f i e d a s pa rame t e rs when
00022
*
POp t 1 S run . I f no opt i ons a r e s p e c i f i ed , a menu *
00023
*
*
i s p r e s en t e d .
00024
*
*
00025
*
'*
Examp 1 e s :
00026
,,<
,,<
popt rc2
0002 7
*
'*
->
Printer Res e t
00028
*
'*
->
C o � r e s p ond�nc e Qu a l i t y P r i n t i ng
00029
'*
*
->
P r I n t Den s I ty twe lve charact e r s p e r i n ch
00030
7:
*
0003 1
*
*
p o p t r6 / p 1
00032
1,
*
Pr i n t e r R e s e t
->
00033
*
*
->
P r i n t Dens i t y s i x cha r a c t e r s p er i n ch
00034
*
->
{ output wa s d i re c t e d to the p r i n t e r a t / p l 1 *
00035
*
'*
You can p u t the pr i n t o p t i on s o n e 1 t her o r b o t fi
00036
*
*
s i d e s o f the dev l c e name . . .
00037
*
*
p op t rc / p 1
i s the s ame a s
p o p t r /p l c
00038
*------------------------- --------------------- --------*
00039
I FP 1
00040
END(
0 0042
set
Prgrm+Obj c t
00 1 1
Typ e
n0043
R evs
set
R e En t - 1
008 1
r �044
. ;45
0000 8 7 C004BA
MOD
PgmLen , Name , Typ e , Revs , En t r y , MemS i ze
P r t P t hN rmb
1
46 0 0000
255
S t a ckSz s e t
; J047
OOFF
s pa c e f o r s t a ck
S t ackSz
0 0048 D 0001
rmb
00049 D 0 1 00
Hems i ze e q u
j P Op t /
00050
0000 5 04F7 0F4
Name
f cs
1
0005 1
001 1 0 1
Ed i t i on f eb
1
00052
000 1
Num b e r of S t andard Output Pa t h
S t dOut
s et
0005 3
001 2 2F50
" /p "
De f au l t P r i n t e r N ame
DPr t Nam fec
C $CR
0 0 1 4 00
00054
f cb
*******
00055
* R e s pons e s f o r e a ch p r i n t e r o p t i on s e t
00056
'*
00057
00058
00 1 5 5 0 7 2696E
Msg5 C P I f e c
/ P r i n t dens i t y f i ve chara c t er s p e r i nch (
fcb
C $CR
00059
004A 00
00060
004B 5 0 726 96E
Ms g6CPI f c c
/ P r i n t dens i t y s i x charac t e rs p er i n ch ( d
0006 1
007 F 00
feb
C $ CR
/ P r int dens i ty 8 . 5 charac t e rs p e r i n c h ( d
0 0062
0080 5 0 7 2696E
Hsg8CP I f c c
fcb
C$CR
00063
00B4 00
/ P r i n t dens i t y 1 0 char a c t e r s p e r i nch (n o
0006 4
00B5 5 0 72696E
Ms g 1 0C P I f c c
f eb
C$CR
00E2 00
0 0065
/ P r i n t d ens i t y t we l ve char a c t e r s p e r i n c h
00066
00E3 5 0 72696E
Ms g 1 2CP I f c c
fcb
C$CR
0006 7
0 1 0B 00
00068
0 1 0e 50 72696E
Ms g 1 7CP I f c c
/ P r i n t dens i ty 1 7 char a c t ers p e r i n ch/
00069
0130 00
feb
C $CR
00070
0 1 3 1 436F7272
HsgCQ
fcc
/ C o r r e s p oncien c e Qua l i t y P r i nt ing/
0007 1
0 1 5 0 00
feb
C $CR
00072
0 1 5 1 50 72696E
Ms gR s t
fcc
/ P r i n t e r Res e t /
00073
0 1 5E 00
feb
C SCR
L
.•
30
05 -9 U ser Notes Vo l ume I
M i c r owa r e OS-9 A s s em b l er 2 . 1
08/05 /84 23 : 06 : 3 7
P O p t - Change P r i n t e r S e t up O p t i ons f o r ML 9 3
00142
*-------------------- ----------------- - - - ----*
*
N o a l t e rna t e p r in t er p a t h f ound
n0 1 4 3
0 0 1 44
0 0 1 45
0 0 1 46
(' ' 4 7
l
48
00 1 49
00150
00151
00152
00153
00154
0 0 1 55
11 0 1 5 6
(10 1 5 7
0 0 1 58
;) 1 59
, J 1 60
1. < 1 1 6 1
(J1J 1 62
r'0 1 6 3
(;0 1 64
()0 165
�)0 1 66
00167
00 1 68
00 1 69
00 1 70
00 1 7 1
00 1 7 2
00173
0 0 1 74
00 1 75
')0 1 76
�O l 7 7
)0 1 78
�,-) 1 79
,0180
f)O 1 8 1
. 82
�83
>0 1 8 4
.J0 1 85
00 1 8 6
00 1 8 7
00 1 88
00 1 89
00 1 9 0
00 1 9 1
00 1 9 2
00 1 9 3
00 1 9 4
30 1 95
00 196
)0 1 9 7
00 1 9 8
00 199
00200
002 0 1
00202
00203
00204
00205
00206
00207
00208
00209
002 1 0
002 1 1
002 1 2
002 1 3
32
P a g e 003
�><
----- -------- - - - - - - - - - - - - - - - - - - - - -----------
0343
0 3 4 3 308DFCCB
0 3 4 7 2 0ED
0349
0349 � 5 36
Loop 1D
Loop 1 E
*
1 eax
bra
DP r t N am , P CR
Loop 1 1
Open the defaul t p r i n t er p a t h
puI s
D,X, Y
r e s t o re .
x_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ h
*
*
*
*
Loop2 s c ans t h e parame t e r s t r i ng f or
p r i n t e r c on t r o l opt i ons . I f an op t i on i s
f ound the c o r r e s p ond i ng s ubrou t i ne i s
*
*
*
*
*----------------------- ------------ --------- *
Loop2
034B
X+
I da
034B A68 0
anda
$7F
c l e ar par i ty b i t
034D 8 4 7 F
034F
035 1
0353
0355
0357
0359
035D
035F
036 1
0363
0365
036 7
0367
0369
036B
036D
0 36F
037 1
0373
0375
0377
0379
037B
037D
037F
038 1
0383
0385
0389
038B
038B
038C
038F
038F
039 1
0395
0398
039C
039F
03A1
03A3
03A3
03A5
03A9
03AB
03AF
03B2
03B4
c a l l ed .
8 1 0D
2738
8 1 20
23F4
8 1 2F
1 02 7 00EO
cmpa
beq
cmpa
bIs
cmpa
1 be q
�
�$OD
xit
#$20
<CR > ?
cont r o l charac t er ?
yes ; l o op
s t a r t o f a p a t h n ame ?
Y e s ; Sk i D o v e r the p a t h name
Loop2
1/ ' /
�k i p PN
* - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - -------------�
*
*
T r ans l a t e l ower t o upp e r c a s e i f
*
*
n e c e s s ar y .
*---------------------------------- ----------*
8161
2506
8 1 7A
2202
8020
cmpa
b10
cmp a
bh l
suba
#'a
Loop 2 1
#'z
Loop 2 1
l ower to upp e r c a s e
1/$20
Loop21
*---- ---------- ---------------------------- -*
*
*
Ana l ys e t h e pa rame t er
*---------------- ----------------------------*
8152
res e t ?
cmpa il ' R
2 72 4
Res et
beq
cmpa
beq
8 1 43
2 7 34
8 1 30
2743
8 1 32
2751
8 1 35
2 760
8 1 36
276F
8 137
2 77E
8 1 38
1 02 7 008B
20CO
5f
1 03F06
3410
308DFDD8
1 7008F
308DFDB5
1 7 0094
35 1 0
20A8
3410
308DFDB6
8D7C
308DFD82
1 7008 1
3510
2095
cmp a
beq
cmpa
beq
cmpa
beq
cmpa
beq
cmp a
beq
cmp a
1 be q
br a
Ex i t
R es e t
Co
#'C
C o r r e s p ondence q u a l i t y?
#'0
'ten C P I
fl ' 2
T w1 vCP I
#'5
F i veCP I
#'6
S i xC P I
#'7
Svn t nCP I
#'8
E i ghtCP I
Ten CPI
Co
Twe l ve CP I
F i ve CP I ?
6 CP I
Sevent een CPI
E i gh t and a h a l f CP I ?
Loop2
OS9
F$Ex i t
s e t B ( r e t urn c o d e ) t o 0 a n d t
r e turn to OS-9
eax
l bs r
l eax
X
CCR s t , PCR
C omm o n 1
M S g R s t CR
C omm on
p o i n t a t R e s e t c on t r o l s t r i ng
wr i t e i t
p o i n t a t r ema rk
wr i t e i t
Loop2
g o s ea r c h f o r n e x t opt i on
c l rb
yshs
Ibsr
�ul s
ra
rshs
eax
bsr
l eax
1 bs r
�u 1 s
ra
05 - 9 U s e r N o t e s Vo l ume I
l
X
X
CCCO , PCR
C omm on 1
Ms gCQ , PCR
C ommon2
X
Loop2
Page 0 0 2
M i c r owa re OS-9 As s emb l er 2 . 1
0 8 / 0 5 / 8 4 2 3 : 06 : 34
POpt - Change P r i n t er S e t up O p t i on s f o r ML 9 3
00074
00075
00076
0 00 7 7
00078
0 0079
0 0080
0 008 1
00082
0008 3
00084
00085
0 0086
0 0087
0 0088
00089
00090
0009 1
00092
00093
00094
0 0095
0 0096
0009 7
00098
00099
00100
001 0 1
00102
00103
0 0 1 04
0 0 1 05
0 0 1 06
00107
0 0 1 08
0 0 1 09
001 1 0
001 1 1
001 1 2
001 1 3
001 1 4
001 1 5
001 16
001 1 7
001 18
00 1 1 9
00120
0012 1
00 1 22
00 1 23
00 1 2 4
00125
-00 1 2 6
00127
00 1 28
00 1 29
00 1 3 0
001 3 1
001 32
00 1 3 3
00 1 3 4
00 1 3 5
00 1 36
001 3 7
00 1 38
0 0 1 39
00 1 4 0
00 1 4 1
*** ***
015F
0161
0163
0165
0 16 7
0169
0 16B
0 16D
*
'*
P r i n t e r C on t r o l S t r i ngs
1B31
1E1F
lC l F
1D1F
1 EOO
1 COO
1000
1 8 00
C CC Q
C C 5 CP I
C C6 C P I
C C8 C P l
C C OC P I
CC2 C P I
CC7CP I
C CR s t
fcb
fcb
fcb
fcb
fcb
fcb
fcb
fcb
l
Ib ' I
1E:$lF
1C. SIF
$lD, SlF
$lE.O
S lC . O
$10.0
$18 . 0
S e t c o r r e s p ondence qua l i t y
Five C P I
S i x CP I
E ight C P I
Ten C P I
Twe l ve C P I
S even t e en C P I
r e s e t p r i n t er
**** ******
*
0 16 F
0 1AO
0 1A1
0 1 BA
0 1 BB
01E1
0 1 E2
O l F8
0 1 F9
021A
021 B
024 1
0242
0267
0268
029A
029B
02CO
02C 1
02E9
02EA
03 1 5
0316
'*
The Menu
4E6 F 2 06D
00
492F4 F20
00
5 04F7074
00
20522020
00
20432020
00
2 0 3 52 0 20
00
20362020
00
20382 020
00
2 0 302020
00
20322020
00
2 0 3 7 2 020
00
ErrMs g l
Er rMs g 2
Menu 1
Menu2
Menu3
Menu4
MenuS
Menu6
Menu7
Menu8
Men u 9
Ent ry
fcc
fcb
fcc
f cb
fcc
fcb
fcc
feb
fcc
feb
fec
feb
fcc
fcb
fcc
fcb
fcc
fcb
fcc
feb
fcc
fcb
I N o m o r e than 1 27 byt e s o f parame t er s are
C$CR
. 1 /0 e r r o r on p r i n t e r pa t h .
C$CR
/POp t a c c ep t s the f o l l ow i ng pa rame t e rs : !
C $CR
I R - R e s e t t h e pr i n t e r !
C$CR
/ C - C o r r e s p onden c e qua l i t y p r i n t l
C $ CR
! 5 - Pr i n t at f i ve chara c t e r s p e r i nch!
C$CR
/ 6 - P r i n t a t s i x chara c t e r s p e r i nch!
C $CR
/ 8 - P r i nt a t e i gh t and a h a l f c har a c t e r
C $ CR
/ 0 - P r i n t a t t en chara c t e r s p e r i nchl
C $CR
/ 2 - P r i n t a t twe l ve char a c t e r s p e r i nch
C$CR
/ 7 - P r i n t at s ev en t e e n c h ar a c t e r s p e r i
C $ CR
***************
* X p o i n t s t o t he s t a r t o f t h e parame t er area .
* Y p o i nt s t o t he end o f t h e parame t er a r e a .
0316
0 3 1A
03 1 E
0322
0326
0328
0328
0 3 2A
032C
032E
0330
0332
0334
0336
* The l a s t chara c t e r i n
'* 0 c on t a i n s t h e l eng t h
1<
the p a r am e t er area i s a <CR > .
o f t he p a r am e t e r area .
cmpd
IbIs
cmp d
l bhs
1 0830001
10230 1 37
1 08 30080
1 02 40 1 7E
#1
Menu
# 1 28
�rr o r 1
Che ck l eng th o f parame t e r a r e a
i f t he r e 1 S n o t h 1 ng t h e r e ; D i s
I t ' s har d t o d e a l w i t h param e t
h ig h ; p arame t e r a r e a t o o l ong
* --------------------------- ----------------- *
* Sear ch p a rame t e r s f o r o u t p u t dev i ce ove r i de *
* -------- ------------------------------------*
3 4 36
A680
847F
8 1 00
2713
8 1 2F
26F4
30lF
Loop 1
Lo o p l 1
��
p sh s
O,X.Y
I da
anda
empa
beq
cmpa
bne
l e ax
X+
7F
� 00
oopl D
#'!
Loop1
-l,X
�
save everything
c l e a r par i t y b i t
<CR > ?
s t ar t o f p a t h name ?
back up one t o I
*-------------------------------------------- *
*
*
O p en a l t erna t e p r i n t er p a t h
0 3 36
0338
033B
033F
034 1
* - -- - - - - -- - - - - - - -- - - - - - -------------------- --*
86 0 2
1 03F84
1 0250 1 4 F
9 700
2 006
I da
OS9
1bcs
sta
bra
#Wr i t e .
I $Open
Error2
P r t Pt hN
Loop1 E
s av e the p a t h numb e r
C o l umn F i ve
31
M i c r owa r e 05-9 As s emb l e r 2 . 1
08 / 05 / 8 4 23 : 06 : 39
P Op t - Change P r i n t e r S e t up O p t i ons f o r XL 9 3
002 1 4
002 1 5
002 1 6
002 1 7
002 1 8
002 1 9
00220
002 2 1
00222
00223
00224
00225
00226
002 2 7
00228
00229
00230
002 3 1
00232
00233
00234
00235
00236
002 3 7
00238
00239
00240
002 4 1
00242
00243
00244
002 45
00246
00247
002 48
00249
00250
0025 1
00252
0 0253
00254
00255
00256
0 02 5 7
0 0258
00259
00260
0 02 6 1
03B6
03B6
03B8
03BC
03BE
03C2
03C4
03C6
03C8
03C8
03CA
03CE
0300
03D4
0306
0308
030B
03DB
03DD
03E l
03E3
03E7
03E9
03EB
03EE
03EE
03FO
03F4
03F6
03FA
03FC
03FE
040 1
040 1
0403
0407
0409
040D
040F
04 1 1
0414
04 1 4
04 1 6
04 1 A
041C
0420
0422
0424
00262
00263
0 02 6 4
00265
00266
00267
00268
00269
002 7 0
002 7 1
00272
00273
002 7 4
00275
00276
0 02 7 7
00278
00279
00280
0028 1
00282
00283
00284
00285
042 7
0427
0429
042D
0430
0432
0433
0433
3 4 10
3 08DFDAB
8D69
3 080FCF 3
8D6F
35 10
2083
3410
3 08DF09 B
8D5 7
3 08DFOOF
8D5D
3510
1 6F F 7 0
34 1 0
3 08DFD80
8D44
3 080FC2E
8D4A
35 1 0
1 6 FF5D
34 1 0
3 08DF06F
8D3 1
3 080FC5 1
8D3 7
35 10
1 6 FF4A
3410
3 080F06 4
8DIE
3 080FCFF
8D24
3510
1 6 FF 3 7
34 1 0
308DFD4B
8DOB
3 08DFC60
8Dl l
35 1 0
1 6 FF 2 4
9600
1 08E0002
1 03F8A
255C
39
8601
82j� i8��gg
TenCPI
Twl vC P I
F i veCP I
5 i xCP I
SVn tnCP I
E i gh t CP I
C ommon 1
pshs
l e ax
bsr
l e ax
ba r
puI s
bra
p s hs
l e ax
bs r
l ea x
bsr
puIs
I br a
pshs
l eax
bs r
l eax
bsr
pu l s
l b ra
043C 39
CCOCP l PCR
C ommon i
Ms g I OCP I , PCR
C ommon2
X
Lo op2
X
CC2CPl PCR
C ommon i
Ms g 1 2CP I , P CR
C ommon2
X
Loop2
X
CC5CP I . PCR
C ommon l
Msg5CP I , PC R
Common2
X
Loop2
X
CC6CP l PCR
Common i
Ms g6CP I , PC R
Common2
X
pshs
l e ax
bsr
l e ax
bs r
pu l s
l b ra
X
CC 7CP l PCR
Common i
Ms g 1 7CP I , PCR
Common2
p s hs
l eax
bsr
l eax
bsr
puI s
Ibn
X
l da
l dy
bcs
rts
I da
6�9
rts
50
X
p s hs
l eax
bsr
l eax
bs r
puIs
l b ra
OS9
C omm on2
P age 004
Loop2
X
Loop2
CC8 C P I PCR
Common 1
Msg8CP I , PCR
C ommon2
X
Loop 2
P r tP thN
112
I $Wr i t e
E r ro r 2
�S t dOut
¥gSr i t Ln
P r i n t e r P a t h Numb e r
l eng t h
I/O error on pr i n t e r path
o u t p u t p a t h f o r r emar k s
max l en g t h o f s t r i ng s
*--------------------------- -----------------*
*
S k i p over a l t erna t e p r i n t er pa t h n am e
*
*----------------------------------- ----- - ---*
043D
043D
043F
044 1
0443
0447
0449
044D
044F
0453
A680
847F
8 1 0D
1 027 FF44
8 1 20
1 02 7FEFE
8 1 2C
1 027 FEF8
20E8
S k i pPN
I da
anda
cmp a
l be q
cmpa
l b eq
cmpa
l beq
bra
�
X+
$ 7F
C$CR
xit
I;CSSPAC
L oop2
I; '
Lo bp 2
Sk i p P N
<CR > ?
yes ; done
< sp ac e > ?
end o f p a t h n ame
end of p a t h name
C o l umn F i v e
33
08 / 0 5 / 8 4 23 : 06 : 4 1
M i c r owar e 05-9 As s emb l e r 2 . 1
POpt - Change P r i n t e r S e t up Op t i ons for HL 93
00286
00287
00288
00289
00290
002 9 1
00292
00293
00294
00295
00296
0455
0455
0459
045 B
045 F
046 1
0465
046 7
046B
0460
0 47 1
00299
00300
003 0 1
0479
0470
047 F
00297
00298
00302
00303
00304
00305
00306
00307
0 0 3 08
00309
003 1 0
0 03 1 1
003 1 2
003 1 3
003 1 4
003 1 5
003 1 6
003 1 7
003 1 8
003 1 9
00320
0032 1
G0322
00323
00324
00325
00326
003 2 7
00328
00000
00000
$04BA
$ 0 1 00
$24F1
34
04 73
0477
0483
0485
0489
048B
048E
048E
0490
0494
0498
049A
049D
049 F
04A2
04A4
04A4
0 4A8
0 4AC
04AE
04B 1
04B3
04B 3
04B4
04B7
04BA
Page 005
Menu
Menu 1 , PCR
I e ax
C ommon2
bsr
Menu2 , PCR
l e ax
C omm on2
bs r
l e a x Menu 3 , PCR
C ommon2
bsr
Menu4 , PCR
l e ax
C ommon2
bsr
Menu5 , PCR
l e ax
C ommon2
bsr
308DFDFI
Henu6 , PCR
1 ea x
80BA
C ommonZ
bsr
3 080FE 1 E
Menu7 , PCR
I e ax
8 0B4
C ommon2
bsr
3 080FE3E
l e a x Menu8 , PCR
80AE
C ommon2
bsr
3 080FE6 1
I e a x M enu9 , PCR
8 0A8
C ommon2
bsr
1 6FEFO
Ex i t
I br a
*-------------------------- ----------- - - *
*
*
End wi t h an e r r o r
*------------------ ---------------- -----*
Error i n p r i n t er p a t h
*
equ
Error2
s av e e r r o r c ode
p s hs
B
3 404
1 08E 0050
#80
I dy
3 080F009
l eax
E r rM s g 2 , PCR
8 6 02
#2
I da
1 03F8C
I SWr i t Ln
OS9
3 5 04
puI s
B
r ec over e r r o r c o d e
p r i n t e r r o r mes s age
F$PErr
1 03FOF
OS9
2 00F
ErrX i t
bra
3 08DFD62
8 DD8
3 08DFD8 3
8 002
3 08DF094
8DCC
3 080FDB O
80C6
3 08 DF00 1
8OCO
1 08 E 0 0 5 0
3 080FCC3
8602
1 03F8c
C60 1
43
1 03 F06
285 0 3 0
E r ro r 1
E r rX i t
PgmLen
e qu
l dy
l ea x
I da
OS9
1 db
c oma
OS9
EMOO
equ
error (s )
warn i ng ( s )
0 1 2 1 0 p r o g r am byt e s gen e ra t ed
0 0 256 ca t a byt e s a l l oca t ed
09457 byt es u s ed f o r s ymb o l s
15 - 9 U s e r No t e s Vo l um e I
*
P arame t e r s t r i ng t o o l ong
#8 0
E r rMs g l , PC R
#2
Error output
lSWr i t Ln
#1
e r r o r c ode
F$Exi t
*
s e t c a r ry
COLUMN S I X
p r og r ams
f or
D E C Pasca1
pa t i b i I i t y
OS-9
by
i t se l f
does
very
l ittle
usef u l
wor k .
Y ou wo n ' t f i nd a n e d i t o r , a s semb l e r ,
comp i l e r , s pe l l i ng check e r . or p a y r o l l s y s ­
t em anywhere o n t he s t a n d a r d d i s t r i bu t i o n
d i sk .
T h a t i s n ' t t o s a y t ha t you ca n ' t g e t
t he s e p r og r a m s f o r O S - 9 , o r e v e n t ha t some
of t hem a r e n ' t somet i me s paCkaged w i t h t he
opera t i ng
s y s t em
(Gimix
packages
M i cr o ­
war e ' s
a s semb l e r ,
ed i t o r ,
debugge r ,
BaS i c09 . a n d R u nB w i t h e v e r y 0 5 - 9 s y s t em ) .
but
OS-9
and
i n t ha t
car:
be
f or m
p ur c h a s ed
i t
with
no
fri l l s ,
i s e s se n t i a l l y u se l e s s .
F o r a n expe r i enced
m i cr ocompu t e r
user
w i t h l o t s of f r i en d s u s i ng 0 5 - 9 and a nea r ­
by s t o re w i th a l a r ge s t ock o f O S - 9 s o f t ­
wa r e t he t a sk o f choo s i ng t he r i gh t a r r ay
of sof t wa r e cou l d be f un . b u t f o r me i t w a s
f r i gh t en i ng .
T he l ea s t expens i ve s o f t wa r e
I
cou l d f i nd c o s t
about
f i fty dol l ars
a
I
c r a ck . a nd i t w e n t up f e s t f r om t he r e .
d i dn ' t
k no w
a nyone
r u n n i ng
OS-9 .
and .
t hough t he r e w e r e many compu t e r s t o r e s
in
Roches t e r , t he o n l y one wh i ch dea l t i n 6a09
based
mach i nes
b e l i e ved
s t rong l y
( nea r l y
exc l u s i ve l y ) i n T S C s o f t wa r e .
I g r i t ted my
I
t ee t h and bought w h a t l ooked good t o me .
was
surp r i sed
to
f i nd
t ha t
everyt h i ng
I
bought w a s at
1 ea s t
OK .
I n r e t r ospect
I
can see t ha t ; t wa s n ' t so very s u rp r i 5 i ng
t ha t I w a s l ucky i n my s o f t wa re purcha ses ;
mos t of t he sof t wa r e f or 0 5 - 9 i s gOOd .
W i t h 0 5 -9
I g o t t he M i c r owa r e E d i t o r ,
A s semb l e r . Debugge r . a n d P a s ca l .
I have no
spec i a l
l ove
f or
t he
M i c r o w a r e Debugge r .
b u t I s t i l l u s e i t because i t i s t he o n l y
game i n t ow n .
I t u s u a l l y i s packaged w i t h
0 5 - 9 , and i t i s ha r d t o g e t a l ong w i t ho u t ,
e s p ec i a l l y i f y o u do a s s e mb l y l anguage p r o ­
g r amm i ng ,
but
I
hope
M i c roware
f ee l s
a
t ou c h of
hum i l i at i o n e a c h t i me t he y send
out a copy Of t ha t p ro g r am -- i t i s not up
to
t he
s t a nda r d
set
by
t he i r o t h e r
pro­
grams .
T h e a ss e mb l e r 1 s unexc 1 t i ng . but i t
does t he j ob .
T he r e a r e o t her assemb l e r s
a r ound . but t h e M i c ro w a r e assemb l e r i s t he
s t anda r d .
The M i c rowa r e E d i t o r i s ha rd to c l a s s i ­
fy.
It
is
t he
on l y
n o n - s c r een -o r i ented
ed i t o r f or 0 $ - 9 t ha t I k now of .
I t wor k s
f i ne a s a s i mp l e e d i t o r .
but
i t m i gh t b e
mo r e accu r a t e t o c a l l
i t a s i mp l e s t r i ng
p r oces s 1 ng
l anguage .
T he ed i t O r
f ea t u re s
space s .
a n d a h i g h power e d
mu 1 t i p 1 e wor k
ma cro 1 anguage wh i c h c a n b e used t o w r i t e
fa i r l y
s op h i s t i ca t ed
p r o g rams .
Tne
bad
s i de o f a l l t h i s soph i s t i ca t i on i s t ha t i t
i s a l i t t l e b i t h a r d t o u se t he ed i t o r f o r
s i mp l e t h i ng s .
I have never been ab l e t o
f i gu r e o u t
how t o copy a r ange o f 1 i nes
w i t ho u t u s i ng a d i sk
f i l e as a t empo r a r y
ho l d i ng p l a ce .
I do n ' t u s e t he "' 1 cr owa r e
Ed i t o r
very
f reQuent l y
s i nce
I
got
a
screen- o r i e n t e d ed i to r , b u t I got a l ot o f
wo rk done o n l t wnen i t w a s the on l y e d i to r
I had , a nd I s t i 1 1 use i t occa s i ona l l y .
I
shou l d a dd t ha t some peop l e t h i nk ed i t o r s
for
1 i ke
t he M i croware ed i t o r a re b e t t e r
p r og r a mm i n g t ha n t h e mo r e w o r d p r ocess 1n "
o r i en t e d ed i to r s .
I t i s hard f o r me to be mode r a t e i n m y
pra i se f o r M i c r owa r e ' s P a s ca l .
1 wish i t
i nc1 uded a debugge r . a nd t he procedu r e f o r
to
ex t er n a l
p rocedu r e s
is
a
bit
l i nk i ng
c l um sy , b u t I l ove i t .
I use i t to deve l o p
c l asses
whe r e
t he
a n d I BM P a s ca 1 a n d
p rob l ems .
T he r e
s t uden t s
have
are
use
n o com­
enough
enhancemen t s t o make t h i S P a s ca l u s ef u l f o r
ree 1 app1 i ca t i on s ( s uch a s a PROMPT bu 1 1 t ­
i n p rocedure wh i ch f or c e s ou t t he cont en t s
of
an
o u t pu t
buf f e r
w i t ho u t
a
carr i age
return ) .
T h e comp i l e r gene r a t e s i n t e rmed i ­
a t e code w r i c h can be execu t e d by e i t he r o f
t wo i n t e r p r e t e r s ( one no r ma l . a n d t he o t he r
suppor t i n g
l Zl rg e
p r og r ams
by
a
pag i n g
a r rangemen t ) ,
na t i ve code .
or
t ra n s l a t ed
i nto
e f f i c i en t
Recent 1Y I got B a s j c09 .
Y ou m a y have
guessed f r om my comm en t s t ha t I a m get t i ng
t o l i ke i t even t hough i t i s c a l l ed Ba s i c .
have Oyna S t a r ,
Oyna F o r m .
and Oynll.S ­
pe1 1 f rom F r a n k HOQ£i L a b s .
None o f t he s e
p rograms a r e except i ona 1 .
but
1 u s e t hem
a l l r egu l a r l y .
DynaSt a r
is
a
screen­
o r i ent ed e d i t o r w i t h ·wh i c h I h a v e t yped a n d
r e v i s ed many hundreds of page s .
I t i s bes t
a t ed i t i n g documen t s , bu t u sa b l e f o r p ro ­
g rams .
I expect t he reason t he p r o g r a m i s
c a l l ed DynaS t a r i s t ha t i t b o r r o w s h ea v i l y
f rom
Wo r d s t a r .
My mother
uses
W o r ds t a r ,
and I
f i nd
t ha t
I
can he l p he r u n ta ng l e
some
prob l e m s
w i th
Word s t a r
by
Z1 s su m i ng
t ha t i t i s k ey s t roke f o r k ey s t roke i de n t i ­
c a l w i t h Dyna S t a r .
I have some s ma l l com­
p l a i n t s abou t D y na S t a r . b u t t he bot t om l i n e
i s t ha t I 1 i ke ; t w e 1 1 enough t o h Zl v e spent
hundreds of hours u s i ng i t .
Oyna F o rm
j s
a
text
f o r ma t t i ng/ma 1 1
m e r g e program .
It
i s fu l l
of f a nc y Ma ; 1 Merge f e a t u re s t ha t I ne v e r use .
I use i t
t o p r i n t f i l es w i t h opt i ona l
page header s
a n d t r a i l er s .
unde r l i n i ng , a n d b o l d p r i n t ­
i ng .
A f ew t i me s I have used i t s a b i l i t y
t o gene r a te
i ndexes
and a
t ab 1 e
of
con­
t en t s .
Dyna F orm does n ' t do we l l w h e n com ­
p a red t o t he h i gh powered t ex t f o rm a t t i ng
packages
u s ed
on
l arge
compu t e r s .
bu t
I
d on ' t t h i nk i t i s i nt ended t o comp e t e w i t h
t ha t k i nd Of t h i ng .
The t h i ng about D y n a ­
F orm t ha t annoys m e mo s t f requen t l y i 5 t ha t
i t can ' t be cus t om i zed t o u se t he speC i a l
f ea t u r e s
of
my p r i n t e r .
It
p r i nt s
bo l d
t e x t by s i mp l y p r i nt i ng t he b o l d c h a r ac t e r s
t h ree t i mes . Dyna S t a r c a n b e u s e d t o i mbed
p r i nt e r
co n t r o l
Charac t e r s
in
text ,
but
D y na F o r m on l y k nows o n e way t o p r i nt bo l d
o r u nde r l i ne d t ex t .
I a l s o w i s h i t wou l d
use
t he
s t andard
i np u t
and
ou t p u t
pa t hs
i ns t ead of a l l ocat i ng spec i a l pa t h s .
OynaS t a r and DynaForm Were w r i t t en by
A l l a n Jos t .
T hey show s i gn s of be i ng w r i t ­
t e n by a p r og rammer w i t h a very p ro f e s s i o n ­
a l a t t i tude .
T hey a r e not l oaded w i t h f e a ­
t u re s but t hey a re so re l i ab l e t ha t I j us t
t ake t hem f o r g r a n t e d .
1
D ynaspe l l
Is
a
spe l l i ng
chec ker .
need a s pe l l i ng checker ver y ba d l y .
Some
peop l e bu y compu t er s t o run a s p r eadsheet
program .
I m i gh t have bou gh t one t o r u n a
OyneSpe l 1
essent i a l l y
spel l i n g
c hecke r .
l oo k s up each w o r d i n a document i n a s e t
o f d i c t i on a r i es .
Any w o r d s t ha t i t does n ' t
f i nd
are
t reated
as
Que s t i onab l e
wor d s .
7hese words can be f i x ed , accept e d as
; Ii ,
or
accep t ed
and
added
to
a
d i c t i o na r y .
Dyna5pe 1 1 i s n ' t as c8f'efu 1 1 y wr i t t e n a s t he
there
is
no t h i n g
p r og r am s by A 1 1 an \Jo s t ;
mZl j o r w rong , b u t t he met i cu l ous c a r e i s n ' t
t he r e .
When DynaSpe l ' r u n s o u t o f space t o
s t ore
words
in.
i t
spews
out
pages
of
C o l umn S i x
35
" ov e r f l ow " me s s a ge s .
T here
i s no w a y t o
t he c o n t en t s o f
t he
d i rec t o ry when
J ynaSpe l l
i s a s k i ng for
t he name o f
t he
f i l e t o chec k .
When you a b o r t t he program
( w i t h III cont r o l C )
i n order t o c heck t he
d i rec t o r y a ga i n . D yn a S pe l l
l eaves t he t e r ­
m i na l ' s
dev i ce
d e sc r i p t o r
in
a
s t ra nge
state .
O y n a S pe l l has most of t he f e a t u res
commo n l y
f ound
in
spe l l i ng
checker s
fo�
m i c r ocompu t e r s , bu t i t doe s n ' t compare w i t h
s i m i l a r p r og r a ms o n l a rger mach i ne s .
Maybe
a spe l l i ng checker
i s one of
t hose t a s k s
wh i ch needs f a s t mach i ne s w i t h l a r ge memo­
r i es .
I
want
a
spe l l i ng
chec k e r
whi ch
he l ps m e c o r r e c t m i s s pe l l ed words by g i v i ng
me a
l ist
of
sugge s t ed s pe l l i ngs .
and
a
1 n t he s a u r u s wou 1 d be a no t her n i ce
bu i 1 t
touch .
Sti l l ,
I use D y naSpe l l when i t i s
i nconven i en t t o s h i p m y f i l es o f f t he t he
I BM t o be checked .
I t i sn ' t a great pro­
g r am , b u t i t d o e s i t s j Ob .
':.i·'eck
I rev i ewed O y naCa 1 c a f e w mon t hs a g o .
s t i l l l i k e t he program , a n d i t i s s t i l l
I wou l dn ' t h a ve chosen Dyna­
heav i l y u sed .
C a l c a s pa r t of m y core g roup o f s o f t wa re
I I mos t l y prog ram and wr i t e w i t h my compu t ­
e r ) b u t I c a n i ma g i ne peop l e who m i gh t n o t
need a n y o t her p ro g r a m .
I
NEW RELEA SE OF M I CROWARE PASCAL
I j u s t got re l ea s e 2 . 0 o f M i c r oware ' s P a s ­
ca l .
I t i s eo ma j o r re v i s i on .
i nc l u d i ng a
new
i n t e rmed i a t e code
l a ngu a ge .
a
S i ng l e
genera 1
purpose
l - co de - t o - n a t i ve- code
t ra ns l a t o r . a nd new run t i me suppor t mod ­
u l es .
I d i dn ' t do a n y caref u l compa r i sons
of t he two ve r s i ons , bu t I get t he s t rong
f ee l , ng t ha t t he new re l ease comp i l es f a s t ­
a n d runs f a s t e r .
The new m a nu a l
i6
er ,
S i gn i f i ca n t l y
be t t er
o r ga n i zed
a nd
more
comp l e t e t han t he o l d one . bu t s t t l l makes
no a t t empt to t ea c h Pasca l .
Two new s t a n ­
dard f u nc t i ons have been added :
GETCHA R .
wh i c h
returns
a
s i ng l e
chara c t e r
f r om
i nput , and I O R E AD Y . wh i ch re t urns t rue i f
t he r e i s i np u t ready .
T hese new f unct i on s
"mou l d b e use f u l
f o r i nt e r ac t i ve app l i ca ­
: i o ns l i k e ed i t o r s .
05 - 9 D I RECTOR I ES
A d i r ec t o r y
1 S a speC i a l type of f i l e con­
t a i n i ng i nf o r ma t i on abou t f i l e s .
It cou l d
be seen a s some t h i ng l i ke a l i bra r y ' s c a r d
I t con t a i ns t he names o f f i l es a l ong
f i le.
with
i nf orma t i on
about
them .
espec i & l l ),
U n l i ke a n yt h i ng a
where t he y c a n be f ound .
p r oper 1 i b rary w ou l d c o n t a i n . t he e n t r i es
i n a d i rectory a r e n ' t k ep t i n any p a r t i C U ­
Y o u c a n get a f orma t ­
l a r l y u se f u l o r de r .
t e d l i s t i ng o f t he cont en t s o f a d i r ec t o r y
w i t h t he D l R comma nd .
O S - s o l i ke UN I X a n d many other mu l t i ­
user
opera t i ng
s y s t ems .
suppor t s
h i erar­
c h i es o f d i rect o r i es o n d i sk .
D i rec t o r i es
c a n be used f o r a number of t h i ngs , o r . I f
you l i ke , l a r ge l y i gnored .
A d i r ec t o r y c a n
co nt a i n any number of o t he r d i rect o r , es i n
ado i t i on t o norma l f i l e s .
Every d i s k ha s a r oot d i rec t o r y on i t
Wh i ch i s c re a t ed when t he d i sk i s f o rma t ­
t e d . a nd cannot be done away w i t h .
Un l e s s
y o u f u s s a round w i t h I N I T a n d S Y S GD t he
36
OS- 9 U s e r No t e s Vol ume
I
d i s k you boo t of f of mu s t have a d i rec t o ry
c a l l ed CMOS i n i t s root cl i re c t o r y .
T here
may a l s o be a S Y S . a nd a D E F S d i rec t o r y i n
t he root d i r e c t o r y o n t he boo t d i S k when
you i ns t a l l O S - S o
Y ou ( t he u s e r ) can c re a t e new d i recto­
r i e s w i t h t he MAKO I R comma nd .
T o use t he
command t ype MAKD I R f o l l owed by t he name o f
t he n e w d i rec t or y y o u w a n t to c r ea t e :
HAKDIR / D l /SOURCE. DIRECTOR Y
I t has become a convent i or1 to u s e cap i ta 1
l et t e r s
f or
d i r ector i es '
name s .
OS-9
doe s n ' t heve a n y t roub l e w i t h
l owe r case
d i r e c t o r y name s . b u t i t i s a n ea s y way o f
r em i nd i ng one s e l f wh i ch f i l es a r e d i r e c t o­
r i es .
I t i s some t i me s t r i ck y to keep t ra c k of
1 i b r a r y of severa l hundred ( ma ybe t hou ­
sand )
f i l es .
Mu l t i p l e d i rect o r i es
are a
m a j o r he l p i n o r g an i z i ng f i 1 es i n s u c h a
way a s to max i m i ze t he chance o f f i nd i ng
t hem
a ga i n .
L on g
ago
I
f ou n d
t ha t
1
c ou l dn ' t f i t a l l my f i l e s on one d i sk ( t ha t
was a 1 0CK f l oppy baCh t hen ) .
l Pl.J t eacn
ma j or p roj ec t on . a sepa r a t e d i sk .
Wh9n I
got d i sk d r i ve s w i t h g r e a t e r d a t a capac i t y .
I
f ound t ha t
1t
w a s n ' t a n unadu l t er a t ed
good t h i ng .
E a c h d i S k c o n t a i ne d 5 0 many
f i l es t ha t i t was a maj or j ob to l oc a t e a
f i l e even k no w i ng wh i C h d i SK i t w a s on .
I
worked o u t nam i ng conven t i ons t h a t made t he
j ob e a s 1 er . b u t t hey u s e d up t he f i r s t two
c ha r a c t e r s o f each f i l e name - - t he r e s u l t ­
i ng
f i le
names
were
pret t y
c r yp t i c .
I
s t i l l keep hundreds of f i 1 es on eaCh c:I ; S k ,
b u t my 1 e r ge5 t d i r e c t o r y ha s about f o r t y
f i 1 es ; n i t .
III
T he root
d i r ec t o r y on a d i s k
have
l abe l ed · pasca l i " con t a i n s no t h i ng but sev­
UT I L . S R C ,
en
D I S T . SRC ,
c:l i rec t o r i e s :
5US R . S R C , BUGS , D E F S . DOC . a nd PCOD E .
E ach
o f t hose d i r e c t o r y names de s c r i bes wha t I
expect to f i nd i n t hem pr e t t y we l l
( t o me
a ny how ) .
E a c h d i r ec t o r y w i t h p r ogr ams
in
i t cont a i ns a d i rec t o r y c a l l ed DOC w h i c h
con t a i ns
r e l a te d
docume n t a t i on .
If
it
seems l i ke I have l a rge numbe r s o f d i r e c t o ­
r i e s ca l l ed DOC .
i t ' s t r ue .
P r e t t y near
Somet i mes
ever y t h i ng needs docume n t a t i on .
1 4- i nd that III d i r e c t o r y b e g i ns t o get ou t
P r o j ect s t ha t I expe c t t o need
of con t rO l .
about t en f i l es have a w a y of expand i ng t o
f o r t y o r f i f t y f i l es .
A p r Oj ect 1 i k e t ha t
r ea l l y be l ongs i n a d i r e c t o r y o f i t s own .
sO I c r ea t e a new d i rec t or y i n t he d i r e c t o ­
r y t ha t cont a i ns t ne f i l es f o r t he p r o j e c t .
and move a l l
t he f i 1 es t ha t a re p a r t of
t ha t proj ect i nt o t he new d i r ec t o r y .
Any f i l e c a n b e accessed b y g i v i ng i t s
ful l
name .
e.g. ,
wou l d
/D 1 /UT I L . S RC/O F I X/ Compa c t e r
de note
t he f i I e Compa c t e r
i n t he d i rec t or y D F l X
w h i ch i s i n t he d i re c t o r y UT I L . SR C i n t he
root d i rec t o r y on d i sk 0 1 , b l.J t t ha t ' s more
t yp i ng than I w ou l d c hoose t o do except as
an act of des pe r a t i on .
T he most common l y
u sec:l S hor t c u t s a r e t he CHO . and CHX com­
mandS .
T he CHO command changes t he d i rec­
tory wh i c h i s t r ea te d a s t he root d i r e c t o r y
f o r d at a .
CHX d o e s t he same t h i ng f or t he
execu t i on c:l i r ec t o r y .
When 0 5 - 9 i s boo t ed t he da t a d i r e c t o r y
s e t t o t he root d i rect o r y o f t he boo t
�A.k . • na t he execu t i on d i r e c t o r y i s s e t t o
is
CMO S
in
d i Sk .
the
If
root
you
d i rec t or y
d i r e c tor y
want
on
t he
to
use
boot
on
f 1 1 es
d i sk ,
al l
t he
in
OIR
OIR
CHD
CHD
boo t
t he
�oot
you need
to
do
i s g i ve t he f i l e name .
i f you want to
u s e f i l es
i n a d i r e c t or y w h i ch i s
i n t ha t
d i rec t o ry y o u g i ve t he name O f t he d 1 rec t o ­
T he
ry
d i rect o r y
f
w i t h t he f i l e n a m e , e . g . , t o get a t t he
1 1 e O S SD e f s i n D E F S i n t he da t a d i rec t o r y
use
O E F S /O S 9 De f s .
d i r e c t o ry
d i rec t o r y
i sn ' t
can
the
If
C o n ve n i e n t
be
s e l e c t ed
defau 1 t
for
w i th
da t a
you ,
t he
a
new
CHD
com­
/D 1 .
way
CHD
T he
d oe s ,
CHX
c omma n d
but
it
works
e f f ec t s
t he
t he
1 i ne
T E S TD 2 .
a nd
t he
T h e re
are
d i rect o r y .
two
T he
spec i a l
"
"
execut i o n
ry .
i n
po i n t s
eve r y
to
t he
d i rec t o ry
i t se l f ,
a nd
t he
e n t ry
po i n t s to t he d i r e c t o r y t he c u r r e n t d i r e c ­
tory i s i n .
t he p a r e n t d i rec t or y .
A
t yp i ­
c a l u s e of t he " . . "
ent r y I 5 t o r e f er t o
s i b l i ng
l a rge ,·
r i es ,
f or
to
d i rec tor i e s .
break i t up
I
al l
in
a
d i rec t or y
t h e p ro J ec t .
t he
f i l e
When
i nto a
If
a
HexO e f s
a p r o j ect
ge t s
s e t o f d i rec t o ­
w h i ch
I
set
p r og r am needs
in
t he
a s i de
a c ce s s
d i re c t o r y
OEFS
wh i c h
is
a
s i b l i ng
of
t he
d i r e ct o r y
SRC
( where
t he
program
is).
I
can
use
t he
s h o r t hand
name
" . . / D E F S / HexOef s "
for
t he
fi le.
I h a v e f ou nd t h i s a good c o nvent i on
to
stay w i th .
As
l on g
as
I c o n t i nue t o
keep
f a m i 1 i es
r e l a t ed
of
f i l es
in
d i rec t o ­
r i es
that
are
s i b l i ng s ,
the
no t a t i on
" . . / D E F S · w i 1 1 a l wa ys g e t me to t he appro­
pr i a t e
DEFS
d i r ec t o r y ,
and
" . . / oc c "
wi l l
a l ways
ref e r
to
t he
r e l a t e d Docume n t a t i on
d i rect o r y .
To
exper i me n t
wi th
d i recto r i es ,
start
w i t h e d i s k w i t h some empt y space o n
i t ,
and use CHD
to set
t he d a t a d i rec t o ry t o
the
r oo t
d i r e c t o ry .
Bu i l d
some
d i rec t o ­
r i es :
MAKD I R TE5TD1
MAKDI R 1E5TD2
MAKDI R TES TD3
M a k e t h i ng s
a
Now
we ' re
command
at
shou l d
i n
t he
d i r e c t ory
exper i me n t
p l us
T ESTD2 .
a nd
t he
r-oot
s hOW
t he
d i r-ec t o r- y .
f i l es
t ha t
T E STD:; .
The
O I l<
f o l l ow i ng
show t he cont e n t s
t he
da t a
f ou r t h
d i rec t o r y
data
t h i rd
d i rec t o r y
command
a l l
t he
T he
t he
1 i ne
way
to
moves
out
to
a
is
easy
l ittle
to
create
i nvo l ved
P e rhaps
i t
1s
a
to
new
d i re c t o r i es ,
de l e t e
good
a
d i recto­
t h i ng
t ha t
it
reQu i r e s more t ha n one qu i ck ope r a t i o n t o
remove
a
d i rectory .
If
a
d i rec t o r y
w i th
f i l e s i n i t i s e r a s ed , e l l t he f i l es i n t he
removed
d i rectory
wi 1 1
rems i n
on
t he
d ; sk ,
but
0 5 - 9 w on ' t be a b l e t o l oc a t e
t hem .
O l de r ver s i o n s of D S - S d o n · t have a n y c o m ­
m a n d wh i ch w i l l d e l e t e a d 1 rec t o r y .
T o qo
a w a y w i t h a d i re c t or y w i t h t he s e o l de r ve r ­
s i on s :
de l e t e
al l
t he
f i l es
( an d
d i recto­
r l es )
i n t he d i r e c t o r y ,
u s e t he A T T I< c o m ­
m a n d t o c ha nge t he d i rec t o r y i n t o a n o r mll! I
fi le
( A T T I<
< d i r n a me >
-d l ,
and
de l e t e
t he
f i 1e
t ha t
used
t o be
t he
d i r e c t or y .
Be
pa r t i cu l a r l y
c a re f u l
not
to
use
ATTR
to
Change
t h e d i r e c t ory
i nt o a
r e gu l a r
f i le
u n t i l t he
easy
way
d l rectory
d i r ec t o r y
to
C h ange
so
you
i s e mp t y .
the
fi 1e
can
d e l et e
T here i s n o
back
i nto a
t he
f i l es
in
it
W i t h t he ne w re i e a s e o f O S - 9 , t he c o m ­
mand D E L D I R C a n b e u s e d t o de l e t e d i r e c t o ­
r i es .
D E L D I R s i mp l y a u t oma t e s t he s t ep s I
j u s t w e n t t h rougn .
D i r e c t o r i e s a r e an i mpor t a n t f e a t u r e o f
UN I X - l i ke
ope ra t i ng
s y s tems .
They
a l l ow
f i l es t o be g r ouped i n manageab l e c l u s t e r s ,
and m a k e
it
rent users .
I
set
e a s i er
to
hand 1
e
many
c o nc u r ­
am p r e pa r i ng t o eat s ome o f t he
d o w n i n m y f i r s t c o l um n .
I am
words
1 001<.-
T he
were
be f ore you s t e r t ed
thi S
t he
ai rec t o r i es
T E S TD 1 ,
T ESTO 1
10/
;1 1
a n emp t y d i r-ec t o ry .
DB" T E S7D2 w i 1 1
t he
d i re c t o r i es
T E ST02 1 ,
TESTD22 ,
T E5 TD23 ,
moves
t he
l ea v e
d i r e ct o ry .
t o conv i nc e m e t h a t r was w r o n g .
I f t h i ng s
I ' l l ho l d t he w o r o e a t i ng c e r emony
go we l l
nex t mo n t h .
l i t t l e m o r e comp l i ca ted :
back
l i ne s
root
1 ng
forward
to
thi s
w i t h a gOOd d e a l
of
p l e a s u r e -- t he y we r E! c r i t i ca l w o r d s .
S ome
peop l e have gone t o a f a i r a mo u n t o f e f f or t
CHD TESTD2
MAKDI R TE5TD2 1
MAKDI R TE5TD22
MAKDI R TES TD23
CHD TES1D2 1
MAKDI R TE5TD2 1 1
MAKDI R TE5TD2 1 2
MAKDI R T£5TD2 1 3
CHD , . /T£5TD22
MAKDI R T£5TD2 2 1
MAKDIR TE5TD222
CHD • . /TESTD2 3
MAKDIR T£STD2 3 1
MAKD I R 1£5TD23 2
CHD
CHD • .
OIR
It
bu t
e nt r i e s
entry
data
c ommand
t he
T ESTD23 .
same
d i r ec t o r y .
t wo
at
command
mand .
for
e x a mp l e ,
to
C h a nge
t he
data
d � rec t o ry t o t he r o o t d i r e c t ory o n 1 0 1 u s e
CHO
f i rst
TESTD 2 / TES T023
. / TE S TD2 / TE5TD23
T£STD2 ; DIR T£S TD23
TESTD2 /TESTD23 ; D I R
Of
commands
wi 1 1
sho\'.'
s h o lo
and
al l
t he d i r e c t o ry T ES T 02 3 :
Co l umn S i x
37
E
05 - 9 U s e r Not e s Vol ume
I
STANDARD TERM I NAL SUPPORT
FOR 05 - 9
t u n a t e l y , GOTOX Y i s hare to ca l l f rom some
l a nguages . and suppo r t s a t e r r i b l y l i m i te d
set of ope r a t i ons .
One o f t he f 1 r s t p r og r am s
I
wrote f o r a
m i c r o p l a yed " L i f e . " T h e game s t a r t s w i t h a
g i ve n p a t t e r n , and , by repea t ed l y a pp l y i ng
a s e t of r u l es , gene r a t e s a n d d i s p l a y s new
pat t erns .
If
t he p a t t e r n s
a re d i s p l ayed
p rope r l y on a C R T , t he c h a ng i ng f i gu re s on
t he s c reen can be f a sc i na t i ng .
( No t e ; L i f e
w a s i nv e n t ed by ,John Ho r t o n Conwa y , a n e nas
been
ext ens i ve l y
d i scu s sed
in
S c i e nt i f i c
Amer i can and B Y T E . ) I w a n t ed my p r og r am t o
be
u sab l e
w i t h mos t
t e rm i na l s ;
so
after
i nv e s t i ng
a
few
days
in
t he
p r og r am ,
I
s pe n t a n o t he r f ew wee k s t r y i ng t o m a k e i t
" dev i ce
i ndependen t . "
I n e v e r rea I I Y f i n ­
i s hed .
It
was
an
uncommon l y
fast
game ,
b u t , s i nce I c ou l dn ' t gener a l i ze t he t e r m i ­
n a l c on t rO l , no- one w i t ho u t a H i 9 w i l l ever
be a b l e to enj o y i t .
Many m i c r o s a VO l 0 t n i s p r o b l em b y n o t
u s i ng a t e r m 1 na l
(e .g . •
t he C o l o r C ompu t ­
e r ) , bu t peop 1 e , 1 i ke m e , who p r o g r a m com­
puters
w i t hout
a
bu i l t - i n
screen
mu s t
e i t he r u s e on l y t ho se cont ro l codes common
to a l l t e r m i na l s ( 1 i ke ca r r i age r e t u r n , and
1 i ne feed ) , o r expend a l o t of ef f o r t w r i t ­
i ng speC i a l code to hand l e d i f f e re n t t e rm i ­
na l s .
F u l l s c reen ed i t o r s a r e t he p r i me exam­
p I e of a
t ype of
program t ha t mus t
have
c o n t r e l of some of t he f ea t u r e s of t he t e r ­
m i na l , b u t many o t h e r h i gn qua l i t y p r og r a m s
suppo r t s o m e of t he f e a t u r e s t ha t m o s t t e r ­
m i na l s 5 ha r e .
E v e r y p r o g r am w i t h genera l ­
i zed
t e r m i na l
supp o r t
mu s t
be
conf i gured
f o r t he t e rm i na l ( o r t e r m i na l s ) i t i s sup­
posed t o work w i t h a s p a r t o f t he i ns t a l l a ­
t i o n of t he p r og r a m .
Some
p ro g r a m s
u se
a
speC i a l
modu l e
w h i ch c o n t a i ns t e rm i na l - sp ec i f i c code f or a
few
c r uc i a l
f u nc t i on s .
It
is
s i mp l e
to
i ns t a l l
a p r o g r a m t ha t u ses t h i s k i nd o f
t e rm i na l
cont r o l
p r ov i ded t ha t t he neces ­
s a r y mOdu l e
is
p r o v i de d .
If
a
S u i t ab l e
modu l e f o r your t e rm i na l
i s not a va i l ab l e ,
a new one mus t be w r i t t en i n a s s emb l y l a n ­
guage .
Ano t h e r a p p roaCh t o g e n e r a I i zed t e r m i ­
na l cont r o l i s t o u s e a conf i gu r a t i o n p r o ­
g r am t o a s k que s t i on s abou t
t he t e rm i na l
be i ng u s ed a n d
5 t o re
t he
i nf o rm a t i o n
in
t ab l e s w h i ch enab l e a s i ng l e t e rm i na l c o n ­
t r o l modu l e t o d r i ve a n y r e a s o na b l e t ype of
t e rm i na l .
I t i s sad t o 5ee s o much e f f o r t u s ed
It
s o l v i ng t he s ame prOb l em ove r a n d ove r .
i s s o na r d t o wr i t e a p r og r a m s o i t can be
a d j u s ted
for
U5e w i t h any
t e rm i na l
t ha t
even 50me comme rc i a l p r og r ams don ' t d o i t .
F o r sma l l p r og r a m s i t can t a k e m o r e w o r k to
i mp l ement
t e rm i na l
suppor t
t ha n
to
w r i te
t he r e s t of t he p r o g r am .
F ra nk Hogg L.abs
seems t o have dev e l oped a s t anda r d for t e r ­
m i na l con t ro l , t he GOT O X Y modu l e .
Once t he
i t
program ,
one
f or
i ns t a l l ed
is
mOdu l e
need not bo.l done aga i n except f :;r a new
t ype of t e rm i na l .
I f every s o f t w a r e d i S ­
i t
wou l d s t a nda r d i ze o n GO T OX Y .
t r i bu tor
wou l d m a k e 1 i f e III l ot e a s i er f o r p rogram­
F ra n k
s of t wa re .
of
purcha s e r s
and
mers
Hogg t e l l s m e t he GOT O X Y modu l es a r e not
p r opr i et a r y ,
s o t r"l i s i s a n a l t e r na t i ve A _
UnforUCSO Pasca 1 make5 d o 101 i t h n e more .
wou l d
1 i ke
to
propose
a
s t a nd a r d
i nt e r f ace f o r C R T t e r m i na l s .
I t w ou l d b e
much
eas i er
for
M i c roware
to
bu i l d
t he
s t a nd a r d c on t r o l s y s t em t ha n f o r me t o d o
i t , b u t i t l oo k s l i k e t he j Ob i s m i n e .
I
w i l l k i ck t he p r ob l em s I f i nd a round f o r a
P l ease he l p m e w i t h t h i s . I f
mon t h o r s o .
I have t o dev i se a s t a nd a rd i n a vacuum . i t
may no t p l ease enough peop l e t o be w i de l y
u sed .
The mos t
Any s t a ndard i s a comprom i 5 e .
i mp o r t a n t goa l
i s to make i t e a s y f o r a n y
p r o g rammer
to
use
t he
i nt e r f ace .
This
ru l es out a l l
t he l anguage - spec i f i c i n t e r ­
f aces .
T he ot her t wo i mpor t a n t goa l s a r e
t ha t
al l
t he c u r r'ent 1 y e x i s t i ng p r o g r a m s
w i t h ( or w i t hou t ) t e r m i na l c o n t r o l modu l es
mus t cont i nue t o o pe r a t e w i t ho u t mod i f i ca �
t i on , ana t ha t t he i nt e r f ace s hou l d p r ov i de
t he
most
soph i s t i ca teO
t er m i na l
c o n t ro l
poss i b l e .
S i nce
many
I anguages
can ' t
use
G E T S T A T / S E T STA T ,
or
o t �e r e x o t i c
ways
of
do i ng I /O ,
I be l i eve t he s t a n d a r d t e r m i na l
cont ro l modu l e shO�j l d e i ther be a ca l l a b l e
mOdu l e l i k e G O T OX Y , or some f o r m of f i l t e r .
The
ca l l ab l e
modu l e
wou l d be
more
e 1' f i ­
c i en t ; b u t d i f f e rent l anguages c a l l s u b r o u ­
t i ne s d i f f e re n t l y , a n d i t w ou l d be s a d t o
f O r sa k e t he b u i l t - i n I /O f a c i I U i es o f a
l anguage i n o rd e r t o r ou t e a l l t e rm i na l I /O
t hr ough a s i ng l e mOdu l e .
T h e r e a re s e v e ra l
p l a c e s a modu l e cou l d be p l aced i n t he t e r ­
m i na l I /O pa t h where i t cou l d a c t a s a f i l ­
ter
i s o l 21 t i ng
t e rm i n a l
spec i f i C
con t ro �
s t r i ngs on t he t e rm i na l S i de of t he f i l t e r ,
a nd s t a nda r d s t r i ngs on t he p r ogram s i de .
don ' t
be l i eve
tha t
t he
d i f fs rence
in
I
e f f i c i ency be t ween t he f i 1 t e r a n d t he Sub­
r o u t i ne method of t e r m i na l con t r o l
i s al l
T he f i l t e r method seems t o be
t ha t g r e a t .
t he bes t
approach
to
t he
t e rm i na l ­
i ndependent p r o g r a m p r ob l em .
f i l te r
met hod
requ i r e s
t ha t
al l
T he
p rograms a c t a s i f t he y a re b e i ng u se d w i t h
some
s tandard
t e rm i na l .
That
t e r m i na '
c ou l d b e i mag i na r y , b u t w i t h s o many d i f ­
f e re n t
t e rm i na l s
ava i l ab l e
Why
i n vent
a no t he r .
Two t e rm i na l s seem 1 i k e a t t r a c ­
t i ve c hO i ce s ; t he V T 5 2 a n d t he VT 1 00 .
T he
V T 1 00 i s espec i a l l y a t t rac t i ve becau s e
it
i mp l emen t s t he ANS I I s tanda r d .
I t wou l d be
n i ce to go w i t h t he accepted s t a ndard , a n d
I t h i nk I w i l l f i na l l y dec i de t o u s e a s u b ­
set
of
t he
ANS I I
s t andard
a
s ub s e t
because I don ' t r e i i sh t he i dea of t r y i ng
t hose f l aShy f e a t u r e 5 o n a
t o emu l a t e a l l
dumb CRT .
T he wor s t d i sadva n t a ge of
t he
A NS I ! s tandard p r o t oco l i s t ha t i t s c u r sor
con t ro l 5equences w i l l be ha r d to gene r a t e
i n a 5 se mb l y l anguage p rograms .
T he r o w a nd
It
co l umn have t o be i n A S C I I cha r a c t e r s .
hu r t s me t o t h i nk of
a p r og r ammer
b e i ng
f O r ced t o
i nc l ude b i na r y - t o - A S C I I
c o n ve r ­
s i on code i n h i s program j u s t $0 t he t e rm i ­
na l con t r o l modu l e can conv e r t t he numbe r s
back to b i nary .
T he VT52 i s r e p r e s en t a t i ve
of
mos t
mOdera t e l y
i n t e l l i ge n t
� e rm i na l s .
I t
cer ta i n l y
i nc l ude s
eve r y
f un c t i on
I
wou l d want to i nc l ude 1 n t he subset of t he
A NS I I s ta n d a r d I p l an to i mp l ement .
I n t he
s hor t run t he V T 5 2 i s a be t t e r cho i ce t ha n
t he VT 1 00 ; i t c ou l d b e e mu l a t e d mo r e e f f i ­
c i e n t l y , a nd wou l d be j u s t a s u s e f u l a s a ny
pract i ca l
subse t
of
t he
A NS I I
s t andard .
siAa4ar_
Te rm i na l S uppo r t f o r OS - 9
39
�ti" ,
I
be l i e ve
t ha t
in
t he
l o ng
run
, d he r ; n g t o the mos t w i de l y accepted sten­
:ar d i s the best p o l i c y .
I am l oo k i n g f o r
a gooo e x c us e t o u s e t he V T 5 2 a s
t he s t a n ­
d a r d , b u t haven ' t f ou n d a good enough o n e
yet .
T he
cho i c e
of
t he s u b s e t
i s another
t r i ck y dec I s i o n .
The m i n i m um u s e f u l subset
i5
e i ther
t he d i rec t
c u r s o r po s i t i on i ng
command , or t he s e t of c u r s o r up ,
down ,
l e f t , a nd r i gh t command s .
Actua l l y .
home
c u r s o r i s adequa t e f o r mos t purpo s e s , b u t
i t t a k e s a s u b s t a n t ; a1 a mo u n t o f w o r k t o
p r o g r am f o r a t e rm i na l t ha t i s t ha t dumb
T he r e a r e many pow e r f u1 commands t h a t make
i t e a s i e r t o program f o r a t e r m ; na 1, and .
more
i mpo r t an t ,
cut
down
t he number
of
c ha r a c t e rs t h a t need to be s e n t to t he t e r ­
m i na l
t o a ccomp l i sh s ome oper at i o n .
If
f ewer c har ac t er s need t o b e s e n t t o ( sa y )
c l ea r
t he s c re e n ,
t he n
t he
s c r ee n w i l l
c l ear f a s t e r and t he numbe r of i nt er r up t s
t he compu t e r w i l l need t o s e r v i ce w i l l be
decrea s e d .
However . t he more f ancy t e r m i ­
n a l c on t r o l commands a re i n c l uded i n t he
s t anda r d , the l a rger t he t e rm i na l con t r o l
modu l e w i l l ge t .
The r e 1 s no reason t he f i l t e r t r i ck
c an ' t be a pp l i ed t o t e rm i n a l i npu t a s we l l
a s ou t pu t .
F o r some o f the l e ss powe rf u l
t e �m l na l s i t w i l l be nece s s a ry t o p a s s a l l
i npu � t h rough t he f i H e r i t o r d e r to k no w
Where t he c u r s o r i s ; howe ve r , a l l t e rm i na l s
w i l l benef i t f r om f i l t e r e d i npu t .
A n i npu t
f i 1 t e r w i 11 perm i t s t a nd a r d program f un c ­
t i on keys ,
a r r ow keys ,
t he c l ear s c �een
k ey . a nd perhaps some o t her spec i a l Key s to
4lL
OS - 9 U s e r Not e s Vo l ume
I
be def i ned .
T he f o l l ow i ng i s a l i s t o f t e r m i na l
c on t r o l
s t r i ng s
in
descend i ng
order
of
l i k e l i hood to be i n t he subse t :
•
D i r e c t cursor p os i t i on i ng
•
C l ea r to end of 1 i ne
•
P F keys/C l e a r Key/ A r row Keys
•
•
A l ternate cursor
u n de r s co r e } / norma l
H i gh l i gh t on/Of f
o r i n t en s i f y )
cu r s o r
( b l oCk /
( e i t her reve r s e v i de o
2 5 t h ( or o t her spec i a l )
l i ne suppo r t
The f o l l ow i ng are s i gn i f i ca n t l y ha rder ;
•
S a ve c u r s o r
pos i t i on
pos i t i o n / re t u r n
to
•
I nsert /de l e te l i ne
•
D e l e t e c ha r a c t e r
•
E n t e r / l eave i ns e r t cha r a c t e r mode
saved
Wi l l
COnsu l t eve r y o ne
can t h i nk o f
about t h ; s . a n d " o p e t he p e o p 1 e I d on ' t
t !", i nk o f w i l l wr i t e o r ca l l me w i t h t he i r
t hough t s .
ol f t e r a mOn t h o r t w o ' s t h ough t .
1 w i l l t ry to wr i t e t he coce t o s uppo r t t he
s ta ndard f o r at
l ea s t
one
t e rm i na l .
I
wou 1d apprec i a t e a ny he I p or adv i ce 1 c a n
ge t .
COLUMN SEVEN
•
•
L a s t mon t h I p r om i sed t ha t I wou l d e a t
some wo r d s t h i s mo n t h .
I n t he f i r s t co l umn
I w r o t e for 6 8 M i c r o 00u r na l , I sa i d t ha t I
was s o r ry no one was us i ng more t ha n 6 4 K
f o r a s i ng l e p r og r am u n d e r O S - S , a n d I made
t he po i n t
r a t he r s t r o ng l y t ha t 6 80 S - ba s e d
comp u t e r s s h ou l d not be s h a r e d .
to
Sev e r a l
l oo k a t
m o n t h s ago Dav i d B rown a s k e d me
his
v e r s i o n of MUMPS
for
t he
6809 .
Str i ct l y
spea k i ng ,
s i nce
MUM P S
doe s n ' t
r u n under a s - 9 ,
it
is out
of
my
a r ea , b u t i t i s i nt r i gu i ng .
T he ver s i on of
MUM P S
Dav i d B r own
sent
me
u se s
a
fairly
soph i s t i ca t ed v i r t u a l memo r y scheme , and i s
not ef f ec t ed cy 64K bounda r i e s .
S i nc e
it
does n ' t r u n u nder a s - S ,
I
st i l l
cha 1 1 enge
someone to be t he f i r s t w i t h a p ro g r a m t ha t
u s e s more t ha n 64K a t once under 05 - 9 , bu t
s i nce Dave B r own ' s
wor k
is
i mp r e s s i ve ,
I
gave i t a m i xed bu t genera l l y n i ce rev i ew .
My
mo t he r
is
t he
s e c re t a ry
of
t he
schoo l boa rd back i n t he t own where I g r e w
up .
S he has g i ven me a very
i n t e r e s t i ng
p i pe l i ne
i n t o t he w o r k i ngs of a m un i c i pa l
s choo l
s y s t em .
Recent 1 y t here has been a
l ot
of
fuss
abou t
comp u t e r s
at
s cho o l .
P r e - c o 1 1 ege s c hoo 1 s have t o make a numbe r
of
d i f f i cu l t
dec i s i o ns
i n t he p r o c e s s
of
i nt e g r a t i ng
compu t e r s
in
t he
e d u c a t i o na l
proce s s .
E ve n t he cho i ce of t he b e s t c o m ­
pu t e r i s comp l i ca t ed f o r t hem by t he s c a r ­
c i t y of
good
sof twa re f o r
t he i r
pu r po s e s
( a nd
t he i I"
unce r t a i n t y
concern i ng
what
s o f t w a r e t hey need ) , a nd by t he wor s t k i nd
of f i na nc i � l
p ro b l ems .
When I hea r d t ha t
m y home town was go i ng t o comm i t i t se l f t o
a gagg l e o f m i crocomp u t e r s runn i ng B a S i C , I
f e l t mo t i v a t e d t o r e s ea r c h t he sUb j ec t w i t h
towa r d t a 1 k i ng t hem ou t
of B a s i c .
an eye
T he O S - S use r s '
g r oup ' s bu l l e t i n board i s
of ten a good s ou r ce o f i nf orma t i o n , and i n
thi s
case
it
was s u r p r i s i ng l y u s e f u l ;
it
t u r ns ou t t ha t many 0 5 - 9 u s e r s a r e i nv o l ved
in
educat i on .
Once
s t a r t ed on
t he
i de a
t ha t 0 5 - 9 m i g h t b e a good s o l u t i on f o r some
of a
s c hoo 1 s
s y s t em ' s p r ob 1 ems ,
I
r u bbed
some f i gu r es t oge t he r and came t o some c o n ­
c l us i ons t ha t s hou l dn ' t have s u r p r i s ed me .
It
i s c l ea r
t ha t f i na nc i a l
c o n s i de r a ­
t i ons a r e c r u c i a l l y
i mpo r t a n t
to a l l
t he
scho o l s y s t ems I know of .
One m i c r o c a n be
enough
to f i t
i n t o a budget ,
i nexpens i ve
but one App l e i s not very u sefu l f or t e a c h ­
i ng a c l a s s
of
t h 1 rty .
I
f i gu r e
t ha t a
h i gh s c hoo l
comp u t e r l ab s hou l d be s e t up
t o t each P a s c a 1 ,
word p rocess i ng ,
t he u s e
of a s p read s h e e t , a n d t he use o f compu t e r s
in
t he
sc i ences .
I
k now
f rom
exper i ence
that s t uden t s can be l ab pa r t ne r s and w o r k
as a t eam o f t wo w i t ho u t t o o much t roub l e ,
but t hree or more s t uden t s wor k i ng t o ge t h e r
wi l l
have p r o b l ems .
F i gu r i ng t h i r t y s t u ­
dent s i n a c l a s s , t he l ab w i l l need f i f t een
s t a t i ons .
T he m i n i mum conf i gu r a t i on I c an
put
together
is
f i f teen
m i c r os ,
ea ch
i nc l ud i ng :
•
A spread s hee t
•
Pasca l
•
Words t a r
•
Opera t i ng
--
--
•
•
Al l
One 5 . 2 5 " f l oppy
- - $ 6 00 . 00
d r i ve
A pr i nter
$:250 . 00
A mon i t o r
$ :200 . 00
T he m i c r o
$ 500 . 00
t hose
p r i ces
a re
rough ,
a nd
but
cont r c � ' e r
r ef l ec t
t he
cheap
a l t e r na t i ve ,
not
t he
qua l i t y
that
s t u den t s d e s e r ve .
Each m i cro w 1 l l
come t o
( t hou gh
$ 2 2 50 . 00
I
doubt
t ha t
t hey cou l d
a c t ua l l y be p u t t og e t h e r f o r t ha t l i t t l e ) .
F i f t een
of
t hem
c os t
$ 3 3 7 50 . 00 .
s e r i OUS money , a n d i t o n l y buys a
s y s t em f o r each l ab team .
That ' s
m i n i ma l
If
a
l a rge
05-9
s y s t em
cou l d
hand l e
f i f t een s t u dent s ,
i t w ou l d be pos s i b l e t o
p u r c hase a t op o f t he 1 i ne CP U w i t h a ha rd
d i sk ,
a f l oppy d i s k , . f i f t een s e r i a l
por t s
( i n t e l l i ge n t ) ,
a
ha l f meg of
memor y ,
a nd
t op
of
t he
1 i ne
s of t wa r e ,
for
abou t
$ 1 4 , 000 . 00 .
F i f t een
very
n i ce
t e rm i na l s
wou l d c o s t
$ 9 000 . 00 br i ng i ng
t he c o s t
of
t he s y s t e m to $ 2 3 , OC� . OO . Two t housand do l ­
l a r s w i l l buy a v e ry n i ce pr i n t e r , br i ng i ng
t he t o t a l c o s t to about $ 2 5 , 000 .
I have ta l ked to s eve r a l peop l e who r u n
m a n y u s e r s on a G i m i x - I I I s y s t em .
I f ha l f
o f wha t t he G i m i x - I I I u s e r s s a y i s t rue . i t
wou l d be r e a s onab l e t o have e i g h t o r t e n
s t ude n t s
s ha r i ng a mach i ne .
If
al l
that
t hey s a y i s t rue ,
i t m i ght b e pos s i b l e t o
hook t h i r t y s t ude n t s t o o n e C P U a n d expect
t hem t o r u n a t a reasonab l e speed .
I now
have a second t e rm i na l on my l eve l t wo s y s ­
t em .
I c a n say f ron' my own expe l" i ence t h a t
m y s y s t em can hand 'i e t wo u se r s w i t h v e r y
f e w s i gns o f be i ng l oaded down .
Based on wha t I know abou t my sys tem ,
and what I have been ab l e to f i nd ou t abo u t
Gimix-I I I ,
I t h i nk a G i m i x - I I I s y s t e m w i t h
at
l ea s t 2 5 6 K of memory wou l d be ab l e t o
hand l e f ou r t o s i x users w i t h a l eve l
of
s e r v i ce t ha t I wou l dl f i nd accept ab l e .
G i v­
en a c ho i ce of a t oy compu t er w i t h barga i n
basement s of t wa r e , and t he b a r e m i n i mum of
pe r i phe r a l s , or a f i f t e e n t h of a f u l l y con­
f i gu red G i m i x - I I I s y s tem ;
I w ou l d p i c k t he
p i ece of a l a rge s ys tem l i ke a f l a sh .
conf e s s
to
be i ng
an
i vor y
t ower
i dea l i s t .
I wa n t peop l e to l i ke compu t e r s ,
so I f l i nc h a t t he i dea of g i v i ng ou t s l i c ­
es of compu t e r so s ma l l t ha t t her e i s not
enough
power
to
a l l ow
sof t ware
to
be
f r i e nd l y .
T hat means t ha t I t h i nk a i nd i ­
v i du a l d e s e r ves a t l eas t a l ev e l t wo s y s t em
w i th
l o t s of memor y .
Rea l i s t i ca l l y ,
m o st
hobby i s t s c an ' t a f f e,rd t o comm i t t h a t much
money t o t he i r compu t er ; bu s i nesses need a
much s t r o nger a r gument t han f r i e nd l y re l a ­
t i onsh i ps bet ween s ta f f a nd compu t e r s ; and
schoo l s
s i mp l y
have
to
choose
t he
l ea s t
expens i ve
way
to
do
t h i ng s
mos t
of
t he
t i me .
I ma i n ta i n that I am p h i l osoph i ca l l y
opposed
to
S ha r i ng
m i c ros ,
but
if
I
am
f o r c ed to cons i de r t he a l t e r na t i ves ,
I am
s t r ong l y i n favor of shar i ng a comp u t e r
prov i ded i t i s t he r i g ht compu t e r .
$ 1 00 . 00
$ 200 . 00
t ype ed i t or
- - $ 300 . 00
s y s t e m - - $ 1 00 . 00
C o l umn
Seven
41
A LETTER
Don wi 1 1 i am s
sent
me
ed
a
l e t ter
f rom
Bengt ­
A l l a n B e rgva l 1 who s e n t a l ong an l n t e r e s t ­
i ng program tha t amount s t o a spec i a l
sor t
I t g i ve s me
of s he l l f o r Bas i c09 p r og r ams .
encou ragement
In
my
p l an
to
w r i te
a
enhanced she l l , but i s usef u l a s i t s t ands .
H i s l e t t e r f o l l ows t h i s co l umn .
T he assemb l e r p r o gram wh i ch wa s
w i th
t he
l e t te r ,
and
wh i ch
, nc 1 u d ­
I
wi l l
i nc l ude
on t he
here ,
i s an
I n t e re s t i ng e x t e n s i on
program ca l l e d
" S t r t T as k "
w h i ch I
gave a f ew months age
I f we we r e u s i ng
r ea l
UN I X
we wou l d so l ve
t he prob l em of
paS S i ng p a r ame t e r s to BA S l eOS programs by
mod i f y i ng the s he l l ; Pa ramMod i s a s o r t of
spe c i a l
purpose
m i n i s he l l
w h i ch
runs
BA S l eQ9 prog rams .
LETTER F ROM BENGT-ALLAN BERGVALL
.Mi c r oware ' s BAS IC09 i s an e x c e l l e n t i n t e rp r e t e r , easy t o u s e f o r p r o du c i ng your
own u t i l i t i e s . Unf o r t un a t e l y , i t i s l a c k i ng a s t ra i gh t f o rwa r d m e t h o d o f p a s s i ng
p ar ame t e r s . F o r e x amp l e , i f you a r e go i ng t o wr i t e a "He l p " u t i l i t y , you wan t t o
type
OS9 : he l p d i r
t o l earn about t he d i r c ommand .
Th i s i s i mpo s s i b l e i f H e l p i s a BAS I C09 p r og r am .
I f H e l p i s a p a c k e d BAS I C09 p r o gr am , i n t e rp r e t e d by RunS , you can type
OS9 : h e l p
on l y , and l et t h e p r ogram a s k you wha t h e l p you want .
you have t o t yp e
I f y o u don ' t h av e RunB ,
OS9 : b as i c 09 #5k h e l p
Howeve r , even i f H i c r owar e d o e s n ' t t e l l you , you c an a l s o pas s param e t e rs i n RunB
or BAS I C09 by u s ing the s yn t ax
OS9 : h e l p ( " d i r " )
o r OS9 : ba s i c 09 #5k h e l p ( " d i r " )
and u s i ng the PARAM s t a t ement i n t he H e l p E r ogram .
Th i s i s
t h e p r o g r am rare l y . but i f t h e p r o g r am wi l l be us e d o f t en ,
you r s e l f, t h i s i s a very c l ums y syn t ax .
OK i f you wi l l u s e
and p e rhaps n o t by
The d e s i r e d s yn t ax can o f c ou r s e b e a c c omp l i s hed by wr i t i ng H e l p i n an o t h er
Th i s i s
l anguage that p e rm i t s the des i r e d p ar ame t e r s yn t a x , L e . in as s emb l er .
probably the wr on� way f o r a u s e r u t i l i t y p r of r am .
To s o l ve the p r ob l em , I have
wr i t t en a shor t ' un i ve r s a l " pr ogram i n a s s emb er , c a l l ed ParamHod , wi t h t h e f o l ­
l ow i ng c harac t e r i s t i c s :
•
P a r am.Mod a l l ows the de s i re d p a r ame t e r s yn t ax .
•
P a r amHod t rans f orms t h e p a r amet e r l i s t f r om the d e s i r e d s yn t ax t o the s yn t ax
The r e s u l t ing p arame t e r s a re a l l o f t h e type
r e q u i r e d by BAS I C09 o r Run B .
STR I NG .
T o b e u s e d a s nume r i c t yp e s , t he s t r i ngs have t o b e t rans fo rmed
us ing the V AL func t i on .
•
ParamMod f o r k s t o e i t h e r BAS I C09 o r R un B . and t h e ma i n p r ogra.m i s wr i t t en i n
BAS I C09 .
•
P a ramMod has t o d up l i ca t ed and c u s t omi ze d on t h r e e t ex t
BAS I C09 memory f o r e a ch ut i l i t y :
s t r i ng s and n e e ded
i nnam
The want ed u t i l i t y name . In t h e g i ven c a s e , He l p .
b e names C ompar e o r Anal yze .
O t he r u t i l i t i es c ou l d
Out name
The name o f t h e f i l e t h a t c on t a i ns t h e BAS IC09 p r o c e dure and p e r f orms
the des i r ed a c t i o n .
I t cou l d be named H e l p_B or /DO/COM/Compare_B or
Ana lyzeBody . i n t erp rt .
i n t e rprt
The name o f the BAS I C09 i n t e r p r e t e r to b e f or k e d t o . E i ther BAS I C09 i f
outname i s a s aved p r oc e dure o r Run B i f i t i s a p a c k e d pr ocedur e .
Memory
The t o t a l numb er of byt e s n e e d e d f o r the p r o c e du r e s and th e i r d a t a a r e ­
as .
42
05 - 9 U s e r N o t e s Vo l ume I
I n t h e f o l l owi n g , we a r e as s um ing you a r e wr i t i ng a H e l p u t i l i t y .
u t i l i t i e s , chan g e t h e n ames a c c o r d i ngl y .
fi r s t
c u s t om i ze
s i ze wi t h y o u r
t h e c omma n d :
t ex t
P a r amMo d ' s
e d i t or .
t h r e e t e x t s t r i ngs and BAS IC09
Then a s s emb l e i t Wl t h H i c r owa r e ! s
For other
e s t im at e d memo ry
as s emb l er , us i ng
OS9 : as m P a r amMod o=He l p # 1 0k
and t he r e s u l t i ng c o de f o r H e l p wi l l b e i n you r e x e cu t i on d i r e c t or y .
Then wr i t e y o ur BAS I C09
p r og r am ,
m u s t s av e o r p a ck H e l p B t o run i t
t h e c ommand ( l n c l ud i ng -p a r ame t e r ) :
naming t h e o ut e rmos t p r o c e d u r e He l l' B . Y o u
H e l p . RUN i t f r om w i t h i n BAS I C09 w i t h
t hrough
B : $ he l p d i r
Y o u may a l s o
dur i ng
t h e d ev e l opme n t
pha s e
c a s e y o u mus t u s e BAS I C 09 p a r ame t e r s yn t ax :
run the
pr ogram w i thout
He l p .
In t h a t
B : r un h e 1 p_b ( " d i r " )
I n c l u ded i s t h e as s emb l y l i s t i ng f o r P a r amMod ,
a dummy H e l p B p r og r am .
B eng t A l 1 an- B ergva 1 1
B 1 av i ng e v . 1
S-56 1 49 H u s kvar na
Sweden
c u s t omi zed f o r a H e l p ut i l i t y and
C o l umn S e v e n
43
PARAMMOD
*
P r ogram wr i t t en by B eng t -Al l an B ergva l l , B l av i ngev . 1 ,
sweden .
* s - 5 6 1 4 9 Huskvarna ,
,;l�
" P r og r am t o r e f o rma t a p a r ame t e r l i s t f r om an e a s i l y
" typed f orm to t h e c l ums i e r f o rm requ i red when runn lng a
* BAS I C09 pro g r am .
or
G i v e n t he c ommand
pa ram4
(n o t e the e x t ra s pa c e )
-I, OS9 : he l p p a r aml param2
* Th i s p r og r am w i l l f o r k t o the RunB o r BAS I C09 p r o g r am
* Help B
as i f g i ven the eou i va l ent c ommand :
rt
,< OS9 : BAS I C 09 'I15 k He l p_B ( param l " , "p aram2 " , "" , " p a r am4 " )
,,<
*
�'<
Th i s p r o g r am i s genera l and c an r e f o rma t t h e r e s u l t i ng
parame t e r l i s t up t o 256 charac t e rs , but the n ame
;( s t r i ng s i nname and o u t name has t o be change d f or each
,/, i mp l emen t a t i on .
*
*
-I,
*
�{
i f i n t e r p r t i s runB , then outname h a s t o b e a p a c k e d
BAS IC09 p r o g r am i n the execut i on d i r e c t o ry .
I f i n t e r p r t i s BAS I C 09 then outname has t o b e a s aved
BAS I C09 p r o g r am e i ther i n the :p r e s ent data d i r e c t o ry o r
*
i n ano t her f i l e w i th out name g l v i ng t h e fu l l p a t h name ,
'
,': e . g . , /DO! COM!H e l p_B
*
.;c
;,
The memor y n e e d ed by BAS I C09 o r RunB mus t a l s o b e
g i ven .
nam parame t e r l i s t m o d i f i e r
t t l f o r BAS I C09 o r RunB
i fp l
u s e /OO/OEFS / d e f s l i s t
endc (us e o s 9 d e f s )
mod p g en d , i nname , pr g rm+ obj c t , r e e n t + l
fdb pgs t ar t , s t ac k
,,< d a t a var i a b l e s
paren d5 rmb 2 o ut put parame t e r l imi t - 5
out p a r rmb 256
v a r end equ
s t e k rmb 200 s t ac k area
s t ae� eau . s t a c k D o i n t e r
*
*
•
* * * * * * * . * * * * * * * * * * �** * * * * * * * * * * * * * * * * * *
* * Cus t om i za t i on area
i nname f c s . He l p . Name o f ut i l i t y
out name f e s . Help-B. Name of BASIC 09 p r o c e dure
feb 0
i nt e rprt f e s . B AS I C09 . Ei ther BAS I C09 o r runB
* T o t a l mem o r y needed in byt e s by BAS I C09 o r RunB
* p r o c e s s : ( e gu i valen t t o the n e e ded BAS I C09 HEM v a l ue)
memory equ 5000
End e u s t omizat i on
,...'<
* * * * H * ** * * * * *********** * * * * * * * * * * * * * * * *
pgs t art
*
*
*
*
*
*
M o d i fy parame t e r l i s t f r om f r e e f o rm i n t o BAS I C09
s t r i n g f orm . Exaap l e o f f r e e f o rm : p a r am l p a r am2 pa ram4
R e s u l t i n£
B AS I C09 s t r i ng f o rm :
He l p_B ( li paraml '" "param2 " , " " , "param4")
p r epare l i m i t check f o r param e t e r l i s t , a l l ow for
end ing l as t �areDthes i s .
l eay var end - 5 , U
s ty parend5
*
c o py o u t name into o u t p u t parame t e r l i s t
pshs X
l eay outpar , U
l eax o u tname , PCR
namechar I da , X+
b e q nameend
s t a , Y+
bra name char
name end pu I s X input parame t e r l i s t
*
1<
app end modi f i ed input param e t e r l i s t t o o u t p u t
p a r amet er l i s t
i da II ' (
s t a . Y+
44
05 - 9 U s e r Rotes Vo l ume
I
I da /1 ' "
s t a , Y+
r, archar I da , X+
, check the r e s u l t i ng parame t er l i s t n o t t o o l ong
cmpy par end5
b l o parOR
c omb s e t carry
I db #56 BA5 ICU9 param e t er e r r o r
059 F$Exi t
p a r OK cmpa #$20 s p a c e ?
beq nextpar
cmpa #$00 car r i age r e t urn ends param e t e r l i s t
beq l a s t p a r
s t a , Y+
bra p a r char
* r e f o rmat next parame t er
n e x t par I da II ' "
s t a J Y+
I da II ' ,
s t a Y+
I da II ' "
s t a , Y+
bra parchar
,�
1 i s t end
l a s tpar I da II ' "
s t a Y+
I da II ' )
s t a Y+
I da #$00 car r i ag e r e t urn
s t a , Y+
-
," f ork t o int e r p r t (RUnB o r BA5 IC09)
l eax i n t erp r t ,PCR
I dy #S 100 a l l ow one page parame t e r s
l eau out par , U
I da iiprgrm+ obj ct
I db # lmemo ry+ 25 5 ) / 2 5 6 dat a area
059 F$Fork
b e s ut
OS9 FSWai t
bcs ut
c l rb no error
ut 059 F$Ex i t
emod
pgend equ *
end
HELP B
PROCEDURE H e l p B
REM Dummy Hel p-u t i l i t y
REM prints the parame t er
PARAM t ex t : STR I NG
PRINT t e x t
BYE
\REM b y e needed t o g i ve aut omat i c r e t urn t o
05-9 when r un by Bas i c09
Co l umn S e v e n
45
4t
05 - 9 U s e r N o t e s Vo l ume I
COLUMN E I GHT
the
pres i d e n t
G i mi x l .
On Augu s t 1 2 t he 0 5 - 9 U s e r Sem i na r opened
r a t he r s l ow l y as I and a fe w o t he r p e op l e
s tood i n 1 i ne i n f ro n t of t h e eXh i b i t ha l l
on t he t h i rd f l oo r o f t he Des Mo i nes Ma r ­
r i ot t .
We
w s t c hed
as
var i ou s
M i c roware
s t a f f s t rugg l ed t o get a Rad i o S hack com­
pu t e r
( ru n n i ng 05 - 9 o f c o u r se )
i n t e r f a ced
w i th
a
t e l ev i s i on .
When
I got
i nt o
t he
ha l l ,
I
was
s u rp r i sed
at
a r'1 d
t h i nks
t he
s e r v i ce
Gimix
manager
ha r d w a r e
move i n a bo u t t he same d i rect i on
to go .
I f t h i ng s go we l l , t he r e
some t e r r i f i C new hardware c om i ng
t i me i n t he i ndef i n i �e f u tu r e .
THE OS- 9 USER SEM I NAR
e x h i b i t or s .
I have a l wayE
0 5 - 9 commu n i t y a s about t he
He
t he
number
a
T he r e were a coup 1 e of .Japanese e ng i neer s demons t ra t i ng F u j i t s u F M - 7 a nd F M- 1 1
compu . e r s .
Very
we l l
done ,
I
w i sh
t ney
were a va i l ab l e i n t h i s c o u n t ry .
A p ar t i cu ­
l a r l y n i ce f e a t u r e o f t he sof t Wa re o n t h e
F u j i t s u mac h i ne s w a s sp l i t - sc r een suppor t .
I
saw
t hem
ed i t i ng
on
one p a r t
of
t he
s c r een w h i l e t wo o t he r s ec t i ons d i sp l a yed
mov i ng g r a ph i c s . . . a l l r u nn i ng at t he same
t i me .
T a no
was
Show i n�
a
D ragon
compu t er .
i mp o r ted
(1
be l i ev e )
f rom
E ng l and ,
The
D ragon
is
a
sma l l ,
i nexpens i ve
compu t e r
I
w i t h c o l or g r a p h i cs a n d 0 5 - 9 Leve l One .
on l y saw i t p l a y i ng game s , but i t does t ha t
pre t t y we l l .
sort
w h i ch
t he y c l a i m
runs
very
f as t .
c l a i m to have compared t he i r s o r t to a
•
s tandard
d i s k - ba s ed merge
sort ,
and
come
out s i gn i f i ca n t l y bet t e r . E i t he r t he a l gor ­
i t hm
u se d
by
the
p ro g r am
t he y
compared
t he i r s t o w a s not the best a va i l ab l e I n t he
1 i te r a t u re , o r t he i r c l a i m may have t o b e
p l aced
in
t he
s a me
c l ass
as
perpe t u a l
m o t i on
mac h i nes .
The
man
who
i nven t e d
t he i r s o r t i ng a l go r i thm wasn ' t t her e f o r me
to a s k abou t t he deta i l s of h i s met hod . a n d
I had no way t o c hec k the i r f i gu r es , so I
w i l l cont i nu e to v i ew t he i r s o r t w i th S k ep ­
t i c i sm ;
howeve r ,
even
1f
it
is
on l y
an
average s or t ,
i t s manua l
docume n t s a f i ne
gene ra l s or t i ng p r o g r a m of a type wh i c h i s
much needed by se r i ous O S - 9 use r s . T hey had
sever a l
o t he r packages
i nC l ud i ng a s e t o f
8 a s i c09 subr o u t i nes f o r 1 5AM f i l e h a nd l i ng
t h a t sounded much l es s exot i c .
bu t
i nter­
e s t i ng .
T he r e w e r e , o f course . many e x h i b 1 t o r s
h a ve n ' t
men t i o neo
( fo r
examp l e
M i cro­
wa re ' s o w n boo t h ) ,
bu t
I
don ' t
i nt end t o
ma k e t h i s c o l umn i nto a w a l k i ng t o u r o f t h e
exh i b i t ha l l .
F r i day t here was p l e n t y of t i me t o l ook
a r ound .
S a t u r da y
and Sunday were
so busy
t here was b a re l y
t i me t o ea t .
M i c ro w a re
of
t he weekehd w i t h c l as ses ,
f i l I ed mos t
presen t a t i on s ,
a nd
" roundtab l es ·
r a n g i ng
f r om 0 5 - 9 a nd B a s i c09 F e a t u re s , wh i ch c o v ­
e red t h i ngs l i k e t he B a s i c09 ed i to r . t o t he
0 $ - 9 R ou ndt a b l e , Wh i ch gave us a chanCe t o
i nt er r oga t e t he p a r en t s o f O S - 9 abou t
i ts
t he
w o r k i ng s .
I n t h e even i ng s a
f ew
of
exh i b i t o r s
r an
" hOsp i ta l i t y s u i t e s ·
w h i ch
gl've some o f us I'n excuse to s ta y up 1 a t e
a n d t a l k abou t o u r compu t e r s .
t he
P r i va c was show i ng the graph i cs board
t ha t I have been covet i ng f or mont hs now .
It
l ooks even
be t t er
in
r ea l i t y
t ha n
it
appea r s
i n a n adve r t i sement .
T he r e w a s a
r u nn i ng
a l mo s t
c o n t i nuous l y
t ha t
p rogram
F i gu r es a nd c ha r ­
demons t r a t ed t he tloa r d .
a c t e r s wou l d appea r . d i sappea r , r ot a t e , a nd
f l oa t acr o ss t h e s c reen .
I had a l ways w o n ­
d e r e d how we l l
t he P r i va c b o a r d was s u p ­
po r t ed u nder 0 5- 9 ;
1 t t u r ns o u t t ha t O S - 9
i s t he ope r a t i ng sys t em t hey use . T he demo
p r ogram was w r i t t en i n Bas i cOS .
W i r e s f r om the G 1 m i x boo t h seemed
to
T he O S - 9 U s e r
s p r ea d
81 l
over
t he
he 1 1 .
J B M G r oup ,
and F rank Hogg L a b s a l 1
G r oup ,
were
bo rr o w i ng
comp u t e r
s e rv i ce s
f rom
Gimi x ,
P e r haps t o demons t ra te t he t i re l es s
ab i l i t y of GM)( - I l l
t o spew cha rac t e rs o u t
on m a n y
t e rm i na l s ,
unused
t e rm i na l s
were
k e p t b u s y 1 i s t i n g s t ra nge progr ams .
W he n ­
e ve r I w a 1 ked by , one o f t he t erm i na 1 s a t
t he F H L b o ot h w a s l i s t i ng a COBOL p rog r am
At
t he
Gim1x
boo t h
I
met
t he
eng i neer
respons i b l e f o r my h a r d w a re ( who
i s a l so
wa n t i t
s h ou l d be
o u t s ome ­
T hey
of
Smoke 5 i gna I
b r oa d c as t i ng had a v i deo
t ape r i g
sho w i ng
a
m ov i e
of
a
m i l i t a ry ­
l ook i ng man .
I r emember a bug l e �nd a l o t
of s t r u t t i ng up a nd down , b ut I j us t c an ' t
remember w hat he was t a l k i ng abou t : I t h i nk
he w a s p ro mo t i ng t he TMP
package .
SmOke
S i gna l
had
a
comp a c t
5 5 50 based
m a c h i ne
t ha t I have never seen bef o r e .
I
T he J6M G roup i s h a r d f o r me to c h a r a c ­
t e r i ze .
T he y
had
some
u t i l i t i es
that
sounded g o o d except t h a t t hey w e r e w r i t t e n
a t l ea s t pa r t l y i n Bas i c09 .
T he t h i ng t ha t
ups et a n d f a sC i n a t ed m e w a s t h a t t hey have
t hought o f
t he
s i 2 e of a l a rge
f am i l y
-t h e r e we r e 24 booths
l i s t ed
in
t he ex h i b i t o r gU i de .
I had a ba l l Wand e r ­
i ng t h r o ug h t h e ha l l , meet i ng peop l e I have
o n l y k nown t hrough phone converS a t i ons , and
s e e i ng some exc i t i ng ha r d wa r e .
Seve r a 1
Qf t h e e x h i b 1 t o r s were s ho w i ng
mach i ne s t h a t u se d O S - 9 a s a p r o c e s s c on­
O ne boo t h spo r t e d a r a c k
t r o l env i ronment .
o f equ i pment t ha t w ou l d have b e en mo r e a t
home next t o a n a s semb l y l i ne .
of
shou l d
Sa t u rday n i gh t there was a meet i ng
O S - 9 U s e r G r oup .
T h e U s e r Group
of
is
hav i ng
some
t roub l es
wh i Ch
seem
to
s t em
mos t l y
f rom
hav i ng
on l y
a
f ew
membe r s
spread over a w i de geograph i ca l
a re a .
We
e l e c t e d o f f i ce r s
for
t he next
yea r :
Da l e
Puck e t t
( P res i de n t ) ,
myse l f
( V i ce
P re s i ­
dent ) ,
Goerge D o r ne r
( T r ea s ur er ) .
a nd To m
Mur phy
( Se c r e t a r y ) .
We
are
r e s pec t i ve l y
respons i b l e f o r t he S o f t w a r e E x c ha nge Com­
m i t t ee ,
t he Member Sh i p Comm i t t ee ,
the Com­
mun i ca t i on s Comm i t tee , and t he B y L aws Com­
m i t te e .
Monday t hose o f uS whO were st 1 1 1
1 ef t
around went o f f to M i c roware ' . o f f i ce s .
had a chance to d i SCUSS some of t he d i f f i ­
cu I t i e s I a m hav i ng w i t h 0 5 - 9 and C w i t h
t he approp r i a t e peop l e , and d i sc overed t h a t
t hos e
p r o grammers
are
s e r i ou s l y
c r o wded .
They desper a t e l y need to m a k e t h e move to a
l arger
n i ng .
f ac i l i t y
t ha t
t hey
have
been
Col umn E i g ht
p l an­
47
SHELL COMMAND S
he s he l l i s a program t ha t i n t e r p r e t s com­
'and l i nes and does 'What i s ca l l ed f or .
O ne
f u l l UN I X s he l l i s a p rogramm i ng l a n ­
guage i n i t se l f . The O S - 9 s he l l i s on l y a
subse t of t he UNI X s he l l , b � t i t has enough
f l ex i b i l i ty to be u s e f u l .
T he f i r s t t h i ng
t o l ea r n about t he s he l l i s how t o u s e t he
bu i l t - I n s he l l command s .
The chd , chx , e x ,
k i l l . w . and s e t pr commands a re bu i l t i nt o
t he s he l l .
T h e s he l l commands a r e used t o
con t r o l
t he env l ronment of
t he programs
t ha t a r e run by t he she l l .
use t he chd comma nd . wh i ch i s t he
command
wh i Ch
changes
t he
work i ng
da t a
d i rec t o r y . more t ha n any o t he r s he l l com­
mand .
T he work i ng d a t a d i rectory i s t he
d l rec tory w h i ch w i l l be u s ed f o r most f i l es
you
read or
wr i te w i t ho u t
spec i f y i ng a
d i rectory i n t he f l I e name .
I t i s u s ua l l y
much be t te r t o change t he work i ng d i r e c t o r y
t ha n t o exp l i c i t l y I nc l ude d i rec t or i es i n
f l I e names so 1 f requent I y change d I rec t o ­
r i e s a s I change f rom o n e t a s k t o anot her .
I t i s a ra re d a y when I use t he chx com­
mand . t he command wh i ch Changes the work i ng
execut i on d l rec tory , even once .
I
i mag i ne
t h a t someone w i t h a sma l l er sys t e m d i sk
t ha n m i ne woul d u s e t he chx command much
more f requent l y t han I
do becau s e 0 5 - 9
remembe rs where t he work i ng d i re c t o r i es a r e
o n d i sk , a n d needS t o b e reset w i t h chd and
chx commands when a c 1 Sl<. i IS changed .
If
you f orget t o change d l rect o r i es when you
change d l Sk s , OS-9 w l 1 1 g i ve you a nas t y
m e s s a ge nex t t i me you t ry t o u se t he d i rec­
tory .
I have never got t e n i nt o t r oub l e by
f o r ge t t ; ng . but i t i s not w i se t o t ru s t an
opera t i ng s y s t e m t oo f a r .
The ex command shou l d be c l a s s ed a s a n
advanced command .
I t rep l aces t he S he l l
'w i t h a n o t he r p r og ram .
Rep l ac i ng t he she l I
I s c e r ta i n l y a good t h i ng t o be ab l e t o dO ,
espec i a l l y for u s e r s w i t h s ma l l er s y s t e m s .
but i t can have d i s concer t i ng resu l ts
ma i n l y t h a t when t he program e n d s .
t he
s he l l won ' t be t he r e .
The res t of t he s he l l commands a r e pr i ­
mar i I Y usefu 1 f o r t hose who run programs
concurren t l y .
You can i ns t ruct t he She l l
t o s t a r t a p rogr am runn i ng , t hen g i ve you
a n o t her s he l l p rompt by pu t t i ng a n & a f t e r
t he commend o n t he command l i ne ;
059 : d i r > /p&.
wou l d l i s t t he f i l es l n t he dat a d i rec t o r y
on t he p r i n t e r wh i l e y o u r u n o t her p r o ­
g r am s .
I f you r u n programs conc u r rent I y
the
k i l l . set pr . a n d w commands w l 1 1 be u s e f u l .
The k i l l command s hou l d be u s ed abo� t t he
way you use t he qu i t con t r o l key ( us ua l l y
<CNTL>Q or <CNTL> E ) .
The qu i t key o n l y
works on t ne l as t program to do I /O t o t he
�erm i na l , t he k i l l command works on any
program .
The setpr command i s used to c o n ­
t ro l t he w a y t he computer ' S resources a r e
d i v i ded up .
T he h i g he r t he pr i or i t y o f a
progra m , t he l a rger a sha re of t he comput e r
i t w i l l get . a n d t he f a s t e r i t w i l l r u n .
A
progra m ' s ( o r .
more proper l y .
p r oc e s s ' s )
pr l or i t y can be anywhere i n t he r a n ge 1 t o
255 .
T he w command causes t he s he l l t o
wa i t f o r a ch i l d process t o f i n i sh .
That
means
t ha t
t he
she l l
won ' t
prompt
for
ano t he r command unt 1 1 a prog ram t ha t was
•
48
OS - 9 U s e r No t e s Vo l ume I
s ta r t ed oy I t t e r m i na t e s .
T he ma i n u s e of
t h i s command i s t o recover f rom t he m i s ta k e
o f runn i ng a p r o g r a m tha t does I / O t o t he
t e rm i na l 1 n backg round .
T he u sef u l ness of
t he 14' command can be appreC i at ed by t ry i ng
t he f o l l ow i ng expe r i ment :
OS9 : d i r x&
Now t ry to g e t some usefll l wo r k done
when you are d i s gu s ted w i t h t he s c rewy
behav i or of your t e r m i na l , t ype 101 at t he
OS9 prompt :
OS9 :
w
There 1 s one pa r t i cu l a r l y n i ce f ea t ure
o f t he She l l wh i ch i s . so f a r a s I k now .
undocumen ted .
I f yo� run a p rogram l i k e
t he
a s semb l er
w i th
i ts
ou t p u t
d i rected
somewhere o t he r t ha n the t e r m i na l ,
t hen
dec i de t h a t you wou l d 1 i Ke t o run a no t her
program at t h e same t i me , ' you can c u t t he
a ssemb l y
l oose f rom t he s he l l
w i t h t he
i nt e r rupt con t ro l
key ( usua l l y <CNTL > C ) .
T he i nt e r r up t cont r o l key w i l l u s ua l l y t e r ­
m i na t e t he p rogram w h i ch mos t recent l y d i d
I /O t o t he t e rm i na l , but , i f t he p � ogram i n
con t r o l o f t he t e rm i na l ( the a ssemo l er- i n
t h i s ca se ) doesn ' t do any I /O t o t he t e r m i ­
na l a t a l l , i t won ' t k i l l i t .
I ns t e a d . t he
she l l s ee s t he i nt e r rupt . and conve r t s t he
program i n cont ro l of t he term i na l t o a
concu r ren� p r ogram .
A LOG I CAL DEV I CE DR I VER
T h i S c o l umn i s an expe r i me n t w i t h a new
f orma t .
There i s a demand for i nf o r ma t i on
f or new O S - 9 user s , but I have a l so hea rd
request s f o r more advanced d i SC u s s i on s .
In
t h i s co l umn I am t ry i r'19 t o i nc l u de s ome­
t h i ng f o r e ve r yone .
Wha t f o l l ows may be o f
genera l i nt e re s t , but . f or a n i ne x pe r i enced
comput e r user . i t may be heavy gO i ng .
Severa l months bac k I s t a r ted a p r o j e c t
whose Obj ec t i ve was t o f i nd a w a y t o g i ve
0 5 - 9 a term i na l - i ndependen t way t o cont r o l
C R T s . I have a spec i a l dev i ce dr i ve r wh i ch
does j us t wha t i s ca l l ed f or , b u t i t i s
bu i l t a r ound M i c roware ' s A C I A source .
I
may be a b l e t o g e t pe!"m i ss i on f rom M i c r o ­
w a r e t o pub l i sh t he m od i f i ed d r i ve r , b u t I
wou l d r a t he r not have t he t e r m i na l mapp i ng
t i ed t ha t C l ose l y t o t he comput e r ' s I /O
port .
Not e v e ry compu ter u s es an A C I A ch i p
f o r i t s s er i a l i nt e r- f ace . a nd my spec i a l
d r i ver o n l y works w 1 t h A C l A ser i a l i nt e r ­
f ace Ch i ps .
Wna t i s needed i s a V i r t ua l .
or l og i ca l , dev i ce t ha t can i ns u l a t e t he
t e rm i na l
mapp i ng code f rom t he phys i ca l
i nt e r face .
The i dea of a l og i ca l dev i ce d r i ve r has
many app 1 i ca� i ons
beyond
III
t e r m i ne 1 i ndependent l nt er f ace .
A t t he User Sem i na r
I spent some t i me t a l k i ng t o t he eng i neers
f rom t he F u j i t su boo t h .
They wan t ed my
op i n l on . of
a
propo s a l
to make
l og i c a l
dev i ces e pa r t o f OS-9 i n order t o a l l ow
t he s y s t em dr i ve to have a conS i s t e n t name
regard l es s of the type of ha rdwa re be i ng
u sed .
T h l S wou l d make i t eas i er to wr i te
p r ograms t ha t referenced f i l es on t he s y s ­
t em d r i ve .
A l og i ca l dev i ce can c e r t a i n l y
do t h i s .
I t wou l d be POS S i b l e t o s e t up a
l og i ca l d i s k w i th some obv i ou s name l i ke
S V S . and have i t know t he name o f t he phys-
i ca l
DO ,
dr i v e
HO ,
or
The
T he r e
be i ng
i oea
is
u sed
as
t ne
s y s t em
dr i ve :
whatever .
no
can
be
e )( t ended
of
compe l l i n g
reason
why
cal l
l og ­
poss i b 1 e
d i sk
u se s
dr i ve
of
t he
concept
I
are :
w i th
a SS O C i a t ed
cache
a nd
fa i r l y easy
way
to
a
s e pa r a t e
A g a t eway
A
way
t e r m i na l ,
a s s oc i a t e
for
p r i nter
a
w i th
a
i nt er f a c e ,
T he
d e v i ce d r i ver I h a ve i nc l uded w i t h
co l umn
is a
l og i ca l
S C F dev i ce d r i ve r
a L e ve l T wo s y s t e m ,
A R B F dr i ve r , o r a
dr i v e r f o r L e ve l O ne WOU l d oe somewh a t d i f ­
f e r e n t , b u t o n l y t he d e t a i l s wou l d need t o
be
changed .
T he
dr i ve r ,
wh i ch
I
named
doesn ' t
dO
t i me .
It i s
wa s t e
i n t e res t i n g
t o be
anyt h i ng
a
l og i ca l
dr i ve r
to
t he
at
s k e l e t on
bu i l t
mus t
l oo k
s y s t em ,
al l
for
except
s ome t n i ng
on .
l e t ' s go t hrough
t he
program ,
A
j us t
so
; t
l i ke
must
a
rea l
have
t he
t yp e O r i v r + O bj c t ,
and
i t mus t h a ve a oy t e
after
t he n o r m a l
mOdu l e header
r e f l ec t i ng
t ne modes i n w h i c h t he dr i ve r c a n be u se d .
Thi s
one
says
i t
1 s good f or u p d a t e ,
i t
m i g h t be a good i de a t o add exe c u t i o n .
T he
s t o rage
r eq u i red
by
a
dev i ce
d r i ve r
is
c a l l ed
t he
dev i c e
stat i C
s t orage ,
a l l oca t e d .
a nd
part l y
i n i t i a l i ze d
f i l e m a n a ger ,
manage r
uses
dev i ce s t a t i c
for
it
w i th
it
is
by
t he
i n t h i s case SCF .
T he f i l e
t he
f i rs t
sect i on
of
the
s t o r ag e , t he s t o ra g e r es e rved
t he
V . SCF
" o rg
P e r f orma nce
is
c h a r a c t er
its
c r uc i a l
r ea d
f r om
at
or
thi s
l ev e l .
w r i t t en
to
t he
but
t he p r i or i t i es s h i f t
some ­
wi l l
branch
to e n t r y ,
e n t r y+ ::! ,
depend 1 ng
e n t ry+6
on
wha t
s e r v i ce
want s .
T he no r m a l
conven t i on i s t o
l br a
i ns t ruct i on s he r e ,
but
l i s t of
i ns t r uc t i on i s a
l i t t l e f as t e r ,
so
t he m
and
w i t h nops
c on t e x t ) .
T he
padded
t he m
( wh i ch
are
INIT
cal l
to
t h r ee
never
mu s t
bytes
e x e c u te d
f i nd
t he
i t
put a
a bra
I used
in
each
th i S
a
bit
is
g0 1 ng
s t o r a ge ,
s oace
t r i ck y .
t he
L ev e l
Two
system
u se r s
can
probab l y
so
to
need
t he
l og ­
memo r y
use
mome nt
needs .
r eque s t .
the
Leve l
t he memo r y
I
a nd
must
s a ve
t he
conve n i ence
s to ra ge ,
must
be
s t orage ,
c ha n ge
bef o r e
VCl A ' s
P.O. '5
s ta t i C
s tat i C
and
af ter
each
cal l
i n f o rm a t i on
cop i ed
back
f r om
P.O. 's
s ta t i C
t o VC I A ' s .
The
INI T
ca l l .
and
each
o t her
ca l l .
b a s i ca l l y Cha nges f r om V C I A ' s s t a t i C s t o r ­
age
to
P . O . ' S ' and
ca l l s
t he
a pp r op r i a t e
ent ry i n P . O .
T he
T E RM
entry
is
r e spons i b l e
for
c l ea n i ng up a s t he dev i ce i s c l o s e d .
A f t er
c a l l i ng P . D ,
to a l l ow i t to c l o s e down t he
p hy s i ca l dev i ce .
i t f r e e s t he dev i ce s t a t i c
memory
that
I N I T a l l oc a t ed f o r P . D "
and
u n l i n ks
w i th
In
a
F $ L I NK
Level
T wo ,
ca l l .
t he
Th i s
is
modu l "
is
1 i nked i n t o t he addre s s s p a ce b e l on g i ng t o
t he
process
d o i ng
t he
l i nk .
T he
dev i ce
d r i ver u s e s t he pr oc e s s number of t he p r o ­
cess
that
opened
it,
but
i t runs
in
t he
s y s t em addr e s s
s p a ce .
I had t o f o o l t he
oper at i ng s y s t em
i n t o t h i n k i ng
I was
run�
P.O.
It
t he m i r ro r
T he
wo r t h
no t i ng
tha t
INIT .
dev i c e descr i p t o r
i mp o r t a n t .
t ha t VT ERM
t h i ngs
dev i ce
is
i mage of
c a l l ed VT E RM .
rea l
dev 1 ce ,
I
use
for
T E RM
VClA
is
S i nce S C F t h i n k S V T E R M i s a
its
dev i ce
descr i p t o r
is
E ven
t he
add r e s s
u s e s i s l mpor t an t .
as
s i mp l e
d r i ver w i l l
of
the
I f you
port
k e ep
as
I
did,
the
l og i c a l
map ever y t h i ng i nc l ud i ng
t he
i n f orma t i on f r om t he dev i ce des c r i p t o r
d i rect l y
to
t he
phYS i ca l
dev i ce
dr i ve r ,
but ,
i f you want t o s u pp o r t somet h i ng 1 i ke
spl
l og
or
t he
it
s c r ee n ,
you w i l l
have
to g i ve e a c h
ical
t e r m l na l
a d i f f e r e n t p o r t addre s s .
5 C F w i l l know t he y a l l a r e re f e r r i ng t o
same dev i ce , and g e t i n t h e way .
F or t una t e l y
GIMlX
I /O
this
V i r t ua l
pro c e s s or s .
dr i ve r
works
Th i s
is
pure
1 uck b e c a u s e G l M I X does n ' t pub I i s h enough
t he i r
d r i ve r
for
me
to
i nf o rma t i on about
des i gn a n i n t e r f ace f o r 1 t .
L e t ' S c on s i der
t h i s a gent l e pus h for R i c h a r d Don a t G i m ; x
t o r e 1 e a se more i n f o r m a t i on about h i S p ro­
p r i e t a r y sof t wa r e .
It
S h ou l d be poss i b l e
to move a gOOd
dea l
l ess
da t a
back
and
forth
between
V e l A ' s and P . O . ' s s t a t i C s t orage t h a n I do ,
b u t I p l ayed i t s a f e i n sp i t e of the l a rge
cost .
I t wou l d be good t o t r y to f i nd s ome
f i e l ds t ha t
b e s aved by
Thi s
p hy s i ca l
dev i ce d r i v e l' and s e t up t he p r oper env i r onment f o r i t .
T he p h y s i ca l dr i ve r , w h i c h
I
cal l
P.O.,
i s f ound and mapped i n t o t he
a dd r El s s
One .
I
F$SL i nk
One
never
knows
when
S C F w i 11
p a r t of t he s t a t i c s t o r a g e .
so
«
t er m i na l
w i 11 p a s s t h rough
t h i s modu l e s o
e v e n a sma l l
i mp r ovement
i n e f f i c i ency
i s
good .
Norma l good cod i ng p r a c t i ce i s s t i l l
i mpor t a n t ,
what .
SCF
d r i ve r
stat i c
One
for
w i th
E ve ry
dev i ce
by
sys tem
f U S S i ng a round .
One a na l og .
T he add r e s s of
be s aved f o r f u t u re c a l l s ,
is
S t a r t i ng f r om t he t op ,
i n t e r e s t i ng
pa r t s
Of
d r i ve r
number
t he
s c r een d u m p s ,
A. t er m i na l - i ndepe ndent
vC r A ,
t he
eac h
ca l l
i n f o r ma t i on
f rom
s t o r a ge
mu s t
be
cop i ed
to
n e t wo r k .
to a
to
t e r m i na l
the
dev i c e
use
su ppo r t
SpI l t
s o reen
t e r m i na l
d l sp l ays
w i th
e a c h sec t i on Of t he s c r e e n t re a t ed a s
t he
for
real
own
in
If
th i s
were
Leve l
have
s i mp l y u s ed
a
al l
T he
s i ze
A n ea t ,
•
i ts
process
po i n t e r s
i ca l
dev i ce d r i ve r p l a y s SCF f o r a
a nd g e t s t he amount of s t o r a ge P . O .
s t orage ,
•
w i t hout
sys t em
t he
t he
Level
A
t he
w i th
page .
d i rect
t h i nk
I c ou l d
one .
Some
under
f u r t he r .
even
i ca l
dev i c e
s hou l d
refer
to
exa c t l y
one
p h y s i ca l
d r i ve .
T he
l og i c a l
dev i ce
cou l d
r e f e r t o s eve r a l p h y s i c a l deV i c es o r j u s t a
pa r t
n ; ng
p l a y i ng
05-9
don ' t need mov i ng
not mov i ng t hem .
modu l e
Level
One
demons t r a t e s
is
compa t i b l e
so
t i me
t ha t ,
w i th
cou l d
a l t hough
Leve l
Two
f or u s e r p r og rams . i t i s no t compa t i b l e f or
s y s t e m modu l es .
T h i s s h ou l dn ' t be 8 s u r ­
p r i se ,
atout .
but
1t
i s somet h i ng t o
I n m a n y c a s e s a l l t ha t
b e c au t i o u S
needs to be
c ha n ged i s a n e n t ry i n a d ef i n i t i on s f i l e ,
b u t i f you t ry t o run ve l A a s i t s t a nds 1 n
a L e ve l One s y s t em ,
t he be s t you c a n hope
for
i s t ha t i t w i l l g i v e an e r ror code a nd
Qu i t .
C o l umn E i g h t
49
Deb u g g i ng code
1n
s y s t em s t a t e 1 s n0
'.; ome t h i ng 1 w i l l
do
, 1'
I
have a c ho i c e .
3
debugger
won ' t
work
on
modu l es
t ha t
T he
need t o r u n i n s y s t e m s t a t e , a na debu gg i ng
code t h a t w r i t e s o u t he l pf u l m e s s a g e s as a
p ro g r a m r u n s doe s n ' t make s e n s e i n a dev i c e
d r i v e r modu l e .
I f t he d r i ve r doesn ' t w O r k
wna t d o you wr i t e t o ?
I d e b u g g e d t h i s mOd ­
u l e by u s i ng i t s r e t u r n code .
I f you have
ve l A set c a r r y b e f o r e i t r e t u r n s t o 5 C F .
t h e p r o g r a m t ha t
i s t r y i ng t o u s e i t w i l l
ge t t he va l ue t ha t w a s i n t he B accumu l a t o r
T h i s a s l ow w a y
when VC I A r et u r ned t o 5 C F .
to l ea r n t h i n g s , b u t i t w O r k s .
po i n t :
i t
i s expens i ve , b u t
O n e f i na l
o t h e r w i se i mpeccab l e t echn i ou e t o p i l e l og ­
l ca l dev i ce o n l og i ca l d e v i ce .
Ve l A ha s n o
wa y
of
k n ow i ng
whe t h e r
t he
dev i ce
i t
oe l i e ves
c o nt r o l s
t he
p h y s i ca l
d e v i ce
i s
r e a l o r l og i ca l .
:l3 M i c r owa r e
i s s a i d to have an " Ov e r t he
top · debugger t h a t can be u s e d t o debug
s y s t em sof t w a r e .
The o n l y per son I know
th11ct has l oo k e d i n t o i t says i t d o e s n ' t
I t seems
wotl<l< W i t h v e r s i on 1 2 of 0 5 - 9 .
M l �a r e now u s e s debug g i ng h a rdwa r e .
50
,lS- 9 U s e r N o t e s Vo l ume I
VC I A DEV I CE DR I VE R
nam v c i a
t t l V i r t ua l ( l og i ca l ) dev i ce dr i ve r
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - ---- - - - - - - - - - - *
Th i s modul e shou l d be us ed as a SCF (S equen t i a l
Char a c t er F i l e) dev i ce dr i ver .
I t doesn ' t
dr i ve any s p ec i f i c dev i c e , but , rather , c a l l s
a phys i c a l dev i c e dr iver , such a s AC IA , t o
dea l w i t h the phys i c a l dev i c e .
P o s s i b l e us es :
*
Mapp ing var i ous t ermi n a l s t o a s tandard
�,
Impl emen t i ng w i ndows .
,�
L i nk i ng a PIA and an ACIA to p rovi de
*
*
*
*
*
*
*
,�
)�
*
s w i t chab l e p r i n t ing of t erm i n a l ou tput
*
,
�
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
The I N I T c a l l mu s t s e t u p t h e env i r onment f o r
the dev i ce dr i ver before pas s i ng t h e c a l I on .
*
R e ad , wr i t e , g e t s t at , and s e t s ta t can probab l y
g e t away w i t h l e s s t han t h ey do , but al l
var i ab l e s a r e mapped b e t we en c on t r o l b l ocks
to ens u r e that thl S modu l e i s t ransparen t .
*
*
,�
*
*
*
*
The TERM c a l l mus t r e l e a s e memory a l l o c a t e d f o r
the phys i ca l d r iver be f o r e r e turni ng .
*
*
*
As i t s t ands t h i s modu l e i s a dummy . I t p a s s e s
a l l c a l l s t hrough wi t h m i n i mum i nt er f e renc e .
*
*
*
�
* - - - - - - -- - - - - - - - - - - - - -- - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - _ .
I FP l u s e / DO/DEFS / de f s l i s t
u s e /HO/DEFS / de f s l i s t
ENDC
Typ e s e t Dr i vr+Ob j c t
R evs s e t ReEn t + l
MOD V c i aLen , Name , Type , R evs , En t ry , MemS i ze
f cb U p da t . D r i ver can be u s e d f o r updat ed (read
Name f c s /VC IA/
fcb 1 e d i t i on numb e r
PDNam f c s fAC IAl
+
w r i t e)
* * * * * * * ,h�;,*
*
*
Dev i ce s t a t i c s t orage f or t h i s vi r tua l dr i v e r
org V . SCF room for SCF
PDModH rmb 2 P o i nter t o
PDModE rmb 2 P o i n t e r to
PDModM rmb 2 P o i n t e r t o
PDModMS rmb 2 amount of
MemS i ze equ
soc 2
var i ab l es
Phys i ca l Dr i v e r ' s Header
Phys i ca l Dr iver ' s Ent ry
Phys i ca l Dr iver ' s S t a t l c Memory
memory a l l oca t ed f or PD s t at i c mem
•
* * 1c * * *�< ** * -J, * *
*
*
B l ock of en t ry p o i nt s
Ent ry
bra I n i t
nop pad out each entry to three byt e s
bra Read
nop
bra Wr i t e
nop
bra Ge t S t a t
nop
bra Pu t S t a t
nop
I bra Term
soc 2
**************
*
*
*
*
*
*
In i t f inds t h e dr i ver i t wi l l u s e a phys i ca l dev i c e dr i ver ,
and al l oc a t e s and in i t i a l l i ze s i t s s t at i c s t orage
Pa s s e d :
P o int s to s t at i c s t orag e
U
P o i n t s t o dev i ce des c r l p t or
Y
Ini t
pshs
Y,U
* * * * * * * ,� *
*
*
*
adj us t p ro c e s s number t o sys t em p r o c e s s
so the l ink wi l l be i n t o the s y s t em addr e s s s p a � e .
l dd D . P r o c
p s h s D s ave A
C o l umn E i g ht
51
I dd D . Sys P r c
std D. Proc
I da #Type d r i v e r m o du l e t yp e
l e ax PDNam , PCR p o i n t X at the name o f
O S 9 F$L i nk
pu I s D r e s t o r e o l d p r o c e s s num b e r
s t d D. Proc
Ibcs Error!
t he P Dr i v e r
l dx 2 , S c o py a ddr e s s of d ev i c e s t a t i c s t o r e to
s t u PDModH , X s av e P . D . ' s M o du l e H e a d e r addr e s s
s t y PDModE , X s av e P . O . ' s E n t r y a d dr e s s
x
l dd MSMem , U m e m o ry r equ i r em en t o f P Dr i v e r
OS� F$SRqM em r e que s t s ys t em M e m o r y
l b c s E rr o r l
s t d PDM o dMS , X s ave amo u n t o f memo r y a l l o ca t ed
s t u PDModM , X s av e po i n t e r t o memo r y
,� * * * ,,, * * * * * ,,<*
At t h i s p o i n t X � o i n t s a t v c i a ' s s t a t i c s t o r a g e
U p o i n t s t o P . O. s s t a t i c s t o r a g e
*
+.
,',
l db UV . SCF l en g t h t o m o v e
* ,,< * * +. ,, +. ,,< * ,,< *,,<
Move t h e ent i r e s e t p a r t o f
i n t o P . O . ' s s t a t i c s t o re .
+.
+.
+.
t h e d ev i c e s t a t i c s t o r a g e
LMo v e E
decb
bmi XMo v e
I da B , X
s ta B ,U
b ra LMov eE go a r o un d l o o p aga i n
XM o v e
Du l s Y b u t l eave U i n t h e s t a c k
;dr * * ,'<>', * ,'< * * * * +',',*
U points
Y points
*
*
�,
t o P . D . ' s s t a t i c s t o r ag e
t o t h e d ev i c e d es c r i p t or
l dx PDM odE , X
j s r DS l n i t , X d o P D i n i t
t fr U , X
pu I s U
*
*
i���+. �*
+.
*
now X p o i n t s a t PD s t a t i c s t o r e
U p o i n t s a t v e i a s t a t i c s t or e
b s r Map ln
p u I s B , PC r e t urn t o SCF
spc 2
+.
+.------------- - -- - - - - - --- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _
+.
+.
SCF n e e d s t o s ee any chang e s t h e phys i ca l d ev i c e
d r i v e r mak e s t o V . P a u s , ( o r V . E r r ) .
X p o i nt s a t P . D. s t a t i c s t or ag e .
U points a t v c i a s t a t i c s t orage .
+.
+.
+.
*
--------- - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - -
Mapln
I db V . P a u s , X
s t b V . P aus , U
I db V . Err , X
s t b V . Er r , U
rts
spc 2
R e ad
I db IIDSRead
bra COJlllD o n
spc 2
Get S tat
l db #D$GSt a
bra toamon
spc 2
Pu t S t a t
I db /lD$PS t a
b r a C01lllllo n
s pe 2
Wr l t e
52
05- 9 U s e r N ot e s Vo l ume I
*
+.
+.
*
l db fJD$Wr i t
spc �
*---------------------------------------------------------- *
*
*
C o de u s e d by a l l ent r i es exc ep t INIT
*
P as s ed B -- o f f s et f r om P . D ' s entry p o i n t for t h i s op . *
* ------------------------------------------------------ ---- *
Common
p s hs D , U
I dx PDMociM , U
* -- --- -------------- --------------------- ------------ -- *
*
*
The phys i ca l d ev i c e driver needs t o have
*
*
V . LPRC , and V . BUSY c o p i e d t o i t each t ime i t i s
*
*
c a l l ed .
*
*
At t h i s p o i n t U p o in t s a t vc ia s t a t i c s t orage .
*
*
X p o i n t s a t P . D s t at i c s t orage .
* ------------------------------------------ ------------*
l dd V . LPRC , U
s t d V . LPRC , X
l d d V . LPRC+ 2 , U
s t d V . LPRC+ 2 , X
l dd V . LPRC+4 , U L i n e
s t d V . LPRC+4 , X
l dd V . LPRC+6 , U Dev2
s t d V . LPRC+6 , X
l dd V . LPRC+8 , U I n t r
s t d V . LPRC+8 " X
l dd V . LPRC+ l u , U PChr
s t d V . LPRC+ l O , X
l dd V . LPRC+ l 2 , U XOn
s t d V . LPRC+ 1 2 , X
�
� spc 2
�
h
*
*
The P . D. requ i res Y , and A t o be as they were
*
*
when v c i a was c a l l ed . A and Y haven ' t been
*
*
b e en d i s t urb e d .
*
*
U mus t p o in t t o P . O . ' s s tat i c s t or age .
,,<
'*
When C ommon was c a l l e d ,
*
*
B p o i n t ed t o the o f f s e t f r om P . D. ' s entry p o int
,,<
'*
that we s hou l d j ump t o .
*------------------------------------------------------ *
l dx PDModE , U
l du PDModH , U
pu I s D r e c over o f f s e t ln P . D . and A f r om s t ac k
J sr B,X
spc 2
tfr U , X point X a t PD s t at i c s t orage
pu I s U r e c over p o i n t e r to v c i a s ta t i c
p s h s B s ave r e turn c ode
b s r Map ln (X p o i n t s t o P D s t at i c , U p o i n t s t o vc i a s ta t i c)
puI s B , PC r e t urn t o SCF
spc 2
spc 2
Term
l db IfD$T e rm
bsr t ommon c a l l PD
p s h s C C , B , U CC and e r r o r # f r om P . D .
_ _ _ _ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ _ _ __ _ __ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ _
tfr
l du
l dd
059
be s
U,X
PDModH 1X addre s s o f PD s tat i c s t o rage
PDHodH� , X s i ze o f memory
F$SRtHem r e t ur n memory
Error2
l du PDHodH , X addre s s of modu l e header
** ,'f* * * * * 'Ic
* adj u s t p r o c e s s d es cr i p t or t o s ys t em p ro c es s
*
l dd D . Pr o c
p s h s D s ave D
l dd D . SysPr c
s t d D . Pr o c
spc 1
059 F$UnLink unl i nk PD
pu I s D r e c over o l d p r oc e s s d e s c r i p t or
s t d D . P r o c an� r e s t ore i t in p l a c e
b e s Err o r 2
spc 1
p u I s CC , B , U , PC r e t urn t o 5CF
spc 2
Error l
p uI s Y , U
rts
C o l umn E i gh t
53
Er r or 2
l eas 2 , S c l ear CC and B o f f s t ack
pu l s U , PC r e t urn t o SCF
spc 2
EROD
V c i aLen e qu '*
us e v t e rm
END
�
Q5 - 9 U s e r No t e s Vo l ume I
COLUMN N I NE
have
t he
UN I X
f i l es .
wo r k i ng
prob l e m
of
mon t h ' s
by
away ,
choo s i ng
c o l umn ,
m i s t ake .
I
had
done
t oo
l a te
t o get
t he
t he
cho i ce
of
made
a
t op i c
de l e t ed
Worse ,
myse l f
d i s t racted
I
in
a
back .
eas i er .
thi s
f i l e s ec u r i t y .
is
f i l es
not i c e
su b j e c t
substant i a l l y
mon t h
this
of
m i nu t e s
f i l es
a
The
for
t he
f or
bunch
d i dn ' t
u nt i l
by
t ha t
l a ter
event
mon t h
t op i c
I f you
b u t i on
on
OS-9
use O S - 9
d i s k you
are
I f you
opt i on :
by
a
1
1
1
0
1
8 3 / 05 / 1 0
8 3 / 09 / 1 1
8 3/ 06 / 1 1
8 3 / 09 / 1 4
8 3 / 08 / 28
F i gu re 2 :
numbe r .
d i rectory ,
f i le
----- -wr
- s -- r-wr
-------r
d-ewr ewr
----r-wr
2 2 34
235 1
1630
2036
1614
Output
wi l l
except J t he
f i le
(a
t ha t
own­
th i s
d i rect o r y
on
t he
con tent s
of
t he
secono
t he
p os i t i on
s ha reab l e
attr i ­
t he
a t t r i bu te
a t t r i �u t e .
in
I f t he re
f i l e can
a t i me .
is
an
"s"
i n t h i s POS i t i on .
the
on l y b e accessed by one proces s a t
next
six
f ield
are
each :
p ub l i c
t wo
p os i t i on s
groups
can do
The
exec u t e .
of
in
t he
t hree
t hat
f i le
the
f i le,
e l se
can
t ha t
it
can
do
is
c l as s of
ca l l ed
User
1 .
p r o t e c t i on .
wri te
a t t r i bu t e
a t t r i bu t es
r ea d .
a nd
I f II pub­
pr i v a t e execute wr i te a nd r ea d .
I ic a t t r i bu t e
i s o n ( i nd i c a te d b y a l e t t e r
i ns t ead o f d a s h i n t ha t p o s i t i on ) t he n a n y
u s e r ca n d o t hat c l a s s of opera t i on s .
If a
p r i va t e a t t r i bu t e
i s on .
t he owner of t he
f i le
read
or
a ny t h i n g
and
oper a t i o n .
C o l umn4
has
t yp i ca l
who
i s t he owner o f
w r i te
to
it
it.
e,nd
exce p t
get
a
l i st
of
t he
d i rectory
about
each
f i l es
w i th
f i le
as
a
"E"
t he
in
your
l ot
of
i l l U s t r a t ed
C o l umn 4
C o l umn8
C o l umn5
PROGRAMS
Di c t i onry
wr i t e
t o t he f i l e wh i l e o t he r
and
t h i ng s
get
r ea l l y
s t i ck y
want
to
update
t he
f i le
access
it.
if
s e ve r a l
at
t he
s ame
t i me .
T he non - shareab l e a t t r i b u t e i s m o s t
i mpo r t a n t when s e v e r a 1 u s e r s w a n t w r i t e to
a f i l e concu r r en t l y .
The prot e c t i on of c o l umnS demons t r a t e s
one of t he more u s ef u l appl i ca t i o ns o f f i l e
p ro t ec t i on i n a S i ng l e u s e r s y s t em .
It
is
i mpOSS i b l e f o r
a nyone .
even
t he
owner
of
t he
fi le.
to
wr i t e
to
chang i ng
i t 5 a t t r i bu t e s .
o f opera t i on 5 con t ro l l ed
t i on
i nc l udes
i ng .
a
be
f i le
w r i t i ng ,
wh i ch
de l e t ed by
is
i t
w i t ho u t
f i rs t
S i nc e t he c l as s
b y w r i te protec­
renam i ng ,
w r i te
m i s ta ke .
If
e n d de l et ­
p r o t e c t ed
I
had
can ' t
wr i te
pro­
tec ted my f i l es I
wou l dn ' t have been a b l e
t o de l et e t hem w i t hout t h i nk i ng a b o u t i t .
It
wou l d
appear
to
be
i mp os s i b l e
to
ever d e l e t e a w r i t e p ro t e c t e d f i l e . b u t t he
owner of t he f i l e can u s e t he a t t r command
to
change
t he
a t t r i bu t e s .
The
p roced u r e
f o r de l e t i ng a w r i te
t he a t t r command to
t ec t i on :
nobody
p r o t ec t ed f i l e i s : u s e
remove t he w r i t e p r o ­
059 : a t t r c o l umnS w
observe
is
t he
p r o t ec te d
fi le,
but
such
on l y
t ha t
any
user
1
user.
non - s hareab l e a t t r i �ute prevent s
get t i ng
c o nf U S i ng
when
user
f rom
de l e t e
the
f; le
w i th
t he
norma l
del
command .
can·
wr i te to i t .
It a l �o has t he non- sha reab l e ­
a t t r i bu te wh i ch p r o t ec t s
i t a ga i ns t
be i ng
a c c e s s e d by more t han one u s e r a t a t i m e .
The
w i th
com i ng
abou t .
Whoever
gets
to
the
f r om
f i l e f i r s t h a s exc l u s i ve access to i t u n t i l
he
c l oses
i t .
If
sever a l
u se r s
wa n t
to
read a f i l e a t t h e same t i me t he r e i s u s u ­
a l l y no reason n o t t o l e t t hem d o s o , p rob1 ems s t a r t t o appea r' when a u s e r wa n t s to
T "en
read
command
t here .
C o l umnS
can
f r om
p ro t e c t i on
D I R Command
of
users
T he
the O I R
work i ng
4141
45BD
608 1
3EO
8 E9
CO
AF
B4
SD
245
f i rs t
POS i t i on
in
t he
a t t r i bu t es
The
f ie l d
is
for
t he
d i re c t o r y
a t t r i bu t e .
D i r e c t o r y f i l e s have seve r a l spec i a l
char­
a c t e r i s t i cs , t he o n e re l a t i ng t o p r o t ec t i on
i s t h a t t hey can ' t be d e l e t e d w i t h t he D E L
comma n d .
is
fi Ie
i n F i gu r e 2 .
f i el d .
The
use
i nf o r ma t i on
c a l l ed PROGR*MS ,
be l ong t o u s e r num ­
.
T he t ype o f p r o t ec t i on g i ve n t o a
depends
f ield
s ome
1 9 : 50 : 32
•
The
i n f orma t i on
in
th i s
d i sp l ay
re l a t e s t o a f i l e ' s p ro t ec t i on a r e i t s
e r a n d a t t r i bu t e s .
Al l
t he f i l es
in
butes
OS-9 ' s
to
sepa r a t e d
Las t m o d i f i ed a t t r i b u t e s s e c t o r byt e c o unt name
Owner
f i l e)
be r 1
by
and .
are
059 : DIR E
as i t came of f t he d i s t r i ­
wi 1 1
b e t he o n l y u s e r and
d i r e c t ory of
s p ec i a l :
s up e r u s e r .
for
you
known
is
0
t he
user s ,
s u p e r u se r ,
f i l es
current
Users
him
s c heme .
I
this
f i rst
d i sk
-­
This
other
t he
User
O.
ca l l
has
spec i a 1
p r i v i l eg e s
t ha t
c i rcumvent t he p rot ec t i on of
Al l
extent
was
number
wou l d
The
superuser
enab l e h i m to
PROTECT I ON
As
user
users
t h i ng s
1
i s·
upda t i ng
t he f i I e a nd some o t her u s e r
i s,
rea d i ng
it,
by
p reven t i ng
t ha t
s ; t ua t i on�
ry
None
have
of t he d a t a f i l es i n t h i s d i rec t o ­
t he exec u t e a t t r i bu t e .
They
a re
al l
t e x t f i l e s and man i f es t l y not execu t a ­
ble .
O S -9 10' 1 1 1 o n l y l oa d a f i l e f o r e x e c u ­
t i on
if
it
ha s
t he
execu t ab l e
a t t r i bu t e .
T he
f r-om
sepa r a t i on
t he
read
of
t he
a t t r i bu t e
exe c u t e
makes
i t
a t t r i bu t e
poss i b l e
C o l umn N i n e
55
to
06
c reate
an
exec u t e - on l y
d i f f i cu l t
d i s a s semb l e
file.
f or
someone
to
copy .
an
e x e c u t e - on l y
It
wou l d
dump ,
file.
or
T he
execu t e - o n l y
f or
a t t r i bu t e
is
p r o t ec t i ng p r o p r i e t a r y
a
u se f u l
t r i ck
s o f t wa r e .
Echo P r e s s c ar r i ag e r eturn t o i n i t i a t e l ogon >/TERM
E c h o P r e s s c a r r i ag e r e t urn t o i n i t i a t e l ogon > / I T I
Echo P r e s s carr i ag e r e t ur n t o i n i t i a t e l og on > / I T2
TSMON / I T l &
TSMON / I T 2&
TSMON / TERM
F i Qure 3 :
ed
A
to
S a mp l e
p a r t i cu l a r l y
t he
S t a r tup
sneak y
execute
file
p r Ob l em
a t t r i bu t e .
is
re l at ­
M e r g i ng
c u t ab l e f i l es t og e t her t o f o r m a f i l e w i t h
a l l t he modu l e s u s e d by some p r o g ra m , or t o
a
set
of
popu l a r
ut i l i t ies
to
be
a ' l ow
1 0a d e O compa c t l y u n d e r L ev e l Two , w i l l c r e ­
a t e a l' i 1 e w h i c h does n ' t h a v e t he e x e c u t e
a t t r i bu te .
O S - 9 w on ' t
l et you exec u t e o r
l oa d t he r e s u l t i ng f i l e .
I t g i ve s an e r r o r
214,
" NO
P E RM I S S I ON . "
T he
fix
for
th i s
p r o b l em i s t o u se t he A T T R command
t he f i l e t he execu t ab l e a t t r i bu t e .
one
If
you
use�
on
d on ' t
i n t end
you r
to
compu t e r
ha ve
t he r e
to
g i ve
more
t ha n
i s
no
rea­
son f o r
,'ou
t o w o r r y abou t
user
numbe r s .
I l'
you
want
to
share
your
compu t e r
w i th
o t h e r peop l e - - e i t h e r
t a k i ng t u r n s u s i ng
t he compu t e r or u s i ng O S - 9 as a m u l t i - u s e r
ope ra t i ng s y s t e m - it
I s a g O O d i dea t o
have a sepa r a t e u s e r number f o r each p e r son
wno uses the compu t e r .
T he b e s t w a y to s e t
y o u r u s e r n u mb e r I s t o s t a r t t he T SMON p r o ­
T he l l!l s t 1 i ne i n
c e s s i n t he s t a r t u p f i l e ,
t he s t a r t up f i l e s hou l d b e s omet h i ng l i ke :
TSMON /TERM
T SMON
w i l l j us t s i t t he r e u nt i l you t ype a
t he
ca r r i age
retu r n .
Thi s
may
g i ve
y ou
, mpress i on t ha t some t h i ng i s w r ong w i t h t he
�omou t e r
u n l ess
you
a re
ready
for
thi s
t o l i d l ack o f a c t i v i t y .
T o c om f o r t m ys e l f
i nc l u d e t he 1 i ne :
ECHO Pr e s s carr i age r e t urn t o
i n i t i a t e l og on>/TERM
bef o r e
file.
•
Init ial
exe­
t he
T SMON
command
in
t he
s t a r tup
It
l eaves d i r ec t i o n s on t he s c reen
a f t e r I boo t t h e s y s t em .
I f y o u are l uc k y
enough t o o w n a s y s t em l a rge enough t o s u P ­
p r i o r i ty
Ini t ial
.
execu t i on
)
Init ial
•
data
d i r ec t o ry
Ini t ial
p ro g ram
" s he l l " )
password
f i le ,
f or
t he
m i stake
a ga i n .
and
the
fi 1
be
eve r y t h i ng
.
t he
l as t
g o i ng .
It
T SMON a s a
The rna i n bus i n e s s o f T SMON 1 s done by
L OG I N command .
The LOG I N command u se s
es
c a 1 1 e d p a s s wo r d a n d m o t d w h i c h
i n t he S Y S d i r e c t o r y on t he s a me
the d e f a u l t d a t a d i r e c t o r y i s on
/ 00 ) .
T he p a s s w o r d f i l e i nc l u d e s
( no r ma l l y
t he u s e r
name , u s e r - number . a nd , opt i ona l l y .
word f o r each u s e r a u t ho r i zed t o
compu t e r .
ma t i on
eaCh
It
used
user .
a l so
to
The
i n t he p a s s w o r d
set
i nc l udes
ful l
up
t he
a
f i l e a re :
a pa s s ­
u se
t he
l ot
of
i nf o r ­
of
e.ech
e n v i r o nment
conten t s
U s e r Name
•
•
56
must
d i Sk
Pas s w o r d
U s e r Number
05- 9 U s e r No t e s Vo l ume I
for
l i ne
. )
( us ua l l y
f o r a u s e r - na m e ,
p a s s wo r d
in
t he
pa s s wor d .
f or
If
t he
f i le,
or
a nnounces
user
name
command
p rotects
each
user
T he
l og i n
numbe!'" f r om unaut hor i z ed u s e b y
i ns i s t i ng
on g e t t i ng a gOOd u se r - name/ pa s s wo r d m a t ch
before
l e t t i ng someone u se a
u s e r -numbe r .
Many d i f f e rent u s e r s c a n s h a r e a u s e r - num­
ber ,
a l l ow i ng
t he rr:
to
share
f i l es
in
a
g roup . b u t each u s e r - name c a n o n l y be a s s o ­
c i a te d w i t h one u s e r
If
number
number
you f i nd a need t o c h a ng e your u s e r
i n t he m i dd l e o f a s e s s i on w i t h y o u r
compu t e r
you m a y b e a b l e do
it
L O G I N command .
T h e L O G I N command
be
on
wi th
t he
can on l y
u se d i f your d e f au l t d a t a d i r e c t o r y
is
t h e same d i s k the pa s s w o r d f i l e i s on .
T he L O G I N command needs
to r e a d t he pa s s ­
word
f i le.
If
you
protect
t he
pa s s w o r d
f i l e aga i n s t pub l i c read t o k e e p e v e r yone
f r om brows i ng t h rough the p a s s w o r d s , nobody
but
t he
mand .
t he
super user
can
be
d i sp l ayed
on
a nyone l og s on .
It
a gene r a l
gree t i ng ,
t ia l
use
T he m o t d f i l e con t a i ns
day . "
I f t h e r e i s a ny
t u s i nf or ma t i on o f
" We
are
runn i ng
a
t Oday . »
get
e x e cu t e
p r omp t s
i s 1 mo o r t ant t o s t a r t
f or e g round t a sk ( no & )
to
a
( usua l l y
( us u a l l y
u se r - name
i sn ' t
i n t he
pa s s w o r d
t h e p a s s wo r d i s n ' t cor rec t , L O G I N
wi 1 1
1' ; l e
to
T he l og i n command p r om p t s
a nd ,
if
t ha t
user
has
a
po r t t h ree t e rm i na l s ,
t he seQuence of com­
mands i n F i gure 3 s hou l d be i nc l uded 1 n t he
s t a r tup
d i rectory
Some
t r i ck s
p r o g r am "
p os s i b l e
to
In
t he
t he
LOGI N
com­
t he " me s s age
t e x t i n mo t d
s c r een
each
of
it
t i me
c a n be u se d t o d i sp l ay
or t o g i ve s y s tem s t a ­
gener a l
i nt e r es t ;
e.g. ,
new
cen
t he
spec i f y
be
r e l ea s e
done
w i th
p .e s s wo r d
not
of
on l y
Pasca l
t he
fi le.
t he
" i ni ­
It
i s
initial
p r o g r am ,
but
I!l l so
iii
pa rame t er
s t r i ng
for
it.
Th i s opens u p exten s i ve p o s s i b i l i t i e s .
Most
t he
user
opera t i ng
commands
c u t ed
prof i l e
every
w i l l i ng
to
sys tems
in
or
a
fi le
iii
t i me
l og i n
he
a c cept
a l l o�
a
u se r
to
have
fi le)
exe­
l i m i . a t i on s ,
t he
( so�e t i mes
command
l og s
some
on .
If
ca l l ed
you
a
are
i n i t i a l command c a n be u s ed t o do much more
t h a n s t a r t a s he l l for you w h e n you l og on .
T he
S i mp l es t
POSS i b l e
entry
p a s s w o r d f i l e m i g h t go s o me t h i ng
myname , , 3 , 1 0 0 , . , . , she l l
in
l i ke :
t he
wh i ch
wou 1 d s e t up a user ca 1 1 ed myname .
wou 1 d have a u s e r number of :3 , a nd
wou l d be s t a r t ed w i t h a pr i o r i t y Of 1 00
H i s da t a a nd execut i o n d i r ec t o r i es wou l d b e
s t a ndard
for
most
s y s t ems
/00
a nd
/ OO / C M O S .
Whenever myname l og s i n a s he l l
w i l l be s t a re d f o r h i m .
Myname
[
A s omewha t more demand i ng u s e r can m a K e
t he pas s word f i l e d o much more f o r h 1 m .
If
t he l i ne i n F i gu r e 4 i s
i nse r t ed i n t he
pass word f i l e .
i t set s up a u ser w i t h a
p a s sword of xyzzy . g i ves h j m non- s t andard
data and execu t i on d i rec t o r i e s . a nd runs
FREE a nd M F R E E for h i m be f ore l eav i ng h i m
runn i ng a s he l l .
]
h i sname , xyzzy , 2 , 1 5 0 , /DO/ H I SDIR . /DO/BAS I CX , sh e l l f r e e ; mfr e e ; ex s he l l
F i gu � e 4 :
P a s s w o rd F i l e E n t r y
_.
. T he i mpor t a n t t h i ng i s t ha t t he sequence o f
commands t he u s e r wan t s exec u t e d mus t s t a r t
w i t h t he name o f t he p rogram t ha t w i l l
i nt e r p r e t t he r e s t o f t he 1 i ne .
I f t ha t
p r o g ra m i s t h e s he 1 1 . t he 1 a s t command i n
t ha t s he l l ' s parame t e r s t r i ng mus t be a n e x
f o r wha tever command y o u w a n t t o s t a r t t he
user w i th .
I f you want t o s t a r t a u s e r w i t h III p a r ­
t i cu l a r l y l on g s c r i p t of command s , perhaps
e nough commands t o h o l d h i m f o r a n ent i r e
s e s s i on ,
use a shel l
command f i l e .
T he
t r i ck i s to have t he i n i t i a l command b e
" s he l l " w i t h a f i l e name a s t he parame te r .
t he f i l e
i sn ' t
in
t he def au l t
da t a
If
d i rect o r y i t s f u l l p a t h - name must b e speC i ­
f i ed .
A s amp l e p a s s wo rd f i l e e n t r y m i gn t
go l i ke :
hername . w l t rs . 5 , 1 30 • • • . ,
s he l l her . cmd . f i l e ; ex s he l l
I n t h i s case t he f i l e " he r . Cmd . f l 1 e " mu s t
b e i n t he s y s tell' defau l t data d i rec t o r y .
T he command f i l e i nv o k ed a t l og i n i s j u s t
l i k e any o t he r s he l l
command f i l e .
T he
i mp o r t a n t res t r i c t i on to remember i s t ha t
t he s he l l command f i l e i s r u n b y a d , f f e r ­
e n t s he l l f rom t he one t ha t t he user w i I I
be us i ng when t he command f i l e i s f i n i s hed .
I f you change t he d i r ect o r i es i n t he com­
mand f i 1 e , t hose Changes w i 1 1 e f f e c t on 1 y
t he she l l
runn i ng t he commands .
not t he
s he l l t ha t w i l l be r u nn i ng a f ter t he com­
mand f i l e i s done .
THE " SUSPEND STAT E "
M i croware h a s a d de d a
n i f t y perf orma nce
enhancement to t he l a t e s t vers i on of 0 5 - 9 .
T he y d i s covered t hat dev i ce dr i ve r s were
s p e nd i ng a S i gn i f i ca n t amount of t i me u s i ng
t he F S S ENO s e r v i ce reques t ( SR ) to commu n i ­
ca t e be t ween t he i nt e r rupt s e rv i ce rout i ne
f o r the port a n d t he r e s t of t he dev i ce
d r i ve r .
I n order t o under s t and why t he
s e n d w a s done you need some background i n
t he way t he O S 9 S C F dev i ce dr i ve r s work .
T he s i mp l es t way to w r i te a dev i ce d r i ve r
i s t o read and w r i t e t o t he po r t d i rect I y
f rom t he read and w r i t e e n t r i es o f t he
d r i ve r , but t h i s requ i res t h a t t he d r i ve r
go i nt o a wa i t l oop wh i l e t he i n t e r f a c e
C h i p ' s p e r f o rm i ng t he opera t i on .
A wa i t
l oo p i sn ' t a bad t h i ng i f t he proces sor h a s
no t h i ng 1: 0 do u n t i l t he I /O i s comp l e t e .
b u t . i n an env i r onment l i ke O S - 9 , t here a r e
l i k e l y to b e sever a l t a s k s wa i t i ng t o g e t
done .
T he " r i gh t " w a y t o w r i te a dev i ce
dr i ver under 0 5 - 9 1 s t o have t he a c t ua l 1 / 0
done by an i n terrupt serv ; ce rout i ne . a nd
have t he read and w r i t e ent r i e s of
t he
dev i ce dr i ver s ha re queues w i th t he i nt e r -
rupt rout i ne .
A charac t e r t o be WI'" i t ten goes t o t he
w r i te e n t r y of t he dev i ce d r i ve r wh i ch p u t s
t he c ha r a c t e r i nt o t he w r i te queue i f t here
i s space f o r i t . or goes to s l e e p i f t here
i sn ' t .
The i nt e r f a c e cn i p shou l d be set t o
gene r a te a n i nt e r r u p t whenever i t i s ready
to w r i t e anot her charac t e r .
T h e i nt e r r u p t
s e rv ; ce r o u t i n e w i l l b e s t a r t ed every t i me
an i n t e r ru p t i s rece i ved f rom t he port i t
1 s r e SPOns i b l e f o r .
I f t he i nt e r rupt w a s
a n o u t p u t i n terrup t , t he i n t er rupt serv i ce
rout i ne w i I 1 t a ke e c ha r a c t e r out of the
o u t p u t queue and s e nd ; t t o t he por t .
1f
the dev i ce d r i ver i s s l eep i ng , wa i t i ng f o r
a n e mp t y s l o t i n t he queue t o appea r . t he
i n t e r r u p t s e r v i cs rout i ne s hou I d send i t a
wakeup s i gn a l .
The procedure f ,or read i ng a cha r a c t e r
i s rough l y the reve r s e of t ha t f o r wr i t i ng .
T he queue f o r i nput goes f rom t he i nterrupt
rout i ne t o t he read ent ry and t he dev i ce
dr i ver s l eeps I f a read i s done when t he
queue i s emp t y .
Al l
t h i s send i ng f ro m the
i nterrupt
s e rv i ce rou t i ne t o t he dr i ve r i s expen s i ve .
A
new s y s t em s t a t e ca l l e d t he
" Suspend
S tat e " was i nvented t o keep dev i ce dr i vers
f rom hav i ng t o u se F S S END reque s t s to s t a r t
a nd s t op , t s read and wr i t e o pe r a t i ons .
T he · su s pend s t a t e " i s a l o t l i k e a l i g h t
nap .
T he process
is
in
t he g r e y a rea
be tween s l eep and a c t i v i t y .
Suspended p r o ­
cesses r e m a i n 1 n t he a c t i ve p rocess queue
where t hey qu i ck 1 y age to t he t op of t he
queue , b u t w h i l e t he s u spend b i t i s on i n
t he i r
p r oc e s s
des c r i ptor
t he y
can ' t
be
s chedu l ed .
T o wake a s u s pended p r ocess u p
j u s t turn t he s u spend b i t of f i n i t s p r o ­
cess des c r i pt o r .
T he f O l l ow i ng code wou l d
wake a s u s pended process f rom t h e i nt e r r u p t
r ou t i ne Of a dr i ve r :
l dx (Add r e s s o f proc e s s
d e s c ri p t or for the p r o ce s s
.you want t o awaken)
I da IIZ55-Suspend
anda PSS t a t e : X
s t a P$S t at e , A.
T h i s sequence o f i ns t ru c t i ons can be done
g rea t dea l f a s t e r t han a F $ S E ND .
iii
A p roce s s can s uspend i t se l f by t u rn i ng
t he s uspend b i t i n i t s proce s s descr i p t o r
o n , t hen S l ee p i ng f o r iii t i Ck ,
T h e s i eep I S
j u s t 8 way o f g i v i ng up t he r e s t of t he
t i me s l i ce .
E ven w i t hout t h e F S S l eep . next
t i me t he d i spat Cher sees t he s u s pended p ro ­
c e s s de scr i p t o r i t w i 1 1 t reat i t a s s u s ­
pende d . a n d won ' t s t a r t i t a ga i n u nt i l t he
s uspend b i t i s t u rned of f .
Co l umn N i n e
57
T he r e a r e c. f e w i mpor t a n t 1 i m i t a t i ons
t o t he s u s pend s t a t e .
T he f i r s t i s that a
p r oces s can ' t ge t ou t of su spend s t a t e o n
i t s own .
T he s ec ond l i m i t a t i o n i s t h a t t he
s u s p end b i t i s i n t he p r oce s s d e s c r i p t o r
wh i c h i s t he i n t he s y s t em addr e s s spac e .
A
no n - s y s t em process has no e a s y way o f
58
� 9. U s e r Not e s Vo l ume
I
d i re c t l y moo i f y i ng t he process des c r i p t o r .
l ast
l i m i t a t i on
is
impl i c i t
i n t he
T he
advantage of s u spend s ta t e . suspended p r o ­
c e s s e s s t ay i n t he a c t i ve p r o c e s s queue .
T hey w i l l s l ow t he d i s pa tcher down s l i gh t l y
beca u s e i t w i l l have to pa s s over t hem e ach
t i me i t l oo k s f or the nex t proce s s t o run .
COLUMN TEN
MORE ABOUT COMPUTERS AT SCHOOL
had my f i r s t c ha nce t o l oo k t h rough a
m i cros cope when I was very young .
t.1y s i s ­
ter was deep l y i ng r o s sed i n t he m i c ro s c op i c
wo r l d s o I , be i ng a t yp i ca l younge r O " o t h ­
er , hung a round a nd made a pes t o f my s e l f
unt i 1 s he s howed me whe t s he was w o rk ; ng
on .
I cou l d r. ' t see any t h i ng but a O l u r
wh 1 c h some t i mes f a ded ou t a l t oge t he r .
I
d i dn ' t see muCh p O l nt 1 n l oo k i ng a t a b l u r .
A s years went by I was g i ven my own m i c ro ­
scop e ,
bu t
c hem i s t ry
se t s .
and my
own
expe r i men t s , were much more i n t e r e s t i ng .
st i l l
had
t roub l e ge t t i ng
i nt e re s t ed
in
b l urs .
I n n i n t h g r a de
encou n t e r ed a rea l
m i croscope f o r t he f i r s t t i me .
I t was a
f i ne o l d i ns t rumen t .
T he t eacher t re a ted
i t w i t h - grea t respect , and i ns i s t ed t ha t we
do t he same .
When I f i r s t u s e d i t I got a
surpr i se t ha t s t a y s w i t h me t o t h i s day .
I t was not h i ng l i k e t he m l c roscopes I had
u s ed Oe f o r e ,
f oc u s i ng
j t w i t h t he f i ne
adj u s tment knob was no p rob l em , a nd when
some t h i ng wa s i n f ocu s , even a s i ng l e c e l l
or a bac t e r i um , i t was very c l ea r .
I c ou l d
have happ i l y spent wee k S peer i ng t hr ough
t he eyep i ece at every t h i ng I cou l d f i t on
E ventua l l y t he C l 8 S S moved on
t he s t a ge .
t o o t he r t h i ng s , bu t I had a new appreC i a ­
t i on f o r t he wor l d of t he very sma l l .
I t i s u n f a i r t o b l ame my pare n t s f o r
n o t get t i ng me II h i gh qua 1 i t y m i c r oscope
when I
was e i gh t ,
but
i t bot he r s me t o
t h i nk o f w h a t I m i s s ed .
I was f a s c i na ted
by wha t t he m i c r oscope revea l ed when ! was
a t eenage r .
T he e f f ec t wou l d have been
even s t ronger i f I had been younge r .
My exper i e nce w i t h t he m i c r os cope i s
what mak e s me keep comp l a i n i ng about t he
t endency of Schoo l s to u s e t he l ow e s t qua I ­
l ty hardware and sof tware t hey can f i nd .
The younger t he s t uden t s .
t he l ower t he
qua l i t y .
The a rgument I s t h a t soph 1 s t i ca t ­
ed har dware and sof t ware i s n ' t needed f o r
any but t he m o s t advanced s tudent s .
Thi s
i s a s e r i ou S error .
W i t h compu t e r s " f oo l ­
means
e i t he r
trivia1
or
very
proof "
soph i s t i ca t ed .
I t reClu i res good hardw ar e ,
and exce l l ent sof t wa r e t o dea l s a t i s f a c t o ­
r i l y w i t h t he wor s t a c h l 1 d can do . T he
k i ds a t mos t schoo l s a r e ge t t i ng t he same
k i nd of e x pe r i ence w i t h comp u t e r s I g o t
w i t h my ear l y m i croscope
onl y a b l urry
i ma�e o f w h a t i t s hou l d be .
•
T he sect i on of a c o l umn I w r o t e a f ew
months ago about compu t e r s f o r schoo 1 s has
drawn more comment t han any o t her co l umn I
have wr i t t e n , maybe more t han a l l of t hem
p u t t oge t he r .
Some peop l e w r o t e to a gree ,
others d i sa greed .
I was g l ad t o hea r f rom
t hose who a greed w i t h me , bu t I was most
i nt e r e s t ed i n t he l e t t e r s f r om peop l e who
took i s su e w i t h one or more of my p o i n t s .
T wo o f my p o i n t s drew p a r t i cu l ar l y heavy
cr i t i c i s m .
I ca l cu l a t ed t he p r i c.e of an
i ma g i nary ( bu t r ea l i s t i C ) S i ng l e - us e r com­
pu t e r .
Severa l peop l e t houg h t an adequa t e
compu ter c ou l d be p u r Chased f o r l es s t han I
sugges ted .
I a 1 so spent some t i me w i s h i ng
I t d i dn ' t
SChoo l s wou l d s t op u s i ng B as i c .
Surpr i se me t ha t seve r a l reade r s f e l t B a s i c
was a f i ne l anguage .
T he 1 i t t 1 e s t o r y abou t t he m i c ro s cope
was i n t ended to addres s t he que s t i o n : " why
bo t he r
to
p rov l de
decent
comp u t e r s
at
s choo l '? "
S t uden t s shou l d b e g i ven a c ha nce
t o use a comp u t e r t ha t t hey don ' t have to
s t r u gg l e w i t h , a nd a l anguage t ha t encou r­
ages
c l ea r
t h i nk i ng .
K i ds
do n ' t
k now
enough
to
comp l a i n
about
BaS i c
on
t he
Cheape s t comp u t e r t ha t can be f ound .
I do .
so I am comp l a i n i ng f o r t hem .
T here were abo u t f i ve more p a r a g raPhS
here abou t Ba S i C , and t he e v i l s of s k i mp i ng
on compu t er s f o r Ch l 1 dren ._ bu t w h i l e re­
read i ng t he CQ:'I u m n ) >Qec i dad .toe t I sounded
'
- P
"
'
l e a s e f o r g i v e t he abrupt
a b i t shrl l l :
t ra n s i t i on , but t he smoot h conc l u S i on of
t h i s a r gument has been p runed w i t h a q u i ck
b l OCk - de l e t e .
..
P I PES
One of t he mos t usef u l
f e a t u res o f O S - 9
( and UNI X )
i s the p i pe .
P i pe s b y t he m ­
se 1 v e s aren ' t g O O d f o r muc h . bu t
i f you
bu i l d a good set of " s o f t ware t oo l s , " p i pe s
maKe many t a s k s s u rp r 1 s i ng l y easy .
A p i pe i s a speC i a l dev i ce wh i ch f o r m s
a conne c t 1 0 n bet ween t w o p rograms such t ha t
t he ou t p u t f rom o n e i s d i rected i nt o t he
i np u t of t he o t he r .
T he s he l l i s Ia ma j or
Y ou c a n ask t he s he ' 1 t o
user of p i pes .
connect t he s t anda r d o u t pu t o f one p r og ra m
t o t he s t anda r d i nput o f anot her by pu t t i ng
an e xc l am a t i on po i n t U ! " bet ween t he com­
mands
T he » ! " sepa r a t es c omman d s 1 i k e t he
u ; "
a n d " & " do , but i t a l so red i re c t s t h e
ou t p u t of t he command bef o r e i t i nt o t he
i np u t of t he command ef t e r i t .
Y o u c ou l d
g e t t he s ame e f f ec t b y u s i ng i n t e rme d i at e
f i l es ( Have t he f i rs t command s ave i t s ou t ­
pu t i nt o a d i sk f i l e .
When t he f i r s t com­
mand ends , r u n t he second command w i t h i t s
i np u t com i ng f rom t he f i l e t he f i r s t com­
mand wrote . ) . b u t
i n t e rmed i a te f i l es are
ne i t her a s fast
nor a s easy to use as
p i pes .
Whe n you f i r s t s t a r t usi ng O S � 9 , p i pe s
won ' t b e of much use t o you .
F or o n e t h i ng
t he y are a b i t conf u s i ng , bu t . more i mpor ­
t a nt .
t h e s t andard 0 5 - 9 u t i l i t i es
d on ' t
i nc l ude many f i l te r S .
A f i l te r 1 s a program w h i ch reads f ro m
t he s t llndard i np u t of i 1 e and wr i t e s t o t h e
s t a ndard output f i 1 e unt i 1 end o f f i 1 e o n
s t andard i npu t .
T he y can be u s e d w i t hou t
p i pe s , bu t ,
i n comb l na t i on w i t h p i pes , a
good t oo 1 box of f i 1 t e r s can be among t he
mos t
u s ef u '
f a c i I i t i es
ava i 1 ab 1 e
under
OS-9 .
The mos t e l emen t a r y f i l t e r wou l d s i mp l y
copy bytes f r om s t andard i nput to s t andard
ou t pu t .
More advanced f i 1 t e r s Change d a t a
on 1 t s loI a y t h rough .
S ome common f i 1 t e r s
s o r t t he da t a . break i t i nt o words , remove
dup l i ca t e l i nes ,
count by t e s ,
wo r d s ,
and
l i nes , and t r a ns l a t e upper case l e t te r S t o
l o wer case .
I t i s re l a t i ve l y easy to w r i t e spec i a l
f i l t e r s t o s o l ve Prob l ems one a t a t i me .
The t r i ck 1 5 t o w r i t e f i l t e r s w h i ch .
in
comb i na t i on w i t h o t he r S ,
can do l ot s o f
usef u l
t h i ng s .
I
have a f l l t e r wh i ch 1
C o l umn Ten
59
cal l
" wo r d s "
( a va i l ab l e
� r oup .
but
t oo
oreaks
t he
i npu t
wrote
I
l o ng
f or
up
a n o t her
f rom
reache d .
t oge t he r
t ha t
w i th
counts
I
program
can
a
hook
p i pe
t he w o r d s
to
in
wh i ch
wh i c h
comma nd
s l i ces
output
i nput
of
of
l i ne
it
words
r j age
wh i c h
to
per
l i ne .
r e l i es
those
fed
is
two
a
t he
p r o g r ams
c ommand
l ineet
!
i nto
t he
r espondS
by
in
a
w r i t t en
o t her
f i l t ers
ca l l ed
1 ist
S 1 nce
I
of
t he
have
un i q
s or t
words
I
a
u s ed
number
in
of
t ha t
pro­
w ou l d n ' t
pu t
up
w i th
s i nce C i s n ' t
and
B a s i c09 .
Both
BWord
grams .
a s t he y
;n
a 5 w i de l y u s e d a s
I ' l l
i nc l ude
two
B a s i c09 ,
a nd
and
L i neCt
are
CharCt
c ru d e
in
pro­
T h e y a re nowhere near a s e f f i c i ent
can be .
I n p ar t i cu l ar , read i ng one
c h a r a c t e r a t a t i me i s i nt e ns e l y bad p r a c ­
t ; ce
c ou l d
under
be
p a r ameters
CharCt
0$ - 9 .
Both
g e ne r a l i z e d
of
these
by
u s i ng
more e x t e n s i v e l y .
c ou n t s
t he
p r o g r a ms
command
It
cou l d
number
of
be gener a l i z ed
60
s he l l
a l ways
some
on
t he
its
o t he r
c om ­
<tes t f i l e
i n testf ; l e .
cha r c t < t e s t f i l e
c a r r i age
returns
in
tes t f l 1 e .
s t r i ng
of
characters
de l i m i ted
by
any
g i ve n set of c ha r ac t e r s .
One use o f
thi s
t ha t comes t o m i nd i s t o d i v i de a f i l e i n t o
s e n t e nces b y break i ng i t a t e a c h p e r i od .
a
shou l d
words
be
e n t e r ed
w i th
nave RUNS
l i ne 1 I k e :
you
8as i c 09 ,
can
run
< t es t f i l e
somewhat
l onge r
comma n d
l i ne :
to
l ook
p l a ce s
at
i 5 easy
t o s p e nd III g r e a t
dea 1
of
w r i t i ng f i l t e r s yow w i l l n e v e r u s e .
Wha t i s needed i s a set of gener a l
purpose
t oo l s .
T h e r e a r e seve r a l
s o u r c e s f or g o o d
i de a s f or f i l t e r s .
Book s a b o u t UNI X o f t e n
g i ve de s c r i p t i on s
m o n 1 y u sed under
concept
is
u se f u l
T he
i ts
has
it
wi l l
al so
be
It
than
ca r -
c o n n e c t s t r i ng s of'
Any
program
t ha t
access t o O S - 9 s y s t e m ca l l s c a n u s e t he
t r i ck t he s he l l u s e s to m a k e t h e s t a n ­
output
of
one of
i ts
ch i 1 d r e n
feed
d i rect l y
i nto
t he
s t anda r d
i np u t
of
a n o t he r . but i t i s s i mp l e r t o u s e p i pe s a s
a
p r oce s s
a nd
its
a
connec t i on
between
parent .
If
you
need a f o rma t t ed
l ist
of
same
dard
proce s s e s
( t he
1 n f o r ma t i orc
procs comman d ) you c a n e i t he r
procesE des c r i p t o r s you r se l f ,
to
i n t e r cept
If
your
t he o u t pu t
a l g o r i thm
s ec t i ons
l y be done by
pat ched
f r om
=�arac­
05-9 Use r N o t e s Vo l ume I
UN I X
She l l u s e s p i pe s t o
c h i l dren
t o ge t he r .
f or
a
for
wh i ch a r e c o m ­
genera 1 .
if
a
A MORE ADVANCED APPROACH TO
P I PES
one
l ea s t
of f i l te r s
UNI X .
1n
for 05-9 .
T h e s t andard pI'ogramm i ng b o o k ,
Sof t wa r e T oo l s ,
by Kern i g h a n a n d P l au ge r ,
i s an e s pe c i a l l y good s ou rc e f o r i de a s a n d
a l go r i t hms .
o c c u r rences
ter
s t r i ngs ,
or
r e gu l a r
e xpr e s s. l o":!> .
m i ght a l so be i mproved by u s i ng morE
t hree b y t e s f o r t he c o u n t e r .
T he
count
to
in
s t r i ng of c h a r ac t e r s be t ween s p a c e s ,
t ab s ,
I t wou l d be m o re gen­
or c a r r i age re t u r n s .
e ra l l y u s e f u l
if
i t wo u l d def i ne a w o r d as
seve ra l
t he f i r s t c ha ra c t e r i n t he c o �m a nd 1 i ne
par ame t e r a r e a i n t h e s t a nd a r d l npu � f i l e .
of
way
re t u r n s
parameter
.
CharCt
easy
III
- e w i nd w i t h � he u p s ho t t ha t f i l t e r s wr i t t e n
n Pasca 1
cou 1 dn ' t e ven g e t s t a r t e d .
T he
e a S i e s t l a nguage I k now f o r w r i t i ng f i l t e r s
f i 1 ters ,
B lll o r d
a s semb l e r .
an
BWord s p l i t s t he i np u t f 1 1 e i n t o l i ne s ,
w o r d per l i ne .
A w o r d i s def i ned a s a
It
effort
J n f o r t un a t e l y
old
r e l eases
of
05-9
had
a
· ' aw
in
P I P E MAN
whi ch
p re ve n t ed
it
f r om
* o rk i ng
w i th
Pasca l
p r o grams .
Pa s ca l
- e w i nds
i ts
s t a nd a r d
i np u t
f i l e
when
it
i s C,
bu t
aSsem b l er
to
a
pas sed
059 : b a s i c 09 words < t e s t f i l e
wr i t t en
P I P E MAN
as
per i OdS
need to u s e a
grams
i n
a s s e mb l e r
and
Ba s i c09
for
th i s
c o l u mn .
I
t hought
I
m i g ht
i nc l ude
a
f ew
f i l ters
w r i t t en
in
P a s ca l
thi s
m on t h .
, t ar t s .
it
c a r r i age
want
it
a r ea
( F ORKs ) .
w h i ch w i l l d i v i de t he t e x t i n t e s t f i l e i n t o
words .
If
you don ' "t
have RUNB y o u m i g h t
Un i q
b r ea'\.. c o l u m n l 0 i nt o w o r d s ,
sort
t he
remOve dup l i ca t e l i ne s . a n d g i ve me a
sorted
c o l umn .
g i ve
eharet
059 :
OS9 : words < c o l l O !
wou l d
1 i st .
you
BWords
l i ne :
!
one
to
and packed .
I f you
words w i th a c o m m a n d
L i ne On e
J unk L i n e
Ano t he r l ine
T he command
If
OS9 :
me
L i n e One
Junk L i n e
J unk L i n e
J unk L i n e
Ano t h e r l ine
of
i npu t .
p a r ame t e r
starts
count l ng
cha r a c t e r u s e
mand 1 i ne :
w ou l d count
g i v i ng
sort
and
un i Q .
Sort
sorts
t he
s t anda r d
i npu t i n t o t he o u t p u t .
Un i q r e moves d u p l i ­
c a t e l i nes ; f o r examp l e :
WOU l d come o u t
to
s t andard
T he
fi 1e .
have
def a u l t
t he
it
thi s
wou l d count
t he
number o f
1 i ne s
i n
its
i npu t
t he
numbe r
of
wo r d s
in
co l umn 1 0 .
I
can
use
1 i ne c t
by
i tsel f
to
f i nd
t he
numb e r
of
1 i nes
on
OS9 :
l i ne .
in
program
words
i nto
word per
return
a
l i ne
f ile:
co l u m n 1 0
one
wh i c h
c ou n t s
form a
f ee d s
up .
l i ne c t
Users
i npu t .and
wr i tes
e n d o f' t he i np u t
059 : words < c o l umn l O
T h at
05-9
c o l umn )
i nt o o n e wo r d
numb e r
of
<CR>s
in
the
t h at number o u t when t he
i s
t he
thiS
d i rect i on
t ha t
( Sa y .
g i ven
by
t he
m es s w i t h t h e
o r u s e a p i pe
f ro m p r o c s .
can
be
d i v i ded
c ommun i ca te
one
sect i on
in
i nto
onl y
c o l l ec t s
i nf o rmat i on ,
t he second 15 0 l' t s
it.
a nd
the
t h i r d f o r ma t s a r ep o r t . ) . t he j ob c a n e a S i ­
s he l l
aren ' t
upda t e
m i ght
t h ree sepa ra t e p r o ce s s e s d i E ­
t he
command
l i ne
w i th
t he
p i pe s .
If
the
s teps
m a na g i ng
t he
f i xe d ( P e r haps y ou e i t he r r e po r t
a f i l e depend i ng on t he da te . ) ,
be
eas i er
to
dea l
w i th
t he
or
it
p i pes
you r s e l f .
This
t ype
of
t h i ng
requ i re s
p i pes t o be def i ned f o r e a c h n e w p ro c e s s ' s
s t a nd a r d
i np u t
pa t h .
U s i ng
a
p i pe
8 15
t he
s ta nd a r d
ou t p u t
path
f r om a
c h i l d process
is
u se f u l
for
m o r e t ha n i n t e r ce p t i ng t he o u t p u t f r om s y s ­
to
t em
u t i l i t i es .
T he
f i r st
expe r i ment s
t ry
W 1 th
thi s
mecha n i s m
a re
with
s y s t em
ut i 1 i t i es .
b u t t he most
i n t e r e s t i ng app l i ­
cat i o n s a r e w i t h p r oc e s s e s des i gned e s p e ­
c l a l l y f or t h i s u s e .
An examp l e m i gh t be a
program wh i c h u s e s a p r ocess a t t ached v i a a
p i pe to ge t
d a t a f rom a
remo t e compu t e r .
T he proce s s at
t he end of
t h e p i pe w ou l d
d i a l the r e m o t e c ompu t e r up . g o t h r ough t he
l ogon f o r ma l i t i es . and d ea l w i t h a n y commu ­
n i c a t i on p r otoc o l s .
T he ma i n p r ocess wou l d
j us t
read
d i s t i l l ed
i n f orma t i on
f ro m
t he
p i pe .
A1 1
t hr e e s t a nd a r d p a t h:; can be
us e d
f o r p i pe s .
I haven ' t t ho u g h t of a u s e f o r
a l l t hree p a t h s . b u t a comb i na t i on o f i nput
The c h i l d p r o ­
and output paths i s u s e f u l .
cess i s g i ve n work to do t h r ough i t s s ta n ­
dard i nput p a t h a nd r e t u r ns t h e � e s u l t s o f
i ts
work
t hr ou g h
i ts
s tandard .
o r e r ro r .
output path .
T he p a r en t p r o c e s s g i ve s t he
wor k
t h r ough
one
p i pe
and
at
an
chi l d
a p p r op r i a t e
t i me
( maybe
mucn
l a ter )
ge t s
t he
res u l t s
by
read i ng
f r om
a
d i f fe r ent
p i pe .
A
F O RKed
p r o cess
i nher i t s
t he
t h ree
s t a nd a r d p a t h s of
I t s pare n t .
If
i t we r e
OK t o g i ve u p a f t e r s e t t i ng u p p i pe s ,
t he
way
to s e t t hem up wou 1 d be t o c l os e t h e
s t a n d a r d f i l es , a n d c r e a t e t h ree p i pe s . one
each
f or
pa t h
one ,
t wo
and
t h r ee .
T he
i ns t r u c t i o n s to open a p i pe i n t he s t a nd a r d
i np u t pa t h wou l d b e ;
P i p e f e s It/P I PE"
l da 110 s td in
OS9 lSCLOSE
l e ax P i e , PCR
I da flup ATE ,
059 HOPEN
g
New pa t hS a l ways t a ke t he l owes t a va i l a b l e
pa t h
numbe r
s o t he p i pe w ou l d
fal l
i nt o
pa t h z e r o ,
A p rocess f or ked f r om t h i S p r o ­
cess
wO\.l l d
i nhe r i t
i ts
s t anda r d
paths
i nc l Ud i ng t he p i pe i n p a t h ze r o .
T he new
p r ocess wou l d t re a t i t s p a t h 0 a s a n orma l
s tandard
i nput
p at h .
Cha r a c t e r s
wr i t t e n
i n to t he p i pe b y t he p a rent w ou l d b e read
by t he c h i l d .
If
a p i pe
is
opened w i t h
no p r o c e s s
F O RKed t o u s e i t , t he p i pe w i l l a c t I i ke a
A p r oc e s s can w r i t e a 1 i m i t e d num ­
queue
ber of b y t e s
i n t o t he p i pe a n d read t he m
o u t a ga i n i n t he s a m e o r d e r they were wr i t ­
ten .
I f t he r e i s n ' t room i n t he queue f o r
t he da t a f r o m a w r i te t o be s t o r e d t he p r o ­
c e s S do i ng t he wr i t e w i l l be p u t t o s l eep
un t i l t he r e i s space t o comp l e t e t he w r i te ,
I f t he p ro c e s s t h a t reads f rom t he p i pe i s
t he same o n e t h a t
i s s l ee p i ng unt i 1
the
queue empt i e s a l i t t l e t he re i s a dead l ock .
A dead l oc k c a n on 1 y be avo ; ded ,
or b r o k e n
b y some ou t s i de agency . , . t he human a t the
t e r m i na l
for
i ns t ance ,
B�ca u s e
�f
thi s
dea d l ock p r O b l em , and t he sma l l s i z e of t he
queue i n t h e p i pe , t he i dea of u s i ng a p i pe
as a queue i s o n l y a nove l t y ,
that
p romp t s
passes
t he
pa i r s
of
to
a
coor d i na t e s ,
C
p r og ram
a nd
wh i ch
" ra s t e r i ze s "
t he 1 i r,es bet ween t he pO i n t s
def i ne d
oy
the
coord i na t e s .
T he
B a s i c09
p r o g r a m pas s e s as many p a i r s a s i t l i k es t o
t he C p r og ram . t h e n c l oses t he p a t h i t h a s
been w r i t i ng t he d a t a t o .
When t he p a r e n t
c l oses h i s e n d of t '1 e p i pe t he ch i l d w i 1 1
ge t
a n e nd - o f - f i 1 e .
The C
p r og r a m s e n d s
t he r a s t e r i zed da t a b a c k t hrough i t s s t a n ­
d a r d out pu t pa t h .
T h i s d a t a conS i s t s o f a
s t r i ng of z e r o s a nd ones
i nd i ca t i ng where
dot s ShoU 1 d be p l aced o n e a c h nor i zonta 1
l i ne i n order to draw the vec t o r s r e c e i ved
a s i nput .
R a s t e r i z i ng ve c t or graph i c s i nf or ma t i o n
is a
p a r t i cu l a r l y good app l i ca t i on
for
a
sepa r a t e p r oce s s .
In a
Leve l
Two s y s t e m
each
process
can
use
an
e n t i re
addre s s
s p a c e o f a l mos t 64K ,
T he s i ze a nd r e s o l u ­
t i o n of t he g r a p h t ha t i s p r oduced depends
o n t he amount 0" memory a va i l ab l e for t h e '
I hav e a ver s i on O f
b i t map of t he g rapr, .
r a s t t h a t u ses 4 6 K f o r i t � b i t m a p a n d c a n
gene r a t e a n S " X 8 " graph o n m y Ok i da t a a t 7 2
d o t s p e r i nch .
I a m n o t v e r y e x p e r i enced
with
graph i cs ;
t here
i s
p r Ob a b l y
a
much
be t t er way to r a s t e r i ze d a t a t ha n what
I
u se d .
My p rog r a m seems t oo comp l i ca t ed f o r
s u c h a s i mp l e t a s k , b u t 1 t wo rk s .
It
is
pa r t i cu l a r l y
i mp o r t a n t
to
keep
t r a c k of i n t e r a c t i ons b e t ween t wo p r o c e s s e s
commun i ca t i ng v i a p i pe s .
If
t he p r oc e s s e s
ever get
l nt o a s i tu a t i on wher e b o t h a r e
wa i t i ng f o r
i nput f r o m a p i pe
l ea d i ng t o
t he o t h e r p roce s s , t h e y w i l ; b e s t u c k u n t i l
you f ree t hem by k i l l i ng one o f t he p r o ­
c e s s es .
The
i mpor t a n t p a r t
of
thi S
s y s t em o f
p r og rams i s a n a ss e mb l y l anguage s u b r o u t i ne
f o r the 5as i c09 p r ogram . T he s ub r ou t i ne i s
descended
f rom
t he S t r t T a s k
subrou t 1 ne
I
pub l i shed m o n t h s a go , bu t h a s been enhanc e d
to
o p e n p i pes
to
t he
new
p r oces s .
T he
I SOUP ca l l i s used to p re s erve t he s t a nd a r d
i np u t a n d o u t p u t f i l e s o f t he B a s i c09 p r o ­
g r a m w h ; l e p a t h s ze r o a n d one a r e
t u rned
i nto
paths
then
back
1 nt o
w ha t ever
t he y
were bef or e .
I n stal l a t i on
T h i s s y s t em of p r ograms i s w r i t t e n i n t h r e e
sepa r a t e l anguages .
I f you don ' t have C i t
S hou l d
be
fa i r l y
easy
to
t r ans l a t e
rast
i n to 6as i c09 ,
but
if
you rewr i t e r a s t
in
Sas i c09 be c e r t a i n t h a t
try to
y ou d o n ' t
fork
it
d i rect 1 y .
S a s i c09 s hou i d
be
t he
p rogram you f o r k ; r a s t sho u l d be t h e p a r a m ­
eter .
I f you w a n t to keep t he o l d S t r t T a s k
a r ound ,
r e n ame e ; t her
i t o r t he n e w one .
Graphe r s hou l d be t yped
i n t o B a s i cOS a n d
saved .
P ar t i cu l a r l y i f y o u a r e us i ng Leve l
One ,
you s hou 1 d paCk G r ap he r a nd u s e R u nS
to save memory .
I n Summa r y ;
•
•
E n t er
S t rtTask
ed i t or
and
rast . c
u s i ng
an
A s semb l e S t l , t T as k
Comp ; l e r e s t . c
Enter
The examp l e of commun i ca t l o ns v i a p i pe s
that I
have i nvented I s a Bas i cOO p r o g r a m
for
pa l r s
•
Grapher
us i ng B a s i c09
Save t he s o u r ce
C o l umn Te n
61
•
I f you i n t e nd t o r u n Gr aphe� f r om
command l i ne a d d t h e l i ne ;
B Y E to
end
of
Run
Grapher
Grapher
and rast
and
wh i ch
f rom
t �e
t he
P a c k G r apher
wi1 1
l oa d
S t r tTask
t he execu t i on d i r e c t o r y
Ope rat i on and Mod i f i ca t i on
wi l l
p romp t
f o r pa i rs
of
coord i �
Grapher
na t e s .
A f t e r e a c h pa i r
i s e n t e r ed
i t wi l l
;a s k you t o vel" i f y
t ha t
you w a n t
to p l ot
Be c a r e f u l w i t h t h i s .
T he r e i s
t ha t 1 i ne .
no va l i d a t i on i n any pa r t of t h i s sys t em .
T here
is
no r e a so n i t s h ou l dn ' t be t he r e
e i t her .
P l e a s e a d d enough e r ro r c h e c k l n g
t o make you comf o r t a b l e i f you i nt end to do
more t han p l ay w i t h t h i s p ro g r a m a l i t t l e .
I f you t r y to d r aw a l i ne way of f i n t o t he
w i l d O l ue yonder y o u r compu t e r w i l l g i ve i t
a g O O d t ry ,
m a s h i ng every t h i ng i n i t s way .
l a s t pa i r of
coord i ­
A f t e r you e n t e r t he
n at e s res pond t o t he ( y , n , d ) p r ompt w i t h D .
T he D r e s ponse sends t he l a s t pa i r t o r e s t
and charts
t he response f ro m r a s t o n t he
s c r een .
I
1 i k e t o d r a w conserva t i ve pa t ­
terns
1 i ke t he one g i ve n oy t he i np u t i n
f i g ure F i gure 5 .
r
I
o
o
o
o
o
0 79 23
23 79 0
0 0 23
0 79 0
1 1 79 1 1
39 0 39 23
F i gure 5 :
5amp 1 e I npu t
program
for
rast
j
Ras t i s s e t u p t o r a s t e r l ze a 80 b y 24
T h a t i s t he s i z e of a s t a n d a r d t e r ­
g r a ph .
m i na l , b u t i f you want t o dea l w i t h l a rg e r
or s ma l l e r graphs . Change V D I MENS I ON t o t he
number of v e r t i ca 1 do t s i n the g r a p h , a n d
HD I M E NS I ON
to
t he
number
of
h o r i zont a l
dot s .
P i pe s a r e a powe r f u l t o o l for i nt e r pr o­
c e s s commun i ca t i o ns .
T hey can be u sed w i t h
good e f f ect t o s o l ve a l mo s t a n y i nt e r p r o ­
c e s s COmmun i cat i on p r ob 1 e m 1 f
t he connec­
t 1 on con be made .
T he wo r s t prob 1 e m w i t h
p i pe s i s t hat t hey can o n l y be used be t ween
p r ocesses
that
are
very
c l o se l y
re l a ted
( b e t ween s i b l i ngs , or p a ren t / Ch 1 l d ) .
T he re
i s a 1 so a pe r f o rmance prob l am under Leve J
T wo ; not on l y i s t he r e the cos t of a s y s t em
reque s t p e r t ra n s fe r , but 0 5 - 9 has t o move
t he Charac t ers
f r om one address
space t o
ano t h e r
t a k i ng a s u r p r i S i ng
l e ngt h o f
' i me .
I f you f ee l a m b i t i ous you 101 1 1 1 f i nd
i s pOSS i b l e to make a m a j o r pe r ­
' na t
it
::. rmance
i mprovement
to
re s t
by
u s i ng a
;ompres s i on a l go r i t hm on i t s ou to�� .
62
OS-9 U s e r No t e s Vol ume I
WELCOME COCO
ha ve been read i ng me s s a ge s
i n t he COCO
spec i a l
i n t e r e s t g roup o n Comp u s e r v e .
It
s o unds 1 i k e M i c r ow a r e put a rea l ver s i on o f
0 5 - 9 o n t ha t l i t t l e moch i ne .
I am s e r i ou s ­
ly
i mp r e s sed w i t h
t he r e a l i t y o f
a
very
i nexpens i v e comp u t e r w i t h a UN I X - l i k e , m u l ­
t i t a s k i ng , even - - i f I may s t r e t c h a pO i n t
- mu l t i - u s e r oo e r a t i ng s y s tem .
There m a y
be a
number of
i n t e r es t i ng ways t o
i n te­
g r a t e C O C O s w i t h eaCh o t h e r a n d w i t h J a r g e r
O S - 9 s y s tems t o ge t a ba r ga i n ver s i on o f
I t may n o t
advanced d i s t r i bu t e d comput i n g .
be
t o o much t o hope f o r
that
T a ndy w i l l
f i nd a way t o put O S - 9 Leve 1 T w o o n some
descenda n t
of
t he
C OC O .
T here
is
some
chance
t ha t
I
will
be ab l e
to
take
the
v i ewpo i n t of a C O C O u s e r i n t h i s c o l umn i n
t he f u t u r e .
I haven ' t made up my m i nd y e t ,
bu t I need a Leve l One s y s t em , and the C o l ­
o r Comp u t er m a y be t he way t o g e t one .
I
w ou l d appr e c i a t e a dv i c e .
THE USERS GROUP
The exec u t i ve comm i t t ee of
t he O S - 9 Use r s .
G r oup has me t t w i c e s i n c e the annua l mee t ­
i ng
(I
a m w r i t i ng t h i s
i n November ) ,
we
have
s t r u gg l ed
w i th
v a r i ou s
i s sues
and
d e f i ne o
a s s o r t ed
po l i C i e s ,
mos t l y
r a t he r
du l l .
V e r y 1 i ke l y by t he t i me t h 1 s c o l u m n
i s p r i n t ed t he membe r s w i l l h a v e rece i ved a
news l e t t e r ,
and
everyone
wil l
have
seen
i nf o r m a t i on
in
th i s
a nd
o t her
mega2 i ne s .
R i gh t now our s o f t wa r e l i b r a r y i s ready t o
go .
I k no w i t has good s tu f f i n i t ; seve r ­
a l p ro g r am s o f m i ne a r e p a r t o f t he co l l ec ­
t i on .
Ou r
p l an
is
to
g i ve
a
s t andard
s e l ec t i o n of sof t ware f rom t he l i b r a r y t o
t he
e x i s t i ng
member s h i p
a nd
t o eaCh new
memb er .
T he o t he r p r o g r a m s
in the 1 i brary
w i l l b e a va i l ab l e f o r sma l l a mou n t s o f m o n ­
ey . or s o f t w a r e cont r l bu t i o ns .
T he a d d r e s s
o f t he U s e r s G r o u p i s ;
O S - 9 U s e r s Group
PO Box 8027
Des Mo i nes , I owa
5030 1
BWORD
PROCEDURE b w r
0000
ilt �; - t� - di�id�-i�; :t - i �t�-��;d��- O��-��;d-;;;--:
0036
006C
" l i ne .
00A2
*
DIM
chr : B YTE
00D8
DIM i nwor d : BOOLEAN
OODF
00E6
DIM S t dOut , St dIn A StdErr : INTEGER
OOF5
ON ERROR GOTO lOu
OOFB
S t dln=O
0 1 02
S t dOu t= l
0 1 09
S t dErr-2
i nword=FALSE
01 1 0
01 16
LOOP
GET IISt dln , chr
01 18
I F inword THEN
0 1 22
I F chr=ASe (" ) OR chr=9 OR chr"' 1 3 THEN
0 1 2B
0 1 47
i nword-FALSE
0 1 4D
WR I TE liS t dOu t
0153
ELSE
PR INT #S tdOut , CHR $ (chr) ;
0157
ENDIF
0163
ELSE
0165
IF chrsASe (" ") OR chr'"'9 OR chr= 1 3 THEN
0169
ELSE
0185
i nword=TRUE
0189
018F
PRINT #St dOut , CHR$ (chr) ;
ENDI F
019B
O l9D
END I F
ENDLOOP
0 1 9f
BYE
0 1A3
01A5 1 00 REM end o f f i l e handl e r
01BE
DIM errnum : INTEGER
01e5
errnum-ERR
IF e r rnum=2 1 1 THEN
OICB
B YE
0 1D7
E LSE
0109
ON ERROR
0 1DD
PR I NT IIS t dErr , "Error Numb e r : " ; e rrnum
O l EO
BYE
0 1 FB
ENDH
0 1 FD
!; ;
'*
- - - - - -- - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - -
*
j
"
C o l umn Ten
63
CHARCT
Mi c r oware OS-9 As s emb l e r 2 . 1
1 1 /08 /83 2 2 : 55 : 20
CharCt - C ount a o c c urances o f a s p e c i f i ed chara c t e r
00001
00002
00003
00004
00005
00006
00007
00008
00009
000 1 0
000 1 1
000 1 3
000 1 4
000 1 5
000 1 6
000 1 7
000 1 8
00019
00020
0002 1
00022
00023
00024
00025
00026
00027
00028
00029
00030
000 3 1
00032
00033
00034
00035
00036
000 3 7
00038
00039
00040
000 4 1
00042
00043
00044
00045
00046
00047
00048
00049
0005 0
0005 1
0005 2
00053
00054
00055
00056
64
D
D
D
D
D
D
D
Page 001
NAM
Cha rCt
TTL
C o unt a o c c u r an c e s of a s p e c i f i ed chara c t e r
*-------------------------------------------------*
*
*
CharCt
Wr i t t en 1 Novembe r 83
*
*
Las t M o d i f i ed 5 November 83
*
A f i l t e r t o c ount oc curances o f any s p e c i f i ed *
*
*
charac t e r i n the s t andard input . I f no
*
chara c t er i s s p e c i f i ed , de f aul t t o c oun t i ng *
*
*
c a r r i ag e r e t urns .
* ------------------------------------------------- *
IFP 1
ENDC
P rg rm+Obj c t
001 1
Type
set
008 1
R eEn t + 1
R evs
set
pgml en , CharC t , Type 1 Revs , En t ry , Mems i ze
0000 87CD009A
MOD
s t ored l n BCD
0000
3
C ount
rmb
1
InChr
rmb
0003
1
Ts t Chr
rmb
0004
Ou t S t r
rmb
6
0005
1
CR
rmb
f o r a CR
OOOB
OOOC
200
Stack
rmb
Mems ize equ
00D4
OOOD 43686 1 72
CharCt
fes
i CharC t /
00 1 3 0 1
feb
1
vers i on
* ------------------------------------------------- *
*
* At ent ry :
*
*
U and DP p o i n t a t l o c a l s t orage .
*
*
X p o i n t s at the pa rame t er area .
*-------------------------------------------------*
Ent ry
00 1 4
00 1 4 OFOO
c1r
C ount
001 6 OrOl
clr
C o un t + 1
0018 OF02
c1r
C o un t + 2
00 1A A684
I da
,X
O O I C 9 7 04
s ta
T s t Chr
OO I E 3043
I eax InChr , U
cha ra c t e r s to read
0020 1 08EOOO l
l dy
#1
0024
Loop
s t d in
0024 8600
#0
I da
l $READ
0026 1 0 3F89
059
0029 25 l E
bes
Qu i t
002B 0603
I db
InChr
002D D 1 04
cmpb T s t Chr
002F 26 F3
bne
Loop
*-------------------------------------------------*
*
*
Increment Count
* ------------------------------------------------- *
#1
I da
003 1 8601
a dda L oun t + 2
0033 9B02
daa
0035 1 9
C ount + 2
s ta
0036 9702
#0
I da
0038 8600
adca L oun t + 1
003A 9901
daa
003C 19
C ount+ 1
003D 9 7 0 1
sta
05 - 9 U s e r N o t e s Vo l ume I
1 1 / 08 / 8 3 2 2 : 5 5 : 28
CharCt - C ount a o c c ur anc e s of a s pe c i f i ed char a c t e r
M i c r owar e OS-9 As s emb l er 2 . 1
0005 7
00058
00059
00060
0006 1
00062
0006 3
00064
00065
00066
0006 7
0 0 06 8
00069
00070
000 7 1
00072
00073
00074
00075
00076
00077
00078
00079
00080
0008 1
00082
00083
00084
00085
00086
00087
00088
00089
00090
0009 1
00092
00093
00094
00095
00096
00097
00098
00099
0 0 1 00
00 1 0 1
0 0 1 02
0 0 1 03
00 1 04
00 1 05
0 0 1 06
0 0 1 07
00 1 08
0 0 1 09
001 10
001 1 1
001 1 2
001 1 3
00 1 1 4
001 1 5
00 1 1 6
003F
0041
0043
0044
0046
0047
0049
0049
004B
0040
004F
005 1
0053
0055
005 7
8600
9900
19
9 700
4F
2 00B
I da
#0
s ta
C oun t
adca
daa
c i ra
bra
P a g e 002
C ount
Loop
s td i n
* ------------------------------------------------- *
�,
*
I f we r eached EO F p r i n t t h e t o t a l c o un t and
*
*
ex i t .
*
*
I f s om e o t h e r c a u s e d us t o s t op _ R e t urn
*
*
w i th an e r r o r c ode .
*------------------- -------------------- ----------*
C 1 03
2 6 36
3045
9600
8D33
960 1
8D2F
9602
Qu i t
I da
bsr
I da
bsr
I da
�8z�
.gg��
0 050 960A
005 F
0061
0063
0067
0069
0 069
006B
006D
006F
007 1
0073
0073
0075
0077
0 0 79
007B
8A80
9 70A
1 08E0007
8630
0 0 7D
007F
0082
0083
0 083
0086
0086
0088
0089
008A
008B
008C
008E
0090
0092
0094
0096
0097
009A
8601
1 03 F8 C
SF
A184
2 6 06
3 13F
3001
20F6
8 6 0D
9 7 0B
9 6 0A
847F
9 7 0A
1 03 F06
l F89
44
44
44
44
8830
A780
C40F
CB30
E780
39
Al0953
cmpb
bne
1 ea x
FndLen
bsr
l eax
I da
ora
s ta
l dy
I da
cmpa
bne
1 e ay
1 ea x
OutPut
Ex i t
Cnvt
bra
I da
s ta
I da
anda
s ta
EX 1 t
Out S t r , U
C o un t
Cnv t
C o un t + 1
Cnvt
Coun t +2
Cnvt
Out 5 t r , U
Out 5 t r+5
11$ 8 0
Ou t S t r+5
�?O
-l , Y
l ,X
FndLen
��OD
O u t S t r+5
1;$ 7 F
but S t r+5
11 1
I $WR I TLN
059
F$Ex i t
tfr
l a ra
l s ra
l sra
l sr a
A,B
ata
andb
addb
atb
rts
EMOO
equ
mark l a s t p os i t i on i n Ou t S t r
s e t c a r ry b i t
l en g t h
,x
Out P u t
I da
059
c 1 rb
adda
P gm l en
IIE �EO F
'0
IIX+
I � O0 F
II
,
X+
d e c r e a s e l en g t h
< CR >
c l ea r t h e c ar r y b i t o u t
s td out
c l ean up f o r e x i t
s h i f t t he h i gh o r d e r n i b l e i n t o l ow
c onve r t t o ASC I I di g i t
r emove h i gh o r d e r nyb l e
c onver t t o ASC I I d ig i t
*
C o l umn T e n
65
-
GRAPHER
PROCEDURE Grapher
0000
DIM proc e s s No , Comp Code , Op t S i ze , Lang- Typ e : BYTE
00 1 3
DIM Parm L : TNTEGER OOlA
DIM InP i�e , O u tPipe : BYTE
0025
DIM ch : STR ING l 1 J
003 1
DIM YN : STR ING
0038
DIM x l , yl , x2 , y2 : INTEGER
004B
DIM name : STR ING
0052
DIM Parms : STRING [2 0]
005E
�
009C
� ;� -� ;-�� - ;;ii - � � ;�i;;;-�� ;� -�� i i-;�;;- ��; -�;;;�- --- -- -- =*
OODA
modul e , pas s ing i t the paramet e r s t r i ng in Parms .
O l l8
---* --0156
name=
"ras
t -" - - - - - - - - - - - - - - - - - - - - - -- - - -------- -- --- - - - - - -- - - -- *
proces s No=O
016 1
Opt S i ze=O
0168
Lang Tr,r.e=$ 1 l \ (* at t r i bu t e s of fork ed modul e (obj ect code , program)
016F
Parms= ' '+CHR$ ( 1 3 �
OlAC
01B7
P � r�=:::�����:�: __ ���_���_:���!�_�:_!��_��:��:!:::_��:! ��-��::� c t
O l EF
0230
Ca l l as s emb l er subrout i ne s t o Fork and wai t for the -s tart ed **
027 1
proces s
02B2
RUN S t r t Task (name , pr o c e s s No , Lang Type , Parm L , Parms , Opt S ize
02F3
O t i
- =� �� �� �� ! u P P e)
0320
�
;�
f
#I
�
�
�--h
;
��
�h
036 1
;�
�; � �� - �;� ;- �; -� ;; ; - � ; � 03A2
* corresponds t o the s tandard input path for ras t
*
03E3
PRINT "Enter the endpoint s o f l ines you want drawn . X muoS : be in"
0424
PR INT " the r ange 0 . . 79 . Y mus t be in t he range 0 23 . "
046 1
LOOP
0493
INPUT "Ent e r X Y c oordina t e s for the ends of a l ine : " , x l
0495
, y l , x2 , y2
PRINT "The l ine wi l l be drawn be tween ( " ; x l ; " , " ; yl ; " ) and ("
04D7
x 2 ; " , " ; y2 ; ") "
052 1
INPUT "OK ? (Yes , No , Done) : " , YN
053E
YN"'LEFT$ (YN , 1 )
0549
I F YN="y" OR YN="Y" THEN
055E
PRINT IIInP i p e , " 1 " , x l , yl , x2 , y2
ENDI F
05 78
05 7A
EXI TIF YN= "d" OR YN"'''D" THEN
058F
PR INT #InP ipe , " l " , x l , yl , x2 , y2
ENDEXI T
05A9
ENDLOOP
05AD
05B l
ON ERROR GOTO 1 00
05B7
c O
�
05BD
:
�
05FE
;� - i ; - � l�;� �- ; ; ;� - ��ii- �� � -;�- � ��= � f=fi l � -- - - -- -- - *
063F
* on i t s s t andard input path .
* - ----- - - - ---- --- - 0680
--- -- - - - - - - *
- - - --- -- - - - - ----- - - - - 06( 1
La O 06(3
0704
R���-f;�;- #O�tP�;�- ( �����-;�;; � ;;���;-t�-; ; ;t�; - ;t;��;; �--- - :
0745
* output unt l l end of f i l e on that path . The end of-f i l e
- c l osed
*
0786
- -o ther end of the p i pe has been
ind l ca t es that the
*
* (in thi s case ras t has ended) .
87(7
R08
------------------------------------------------------------ *
, 49
GET IIOu tP ipe , ch
I F ch= "O" THEN
.:. 5 3
PR INT " " ;
.J860
ELSE
0866
086A
PUT Ill , ch
ENDI F
0873
ENDLOOP
0875
0879 1 00
087D
ON ERROR
0880
CLOSE IIOut P i J;! e
0886
RUN Wal t Task lprocess -No , Comp-Code)
0895
IF Comp Code<>O THEW
08Al
PRINr"Comp l et i on c ode f or " ; name ; " II " ; proces s -No ; was
; Comp_Code
ENDIF
08D4
I:
1
*
I
I�
*
*
*
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --- - - - - - - - - - - - - *
�
*
�
�
*
l
l
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - .
•
•
l
l� �� � �i��:
!:
*
*
*
11
66
05 - 9 Us e r N o t e s Vo l ume I
11
STRTTASK
Mi c r owar e OS-9 As s emb l e r 2 . 1
1 1 / 08 / 8 3 2 3 : 33 : 26
S t r t Ta s k - S t ar t a s ub t a s k ( c a l l ed f r om B a s i c09)
0000 1
0 0002
00003
00004
00005
00006
00007
00008
00009
000 1 0
0 00 1 1
000 1 2
000 1 3
000 1 4
0 00 1 5
0 00 1 6
000 1 7
000 1 8
000 1 9
00020
0002 1
-00022
0 002 3
00024
00025
00026
0002 7
00028
00029
00030
0003 1
00032
00034
00035
00036
0003 7
00038
00039
00040
000 4 1
00042
00043
00044
00045
00046
00048
00049
0005 0
0005 1
0005 2
00053
0 0054
00055
00056
00057
00058
0 0059
00060
0006 1
00062
0 006 3
00064
0 0065
0 0066
00067
00068
0 0069
00070
0 00 7 1
0 00 7 2
00073
Pag e 0 0 1
ttl
S t a r t a s u b t a s k ( c a l l e d f r om B a s i c09)
nam
S t r t Ta s k
* --- - - -------------------------- ----------------------- *
'*
'*
S t r t Ta s k i s a s u b r ou t i ne f o r B a s i c 09 .
*
'*
S t a r t a n am e d modu l e as a s ub t as k .
*
*
L e t t h e new t a s k r un a s ynchronou s l y .
*
Open p i p e s t o t h e modu l e s s t andard i n and s t andard *
i,
*
out paths .
'*
*
R e t u r n t h e new t a s k s p r o c e s s numb e r ! t h e p a t h
*
*
numb e r s f o r t h e p i p e s , and t h e c on d 1 t i on c o d e
*
f r om t h e F ork .
*
C a l l i ng s equen c e :
*
run S t r t Ta s k (Name , P r o c e s s Num , Lang Typ e ,
*
P a r am L , P a r am , O p t s i ze
*
I nP i piN , O u t P i p eN) *
Name i s any l en gt h , b u t has a v a l i d t e rm i na t or
(h i gh b i t s e t on l as t byt e , or de l im i t e r a f t e r i t ) *
*
P r o c e s s Num byt e f i e l d , p r oc e s s numbe r of n e w t a s k . *
*
Lang Type b y t e f i e l d , l anguag e / t yp e byt e f o r
*
f o rKed modul e .
*
P a r am L l i n t e g e r f i e l d , l en g t h o f p arame t e r area .
*
P a r am-f 1 e l d o f any t yp e . p a r ame t e r a r e a t o b e
*
p a s s e d t o f or k e d p r o c e s s .
*
Op t S i ze byt e f i e l d , o p t i ona l da t a a r e a s i ze i n
*
p ages .
'*
I n P 1 pe N , i n t eg e r f i e l d . p a t h numbe r
'*
Ou t P l p eN , i n t eg e r f i e l d , p a t h numb e r
'*
P r o c e s s Num , I nP i p e N , Ou t P i p eN , and R e t urn C o d e
'*
*
a r e a l tere d by S t r t Ta s k , n o o t h e r param e t ers a r e .
* ------------------------------------------------------ *
*
'*
*
*
*
*
*
*
*
'*
*
*
*
*
*
*
'*
'*
*
I FP l
ENDC
0002
0004
0008
O OOC
0010
00 1 4
0018
OOlC
0020
002 1
008 1
0000
000 1
0000
0000
00 1 5
OOlA
001B
OOIB
0010
002 1
***'** ,�
*
O f f s e t s t o argumen t s
*
2
equ
4
equ
8
equ
equ
12
16
equ
20
eQu
24
equ
26
equ
equ
32
SBRTN+OB JC T
set
REENT+ l
.et
o
equ
1
equ
8 7CDOOB 1
TLen , S t r t T as k , Type , Revs , SEn t ry , O
mod
53747274
S t r t Ta s k f es
S t r t Ta s k /
'/P IPE"
2F504950
Pipe
fes
1
v e r s i on
01
feb
SEn t ry
EC62
l dd
ACo un t , S
g e t param c o un t
1 06 30008
cmpd
are there 8 p a r ams ?
#8
1 0260063
I bn e
BadEx i t
n o ; l ea v e n o w .
* ------------------------------------------------------*
*
*
S e t up � i p e s f o r S t dln and S t dOut .
*
*
Th e p r o c e dure 1 8 :
*
Dup t he s td i n and s t d o u t p a ths t o s av e t hem . *
*
*
C l o s e s t d i n and s t do u t .
*
Open / P IPE t w i c e . On e w i l l b e p a t h 0 t h e n ex t *
*
*
pa t h 1 .
*
'*
F o r k the new pr o c e s s .
*------------------------------------------------------ *
* O f f s e t s f r om S f or l oc a l s t orage
0 0 00
DS t d ln
equ
0
0001
DS t dOut
equ
1
0002
L o ca l S iz e qu
2
*
ACount
Modu l eN
P r o c Num
ModType
P armLen
P a rms
KDat S i ze
I n P i peN
Ou t P 1 peN
Type
Revs
S t dln
S t dOut
{,
C o l umn Te n
67
� i c r oware OS-9 As s emb l e r 2 . 1
1 1 / 08 / 8 3 23 : 3 3 : 36
5 t r t Ta s k - S t a r t a s ub t a s k ( c a l l e d f r om Bas i c09)
:'00 7 4
U0075
.1 0076
,. 1007 7
00078
00079
00080
0008 1
0008 2
0 0083
0008 4
00085
00086
00087
00088
00089
00090
0009 1
00092
00093
00094
00095
00096
00097
00098
00099
00 1 00
00 1 0 1
00 1 02
00 1 03
00 1 04
00 1 05
00 1 06
00 1 07
00 1 08
0 0 1 09
001 1 0
00 1 1 1
00 1 1 2
001 1 3
00 1 1 4
00 1 1 5
001 1 6
001 1 7
001 1 8
OC : 1 9
001 2 0
00 1 2 1
00 1 22
001 23
00 1 24
0 0 1 25
00 1 26
00 1 2 7
00 1 28
001 2 9
00 1 3 0
00 1 3 1
00 1 32
00 1 3 3
00 1 34
0 0 1 35
0 0 1 36
00 1 3 7
68
Page 0 0 2
0025
0027
0029
002C
002 E
0030
0032
0035
0 03 7
3 2 7E
8600
1 03 F82
2570
A7E4
860 1
1 03 F82
2574
A7 6 1
l eas
I da
OS9
bes
s ta
I da
OS9
bes
sta
- L o ea l S i z , S make s p a c e f o r t emp s t orage
II S t d l n
I $ Oup
Oup S t d i n
B adEx i t 2
OStdln , S
S t dOut
SOup
Oup S t dOu t
B adEx i t 2
OSt dOut , S
0039
003B
003E
0040
0042
0045
8600
1 03 FB F
256B
860 1
1 03F8F
2564
i da
OS9
bes
I da
OS9
bes
tS t d l n
004 7
004B
0040
0050
l e ax
308DFFCA
8603
I da
1 03 FB 4
OS9
2559
bes
1< Th i s w i 1 1 b e p a t h 0
P i pe , PCR
f/U PDAT .
I SO p e n
B adEx i t 2
308DFFBF
l e ax
8603
I da
OS9
1 03 F 8 4
bes
254E
*
Thi s wi l l b e pa t h 1
OS9
0050 1 03 F 8 2
bes
0060 2549
sta
0062 A7 F82 2
P i p e , PCR
Ilu PDAT .
I $Open
B adEx i t 2
0052
0056
0058
005S
I da
OS9
bes
sta
t
$C 1 0s e
B adEx i t 2
II S t dOut
I $C l o s e
B adEx i t 2
C l o s e S t dln
C l o s e S t dOut
Open a p i p e i n path 0
Open a p i p e I n p a t h 1
I $Dup
Dup i t
� a dEx i t 2
l L o c a l S i z+Out P i peN , S]
11 5 t d l n
I $ Dup
Oup i t
� adEx i t 2
L Lo c a l S i z+ l nP i pe N , SJ
0065
006 7
006A
006C
8600
1 03 F 8 2
253F
A7F8 1 E
006F
007 1
0075
0078
0078
007E
008 1
0083
l dx
o ca l s i z+Kodu l eN , s
d dr e s s o f m o du l e name
AE66
1 0AEF8 1 2
l dy
L o e a l S i z+ P a rmLen , S
l ength o f p a r ame t e r s
I da
t yp e o f modu l e t o i n v o k e
A6F80E
L o c a l S i z+ModTyp e . S
l db
E6F8 1 A
L oc a l S i z+MDa t S l ze . S] o p t i on a l d a t a a r e a s i z e
l du
Loca l S i z+Pa rms . S
po int e r t o p a r ame t e rs
EEE8 1 6
059
F $ F o rk
s t a r t the new p ro c e s s
1 03 F0 3
ijadEx i t 2
bcs
2528
sta
L Lo c a l S i z+Pr o cNum , SJ s ave n ew p r o c e s s numb e r
A7F80A
* ------------------------------------------------------ *
*
*
R e s t or e t h e o r i g i n a l s t d i n and s t dout f i l e s t o
*
*
p a t h s 0 and 1 .
*--- -------------- ------------ ------------------------- *
I da
8600
HSt d ln
C l os e S t d l n and S t dOut
1 03F8F
1 $C 1 0 s e
059
860 1
1 da
# S t dOut
1 03 F 8 F
I $C l o s e
OS9
A6E4
I da
D5t dl n . S
p a th numb e r of dup ed s t d i n
dup i t into p a t h 0
OS9
I$Dup
1 03 F 8 2
l da
D5t dln , S
A6E4
1 03F8F
and c l o s e i t
OS9
I $C 1 o s e
A66 1
p a th numb e r o f d u p e d s t d o u t
l da
DSt dOut , 5
dup i t i n t o p a t h 1
I $Dup
059
1 0 3 F82
D5 t dDut , S
I da
A66 1
and c l os e i t
1 03F8F
I $C 1 0 s e
059
l e as
L o c a l S i Z , 5 c l ear s t ac k
3262
5F
c l ea r carry
c 1 rb
rts
r e t u rn
39
0086
0088
008B
0080
0090
0092
0095
0097
009A
009C
009F
OOAl
0 0A4
OOA6
0 0A7
05 - 9 U s e r No t e s Vo l ume I
l
r
M i c r owa r e 05-9 As s emb l e r 2 . 1
1 1 / 08 / 8 3 23 : 3 3 : 45
5 t r t T a s k - S t ar t a s ub t a s k ( c a l l e d f r om B a s i c09)
00 1 38
00 1 3 9
001 4 0
00 1 4 1
00 1 4 2
00 1 4 3
00144
00145
00 1 46
001 4 7
00 1 4 8
00 1 49
00 1 5 0
00 1 5 1
00 1 5 2
00 1 5 3
00 1 5 4
00 1 5 5
00156
00 1 5 7
00158
00 1 59
00160
001 6 1
001 6 2
001 6 3
00 1 6 4
00 1 6 5
00 1 6 6
00 1 6 7
00 1 68
00169
00 1 7 0
001 7 1
001 7 2
00 1 7 3
00 1 7 4
00 1 75
00 1 76
00 1 7 7
00 1 78
00 1 79
00 1 8 0
00 1 8 1
00182
00 1 8 3
00 1 8 4
00185
00 186
00000
00000
SOOE3
$0000
S2 1 8 B
OOAB
00A8 4 3
00A9 3 2 7 E
OOAB
OOAB 3 2 6 2
OOAD 39
OOAE 2 3 99 5 1
00B 1
B a dE x i t
B adEx i t 2
c oma
l ea s
set c a r r y
- L o ca l S i z , 5 dummy p u s h
l eas
L o c a l S i z , S c l ear s t a ck
rti
TLen
Page 003
EMOD
equ
ttl
re turn
*
W a i t f o r a ( ch i l d) p r o c e s s t o c omp l e t e
Wa i tTas k
nam
*------------------------------------------------------ *
*
*
Wa i t Ta s k i s a s ubrout i n e f o r B a s i c09
'*
*
Wa i t f o r t h e a c h i l d p r oc e s s t o c ompl e t e .
*
*
R e t ur n t h e p r oc e s s 10 o f the p r oc e s s that c omp l e t e d *
*
i n p a r am e t e r one .
'*
*
R e t ur n the c ompe t i on c ode o f the p r oc e s s
1.
*
i n p a r am e t e r two .
*
Thi s s ub r ou t i n e w i l l wa i t us i ng no CPU t i me unt i l *
*
'*
a c h i l d p r o c e s s c ompl e t es .
*
'*
I f a c h i l d c omp l e t ed j us t b e f o r e Wa i t Ta s k was
*
*
c a l l ed . i t w i l l r e t urn a l mo s t immed i at l y .
*
I f t her e a r e no c h i l dr en . an e r r or wi l l b e r e t urned*
*
*
w i t h a p r o c e s s number o f O .
'*
'*
Cal l i ng s equenc e :
*
'*
RUN Wa i t�a s k (Pr o c e s s N o , Comp Code)
*
b o t h p r o c es s no and C amp Code aFe B YTE var i ab l e s . *
'*---------------=-----------=-------------------------- *
Type
s et
SBRTN+OBJCT
002 1
008 1
0000
0000
0015
00 1 6
00 1 6
00 1 9
00 1 B
OO IF
0021
0024
0026
0029
002C
0020
0020
OOlE
87Coo032
5 76 1 69 7 4
01
6 FF804
EC6 2
1 08 3 0002
260C
1 03F04
2508
A7F804
E7F808
39
43
002E 39
002F 4C34C4
0032
R evs
s et
REENT+ I
fcb
1
edi t i on
[4 , S)
2 5
2
BEx i t 2
F$Wa i t
BEX ' t
zero t he p r o c e s s 10
pa r am c o un t
I f not exa c t ly 2 p a r am s t h en
t h e c a l l e r i s mak I ng a bad m i s t a k e
wa i t f o r a ch i l d
mod
Wa i t Ta s k f CB
WEn t ry
clr
Idd
cmpd
bne
059
WBEx i t 2
WBEx i t
WLen
b c: s
s ta
s tb
rtB
WLen . Wa i t Task . Typ e , R evs . WEn t ry . O
/W a i t T a s k /
e
l j
4,S
8,S
s e t carry
c oma
rts
EMOD
egu
r e t u rn t h e p r oc e s s 10
r e t urn th e c omp l e t i o n c o d e
r e t urn
r e t urn
*
end
error (s)
warn i ng (s)
002 2 7 pr og r am byt e s gene r a t e d
00000 d a t a byt e s a l l o ca t ed
085 8 7 by t e s u s e d f o r s ymbo l s
Co l umn T e n
69
nAST
9
N ovember
1 98 3
0: 1 4
Ras t er izing P rogram
1
1 # i n c l ude < s t di o . h >
2 #define VDIMENS ION 24
3 #de f i ne HDIMENS ION 80
4 #de f ine BYTES HDIMENS ION/8
5 ?/de f i ne TRUE 1
i ne FALSE 0
6 fl.def
7 1 *- ---------------------------------------------------- *
Data S t ruc ture
8
9 * The ras t e r i zed da t a i s kept in an array o f b i t s . **
The S e t b i t and Bi tSet rout ines are respon s i b l e for
10
*
det ermining whi ch b i t correspondes t o each
11
1 2 * pos i t i on . They' a l s o are the onl y procedures wi th **
acces s t o the 'bi t tl array .
1 3 ----------------------------------------------------*1
14 *
1 5 �a i n O
16
1 7 int x l , y l , x2 , y2 ;
1 8 int i ;
1 9 char o p ; 1 * t akes values of L Line (n , n , n n)
C C i r c l e n , n , 6 , 0)
20
S Spl i ne 0 en) (n , n , n , n , n , n)
21
E Spl ine c f os ed) (n , n , n , n , n , n)
22
*1
23
24 regi s t er int j ;
25
26 whi l e (s canf ("lc ld ld ld ld" , &op , &x l , &y l , &x2 , &y2) ! = EOF)
27 1* Ignore "<lP " for now ",/
i f (x l < xZ)
28
draw (x l , x2 , y1 , y2) ;
29
else
30
draw (x2 , x l , y2 , yl) ;
31
32
33 for ( i =VDIMENS ION - l ·" i >= O · i--)
{
34
for ( j =O ; j <HDIMENS ION � j ++)
35
put char (bi t s et (j , i ) ? ' 1 '
'0') ;
36
printf ("\n") ;
37
38
}
39 r e t u rn ;
40
1 * end o f ma I n *1
41
42 draw (x l , x2 , y1 , y2)
, nt x l , x2 . yl . y2 ;
43
44
int de l tay, de l tax , x , y , dy , dx ;
45
46
f l oat e , s l ope ;
reg i s t er int i ;
47
48
de l tay = y2 - yl ;
49
del t ax .. x2-x
l;
50
x .. x l ·
51
yl
52
Y
I f ( (de; l tax
del tay) && (de l t ay
0) )
53
{ 1 * special case -- draw a p O I nt * 1
54
p l ot (x , y) ;
55
return ;
56
}
57
58
i f f del tax > del tay)
59
60
i f (de l t ax == 0)
61
{ 1* prevent d i v i s i on by zero * 1
62
y = (yl <= y2) ? yl : y2 ·
63
f or ( 1 =O ; i <- « de1 tay >= 6) ? del tay - d e l tay) ; i ++)
64
65
p l ot (x , y++) ;
return ;
66
67
}
s l o V e = ( f l oat ) de l tay/ ( f 1 0at ) de l t ax ;
68
S l ope >= 0)
if
69
t
70
e s l ope-0 . 5 ;
71
dy ., 1 ;
72
73
74
75
e .. s l ope+O . 5 ;
76
dy .. - 1 ;
77
78
}
,�
,�
*
�,
,�
�
'"'
==
==
=
70
P age
05 - 9 U s e r No t e s Vo l ume
I
9
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
1 00
101
102
1 03
1 04
1 05
1 06
107
1 08
1 09
1 10
111
1 12
113
1 14
1 15
1 16
1 17
1 18
1 19
120
121
1 22
1 23
124
125
126
127
1 28
1 29
131
132
133
1 34
1 35
1 36
1 37
1 38
1 39
1 40
141
1 42
143
144
1 45
1 46
147
148
1 49
150
15 1
152
153
Ras ter izing Program
0: 1 4
N ovember 1 983
Page
2
for ( i = O ; i < =de l t ax ; i ++)
( 1 * actua l ly draw the l ine * 1
P l o t X , y) ;
1 f ( ( s l ope > 0 . 0) &&
(e>O . 0» I I
{ (s l ope < 0 . 0 ) && (e<O . 0) ) )
Y + = dy ;
dy ;
e
{
}
x++ ;
e +=
1*
s l ope '
a c t u a 1 1 y ' draw the l i ne * 1
s l o � e = ( f l oa t ) de1 t ax/ ( f l oa t ) del tay;
i f s l ope > 0)
t
e '" s l ope-0 . 5 ;
dx = 1 ;
e
s l ope+0 . 5 ;
dx ., - 1 ;
}
for ( i =O
; i <=de l t ay ; i + + )
( 1 *----------------------------------------- *
* draw a l i ne wi th s lope greater than one *
*
� �or t h i s type o f l ine y needs t o b e
*
1
ncremen
t
ed
more
f
requen
t
l
y
than
x
.
*-----------------------------------------* 1
p l o t (x , y) ;
1 £ f «slope >
0) & & (e>O» ' I « s l ope < 0 )
+= dx ;
e -- dx ;
}
y++ ;
e += s l op e ;
...
�
&&
(e<O» )
X
}
}
r e t urn;
end of draw *1
p l ot (x , y)
t nt x , y ;
s et b i t (x , y) ;
r eturn ;
J
s ta t i c char b i t [VDlliENS ION] [SYTES] ;
s e t b i t (x , y)
tnt x . y ;
int t emp= l ;
r eg i s ter int t x ;
t emp - t emp
(x%8) ;
t x = �1.8 ·
b i t [yJ [t�] .. b i t [y] [ t x] I t emp ;
return ;
1*
«
b i t s et (x , y)
\n t x , y ;
int t emp= ! ;
t emp - t emp
«
re turn (b i t Ly]
(xb8) ;
[x/8J & t em� ' :
C o l umn Ten
71
72
0i'- 9 U s e r Not e s Vol ume I
�u�V�N
THE 05 - 9
1 /0 SYSTEM
�VuUMN
The
--
paths
ab i l i t y
is
pa t hs
beca u s e
dev i ce .
type
0 5 - 9 u s e s a modu l a r I /O s y s t em de s i gned
S i mp l i c i ty
and
f l ex i b i l i t y .
B e ca u se
th i s
modu l a r i t y
u ser
cou 1 d
graf t
it
changes
to
to
except i on a l l y
a
new
05-9
i nto
t he
t ern .
But
I /O s y s tem
m i ng
an
W I" ; t e
of
t he
any
ope r a t i ng
sys­
a re
o t her
aspects
of
t he
don ' t requ i re a ny p � o g r a m ­
e xp l O i t .
and
so
u s ef u l
t ha t
new
t he
0 5 -9
p r oc e s s
has
t h ree
( t i l es )
open
when
i t
c a l l ed s t a nda r d
i npu t .
o u t pu t .
a n d p a t h :2
is
l i sts
dev i ce
s t a n da r d
pa t hs
l s pOSS i b l e f or a p r og ra m to
c l ose t hese
paths and r e - open t hem f or i t s own p u r p o s ­
es .
but m os t p r o g r a m s l ea v e t he m open a nd
u se t hem a s o n e m i gh t t h i nk they S h ou l d be
u sed .
f rom
as
The s ta n d a r d
i np u t p a t h u s u a l l y r ea d s
t he keyboar d ( t e r m i na 1 ) .
a nd
i s used
t he
u se r .
i nput
p r i ma r y
s ou r ce
Programs
c a n a nd
f l l es .
somet i me s
of
i np u t
o f t en
t he
dO
f rom
">"
T he
s tandard
o u tput
pat 1"1
t yp i ca l l y
w r i tes
to
t he
s c reen
( t e rm i na l ) .
and
ls
E ve r y
used f o r r ou t i ne ou t pu t t o t he u s e r .
c ha r a c t e r t h a t appea r s on your s c reen p r ob ­
a b l y came f ro m a s t a nd a r d ou tpu t pat h .
059 :
does
By
s t a nd a rd
conve n t i on
e r r o l" p a t h
it
is
used
is
for
s e l dom
e r ror
u se d .
mess a g ­
j us t
o f t he pa t hs can be d t r ec t ed w h e r ev e r t he
user
w i s he s
b e f o r e a p r o g r am
is
s t a r te d .
T h i s can p r ove u s ef u l when i t i 5 conven I en t
t o h a v e d i f f er e n t
t h i ng s
done
w i t h e r r or
messages
of
a
t han
w i th
t he
rest
of
t he
ou tput
prog r a m .
T he
s tanda r d p a t h S a re
open
when a
t he
shel l .
thi S
The
ab i l i t y
to
s he l l
pass
takes
i ts
advan t a ge
s t andard
paths
of
on
to
t he
p r og r a m s
it
starts
t o c tl a n g e
t he
pa t h S f ro m the s t andard ( a l l
to t he t e rm i ­
n a l ) t o a n y o th e r d i spoS i t i on a u ser m i gh t
s p ec i fy .
O p t I on s
cate
to
t he
a
stle 1 1
s he l l
wha t
on
command
needs
s t andard
paths .
" > )(XXXX " f or " red I r e c t
i npvt
rect
dard
" < xxxx x "
to
xxxxx , "
for
a nd
s t a nd a r d e r r o �
pat h
is
not
i nher 1 t e d f ro m t he
to t he t e r m i na l .
i nd i ­
1 i ne
be
done
to
The
op t i.:ln S
are
s t a nda rd o u t pu t
to
t he
x x x xx . "
to
" red i r e c t
"»
x xx x x "
t o xxxxX . "
r e d i rected
s he l l ;
it
s t a ndard
for
If
i t
" r ed i ­
a ny
is
s ta n ­
s i mp l y
usua 1 1 y
to
see
the
s t anda r d
o u t pu t
end
of
red i rect
t he
t he
t he
The
command
s t anda r d
te l l s
ou t p u t
l i s t f i l en�e > l s t f i l e
the
If
can
that .
It
pu t s
the
ou t p u t
send
t he
ou tput
of
a
command
u se r w i t h a command l i k e :
059 :
to
a no t he r
aam t e s t . a 1 >/T2
Wh i Ch
w ou l d
send
t he
l i s t i ng
f rom
the
a s s emb l y
of
t es t . a
to
t he
dev i ce
ca l l ed
/ T 2 . w h i ch ; s u s ua l l y a t e rm i na l .
red i r e c t
S t anda r d
O u t pu t
more
t ha n
t he o t he r p a t hs . but t he r e a r e r e a s o n s t o
red i rec t
t he
o t her
p a t hs
as
wel l .
The
S t anda rd I np u t pa t h I s t he one wh i ch p r o ­
g r a m s u s ua l l y r e a d f rom .
A program c a n be
fed a
c a nned S C I" I pt
of
commands by r e d I w i th
i ts
t he
i ns e r t
S t a nd a r d
commands
I np u t
in
t h i s command
to
a
i t .
d i sk
I
f i le
some t i me s
i n my s t a r tup
fi le:
debug < s t artup . debug >/NL
T h i s runs t he M i c r owar e debuI:Jger w i t h
i ts
I npu t
c om i ng
f rom
s t a r t up . Clebug ,
and
i ts
o u t p u t go l ng t o a spec i a l SCF dev i ce w h i c h
I made pub l i c i n the f i rs t co l umn I w ro t e
( / N L i s a n u l l dev i ce - i t m a k e s a ny t h i ng
you
send
to
It
d i sappe a r ) .
By
pu t t i ng
debug
in
my
s t a r t up
1.
f ;
1 i ke
this
eas i l y
a pp l y
pa t c he s
to
res i dent
every t i me I boot my s y s tem .
T he
pro­
g r am s t a r t s because t hey a r e i nher i t e d f rom
t he proces s t ha t s t a r t e d i t ,
i n m os t c a s e s
i s ea s i e s t
of
es .
Norma l l y
t he
s tanda r d e r r o r
pa t h
is
d i r e c t e d t o t he
s c r ee n
t og e t h e r
w i th
t he
s t andar d
o u t pu t
pa t h .
The
r a t i ona l e
f or
hav i ng
separa t e
pa t hs
for
r o u t i ne
o u tput
error
me s sages
r i s es
f rom
a
spec i a l
and
c ha ra c t er i s t i C of t he s t anda rd p a t h s .
Each
same
pat h .
l i s t command i n t o a f i l e named l s t f i l e .
you a r e us i ng a mu l t i - u s e r s y s t em you
rec t i ng
The
t he
to
t he
i nput i s f rom some pa t h o t he r t ha n s t a nd a rd
i np u t .
but s t a nd a r d i npu t i s by c o n v en t i on
t he pa t h
u se d f o r
commun i ca t i on
w i th
t he
u se r .
t he
t he
I
to t he
f i l e w h o s e name f o l l ow s t h e > .
can ' t
t h i nk of any re ason f or
s omeone t o
w a n t t o put t h e o u t p u t o f t he l i s t command
i n t o a d i s k f i l e . bvt ,
the
of
t hrough
at
she 1 1
open o t h e r
maj o r i t y
of
for
t he
c o nt e n t s
of
f i l ename
on
c a l l ed / P . u s ua l l y t he p r i n t e r .
s i ng l e
starts .
Pa t h 0
ls
Path
1
i s s t andard
s t a n da r d e � r o r .
It
d e v i ce
d e v i ce
any
059 : l i s t f i l ename >/p
t he
E ach
anot h e r
I /O
to
I t l i sts
w i t h n o r e d i rect i on .
o f t h e f i l e ca l l ed " f i l e name "
s c r een
0 5 - 9 u s e r s s hou l d p l a y w i t h t he m a s soon a s
I NPUT/OUTPUT SYSTEM
d i r e c t ed
path .
PO S S i b l e .
THE UN I F I ED
s ta nd a r d
l i s t f i l enam e
I s a comma nd
the cont en t s
on
t he
i ndependent
be
d e h lu l t
OS9 :
and
m a k i ng
can
j us t
t he
red i rect
dev i ce
The power of t h i s f e a t u r e
w i t h a f ew e x am p l es :
a mb i t i ous
subsys tem
w i t ho u t
rest
t h e re
w h i ch
I /O
f or
of
not
as
to
c a l l ed
S t a nd a r d
i nf requent l y
that
E rror
it
is
ca n
I
modu l e s
pat h
Is
used
so
t o f o rg e t t h a t
ea s y
i t ex i s t s .
It
i s t he p a t h wh i ch p r o g r a m s
u s ua l l y
use
f or
s e r i ou s
e r r o l"
m e s s a ge s .
Usua l l y .
i t
I S a good i dea to l eave t he
S ta n d a r d E r ro r pat h d i r e c t e d to t he s c r ee n .
but
s o m e t i me s
it
s h ou 1 C1
be
r e d i re c t e d .
Some comp i l e r s
send s yn t a x e r ro r s .
01" a t
l ea s t
E r r or
t ha t
s umma r y s ta t i s t i cs
p at h .
I f you want
uses
ground
t tle
wh i 1 e
S t a ndard
you
ed i t
ou t
t tle
S ta n da r d
t o run a program
E rror
in
pat h
in
f o reground .
back­
it
is
w i se to r e d i r e c t t he bo t h the S ta n d a r d Ou t ­
put
and
t he
S t andard
E rror
paths o f
t he
comp i l e r
e r w i se
p i l er
to
you
d i sk
may
c ropp i ng
s c reen a t
f i l es
f i nd
up
awkwa r d
or
t he
m e s ssges
in
the
p r i n ter .
oth­
f rom
t he
com ­
of
your
m i ddl e
t i me s .
goes
C o l umn
ml even
- -
The 05 - 9 I /O S y s t em
73
f i ne ,
a 1 w a y s wo r k s
R e o 1 rect j on a 1 m os t
t he r e a re some p r o b l ems l u r k i ng a round .
a
of
respons i b i l i t y
t he
be
s ho u l dn ' t
• t
bu t
)l>er t o wat c h o u t f or t he s e p r o b l ems ,
1$ - 9 i s des i gned w i t h t he a s sump t i on t ha t
c o nv e n t i on s
some
f o l l ow
wi I I
'j�ograms
s tandard
t he
of
use
t he i r
to
.',pp I Y i n g
S o m e p r o g r am s re l y o n dea l i ng w i t h
�aths .
T he s e p r o g r ams shou l d
p a r t i cu l a r de v i Ce s .
��t
open spec i a l
paths
to
t hose
dev i ce s ,
but
some
use
t he
s t andard
paths
f or
dev i c e
depende n t
1 /0 .
T he s e
progr ams
s hou l d
be
a v o i ded i f poss i b l e .
T he
t yp i ca l
05-9
s y s t em
c ome s
w i th
t h ree t ypes of f i l e s , S e q u e n t i a l Cha r a c t e r
F i 1 es ,
Random
8 1 0ck
F i I es •
and
P i pes .
Seque n t i e l C h a r a c t e r F i l e s ( l.Isua l l y ce l l e d
S C F f i l e s ) a r e w r i t t e n o r r e a d f rom beg i n ­
n i ng t o end .
T h e m o s t common S C F f i l es a r e
T e r m i na l
i np u t a n d o u t Pl.l t , p r i n t e r ou t pu t .
and mOdem i nput a nd Ol.l t pu t .
T he byt e s i n a
R B F f " e (of 1 1 es h a n d l ad by t he R B F MAN f i I e
1 n any o r der .
D i sk
manager ) c a n be read
l i ke
t hem .
Such a s
f i I e s and o t he r f ; I es
f i l es I n bubb l e memory o r ma i n memo r y , a r e
u s u a l l y R B F f i l es .
T here i s o n l y o n e t ype
of P i pe f i l e . t h a t i s a t empo r a r y f i l e kept
u s ed
a
b l.l f f e r
ma i n
memory
wh i c h
is
in
b e t ween
one
prog ram ' s
ou t pu t
and
a no t he r
prog ram ' s i nput .
U n l e s s e p ro g r em concer n s
i t se l f w i t h
t i m i ng
l s sues
or
uses
t he
more
exot i C
G E � ST A T / S E T S T A T
s y s t em
s e r v i ce
reques t s .
t he r e i s no wey f o r i t to t e l l t he d i f f e r ­
ence b e t ween one dev i ce end a not her p rov i d ­
ed t he de v i ces a r e of t he s a me t ype ( RB F .
SCF .
or
P i pe ) .
Some pr ogrems c en ' t
have
t he i r s t anda r d I/O red i rec t ed to a R 8 F f i l e
or a P i pe . but t he g r e a t maj o r i t y c a n .
If
a p r o g r a m uses S C F -s p ec i f i c G E T 5 T A T / S ET S T A T
i t wi 1 1
o n l y b e po s s i b l e t o u s e i t
codes
w i t h t he proper t yp e of f i l e s , b u t e l l bu t
one
of
t he p r og r a m s
t ha t
1
know
of
f r om
M i c r owa r e and o t he r maj or vendo r s C a n have
t he i r
I/O
red i r e c t e d w i t ho u t
re s t r i ct i on
T he
one
excep t i on
is
M i c r oware ' s
Pa s ce l
w i t h o l d ver s i on s o f 0 5 - 9 .
Al l
p r og ra m s
w r i t te n
in
that
l angulll g e .
i nc l ud i ng
t he
comp i l er i t s e l f ,
t ry to r ew i nd t he i r s t a n ­
d a r d output f i 1 e when i t s t a r t s .
T he S C F
f i le
manager
d ea l s
wi t h
thi s
s t r a nge
reQu e s t correc t l y by
i gnor i ng i t .
but
t he
P i pe
manager
returns
an
e r r or
if
anyone
t r i e s to rew i nd i t .
I f you t r y t o red i r e c t
t he ou t pu t o f a p r og ra m wr i t t en
in Pasca l
t o a P i pe , t he p r o g r am w 1 1 1 d i e a s s oo n e5
i t ' S s t a r t ed .
M i c r owere has a f i x f o r t h i s
p r ob l em i f you run i nt o i t .
CHANG I NG 05 - 9 ' 5 DEV I CE SUPPORT
T he modu l ar des i gn of O S - 9 ' 5 I / O sys t em
a l l ows new dev i ce s t o be added and t he s u p ­
po r t of o l d dev i ce s t o b e enhanced w 1 th t h e
onl y
r e s t r i ct i ons
b e i ng
t he
w i s he s
and
budget of t he pe r s o n r e spons i b l e . a n d t he
t he compu t e r .
Sup­
memory cons t ra i n t s of
port
for
1 /0
starts
at
the
l OMAN mOdu 1 e
w h i ch
f i e l ds
each
I /O
system
s er v i ce
reques t and some t l me s
does
a
l i t t l e work
b e f o r e pess i ng
it
of f
to
t he appropr i a t e
mod" l e .
F i Ie
manager s
i nc l ud i ng
SCF
and
RB F
a re
t he n e x t
l ev e l
down f r om
l O MAN ;
t hey do mos t of t he f i l e h a nd l i ng work t he t
i sn ' t
s p ec i f i C
to
a
pa r t i cu l a r
p i ece
of
hardwa r e .
The dev i ce d r i ve r s . such a s A C I A
and P I A , hand l e t he i n t e r f ace w i t h t he I / O
hardwar e .
74
The
dev i ce
descr i p t o r
modu l es
05 - 9 U s e r Note s Vo l ume
I
con t a i n
u l es
t he d i re c t i ons wh i c h a l l t hese mod­
f 0 1 1 0w .
T he r e
i5
a
descr i p t o r
f or
each dev i ce i n an 0 5 - 9 s y s t em con t a i n i ng no
execu t at:l l e
i ns t ruc t i on s .
but
l o t s of
da t a
wh i c h c o n t r o l s t he o t he r I /O modu l e s .
H a r dware t ha t requ i re s comp l i ea t ed new
modu l e s f o r t he 1 / 0 s y s t em shou l d come w i t h
t he necess a r y modu l e s .
T he h a rdwa re vendor
has to have t he mOdu l e s wr i t te n ( o r w r i t e
t hem ) .
bu t a c u s t omer need o n l y
l oad t he
modu l e s
nor ma l l y by
i nC l ud i ng
t he m
in
h i s boot - - i n o r d e r t o add s o f t w a re sup­
por t
for
t he dev i ce t o h i s s y s t em .
Thi s
set s
05 -9
a pa r t
f r om m a ny ope r a t i ng
s y s t em s
i n w h i c h a maj o r p a r t of t he opera t i ng s y s ­
t em h a s t o be Changed f or a n y n e w dev i ce .
Ha r d w a r e
vendo r s o f t e n
need t o w r ; t e
1 /0 mOdu l e s i n o r d e r t o s e l l t he i r p r oduc t s
t o t he 0 5 - 9 commu n i t y , b u t anyone c a n w r i te
I /O mOdu 1 es i f t he need or t he mood t ak e s
'
t he m .
W r i t i ng an e n t i re new 1 / 0 s u b s y s t e m
wou l d requ i re a l o t of wo r k . but mos t p r o b ­
l em s c a n b e s o l ved w i t h much l e s s ef f or t .
Many aa v i ce s
can
be accomrnod e t e d by 0 5 - 9
w i t h o u t a n y s e r i ou s p r o g r a mm i ng a t a l l
by
c r ea t i ng
new
dev i ce
des c r i p t o r s .
Dev l ce
desc r i p t o r modu l es spec i f y how each dev i ce
is
t o be t r e a t ed .
T he dev i ce d e s c r i p t o r
cont a l ns
f i e l ds w h i ch
i nd l e a t e ( t o l O MAN )
wh i c h f i l e menager a nd deV l ce dr i ver s h ou l d
be u sed f o r t he dev i ce . a n a b s o l u t e phys ' ­
ea l
address f o r t he d ev i ce , and any o t he r
da t a spec i f i C t o t he pa r t i cu l a r dev l ce
T he
f i rs t
18
byteS
of
al l
de v i ce
aesc r l p t o r s
have
t he
same
f o rma t .
T he
f i r s t n i ne b y t e s a r e common t o a l l modu l e
h e a d e r s ( Sync B y t e s , Modu l e s i ze . O f f s e t t o
Modu 1 e
Name ,
Type/ L a nguage
(SF i ) ,
A t t r i bu t e s / R ev i s i on .
ana
Header
Par i ty
check ) .
Of
t hese .
t he
modu l e
a t t r i butes
a re m o s t i n t e r es t i ng i n t he con t e x t o f t he
dev i c e d e s c r i pt o r .
I f t he dev i ce des c r i p­
t o r mOdu l e i s marked reen t ra n t , t he dev i ce
c a n be u sed by more t ha n one p r ocess at a
t i me ; o t herw i se ,
i t c a n o n l y be 1 i nk e d t o
o r opened by one p r ocess a t a t i me . Dev i c e
des c r i p t o r s wh i ch a r e n o t reen t r a n t a r e no t
o n l y r es t r i c t ed to use by on l y o ne p r ocess
at a t i me , t hey c a n ' t be 1 i nk e d t o b y debug
at
al l
if
t he y
are
in
the
bo ot .
S ome
d e v i ces , such as t he p r i nt e r . sho u l dn ' t be
r e e n t r a n t un l e s s you f ee l ve r y r eady to b e
r e s pons i b l e .
05-9 w i 1 1 happ i l y m i x o u t pu t
f rom s e v e r a l
p r og r a ms 1 1 ne b y 1 i ne on t h e
p r i n te r i f you t e l l i t t o .
The f o r m a t of t he next n i ne b y t e s i s
common
to
all
dev i ce
des c r i pt o r s .
The
f i e l ds a r e ; t he o f f se t t o t he F i l e Manage r
name ( e . g . . R 8 F ) f o r two byt e s . t he o f f se t
t o t he DeV i ce D r i v e r name l e . g . . A C I A ) f o r
t w o bvtes ,
t h e mode ( wh a t t he dev i ce ean
for one b y t e .
do . e : g . Read/Wr i t e /execu t e )
t he
dev i ce
c on t ro l l er ' s
rae l
address
for
t h re e b y t e s . and t he l engt h o f t he i n i t i a l ­
i z a t i on t ab l • .
Af ter
t he
f l rS t
18 b y t e s . d i f f e re n t
t yp e s
of
de v i ces
heve
d i fferent
f i e l ds .
T he 1 n i t i s l i t a t i on t ab l e w h i ch f o l l ows t h e
b y t e w i t h i t s l engt h con t a , ns mos t o f t h e
f i e l ds t ha t a re i n t e r e s t i ng t o p l e y w i t h .
A f t er
t he
i n 1 t i a l i za � ' c �
t ab l e
t here
1 s
n o t h i ng but modu l e names and t he eRC .
There are e l even f i e ds i n t h e i n i t i a l ­
i z a t i on
t ab l e f o r
RB F - t ype
dev i ce s
( d i sk
The f i rs t f i e 1 d i s one by t e l on g
dr i v e s ) .
a nd
cont a i ns
RBF
d ev i c e .
a
1
i nd i ca t i ng
T he o t he r
t ha t
f i e l ds
thi s
is
a
are :
s t ep r a t e
dev i ce
t y pe
I ' l l
•
med i a d e n s i t y
•
numb e r
•
number
wr i t e s
)
cy l i nd e r s
of
( t wo b y t e s
s u r f aces ,
•
def a u l t
bytes
•
def au l t
sectors
per
z e r o f o r t w o by t e s
•
•
s ec t o r
s egment
of
t he
dev i ce
dr i v ­
c o n f i rm t h i s
when
I
get
on e .
( 0= s i ng l e . 1 � doub l e )
A
of
t he capab i l i t i e s
er .
I t i s t he opt i on of t he p e r s o n wr i t i ng
the d ev i ce d r i ve r t o i gno r e a n y t h i ng i n t he
dev i ce
descr iptor
he
wa n t s .
Th i s
means
t h a t t he r e i s no g u a r a n t e e t ha t t h e o p t i o n s
i n t he dev i ce desc r i p t o r w i l l w o r k .
I have
heard
that
t he f l oppy d i sk
dr ; ve r
on t h e
co l or compu t e r i gn o re s man y of t he o p t i on s .
d r i ve number
•
change
sec t o r s
i nt e r l e a v e
a l l oca t i on
ver i fy
p er
t ra c k
t ra c k
l on g )
( O:a ve r i f y
for
on
two
t rack
f ac t o r
s i ze
T he s tep r a t e can ta .. e o n va l ues o f 0 . . 3
w i t h t he h i g h e r num be r s r e f l ec t i ng h i g h e r
s t epp l ng r a t e s .
I n t he dev i ce t yp e b y t e t h r e e b i t s a r e
s i gn i f i ca n t .
B i t z e r o i nd i ca te s a S " f l op ­
p y i f i t i s one .
B i t s i x i nd i c a t e s a n o n ­
s t a ndard f or m a t i s b e i ng u s e d i f i t i s on e .
Sit
se v e n
b e i ng
one
i nd i ca t e s
t ha t
t he
d ev i ce i s a ha r d d i s k .
I n t he med i a d e n S i t y b y t e t w o b i t s a r e
1 i nd i ca t e s t ha t
s i gn i f i ca n t .
B i t zero
t he d e v i ce can hand l e doub l e den s i t y .
Bit
one " 1
i nd i ca t e s t ha t t he d i s k i s capab l e
o f doub l e t rack d e n s i t y ( 96 t p i ) .
The f i e l ds i n t he dev i ce desc r i p t or a r e
i n t e r p r e t e d b y t he
d e v i ce d r i ve r a nd
t he
va l ue
In
t he
file
manage r .
C ha n g i ng
a
dev i ce
d e sc r i pt o r
can ' t
f orce
the
o t he r
modu 1 e s t o d o some t h i ng t hey weren ' t w r i t ­
t en t o d o .
F o r examp l e ,
i t p r Obab l y i s n ' t
p o s s i b l e t o use t h e dev i ce d r i ve r Wh i c h i s
d e S i gned f o r f 1 0p p y d i s K S to con t ro l a ha r d
d i s k - - Chang i ng t he dev i ce t ype b y t e won ' t
d i f f e re n t
set
of
f i e l ds
are
in
the
i n i t i a l i za t i on t ab l e f or S C F d ev i ce s .
Most
of
these
f i e l ds
cont r o ;
t he
l i ne - ed i t i ng
f u nc t i on of t he S CF manage r .
T he s e a r e t he
va l ue s t ha t a r e t empor a r i l y set by TMOD E .
They
can
be
set
permane n t l y
by
c h a ng i ng
them i n t he dev i ce des c r i pt o r .
T he i n i t i a l i za t i o n t ab l e i n t he d e v i ce
desc r i p t o r i s cop i ed i n t o t he p a t h d e s c r i p ­
t o r when a p a t h i s opened .
There i t can be
c ha n ged a n d r e a d b y GE TST A T / S E T S T A T c a l l s "
b u t t he c hange a pp l i es o n l y t o t ha t pa r t i C ­
u l ar p at h .
Changes t o t h e dev i ce d e s c r i p ­
to r become t he def au l t f o r a l l pa t hs o p e n e d
to t ha t dev i ce .
The e a s i es t w a y t o c hange t he d e v i ce
descr i pt o r s i s w i t h debug .
If,
f o r exam ­
p l e , y ou w a n t t o a d d a n ew t e r m i na l to y ou r
system
wh i c h
you
d on ' t
have
a
d e v i ce
de s c r i pt o r f or .
y ou c a n mod i f y
a
simi 1ar
desc r i pt o r w i t h debug t o f i t you r r equ i r e ­
m e n t ( pr obab l y chang i ng on l y t he c o n t r o l l e r
a dd r e s s a nd modu l e name ) .
s a ve t he r e s u l t
w i t h t he s a v e comm a n d . a n d v e r i f y
i t w i th
t he
upda t e
opt i on
to
fix
i ts
C RC .
T he
r e su l t i ng modu l e c a n be l oa de d a nd u s e d .
A
dev i ce
desc r i p t o r
can
be
m od i f i ed
even w h i l e t he d e v i c e
it
s p ec i f i e s
is
in
use beca u s e t he d e s c r i pt o r i q i se 1 f i s se l ­
dom r e f e ren ce d .
I n f ac t . a s f a r a s I k n o w ,
the dev i ce d e s c r i p t o r i s o n l y u s e d w h e n a
pa t h i s opened to t he dev i ce .
The d e v i ce d e s c r i p t o r
i s t he cont r o l ­
l i ng p a r t of t he 0 5 - 9 1 /0 s t r u c t u r e .
The r e
a r e s eve r a l
t h i ng s t ha t c a n b e don e w i t h
t hem t ha t I
haven ' t c o ve r ed y et .
b u t t ha t
w i l l b e m a t e r i a l f o r o t he r co l umns .
C o l umn � l even - - The O S - 9
I /O Sy s t em
75
7,6::;
05.- 9 U s e r N o t e s Vo l ume
I
COLUMN TWELVE -- THE COCO
but
I now have a Rad i o S ha c k C o l o r Comp u t e r
w i t h OS-9 .
I h a d hoped t ha t
th i s c o l umn
wou l d be abou t my f i r s t expe r i enCes as a
new C oCo/ O S - 9 Leve l
O ne u se r .
bu t
1
have
o n l y had a f e w hou r s t o p l ay w i t h t he new
ma c h i ne and t h i s co l umn 1 s dUEl .
E ven
j u st
a
few
hou r s w i t h t he CoCo
ver s i o n
of
05-9
i5
enough
to
f o rm
some
f i rst
i mp r e s s i ons .
F i rst ,
t hat re a l l y
is
0 5 - 9 i n t he r e .
Al l
t he s t andard commands
and
u t i l i t y program s
a re
i nc l uded .
Even
X M OD E . w h i c h d i dn ' t come w i t h my Leve l Two
s y s tem ,
was on t he CoCo O S - 9 d i sk .
I am
i mp ressed w i t h t he p e r f orma nce o f t he CoCo .
I am u s ed to a t wo megahe r t z G I M I X s y s t em .
and
t he
CoCo
is
d i s t i nc t l y
s l ower
t ha n
t na t ;
but ,
I bet B a s i c09 o n a CoCo wou l d
g i ve an I BM - P C runn i ng i t s ver s i on of B a s i c
a good race .
I hope I have a chance t o do
some benchmar k s soon .
F o r a user mov i ng f rom C o l or Bas i C t o
0 5 - 9 t he change m u s t be wonder f u l . b u t con­
f u s i ng .
0 5 - 9 br i ng s ou t mUCh Of t he power
h i dden
in
that
l i t t l e o f f - w h i t e box .
It
a l s o demo n s t r a te s
t he
1 i m i t a t i on s
of
t he
Co l o r Compu t e r .
A f t e r t h i s co l umn I i nt end
to conce n t r a t e on POS i t i ve a s pect s O f t he
Co C o , but r i ght up f r ont I have to say t ha t
my new CoCo i s a s i t - down 1 awnmower w i t h
t he s o u l o f a Grand P r e r a ce r .
I want t o
get my comp l a i n i ng ou t of t he way e a r l y , s o
t h i s c o l umn i s e l e c t e d .
On t he hardware s i de ,
I guess my c om ­
p l a i n t s can be s u mma r i ze d a s : t h i s compu t e r
seems
t o hav& been des i gned t o s e 1 1
f or
unde r a
t housand
do l l a r s .
It
is
r ea l l y
unfa i r f or me t o t h i nk t n a t t h i s compu t e r
s hou l d have DMA ( D i r e c t Memo r y Acce s s ) f o r
i t s d i sk I/O and a ch i p t o do i t s ser i a l
I/O .
By
d o i ng
t hose
tasks
in
sof t w a r e
Rad i o S h a c k h u r t
0 5 -9 ' 5 per f o rmance ,
bu t
they a 1 so
kept
t he c o s t
of
t he
compu t e r
down .
C e r ta i n l y ,
my
ma i n
r eac t i o n
to
t he
Ra d i o S he c k v e r s i on of 0 5 - 9 was p l ea su r e .
but t h a t d i dn ' t keep me f rom f i nd i ng a f ew
t h i ngs to comp l a i n abou t .
I n my l a s t c o l ­
umn 1 h i n t e d t ha t t h e d i s k dr i ver i nc l u ded
w i t h CoCo 0 5 - 9 does n ' t adhere to 0 5 - 9 s t a n ­
da r ds .
I
d i d n ' t m a k e a s t rong s t a t ement
because I d i dn ' t k now f r om p e r sona l expe r i ­
ence .
I can t ent a t i ve l y conf i rm t he I nf o r ­
ma t i on
now
t he
CCD i s k
d i sk
d r i ve r
doe sn ' t seem t o r e f e r t o t he param e t e r s s e t
i n t he d i S k dev i ce desc r i p t or s .
The docume n t a t i on t h a t came w i t h 0 5 -9
was
a l so
a
d i sapPo i n tmen t .
I
expected
ent i r e l y n e w books e xp l a i n i ng t he t r i c k i er
a spects of 0 5 - 9 so any f oo l
cou l d u nde r ­
s t a nd
it.
T he
manua l S
I
got
a re
just
p r e t t i ed - u p ve r s i ons o f t na M i crowa r e manu­
a l s \l/ i t h some par t s m i s s i ng .
The documen­
t a t i on
seems
to
have
been
very
�u i c k l y
done .
I checked out t he s e c t i on on dev i ce
descr i p t o r s
f i rs t
t h i ng ;
the
m a nu a l
, nc l udes a f u l l
desc r i p t i on o f t he d e v i ce
descr i p t or
wi th
no
i nd i ca t i o n
that
some
parame t e r s don ' t w o r k on t he CoCo .
Most of
t he
i n forma t i on
f rom
M i croware ' s
ma nua l s
abou t
adapt i ng 0 5 - 9
t o a new sys t e m are
m i s s i ng f r om Rad i o Shack ' s OS-9 document a ­
t i on .
My
comp l a i nt s
t hey are not .
may
sound
s i gn i f i ca n t ,
1'he h a r dwar e 1 i m i t a t i ons
of t he C o l or Comp u t e r are no worse t han o ne
wou l d expect i n a l ow - c o s t compu t e r .
T he
1 i m i t ed d i s k d r i ver i s on l y wa i t i ng t o be
r e p l aced by a more g e ne r a l o n e .
I f no one
e l se wr i t e's one . I may do i t myse 1 f .
T he
documen t a t i on p r ob l e m
I s an i nv i t a t i o n t o
peop l e l i ke me .
I f O S - 9 o n t he CoCo con­
t i nues to be a s b i g ill success as
i t has
been . books w i l l appear abou t i t i n f a i r l y
s h o r t o rder .
NOTES ON COMPUSERVE
I spent over t w o hou r s read i n9 t h r ou gn
t he messages i n t he new O S - 9 S 1 G on Compu­
s e r ve .
That bu l l e t i n boa r d i s rea l l y p i ck ­
i ng
up !
peop l e
are
beg i n n i ng
to
buy
B a s i c09 f or t he CoCo and a re hav i ng t r oub l e
i n s t a l l i ng
it.
Some
mes sages
went
some­
t h i ng l i k e : I i ns t a l l ed B a s i cOS on my s y s ­
tem a n d i t does n ' t w o r k - - H E LP .
I can ' t
i mag i ne hOW anyone i s ab 1 e t o f i gu re out
wha t
wen t
wrong
f rom
that
k i nd
of
com­
p l a i nt ; I c e r t a i n l y cou l dn ' t .
Seve r a l o t h ­
er peop l e gave more d e t a i l e d desc r i p t i on s
of t he i r t roub 1 as .
I t sounded t o m e 1 i ke
t hey were hav i ng t roub l es w i t h d i r e c t or i e s .
When you
start
OS-9
run n , n�
i t
wi l l
f i nd a d i rec:: t o r y c e l l ed IDO/CMDS o n your
s y s t em d i s k .
This
i s
the d i r e c t o r y O S - 9
w i 1 1 a l ways execu te p r ograms o u t o f u n l e s s
you exp l i C i t l y d i rect
i t t o a no t he r d i r ec ­
tory .
Spec i f i c::a l 1 y ,
i f you g i ve t he com­
mand
BASIC09
05-9
wil l
l ook
for
an
execu t ab l e
f i le
ca l l ed BASI COS
i n t he /OO/CMOS d i rect or y .
If
it
f i nds
t he
program ,
eve ry t n i ng
i5
f i ne ;
o t herw i se .
05-9
wi l l
search
t he
defau ] t data d i r ec t o r y ( i n i t i a l 1 y /00 ) f o r
J f B A S I C09 i n f ound
a f i l e ca l l e d BAS I C09 .
i n t he da ta d i rectory i t w i l l be taken as a
she 1 1
command f i 1 e ,
and a s na 1 1
w i 1 1 · be
s t a r t ed up
to
execu t e
t he
comma nd s .
If
that
file
turns
out
t o be
fu l l
of
t he
mach i ne code f o r Bas i cOS , t he s he l l w i l l be
under s t a ndab l y
confused .
If
you
copy
Ba s i c09 f r om i t s D i s t r i bu t i on d i s k t o t he
root d i rectory f o r y o u r s y s t e m d i s k ( wh i ch
i s what t he commend :
copy /Dl / bas i c09 Bas i c 09
\l/ i l l do ) you r s he l l w i l l get wr apped a r ound
t he ax l e i n about t he way I j u s t d e sc r i bed
is
to put
Tne way to avo i d t ha t prob 1 em
Ba s i c09 i n your execu t i on d i r ec t o r y w i t h a
command l i ke :
co py' /Dl /bas i c09
/D07CHDS/ Sas i c 09
The
s ys tem d i s�.
on
my
CoCo
i Iii
very
ful l .
I f I h a d a n y number of my o w n p r o ­
grams on t ha t d i s k i t w ou l d overf l ow .
When
t ha t happens i t i s t i me to d i v 1 de t he f i l e s
on t h a t d i sk be t ween t w o d i s k s .
One way to
sp l , t th i ngs ".Jp i s to p u t Bas i c:09 a n d a few
other
programs
t ha t
a re
f requent l y
u s ed
w i t h Bas i c09 on a d i Sk by t hemse l v es , and
rep l a ce t he s y s t em d i s k w i t h t ne spee i a l
Bas i c09 d i sk when i t i s t i me t o use B as i c .
T h e re i s not h i ng w r o ng w i t h t he i dea . but
t here is a n i ce p i t f a l l wa i t i ng here t oo .
C o l umn Tw e l ve
- - The CoCo
77
O i rect o r 1 e s a re f i l es , and ,
to s a ve t i me ,
05-9
remembe r s where
t he
f i l es
you
ere
When yo u boo t 0 5 - 9 i t
u s i ng a re o n d i s k .
determ i nes whe re t he d i rec t o r y / OO/CMOS i s
a nd w i l l
l oo k r i g h t
t here next
t i me
it
needs t o f i nd e program .
I f you pu l l
out
i n your spe c i a l
t he s y s tem d i sk end p u t
Bas i c09 d i Sk . 0 5 - 9 w i l l reed t he l oc e t i on
on
t he Ba s i c09
d i s k w h e re
t he /OO/CMDS
d i rectory w a s on t he s y s t em d i s k .
I n t he
bes t c a se you w i l l ge t a mea n i ng f u l e rror .
b u t you may not .
T he w a y t o g e t e r ou n o
t h i s prob l em i s t o remember t o c h a nge you r
execu t i on ( and per haps your d a t a ) d i rec t o r y
when y o u change t he d i s k i t i s o n .
Tha t
is:
Take t h e s ys t em d i s k 9ut
P u t the B a s i c09 d i s k l n
type
CHX /DO / CMOS
wh i ch w i l l cau s e OS - 9 t o f i nd t he IDO/ CMOS
d i rec t o r y a ga i n .
O f c ou r s e , i f you dec i de
to ce l l
t he execu t i on d i rec t o r y on your
Bas i c
d i sk
some t h i ng
o t he r
t ha n
C MOS .
that ' s
f i ne ;
j us t
C h a nge
t he
execu t i on
d i rect o r y appropr i a t e l y . F o r exemp l e :
O S 9 : CHX / DO/BAS I C . CMOS
I f you out B a s i c09 on a d i sk sepa r a t e
f rom m a n y of you r o t her p r og rams you may
f i nO you rse l f u na b l e t o get at s ome i mpor
tant p r og ram w h i l e you a r e u s i ng BaS i c0 9 .
There a re a t l ea s t t hr ee ways to s o l ve t h i s
prOb l em .
0 5 - 9 l e t s you l oa d p rograms i n t o memory
and keep t herr, t he re .
Y ou don ' t wa n t t o
l oad t o o many becau se ma i n memory i s a ver y
l i m i t ed
resource ,
bu t
some t i me s
it
can
prove very u s e f u l t o have a program o r t w o
I f you i ns e r t your B a s i c d i s k .
i n memory
oad /OO/CMOS /bas i c09 ( no t e t ha t 1 s pec l ­
f l ed t he f u l l
d i rectory name i ns tead o f
:;- .' '19 1 n9 t he exec u t i on d i r e c t o r y - - e i t he r
"' i l l work , bu t t h i s way I won ' t need t o
: <; " 'ge t he d i r e c t o r y back ) .
t hen remove t he
;: ;; !" c d i sk and pu t t he s y s t em d i s k back i n .
, 0 .. B a s i c09 i s
i n rna i n memo r y .
You can see
.o a s 1 c09 i n t he ou t pu t o f t he MO I R command ,
end t he M F R E E command w i l l s how t ha t t here
i s much l e s s f r ee memory i n t he s y s tem t h a n
t here was b e f o r e you l oaded B a s i c09 .
Now ,
i f you t ype
•. -
OS9 :
b a s i c 09
you w i l l f i nd you r se l f i n bas i c much f a s t e r
t ha n w he n i t h a d t o b e l oaded f rom d i s k .
T o get r i d o f t he copy o f Ba s i C09 i n me i n
memory use t he UNL I NK command :
OS9 :
UNL INK bas i c 09
I f t here i s some sma 1 1 number of sma 1 1
programs
you
want
to
use
f rom
w i th i n
Bas i cOS you can l oad t hem i n t o memory w h i l e
t he s y s t em d i s k i s mou n t ed . F o r examp l e :
78
05 - 9 U s e r Not e s Vo l ume I
OS9 :
059 :
LOAD c o p y
LOAD l i s t
r emove t h e s ys t em d i s k
ins e r t t h e bas i c d i sk
059 :
CHX / DO /CMDS
and p e rh a p s
d i r e c t o ry
OS9 :
change t h e d a t a
CHD /DO / BAS I C . PROGS
then s t a r t b as i c 09
OS9 :
BAS I C 0 9
J f , f o r one r e a s o n o r a no t her , ne i t her
of t hese t r i Cks w i l l s e r ve , you can c ha nge
t he
execu t i on
d i r ec t o r y
f rom
w i th i n
B a s ; c09 .
F o r examp l e . s t a r t i ng f rom a t i me
when Bas i c09 i s runn i ng w i t h t. he baS i c d i s k
on d r i ve /DO :
Rep l ace t he bes i c d i s k
t he programs you need
B:
w i th
chx / DO /CMOS
t he
d i sk
w i th
o r wha t eve r
do what needs t o De done .
t hen ,
be f o re
eX 1 t i ng f rom bas i C , r ep l a ce t he ba s i C d i s k
i n t he dr i ve .
T he Bas i c09 CHX command on 1 y c h a nges
t he execu t i on d i rec tory w i t h i n 8as i c09 a nd
any programs t ha t ere r u n f rom i t .
When
you e x i t f rom B a s ' c09 t he d i re c t or i e s t h a t
were act i ve be f o r e y o u s t ar ted B a s i c09 w i l l
be I!!I c t i ve a ga i n .
THANK YOU G I MI X
E ve r s i nce the CoCo v e r s i on of 0 5 - 9 was
a nnounced w i t h a d i f f e ren t d i s k f o rmat f rom
a l l o t her ver s i ons of 0 5 - 9 t he u s e r s of
l a rge
05-9
sys t em s
have
been
grumb l i ng
about t he i ncomp a t i b i l i t y of ou r d i s k f o r ­
ma t s
and
t he
CoCo
f o r ma t .
GIMIX
has
rel eesed a new f l oppy d i s k dr i ve r for t he i r
sys tems that suppor t s read i ng a nd ( i f you
have a 40 t rack d r i ve ) w r i t i ng d i s k s i n
1 am very gra t e f u l , and
CoCo 0 5 - 9 f ormat .
I a m sure I repre sent many o t her 0 5 - 9 u se r s
when I t hank G I M I X f or t he i r e f f o r t s .
A HANDY SHORTCUT
1 a l ways use 3 21< when I r u n Dynas t a r ,
and 1 a 1 mos t a l ways u se 2 41< f or t he M i cro­
ware A ssemb 1 er .
I a m se l dom content t o u s e
t he m i n i mum memo r y requ i rement g i ven i n t he
modu l e header for a n y program .
I have mod­
i f i ed the modu l e heade r s 01' s e ve r a l pro­
grams so t hey 101 1 1 1
a u t oma t i ca l l y requ e s t
t he amount o f memor y I u s ua l l y reques t t o r
t hem .
Debug c a n b e u sed t o do t h i s .
T he
commands wh i c h w i l l mOd i f y Dyna s t a r ( OS ) t o
def au l t t o i ts ma x i mum memory s i ze ( 32K )
i ns t ea d Of t he m i n i mum ( 8K ) a r e :
l oad ds
d e bu g
1 ds
. +b
•
=7 F
=FF
Q
T o p o i nt a t t h e p e rmanent s t o r age s i ze i n
t h e modu l e header .
The v a l ue o f t h i s byt e i s $20
The c hange i s made s o qui t d e b ug
T e s t d s t o make c e r t a i n t he new d e f au l t i s work ing .
I f i r s t mad e c e r t a in I cou l d ed i t a l a rge f i l e , t hen
i nvoked procs f r om w i t h i n ds and n o t ed t h at d s was
us i ng 12 8 page s .
I f you want t o make t he change
use t he f o l l ow i ng sequence :
permanent
execu t e
t he m on
a t t r i bu t e s
are
m i s s i ng .
so
turn
O S 9 : a t t r /QO/CHDS / d s 2 e pw
O S 9 : s aV e /OO / x d s
O S 9 : v e r i f y U < / DO/x
> / OO/CMDS / ds 2
Save t he o l d ve r s i on
OS9 : r en ame /OO/CHDS/ ds o l d . ds
C heck i t s a t t r i bu t es
OS9 : a t t r /OO/ CHDS / d s 2
You w1 1 1
f i nd
that
t he
execu t e
a nd
pub l i c
OS9 : r ename / OO/CHDS/ ds 2 d s
Col umn Tw e l ve
- - T h e C oC o
79
80
'�- 9 Us e r No t e s Vo l um e I
COLUMN TH I RTEEN
B I G SYSTEM HARDWARE
Gimix
has
o f fered
CoCo
owner s
an
a t t raCt i ve dea l .
Gimix
i ts
va l ue .
Even
w i t h t h i s r ou gh l y t ho u sa nd d o l l a r b r e a k i n
t he p r i ce o f a G i m i x t he u p g r a de i s expe n ­
s i ve ,
bu t .
spea k 1 n g a s a per s o n w h o h a s
u sed a G i m i x f o r many many hou r s ,
i f you
can f i nd tne money , t a ke th i 5 oppo r t u r ; t y .
Wha t makes i t wor t h t ho u s a nds of do l l a r s t o
move f rom e CoCo t o a 5550 s y s t em?
The
mo s t
i mpo r t a n t
d i f f e r e nce
is
t ha t eve r y ­
t h i ng wo r k s r i ght on t ne 1 a r ger s y s tems .
Another i s t hat t he more expens i ve s y s t ems
are faster .
A t w o mega h e r t z 6809 runs more
t ha n t w i ce a s f a s t as a CoCo I n i t s norma l
mode .
The DMA d i sk c o n t r o l l e r a n d o t he r
powe r f u l I / O dev i ce s a l s o make a not i ca b l e
d i f f erence .
The upg rade f rom a CoCo to a SS50 s y s ­
t e m i s n ' t t h e end of
t he 1 1 ne .
Al l
the
ma j o r S S 50 s y s t em s t ha t s u p po r t O S - 9 s u p ­
p o r t bo t h O S - 9 L e v e l
O ne a nd Leve l
Two .
The move to Leve 1 Two i nvo 1 ves a new ver ­
s i on of t h e O S - 9 ope r a t i ng s y s t em . but no
Change i n app l i ca t i on s p r o g r ams .
Al l
t he
mode r n
S S5 0
s y s tems
I
know
of
can
be
upgraded w i t h 1 i t t l e o r no change t o the
ha rdware
( t he m a i n requ i rement
i s memory
management h a r d wa re ) .
I i ma g i ne that O S - 9
Leve l Two m i ght r u n w i t h t he 56K o f memo r y
t h a t Leve l One u s es . b u t j us t b a re l y .
Lev ­
el Two beg i ns to come i n t o i t s own a t i 2 8K .
At S44K . I have never r u n o u t of memor y .
B I G SY STEM SOFTWARE
Tl1e"e i s IS b i t of c o n t r o v e r s y a r i s i ng
i n t he O S - 9 wo r l d .
Smoke S i gna l B£ oadca s t ­
i ng h a s been r e s pons i b l e f o r a l ot
o f 6809
s o f t wa r e over t he y ea r s .
T here i s even a n
opera t i ng s y s tem wh i ch t he y a r e respons i b l e
fo�
Now
t hey a r e c o nt r i bu t i ng
to 05-9
s o f t wa re .
M y u n de r s t a n d i ng i s t h a t SmOke
comm i ss i oned someone to work on t he v er s i on
of 0 5 - 9 l i censed to t hem .
T he i r c o n s u l ta n t
made 0 5 - 9 l es s mOQu l a r i n o rde r to i mprove
j ts pe r f o r ma nce .
The SmOke u s e r s I know
conf i r m that t he rev i s i ons make t he Smoke
ve r s i on of O S - 9 r un f a s t e r t han i t u sed t o .
R unn i ng f a s t e r w ou l d seem t o be a n advan­
t age . b u t t he changes SmOke h a s made t u r n
o u t t o be a m i xed b l es s i ng .
T he r e appea r
to be subt l e i ncompat i b i l i t i es between O S - 9
as
i t comes f rom M 1 c r o w a r e and O S - 9 f rom
Smoke S i gn a l B r oadca s t i ng .
I have spoken
to M i c rowar e and t hey say t ha t t hey can ' t
suppo r t Smoke ' s vers i on o f 0 5 - 9 ( t ha t may
have Cha nged by t he t i me you read t h i s ) .
I
have had t ro ub l e exchang i ng s o f t w a re w i t h
Smoke u s e r s .
The Smoke u s e rs a r e amaz i ng l y t o l e r a n t .
I
have read exchanges
on
the Compuserve
O S - 9 S I G i n wh i ch Smoke u s e r s exchange t i p s
on wa y s t o prevent t h e O I R comma n o f r om
i nt e rm i t te n t l y produc i ng j un k .
4
Th i s prob 1 em waS r e s o 1 ved to e v e r yone ' s
s a t i s f a c t i o!"\ when SmOke a g r eed to o f f e r
the i r
users
a
cho i ce
of
mod i f i ed
or
unmOd i f i ed O S - 9 .
I c e r t a i n l y app rove of i mp rov i ng O S - 9 ' s
pe r f ormance , but i t i s very i mpor t a n t t h a t
a n ooera t i ng s y s tem b e a s s t andard a s p o s ­
s ible.
If
I
were buy i ng
a
s y s tem
f r om
Smoke
S i gna l
B roadcas t i n g .
I
wou l d
want
s t r ong
a s s u r a nces
t ha t
t he i r
ve r s i on
of
OS-9
was
compa t i b l e
with
M i c r o wa re ' s
on
e v e r y l eve l .
A gOOd t e s t w ou l d be t ha t a l l
app l i ca t i ons
programs
and
s y s tem
modu l es
t ha t
r u n under s t anda r d O S - 9
s h ou l d r un
u n der t he mod i f i ed one , and v i ce ve r s a .
THE COMPU5ERVE 05 - 9
SIG
T he O S - 9 Spec i a l I n t e r e s t Group on Com­
puserve i s boom i ng .
M e s s a g e s f l ow t h rough
t he bu l l e t i n boa rd s o f as t I a m beg i nn i ng
to ques t i on my ab i l i t y t o read t hem a l l .
Many exper i enced O S -9 u s e r s regu l a r l y check
i n , but i t i s a p a r t i c u l a r l y gOOd r e s o u r ce
f or newcome r s .
I s t r o ng l y suggest t ha t you
j O i n Compuserve i f t he r e i s an a c c e s s p o i nt
c l o se t o you .
It
5
worth i t even i f y o u
on l y use i t to a c c e s s t he 0 5 - 9 S I G .
05- 9 ON THE COLOR COMPUTER
I have been s a y i ng na s t y t h i ngs a bo u t
Tandy
wh i ch
a r en ' t
t r ue .
I
b l amed
t he
s l oppy
programm i ng
in
t he
CCD I SK
dev i ce
dr i vel' on Tandy when
1 t seems t he b l ame
s h ou l d
fal l
o n M i c r ow a r e
a nd M i c r o s o f t .
T he
boo t s t r ap
for
t he
CoCo
is
in
ROM .
There i s on l y one boo t s t r a p ROM , des i gned
by M i crosof t f or use w i t h C o l o r D i s k B a s i C
(1
gue s s ) .
M i crowa re
had
t o des i gn
t he
CoCo i mp l ement a t i on of O S -9 s o i t cou l d be
l oaded w i t h t h a t Boot s t rap .
T h e CoCo boo t
ROM reads 1 5 sect o r s o f f t r a C k 3 5 i n t o a
f i xed l oca t i on i n memor y .
T he OS9Boot f i l e
had
to f i t
i n to t hose
1 5 s e c t or s .
Th i s
memory cons t ra i nt f orced M i c r owa r e to p a y
e v e n m o r e at tent i o n t o w r i t i ng compact code
S i nce 6809 i ns t ru c ­
t ha n t hey u s ua l l y do .
t i ons t ha t d o d i rect memory r e f e rences t a k e
l es s
memory
t ha n
i ndexed
i ns t ru c t i on s .
M i crowl1lre used t hem whenever
t he y c o u 1 d .
S i nce versat i l e dev i ce d r i ve r s t a k e m o re
memory
t ha n
l i m i ted
d r i ve r s ,
t hey
wrote
Tandy .
I
a po l og i ze f or
l i m i t ed d r i ve r s .
t he nas t y thou g h t s I sent y o u r way .
I dec i ded to w r i t e t h i s mont h ' s p r o j e c t
f o r t he CoCo .
I not i ced t ha t Co l o r B a s i c
h a s a number of comml1lnds wh i c h make a s s o r t ­
ed
hon k s
and
beeps
emerge
f rom
my
TV .
Ba s 1 c09 has no way to make t ho s e no i se s .
I
checked t he " C o t o r Comput e r Techn i ca l Re f ­
e r e nce Manua l "
f o r'
i nf or ma t i on abou t
t he
sound gener a t o r , a n d f ou nd t ha t t he C o l or
Comp u t e r gene r a t es s o u nd w i t h a D i g i ta l t o
A na i og conve r t e r .
T he o u t p u t f rom t he O / A
conve r t e r i s routed t hr o u g h a n a n a l og m u l ­
t i p l exer to t he moau l a t o r , a n d hence t o t he
TV .
It
l ooked
l i ke 0 5 -9 cou l d l e a r n t o
make no i se .
expect
that
t he
reason
M i c r oware
d i dn ' t
i nc l ude sound gene ra t i on
in
the i r
OS -9 f o r the Co l or Compu t e r i s t ha t S Ou n d
ger.erat j on w i t h a n O / A conve r t er i s a v e r y
t i me dependent opera t i on .
A note i s p l ayed
by g radua l l y
( i n compu t e r
t e r ms )
r a i s i ng
and l ower i ng t he vo l t age g e ne r a t ed by t he
D/ A conve rter .
T h i s h a s t o be done w i t h a
t i m i ng l oop i n a p ro g r a m .
T he t i m i ng l oop
must have exc l us i ve u �e o f t he compu t e r , or
C o l umn Th i r t e e n
81
t he
rate
Tal l s
wi l l
at
wh i ch
vary
t he
c a u s i ng
vo l t ag e
note
the
a nd
r i ses
be i ng gen­
� r a t ed to r i s e and f a l l .
S ome peop l e m i ght
f i no
t he
r e su l t i ng
yodel
s u r p r i s i ng .
A
p r ogram c a n g i ve
i tsel f
ex c l u s i ve u se o f
t he comp u t e r b y m a s k i ng o u t i nt e r rup t s . b u t
1 0 ck l ng o u t i n t e r r u p t s f or m o r e t ha n a f ew
m i l l l o n t hs of a second i s a n t l s oc i a l beha v ­
i o r f o r a n y p r og r am - - even a p a r t o f t he
oper a t i ng s y s t em .
S t i l l . t he ab i l i t y t o at l ea s t be ab l e
g e n e ra t e a beep s e e m s i mp o r t. a n t to m e .
1 s t a r ted by w r i t i ng a p r o g r am c a l l ed Sound
to i nve s t i ga t e s o und p r o d uc t i on .
The p r o ­
gram gene r a t e s a s a w - t o o t h wave t h a t s ounds
r a ther 1 i k e a s a be r s a w c u t t i ng t h i n p l y ­
WOOd .
but
it
workS .
The
most
i mp o r t a n t
d i scove r i es I made wh i l e w r i t i ng S o u nd w e r e
to
how t o
i n i t i a l i ze
t h e mu l t i p l ex e r
s o t he
D/ A conv e r t e r ' s o u t p u t wou l d be rou ted t o
the TV .
T he con t r o l reg i s t e r s a t $ F F03 and
$ F F 2 3 bo t h need to be m od i f i ed .
The f a c t
t ha t
t he y
cou l d
be
mod i f i e d
was
another
i n t e r es t i ng d i soove ry .
1 a m u sed t o con­
t rol
reg i s te r s
be i ng
e i ther
readab l e
or
wr i teab l e .
T he s e
r eg i s t e r s
are
to
some
extent
read / w r i te .
CoCo
p r o g ra m me r s
may
take t h i s f o r g r a n t ed , b u t 1 w a s p l easant l y
su rp r l s ed .
Once
t he
c on t r o l
reg i s t e r s
are
set .
sound c a n be g e ne r a t ed by
s i mp 1 y
wr i t i ng
d i f f e rent va l u e s
, n t o t he m o s t s i gn i f i ca n t
6 b i U o f t he b y t e a t $ F F20 .
T h e f as t e r
t he v a 1 u e i s changed t h e h i g h e r t he p i t c h .
wrote
t he p r og r am
to
s e nd 1000 wave s .
I
then s t op .
There I s l o t s of r oom f o r i mp rovement
i n S o u nd .
The qua l i t y of t he note c reated
b y t he p ro g r am c ou l d be i mp roved . a nd t he
pr ogram m i ght even be m a d e to p l ay a song .
I dec i ded to drop Sound and w o r k on b u l 1 d 1 n9 /!. Dev i ce D r i ve r f o r t he D/A conve r t e r .
The D e v i ce descr i p t or I w r o te f o r t he
O / A conve r t e r , Beep . i s a l mo s t as s ma l l a s
T he 0 / A con­
a D e v 1 c e O e s c r i p t o r c a n be .
ve r t er ; s not a random access dev i ce so 1
dec i de to use t he S C F f i l e manager to d r i ve
it.
T h e r e a r e no opt i on s except
t he one
byte
wh i ch
i nd i ca t e s
t ha t
it
is
a
SCF
dev i c e .
T he r e a r e t h ree addre s s e s
i n t he
des c r i p t o r .
N o r ma l l y
a
desc r i p t or
onl y
needs one por t a d d r e s s . bu t
i n th i s cas e .
s i nce
t he t hr e e addresses used
i n m ak i ng
t he D / A conve r t e r make sound a r e n ' t r e l a t ­
ed , I
i nc l uded a l l t he addre s s e s e x p l i C i t ­
l y.
The
D ev i ce D r i ve r .
ca l l ed
Beepe r .
is
not
l nterrupt
d r l ve n .
Mos t
05-9
dev i ce
d r i ve r s u s e i nt e r r u p t s to g i ve t hem a way
to avo i d w a i t l oo p s . bu t I cou l d n ' t f i nd a
way
to g e t t he O / A conve r t er
to gene r a t e
I n t h i s c a s e i nt er r u p t s we r ­
l n ter r u pt s .
e n ' t nece s s a r y ; t he dev i ce responds a s f a s t
a s da t a c a n b e pumped i n t o i t .
.
The i n i t i a l i z a t i on e n t r y pu t s s ome va l ­
ues t n a t w i l l b e needed i n t he t e rm i n a t i on
r o u t i ne
i nt o
dev i ce
stat i C
s t o rage ,
and
s e t s t he t wo P I A r eg i s t e r s t ha t need t o b e
a d j u s t ed t o pe r m i t sound t o be made .
T he
t e rm i na t i o n e n t r y set s t he t wo con t r o l reg1 sters DaCk t he way t hey were b e f o r'e Beeper
s t a r t ed .
and
t he
Ge t S ta t
a nd
P u t St a t
en t r i es don ' t do a n y t h i ng a t a l l .
The read
a nd wr i te ent r i e s de a l w i t h the f a ct t h a t
t he O / A conve r t e r o n l y u s e s t he h i gh-o rder
82
OS - 9 Use r N o t e s Vol ume
I
six
bi ts
of
t he
reg i s t e r
it
is
acce s s e d
t h rough .
I NSTALLAT I ON OF BEEP/BEEPER
Beep and Beeper have t o be t yped i n and
a s s e mo l ed .
As
usual ,
t he
USE
s t a t emen t s
be t ween the I F P l a nd E NO C don ' t come ou t i n
t he
a s s emb l y
l i s t i ng .
You
wi l l
have
to
i nc l ude u s e s t a t ement s f o r b o t h O S 9D E F S a n d
SCFDEFS
f or
t hese
p ro g r a ms .
When
you
a s s e mb l e t he Beeper f i l e i t w i l l gene r a t e a
file
in
t he
exec u t i o n
di rectory
ca l l ed
Beeper w i t h bo t r Beep and
05-9
To u se beeper
command l i n e :
f i r st
Beeper
l oa d
in
it
it.
w i th
the
OS9 : l o ad b e e p e r
t he n
l i nk Deeper w i t h t he command
l i ne :
OS9 : l i nk b e ep e r
S i nce beeper
i s th e
h a v e II
f i l e i t wi l l
i f y o u do n ' t l i n k i t .
As
out O f
/Beep .
s econd modu 1 e
; n t he
tendency to d i sappe a r
a f i r s t t r y you c a n g e t a l ow g r o w l
you r compu t e r b y l i s t i ng a f i l e t o
!
used
OS9 : l i s t b e e p e r > / b ee p
To get a m o r e i n t e re s t i ng sound o u t o f
t he dev i ce you w i 1 1 n e e d to f ee d j t mea n ­
i ngf u l
da t a .
T he B a s l cOS
p r og r a m c a l l ed
T e s tBeep gene r a t e s a t housand byt es of s i ne
wave .
Tes t B eep
is
i n 't enoed to be pack ad
and run out of t he ex ecut i on d l r e c t o r y .
If
it
1S
run f rom s o u r c e t he B Y E s ho u 1 d be
removed . I t takes a l o ng t l m e to i n i t i a l i ze
t he a r r a y . so be pat i ent .
T he wave can be
s e n t one byte a t a t i me w i t h a l oop l i ke :
I - I t o 1000
put #s oun d . no t e ( I )
next I
f or
B u t O S - 9 doesn ' t do v e r y we l l at o u t p u t t i ng
a s i ng l e c ha rac t e r at a t i me .
Thi s program
segment demons t ra t e s t ha t b y gene r a t i ng a
l ow , ra spy note .
To get a h i ghe r . smoo t h e r
note I sent t h e e n t i r e t housand - b y t e a r r a y
w i t h one wr i t e .
T he q ua l i t y o f
t he t o ne
st i l l 1 eaves II l o t to be des i red , b u t i t ' s
t he best I cou l d do qu i c k l y .
APPL I CAT I ONS FOR /BEEP
I
i mag i ne t ha t the t i mb re of t he t one
gene r a t ed by T e s t B eep cou l d be i mp r oved by
spend i ng more t i me w i t h t he wave f o rm : t he
Cer­
rough s i n wave 1 use i s p r e t t y c r ude .
ta i n l y t he p i t c h c a n b e v a r i ed b y chang i ng
t he f requency of
the wave .
I
d i seove r e d
t ha t Tes tBeep j us t a s i t s ta n ds i s a u s e f u l
demons t r at i on o f O S - 9 ' s mu l t , t a sk i ng be h a v ­
i or .
I s t a r t ed T e s t B eep w i t h t he command
1 i ne :
OS9 : BAS IC09 Tes t Be ep&
if
you
have
RUNS
OS9 : Tes t B e ep&
wil l
wor k
f i ne
background
r an
a
var i et y
not i ced
If
t ha n
do i ng
t he
you
in
t he
i sn ' t
get
of
t he
i n m i nd
stat i c
as
a
s t ar t e d ,
I
p r o g r am s
code .
a hd
sound .
gene r a t e
ou t
in
ha ve
dev i ce
t he
p r og r am
no i se
d i f f e re n t
on
to
work
t he
t he
a
THE USERS GROUP
h i gh e r
B ee pe r ,
d e v i ce
is
to
I
p i tch
sugges t
d r i ve r .
add
s t o r age
a
f or
hope
T he
Users
buf f e r
t i me
B e e pe r .
of
Beeper
rece i v e s a reque s t
to
wr ; te a
va l ue i t w i l l
l oad t h e ne x t 256 b y t e s
w r i t t en
Beep
can
I
of
want
more
runs
When
e f f ec t
you
app r oa c h
When
zero
Thi s
task .
l nt o
be i ng
wi l l
t he
bu f f e r .
l oa d e d ,
i nd i c a t e
each
a
When
v a l ue
number
of
t he
group
you
you
d i sk .
read
wi l l
1
al l
am
ha ve
to
Some
of
t i mes
to
have
i n c l uded
send
t he b u f f e r
out
the
CiA .
1 b e l i eve
t ha t t h i s a p p r oa c h w i l l
prove to b e r e a l l y
usef u l ,
espec i a l l y
if
t he r e
is
a
d ef a u 1 t
wave
l o aded
i nt o
t he
bu f f e r
by
t he
I NI T
but
you
I
t he i r
am
rece i ve d
respons i b l e
wr i t t e n
t he
memb e r s
have
thl S .
have a ny record
a n d f o r ma t ) a n y
buffer
t he
wi l l
of
of
peopl e
t he
our
who
afra i d
t he
for
t he
05-9
by
t ha t
w r o ng
th i s .
t he
some
t yp e
We
of
don ' t
t ype of d i sk
( s i ze
ear l y membe r s use .
have
i nf o r m a t i on
i n m o s t cases I
g e t a d i sk you
of
d i sks
j o i ne d
abou t
recent l y
t he i r
d i sk ,
ha ve had t o gues s .
If
can ' t dea l
w i th.
wr i t e
t o t he U s e r s Group a d d re s s , a n d
t o ge t you a d i s k you c a n r ead .
we
wi l '
try
SOUND
M i c roware OS-9 Ass emb l er 2 . 1 02/ 1 5/84 03 : 00 : 48
Page 001
Sound - Sound generator f or C oC o
nam Sound
0000 1
t t l Sound generator for CoCo
00002
IFPl
00003
ENDC
00005
SET PRGRM+OBJCT
TYPE
00006 00 1 1
MOD ENDSND , NAM, TYPE , REENT+ l , ENTRY , DS IZE
00007 0000 87CD0065
RMB 2
CNTL
Addr ess of DIA contr o l r eg i s t e
00008 D 0000
CNTL2
RHB 2
Address of another D/A c on t r o l
00009 D 0002
RHB 2
PORT
Addres s of D/A input
000 1 0 D 0004
RMB 2
CNTR
Number of wa v e s t o s end
000 1 1 D 0006
RMB 1
CNTLV
Ini t i al val ue of f i r s t Cont r o l
00012 D 0008
Ini t ia l va lue o f other c ont rol
CNTL2v RMB 1
0001 3 D 0009
STACK
RMB 200
0001 4 D OOOA
EQV
DS IZE
000 1 5 D 00D2
FCS i SOVND/
0001 6 OOOD 534F554E NAM
EQV
ENTRY
000 1 7 001 2
********* ** >1:'1,
0001 8
* Ini t ia l i ze addr e s s e s i n l ocal s t orage
0001 9
*
00020
LDD I $FF23
0002 1 0012 CCFF23
STD tNTL
00022 00 1 5 DDOO
LDD 1!$FF20
00023 00 1 7 CCFF20
STD PORT
00024 00 1A DD04
LDD I/SFF03
00025 OOlC CCFF03
STD tNTL2
00026 OO lF DD02
*****,* ,� ****
00027
'*
Save i n i t i a l va l ue s of c ontrol reg i st ers
00028
* and set them to route D/A out put t o s ound
00029
'*
00030
LDA [CNTL , U]
00031 002 1 A6D4
STA CN TLV
00032 0023 9708
ORA
08
00033 0025 8A08
CNTL U]
STA
00034 0027 A7D4
LDA
CNTd , V]
00035 0029 A6D8 02
STA CNTL2V
00036 002C 9709
ANnA tf$FF-S08
00037 002E 84F7
STA
CNTL2 , V]
00038 0030 A7D802
*** ,', *,* * ,*,* * * *
00039
'*
Ini t i a l i ze the coun t er
00040
'*
00041
LDD � 1 000
00042 0033 CC03E8
NTR
STD
0001+3 0036 DD06
*** * *** ** *
00044
* Send waves
00045
'*
00046
LOOP2
0001+7 0038
LDA tl o
00048 0038 8600
"
r
C o l umn Th i r te e n
83
05-9 As s emb l e r 2 . 1 02/ 1 5 / 8 4 03 : 00 : 55
- S ound generator f or CoCo
M i c r owa r e
Sound
00049
:10050
G005 1
00052
0005 3
00054
00055
00056
0005 7
00058
00059
00060
0006 1
00062
00063
00064
00065
00066
00067
00068
00069
00070
0007 1
00072
00073
00074
00075
00076
00077
00078
00079
00080
0008 1
00082
00083
00084
00000
00000
"065
';D2
':: F8
Page 002
,I( ,� * * * ,'r * 'i( * * *
Send each wave
003A
LOOP 1
003A A70804
STA
ORI . U]
0030 8B04
ADOA I
003F 1 2
NOP
0040 1 2
NOP
0041 1 2
NOP
0042 1 2
NOP
0043 1 2
NOP
0044 1 2
NOP
0045 1 2
NOP
0046 1 2
NOP
0047 1 2
NOP
0048 8 1 00
CMPA 110
004A 26EE
BNE LOOP 1
* * * ,'r** *,'r*
*
End o f s endi n f one waVe .
See i f we s t i 1 need t o s end more
LOO CNTR
004C OC06
SUBO � l
004E 8 30001
005 1 0006
NTR
SID
0053 26E3
BNE LOOP2
,'r * * �<** ,� * * *
,
Res t o re i n i t i al values t o c on t r o l r eg i s te u
0055 9608
LOA �NTLV
STA
CNTL , U]
005 7 A704
0059 9609
LOA �NIL2V
SIA
005B A7D802
CNIL2 , U]
005E 5 F
CLRB
c l ear carr
005F 1 03F06
r eturn t o OS - 9
OS9 F$EX I T
£MOD
0062 528069
0065
ENDSNO EQU
error (s)
warni ng ( s )
00 1 0 1 program bytes generat ed
002 1 0 dat a byt es a l l ocated
03832 byt es us ed f or s ymb o l s
*
,'r:
J
*
'*
.,
,,;'�
'I:
BEEPER
�i croware OS-9 As s emb l e r 2 . 1 02/ 1 5 /8 4 02 : 59 : 46
Page 00 1
BEEPER - OS - 9 Sys t em Symb o l Oe f i n i t i ons
00001
NAM BEEPER
I FP 1
00002
00006
ENDC
00007
BEEP
USE
Devi ce Des c r i p t o r
TTL DEV ICE DESCR IPTOR
00008
NAM BEEP
00009
000 10 00F1
TYPE
SET DEV I C+OBJCT
0001 1 0000 8 7C00027
MOD BPEND, BPNAM, TYPE , REENT+ 1 , FMNAME , OR VNAM
000 1 2 0000 03
FCB READ . +WR ITE . MODES
FCB $FF , $F F . S20 PORT ADORESS
0001 3 OOOE FFFF20
000 1 4
fCB OPTL
00015 001 1 0 1
Length o f opt i on s s e c t i on
OPTIONS EQU *
00016 0012
0001 7 0012 00
FCB DT . SCF
00018 0001
EQU *-OPTIONS
OPTL
000 1 9
00020 0013 FF23
FOB $FF23
CNTLl
addres s of c ontrol byt e 1
0002 1 0015 FF03
CNTL2
addr e s s o f c ont r o l byt e 2
FOB $FF03
00022 001 7 42454500 BPNAM
FCS ! BEEP/
name o f thi s modu l e
00023 001B 5343C6
FMNAME FCS Iscr/
F i l e Manag e r name
00024 001E 42454550 DRVNAM FCS /BEEPER/ Devi ce drlver
name
00025 0024 58AEA3
£MOD *
00026 0027
EQU
BPEND
00027
TTL DEV ICE ORI VER FOR D/A
84
05 - 9 U s e r N o t e s Vol ume
I
OS-9 As s emb l e r 2 . 1
BEEP - DEV I C E DR I VER FOR D/A
M i c r o wa r e
00028
0 0029
00030
0003 1
00032
0 0033
0 0034
00035
0 0036
00037
0 0038
0 0039
0 0040
0004 1
00042
00043
0 0044
00045
00046
00047
0 0048
0 0049
0 005 0
0005 1
00052
0 0053
00054
00055
00056
0 00 5 7
00058
00059
00060
0006 1
00062
00063
0 0064
0 0065
0 0 066
0 006 7
0 0068
0 0069
00070
0 00 7 1
00072
00073
00074
00075
00076
00077
00078
0 2 / 1 5 / 8 4 02 : 59 : 5 0
00E 1
TYPE
SET
REVS
008 1
SET
0 00 0 87CD0076
MOD
OOOD 03
FCB
OOOE 4 2 45 4 5 5 0
BPR�AM
FCS
0014 01
FCB
******* * * * * ****
* Dev i c e S t a t i c s t o ra g e
Page
002
DR I VR+OBJCT
R EENT+ 1
BPREND , BPRNAM , TYPE , RE V S , ENTER , MEMS IZE
R EAD . + WR I TE . DR I VER MODE
/BEEPER/
1
EDI T I ON
,�
D 0010
ORG
V . SCF
** *********
* L o c a l p a r t o f s t a t i c s t o rage
Sys t em p a r t
of
S t a t i c S t o ra g e
i,
D
D
D
D
D
D
001D
PORTA
C'fL 1 V
CTL2V
CTL 1A
CTL2A
OO l F
0020
002 1
0023
0025
0015
W OO l S
W 001 8
W 00 1 B
W OOIE
W 002 1
W 0024
HEHS I ZE
* * >� * *''r. * ****''r.
* Ent ry v e c t o r s
*
ENTER
1 6 000F
1 6 002C
1 600 3 1
1 6003E
1 6 003B
1 6003A
0027
RMB
RMB
RHB
RMB
RHB
EQU
LBRA
LBRA
LBRA
LBRA
LBRA
LBRA
2
I
1
2
2
P ORT
HOLD
HOLD
HOLD
HOLD
ADDRESS
CNT L I VAL
CNTL2 VALUE
CNI L l ADDR
CNTL2 ADDR
INIT
READ
WR I TE
GETS TAT
PUTS TAT
TERM
INIT
* ''r.**** ,�
*
*
*
U ADDR E S S
OF DEV I CE S TAT I C S TORAGE
Y ADDRESS OF DE V I CE DE SCR I P TOR MODULE
0027
002A
0 020
002F
0032
0034
AEA8 1 3
AFC8 2 1
A684
A7C8 l F
8A08
A784
LDX
S TX
L DA
S TA
ORA
STA
0 0 36
0039
003C
0 03E
0041
0043
AEA8 1 5
AFC8 23
A68 4
A7C8 20
8 4 F7
A784
LDX
STX
LDA
S TA
ANDA
S TA
0045 5F
0046 39
CLRB
RTS
CNTL I , Y
CT L 1 A , U
,x
CTL I V , U
#S08
,x
CNTL2 . Y
CTL2A , U
G e t c on t r o l addr e s s l o u t o f D
S ave t h e a d d r e s s
Ge t t h e p r e s en t v a l u e o f c n t l
s aVe i t f o r l a t e r r e s t o r e
s et i t f o r s ound
d o t he s ame s t u f f
for cnt 1 2
,x
CTL2V U
ItSFF- $ 08
,X
C LEAR CARR Y
RETURN
C o l umn Th i r t e e n
85
� i c r oware OS-9 As s emb l e r 2 . 1
5 EEP - DEV I CE DR IVER FOR D/A
00079
00080
0008 1
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00 1 00
00 1 01
00 1 02
00 1 03
00 1 04
00 1 05
00 1 06
0047
C" : 07
(! t:;3
C
:; :,<
005 F
005F
005F 5 F
.
(
.
., � O
I� J l l 1
00 1 1 2
001 13
001 1 4
00 1 1 5
0 0 1 16
001 1 7
001 1 8
001 1 9
00 1 20
00 1 2 1
00 1 22
Page 003
READ
* U ADDRESS OF DEV ICE S TATI C STORAGE
,� Y ADDRESS OF PATH DESCR I P TOR
0047
0049
004B
004C
004D
004E
004F
004F
005 1
0052
0053
0055
0057
0059
005B
005D
005E
* RETURN CHARACTER READ I N A
*
AE4 1
A684
44
44
5F
39
LDX
V . PORT , U
LDA
,x
LSRA
LSRA
CLRB
RTS
p o r t addr e s s f r om dev i c e d e s c r
D/A va l ue
Sh i f t out l ow order b i t s
C l ear c a r r y
WR I TE
* * * ,�* ***
* U DEV I CE STATI C S TORAGE
* Y PATH DESCR I P TOR
*
*
A
VA LU E TO WR I TE
AE4 1
48
48
3402
A684
8403
AAEO
A784
5F
39
0060 39
006 1
LOX
LSLA
LSLA
PSHS
LDA
ANDA
ORA
STA
CLRB
RTS
GETSTAT
PUTS TAT
V . PORT , U
A
X
l!% 000000 1 l
, S+
,X
Shi f t out high order b i t s
s ave va l ue t o wr i t e
Ge t c u r r ent val ue a t P o r t
c l ear D / A va l ue
put v� l ue t o wr i t e i n
s end l t
RETURN
CLRB
RTS
TERM
*,� **** * *
* U DEV I CE S TATI C STORAGE
*
006 1 AEC82 1
0064 A6C8 1 F
0067 A784
0069 AEC823
006C A6C820
006F A784
007 1 5F
0 0 7 2 39
0073 A 1 82B 1
LDX
" LDA
STA
LOX
LDA
S TA
CLRB
RTS
EMOD
E QU
00 1 23
00 1 24 0076
BPREND
00000 e r r o r ( s )
00006 warn i ng (s )
$009D 00157 program byt e s generat ed
$0008 00008 data byt e s a l l oc a t e d
$ 164B 05707 byt es u s ed for s ymb o l s
TESTBEEP
PROCEDURE TESTBEEP
DIM NOTE ( 1000) : BY TE
DIM I : INTEGER
DIM SOUND : INTEGER
OPEN ttSOUND " /BEEP" : WR I TE
FOR 1 " 1 TO l 000
NOTE ( I ) -32* ( 1 +S IN ( I »
NEXT I
FOR I - I TO 100
PUT tISOUND , NOTE
NEXT I
BYE
86
02 : 59 : 58
02 / 1 5 / 8 4
05 - 9 U s e r N o t e s Vo l ume
I
CTLlA, U
CTLlV , U
,X
CTL2A , U
CTL2V , U
,X
*
r es t ore o r i g i na l Cnt l 1 va l ue
r e s t o r e o r i gi n a l Cnt 1 2 va l u e
c l ear c ar ry
COLUMN FOURTEEN
MORE ABOUT THE COCO D I SK DR I VE R
A f t e r i n send i ng l as t mon t h ' s c o l u m n I
had second t ho ug h t s about what I sa i d about
t he 0 5 - 9
d i sk
dr i ver
for
t he
CoCo .
I
d i dn ' t be l i ev e what
I
had w r i t t en .
The
g i s t of what I sa i d was t ha t M i c r ow a re and
M i c ro sof t t og e t he r were t o b l ame f or t he
non - s t a nda r d d i s k dr i ver i nc l uded w i t h t he
CoCo 0 5 - 9 .
T he boot ROM i n t he CoCo l oa ds
j u s t 1 5 s ec t or s f rom t rack 34 on t he boot
d i s k i nt o set l oc a t i on s i n memory and j umps
t o t hem .
Th i s
i s M i c r o s o f t ' s i dea of a
n i ce w a y t o boot a compu ter .
What I s a i d
l a s t mo n t h wa s t ha t M i c roware managed t o
squeeze a l l o f 0 5 -9 i n t o t ho se 1 5 s ec t o r s
Th i s
b y extens i ve compr e s s 1 0n o f t he code .
sou nded pret t y ext reme t o me , bu t I t hought
t ha t was wha t I had heard f rom Ken K ap l a n
o u t a t M i c rowa re .
L a t e r , I became c e r t a i n t het I m i s u n­
der s t oo d Ken .
T here i s no way a l l t he core
res i dent p ar t s o f 05-9 c ou l d be s queezed
i nt o that amount of d i s k , and , i f a l l of
0 5 - 9 was l oeded b y t he ROM boot , Why dOes
t he CoCo have a two s tage b oo t ?
1 c a l l ed M i croware t o check my f ac t s .
r was IoI r o ng .
I n t he f i r s t s tage o f t he
boot t he CoCo ROM does l oad d a t a f rom 1 5
sec t o r s o n t rack 34 i n t o memo r y and j ump t o
i t , but on l y a f e w i mp o r t ant pa r t s of O S - 9
a r e l oaded :
t he kerna 1 ,
t he I n 1 t modu l e ,
T hese a r e t he mod­
and t he O S - 9 b oo t s t rap .
ul es t ha t are f ou nd i n ROM on o t her O S - 9
s y s t ems .
The n e x t s t age o f t he boo t u s e s
t he 0 5 - 9 boo t s t ra p wh i ch was l oaded i n t he
f i r s t p a s s to do a norma 1 O S - 9 boo t .
The
pa r t s of 0 5 - 9 l oaded i n t he f i r s t phase of
t he boot had t o be squeezed hard , b u t much
of t he d i s k d r i ve r i s l oaded i n t he second
pha se of t he boo t .
There were a number of ways f o r M i c r o ­
wa re t o ge t a f u l l - f e a t u red d i s k d r i ver
i nt o
t he
CoCo ,
but
t he y
di dn' t .
The
r e s t r i c t i on s on t he f i r s t phas e of t he boot
f orced t hem to dev i a t e f rom OS-9 s t andards
i n t he boot modu l e p a r t of the d i s k d r i ve r .
I
be l i eve t hey c ou l dn ' t f i nd a
way
to
i n t e r e s t T a nd y i n t he e x t r a work ( a nd memo­
r y ) requ i re d to d i s c a r d t he boot a f t e r i t s
work was done and l oa d a d r i ve r t ha t wor ked
i ndependent l y .
That
I s cer t a i n l y r ea s on ­
ab l e .
Why s ho u l d Tandy be i n te r e s t ed i n
mak i ng i t e a s y f o r peop l e t o u s e non-Tandy
pe r i phera l s?
1 n a n y c a se ,
t he prob 1 em seems to be
s o l ved .
O.
P.
vohnson
is
a dv e r t i S i ng
sof tlolare
that
l et s CoCo O S - 9 dea l
loI i t h
every d i sk f o r ma t m y G i m i x can hand l e .
I
haven ' t
t r i ed h i s sof t ware ,
bu t
I
have
I a l s o own
hea r d f rom s a t i sf i ed c u s t omer s .
a 256K memory board made by D a n Johnson .
r
purchased one of t he f i r s t boa r d s he s o l d
a nd had t he k i nd of d i f f i cu l t i es one m i gh t
expec t .
I
came
t o respect D a n Johnson
wh i l e we s t r u gg l ed
t o ge t her
to f i x
t he
He i s gocd
prob 1 ems wh i ch I d i scovered .
w i t h hardware and sof t ware and VE R Y conSC i ­
ent i ou s .
I c an ' t recommend t he s o f t w a r e
because
haven ' t t r i ed i t { ye t ) .
do
recommend t he man w h o s e l l s i t .
WHERE NEXT?
1 have two very d i f f e re n t O S - 9 s y s t em s ,
a very l a rge G i m i x Leve l T w o s y s t em a n d a
CoCo .
T hey
fa l l
at
a l most
oppo s i t e
e x t r emes of t he s pec t rum of m i cr ocompu t e r s .
T he CoCo i s so l i gh t and s ma l l t ha t I t h i nk
n o th i ng of
tuck i ng
i t under my arm and
T he G i m i x
wa l k i ng a m i l e down t o camp us .
i s s o heavy t ha t
am dau n t ed b y t he
t hought of mOV i ng that s ta c k o f hardware
even a few f eet .
T he C oC o can ' t re a l l y
hand 1 e more t ha n one conc u r re n t u s e r .
I
r out i ne l y have t wo u s e r s on my G i m i x and
k now peop l e whose G i m i x mach i ne s t yp i ca l l y
serve f ou r o r more conc u r rent u se r s .
T he
C oCo i nc l u d e s f u l l g raph i CS a n d a " te rm i ­
n a l " p r ot o c o l w h i ch i s cons i s t en t ac ros s
a l l CoCos .
Th i s i s a b i g i ss u e f o r o t he r
O S - 9 u s e r s , par t i cu l a r l y s o f t wa r e deve l op ­
e r s w h o have t o w r i te p rograms w h i ch can be
conf i gured f o r any t e rm i na l .
Not i ng t he s i m i l a r i t i e s and d i f f erences
between these comput e r s has g i ve n me a l o t
of i deas about t he k i nd of hardware I w ou l d
1 i ke t o see O S - 9 runn i ng o n .
I i mag i ne a l l
comput e r u s e r s
spend some t i me d rea m i ng
abou t t he s y s tem t he y wou l d have i f on l y . . .
My dream compu t e r i s a cer so na l compu t ­
e r , o r , t o u s e t he popu l a r phr a se , a per ­
s ona l work s ta t i on .
I have g r o wn u se d t o
t he i de a o f 0 5 - 9 leve l Tlolo a s a mu l t i - us e r
opera t i ng s y s t em ,
bu t I
s t i l l prefer t o
t h i nk O f i t a s a v e r y powe r f u l S i ng l e - u s e r
s ys t em .
S h a r i ng compu t e r s i s a way to save
money .
When I i mag i ne t he compu t e r I w ou l d
l i k e , I don ' t cons l de r money f i r s t .
N a t u ra l l y , my dream compu t e r runs O S - 9
Leve l Two . I t i nc l udes a b i t -mapped s c reen
( co l o r opt i on a l ) , severa l ded i ca t ed proce s ­
SOl'S ,
supp o r t
f or
some
g r ap h i cs
i np u t
dev i ce ( I haven ' t chosen be t ween a b i t pad ,
a mou se a nd a l i ght pen ) , and more thaI'!
p l enty of memory .
Many peop l e seem to t h i nk t ha t 1 28K 1 s
t he r i ght amount t o run 0 5 - 9 level Two 1 n .
Now you CAN r u n Leve l Two i n even l es s , b u t
y o u don ' t r ea l l y apprec i a t e i t u n t i l you
get t o a t l ea s t 1 9 2K .
My d ream mac h i ne
w ou l d
have
at
l ea s t
1 9 2K upgradab l e
to
256K ,
bet t e r s t i l "
5 1 2K .
There a r e s o
many u ses f o r memor y !
S o l i d state d i sk
d r i ves or caches g 1 ve be t t e r access t i mes
t ha n hard d i s k s b u t u s e a l o t o f memory .
C omp l ex prog rams can t a k e l ot s of memo r y ,
bu t , when t hey a r e wel l w r i t t en , t hey a r e
powe r f u 1 and easy t o u s e .
Somet i mes l ot s
of memory i s needed f o r s i mp l e s t o r a ge o f
data .
1 k now a woman w h o keeps runn i ng o u t
of space f o r her spr� a d sheet on a n I BM P C .
She h a s abou t 600K !
So 1 e t s put l ot s o f
memory i n t he dream mach i ne .
Graph i cs hardware i s never good enough .
A t any rate t ha t ' S t he way 1 r e a c t to 1 t .
I f t he reso l u t i on a n d t he number o f c o l o r s
i s s uf f i c i en t , t he s creen t a ke s t oo l on g t o
I f d a t a i s d i sp l ayed b y f us s i ng
u p da t e .
w i t h parameter
l i s t s a n d reg i s t er s ,
t he
s y s tem i s t oo 1 i m i t ed .
I f t he s creen i s
b i t - r.lapped ,
it
takes
t o o much a t t e n t i o;;
f rom t he CPU t o con t r o l t he s c reen .
The
bes t 15 0 1 u t i on seems t o b e t o h a v e a s ep a 5
Of c ou r s e . w i th t ha t much RAM you
ex t r a h i gh-capaC i t y d i s k !5 to save
you ' re work i ng on .
Co l umn F ou rt e e n
need
wha t
87
r a t e p r oce s s o r t ha t de a l s w i t h a b i t -mapped
o i s p l ay .
If t he graph i cs processor has a
very h i gh speed connect i On t o t he rest of
t he s y s t em ,
and can be dynam i c a l l y pro ­
a r ammed t o do m o r e t ha n j u s t upd a t e t he
; c reen , t he res u l t s hou l d be speed and
f l e x i b i l i t y i n g r aph i c s .
T he r e i s use f o r more t ha � one spec i a l
proce s s o r i n my d ream compu t e � .
I f graph­
i c s suppo r t i s i nc l uded i n t he package . i t
wou l d be f oo l i s h t o r e qu i r e a t e r m i na l t o
b e a t t ached t o t he compu t e r ; a n a t tache d
k e yb o a r d wou l d b e s uf f i c i en t .
A ded i ca t ed
processor to scan t he keybo a r d wou 1 d t a k e
T he
a no t he r l oad o f f t he rna i n p rocessor .
o t he r I / O dev i ce s c ou l d a l so use t he i r own
p r oc es s o r s .
My G i m i x u se s a 6809 o n one of
i t s se r i a l cards t o take some of t he i nt e r ­
rupt
l oa d
off
t ne
ma i n
p r ocessor .
It
speeds my mach i ne up a l i t t l e . but doesn ' t
have any o t he r u s e .
I f t he sof t ware f o r
t he 1 /0 p r oce ssor wa s l oaded ( an d r e l oaded )
by t he ma i n pr Oce ssor
i t wou l d l e t the
se r i a l board be progr ammed t o hand l e h i gh­
speeo ne t w o r k s a nd o t he r a pp l i ca t i ons where
t i m i ng i s i mpor t a n t .
E ven d i sk con t r o l l e r s
cou l d u s e t he i r o w n spec i a l proces s o r s .
I
d on ' t know of a ny progr a mmab 1 e d i sk con­
t r o l l e r s t hE'\" ' cou l d do f o r d i s k I / O what
smart s e r i a
cards has done f o r t e r m i na l
I / O . The G i m i x i n t e l 1 1 ge n t s e r i a l c a r d con­
t a i ns a good pa r t of S C FMAN .
B y u n l oad i ng
t h i s work o n t o a spec i a l
processor more
eye 1 e s a re I ef t for user p r og r a ms . RBFMAN
i s more comp l i ca te d t ha n S C F MA N a n d u ses
more C P U t i me ,
If most o f t h a t work cou l d
be done by a sepa r a t e p ro ce s s o r s t i l l more
of
the
resources
of
t he ma i n p rocessor
wou l d be a va i l ab l e tor t he u s e r .
I n f act . why t a l k abou t t he ma i n pro­
cessor?
I n many cases O S - 9 p r ocesses don ' t
sha re memory w i t h one a n o t he r .
If
t he
dream compu t e r had a bus where a dd i t i ona l
p r oces sor boa rds w 1 t h s ome memo r y and per ­
haps I / O cou l d be i ns e r ted . 05 - S cou l d ru n
i ndependent pr ocesses o n t he i r o w n proce­
dures .
Mos t per sona l
work s t a t i on u s e r S
Clon ' t n e e d t o r u n more t ha n t h r ee o r f ou r
proce s s e s a t III t i me . s o i nC l ud i ng many o f
w h a t amoun t s t o separ a t e comp u t e r s 1 n t he
package wou l d be wastef u l . B u t , 1 f t he pow­
er
is
a va i l ab l e
t he
app l i ca t i on s
wi 1 1
a r r i ve .
M i ce a r e mak i ng a b 1 g sp l as h t hese
Clays .
T he X e r ox Star , t he A pp l e MaC i n tosh
and L i s a . and 1 0 t e of more expens i ve work
s ta t i ons a re us i ng t hem .
I wou l d def i n i t e ­
I have
l y P 1 c k a mouse over a j oy s t i ck .
more t roub l e deC i d i ng t ha t a 1 i 9ht pen or
g r a P h i cs pad i s n ' t a be t t e r t o o l
than a
mou s e .
T he graph i CS pad i s very preC i s e
and t he s t y 1 us can be u sed about 1 i k e a
mouse .
T he a r guments a g a i ns t graph i cs pads
are t ha t they are expen S i ve , requ i re deSK
space , a n d ,
f or some app l i ca t i ons , f orce
t he person u s i ng t hem to menta l l y map f rom
t he b i t pad t o t he s c r een .
T he cos t p r oo ­
l em I w l 1 1 i gnore - - af t er a l l t h i s i s a
dream compu t er .
T he o t he r
t wo prob l ems
A l i gh t pen doesn ' t
app l y to m 1 ce as we l l .
requ i re desk space o r a men t a l mapp i ng . ou t
I don ' t f i n d t he m v ery prec i se and my hand
obscures t he sc reen when I am po i n t i ng .
!
can ' t make up my m i nd .
A
f a ncy computer
l i ke t h 1 S deser ves
f ancy sof t w a r e .
T he peanu t - bu t t e r and J e l ­
l y progr ams now ava i l ab l e f or O S - 9 J us t
don ' t l i ve up t o the hardwa r e .
SS
O S - 9 U s e r Notes Vo l ume I
My pet peeve w i t h 0 5 - 9 s o f t wa re h a s
a l ways b e e n i � s l a ck o f exce l l en t e d i t o r s .
I 1 i ke Dyna s t a r f i ne . a n d I have hea r d n i ce
t h i ngs about S c r ed i t o r and S t y l ograph , but
t he s e p r og r am s a re at
l ea s t
f i ve
yea rs
beh i nd
t he
s t a t e - o f - t he - a r t .
My
dream
mach i ne deserves s ome t h i ng spec i a l .
D o you
s uppose E M A C S c ou l d be po r t ed t o 0 5 - 9 7
A r e a l da t abase program w ou l d b e n i c e .
Some t h i ng more t han a f i l i ng cab i net or
s t a c k of i ndex cards metapho r .
b e t K nu t h ' s TeX w ou l d r u n on some­
t h i ng l i k e t h i s .
Some good g r aph i c s pro­
g ra m s , e spec i a l l y a g raph i cs e d i t o r w ou l d
make t he g r ap h i cs suppor t a l ot more use­
ful .
A r e a l s t at i s t i ca l p r o g r am I 1 k e S A S ,
o r S P S S wou l d make some peop l e happy .
Oth­
e r s need r e a 1 1 Y good commun i ca t 1 0n s sof t ­
Ware .
L a nguages a r en ' t as
i mp o r t a n t as t he
sof t wa r e w r i t t e n i n t hem , b u t 0 5 - 9 i s s t i l l
pa i nf u l l y s ho r t o f l a nguages .
I be t A P L
wou l d r u n w e l l under O S - S .
Fortran i s ol d
f a s h i on ,
but
we
rea l l y
s hou l d have
it .
Those a r e t he f u ndament a l
l a nguages ,
but
t he r e i s a n e n d l e s s l i s t , i nC l ud i ng : P i l o t .
P L / 1 . Logo , Sma l l ta l k . a n d o t he r s .
Ne t w o r k i n9 i s ano t he r sexy 'top ; c t he s e
days .
E xpens i ve compu t e r s ( wh i ch my dream
mach i ne i s t u r n i ng out to be ) a r e genera l l y
used b y peop 1 e f o r whom commun i c a t i on ; s
t e r r i b l y i mpor t an t .
E l ec t ron i c ma i l . e l ec­
t ron i c c a l e nda r s . ane shar i ng o f f i l es and
other
resources
are
i mpo r t an t
to
t hem .
0 5 - S does n ' t
i nc l ude networ k i ng s o f t wa r e ,
but I t h i nk i t w i l l be a t l ea s t as easy t o
r u n ove r a net wo r k a s a ny o t he r ope r a t i ng
s y s t em .
E nough
of
t he
dream i ng .
T ru l y ,
my
I /O
dream mach i ne i s not so very f a r away .
am sure more are
p r o c e s s o r s ex i s t . and
com i ng .
I have he2l rd t a l k abou t s l ave pro­
cessors .
T he r e a r e graph i C S boards ava i 1 a b l e f o r t he 5 5 - 50 bus t ha t a r e a l o t l i k e
w h a t I h a v e i n my dream mach i ne .
T he CoCo
comes w i t h b i t mapped g r a ph i cs s t a nd a r d .
F o r my G i m i x
c a n hope f o r I / O and
s l ave p r oc e s s o r s and a bet te r ( a nd l es s
expens i ve ) g r ap h i cs boa r d .
For my CoCo I
c a n a i m l ow a n d hope f o r a d i s k con t ro l l er
w i t h a n onboa r d buf f e r , or a i m h i gh and
l oo k for a rea l Leve l Two s y s t em wi t h a s
mUCh done
i n ha rdware a s pOSS i b l e ( I / O .
soun d . a n d g r a ph i cs ) .
F rom my v i ewpo i n t a s
a Leve 1 T w o u s e r I t h i nk T a ndy w o u 1 d b e
c r a z y n o t t o of f e r a CoCo 101 i t h Leve 1 T wo .
F o r a s o f t wa re pe r s on l i ke me . i t i s f u n t o
t h i n k up l o t s o f t h i ngs t h a t hardware peo­
p l e shou l d do for u s , but t he mos t i mpor ­
t a n t pa r t of any compu t e r i s i t s sof tware .
Some of my sof t wa r e w i sh l i s t w i l l have
to w a i t f o r be t te r ha rdware . i n pa r t i cu l a r
f o r more m emor y .
Much of i t c a n be done
now .
I ha ve done some p r i m i t i ve n e t wo r k i ng
A rea 1 1 Y spec i a 1 da t abase p r ogram
myse 1 f .
o r e d i t o r w ou l d push a 680S ha r d , but m i gh t
b e poss i b 1 e .
I h a ve hea rd f rom peop 1 e whO
a r e � � r k i ng on
l o t s of n i ce t h i ng s f o r
OS-S .
P r e t ty nea r every p i ece o f s o f t wa r e
f o r Ill y d r e a m mach i ne 1 s a proj ect someone
i s work i ng on now .
MORE NO I SE FROM THE COCO
Last
mon t h
I
i nc l uded
D i g i t a l - t o - A na l og
That
dr i ve r
was
app l i ca t i on s .
d r i v er
conv e r t e r
u s ef u l
but
i t
s ound
gene rat i on .
d r i ve r cou l d manage
in
for
d i dn ' t
to
get
Of
c h a r a ct e r s
t h r ough
enough
de l ay
character
waves
5 C F MAN .
to
in
very
make
at
p i tch
my
Of a g u r ­
the d r i v ­
character
OI h e n
a
b l ock
t og e t h e r
t he r e
h i gh -
F o r t u na t e l y ,
t he
onl y
purpose
Cont ro l l i ng
l ab
of
got
1 i t t 1 e car r i ed away w i t h t h e
B E E P ER .
T he p ro g r a m c a l l s
f o r a magn i tude a nd f requency f o r
a wave
( t he numbe r s are o n l y r e l at i ve ) .
The s i ne
w a v e gener a t ed w i t h these numb e r s
i s added
to whatever wave h a s a 1 ready been gene r a t ­
ed .
T he r e s u l t i ng wave i s d i sp l ayed .
If a
Y i s e n t e r ed , t he wave i s l oaded i n t o B E E P ­
E R ' s bu f f e r and a f e w beeps a re s e n t ,
i f an
A i s e n t e red another s i ne w a v e i s p r omp t e d
test
CIA
we l l
t ra � s m i s s i o n
smo o t h .
i mposs i b l e .
mus i c
i sn ' t
conve r t e r .
E v en
t h r o u gh
the
t he
CoCo .
l o w - speed
do
T he
h i gh e s t
w a s s ome t h i ng
goes
for
t he
Th e speed p rob l em w a s n ' t 1 1'1
I t t a k e s a l o ng t i me f o r a
gle,
er ,
is
a
TH I S MONTH ' S DR I VER
e aC h
f r eq u ency
gener a t i ng
for
an
CIA
i ns t r u m e n t s ,
m o t or s .
and s u ch a r e
w h i ch o n l y reQu i re a
a l l f i ne a pp l i ca t i on s
vo l t age t o be changed
i n f requent l y
mos t ,
t i me s
for
a
dr i ve r
and
for
added
to
a n y t h i ng e l s e
and
t he
is
p rogram
t he
ex i s t i ng
wav e ,
ent ered
t h e wave
s ta r t s
over
and
is
w i th
a
if
e r a se d
C l ea n
s l a te .
at
am a f ra i d t ha t
thi s
tes t d r i ver
is
a n o t her
p rogram
t ha t
needs
work .
BEEPER
t ru nc a t e s
numbe r s
grea t e r
t ha !"l 6 3
t o 63 .
I ended l a s t m o n t h ' s CO l u m n w i t h a f e w
s u gge s t i on s f o r w a y s t o m a k e t h e CIA d r i ve r
If
t he s u m of
t he s i ne waves
l oa ded
i n to
B E E P E R ' s bu f f er
; s g r e a t e r t h a n 6 3 at any
po i nt
the wave wi 1 1
be cl i pped
( as
hi-fi
peop l e s ay ) .
It
wo u l d be good
if
T B E E P2
be t t e r
at
10
gene ra t i ng
per
s o u nd .
went ahead and t oo k my
mon t h ' s
AID
d r i ve r d o e s
s e c ond
Th i s
mon t h
I
sugge s t i on s .
This
a pret t y good j oO
of
mak i ng
mus i c .
It
even
makes
n i ce
c ho r ds .
I made t he i mp r o vement I s u gg e s t ed
l as t mo n t h .
I f t he d r i ve r rece i v e s a zero .
i t p l a c e s t he nex t 360 b y t e s s e n t t o i t i n
a s peC i a l bu f f e r .
C h a r a c t e r s t ha t d on ' t g o
i nt o t he b u f f e r c a u s e t h e cont ent s o f t he
b u f f e r to be t r a n s m i t t ed t h rough t h e O I A a
number of t i mes c o r r espond i ng to
t ude of
t he
cha r a c t e r
w r i t t en .
t he m a g n i ­
S i nc e
It
t a k es
a f i xed a m o u n t
of
t i me
to t ransm 1 t
t he bu f f er . each c h a r ac t e r f rom $0 1
to $ F F
wil l
take
a
f i x ed
amount
of
t i me
T h i Iii way e a c h c h a r ac t e r sends a
set d u ra t i on w ha t e v e r t he p i t c h .
At
l ong .
f i rs t
T ha t w a s
used
easy
but
was
to
it
hard
a
to
bu i l d
to
no t e
send .
Of
a
b y t el
buffer
hand l e
1 28
i n BEEPER
a
in.
wave
It
,
when ang l e s
t hey
ml!lke
t r i ed
a
90
mea s u r e d
byte buf fer .
t o s t o r e smoot h ,
A f t er t he bu f f er
used
a re
in
degrees
a r e mea s u red i n r a d i a n s 1 t
i s ha r d
any
i nt ege r s
come
out
eve n l y . )
t he
D
but
I
f ound
it
to
o f f se t
t he
out
t he
ent i re
wav e f o r m
it .
On t h e o t h e r hand I
t o t he g r ap h i C d i s p l a y of
to
ge t
am r a t he r
t he wave­
form.
TH E USERS GROUP
T h i ngs a r en ' t m o v i ng as qu i C k l y f o r t he
0 5 - 9 U s e r s Group as
we hoped
t he y wou 1 d .
We pub l i s hed our f i r s t neOlS l e t t e r ( ca l l ed
MOTO ) m o n t h s ago .
By t he way , i f you a r e a
member and d i dn ' t
rece i ve a copy of MOT D ,
s en d a note to t he U s e r s G r oup .
O u r s y s t em
f o r keep i ng t ra c k of membe rs seems
pretty
r e l i ab l e , b u t i t may have c rack S i n i t .
We
to
I
bet ween 40 t r ack d i s k s wr i t ten by 80 t ra c k
d r i ve s on t wo d i f f e rent manuf a c t u r e r ' s s y s ­
hard
i nd e x
i nt o i t s o l e ng t h d i dn ' t m a k e m u c h d i f f e r ­
ence .
I chose 360 b y t e s a s t h e l engt h o f
t he bu f f er becau se i t
1 s a n ea s y number t o
work w i t h when gene r a t i ng t he wave .
I nter rupts are
dependent
t h i ng s
t o w i pe
r i d of
part i a l
( if
h i gh - p i t c he d t ones i n i t .
got over 1 28 b y t e s l on g . I
reg i s t e r
have
I
a l so g e t p r e t t y
l i k e t he l a s t s i ne
I
am bu i 1 d i ng a n d
work i ng on t he second i s s u e .
The most
i mp o r t an t t h i ng t o mos t membe r s s e e m s t o be
t he SOf t Wa r e e x c ha nge ,
T here
have been a
number
of
p r ob l em s
g e t t i ng
t he
s o f t wa r e
excha nge d i s k s o u t .
T he m o s t
i n t e r e s t i ng
p r ob l em
has
been
a
d i sk
i ncompa t i b i l i t y
is
i mp o r t a n t t ha t a w ho l e number o f cyc l e s f i t
I t w a s d i f f i cu l t to gen­
i nt o t he bu f f e r .
erate
I!I
wave t h a t
fit
p rec i se l y
i nt o
1 28
v a l ues ,
Numbe r s l i k e 90 and 3 6 0 wo r k bet ­
ter
wou l d check
f or
t hi s ,
f ru s t ra t ed when I don ' t
wave 1 added to a wave
a
p rob l em
to
t i me ­
1 i ke
mus i c .
1
t r i ed
B E E P E R w i t h i nt e r r u p t s m a s k ed a n d u nmas k ed .
When
i n t e r r u p t s a r e u n m a s ked t he s ou n d
is
def i n i t e l y
not
pure ;
however ,
when
t he
i nt e r ru p t s
are masked
l o ts
Of
bad
t h i ng s
happen .
W i th
i nt e r ru p t s
masked
no t h i ng
happens except opera t l on of t he D/A .
T i me
doe s n ' t g e t upda t ed ,
t he keyboa r d does n ' t
get
sca nned .
and ,
if
you
are
u s i ng
t he
R 5 - 2 3 2 po r t .
; t comes
t o a ha 1 t .
I n t he
ver s i on of B E E P E R i nc l uded w i t h t h i s c o l um n
! comme n t ed ou t t he ORCC and ANDCC .
Try i t
b o t h ways and choo s e f o r you r se l f .
are
tems .
Wat c h f or
a l so
T here
ge t t i ng
d i sks .
de l i v e red to a
It's
hard
to
t h i s p r ob l em !
seems
to
be
s ome
t roub l e
T h ree
do l l a r s
per
d i sk
member i s a very l ow p r i ce .
be
t oo
i mpa t i e n t .
In
any
case ,
ba r r i n g a n o t h e r s e r i ous h o l d - u p .
t he
d i s k s s hou l d be i n t he ma i l by l a te Ma rCh .
Let
me say
aga i n
t ha t
we do n ' t
know
t he
d i 5k
format
many U5e�s
need ,
I of' I g u e s s
w rong ,
send
t he U s e r s
Group a
1 etter and
we ' l l
t ry
t h i ng s o u t .
to
f i nd
a
way
to
s t ra i gh t e n
C o l umn F o u r t e e n
89
it:EEPER2
Page 001
� ; c r oware 05-9 As s emb l er 2 . 1
03/ 1 3 /84 2 0 : 3 1 : 36
I, ;:;EPER - OS-9 Sys t em Symbo l De f i n i t i ons
0uOO l
00002
00004
00005
00006
0000 7
00008
00009
000 1 0
000 1 1
(,001 2
000 1 3
000 1 4
000 1 5
000 1 6
000 1 7
000 1 8
000 1 9
00020
0002 1
00022
00023
00024
00025
OOFl
TYPE
00 1 1 0 1
00 1 2
00 1 2 00
000 1
OP T I ONS
0000 8 7CD0027
OOOD 03
OOOE FFFF20
00 1 3
00 1 5
00 1 7
00 1 B
001E
002 4
0027
FF2 3
F F03
424545DO
5 343C6
42454550
58AEA3
OP TL
CNTL 1
CNTL2
BPNAM
FMNAME
DRVNAH
BPEND
Mi c r oware OS-9 As s emb l er 2 . 1
BEEP - DEV ICE DR IVER FOR D/A
00026
0002 7
00028
;0029
:;0030
, )03 1
. ·')032
� j0 3 3
C0034
- ·) 035
J036
)37
J38
. 039
.040
.004 1
�0042
a00 4 3
<
0
D
D
D
D
0
D
0
0
00E 1
008 1
0000
OO lD
0010
00 1 F
0020
002 1
0023
0025
0168
002 7
018F
OOOD
OOOE
00 1 4
8 7CDOOD8
DEV I CE DESCR I P TOR
FCB
EQU
FCB
EQU
OPTL
*
DT . SCF
* - OP T I ONS
Leng th o f op t i ons s e c t i on
FOB
FOB
FCS
FCS
FCS
£MOD
EQU
TIL
SFF23
$ FF03
/BEEP/
/ SCF/
/ BEEPER/
addr e s s o f c on t r o l byt e 1
addr e s s o f c ont r o l b y t e 2
name o f th i s modu l e
F i l e M anag e r name
Dev i c e dr lver name
B EEP
U s e OS9DEfS , SCfDEfS and I ODEf
and ENOC
B EEP
DEV I C+OB JCT
B PEND , BPNAM , TYPE , REENT+ 1 , FMNAME , DR VNAM
READ . +WR I T E . MODES
$ FF , $FF , $20 PORT ADDRESS
*
DEV ICE DR I VER FOR D/A
Page 002
0 3 / 1 3/84 2 0 : 3 1 : 4 1
TYPE
REVS
PORTA
CTL l V
CIL2V
CTL l A
CTL2A
COFFSET
BUFLEN
BUFFER
MEMS I Z E
SET
SET
MOD
ORG
RHB
RHB
RHB
RliB
RHB
RHB
EQU
R MB
EQU
FCB
FCS
FCB
DR IVR+OBJCT
REENT+ 1
B PRENO, BPR NAM , TYPE , REVS , ENTER , HEMS IZE
V . SCF
PORT ADDRESS
2
HOLD CNI L 1 VAL
1
HOLD CNTL2 VALUE
1
HOLD CNIL 1 ADDR
2
HOLD CNIL2 ADDR
2
2
OFFSET IN BUFFER
90*4
BUFLEN
LOX
STX
LOA
STA
ORA
STA
LOX
STX
LOA
nA
ANDA
STA
BSR
CLRB
SIB
SIB
RTS
CNIL 1 , Y
C IL I A , U
,X
C IL 1 V , U
I/S08
,X
CNIL 2 , Y
C TL2A , U
,X
CTL2V U
f/SH- S 08
R EAD . +WR I TE . DR I VER MODE
03
/ B EEPER/
Program Name
BPRNAM
42454550
EDITION
1
01
***********
*
Ent ry p o i n t s
*
ENTER
LBRA I N I T
1 6 000F
LBRA R EAD
1 6 0042
LBRA WR ITE
1 6 0047
LBRA GETSTAT
1 600AO
LBRA PUTSTAT
1 60090
LBRA TERM
1 6 009C
INI T
*******
*
U ADDRESS OF DEV I CE STAT IC STO R AG E
* Y ADDRESS OF DEV I CE DESC R I P TOR MODULE
)0044
00045
00 1 5
00046 W OO l S
00047 W 00 1 8
00048 W 00 1 B
00 1 E
00049
00050
002 1
0005 1
0024
0005 2
0027
0005 3
0005 4
0005 5
*
00056
002 7 AEA8 1 3
0005 7
002A AFC82 1
00058
002D A684
00059
002F A7C8 1 F
00060
0032 8A08
0006 1
0034 A784
00062
0036 AEA8 1 5
0006 3
0039 AFC823
00064
003C A684
00065
003E A7C820
00966
004 1 84F7
0006 7
0043 A784
00068
0045 8008
0006 9
toO'70
0047 S F
0048 E7C825
0007 1
004B E7C826
00072
004E 3 9
000 7 3
90
B EEPER
NAH
I FP 1
ENDC
USE
TTL
NAH
SET
MO D
FCB
FCB
0 5 - 9 U s e r N o t e s Vo l ume
I
,X
I N I TBUF
COFfSET , U
COFFSET+ 1 , U
Move the add r e s s of cnt 1 1 byt e
from the D . De s c r i p t o r t o s t a t i
s ave t h e va l ue o f the cnt 1 1 by
s e t one of the b i t s
tha t t urns on s ound
Hove the add r e s s of cnt 1 2 byt e
f r om t h e D . De s c t o s ta t i c s t o r
s ave t he va l ue o f t h e cnt 1 2 b y
set the other bi t
that t urns on s ound
I n i t i a l i ze the s ound b a f f e r
CLEAR CARRY
C o f f s e t i s a two b y t e f i e l d
RETURN
OS-9 As s emb l e r 2 . 1
BEEP - DEV ICE DRI VER FOR D/A
03/ 1 3/84 2 0 : 3 1 : 5 1
Ki c r ow a r e
00074
00075
000 76
00077
00078
00079
00080
0008 1
00082
00083
0008 4
00085
00086
00087
00088
00089
00090
0009 1
0009 2
00093
00094
00095
00096
0009 7
00098
00099
00 1 00
00 1 0 1
0 0 1 02
001 0 3
0 0 1 04
00 1 05
00 1 06
00107
0 0 1 08
0 0 1 09
001 1 0
001 1 1
00 1 1 2
001 1 3
001 1 4
001 1 5
001 1 6
001 1 7
00 1 1 8
00 1 19
00 1 2 0
001 2 1
00 1 2 2
00123
001 2 4
00125
00 1 26
00 1 2 7
001 28
001 29
00130
00 1 3 1
00 1 3 2
00 1 33
00 1 34
00135
00 1 36
00 1 3 7
00 1 38
00 1 39
00 1 40
00 1 4 1
00 1 42
001 43
00 1 44
00 1 45
00 1 46
00 1 4 7
001 48
001 49
Page
003
D/A
reg i s
* *,b� ;�**,b�* ;nb�
*
P u t s ome th i ng t h a t won ' t s ound t o o b a d
*
i n t o t he s ound b u f f e r
*
004F
004F
005 2
0055
0055
005 7
OOSA
DOSe
005D
30C827
CC0 1 6 7
E788
8 3000 1
2CF9
39
I N ITBUF
I N ITLOOP
R EAD
LEAX
LDD
BUFFER , U
fIBUFLEN- l
STB
S UED
BGE
RIS
D X
i
N ITLOOP
�
* *, ,�* * *" d<'f:
* U ADDRESS OF DEV ICE STAT IC S TORAGE
*'
Y ADDRESS OF PATH DESCR I PTOR
* RETURN CHARACTER READ IN A
*
005D
005F
006 1
0062
0063
0064
0065
AE 4 1
A684
44
44
5F
39
WRI TE
*
008E
0090
0093
0095
0097
0099
0098
*
6DC826
263F
6DC825
263A
4D
272F
get
the v a l u e l n t h e
Shi f t out the
C l e a r c a r ry
l ow o r d e r byt e s
1ST
BNE
TST
BNE
TSTA
BEQ
COFFS ET+ l , U I f c o f f s e t i s n ' t z e r o
DEF INE
we are i n the proce s s of f i l I i
eOFFSET , U b u f f er . We h a v e t o t s t b o t h e
DEF I N E
I f t h e c h a ra c t er t o wr i t e i s 0
SDEFINE
t h e s o un d bu f f e r
LEAK
P SHS
B UFFER , U
A
LDD
P SHS
/IBUFLEN- 1
* * * ** **",
* LOOP THROUGH BUFFER
*
Shut
o f f i n t e r r up t s
b
t h e addr e s s o f t he s ound bu f f e
SAVE COUNT
O f f s e t in buf f e r
Sav e o f f s e t
lOA
PSHS
D,X
g e t a byt e o u t o f buf f e r
X
* * * * on s e c ond t h o ugh t i t w ou l d h a v e b e en
* ** * b e t t e r t o j u s t d o a l ea x BUFFER , V l a t er i ns t e ad
* *** o f s av i ng t h i s v a l u e h e r e
AE4 1
LDX
V . POR T , U
Th e addr e s s o f t h e D/A r eg i s t e
3402
B u i l d t h e byt e t o s t o r e i n t he
PSHS A
A684
r eg i s t er
X
LDA
8403
MEO
A784
35 1 0
***** s e e n o t e
ECE4
8 3000 1
EDE4
2eE5
326 2
6AE4
2 6 DA
* ANDCC
009D 326 1
009F SF
OOAO 39
OOAI
OOAl
00A4
00A7
00A8
,x
Y PATH DESCRIPTOR
A VALUE TO WRI TE
0072 30C82 7
0075 3402
'1< ORCe III NTKASKS
0077
CYCLE
0077 CC0 1 6 7
007A 3 406
WLOOP
007e
007C A68B
007£ 3 4 1 0
0080
0082
0084
0086
0088
ooaA
008e
V . PORT , U
***** ***
* V DEV IC E STATIC STORAGE
'
*
0065
0068
006A
006D
006F
0070
LDX
LDA
LSRA
LSRA
CLRB
RTS
CC0 1 6 8
EDC82S
5F
39
ANDA
ORA
S TA
PU LS
LDD
SUED
STD
BGE
LEAS
DEC
BNE
#SFF- INTKASKS
LEAS
C LRB
RTS
SDEF INE
LDD
S TD
CLRB
RTS
# 4000000 1 1
, 5+
,X
S t or e t he new D/A v a l u e
r e c over t h e b u f f e r a d dr e s s
Itt
,5
g e t t h e n ew o f f s e t i n b u f f e r
dec r i m e n t t h e o f f s e t
X
WLDOP
S
S
CYCLE
�
i f i t i sn ' t n e g a t i ve s en d t h e
Cl ear s tack
d e c r iment r e p e a t c oun t
cyc l e i f n o t ze r o
1,S
C LEAR STACK
118UFLEN
COFFSET , U
CLEAR CARRY
C o l umn F o u r t e e n
91
OS-9 As s emb l e r 2 . 1 03/ 1 3/ 8 4 2 0 : 3 1 : 58
BEEP DEVICE DRIVER FOR D/A
,* * ,* * ,* ,* >'ddr>� * ''<
00 1 5 0
Load t h e Sound buf f e r
00 1 5 1
'*
00 1 5 2
DEF INE
00 1 53 00A9
LSLA
00 1 5 4 0 0A9 48
LSLA
00 1 5 5 OOAA 48
P SHS A
001 56 OOAB 3402
LDO COFFSET , U
00 1 5 7 OOAD ECC825
SUBO ff 1
00 1 58 OOBO 83000 1
STO COFFSET , U
00 1 59 00B3 EDC825
LEAK BUFFER , U
00 1 60 00B6 3 0C827
LEAK O , X
001 6 1 00B9 308B
PULS A
00162 OOBB 3502
STA , X
0016 3 OOBO A784
CLRB
00164 OOBF SF
RTS
00165 OOCO 39
GETSTAT
00166 0 0C 1
PUTSTAT
001 6 7 OOC !
CLR B
00168 00C 1 SF
RTS
001 69 00C2 39
00 1 70 00C3 * * * * * ':1< * >'< TERM
001 7 1
U DEV ICE STATIC STORAGE
001 72
001 73
LDX CTLIA, U
001 74 00C3 AEC8 2 1
LDA CTLIV , U
001 75 00C6 A6C8 1 F
STA , X
001 76 00C9 A784
LOX C TL2A , U
001 77 OOCB AEC823
LDA C TL2V , U
001 78 OOCE A6C820
STA , X
001 79 0001 A784
CLRB
001 80 0003 SF
RTS
001 8 1 0004 39
EMOD
001 82 0005 A60D8D
BPREND EQU '*
001 8 3 0008
00000 e r r or (5)
�00 03 war n i n g ( s )
' 10FF 00255 p rogram byt e s gener a t e d
- J1 72 003 70 dat a byt e s a l l o c a t e d
S 1 6D2 05842 byt es us e d f or symb o l s
Page
M i c r oware
004
'it
P r e p a r e the v a l u e
s ave i t
Curr ent o f f s e t
Upda t e o f f s e t
l o c a t i on t o s t o r e t h i s byt e a t
get t h e byt e
s t ore i t
'*
,'t
r e s t o r e t h e o r i g i n a l c t 1 1 va l u
r e s t o r e the o r i g i na l c t 1 2 va 1 u
TBEEP2
PROCEDURE TBEEP2
0000
TBeep2 is a t e s t dr i ve r for the dev i c e dr i ve r
0032
B EEPER . I t l oa d s BEEPER w i t h a wave f o r m ,
0062
* t hen s ends i t a f ew mor e chara c t e rs t o t e s t the t one .
008F
00C7
00F9
No t e i s an a r ray wh i c h c on t a ins the v a l u e s wh i ch wi l l b e s ent t o
OOFC
t h e D/A t o f o rm a no t e
013F
0158
DIM NOTE (360) : BYTE
015B
DIM I J , K: INTEGER
0167
DIM SOUND: INTEGER \ ( * P a t h n umber f o r A/D
0 1 76
DIM MAGNITUDE*FREQ : INTEGER \ (* var i a b l e s u s e d t o f o rm the wav e f o rm
0193
DIM C : BYTE \ ( a u t i l i t y one-byt e var i a b l e
0 1 C4
DIM CMD : STR I NG \ ( * wav e f o rm c ommand
0 1 E9
0203
OPEN ffSOUND, " /BEEP " : WR I TE
0204
DEG \ ( * U s e degrees f o r ang l e s
02 1 4
(* I n i t i a l i ze N o t e t o zer os
022F
FOR 1=1 TO 360
024A
NOTE (1) -0
025B
NEXT I
0266
027 1
0272
B i l d wav e f o rm
0275
0286
LOOP
0289
RUN GFX ("ALPHA") \ ( * make s c r een pr i n t ab l e
0288
('* Ge t p a r am e t er s f o r a s i n wav e
02B0
INPUT "MAGNI TUDE1< " , MAGNI TUDE
'0lID0
INPUT " FREQUENCY : " , FREQ
OEE3'
ilR.I.E6:
�: add t h e s i n wave t o t h e wave i n NOTE
�
'*
*
'*
---------------------- -- -----------------------
,'t
*
'*
'*
'*
�:
�
u
05 - 9 U s e r No t e s Vo l ume
I
0320
0323
0334
0358
0363
0366
037A
037D
0 38 F
0 39 F
03BO
03BB
03CD
03CF
03DA
03E5
03F7
0 3 F9
040B
040D
0420
0438
043B
0464
048F
0492
04A2
04B6
04C 1
0403
0405
04EO
04EB
04FO
· 04FF
05 1 1
05 1 3
05 3 3
053E
054 1
0574
05A6
05Cl
05C4
05C9
0506
050A
05E7
06 1 0
06 34
06 3F
0641
064E
065 2
065 F
066B
06AB
06CB
06E9
06FB
06FE
0726
0729
073E
0746
0750
0754
0768
0773
0775
0778
0789
078C 1 00
0790
07Al
07AC
(*
FOR I - I T O 360
NOTE ( I ) -NOTE ( I ) +MAGN I TUDE* ( l + S I N ( I *FREQ) )
NEXT I
�:
Di s p l ay t h e g r aph
RUN GFX ( "MODE" • 0 , 1 )
FOR I - I TO 1 8 0
J -NOn ( I *2) - 2
K"'J+4
I F J < O THEN J==O
END I F
J .. J * 2
K=K*2
I F J > 1 9 2 THEN J= 1 9 2
END I F
I F K> 1 9 2 THEN K== 1 9 2
END I F
RUN GFX ( " LINE" , I , J , I , K)
X
1f�: : :
i P l ay a l i t t l e b i t of t h e n e x t c y c l e
t o demons t a t e t h e t h e wave i s c on t l nuous
FOR 1 - 1 8 1 TO 255
J-NOTE ( �I - 1 80) * 2 ) - 2
K-J + 4
I F J<O THEN J - O
ENDI F
J-J*2
K-K * 2
I F J > 1 9 2 THEN J= 1 9 2
END I F
I F K> 1 9 2 THEN K� 1 9 2
ENDI F
RUN GFX ( " L I NE" , I , J , I , K)
NEXT I
;:
Th e r e i s n o p r omp t b e c au s e t h e s c r e en i s f u l l o f
* g r a ph i c s , but ent e r Y<CR> A<CR > , o r N<CR > a f t e r
* the g raph has b e e n dr awn
*
I NPUT CMD
EXI T I F CMD- " Y " THEN
ENDEX I T
I F CMD< >"A" THEN
F OR I � l TO 360 \ (* Th e wavef o rm i s bad .
NOTE ( I ) -O \ ( * z e r o i t and s t a r t o v e r
NEXT 1
END I F
RUN GFX ( "C LEAR tt)
ENOLOOP
RUN GFX C tlALPHA")
RUN GFX ( "QU I T " )
C-O
a z e r o t e l l s t he d r i ve r t o u s e t h e n e x t 3 6 0 c h ar a c t e r s
PUT � SOUND , C \ (* t o b u i l d a n e w f o rm
PUT �SOUND , NOTE \ (* s en d t h e n ew f orm
P R I N IISTAR T I NG SOUND"
�(*
�:
S end a f ew b e e p s
�:
De l ay a l i t t l e
of
d i f f e r en t
l en g t h s
FOR 1 = 1 00 TO 2 5 0 S TEP 50
C=1
PUT IISOUND , C
GOSUI! 1 00
PR INT fiEND Of LOOP " , I
NEXT I
END
FOR J- l TO 5 00
NEXT J
RETURN
C o l umn F o u r t ee n
93
94
OS - 9 U s e r Not e s V o l ume I
COLUMN F I FTEEN
THE OS- 9
t he p l an i s t o hand t he
S unday mor n i ng brunch .
me
SEM I NAR
w i 1 1 i ng
to
go
out
at
t he
L a s t year we hea r d a l ot a bout t he new
6 8 000 v er s i on o f 0 5 - 9 .
Th i s year we m a y be
ab l e
to
see
one
in
a c t i on .
That ' s
not
off i c i a l
f r om
M i c r ow a re ,
but
there
a re
s i gn s t ha t i t may be ready .
I went to t he 0 5 - 9 u se r s sem i na r l a s t sum­
mer , s o d i d a 1 mo s t every pe r s o n I ' ve hea r d
I t w a s i n t e r es t ­
o f i n t he 0 5 - S commun i t y .
t h rough t he e x h i b i t
ha l l
a nd
i ng wa l k i ng
1 i s t en i ng t o t he speake r s
T he t h i ng t ha t
ma ke s
p r i zes
h a l f way
across
I g u e s s i t SOunds 1 1 k e I ' m adver t i s i ng
t he S em i na r ,
I suppose I a m .
I w ou l dn ' t
m i s s i t f o r t he wor l d , a nd I hope I ' l l see
you t her e .
t he
coun t r y t o t a k e p a r t
i n t he s em i nar
th i s
summer i s t he f u n I had l a s t y e a r t a l k i ng
w i t h o t he r 0 5 - 9 peop l e .
Mo s t of U S . m y se l f
i nc l u ded . spend our 1 i ves i n a wor l d where
e v e r y o t he r m i crocompu t e r u s er
th i nk s t he
wor l d ends r i ght past P C - D O S a nd CPM .
Last
summe r I � a i r l y w a l l owed i n t he p l e as u r e o f
be i ng w i t h hundreds o f peop l e who s h a r e d m y
i nt e r e s t i n O S - S .
W e a r gued . a g re e d , com­
p l a i ned.
p u ZZ l ed ,
and
ap p l a u de d
about
t h i ngs t ha t are dear t o 0 5 - 9 u s e r s ( an d not
man y o t he r s ) .
I f you need a pract i ca l r e a s o n t o spend
a l ong weekend i n Oes Mo i ne s . b r i ng 8 que s ­
I f you have been i t ch i ng t o
t i on w i t h you .
show t he pe r so n on t he M i crowa r e ho t l i ne a
prob l em t ha t he can ' t repr oduce .
he ' l l
be
t he r e .
Go
demons t ra t e
t he
p r Ob l em
y ou r ­
If
you want
to
sugge s t
t ha t
05-9
se l f .
bad l y needs a WA L L command you c a n p ro b ab l y
f i nd someone i mp o r t a n t and back h i m i nt o a
corner a bou t i t .
Al l
t he
i mp or tant
vendors
were
t he re
l a st year - - I a s sume t hey ' l l be back .
If
t hey
come .
you ' l l
be
ab l e
to
check
t he
Smoke S i gn a l v e r s i on of O S - 9 f o r compa t i ­
bi l i ty
with
o t he r
v e r s i on s .
Try
a
f ew
th i ngs
on
t he G I M I X
II I .
hope
P r ; vac
comes aga i n ; t he i r g r a p h i c s b o a r d ; s much
more i mp r es s i ve i n mot i on t ha n i n an a d v e r ­
1 i ma g i ne t he re ' l l b e a b u n c h o f
t i sement .
new vendors t here show i ng CoCo p ro d u c t s .
The
vendors and M i c roware
staff
not ­
w i t h s t a nd i ng ,
t he best
p l ace
t o . l oo k
for
a n s w e r s w i l l b e s t and i ng o r s i t t i ng b e s i de
you ( ve r y l i ke l y at break f a s t o r s o me o t he r
; mprobab 1 e
t i me ) .
Last
yea r
I
f ound
t he
o t he r u s e r s a t t he S em i na r a m i ne of u se f u l
; n f o rmat i on .
If
you a r e a vendo r .
go to
t he S em i na r even i f you don ' t have !II b oo t h
I t i s a g r e a t p l ace t o t e s t t he wa t e r .
T he Sem i na r
i s a bus i ne s s l i ke af f a i r .
but i t i s a l so somet h i ng of !II p a r t y : veanne
K ap l an ' S
party .
E ve ryone
who
has
dea l t
w i t h M i c roware f o r any l eng t h of t i me k nows
t hat
�eanne
1s
a
cons umma t e
o r ga n i zer .
L a s t yea r every t h i ng t i cked a l ong smoo t h l y
desp i t e the fact
t ha t s he m u s t have been
s l owed down a 1 1 t t l e by t he c h i l d s he waS
about t o have .
Last year M l c r o w a r e h o s t e d
a banquet a n d a f a ncy brunch .
T h e Gover n o r
o f I owa came a n d g a v e us a l i t t l e t a l k o v e r
d i nner .
K e n Kap l an handed ou t
p r i ze s
to
i nd i v i dua l s who h a d made p ar t i cu l a r l y d i s ­
t i ngu i sned cont r i but i ons t o t he 0 5 - 9 commu ­
n l ty .
A t t he b r u n�h mor� pr i ze s were hand­
ed out .
I wonder wha t i s i n s to re f or us
t h i s y ea r .
M i cr o w a r e
is
go i ng t o g i ve
t he U s e r s
I d on ' t
G r oup some sof t wa r e f o r a r a f f 1 e .
k now j us t how i t w i l l be organ i zed yet , but
OFLEX
Ju s t t oday I rece i ved a copy of O F l e x .
p r o g r a m r u ns F l e x a s a process
i n an
Level
Two
system .
I 'm
a f ra i d
it's
t o o l ong s i nce I
u s e d F l ex w i t h any
r e gu l a r i t y
f o r me
to g i ve
t he p r o g r a m a '
gOOd w o r k ou t ,
S t i l l . I r a n a few F l ex p r o ­
a nd
checked
out
t he
i nt e r f a ce
to
grams
OS-9 .
Thi s
05-9
been
"emembered f rom u T he S o u l
of
a New
Mach i ne "
t ha t
Advent u re
was
an
i mp o r t a n t
t e s t u s e d on n e w h a r dware .
I have a ver­
s i on of Adven t u r e w h i c h r u n s under F l ex , s o
I r a n t hrough a d o z e n rooms o r s o w i t h i t
a nd g rabbed t w o or t hr ee t re a s u res
no
prob 1 em .
I comp ; 1 ed a P asca 1 p r o g ra m u s i ng
t he T S C Pa SCa l
comp i l er w i t h no d i f f i cu l ­
t i es e x c e p t some t r ou b l e remembe r i ng h o w t o
u s e F l ex .
P a r t o f t h e O F l ex package i s a p r og r a m
c a l l ed X COPY t ha t r u ns under O F l ex .
XCopy
c a n copy f r om 0 5 -9 f i l es to F l ex f i l es a nd
back .
I
t r i ed e v e ry comb i na t i on
I
cou l d
t h i nk of
and cou l dn ' t make i t f a i l .
That
b r i ngs up t he o ne i mp o r t an t f a i l i ng I c ou l d
f i nd i n O F l ex ; t he r e i s n o F O RMAT u t i l i t y .
I g u e s s F O R MAT i s t oo near t he h a r d wa r e t o
r u n i n wha t a mou n t s t o a v i r t ua l mach i ne .
O F l ex can r ea d a n d w r i t e F l ex d i sk s .
I t can a l so f orma t f i l es on a n O S - 9 d i s k 5 0
t he f i l e s can be t re a t ed a s F l e x d i sk s b y
OFlex.
The f i l es
a r e acces sed
through a
command
ca l l e d
ASND I SK .
U S i ng
A S ND I 5K ,
f i l es can be a s soc i a t ed w i t h each d i s k nu m ­
b e r ( 1 t h r ough 4 ) .
Th i s i s a u s ef u l
fea­
t u r e f o r F l ex .
! shudder t o t h i nk o f t he
p r o b l em
i t wou l d be dea l i ng
w i th a
hard
d i sk f u l l
o f F l ex f 1 1 es .
W 1 t h O F l ex
t he
ha r d d i s k c a n be broken up i nt o many s ma l l ­
e r v i r t ua l
d i s k s g i v i ng managea b l e bunchs
o f f i l es to work w i th .
O F l ex
i sn ' t
r een t r a n t .
Th i s
is
sad,
but , a s I remember 1 t • many F l ex p r o g r a m s
change
f l ag s
and
po i nt e r s
i nS i de
F lex .
Becaus e
it
i sn ' t
reent ra n t .
each
i ns t ance
of O F l e x r unn i ng under 0 5 - 9 needs a f u l l
60K , bu t ,
i f t he memo r y i s a va i l ab l e , m a ny
u s e r s c a n run O F 1 ex
on t he same m a c h i n e .
T h i s cou l d be v i ewed as an ea s y way of g e t ­
t i ng mu l t i - u s e r F l ex .
O F l ex
i s
1 i censed f rom T S C a n d F ra nk
Hogg L a b s .
As f a r as I ca n t e l l i t i s re g ­
u l ar
F l ex
w i th
m od i f i ed
I /O
wh i ch
f ee d s
i nt o OS-9 .
It
r a n t he p r ogr a ms
I
t r i ed
f l a w l es s l y , bu t 1 k no w of s e ve r a l F l ex p r o ­
g r ams ( I ' ve w r i t t e n s ome my se l f ) w h i ch u se
mem o r y-mapped I /O d i r ect l y i ns t ead of g o i ng
t h r ough F l ex .
They won ' t w o r k under O F l ex .
Anyhow ,
I f you have 0 5 - 9 a nd you w i sh you
C o l umn F i f t e e n
95
o:- ou l d run most of your o l d F l e x p r o g r ams ,
' r at
l ea s t read the o l d d i s k S , OF l e x w i l l
:,,1 what
you need .
I f you have n o p a r t i cu ­
'I a r n eed f o r 0 5 - 9 but f i gu re O F l e x m i ght b e
'ii '
i mproved way t o r u n F l e x , y o u mus t be
v e r y b r ave .
I t i s an i mp r o v ement over r e g­
u l a r F l ex i n seve r a l ways , but one day a
p ro g r am you despera t e l y w a n t to r u n won ' t
worK w i t h t h i S mu t a t i o n of F l ex .
I n any
case
try O F l e x w i t h y o u r s o f t wa re bef o re
y o u r e l y on i t .
NEW MANUALS
I got a s t acK of new O S - 9 Manua l s l a s t
I ' m not an a u t hor 1 t y on most of t h e
week .
0 5 - 9 Manua l s , but
I ' ve pract i ca l l y memor ­
i z e d t h e S y s t e m Progr amme r ' s Manua I .
The
new manua l
i S a b i g i mpr ovement over t he
o l d one .
T he r e i s a s e c t i on on memo ry man­
ageme n t
f or
L e ve l
Two
and
a
sect i o n o n
p i pe s w i t h a f ew a s semb l y l a nguage exam­
p l es .
T he L e ve l Two Serv i ce R e qu e s t s a r e
i n w i t h t he o t he r reques t s . n o t i so l a t e d , n
a n append i x .
Spea k i ng o f S e r v i ce Reque s t s ,
t he
manu a l
goes
i nt o
a
good
dea l
more
deta ; 1
t ha n i t used t o on some of t hem .
Cha i n t ak e s more t han
The e x p 1 ana t ; o n of
h'o page s .
E x ; t t a k e s abou t a page and a
q� a r t e r . as d oe s I n te rcept .
T he new manua l c o nt a i ns l o t s of use f u l
of
code
demo ns t ra t i ng
t r i C ky
s n i pp e 't s
po i nt s .
I was p a r t i cu l a r l y p l eased to see
f i ve chunks o f about
ten 1 i ne s each t ha t
cove r t he mos t o b s c u r e pa r t s of a n i n t e r ­
r u p t d r i ve n dev i ce dr i ve r .
I be l i e ve t hose
chunks o f COde were taKen stra i ght ou t o f
t he A C I A dev i ce d r i v e r .
M i c ro lol a r e has been p r oduc i ng s tead i l y
oet t e r manua l s f o r t h e l as t two year s .
T he
i s the i r b es t so f a r .
'1ew S y s t ems manua l
:f
i t had been ava 1 1 ab 1 e 1 a s t uanua r y ,
I
� i ght never ha ve seen a need f o r t h i s CO l ­
umn .
C FUNCT I ONS
have been work i n9 o n a p r ogram
to
mooe 1 a proo l ern in d i s t r l bu t e d s y s t ems for
a course I am t a k i ng .
I needed some f u nc­
t i o n s to man i pU l a t e f l oa t i ng po i n t numb e r s
as
a
s epara t e man t i s sa a n d exponent .
I
s pent
most
of
an even i ng f US S i ng a r o und
w i � r> as semb l e r bef ore I gave up and w r o t e
t he f u nc t I on s most l y i n C .
I t w a s such a
f r us t r a t i ng expe r i ence t h a t
I
dec i ded
to
i n c l u de t h e m i n t h i s co l umn .
I w r o t e f r exp
to du p l i ca t e f u nct i o n s t ha t are
a n d modf
p a r t o f t he UN I X ma t h l i br a r y .
F rexp re t u r n s the ma n t i s sa of va l a s a
doub l e l es s than one , and s t o res the expo­
nent
i n the
i nt eger po i n t ed t o by ep t r .
The exponent
i s f o r a power o f t w o ; t ha t
i s , t he number w a s ( va l e x * 2 * * e xp ) .
Modf sep a r a t e s a doub l e i nt o a n i n t eger
p ar t end a f r a c t i ona l
pe r t .
The
i n t eger
p ar t i s st o r ed a t t he a dd r e s s I n ptr ( a s a
doub l e ) ,
and
t he
f r a c t i ona l
pa r t
is
r e t u l" ne d ( a l s o a s a dour;, '· e ) .
I
w rote mos t o f
t he
code f o r
t hese
f unc t i o n s in C becau s e I cou l dn ' t do i t i n
a S semb l e r .
I certa i n l y tr ied,
but M i cro-
96
05-9 U s e r Not e s Vo l ume I
wa r e C uses l o t s of
i n te r na 1
s u b r o u t i nes
a nd
a
spec i a l
stat , c
s t o r a ge
l oca t i O n
ca l l ed f l a cc
( f l o a t i ng po i n t accum� l a t o r }
to do f l oa t i ng po i nt ce l c u l a t i ons .
I
had
l o t s of t r oub l e f i nd i ng the f l oi!l t i ng pO i n t
numbe r
and
ret u r n i n g
t he
numbe r
to
t he
ca l l e r .
As you c a n see f r om t he programs ,
my s o l u t i on was t o use C to do ever yt h i n g
i n modf , and to f i nd va l and r e t u rn a va l ue
i n f r exo .
THE BUTTERFLY
It
l oo k s
l i ke
t he
Compu t e r
Sc i e n c e
Depar tme n t
here
at
t he
U n i ver s i t y
of
R oche s t er i s go i ng t o g e t a compu t e r c a l l e d
a But terf l y .
I t i s named a f ter t he n e t w o r k
u s e d 't o connect
i t s pr oce s s o r s t o ge t her .
T he But terf l y t ha t w i 1 1 be com i ng here has
128 68000 m i croproces s o r s .
EaCh 68000 has
a t l e a s t 5 1 21< o f memory a nd , p o t e n t i a l l y .
i t s own bus s . They a r e a l l ab l e to read a n d
w r i t e one a no t he r ' S memo r y .
I
h e a r that
th i s
comp u t e r
wil l
h a ve
the
f as t e s t
i n s t r uc t i on ra te i n t he wor l d .
Of c ou r se ,
i ns t r uct i on r a t e s a r e an a l mos t mea n i ng l es s
mea s u re , but won ' t t ha t be a marve l ou s com­
pu t e r to deve l ope p a r a l l e l a l go r i t hms on !
- I t ' s com I ng w i t h a UN I X - l i ke oper a t i ng s y s ­
tem . bu t I can ' t h e l p bUt wonde r w he t he r i t
cou l d r u n OS -9 .
DYNASPELL
L a s t summer at the O S - 9 Users Sem i na r I
me t Da l e Pucke t t
at
d i nner
I)ef or e we
were both e l ected a s U s e r s Group o f f i ce r s .
I had been a 1 oye 1
u s e r o f O ynasoe 1 1 ,
a
program
wr i t t e n
by
Da l e
PucK e t t ,
but
I
wasn ' t ent i re l y happy w i t h i t .
I n f ac t I
had wr i t t e n a v e r y m i xed s hort reV i ew of i t
1 n t h i s c o l umn .
Dur i ng d i nner I made D a l e
Sit
th rough a
caref u l
e x p l anat i o n o f
my
c r i t i c i sm o f h i S program , a nd a l on g d i S ­
c u s s i on of what I thought a spe l l i ng cheC k ­
e r shou l d do .
Da l e wa s v e r y pat i e n t w i t h me .
He even
encou r age d me t o g o i nt o more dep th a b o u t
m y i deas f o r the p e r f e c t s pe l l i ng checke r .
I t o l d h I m t hat I WOU l d w r i t e a new , m o r e
comp l e t e I" ev i ew o f O yna s pe l l
i f h e w ou l d
send me a vers i on that deserved f r e s r. con­
s i derat i on .
Some
months
l a ter
I
got
a
package f rom D a l e i nc l ud i ng some t h i ng p re t ­
t y c l ose t o m y dr eam s p e l l i ng chec ker .
We
went t hrough s ome
i t e r a t i o ns
w or k i ng
ou t
var l OUS pl"Ob l em s .
Now I owe O ynaspe l ;
a
re V l e ", .
I have been very s l ow a p o u t w r i t ­
i ng t hat rev l e\< . so l et me summa r i :z e here .
I ' l l
go
i nto
more
dep t h anot he r
mon t h .
Oyna s pe l l i sn ' t pe r f ec t . b u t I ha ven ' t b e e n
a b l e t o f i nd a n y b u g s i n t he 1 " t e s t v e r ­
s i on .
It
i 5 mvch f e s t e r
then t he e a r l y
ve r s i on I
had .
It
i s a b l e t o l oo k near
m i s s e s up
in
i t s d i c t i o nary
a nd
sugge s t
c o r r ect i ons
when
it
s u sp ec t s
a
s pe l l i ng
er ror .
My rema i n i ng comp l a i n t about Dynaspe l l
is
t hat
t he
new
features
don ' t
go
far
enough .
T he
" l oo k u p "
f e a t u re
i sn ' t
as
I t o f t e n f i nds
se l ec t i ve a s a wou l d l i ke .
more p o s s i b l e s pe l l i ngs f o r a w o r d than i t
can f i t on t he screen .
O n the o t he r hand
i t somet i mes doesn ' t sea rch w i de l y e n o ugh
to f i nd t he correct spe 1 1 i ng for me .
I
a l so
a
w i sh
it
wou l d
s creen o r i e n t e d
g i ve
text
me
t he
e d i t or
fea t u r e s
when
i t
of
f i nds
a s pe l l i ng ed i t o r .
D y n a s pe l l has a mode i n
w h i C h spe l l i ng e r r o r s c a n be v i ewed i n c on ­
t e x t , bu t t he con t e x t i t shows i s a s c r ee n ­
ful l
of
t he docum ent u p t o and
i nc l u d i ng
t he word i n e r r o r .
I wou l d l i k e to be a b l e
t o move f o r w a r d a nd backward t h rought
t he
documen t ,
a nd
t o c hange words
o t he r
t ha n
t he o n e i n e r r o r .
has
requ i r ed
s t r a nge
e i t her
p r ac t i c es .
s 1 i gh t
of
hand
O n l y modu l es
or
very
r u n n i ng
in
t he s y s t e m addre s s s pace can add S e r v i ce
Reque s t s , bu t 0 5 - 9 does n ' t i nc l ude a way t o
r u n a p rocess i n t he s y s t em a ddr e s s space .
I have r u n dev i ce d r i ve r s and f i l e ma n a ge r s
j u s t t o a d d Ser v i ce r eque s t s , a nd c on s i d ­
e re d r e n a m i ng O S 9 P 2 as O S9 P2 1
own
OS9P2
wh i Ch
wi 1 1
1 i nk
OSSP2 1 .
and
to
add i ng my
and
ca l l
A N I CE EXPE R I ENCE
M i c r ow a r e ha s
i nc l uded s ome t h i n g
1 i ke
t ha t l a s t t r i ck i n L eve l T w o .
A f t e r 0 59 P 2
(al l
is
i s f i n i s he o
i n i t i a l i z i ng
i t does
s e t u p a l i s t o f S er v i ce R eques t s ) i t t r i es
t o f i nd 0 5 9P 3 .
There
i s no 0 5 9 P 3 u n 1 e s s
t he u s e r adds i t t o t he boot f i l e ,
so i t
g e n e ra l l y f a i l s t o f i nd t he mOdu l e , b u t i f
i t f i nd s O S 9 P 3 i t e x ec u t e s i t a s a s y s t em
mOdu l e .
T h i s opens up l o t s o f i nt e r es t i ng
poss i b i l H i es .
E a r l y l a s t s u mm e r I bought a T e l eV i deo
970
termi nal .
T he y
were
j US �
becom i ng
i n f ac t .
I had a
ava i l ab l e on t he ma r ke t ;
h a r o t i me f i n d i ng one .
I t seems t he b o a t
br i ng i ng a l a rge s h i pm ent i n f r om ove r s ea s
had sun k .
I ' m n o t cer t a i n 1 be l i ev e t ha t ,
b u t i t was def i n i t e l y d i f f i cu l t to f i nd one
I f i na l l y f ou nd one , got i t home ,
to buy .
and s t a r t ed u s i ng i t .
N i ce t e rm i na l .
Big
s c r ee n ,
n i ce keyboa r d .
A 1 mos t
t oo f l e x i ­
bl e .
O ther
i nterest i n g
poss i b l 1 i t i e s
a re
s u gge s t ed by t he S S . S I G a nd 5 S . Re l ee S e t S ­
t a t codes .
S S . S I G i ns t r u c t s O S - 9 t o send a
s pec i f i ed s i gn a l when da t a i s ready f r om a
pa t h .
T he e a s y u se f or t h i s i s t o wa i t f o r
o u t pu t f r om seve r a l p a t hs a t once .
Thi s i s
e s p ec i a l l y
good
for
t h i ngs
l i ke
" modem "
p r o g r a m s t ha t need t o wa i t f o r
i nput f r om
two
paths
S i mu l t a neou s l y .
w i t hou t
th i s
S e t S t a t t he on l y way t o h a nd l e t ha t p r Ob l em
w a s t o p o l l bo t h pa t h s .
After
about
a week
s t a r t ed f i nd i ng
bugs .
A f ew comma n d s d i dn ' t w o r k r i gh t .
1
ca l l eo t he numb e r i n t he manua l a nd t a l ke d
t o a n e ng i ne e r .
T he nex t day I got a p a C K ­
age v i a F e de r a l
E xp r e s s w i t h new f i r m w a r e
T h a t w as n ' t t he end o f t he p r o b l em s
ROMS .
w i t h t he t e rm i na l .
I ' � one of t ho s e a n noy ­
i ng peop l e who r e a d s t he e n t i re ma nua l t he n
t r i es a l l t he s t r ange comb i na t i on s o f com ­
ma nds j us t
to s e e wha t
t he y w i 1 1
do ,
and
t he 9 7 0 h as a m a nu a l a b o u t t wo t h i r d s o f a n
i nc h t h i ck .
T he l as t t i m e I c a l l ed t hem I
t o l d t hem t ha t I needed a f ea t u re w h i c h wa s
documen t e d
ln
t he
manu a l .
but
wh i ch
t he
e r r a t a w i t h t he manua l s a i d w a s n o t i mp l e ­
men t eo ( do w n l oadab l e f on t s ) . W i t ho u t a com­
p l a i nt t hey s e n t m e a who l e new l og i c boa r d
w h i ch suppo r t s t ha t f e a t u re .
It
i s n ' t d i f f i cu l t t o wr i t e a p r o g r am
I n f ac t .
t ha t
po l l s
a
number
of
pa t hs
p o l l i ng i s t he wa y mos t of t he more p r i m i ­
t i ve m i cr ocompu t e r oper a t i ng sys t em s w o r k .
T he p r ob l em w i t h p o l l i ng i s t ha t i t wa s te s
t remendous amount s of C P U power .
I s e 1 dom
t ype f a s t er t han 2 c ha r ac t e r s per second .
I f a p ro g r am ha s to p o l l
f o r my i npu t
it
wi 1 1
l ook f o r s o me t h i ng t o r ead t ho u sands
o f t i me s b e f o r e i t ge t s a n y t h i ng .
use d
my
ear l y
copy
of
D y na s pe l 1
bec a u se I need a s pe l l i ng c he c k e d ba d l y a n d
i t was t he bes t I h a d .
I u se i t m o r e o f t e n
a nd m o r e happ i l y now .
be s t
spe l l i ng
c he ck e r s
p r og rams i nc l uded .
It
i s one o f
t he
I
know ;
m a i nf rame
don ' t
t h i nk
wou l d
recommend
the
Te l eV i deo t e rm i na l t o m os t O S - 9 u s e r s .
T he
t e rm i na l
c os t s
over
a
t ho u s a nd
dol l ars .
T ha t m a k e s i t h a r d t o j us t i f y when a a de ­
qua t e t e rm i na l on l y cos t s f i ve or s i x h u n ­
F o r t ho s e who t a ke t e rm l na l s
dred d o l l a r s .
s e r i ou s l y ,
it
1 s wor t h wha t
i t cos t s ,
It
suppo r t s
ANS I
s t andard
a nd
VT52
con t ro l
sequences . a n d i nc l udes about every f e a t u r e
( t hey
1 c a n i ma g i ne except f u l l
g r aph i c s
s a y t h a t ' s c om i ng ) .
t he
is
The bes t
t h i ng about
t he 970
exce l l en t
suppor t
T e l e V i deo
g i ve s .
Many
l a rge v e nd o r s s e e m t o l os e i n t e r e s t e f t e r
t hey s e l l y o u t he i r produc t ,
T e l e V i de o ha s
and
gone o u t
of
t he i r
way
for
me a ga i n
a ga i n .
TR I C:r.S FOR LEVEL TWO
I j ust
l ea r ne d abou t 0 5 9 P 3 i n t he new
OS-S
Sys tem
P r o g r ammer ' s
Manua l ,
I
have
o f t e n w i shed for a n ea s y way to add S y s t em
S e r v i ce Reque s t s t o O S -9 .
Under L eve l One ,
i t
i sn ' t
t oo
hard ,
bu t
under
L eve l
Two
i t
W i t h S S . S I G i t shou l d be p o s s i b l e t o do
a c oup l e o f S e t S t a t s and wa i t f o r a s i g n a l .
W h i l e en 0 5 - 9 pr ogr a m wa i t s i t u s e s e s s e n ­
t ial l y
n o t h i ng
but
memo r y .
Th i s
shou l d
m a k e modem p r ogr a ms a no o t her p r ogr a ms w i t h
s i m i l a r p rob l ems much m o r e e f f i c i e n t .
T he o t her use I c a n t h i nk of f o r S S . S I G
t o s o l ve t he p r ob l em t ha t dev i ce s c a n ' t
be p reemp t ed .
I f you have a s y s t em w i t h
more
t ha n one t e rm i na l
you
have p r Obab l y
n o t i ced
t ha t
if
you
s e nd
a
mes sage
to
t e r m i na 1 ,
a no t her
t he mes sage lola 1 t s u n t i 1
t he u s e r a t t he o t he r t e r m i na l types a c a r ­
r i age r e t ur n .
T h a t ' s bec a u s e t he r e
is a
(e . g .
program
t he
She l l )
t r y i ng
to
read
f r om t ha t t e r m i na l .
U n t i l t he read i s f i n­
i s hed O S - 9 won ' t a l l ow a n y pr ocess t o w r i te
to i t .
5 S . S I G g i ve s u s a way to b r e a k t h a t
dead l oc k b y n o t l eav i ng a r e a d a ct i ve .
IS
I h a v e i nc l uded a t r i v i a l p r og ram w h i ch
demo n s t ra t e s t he u se of t he 5 5 . S I G s e t s ta t
w i t h t h i s C o l umn .
It
does n ' t d o a n y t h i ng
u s ef u l
-- j us t cop i es
1 i ne s f rom s t an d a r d
i npu t
to
s t anda r d
o u t pu � .
T he
ex c i t i ng
t h i ng i s t h a t i t wor k s !
I r a n t s t s s i g on
one t e rm i na l ; t yped a f ew l i ne s i nt o i t t o
m a ke ce r t a i n t ha t i 't w o r k e d ; l ef t i t a t i t s
p r omp t ,
a n d went t o my o t her t e rm i na l .
I
t yped
Echo Hi t h e r e > / t e rm
on t he o t her t e rm i na l a nd i t appeared i mme­
d i a t e l y o n t he t e rm i na l r u n n i ng t s t s s l g· .
C o l umn F i f t ee n
97
went
and
back
to
t yped a
t ne
b l a nk .
t e r m i na l
T he
runn i ng
b l ank
tstss i g
c a u sed a
S 1 g­
na l
t o be s e n t t o t s t s s i g l e t t i ng i t p r o ceed t o t he l $ R e a d L n .
O nc e t he read w a s
" :.;p "
/term was
l oc k e a .
1
t r i ed
to
send
a no t n e r m e s s age
t o I t erm a n d f ound t ha t 1
h a d to w a i t un t i l 1 t yped a c a r r i age r e t u r n
98
'lS- 9 U � � r N o t e s Vo l ume I
on
a nd
I t e r ",
before
t he
mes s age
was
de l i ve r ed
t he e c h o command comp l e' t e d .
wonder
w he t he r
t he
SS . SIG
t r i ck
s hou l d be u se d a s a m a t t e r of po l i Cy when
l ong wa i t s f o r i np u t a re e)<:pec t e d .
TSTS S I G
M i c roware 05-9 As s emb l er 2 . 1
t s t s s i g - Te s t S S I G s e t s t a t
00001
00002
00003
00004
00005
00006
00007
00008
00009
OOO l D
000 1 1
000 1 2
000 1 3
000 1 5
000 1 6
000 1 7
000 18
000 1 9
00020
000 2 1
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
Page 00 1
04/ 1 1 /84 2 1 : 58 : 5 7
nam
ttl
t s t s s ig
Te s t S S I G s e t s t at
* --------- --------------------------------------------- *
*
*
Tes t S S . S I G S e t S t a t Serv i c e r eques t .
Th i s pr ogram wi l l c opy l i nes f r om s t andard i nput
to s t andard o u t p u t wl t h o u t t y i ng the dev i c e
u s e d f o r s t anda r d i nput up wl th a read , o r u s i ng
e x c e s s i v e amoun t s o f CPU t i me by p o l l ing t h e
s t an d a r d i nput p a t h .
"
*
,�
*
*
,�
,�
*
t s t s s i g has no p r a c t i c a l us e that I can t h i nk o f . *
*-- ---------------------------------------------------- *
001 1
008 1
000 1
0000
0004
0064
00C8
0000
OOOD
00 1 4
0015
0003
8 7 C00072
54737473
01
3030BE
I FP 1
ENDC
Type
s et
Revs
set
S t dOut
set
S t dIn
s et
SSC o de
set
L i neS i z s e t
Stack s i z s e t
mod
Ts t N am
fcs
Edi t i on f c b
P r omp t
fcs
P r omp t L equ
us e o s 9 d e f s
Obj c t + P rgrm
ReEn t + 1
1
0
4
1 00
200
c o d e u s ed t o i n d i c a t e input wa
Ts tLen 1 T s t Nam , Typ e , R evs , En t ry , MemS i ze
/Ts t S S lg/
1
/==>/
* - P r omp t
·
*---------- --------------------------------- ---------- - *
*
*
S t a t i c S t orage
o
o
o
o
0000
0001
0065
0 1 20
00035
00036
0003 7
00038
00039
00040
0004 1
00042
00043
00044
00045
00046
00047
00048
00049
00050
0005 1
00052
00053
00054
00055
00056
0005 7
00058
00059
00060
0006 1
0018
00062
00063
00064
00065
00066
0006 7
00068
00069
00070
000 7 1
00072
0040
0040
004F
0052
0055
0058
005s
0050
005F
006 1
0062
* - - - - -- - - - - - - - - - - - - - - ---------------------------------- *
IntNo
L i ne
KemS i ze
)� *
*
)�
0018
00 1 C
00 1 F
00 1 F
0023
0027
0029
002C
002E
002E
0030
0032
0035
0037
0037
0039
0030
003F
0042
0044
0046
0049
004B
* * * 'i,i,*
rmb
rmb
rmb
equ
1
L i neS i z
S t a cks i z
Save t h e s i gna l f r om the t ra p
S t orage f o r a l i ne t o echo
En t ry
S e t up s i gna l i n t e r c ep t t rap
3080005 0
1 03F09
3080FFF2
1 08E0003
860 1
1 03 F8A
2536
8600
C60 1
1 03 FBO
25 1 6
304 1
1 08E006 4
8600
1 03 F8B
2520
860 1
1 03 F8C
25 1 9
2002
C6 1 A
8E0004
1 03 F8E
8EOOOO
1 03 FOA
0600
C l 04
27CD
43
2000
L o op
S t r t Re ad
OoEcho
Do S S I G
l eax
OS9
l eax
l dy
I da
OS9
b cs
I da
l db
0 59
bcs
l eax
l dy
I da
OS9
bcs
I da
OS9
b cs
bra
l db
l dx
OS9
I dx
OS9
l db
cmpb
beq
c oma
bra
Trap , PCR
F$ I cp t
$�
$
Add r e s s of Int e r rupt t rap code
P r omp t , P eR
p r omp t L
S t dOut
Wr i t e t h e p r omp t
$Wr i t e
Error
S t dIn
�S S . R e a dy
I $G e t S t t
OoS S I G
$
L i ne , U
L ine5iz
�S t d In
I $R eadLn
Error
tl S t dOut
I $Wr i t Ln
E r r or
Loop
$
�O
�
any data ready?
No ; wa i t f or a s i gna l
R e ad a l i ne
and e ch o it back out
Go p romp t for the n e x t l i n e
SS . SSIG
�SS C o de
I$Set S t t
s e t s t a t f unc t i on c ode
$ S l eep
IntNo
S S Code
t r tRead
S l eep un t i l an i n t e r r up t c omes
Error
s e t carry
C o l umn F i f t e e n
99
Mi c r owa re O S-9 As s emb l e r 2 . 1
t s t s s i g - T e s t S S I G s e t s t at
0064
0 064
0 06 6
0068
0 06 9
0069
00073
00074
00075
00076
00077
00078
00079
00080
0 00 8 1
00082
00083
00084
00085
00086
Error
C 1 D3
2601
SF
Ex i t
Page 002
04/ 1 1 / 8 4 2 1 : 59 : 0 4
cmpb
bne
c l rb
IJE$ E o f
Ex i t
1 03 F06
OS9
F$Ex i t
'h� * '�*'i:**,� *,� * * * ,',
* Tr i v i a l I n t errupt t rap
EOF i s n ' t an e r r or
,'r
Trap
006C
006C E7C4
006E 3B
006 F 8AD3 4 F
0 072
Ts t Len
s tb
rtl
emod
equ
IntNo , U
s ave t h e i n t e r r upt code
*
FREXP
1 d o ub l e
2 f r ex p (va l , i p t r )
3 d o ub l e va l ;
4 t n t ;< i p t r ;
5
� eg i s t er d o ub l e * r p ;
6
l n t exp ;
7
8
ri .. &va l '
9
/ ' a t t h i s p o i nt U c o n t a i n s
10
1 1 Ilasm
1 2 l db 7 U g e t C e x p onent
J 1 28
13 a ddb #
1 4 s ex
1 5 s td
save exp
16 I da
1 28
1 7 s ta
•U
1 8 flendasm
19
exp ;
20 * i p t r
2 1 r e t u rn (va I J ;
22
t h e addr es s o f va l * /
�s
..
HODF
1 / * modf r e turns t h e p os i t i v e f r a c t i onal p a r t o f val .
2
and s t o r e s the i n t eger p a r t i n the d o ub l e po i n t e d t o
3
by p t r .
4 */
5 #de f ine MAXLONG 1 34 2 1 7 7 2 7
6
7 d o ub l e
8 mod f (va l , p t r )
9 d o ub l e v a l , * p t r ;
10
11
{
12
d o ub l e t mp ;
13
i f ( l a l > MAXLONG)
14
15
16
*pt r
va l '
17
r e t urn (O . OJ ;
18
}
19
tmp
( l ong) v a l ; /* t ru nc a t e t o i n t by c o e r c i on t o l ong "'!
20
* p t r E va l
tmp ;
21
r e t urn ( t mp) ;
22
23 }
-
..
-
l.Q[O
0> 9 U s e r No t e s Vo l ume I
COLUMN S I XTEEN
on ,
W h i l e t hese ha r dw a r e changes were go i ng
ope r a t i ng s ys t ems were be i ng i mpr oved .
P r ograms
STANDARDS
S e v e r a 1 mon t n s ago I men t i oned Smoke ' s
spec i a l
v e r s i o n o f 0 5 - 9 Leve l T w o
i n thi s
c o l umn .
T he
ques t i ons
I posed abo u t i t s
compat i b i l i t y
w i th
M i c r o wa r e 0 5 - 9
s t i r r ed
up a
l o t of commot i on ,
but
t ha n k s
to Don
IN i l l i a m s '
i n t e rvent i on no b l ood w a s s hed .
Smoke S i g na l h a s a greed t o g i ve cus tome r s a
cho i ce of t he acce 1 e r a t e d Smoke ve r s i on o f
OS-9
or
t he
M i c r oware
ve r s i on .
1
t h i nk
Smoke
S i gna l
deserves
much
c r ed i t
for
o f f e r i ng t he i r c u s t o m e r s t h i s a l t e r na t i ve .
S ome ,
perhaps
mos t ,
peop l e
who
use
05-9
need e x t r a speed enough t o t a k e t he r i s k
a ssoc i a t ed w i t h a v e r s i on of 0 5 - 9 not j u s t
1 i ke
e v e r yone
e l se ' s .
C a u t i ous
peop 1 e
( 1 i k e me ) c a n a s k Smoke to send t hem t he
M i c r o w a r e ve r s i o n of O S - S .
'
It
probab l y
seems
s t ra nge
that
I ,
a
per s o n
who
1 i k es
to
fuss
w i th
opera t i ng
s ys t ems ,
s hou l d
get
so
w o r k ed
up
abo�t
C ha nges t o 0 5 - 9 .
A f t e r a l l , I e n j oy a dd i ng
non - s t a nd a r d f ea t u r e s to 0 5 - S ;
even pu b1 i s h so me of t hem i n t h i s c o l umn .
Let
me e x a m i ne
t he ques t i on of
s t an­
d a r ds f r om a f ew pO i n t s o f v i ew .
There a re
t h i ng s
to be s a i d f o r
i gnor i ng s t anda rds :
mos t l y t h a t i gn o r i ng e x i s t i ng s t anda r d s i s
t he way new ,
i mp r oved ones a r e b orn .
How­
eve r .
consu me r s f i nd s t a n d a r d s conven i en t ,
and p r odu c e r s t y p i ca l l y f i nd s t a n d a r d s c r u ­
cia1 .
Good e x amp l e s of s t a nd a r d s t ha t beg t o
be
i gnored
can
be
f ound
in
t he
bu s ses
i nv e n t e d i n t he e a r l y days o f m i c r ocomp u t ­
ers .
E ng i nee r s I know a g r ee tha t t he 5 - 1 00
b u s i s poor l y de s i gned .
T he y wou l d l ove t o
be ab l e t o m a k e a f ew changes t o i t s spec i ­
f 1 c a t i o ns .
Our
own
5 5 - 50
bus
ha s
gone
t h rough some evo l u t i o n .
but ex tend i ng t he
address
space
beyond
a
megaby te
wi l l
requ i re f u r t h e r changes t o t he s t andard .
I don ' t know hardware ve r y w e l l . b u t
i ma g i ne e l ec t r i ca l e n g i nee r s l ea r n t o w o r k
a r ound s t anda r d s a b o u t
t he s a m e way p r o ­
g r amme r s do .
S t r i c t a dh e r ence t o s t a n d a r d s
even
when
t hey
have b e e n o u t g rown
o f t en
r e s u l t s i n a " k l udge . "
E i t h e r t he o l d code
i s l e f t t he r e a nd a new s t ru c t u r e bu i l t on
t op of i t . or i t i s ent i r e l y rep l aced w i t h
code t ha t does t h i ngs
" r i gh t . " a nd adhe r ­
ence t o t he s t a nd a r d i s added o n a s a spe­
cial
case ,
somet h i ng ug l y hang i ng off
t he
s i de of t he new i dea .
B o t h of t hese s o l u ­
t i o n s l oo k l i ke poor des i gn .
I B M i s a good e x a mp 1 e of a company ,
in
f ac t a n i ndu s t r y ,
caug h t o n a ho rns of a
s t a nd a r d .
Y e a r s ago t he y i nven t ed t he 3 6 0
a r ch i t e c t u r e ,
a compu t e r a r C h i t e c t u r e t h a t
t hey
u sed
for
al l
t he i r
compu t e r s .
T he
i dea of hav i ng a l i ne of compa t i b l e compu t ­
e r s caught o n n i ce l y .
L a t e r , t he y e x t ended
the
360
a r c h i t ec t u re
to
i nc l ude
v i r t ua l
memo r y a nd a f e w o t he r good i e s , g i v i ng t he
3 7 0 a r ch i t e c t u re .
I t w a s a l so qu i t e s u c ­
ce s s f u 1 .
C u s t ome r s
seemed
to
app rec i a t e
be i ng a b l e t o move t o mo re powe r f u l compu t ­
e r s w i t hou t
r e w r i t i ng a ny s o f t ware .
Most
recent 1 y ,
I BM p r oduced X A , a n e x t e n s i on o f
t he
370 a r ch i t e c t u re W h 1 Ch
3 7 0 cus t omer s
c a n move t o r e l a t i ve l y pa i n l es s l y .
t ha t r a n under M F T ( a n o l d ope r a t ­
s hou l d
run w i t h
no
s y s tem
for
360s )
i ng
i mpo r t a n t changes under t he l a t e s t ver s i on
of MV5 .
T h i s l eve l of compat i b i l i t y ex i s t s
on l y beca u s e I BM ha s s t u ck g r i m l y t o
i ts
s t a nd a r d s .
T h i s p r a c t i ce h a s br ou gh t t hem
succes s , but not c r i t i ca l a cc l a i m .
I k now
ope r a t i ng
s y s t em
expe r t s
who
p r e t end
to
w i th
f ee l
s i ck
when
MVS
is
ment i oned
s ome j u s t i f i ca t i o n .
con t a i ns l ayer a f t e r
T h a t ope r a t i ng s y s tem
l a y er of h i s t o r y .
In
some p l aces t he comp l e x i t y i s so t h i c k i t
;s
p r ac t i ca l l y
i mposs i b l e
to
f i gu re
out
wha t
t he p r ogramme r was
t r y i ng t o do .
I
i mag i ne t h a t , i f t he e f f o r t w h i c h goes i n t o
adap t i ng M V 5 a n d 3 7 0 a r ch i t e c t u r e t o modern
needs
were
d i rected
t ow a r d
des i gn i ng
new
hardware and s o f t wa re ,
t he r e su l t wou l d be
much f a s te r and mor e u s e f u l t ha r. I BM ' s c u r ­
r e n t 3 7 0 - t ype p r odu c t s .
I b e t t he r e a r �
nume r ou s e n g i nee r s a n d comp u t er s c i ent i s t s
a t I BM who yea r n t o j u nk t he o l d s t anda rdS
i n f av o r o f some t h i ng be t t er .
S t a nda r ds
1 i ke
5 - 1 00 ,
5 5 - 50 ,
and
360 / 370 a r c h i t e c t u r e have t i e d manu f ac t u r ­
ers
to d i nosa u r s .
They can ' t depa r t f rom
t he i r s t a nd a r d s w i t hou t
hu r t i ng ,
a nd per­
haps
l O S i ng c u s tome r s .
T he
big
comp u t e r
a nd
sof twa r e
ma n u f a c t u r e r s
p r oba b l y
have
m i xed f ee l i ng abou t s t a nda r ds .
The con s u m ­
e r s of t h e i r p r odu c t s f ee l a b o u t t he same
way .
er
I t i s h a r d to r e S i s t a s ex y new compu t ­
o r p i ece of s o f t w a r e .
The non- s t andard
o f f e r i ngs are f r equent l y f a s t e r and i n var ­
i ou s ways be t t er t ha n t he mo r e conse r va t i ve
ones .
T he
prob l em
is
t ha t
non- s t a nd ard
compu t e r s o r ope r a t i ng s y s tems a re
r i s ky .
T he e x c i tement of be i ng t he on l y per s on i n
t he s t a t e w i t h some f a s t , e l egant ope r a t i ng
s y s tem f a de s
fast
whe n
you
have
t ro ub l e s
w i t h s o f t w a r e ava i 1 ab i 1 i t y .
We a r e 1 u c k y t o be u s i ng h a r dw a r e a nd
sof t wa r e
that
have
gOOd
s t a nda rds .
CoCo
u sers are dea l i ng w i t h o n l y one vendor and
one mach i ne .
It
i s a s hame
Tandy d i dn ' t
dec i de to u se t he same d i s k f o r m a t a l l t he
o t he r 0 5 - S s y s t ems do .
but a t
l ea s t t ha t
p r ob l em i s w e l l
k nown .
I t s hou l d b e e a sy
t o exchange sof t w a r e a n d hardware bet ween
CoCos .
; s a l so a good s t andard
The 5 5 - 50 bus
wh i ch ha s been carefu l l y respec t ed by t he
vendo r s t ha t suppo r t
i t.
I
r a n my G i m i x
d i sk
con t ro l l e r
boa r d
w i th
a
5WTPc
CPU
boa r d a nd memory b o a r d s f r om t hree d i f f e r ­
ent s ou r ces f o r about a year w i t h no t r ou­
ble.
If
al l
those
m a nu f ac t u r e r s
hadn ' t
respec t ed
t he
5 5 - 50 s t a n da r d ,
I
cou l dn ' t
have done t h a t .
M i c r ow a r e 0 5 - 9 i s s o l i d a c r o s s a l l
t he
mac h i nes I k now of .
I t i s ev en pos s i b l e t o
move f r om Leve l
O ne
to Leve l
Two wi t hout
( pr ov i ded
chang i ng
sof tware
t he
p r og rams
were wr i t ten to appropr i a t e s t andards ) .
An
0 5 - 9 user can t rade f r om a CoCo t o a He l i x
t o a G i m i x I I I s y s t em w i t hou t r ew r i t i ng any
programs except whe re t hey u s e spec i a l
I /O
f ea t u re s of each compu t e r ( l i ke g r aph i c s on
t he CoCo ) .
A s o f t wa r e house can u s e t he i r
Gimix III
s y s t em w i t h
i t s h i gh speed a nd
debugg i ng
f a c i l i t i es
to
deve l op
s o f t wa re
w h i ch w i l l r u n on a CoCo .
U s ua l l y we can
o rder s of t w a r e w i t hout p a y i ng a t t e n t i o n t o
t he manu f a c t u r e r
of
our mach i ne .
C o l umn S i x t e e n
101
ant
T he s t a nd a r d s w i t h i n O S - 9 a r e as 1 mp o r ­
as
t he
i nt e r f ace
to
user
p r og r ams .
dev i ce dr i v e r s and o t he r s y s tem modu l e s
It
t a t i on
i s a good ques t i on w he t he r documen­
f o r a pr oj ect s hou l d be i n t he same
i nc l ude
with
t he
c o l umn
o c ca s i ona l l y
� �ou l d r u n o n a ny O S � 9 s y s t em w i t h s u i t a� l e
ha�dwa re .
I
re l y o n M i croware
to
s t i ck
\' 1 t h
t he ; n t e r f ac e s bet ween s y s t em mod u l e s
d i re :::: t o r y w i t h t he s ou rce o f p ro g r am s f o r
t h a t p r o j e c t . i n a s i b l i ng o f t ha t d i r ec t o ­
r y ded i ca t ed t o docume n t a t i on f o r sever a l
p r o j ec t s ( o r j us t f o r a s i ng l e p r oj e c t ) , o r
i n a d i rec t o r y w h i ch
I s t he c h i l d o f t h e
t ha t
d i r e c t o r y w i t h t he s o u r ce
:le
t he y
have
s pe c i f i ed
If
I
ever
f i nd
t he money f o r i t ,
I w i l l be ab l e t o buy a
I f t he ven­
g r aph l c s b oa r d f o r my s y s t em .
it
d o r i s s e l l i n g i t for t he O S - 9 ma r k e t ,
w i l l come w i t h s o f t wa r e t o hook i t i n t o m y
s y s t em .
T ha t s o f t ware w i l l a l mo s t c e r t a i n 1 y
work
t e s t ed
f a ces
it
beca u s e
on
a
i ts
s y s tem
a u t hor
w i th
bet ween s y s t em modu l es
wrote
t he
s ame
as
m i ne .
it
and
it .
Some
peop l e
t h i nk
t ha t
d i r e ct o r i e s
s hou l d c on t a i n e i t he r o n l y o t h e r d i r e c t o ­
r i e s , o r o n l y da t a f i l es .
1 d on ' t t h i n k I
I i k e t ha t i de a , bu t I c a n s ee s ome va l ue i n
i t .
l nter­
P ro gr ammer s have t he mos t t o ga i n f r om
carefu l l y
f o l l owed
s t anda r d s .
If
someone
b u y s a p r o g r am t ha t doe s n ' t r u n o n h i s com ­
p u t e r , he w i l l comp l a i n - - maybe r e t u rn t he
p ro g � am .
T h i s 1 5 a p r ob l em f o r t he con sum ­
er ,
but f or t he a u t h o r o f t ha t p r o g r a m i t
i s a d i sa s t e r .
I ma g i ne wha t i t wou l o f ee l
, l k e t o s p e nd � h ou s a nd s o f hou r s c rea t i ng a
a
program .
t he n
d i scover
of
ma s t e rp i ec e
t �a t i t wou l d o n l y run o n a f ew of t he com­
p u t e r s you had c o u n t e d o n f o r your m a r ke t .
W i t h M i c r o w a r e 0 5 - 9 on a ny s uppor t e d com­
puter a
p r og r amm e r c a n be c o n f i de n t
t ha t
t ha t w on ' t happen .
P r o g r amm e r s
w ou l d
l i ke
to
see
more
s ta nd a r dS i n t he O S - 9 wor l d .
I have w i s hed
i nter­
a nd w o r k e d f o r a s t a nd a r d t e r m i na 1
It
i s a shame t ha t
f ac e f o r a year now .
eac h p r og rammer who wan t s t o s e l l n i s p ro ­
g r a m s ha s t o i nvent a w a y t o a d a p t h i s p r o ­
g r am to w ha t ever k i nd of t e r m i na l
i t m i ght
en c o u nt er . A s t a nd a r d he re wou l d save d a y s
i n p r og ram d e v e l opment t i me f o r each pro­
g r am t ha t u s e d i t , encour age more program­
mers t o use t er m ; n a 1 f e a t u r e s s uppor ted by
s t anda r d ,
a n d g i ve
pu r C h a s e r s
conf i ­
t he
dence t ha t a p r o g r am wou l d work w i t h t he i r
t e rm i na l s .
S TANDARDS THAT ARE THE USER ' S
RE SPONS I B I L I TY
I f your
system
comes
to
you
non­
s t a nd a r d i n some way ,
you s hou l d comp l a i n
Once you have
t o t he p e r s o n r e s ponS i b l e .
Y ou can g e ne r a t e a dd i ­
i t , i t ' s you r ba�y .
t i on a l
s t a nd a r ds
t o s i mp l i fy your s y s t em .
o r l e t Chaos g row i n you r s y s tem .
areas
come
to
m i nd
as
good
Seve r a l
i ns t i t u t e s t anda r d s .
D i r e c t ory
p l aces
to
i s
an e spec i a l l y good p l ace t o
s t r u c t u re
I f y o u w r i t e a l ot o f
dev i s e a s t andard .
p r o g r am s , you m a y need iii nam i ng conven t i on .
A s e t of s t a nd a r d s f or document a t i on m i g h t
he l p keep i t up- t O - da t e .
There are t wo po l i c i es t ha t Can be u s ed
to
gu i de
t he
c o n s t ru c t i on
of
d i rectory
The
d i r e c t o r i es
can
be
s t r u c t u re s .
( pro­
a r r a nged
by
what
t he
c o n t e nt s
are
g r am s ,
t ex t ,
s pread s he e t
i nf O . ) ,
or by
( s o r t p r o g r am s ,
house­
what
t he y a r e f o r
h o 1 d , U s e r G r ou p f j 1 es ) .
E a C h me t hod has
i t s charm .
I us e bot h . each where i t seems
appropr i a t e , bu t 1 w i sh I had dec i ded ear l y
Wh l C h way I w a n t e d to go and s t uck w i t h i t .
So me t l me s
I
have
to sea r C h f o r m i n u t e s
b e f o r e I f i nd a f i l e I haven ' t u s e d i n a
few months .
1 02
in
05 - 9 U s e r Not e s Vo l ume I
P r o g r a m names deserve s e r i ou s t hou gh t .
T he S ho r t e r t hey a r e t he f a s t er t hey c a n be
t yped .
I t i s e a S i e r t o t ype L t ha n L I ST ,
but t he s h o r t e r names a re t he mo r e c r y p t i C
t hey become .
L OOK or L OGO F F c ou l d a l s o be
abb r ev i a t ed L .
I t has t o be c l ea r wh a t t he
abb r ev l a t i on s t a nds f or .
I t makes sense to
me t o g i ve s h o r t names to f requ e n t 1 y u s e d
p r o grams .
The names of
t he commandS w i 1 1
s t ay
f re s h
i n t he m i n d
if
t hey a r e f re ­
q u e n t l y u s e d even i f t hey a re n ' t v e r y m n e ­
mon i c .
Less
f requent l y
used
p r og r a m s
s ho u l d have l onger n a m e s bo t h t o save s ho r t
names
f or
more
f requen t l y
u s e d commands ,
a n d to j og t he memo r y abou t t he i r f u n ct i on .
THE USERS GROUP
T he 05 - 9 U s e r s G r oup p l a n s t o s u bm i t a
of
" r equ i remen t s " to M i c r oware at t he
05-9
Sem i na r
thi s
s ummer .
If
you
have
s p o t t ed iii f l a w i n � i c r owa r e ' s so f t wa r e t ha t
you t h i nk i s o f g ene r a l
i n t er e s t , o r wou l d
1 i k e t o s u g g e s t t h a t a new f e a t u re s hou l d
be
a dded t o one o f
t he i r' pr oduc t s ,
this
wou l d be a good way to br i ng i t t o �'l i c r o ­
w a r e ' s a t t en t i on .
S u bm i t
you r
s u gg es t i on
i n w r i t i ng to t he U se r s G r ou p e a r l y enough
t na t i t w i l l reach us at l ea s t a f ew week S
bef o re
t he
S em i na r .
P l ease
keep
it
to
a b o u t a page o r l es s .
We w i l l have c op i es
of
al l
the
sugges t i on s
a va i l ab l e
at
t he
U s e r s G r ou p boo t h a t t he s em i na r .
T he s u g ­
g es t i on s
wi l l
b e d i s cu s s e d
at
t he
Users
G r ou p mee t i n 9 a n d t hose abo u t wh i ch we can
reach a c o n s e n s u s w i 1 1
be g i ve n to M i c r o ­
ware .
We
wil l
try
to
get
an
of f i c i a l
r e s p on s e t o each sugges t i on f r om M i c r owa r e
somet h i ng
l i Ke :
i mp o s s i b l e ,
not
i nter ­
e s ted ,
wi l l
dO ,
wonder f u l
s ugge s t i on ,
or
a l ready done .
1 ist
COLUMN SEVENTEEN -- THE
F I RST STEP I NTO 05- 9
ki l l
•
There
has
been
s om e
ca l l
recent l y
f or
i nf o r ma t i on f o r t he beg i nn i ng u s e r of O S - S .
C o l or
Compu t e r
users
new
to
05-9
f ee l
swamped by t he number o f d e t .a i 1 s
i nvo 1 veO
i n t he ope ra t i ng s y s t em .
T h i s c o l umn i s an
a t t em p t
t o make 0 5 - S
seem S i mp l e r
to new
users .
T he D S - 9 opera t i ng s y s t e m has s t a r t ed
t o oeve l op a repu t a t i on f o r comp l e x i t y and
O O S C \.J r i t y - - i n o t her w o r d s . us er h o s t i l i ­
ty .
I t i s an u n j u s t a c c u s a t i on .
The t h i ng
t ha t mak e s 0 5 - 9 app e a r c o nf u s i ng i s t he way
i t
is
p r e s e n t ed .
The r e
are
many
subt l e
f ea t u r e s
in
t he
ope r a t i ng
system ,
and
a
l ar g e a r r a y of u t i l i t i e s
The manua l s t ha t
come
wi th
i t
c ou l d he l p b u t
don ' t .
T he
O S - 9 man ua l s w e r e w r i t t e n a s r e f e r ence ma n­
u a l s . n o t t u t or i a l s .
T hey d rop e v e r y t h i ng
on you
a t once .
A
new 0 5 - 9 u s e r who
is
wi th
compu t e r s
or
ver y b r a ve
e xpe r i en ce d
s hou l d
re ad
t he
m anua l s ,
w r ap
his
m i nd
a round t he w ho l e t h i ng . a nd s i t down a t t he
compu t e r t o enj oy O S - 9 .
T ha t 1 5 t he qu i ck .
b r u t e f orce . way t o l ea r n O S - 9 . b u t i f i t
doesn ' t w or k f o r you , I recommend a gent l e r
approac h .
My
copy
of
CoCo
OS-9
i nc l udes
abou t
c ommands .
Al l
t he s e
commands
a re
f i f ty
i mpor t an t t o a t l ea s t s ome peop l e , b u t mos t
of
t hem a re o n l y c o nf us i ng to to new 0 5 - 9
users .
T he
ent i re
Engl i Sh
l a nguage
i nc l udes
more
t ha n
a
h undred
t ho u s a nd
wor ds . bu t m o s t peop l e on l y u s e f ewer t ha n
t w e nty t hou sand of t hem . a nd i t i s p o s s i b l e
t o commun 1 c a t e w i t h a vocab u l a r y o f a t ho u ­
s a n d wor ds or l es s .
Oper a t i ng s ys t ems l i ke
Un i x and O S - S are much l i ke E ng l i s h in t ha t
respec t .
Of
al l
t he
commands
a va i l ab l e
under O S - 9 a bo u t a dozen a r e rea l l y nece s ­
sary .
T he b a r e m i n i m u m s e t o f O S - 9 com­
mands a r e :
b ack up
•
copy
de l
•
dir
•
edi t
•
f o rm a t
•
f ree
•
1 i st
setpr
T he
on l y
s he l l
comma nds
t ha t
you
r ea l l y
need t o k now a r e cho a nd c hx .
I f you m e a n
to
do
a s s emb l y
l a ngu a ge
p r ogr a mm i ng
you
w i l l a l so need :
asm
debug
If
•
you
wi l l
be u s i ng B a s i c09
you w 1 l l
need :
B a s i cQ9
R u nB
•
GFX
Of
al l
t he se comm a n d s
t here a r e f o u r
t ha t
need
exp l a na t 1 0 n
e s peC i a l l y
ba d l y .
F o rm a t need s t o be d i s c u s se d beca u s e i t i s
dangerou s ;
i f i t i s u s ed c a r e 1 e s s 1 y i t c a n
d e s t roy i mpor t a n t i nf o r ma t i on .
B ACKUP i s a
r e l a t i ve l y f a s t wa y t o copy a n e n t i re d i s k
( i t 1 S a good t h i ng t o ge t
i n t o t he h ab i t
of do i ng t h i s ) ; pe r h a p s a c a re f u l d i scu s ­
s i on o f BACKUP w i l l encou rage peop l e t o u s e
i t more .
E x p l a i n i ng O I R i s a good e x c u s e
t o s a y a f ew t h i ng s a bo u t d i r ec t o r i e s :
an
i mpor t an t
f ea t u re
of
05-9 .
CHX
a no
CHD
a l so
rel ate
to
d i r ec t or i es .
and
seem
s t ra i gh t f o rwa r d .
Wha t t he y a r e supposed t o
d o ma t t e r s l es s t o a p e r son w i t h a 0 5 - 9 o n
a s ma l l compu t e r t ha n t he i r unof f i c i a l S i de
e f f ec t s .
FORMAT
The f o r m a t command i s t he f i r s t one t o u s e ,
U n t i l a d i s k has been f o rma t t e d i t i s u n u ­
sab l e t o O S - 9 .
T he f o rma t command wr i t e s a
pa t t e r n on t he d i s k wh i c h ma r k s
t he d i s k
( Wh i c h a mou nt t o p i geon ­
of f i nt o s ec t o r s
ho l e s f o r O S - 9 t o s t or e d a t a
i n) .
After
wr i t i ng t h e pa t te r n f o r m a t C hec k s t h e d i s k
to
mak e
c er t a i n
t he
pa t t e r n
is
recorded
c o r r e c t l y on t he d i S k .
I f i t i s n ' t . f orm a t
w i l l n o t e t ha t t he s ec t o r s whe re t h e e r ro r s
occu r r ed
are
f au l t y .
a nd
t hose
sec t o r s
won ' t be u s ed t o s t o r e da t a .
F o r m a t a l so
wr i t es some i nf o r ma t i on wh i C h w i 1 1 be u s e d
t o manage f i l es on t ha t d i s k .
I n t he p r o ­
c e s s o f do i ng a l l
t h i S t he f orma t p r og r am
comp l e t e l y e r a se s t he d i sk .
I f t he d i sk i s
f re s h o u t of a box o f
new d i s k s you c a n
f ee l cer ta i n t ha t t he r e i s n o t h i ng o n t he
d i sk t h a t you ca r e a b ou t . bu t . i f i t i s one
you a r e recyc l i ng . be c a r ef u l .
Af ter for­
mat
i s s t a r t ed a ny da t a t ha t was o n t ha t
d i sk i s gone f or ever ,
rename
•
T he
the
t he
bu i 1
•
s he 1 1
s he 1 1
is
t he program wh , ch proc e s s e s
commands y o u t ype
i nt o 05-9 and runs
o t he r comma nds .
S e ve r a l
commands a r e
t i n t o t he s he l l .
T hey a r e :
chd
P u t t he d i S k you w a n t t o f o r m a t i n t he
d r i ve you aren ' t u s i ng f o r t he s ys t e m d i s k
( I ' m go i ng to a s sume you have your s y s t em
and t he
d i s k i n t t"oe dr i ve 0 5 - 9 ca l l s / 00 .
d i sk
you
want
to
f orma t
in
d r i ve
/0 1 ) .
I nv ok e t he f or m a t comma nd by t yp i ng F O RM A ,
/ 0 1 a t t he 0 5 - 9 p r ompt .
T ne command l i n e
s hou l d l oo k l i k e :
OS9 : FORMAT /01
Chx
t o wh i Ch you st"oou l d g e t
•
t he r e s ponse :
ex
101
C o l umn S ev e n t ee n - - The F i r st
Step I nto 05-9
103
COLOR COMPUTER FORMATTER
FORMATTING DR I V E ID!
Y (YES) OR N (NO)
R EADY ?
BaC KUp
ate
disk
out
of
d r i ve
/00
at
th i s
po i n t
even
if
you
a re
f o r ma t t i n g
t he
d i sk
in
d r i v e one .
T he r e
i s n o da nge r o f f o rma t
w r i t i ng on t he w r ong d i s k , b u t you ca n ' t be
t oo c a r e f u l .
I f you r ep l y N t o t he R E AD Y ?
p rompt f o r m a t w i l l qu i t i mmed i a t e l y l ea v i ng
t he
d i sk
i n t ac t .
If
you
rep l y Y ,
t here
wi I I
be a p a u s e ( 23 seconds on m y CoC o ) .
t he n f o r m a t w i l ' p r om p t you f o r a name f o r
t he d i s k .
T he p r ompt w i l l l ook 1 i ke :
DISK NAME :
At
this
po i nt
enter
t he
name
you
have
T he name c a n be u p
ass i gned t o t h e d i s k .
to
32
c ha r a c t e r s
l ong
and
may
i nc l ude
b l anks ,
F o l l ow
t he
d i sk
name
wi th
an
E NT E R .
F o r m a t w i l l now check t he d i s k .
As
i t c necks each t ra c k o n t he d i sk
i t wi 1 1
wr 1 te
t he
t rack
number
to
t he s c reen
in
I f you have a t h i r ­
hexadec i ma l ( b a s e 1 6 ) .
t y f i ve t r a ck d r i ve .
t he numbers w i l l
be
f ro m 000 to 022 ,
T hen f or m a t w i l l
p r i nt
t he m e s s age :
NUMBER OF GOOD SECTOR S : $000276
If
t he numOer
i s s ma l l e r
numoer
wh 1 c h
is
630
s ec t or s were f au l t y .
16
t han 2 7 6
(a
i n dec i ma l )
OS9 : FREE /01
r e sponse s hou l d be somet h i ng
?:
At
t h i s p o i nt
pu t
t he
d i sk
you
want
to
copy
i n /00 and a f or ma t t ed d i s k w h i c h has no t h ­
i ng you wa n t t o k ee p o n i t
i n d r i ve / 0 1 .
Then check t he d i s K i n / D l . . .
B ACKUP w i l l
e r a s e a n y t h i ng t h a t ' s o n t ha t d i S k .
When
you are c e r t a i n e v e r y t h i ng
i s O K t ype Y .
Now B A C KUP
wi l l
doub l e check w i t h you by
t e l l i ng you t he name of t he d i S k
i n dr i ve
/0 1 . T he m e s s age w i l l l oo k 1 i ke :
THE DISK
IS BE ING SCRATCHED
OK ? :
I f you r e p l y Y t o t h i s . t he b a c k u p f r om t he
d i sk
I n /00 to t he d i sk
i n /0 1 .... i 1 1
take
p l ac e .
The
d i sk
in
/0 1
wi l l
become
an
e x ac t coPy o f t he d i sk i n /00 r i gh t down t o
t he d i s k ' s name ,
1 i ke
The
a
8 AC KUP
comman d
t akes
what
seems
l on g t i me
to
run .
There
are
t wo
t h i ng s t h a t c a n speed i t u p .
One i s t o use
t he - v o p t i on wh i c h p r eve n t s t he copy f rom
be i ng ve r i f i ed .
I don ' t s u g ge s t t ha t a n y ­
on e
use
th1s
oot i on .
The
o t he r
way
to
speed B A C K U P u p i s t o 1 ns t r u c t O S - 9 t o g i ve
i t e x t r a memor y to r u n i n .
B A CKUP c a n u s e
e x t r a memor y t o r u n mor e qu i ck 1 y ,
BACKUP
r a n f o r o n e m i nu t e sa s e c o n d s w he n I s t a r t ­
e d i t w i t h t he command l i ne :
OS9 : BACKUP
uses
Norma I 1 Y B A CK U P
i t mor e
If
you g i ve
w i t h t he command 1 i ne :
19
pages
of
memo r y .
say
1 00 pages - -
OS9 : BACKUP 1/ 100
it runs
i n one m i n u t e 4 8 sec ondS .
It
is
a l so q u i e t e r beca u s e t he heads o n t he d i s k s
don ' t l oa d a nd u n l o a d a s o f t e n .
l i ke :
di s k name CREATED ON 84/ 0 1 /24
CAPAC I TY : 6 3 0 S ECTORS ( I -SECTOR
CLUSTERS)
6 2 0 FREE SECTOR S , LARGEST B LOCK
620 SECTORS
Whe r e " d i s K name " i n t he f i r s t 1 i ne o f t he
r e s p onse w i l l be t he name you gave t he d i sk
when yoU f o rma t t ed i t .
D IR
T he command wh i ch t e l l s you w h a t f i l es a r e
( short for
o n e your d i s k s
i s t he t he D i r
d i rec t o r�' ) command .
I f y o u j u s t t ype O I R
a f t e r boot i ng O S - 9 you w i l l g e t a r e s p o n s e
1 ; ke
DIREC TORY OF . 2 3 : 55 : 08
OS9BOOT
CMOS
SYS
DEFS
STARTUP
BACKUP
1
L..-_
_
The nex t command
to use li f t e r
t he f o rma t
command i s BA CKUP , I t i s c r UC i a l to ha ve a
ba c k u p copy
of each s o f t wa re d i s t r i bu t i on
d i s k you have .
I f you m ake an e r r o r t h a t
damages t he o n l y d I s k w i t h a n s i gn i f i ca n t
p i e c e o f sof t wa re on
1 t
you w i 1 1 h l!l v e t o
wa i t u n t ; 1
you c a n ge t a r ep l a cement
for
t he d i s k bef o re you c a n u s e y o u r comp u t er
aga i n .
E ve n i f t he t i me wa s t ed wa i t i ng f o r
t he
r ep l aceme n t
d isk
i sn ' t
i mp o r t ar. t
to
you .
conS 1 de r t ha t
rep l acement d i s k s c o s t
mone y .
104
OS9 : BACKUP Th e r e s pons e w i l l b e :
READY TO BACKUP FROM /DO TO / D l
base
some
I f you w a n t t o demons t r a t e t o you r s e l f
:I t
f o r m a t d i d so me t h i ng t o t he d i s k t r y
',e
F R E E command on t he new d i s k .
Enter
. ne
command
FREE
/0 1 .
The
command
l i ne
s ho u l d l oo k l i k e :
T he
i s a r e l a t i ve l y f a s t way to c re ­
copy o f a d i s k ,
I t ha s many
exac t
opt i on s ,
bu t
t he S i mp l es t
way to
use t he
command i s t o j u s t g i ve t he comma n d B A C K U P .
T he command l i ne S hou l d l oo k l i k e :
1 his
is
f o rma t
g i v i ng
you
a
chance
to
c h a n g e you r m i nd ,
I t i s a l s o a way f o r you
to f o rma t d i s k s
i f you o n l y have one d r i ve ,
a S k i ng
f o rmat
to
f ormat
t he
d i sk
in
by
d r I ve
/00 a nd r ep l a c i ng t he s y s t em d i s k
w i t h t he d i s k you want t o f o rma t i n at t h i S
pO I n t ,
In
e , t he r c a s e d o u b l e chec k
t ha t
you a re abou t to f or m a t t he c o r rect d 1 S k ,
I f you w a n t t o be e s p e c i a l l y s a f e t a k e your
sys t em
an
08 - 9 U s e r No t e s Vo l ume I
T h I S mea n s t h a t you a r e l i s t i ng t he c u r r e n t
d i rec t o ry wh i C h i s
k nown b y t h e p s e u d o nym
" . " at 1 1 : 5 5 : 08 i n t he even i ng .
T he f i l e s
i n t ha t d i r e c t o r y a r e O S9 8 0 0T ,
CMOS .
SYS .
DE F S .
a nd
STA"TUP .
Now .
in
f ac t
on l y
O S 98 0 0 T a n d S T A R T U P a r e no rma l
f i l es ,
t he
o t h er t h r e e f i l es a r e subd i r e c t o r i e s .
Sub­
i nt e r es t i ng t op i c
d i re c t o r i es a re S u c r, a n
t ha t
t hey
we r e
t he
s u b j e ct
of
t he i r
own
c o 1 umn some m o n t h s ago . a nd won ' t be cov­
e r ed
any
more
t ha n
abso l u t e l y
n ec e s s a r y
he re .
To
f i nd o u t
t he i r names u s e
more
about
t he comma nd
t he
OIR
f i l es
t ha n
E
OS9 : DIR E
wh i c h w i l l
CHO /01
r e spond :
DIRECTORY OF .
23 : 59 : 5 7
OWNER
START
CREATED
ATTR
ON
8 3 / 06 / 0 2
- - ----WR
8 3 / 06/02
D-EWREWR
8 3 / 06 / 0 2
D-EWREWR
8 3 / 06 / 0 2
D-EWREWR
8 3 / 06 / 0 2
----R-WR
1921
wi 1 1
cause a l l
f u t ure
r ef e r en ces
f i l es t o l ook f or t hem o n / 0 1 .
NAME
S IZE
OS9 BOOT
3032
0
1956
CMOS
6AO
3C
2 002
0
SYS
164
AO
2002
0
OEF S
CO
17F
2 003
S TAR TUP
0
1 F5
E
0
A
da t a
d i r ec t ory 0 5 - 9 goes d i rec t l y t o t he d i rec ­
t o r y ' s l oca t i o n on d i s k a n d s t a r t s r ead i ng
. . . i mag i ne wha t wou l d happen i f you f oo l e d
0 5 - 9 by chang i ng d i sk s .
Y o u c h a nge d i s k s
a n d t ype a command l i k e
L I S T FDO
t he n
,t
wi l l
s t op beCause
t he
screen
is
When you a r e r eady t o c o n t i n u e h i t
fu 1 1 .
a ny k e y . . . I u sus 1 1 y p r e s s t he space b a r .
T ha t w a s t he e nd of t he d i r ec t o r y .
so a l l
you get a f t er you 1 e t t he o u t p u t c o n t 1 nue
i s � f ew b l a n k l i ne s a nd a new OS9 p r ompt .
Two of t he f i e l ds i n t he 0 1 R E o u t p u t
a r e of no spec i a l i n t e r e s t u n t i l y o u become
OWNE R .
and S T A R T .
a n advanced O S - 9 u s e r :
T he f i r s t t w o f i e l ds f or e a c h f i l e a re t he
da t e a n d t i me t he f 1 1 e w a s c r ea t ed .
T he
da t e
is
i n t he u s u a l
Y Y /MM / D D
f orma t a nd
t he t i me i s i n HHMM f o rma t w i t h h o u r s r a n g ­
i ng
f rOm 00
to 2 3 .
T he
a t t r i bu t e s
f ie l d
conta i ns
i nf o r m a t i on
about
wha t
t he
f i le
c a n be use d f or .
The rna i n t h i ng
now
is
t ha t f i l es w 1 t h a 0 a s t he f i r s t c ha r a c t e r
d i r e c to r i es .
in
t he
a t t r i bu t e
f ield
a re
F i l e s w i t h a d a s h a s t he f i r s t cha r a c t e r
t he i r a t t r i bu t e f i e l d a re nor m a l f i l es .
to
T o speed O S - 9 uP .
t he l oca t i on o f t he
d i rec t or y f i l e on t he d i s k i s k e p t i n memo­
ry .
T h l S l eads to t he s i de e f f ec t o f t he
C h d a n d Chx comman ds .
When you read t he
= = = = = = = = = = = == � � = = = = s = = z c _ = = = = =
in
T he o t h e r opt i on w h i ch c a n be u s e d w i t h
t he 0 1 R command i s X .
T he X o p t i on
is a
s ho r t hand way to g e t t he d i r e c t o ry of t he
execut i on d i r e c t o r y : t ha t i s . t he d i r e c t o r y
0 5 - 9 sea rches " O r p r o g r a m s .
1 i k e t he com­
ma nd S ,
you
ask
it
to
run .
The
command
1 i ne :
OIR
da t a d i r e c t o r y i s /00 .
I f you h a ve a s e c ­
o n d d r i v e ( I h a v e been a s sum i n g
t ha t you
do ) you w i l l prObab l y want to use t ha t f o r
T he comma nd :
dat a .
X
w i l l g i ve y ou a r a t he r l on g 1 i s t of a l l t he
f i l es i n you r execu t i on d i r e c t o r y .
I f you
haven ' t w r i t ten any o f your own p r o g r ams .
t h i s w i l l be a l i s t of a l l t he commands a nd
u t i l i ty p r o g r a ms wh i ch came w i t h O S - 9 .
Y ou
w i 1 1 probab 1 y have t o p r e s s t he s p a ce b a r
i n t he m i dd l e of t he o u t pu t o f
t h i S com­
mand .
I t i s more t han one page l ong .
CHX AND CHD
C h x s t a nd s f o r C h a nge E xecu t i o n D i r ec t o r y ,
Chd
for
C ha nge
Data
D i r e c t or y .
05-9
expec t s t o f i nd a l l command s , whe t her t hey
are pa r t o f t he o pe r a t i n g s y s t em o r some­
t h i ng you w r o t e ,
in t he e x ecu t i o n d i r e c t o ­
A l l f i l es t ha t y o u don ' t m e a n t o e x e ­
ry .
c u t e ar e l ooked f o r i n t he Oa t a d i r e c t or y .
( T here
are
ways
a ro u n d
both
of
t he s e
res t r i c t i on s , b u t l e t ' S s k i p t ha t f o r n ow . )
A f te r y o u b o o t 0 5 - 9 yo u w i l l f i nd t ha t t he
execut i on
d i rectory
i s
/ OO / C M D S
and
t he
or
even J u s t 0 1 R .
Y o u r o pe r a t i ng s y s t em
wil l
s t a r t read i ng whe r e t he d i r ec t o r y i s
s upposed
t o be .
S i nce
t he
d i sk
w i th
a
d i r ec t or y a t t he s e l e c t e d s p o t
i s s i t t i ng
i n i t s enve l ope a nd s ome o t her d i s k
is �n
t he d r i ve , 0 5 - 9 w i l l
f i nd somet h i ng u n e x ­
p e c t ed w h e r e t he d i r ec t o ry was .
T he r e s u l t
cou l d
be a n y o f
s e ve r a l
error
mes s a ge s .
T he s o l u t i on t o t h 1 s p r ob l em i s t o a l wa y s
g i ve O S - 9 a chance t o f i nd t he d i r e c t o r i es
on a new d i sk by g i v 1 ng i t C hd a n d C h x com­
ma nds a s neces s a r y when you change d 1 s k s .
T he r e
i s o ne
l as t
t r i ck y t h i ng
abou t
t he C hx / C hd command s ' spec i a l u s e .
I f you
k e ep t h i n g s s i mp l e i t w i l l
s eem t ha t you
o n l y need to u s e t he Chx comma n d , but t h i s
i s j u s t a spec 1 a l c a s e
I s u g ge s t t ha t you
l ea r n how t o make d i rec t o r i es An d use t he m
when you c a n , b u t ,
unt i l
you s t a r t u s i ng
t he new d i sk s you u s e t o s t o r e da t a
t hem .
w i 1 1 o n l y have t he d i r ec t o r y F ORMAT a u t o ­
ma t i ca l l y cr ea t es ( c a l l ed t he " ro o t d i rec­
t ory" ) .
T he root
d i rectory
is
a l wa y s a t
t he same
l oc ill t i on o n a d i s k .
Beca u s e of
t h i s spec i a l f a c t abou t t he root d i r e c t o r y
O S - 9 i s a l ways a b l e t o f i nd i t , a n d c ha n g ­
i ng d i sk s t h a t o n l y have t he r o o t d i r e c t o r y
on t hem won ' t c a u s e a n y t roub l e .
T he exe ­
c u t i o n d 1 rectory
i s u s ua l l y n o t
t he
roo t
d i r e c t o ry ,
so
thi s
spec i a l
case
d oe s n ' t
g e nera l l y app l y t o i t .
T he s e t Of commands I have me n t i oned i n
t h i s co l umn m i g h t be cons i dered a " s t a r t e r
set " for 05-9 .
T he doz en s of
commands
1
l ef t ou t a r e c e r t a i n l y wor t h l ea r n i ng , b u t
you c a n g e t 0 5 - 9 wor k i ng w i t h t he s e f e w .
OOPS
neg 1 ec ted t o m e n t i on a
f ew m o nt h s
a go
t ha t O F l ex as rev i ewed i n t h i s c o l u m n i s
a va i l ab l e o n l y
f rom G i m i x .
R i chard
Don ,
t he s a l es m a n f O r G i m i x , e x p l a i ne d t h e gen­
eO l ogy o f OF l ex to me .
It
i s F l ex b y T S C
a da p t e d by R i ch a r d Hogg t o r u n u nder O S - 9 .
G i m i x prov i des enhanced d i sk D ev i ce D r i ve r s
to
s u ppor t
F l ex ' S
requ i rement s ,
and
made
some enha nceme n t s to R 1 cha r d Hogg ' s d e s i gn .
A nyone whu t ak �b o u t l i ca n s e s f r om T S C a nd
R i c ha r d Hogg c a n s e l l OF l ex , b u t the ve r ­
s i on
I
rev i ewed
ha s
f ea t u � e s
added
by
Gimix.
Co l umn S e v e n t e e n - - The F i r st S t ep I n t o OS - 9
105
106
0 5 - 9 U s e r N o t e s Vo l ume
I
COLUMN E I GHTEEN
MY L I FE
I ' m a f ra i d t h i s mon t h ' s cO l umn w i l l be a
l i tt l e
s ho r t .
I
j us t
bought
a
house .
N o t h i ng ma j o r wrong w I t h i t , b u t I ' m l i v i ng
I n t he f i r s t
f l oor w h i l e
f i x up t he
upsta ; rs .
1=> ; 1 es of bo xes a r e e v e r yw he r e ,
a nd i t s eems l i k e e v e � y t h i ng I need i s i n a
box at t he c e n t e r of an unk nown p i l e .
Thi s
d i s o r d e r has not he 1 ped me get a l o t of
compu t i ng done .
I don ' t mean t o t u r n t h i s co l umn i n t o a
d i a ry , but t he r e a re a f ew o t h e r i mpo r ta n t
i t ems .
A k i t t en i s he l p i ng me w r i t e t h i s .
I go t h i m t o he l p ma ke m y h ou s e seem home1 i ke , but h e 1 i kes to he l p t yp e .
I e n J oy
h i s he l p ,
bu t I
hope he w i l l
s w i t c h to
s l eep- i n - t h e - 1 ap mode s oo n .
T h i s f a l l I w i l l f i na l l y become a f u l l ­
t i me g r a d u a t e s t uden t .
I have been s t Udy­
i ng Compu t e r S c i ence p a r t t 1 me f o r y e a r s .
but
i t s eemed t h a t t he f i e l d wa s mov i ng
a head f a s t e r t ha n I was l ea rn i ng 1 t .
It is
a
s c a r y b u s i ness
g c i ng baCk
t o c o l l e ge
a f t e r be i ng a w o r k i ng man f or year s . but
I ' m fa i r l y
qu i ve r i ng w i t h
eagerne s s .
I
have one more co 1 umn t o wr i t e a s a f re e
man , t he n I 101 1 1 1 be a s t udent .
I t h 1 nk I
can g e t p e rm i s s i o n to keep w r i t i ng t h i s
c o l umn .
I
hope my s t u d i es add s om e s p i ce
to my w r i t i ng .
NON-STANDARD HARDWARE
get
A f a i r amou nt o f t h e 0 $ - 9 ma i l
asks abou t spec i a l ver s i ons o f O S - S .
Many
peop l e have o l d S WT P c sys t em s t hey wou l d
l i ke t o r u n 0 5 - 9 o n .
T he r e a re a l so a few
peop l e w i t h home - b rew 6 8 0 9 s y s t em s who ' d
l i ke t o po r t O S - S . T he news f or t he s e peo­
p l e i s m o s t l y bad .
T he r e u s ed to be a SWTPc v e r s i on of
0 5 - 9 Leve l One , bu t I don ' t t h i nk i t i s
s o l d any m o r e .
O S - S L. e v e l Two i s s o l d o n l y
t h rough h a r d w a r e m a nu f a c t u re r s . and SWTPc
h a s n ' t 1 i c e n s ed i t .
I f you have you r own
home -brew d e s i gn . you c a n l i ce n s e 0 5 - S f rom
M i crowa r e .
but
t he
p r i ce
is
r i d i cu l ou s
unl ess you mean t o s e l l i � .
Two yea r s ago ( or more ) M i croware u sed
t o se 1 1 a gener i c vers i on o f 0 5 - S L.eve 1
You cou l d bUy i t d i r e ct l y f rom M i c r o­
One .
wa re a nd a dapt i t t o whatever s ys t em you
wanted .
I
g u e s s a f ew peop l e mu s t have
p u rcha sed t ha t v e r s i on o f 0 $ - 9 a nd t i ed up
M i c r owa re ' s hot l i n e for days w i t h t he t r ou ­
b l e t he y h a d g e t t i ng i t go i ng .
T he e f f or t
t hey had t o p u t i n t o he l p i ng peop l e u s e t h e
gene r i c 0 5 - 9 was more t han foII i c roware cou l d
a f f o r d . s o t hey d r opped t he p roduct .
Th i s
po l i CY seems t o be ma i n l y a way o f a vo i d i ng
p i racy .
T h e t he o r y i s t h a t i f t he p e op l e
who s e l l t he hardware have t o buy t he r i gh t
t o s e l l O S - 9 , t hey w i l l see t o i t t ha t peo­
p l e buy
an
oper a t i ng
system
i ns tead of
s t ea 1 ; ng i t .
O f f i c i a l l y t h e r e i s no way t o g e t 0 5 - S
for
your
5WTPc .
or
home- b r ew
mach i ne .
Unof f i c i a l l y . t he r e a r e ways .
A n i mp o r � a n t
f e a t u r e s o f 0 5 - S i s i t s h a r dware i ndepen-
dence .
The c l oc k a nd I /O dev i ce s a r e h a n ­
d l ed by d r i ve r s .
T he
i n t e r f aces t o t he
d r i ve r s a r e gene r a l enough t h a t a n y r e a s o n ­
ab l e ha r dw a re c a n b e accommoda t e d .
M i cro­
w a r e w i l l s e l l t he sou rce t o s e ve r e l d e v l ce
d r i ve r s a n d a f ew c l oc K d r i v e r s .
W i th a
copy of 0 5 - 9 f or a n y mac h i ne . a w o r K i n g
0 5 - 9 t o bu i l d t he new 0 5 - 9 o n . a n d a c o l ­
l e ct i on of source f rom M i c roware i t s h ou l d
be poss i b l e f o r a n e x p er i enced p r o gr a mmer
to adapt 0 5 - S t o a ny G8D9 -ba sed m a c h i ne I
have hea r d of .
I t i s n ' t h a r d to b u y a copy of 0 5 - 9 t o
cu s t om i z e .
T r y a f ew manu f ac t u r e s .
When I
was bu i l d i ng c r azy s y s t em s I d i d a l o t o f
bu s i ness w i t h A A A Ch i cag06 Compu t i ng ;
t he y
Y ou don ' t c a r e
m i gh t b e ab l e t o he l p you .
what ve r s i o n o f 0 5 - 9 y o u get u n l e s s y o u c a n
get o n e t ha t i s a l ready pa r t l y compat i b l e
w i t h you r s y s t em .
Y ou ' l l have t o Ioi r i t e a
c l ock d r i ve r , a d i S k d r i ve r , anCl ,
i f you
u s e an unusua l s er i a l c h i p , a 5CF d r i ve r . '
I f you want to adapt L. e ve l T wo , you ' l l have
t o buy a vers i on o f 05-9 t ha t i s de s i gned
for
t he
memo r y
management
hardwa r e
you
have . Memo r y management i s done i n t he 0 5 -9
( 0 5 91=> 1 ) .
It
i s n ' t easy to a dapt
k e rne l
w i t ho u t l ot s o f source code
t he k i nd
of source M i crowa r e s e l l s a s p a r t o f a n O E M
l i cense . . . v e r y e x pens i ve .
I f anyone has 0 5 - 9 r u n n i ng o n u n s u p ­
p o r t ed na r dware
l et m e
k now .
M i c rowa r e
does n ' t of f i c i a l l y wa n t t o s up po r t you . b u t
t he y m i gh t n o t ObJ e c t i f w e s e t up a f unc­
t i o n of t he U s e r s Group t o he l p you ou t .
I f t he r e i s enough i nt er es t . maybe we c a n
f i nd a r e I i ab l e s o u r c e o f a d a p t ab l e O S - S .
I n a ny case , I ' l l repo r t a n y t i ps you s e nd
me i n t h i s c o l umn
D I RECTOR I ES AS F I LE S
A d i rec t or y i s a spec i a l t ype o f f i l e ,
I f t hey a r e hand l ed c o r rect l y , t he y can be
opened and u s e d w i t ho u t much t rou b l e .
If
you t ry t o l i s t o r dump a d i rec t o ry f i l e ,
you w i l l have t ro ub l e .
D i rectory f I l es can
o n l y be opened u s i ng t he d i rec t o r y a c ce s s
mode ; a n d Dump . L. 1 S t , Copy , a n d m o s t o t he r
0 5 - 9 u t i l i t i e s don ' t u s e t h i s mode .
T he eas i es t t h i ng t o do w i t h a d i re c t o ­
r y i s t o s i mp l y r e a d i t a n d copy i t t o
s t a nd a r d o u t pu t .
T h e p ro g r am ca 1 1 e d D L 1 s t
c op i es t he current d i r e c t o ry t o s t a n d a r d
o u t pu t .
You can s e e t he c o n t e n t s o f t he
c u r r ent d a t a d i r e c t o r y by a s s e mb l i ng D L. i s t
a nd t yp i ng
059 : DL i s t 1 Dump
D i r e c t o r i es conta i n many unpr i n t ab l e c h a r ­
a c t er s , s o i f you don ' t u s e Dump t o f o rmat
t he o u t p u t you w i l l g e t g i bber i s h on t he
s c r ee n .
Y ou may even make you r t e r m i na l do
s t r a nge t h i ng s .
6
I t occurs t o me t ha t Rad i o S hack s e l l s
t h e l ea s t expenS i ve 0 5 - 9 a r ou nd .
foII i c ro­
w a re h a s a f e w ve r s i o n s o f leve l One f o r
M o t o ro l l a s y s t e m s t ha t
t hey c a n s e l l .
T h e Rad i o S hack 0 5 - 9 h a s a non - s t anda rd
d i sk f ormat that you can a VO i d b y buy i ng
t he m o r e expenS i ve Motoro 1 l a Sof t wa r e .
C o l umn E i gh t e e n
107
I have a d i r e c t o r y w i t h o n l y t he
c o n t a i n i ng D L i s t
In it.
ran D L i s t
t h e commano
Addr
0000
0010
0020
0030
0040
0050
0060
0070
!
l
The c o n t e n t s
l i ne :
a 1
----
OS9 : DL i s t ! Dump >tmp
f i le
w i th
2 3
----
2EAE 0000
0000 0000
AEOO 0000
0000 0000
4 5
0000
0000
0000
0000
746D FOOD 0000
0000 0000 0000
444C 6 9 7 3 F44 3
0000 0000 0000
6 7
8 9
----
----
0000
0000
0000
0000
0000
0 000
4830
0000
0000
0000
0000
0000
0000
0000
B 7 00
0000
E
A B
C D
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
0000
F
0000
0 1 89
0000
0 5 4D
0000
0765
0000
0763
of
Tmp
a�e
l i s ted
i n F I gu r e G ,
a 2 4 6 8 A C E
·
.
.
.
.
.
.
.
.
.
.
.
.
.
.
•
.
•
•
•
•
•
•
•
•
•
•
.
•
•
9
·
;,
..
.
.
.
.
.
.
.
.
.
.
.
•
•
•
•
•
•
•
•
•
•
•
•
•
•
•
.Pi
.
.
.
•
.
.
•
.
.
,
.
.
.
tmp
.
;, ;,
nLi � tCif07 : : : : : : :
•
•
.
•
•
•
.
.
.
•
.
•
.
•
•
c
H
6
d m p o f a d i r ec t o r y
__
F i�
Q_
e___:_______e_x___u
U_
�_
_________________________________________________________________________,�
___
E a c h e n t r y i n t he d i r e c t o r y t a k e s two l i ne s
in
t he dump
T he
f i rs t
t wo e n t r i e s
are
s e l f - r ef e r e nc i ng .
T he
entry
i s f i rs t ;
t he name " . . ". ( 2 E II E ) i s a t t he beg i n n i ng o f
t he e n t r y .
T he d i s k add r e s s o f
t he f i 1 e
d e s c r i p t or ( 000 1 99 ) f o r t he pa r e n t of t h i s
d I r ec t o r y i s a t t ne e nd of t he e n t r y .
The
s e cond ent ry i s f o r " . " ( A E ) wh i c h i s t h e
a l ias
for
th i s
d i rectorY .
T he
add r e s s
a s s oc i a t e d w i t h t ha t ( 000540 ) po i nt s t o t he
f i l e oes c r l p t o r f o r t h i s d i r ec t o r y .
1 he en t r y f o r t mp i s f o r t he f i l e I p u t
t r-e dump i nt o .
T he l as t e n t r y l oo k s 1 i ke
i t i s f o r O L i s t CH07 , b u t i f you l ook a t t he
hex p a r t of t he dump you w i l l s e e t ha t t he
h I g h b i t of t he " t " i s o n , mean i ng t h a t i t
i s t he l as t C ha r a c t e r i n t he s t r i ng
T he
c h a r a c t e r s ' CH07 " a re an a r t i f ac t of a p r e ­
V 1 CU S
use
of
t he
entry
for
t he
f i le
S C R A 1 CHC7 .
D L I s t cou l d be changed t o ed i t t he con­
t e n t s of t he d i r e c t o r y b e f o r e p a S S i ng i t to
s t a n d a r d o u t pu t ,
T he f i r s t t wo e n t r I es a r e
a l wavs f o r " . " a n d " . . " .
T he r e i s u s u a l l y
no ne ed t o no t i ce t he m .
T he r e can a l s o be
n u l l e n t r i es i n t he d i r e ct or y .
When a f i l e
i s de l e t ed t he f i rs t b y t e i n the d i r e c t o ry
e '1 t r y i s s e t t o $00 m a k i ng i t i n t o a nu l l
e n t ry .
D L i s t cou l d check f o r n u l l e n t r i e s
a n d s up p r e s s t he m .
It
O L i s t 2 i s an
uses
I $ Se e k
e n h anced v er s i on of D L I s t .
to
Sk i p
t he
f i rs t
t wo
e nt r i e s , t he n c op i es a l l e n t r i es t ha t
s t a r t w i t h $ 00 t o s ta nd a r d o u t pu t .
don ' t
T he next f e a t u re to add wou l d be f o r ­
m a t t i ng
t he
output
so
it
cou l d b e
read
w i t ho u t
US i ng
Dump .
The
address
of
t he
i sn ' t
1 i ke l y t o be w o r t h
f i l e descr i pt o r
s ee l ng
of t e n ,
so
t he
f i na l
program ,
ld.
p r i nt s
t he
f i le
name s .
A
usef u l
j ust
d I r ec t o r y l i s t p r o g r am needs to be ab l e t o
I i s t t he c on t e n t s of d i r ec t o r i e s o t he r t ha n
t he c u r rent d e f a u l t SO I added t ha t f un c ­
L d c a n t a k e a d i r e c t o r y name o n t he
t i on
command l i ne ,
I t wou I d n ' t be t oo h a r d t o
a dd t he x op t i on by ope n i ng t he d i r ec t o r y
w l t h t he execu t i on a t t r i bu t e , b u t t ha t ' S a
f unc t i on I d I dn ' t add .
T h e p r o g r am d e t e r ­
m I ne s whether a d i r ec t o � y name wa s g i ve n b y
cheCK i ng t he l eng t h o f t he p a r a me t e r a rea .
If
t he
parame t e r
a rea
is
on l y
one
byte
l o ng ,
i t on l y cont a i ns a ca r r i age r e t u r n ,
o t he r w i se i t con t a i n s a d i r e c t o r y name t e r ­
m i na t ed w i t h a ca r r i age r e t ur n .
108
05- 9 U s e r N o t e s Vol ume I
I t wou l d De n i ce t o add t he " e " opt i on
to t he l d command . b u t a n ex t e n d e d d i r e c t o ­
r y i nv 0 1 v e s l o t s o f numbe r s a n d d a t e s .
The
code t o f o rmat a l l
t ha t
i nf o r ma t i on w ou l d
make a l ong p rogr am .
I n s t ea d , I have w r i t ­
t e n a B a s i c09 p r o g r a m t ha t t a k es t he ou tpu t
of
D L i st2
and gene r a t e s a mo r e e x t e ns i ve
r epo r t .
T he r e i s r oom . f or l o t s of i mp r ov e ­
ment
i�
D F o rrna t ;
I
onl y
pr i n t
tne
file
name ,
c r e a t i on d a t e .
l as t
mod i f i ed
date .
and f i l e s i ze . a n d I don ' t s o r t t he l i s t i n
a n y spec i a l o rder .
I mp rovem e� t s l i k e t h e s e
a r e , a s t hey say , " l ef t f o r t ne r e a d e r , "
E ac h d i r e c t o r y en t r y co n t a i ns t he d i s k
a dd r e s s o f t he f i 1 e d e s c r l i n o r s ec t o r f or
the f i l e .
T he f i l e aes c r i pt or con t a I ns a l l
the
i nt e re s t i ng
i nf o r ma t I on about a f i l e .
We n eed t o read t he f l I e oes c r i p t o r ,
bu t
al l
we know
is
i t s d i s k addr e s s .
a nd t he
o n l y way t o ge t a t a pa r t i cu 1 a r s e c t o r on a
d i S k i s w i t h phy s i ca l - s e c t or I /O .
Nor ma l l y
phys i ca l - se c t or
I / O i s done by ope n i ng a
dev i ce ; e . g . dump 1 00fi .
S l nce t he r e i s no
e a s y way t o f i nd o u t t he name of t he d r i ve
t he d i r ec t or y i s on , t he ID� t ype of t r i c k
i sn ' t u s ef u l .
T h e r e i s a n i n t e r es t i ng v a r ­
i a t i on
on
phys i ca l - s e c t o�
1 10 wh i ch I
ha ve n ' t bee n a b l e to f i nd docume n t e d a n y ­
wher e
I f y o u open t he f i l e e> .
it
wi l l
open t he d r i ve t he da t a d i r ec t o r y I S o n f o r
phys i c a 1
I /O .
I f you open
it
f o r e xecu ­
t i on .
i t w i l l open t he d r i ve w i t h t he e x e ­
cu t i on d i r e C t O r y o n i t f o r phys i ca l I /O .
S i nce O L i s t 2
i s f eed i ng t h i s p r o g r a m ,
a n d O L i s t 2 can o n l y read t he c u r r e n t da t a
d i r e c t ory . D F o r ma t a s sumes t he d I r ec t o ry i s
on t he s ame d 1 sk a s t he d a t a d i r e c t o r y .
I ysed a u s ef u l t r i Ck f rom t he UN I X 1 5
Command
D i r e c , o r y f i l es a re i nd i ca t e d by
a " I " af t e r t hem i n t he 1 1 s t i ng f rom D F o r ­
ma t .
I f you have a UN I X - l i ke s o r t p r o g r a m
a va i l ab l e
the
comb i na t i on
of
DL i st2
and
D F o r m a t can be m a d e eyen mor e u s e f u l .
By
s or t i ng o n t he va r i OU S f i e l ds i n t he o u t p u t
f r om O F o rmat y o u c a n ge t t he l i s t i ng a l pha ­
b e t i ca l l y by name ,
by
i nc r ea S i ng s i z e ,
or
i n c h r o no l og i ca l o rd e r .
I f you have RunS t ype D F O r m a t i n ,
I t , a ne p a C k i t .
T hen u s e i t w i t h a
mand 1 i ne I i ke :
OS9 : DL i s t 2 ! DForma t
save
com­
If
you
don ' t
some t h i ng
have
1 i ke :
R u nS ,
you ' l l
need
to
O S 9 : 0L i s t 2
use
b a s i e09 OFormat
DL I ST PROGRAM
OS-9 As s embl er 2 . 1 0 7 / 1 3/84 1 2 : 07 : 5 2
Page 001
DLi s t - Li s t the Current Dir e c t ory
00001
n am OLi s t
00002
t t l List t he Cur r ent Dir e c t o ry
00003
I FP 1
00005
ENDC
00006 001 1
type
s et PRGRM+OBJCT
00007 008 1
Revs
s e t REENT+ 1
00008 0000 8 7CD0043
mod MEnd , Name , Type , Revs , Entry, Mems i ze
00009
000 1 0 D 0000
OPath
rmb 1
Direct ory path num b er
000 1 1 D 0001
Buffer rmb 32
b uffer for d i r e c t ory en t r i e s
000 1 2 0 002 1
Stack
rmb 200
000 1 3 0 00E9
M e s i ze
equ
000 14
00015 0000 444C6973 Name
fes /OLi s t /
00016 · 0012 0 1
Vers i on feb 1
O i r n ame
000 1 7 001 3 2EAO
fcs / . /
000 1 8
000 19 0015
Entry
00020 0015 868 1
I da
OIR . +READ .
0002 1 001 7 3080FFF8
l eax g i rname , PCR
00022 001 8 1 03 F84
OS9 I $Open
00023 ODI E 25 1 D
b es Error
00024 0020 9700
s t a DPath
00025 0022
RLoop
00026 0022 3041
l eax Buffer , U
00027 0024 1 08 E0020
ld
11 32
OS � I $Read
00028 0028 1 03 F89
00029 002B 250B
b es TEof
l
Std outpu t
I da
00030 002D 860 1
OS9 � $W r i t e
0003 1 002F 1 03F8A
00032 0032 2509
b es Error
I da DPath
00033 0034 9600
bra
RLoop
00034 0036 20U
TEof
00035 0038
cmp b �E $EO F
00036 0038 C 1 03
rror
00037 003A 260 1
b ne
c lr b
00038 003e SF
Error
00039 0030
OS9 F$Ex i t
ret urn
00040 003D 1 03 F06
EHOO
00041 0040 69C250
equ
MEnd
00042 0043
00000 error (s)
00000 warning (s)
0043 00067 pr ogram bytes generat ed
OOE9 00233 aa ta byt es a l l ocated
223F 08767 b ytes us ed for symbo l s
Mi c r owar e
m
*
1
C o l umn E i ghteen
109
)L I ST2 PROGRAM
i i c r owa r e 0 5 - 9 As s emb l e r 2 . 1
0 7 / 1 3 /8 4
. ;L i s t 2 - L i s t t h e Cur r en t Di r e c t ory
,0001
J0002
ll0003
l)0005
00006
00007
0 0 0 08
0 00 0 9
000 1 0
0 00 1 1
0 00 1 2
0 00 1 3
000 1 4
0 00 1 5
0 00 1 6
0 00 1 7
000 1 8
000 1 9
00020
0 00 2 1
00022
00023
00024
00025
0 0026
00027
00028
0 0029
00030
0 00 3 1
00032
00033
00034
00035
00036
00037
00038
00039
00040
0004 1
00042
00043
00044
00045
00046
00047
00048
00049
00050
0005 1
D
D
D
D
Page 0 0 1
nam
ttl
IFP1
ENDC
set
s et
m od
DLi s t 2
L i s t t h e C ur r e n t Di r e c t o r y
1
32
001 1
0 08 1
0 0 0 0 8 7CD005 7
t ype
R evs
0000
000 1
002 1
0 0E9
DPa t h
Bu f f e r
S t ack
Mems i ze
rmb
rmb
rmb
equ
D ODD 444C6 9 7 3
001 3 0 1
0 0 1 4 2EAO
Name
V e r s i on
D i rname
fcs
feb
fcs
/ DL i s t 2 /
00 1 6
00 1 6
00 1 8
00 1 C
00 1 F
002 1
0023
0025
0028
002B
Ent ry
I da
l ea x
ffD I R . +READ . f i l e a c c e s s m o d e
D i rn ame , PCR f i l e n ame " . "
I $Open
Err o r
DPa t h
s ave t h e p a t h n um b e r
U
s av e U
868 1
308DFFF8
1 0 3F8 4
2 5 30
9 70 0
3440
CE0040
8EOOOO
1 0 3 F8 8
002E 3 5 4 0
0 0 3 0 25 l F
0032
0032 3 0 4 1
0034
0 0 3 4 1 08E0020
0038 1 03 F89
003B 25 0F
003D 6D4 1
0 0 3 F 2 7 F3
004 1 8 6 0 1
0043 1 03FSA
0046 2509
0048 9 6 0 0
004A 2 0 E6
004C
0 0 4 C C 1D3
004E 260 1
0 0 5 0 SF
005 1
005 1 1 03 F06
0 0 5 4 C80 0 7 0
005 7
OS9
bcs
s ta
pshs
I du
l dx
RLoop
RLoop2
MEnd
1
11 3 2 *2
11 0
l ea x
B uf f er , U
l dy
t/ 32
059
bcs
I da
bra
Di r e c t o r y p a t h numb e r
buffer f o r d i r e c t ory entr i e s
/. /
I$Seek
U
Err or
bes
tst
beq
I da
Error
2 00
pu I s
bcs
059
TE o f
PRGRM+OB JCT
REENT+ l
MEn d , � ame , Typ e , Revs , En t r y , Mems i ze
059
I $R ead
TE o f
B uf fe r , U
R L o op2
ti l
I $Wr i t e
Error
DP a t h
R L o op
s k i p o v e r . and . . e n t r i e s
r e s t or e U
nul l ent ry?
y e s : s k i p i t and r ead aga in
S t d out p ut
di r e c t ory p at h
read ag a l n
emp b
bne
c l rb
fJE$EOF
Error
I s t h i s EOF ?
n o ; er r o r
yes ; r e t urn happy
059
F$Ex i t
r e t u rn
EMOD
equ
00000 e r r o r ( s )
00000 war n i ng ( s )
$ 0 0 5 7 0008 7 pr ogram byt e s g en e r a t e d
$00E9 0 0 2 3 3 da t a byt e s a l l o ca t ed
$224E 0 8 7 8 2 byt e s u s ed f o r s ymb o l s
110
1 2 : 08 : 1 7
OS - 9 U s e r N ot e s Vo l ume I
LD PROGRAM
07 / 1 3/ 8 4 1 2 : 08 : 29
Mi c r owa re OS-9 As s emb l e r 2 . 1
l d - L i s t F i l e s i n a Di r e c t ory
0000 1
00002
00003
00005
00006
001 1
000 0 7
008 1
00008
0000
00009
000 1 0 0 0000
000 1 1 0 0001
000 1 2 0 002 1
000 1 3 0 00E9
000 1 4
000 1 5
0000
000 1 6
OOOF
0001 7
0010
000 1 8
00 1 2
000 1 9
0012
00020
0002 1 . 0 0 1 6
00022
00023
00024
00 1 8
00025
OO l C
00 1 C
00026
0002 7
00 1 E
00028
002 1
00029
0023
0003 0
0025
0003 1
0027
00032
002A
0003 3
0020
00034
0030
0003 5
0032
0034
00036
00037
0034
00038
0036
00039
0036
0004 0
003A
0004 1
003D
003F
00042
004 1
00043
0043
00044
0045
00045
00046
0047
004A
00047
004C
00048
004E
00049
0050
00050
0005 1
0050
0052
0005 2
0054
0005 3
00054
0055
0055
0005 5
0058
00056
0005 7
0058
00058
0059
00059
0059
00060
005s
0006 1
0050
0006 2
005F
0060
00063
0062
0006 4
006 4
00065
0064
00066
0006 7
0066
00068
0067
00069
0069
8 7C0007 2
6CE4
01
lEAO
1 08300 0 1
2 2 04
*
'*
308DFFF4
868 1
1 0 3F84
2532
9700
3440
CE0040
8EOOOO
1 03 F88
3540
252 1
304 1
1 08E0020
1 03 F8 9
251 1
604 1
2 7 F3
801 3
860 1
1 03 F8C
2509
9600
20E4
C 103
260 1
5F
1 03 F06
5F
6085
2B07
2 70B
5C
C l IO
25F5
8600
5C
A785
39
t yp e
R evs
nam
ttl
IFP!
ENoe
set
set
mod
Page 001
ld
L i s t F i l e s in a Oirect ory
PRGRM+OBJCT
REEN T + l
MEn d , N ame , Typ e , R evs , En t r y , Mems i ze
OPa th
Buffer
Stack
Mems i ze
rmb
rmb
rmb
equ
1
32
Name
V e r s i on
O i rname
f cs
f cb
f cs
1 1 d/
1
/. /
200
Di r e c t ory p a t h numb e r
b u f f e r f o r d i r e c t or y ent r i es
En t ry
cmpd # 1
l eng t h o f p a r ame t er s t r i ng
bhl
Di rNGivn
I f mor e t han one byt e o f param e t e r s
O t h e rw i s e u s e " . "
a s s ume f i l e name o n c ommand l i ne .
l eax Oi rname , PCR us e " . " a s d i r e c t o ry
O i rNG ivn
#OI R . +READ. f i l e a c c e s s mode
i da
059
t $Ope n
bcs
Error
s ta
OPa t h
s ave t h e path numbe r
paha U
s ave U
*
i du
f13 2 2
I dx
riO
059
I SSeek
s k i p over . and
ent r i es
puis U
restore U
bcs
Error
RLoop
l e ax Buff e r , U
RL oop2
l dy
113 2
059
I SR ead
bcs
TEof
tst
Buf f e r , U
nul l ent qr?
beq
RLoop2
yes : s k i p i t and r e a d aga i n
bsr
Edi t
P r ep a r e f i l e name f or p r i n t i ng
I da
S t d o u tput
11 1
I $Wr i t Ln
059
Error
b cs
OPa t h
I da
d i r e c t ory p a t h
bra
R Loop
r e a d aga ln
TEo f
cmpb I!E$EOF
Is t h i s EOF?
bne
Error
no ; e r r o r
c l rb
y es ; r e t urn happy
Error
0 59
F$Ex i t
r e t u rn
Ed i t
c l rb
ELoop
B,X
tst
bmi
E Lo opX
beq
EError
A name c an ' t end i n a nu l l
i nc b
c mp b /129
ELoop
blo
A name c an ' t b e mor e t han 2 9 b
ELoopX
I da
11$00
<CR>
i nc b
B ,X
s ta
rts
•
•
C o l umn E i g h t e e n
111
Mi c r oware OS-9 As s emb l er 2 . 1
0 7 / 1 3 /8 4 1 2 : 08 : 3 2
I d - L i s t F i l e s in a D i r e c t o ry
00070
0007 1
00072
0 00 7 3
0 0 07 4
00075
EEr r o r
006A
006A 860D
006C A784
006E 39
0 0 6 F 6 FABB C
0072
MEnd
I da
sta
rts
EMOD
equ
f/S O D
,X
P a g e 002
R e t u rn nu l l l i n e for e r r o r s
*
00000 error ( s )
00000 warn i ng ( s )
$ 0 0 7 2 0 0 1 1 4 p r o g r am by t e s gene r a t e d
5 00E9 0 0 2 3 3 da t a byt e s a l l o c a t e d
$2299 08857 byt e s u s ed f o r s ymb o l s
DFORMAT PROGRAM
PROCEDURE DForma t
TYPE d i r fmt =name : ST R I NG [29] ; l sn (3) : BY TE
0 0 00
TYPE SegLFmt=SLsn (3) : BYTE ; S e gLen : I NTEGER
OOIB
TYPE fdfmt=at t r : B Y T E ; own e r : INTEGERi ModDa te ( 5 ) , L i nkCt ,
003 1
.
F i l e S i ze ( 4 ) , CDa t e ( 3 ) : B YT E ; � e g L i s t (48) : S e g L Fmt
DIM D i r En t : d i r fmt
0070
DIM FD: f dfmt
0079
DIM R e a l LSN : R EAL
0082
D IM i , e rrnum : INTEGER
0089
DIM P P a t h : BYTE \REM Phys i c a l 1 0 p a t h number
0094
OPEN t/PPath , "@ " : READ
00B6
00C2
LOOP
GET f!O , Di rEnt
00C4
ON ERROR GOTO 1 0
00 CD
REM Change name f r om a s s emb l e r s t r ing f o rma t t o
00D3
0 1 02
REM Bas i c 09 s t r i ng f o rmat by p l unk i ng a SOO a t the end o f i t .
FOR i - I TO 29
O DE
EXI T I f ASC (MID$ (Di r Bn t . nam e , i , l » > 1 2 7 THEN
0 1 4E
D i r En t . name-LEFT$ (D i r En t . name , i )
0 1 64
0177
ENDEX IT
NEXT i
0 1 7B
REM change t h e LSN o f t he FD s ec t o r f r om three byt es
0 18 6
REM to a real numb er
0 1 B9
Rea l LSN-Di r En L l s n ( 3 ) +256''« D i rEnt . 1 sn ( 2 ) + 256*
O l CC
Di rEn t . l sn ( l »
SEEK #PP a t h , Re a l LSN*256
0 1 F4
GET t/PPath . FD
0203
0200
P R I NT D i rEnt . name ;
I F FD . a t II
t r > 1 2 7 THEN
02 1 6
0225
PR INT I" ;
END I F
022S
PR INT " " ; FD . ModDa t e O ) · " / " ; FD . H.odDa t e (2) ; " / " ;
0 2 20
FD . M o dDa t e (3) ' .7 I I . FD . ModDat e (4) ;
PRINT " _ " ; FD. ModDa t e (5) ' " 'II ; FD . CDa t e ( 1 ) ; " /" ;
0265
F D . CDa t e ( 2 ) ;
FD . CDa t e (3) ;
PRINT II
(. FD . F i l e S i ze 4) +256* ( FD . F i l e S i ze ( 3 ) + 2 5 6 '"
029C
FD . F i l e S i ze ( 2 + 2 5 6 * FD . F i l e S ize ( 1 » )
ENDLOOP
0 2D2
REM error hand l er
02D6 1 0
e rrnum""ERR
0 2 E9
I F er rnum= 2 1 1 THEN \REM end o f f i l e
02EF
CLOSE {fPP a t h
0309
END
030F
E LSE
03 1 1
PRINT "Er r o r numb er " ; er rnum
0315
END
032A
END I F
032C
END
032E
•
"
112
0 5 - 9 U s e r No t e s V o l ume I
"�";
COLUMN N I NETEEN
MORE GAME S W I TH D I RECTOR I E S
L a s t month I d i scussed read i ng f rom d i rec­
tory
f i l es .
Th i s mon t h
I'll
stay
with
d i rect o r i e s and add s ome add i t i o na l t r i c k s .
The d i r ec t O ry f o rmat t i ng command a t t he
end of t h i s c o l umn i s a usef u l ve r s i on o f
t he D I R comma n d .
I t doesn ' t i l l u s t ra t e a ny
i de a s t ha t weren ' t covered i n l a s t co l umn ,
but i t i s a s i ng l e p rogram t ha t i s f a s t e r
t o u s e t ha n t he p i pe l i ne of p r og r a ms I p r e ­
s e n t ed l a s t mont h .
I have f ou nd t ha t C 1 s a good l anguage
t o w r i t e qu i C k s y s tem l eve l p r o g r ams .
Of
c ou r se , a s semb l y l anguage s t i l l
has some
a dv a n t ages
over a ny h i gh - l eve l
l anguage ;
not l ea s t t ha t a l mos t ever yone w i t h 0 5 - 9
h a s a n a s semb l er .
A f unct i ona l d i r e c t o r y
command i n a ssemb l er w ou l d be j u s t t o o l on g
f or o n e mont h ' s C O l umn , a n d not i n t e r es t i ng
enough t o devo t e seve r a l mon t h s t o .
50 t he
f i r s t p rogram f o r t h i s c o l umn i s a n i nt e ­
It is
g ra t ed d i r ec t ory f or ma t t i ng command .
I t cou l d be t ra n s l a t ed t o
w r i t t en i n C .
B a s i c09 w i t hou t t oo muCh t r oub l e , bu t t ha t
wou l d requ i r e l oa d i ng Bas i c09 every t i me
Sorry , peo ­
you w a n t t o 1 i s t a d i r ec t o r y .
p 1 e 101 i t nou t C .
Rad i o Shack
an i mpres s i ve l y
i nv e s tmen t .
i s s e l l i ng
l o w pr i ce .
M i c r ow a re C a t
It
i s a good
T h i nk o f d r as a gOOd s t a r t i ng p o i nt .
I t i s easy t o get ; t t o s o r t i t s o u t pu t .
Add i ng t he ab i l i t y t o se l ec t o n l y f i l es
t ha t mee t c e r t a i n cr i t e r l a f o r d i sp l a y i s
harder bu t u s ef u l enough t o be wor t h t he
e f f or t .
Wor k i ng t h i s up i n t o a f u l l - s c reen
command env i ronment i s s ome t h i ng I ' ve been
p r om i s i ng myse l f
t i me t o d o
bu t I
haven ' t ye t .
You c a n w r i t e d i r ec t o r i es a s we l l a s
read t hem .
T he r e a r e gOOd reasons t o eto
th i s .
Renam i ng f i l es i s one r e a s on .
The
rename command s i mp l y w r i t e s a new name
over the o l d one i n t he d i r e c t o r y .
De l et ­
i ng and c r ea t i ng f i l es are o t he r reasons t o
w r i te
i nt o
d i rectory
f i l es ,
bu t
R B F Ma n
M o s t o t he r
t a k e s care o f t ho s e opera t i ons .
t h i n g s y o u wou l d want t o cnange atlovt a
f ' l e i n vo l ve w r i t i ng i nt o t he f i l e des c r i p ­
t o r sec t o r f o l'" t he f i l e .
T ha t ' s j u s t a s
easy a s w r i t i ng t he d i r e c t o r y .
E aS l e r .
T ne r e 1 5 an easy way t o ma ke C read a
d i r e c t o r y f i l e , but t he r e i s no e qu i va l en t
me t hod f o r upda t i ng d i rec t o ry f i l es .
The
comb i na t i on o f a t t r i bu t es requ i red t o w r i t e
i n t o III d i rectory can be used f rom a s sem­
b l e r , or f r om t he l ower l eve l pa r ts of C ,
but i t seems M i croware w an t ed t o mak e i t a
bit
t r i Ck y
to
mes s
wi th
d i r ect o r i es .
Bef o r e
I
cont i nu e
l et me add
to
t he i r
I f you a r e no t brave and
i mp l i c i t warn i ng .
exper i enced don ' t even t h i nk o f upda t i ng a
d i rectory f i l e !
W r i t i ng o n d i r ec t ory f i l es i s a dange r ­
I f you ma k e a m i s t a k e you
o u S t h i ng t o d O .
can l oo se f i l es . or even me s s up t ne s t r u c ­
t u r e o f t he e n t i re d i s k .
DON ' T j ump i n and
t ry p rograms t ha t w r i te to t he d i r ec t o r y on
a n i mpo r t a n t d i sk .
A f te r mak i ng ce r t a i n t ha t your progra m
d o e s n ' t damage t he d i rect o r y under n o r ma 1
c i rcums t ances .
t h i nk
about
ext raord i na r y
s i t u a t i ons .
How d o e s t he program behave i f
t he s ys t em crashes r i gh t i n t he m i dd l e o f
t he Change?
Can t ro ub l e s ta r t i f t w o p r o ­
g r ams t ry t o make a change a t t he same
t i me ?
Wha t w i l l
a
program read i ng
t he
d i r e c t o r y wh i l e you make your change see?
Anot her a r ea w he r e you can get i n t r ou ­
b l e a n d d l scover i nt e r es t i ng new pOS S i b i l i ­
t i e s h i dden i n t he 0 5 - 9 f i l e s t ruc t u re i s
t he p o ss i b i l i t y f O r hav i ng seve r a l d i rect o ­
r y e n t r i es pO i nt i ng a t t he same f i l e .
There ; s a l i nk count
i n each f i I e
d e sc r i pt or sect o r .
T h i S count w i l l a l ways
be one i n norma l
05-9 s y s t ems ,
but
t he
f i e l d o f f e r s a way t o t e l l 0 5 - 9 ( RB F M a n )
t ha t
t he re
are
t wo
or
more
d i rec t o ry
e nt r i es pO i nt i ng a t a f i l e .
T h i S t r i ck w i l l c e r t a i n l y cause DCHECK
t o have f i t s .
I f you 1 i nk two d i r ec t o r y
f i l es t o o n e a nO t he r ( no t j us t w i t n t he . .
f i l e name ) DCHECK w i l l l oop be t ween t he two
d i rect o r i es f oreve r .
E ven i f you don ' t get
t h i s e x t reme DCHECK w i l l n o t e t ha t more
t han one f i l e i s U S i ng t he c l u s t e r s be l o ng ­
l ng t o t he f i l e w i t h wh i ch you ' re p l ay i ng .
I have a dead l y f a SC i na t i on w i t h t h i s t r i ck
of l i nk i ng t o a f i l e severa l t i mes .
The
pa r t s to put i t t oget ner are a l l t he r e , bu t
f o r some rea son M i c roware h a s n ' t bu i l t i t
i n t o 0 5 - 9 yet .
My bet i s t ha t t he r ea S On f O r mu l t i p l e
I i nk s t o f i l es rema i n i ng dormant i n OS - 9 i s
t he recovery p r ob 1 e m t h i is f ea t u r e crea t e s .
1 t i IS i mpo s s i b 1 e t o upda t e t he 1 i nk count
i n t he f i l e descr i p t o r a nd change t he num ­
be r of d i rectory e n t r i es pO i n t i ng t o a f i l e
s i mu 1 t aneous 1 y .
There i s a 1 ways some way
to crash t he sys t em b e t ween t he t wo o pe r a ­
t i on s - - pu l l i ng t he p l ug w i l l w o r k .
I f t he 1 i nk count i s g r ea t e r t ha n t h e
number o f d i r ec t o ry e n t r i es a c t ua l l y l i nked
to t he f i l e , t he f i l e 101 1 1 1 eventua l l y tie
a r ound
w i th
no
d i r ec t o r y
e nt r i es
l ef t
pO i nt i ng a t i t .
The d i SK space f o r t he
f i l e w i l l be a l l oca t ed a nd t he r e w i l l be n o
e a s y way t o ret u r n t ne m ,
I f t he 1 i nk count 1 s sma l l e r t ha n t he
number o f d i r ec t or y ent r i es 1 i n ked t o t he
f i l e t he resu l t i s w o r s e .
Even t ua l l y t ne r e
w i 1 1 b e a d i r ec t o r 'l ent ry po i n t i ng t o a
f i l e t h a t i sn ' t t he r e .
The sectors t ha t
u sed t o be l ong t o t he f i l e cou l d be pa r t o f
a no t he r f ; I e o r j u s t f ree ; i n e i t ne r case
t he r e s u l t i s chaos .
I t l oo k s i mpos s i b l e .
There i s t r o ub l e
whe t he r
t he
f i le
desc r i pt or
is
upd a t ed
be f o r e or a f t e r t he d i r ec t ory .
T he r e a r e
t wo s o l u t i on s .
O ne POSS i tl i l i t y i s t o l i ve w i t h t he
p r ob l em .
An
expe r , enoed u se r
can
fuss
a r ound w i t h t he a l l ocat i on map a n d d i r ec t o ­
r y e nt r i es ,
a n d r ep a i r a damaged d i s k .
M o s t o f t he w o r k can be a u t omat e d .
Compu t ­
e r s don ' t crash o f t e n .
Cr.ances a � e t he y
won ' t c r a s h i n t he m i dd l e o f a d 1 rec t o r y
o pe r a t 1 0n . . . .
age "
l oo k
The a l t e r na t i ve i s t o u s e " s t ab l e s t o r ­
t r i ck s .
E v e r y t i me 0 5 - 9 s t a r t s u o
f o r ev i dence o f a c r a s h , a n d every
C o l umn N i n e t e e n
113
a
d i rec t o r y
p r epa r e
for
you
upd a t e
T h i s s l ow s d i rec t o r y upda t e s , s y s tems
t i me
o ne .
s�artup.
and
vent s
users
r ecove r y .
even
d i sk
mou n t s ;
ha v i ng
f r om
to
b ut
i�
worry
pre­
abou t
I use
Ne i t her me t ho d sounds O S - 9 - l i ke .
t he
" 1 1 ve w i t h t he p r ob l e m " me t hod .
I ' ve
never
had
reason
to
regret
it,
but
I
am
T he " s t ab l e s t o r ­
p r epa r ed f o r t he w o r s � .
age "
me t hod
is
l n t e r e s t i ng
wor t h
a
b r i ef d i s c u s s i on .
Here
is
a
way
to
re l i ab l y
upda t e
S t ep
4
changes
i nvo l ve s
t he
a
s i ng l e
d i rectory
ope ra t i o n
s t ruc t u r e
t ha t
vls ible
to
t he pu b l i c .
U nt i l
s t ep 4
is
exec u t ed no
p r o g r a m k nows abou t the change .
A f t e r s tep
4 t he r e i s a cons i s t e n t upd a t ed d i r e c t o r y .
R e c o v e r y wo r k s
•
as
I SN ' T
f o l l ows :
IF
THERE
ANYTHING
no
recovery neces s a r y
IN
THE
I F T HERE IS A PO I N T E R M A R K E D
NO N E W PO I NT E R
a
" T AB L E "
"OLD "
AND
d i rec t o ry :
de l e t e
1.
Copy
fi le
� i th
rou t i
some
t he e n t i r e d i r e c t o ry i nc l ud i n g
desc r i pt o r s t o a spec i a l s p o t .
i t s a d d r e s s k n o w n to recove r y
( in
nes
a
t ab l e
l oc a t ed
at
k nown spo t ) .
2 .
Upda t e
t he
copy
3.
P u t t he add r e s s of t he o l d d i rec t o ­
r y i n t he s ame t ab l e a s t he a dd r e s s
o f t he ne� o n e w l t h a m a r k i nd i ca t ­
i ng t ha t i t i s o l d .
the d i rectory .
of
a dd r e s s
i n
t he
4.
t he
Put
d i rec t o r y
parent .
5 .
Remove
tabl e .
6 .
De l e te
t he
i t f rom t he
114
of
t he
new
t he
upd a t e d
d i rectory ' S
d i r ec t o r y
0 1 d d i rectory
tabl e .
f r om
t he
remov i ng
Gs - g U s e r N o t e s Vo l ume I
•
IF
t he
THERE
T HE T A B L E
del ete
IF
BOTH
old
I S ON L Y A N E W D I R E C T O R Y I N
it.
PO I N T E RS
con t i nue
f r om
p roced u r e
T h i n gs
e s m i ght s
r y , o r t he
I f that i s
p l i ca t ed .
d i rec t o r y
ARE
s t ep
iN
THE
4
in
TABLE
t he
upda t e
f a l l a p a r t a ga i n i f t wo p r oce s s ­
i mu l t a neous l y upda t e the d i rec t o ­
f i l e des c r i p t o r s a t t a c hed to i t .
p e rm i t t e d t he p r o t o c o l ge t s com ­
T o o comp l i ca t ed f o r t h i s co l um n .
I ' m not go i ng to t r y to p r e s e n t a p ro ­
g r am
i mp l emen t i ng
s t ab l e
s t orage
th i s
mont h .
.Ju s t
a
5 impl e
program
to
squeeze
t he n u l l en t r i es out of a d i r e c t or y .
DR PROGRAM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
lI i n c l ud e
li i n c l ude
ti i n c 1 u d e
il i n c l ud e
< s t di o . h>
< c type . h>
<mod es . h >
< d i r e c t . h>
s t a t i c s t ruc t d i r e n t Di rEnt rv ;
s t a t i c F I LE * f o p e n C ) , *di r , �di s k ;
1 *-------------------------------------------------------- *
*
,�
dr
direct ory read
*
*
R e a d an d f o rmat a l l t he impor tan t f i e l ds i n a
""
,',
d i r e c t o ry ent ry and t he a t t a ched FDs .
�<
To a l l ow f o rmat t i ng , s o r t i ng , and s e a r c h i ng p r ograms *
*
*
t h e b e s t a c c e s s t o th i s da t a i t i s j u s t p r 1n t ed
*
*
w i thout t i t l e s .
*
The r e a r e no opt i on s . A d i r e c t o r y name may be g i ven*
I f i t i s n ' t the curren t *
as a c ommand l 1 n e a r g umen t .
*
*
*
d a t a d i r e c t o ry w i l l b e l i s t e d .
*----------------- ------------------------------- -------- * 1
ma i n (arg c , argv)
int argc ;
lhar *argv [] ;
char t eml? [ 1 20J .
char dev1 c e [301 ;
r eg i s t e r i n t i ;
pfl ini t o ;
argv++ ;
i f (argc > 1 )
s t r c py ( t emp . *argv) ;
else
s t r cpy C t emp , tI . " ) ;
iH dir
f
}
=
f o p en ( t emp , t l d t l »
1* bump p a s t p r o g r am n ame i n a r gs * 1
1 * d e f a u l t d i r e c t o ry * 1
-=
NULL) I i' open t h e d i r e c t ory *1
f p r i n t f (s t d e r r , "k s c an ' t be r e ad a s a d i r e c t ory\n " , t emp) ;
ex i t ( I ) ;
•
s t r c p y (devi c e , " @ " ) ;
' I')
i f ( emp [O]
l
}
1* d e f au l t d ev i c e i s da ta di rec t or y dev i c e * 1
-=
i
do
=
0;
�
d ev i ce [ i ] - t emp [ i ] i
whi l e i S aJnUm ( t emp [++ 1 ] ) I I t emp [ i J
dev i c e i ++j
'@' ;
d ev i c e i]
' \0 ' ;
fpr i n t f ( s t de r r , "Dev i c e : ks\n" , devi c e ) ;
,. ,
-=
=
•
!I
t emp [ i J
==
,
') ;
/ *------------ -------------------------------- *
* Open t he devi ce c on t a i n i ng t h e d i r e c t ory *
*
* we ' r e about t o l i s t .
i f « isk
1
}
c
f op en (dev i c e , " r " »
.. oo
NULL)
f pr i n t f (s t d e r r , "Err o r %d opening dev i c e s \n " , f e r r or (di s k ) , dev i c e ) ;
exi t ( 1 ) ;
f r e a d (&Di r En t r y , s i ze o f Di rEnt ry , 1 , d i e ) ; J* s k i p . en t ry */
ent ry *1
f r ead (&Di rEn t ry , s i ze o f Di rEn t r y , 1 , d i r) ; / * s k i p
1 * ----------------------- ---------------- ----- *
* Read and f o rma t d i r e c t ory e n t r i e s un t i l EOF*
•
:-��:�-���:�:�-�:�-����:��-��-�����!:�:------:
•
�
wh i l e ( f r e a d (&D i r En t r y , s i zeo f Di rEn t ry . 1 . d i r
! = NULL)
pu t En t ry (Di rEn t r y . d l r_name , Di r En t ry . d i r_addr ;
}
e x i t (O) ;
p u t En t ry (Name , Addr e s s )
Co l umn N i n e t een
11 5
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
l har
*Name , *Addr ess ;
char CName [30] ;
l ong LSN ;
i f (Name [O]
' \0 ' )
return ; / * Nul l ent ry */
f i xname (CName , Name) ; / '� change OS- 9 s t r � ng (h i gh-bi t)
to C f orma t s t r l ng */
1 3 t o l (&LSN , Addre s s , 1 ) ; 1 * make LSN usefu l l */
p r i n t f ("%s " ,CName) ;
1* ref orma t ted f i l e name */
/1: res t of the i nforma t i on */
ex p ans l on (LSN) ;
return ;
==
97
98
}
99
100
1 0 1 s t at i c s t ruct f i l des FD ;
102
1 03 expan s i on (LSN) 1 * p r i nt everyth i ng i n t e re s t ing a b out a f i l e *1
l ong LSN ;
1 04
1 05
1 06
i f ( l seek (di s k , LSN*256 , 0)
EOF)
1 07
1 08
fprint f (s tder r , "Di s k s eek error 'Xd\n " , ferro r ( d i s k» ;
1 09
ex i t ( 1) ;
1 10
}
111
i f ( l read (&FD , s izeof FD , I , d i s k)
NULL)
1 12
1 13
f p r in t f ( s t derr , "Di sk read error %d\n" , f error (disk» ;
1 14
ex i t ( ! ) ;
1 15
1 16
117
f o rma t at t r (FD . fd at t ) �
l 18
pr in U"(" Xu" , FD. fa own) '
l 19
format date (FD . fd aa t e , 5) ;
1 20
pr int f"(" Xd : l d " , FD . fd l ink , FD . fd_f s ize) ;
121
format dat e (FD. fd-dcr , 3) ;
122
p r i n t f"("\n" ) :
1 23
return ;
1 24
1 25
}
1 26
127
1 28
1 29 f ixn ame ( f,0odname , b adname) 1 * convert from OS-9 s t r ing t o C s t r i ng
lhar 'goodname , *badname ;
1 30
131
reg i s ter int i ;
132
1 33
i 0;
1 34
do {
1 35
1 36
*goodname++ *badname & ' \x 7 f ' ;
1 37
}
1 38
29» ;
whi l e « *badname++ > 0) && (++ i
139
1 40
*goodname
' \0 ' ;
141
return ;
1 42
}
143
1 44
1 45 f o rmat attr (at t r) 1* print f i l e at t r i bu t e s * 1
lhaF attr ;
1 46
1 47
1 48
i f (at tr & S I {DIR) 1* i s i t a di r e c t o ry? *1
1 49
pr int f ( 7 l d") ;
150
e l se
151
pr int f CIt [ " ) ;
152
153
i f (attr & S I SHARE)
1 54
print f ("-pS ) ;
155
156
i f (at t r & SIt- IOEXEC)
157
pr i n t ! ( p e t! ) ;
158
1 59
i f (at tr & S I OWR I TE)
160
pr i nt f ( "-pw") ;
161
1 62
�=
�=
=
=
<=
=
"
"
1.1 6
OS - g U s e r No t e s Vo l ume
I
*1
163
164
165
166
167
168
169
1 70
171
1 72
1 73
1 74
175
1 76
177
1 78
1 79
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
1 98
1 99
200
201
202
203
204
205
206
207
208
209
210
211
212
213
i f ( a t t r & S I OREAD)
pr i n t f ( "-pr " ) ;
i f ( a t t r & S I EXEC)
pr i n t f ( "-e " ) ;
i f ( a t t r & S I WR I TE)
p r i n t f ( "-w" ) ;
i f (a t t r & S IR EAD)
p r i n t f ( "-r " ) ;
p r i n t f ( " J ") ;
r e t u rn ;
f o rma t da t e ( da t e , x ) 1 * pr i n t a da t e i n r e adab l e f orm *1
char >" dat e ; I" yymmdd (hhmm) * 1
n t x ; 1 * numb e r o f ent r i e s i n the d a t e ar ray *1
t
char *mon th_name () ;
f r i n t f ( " (i.d k S 1 9 % 0 2 d " , da t e [2] , month_name (da t e [ 1 ] ) , da t e [0] ) ;
I f (x >= 5 )
p r i n t f ( " % d : %02 d " , da t e [3] , da t e [ 4] ) ;
p r i n t f ( I t ) It ) ;
r e t urn ;
char *month name ( n) 1 * r e t urn name o f n - t h month *1
nt n;
t
\
s t a i c char *name [] -
};
" i l l eg a l month " ,
" January" "
" F e bruary ,
"Mar ch "
"Apr i l " :
" May"
" J une /' ,
"July" ,
"Augu s t " ,
" S e p t emb e r " ,
"Oc t o b e r "
"Novemb e r " ,
"De c emb e r "
r e t urn «
n < 1
I I
n
>
1 2)
? name [0]
name [n] ) ;
C o l umn N i n e t e e n
117
D I RSQZ PROGRAM
#
lf
i n c l ude < s t d i o . h >
1
i n c l ude < d i r e c t . h >
2
3 # i n c l u d e <mode s . h >
4
5 s t a t i c s t ru c t d i r e n t Di rEn t ry ;
6 s t a t i c i n t d i r ; 1 * p a t h numb e r * 1
7
8 1 -1,
'" Di rSqz ''' I
9 I
Th i s p r o g r am c an be u s ed t o p r e s s t h e n u l l
10
e n t r i es o u t o f l a r g e d i r e c t o r i es t h a t h a v e
11
b e e n h i t w i t h many d e l e t i on s .
1 2 1' 1
1 3 m� i n 0
14
t
15
l on g s t r t -p t r , e n d p t r , b a ck u p ( ) ;
16
1 7 Pflinit ) .
NULL)
i f ( dir
o p en ( " . " , S - I FDIR+S- IREAD+S- IWR I TE»
18
19
20
f p r i n t f ( s t d e r r , tiEr r o r o p en i n g t h e d i r e e t o r y t d\n " , £ e r r o r ( d i r ) ) ;
21
ex i t o ) ;
22
J
*/
23
strt ptr
s � ze o f D i r En t ry * 2 ; 1 * p o i n t p as t , . a�d
24
g e t s fa t C 2 , d l r , 'end p t r ) ; 1 * l en 3 t h o f t h e f I l e R I
end p t r -- s i ze o f D i FEn t r y ; 1 * p O I n t b a c k f r om e n d * /
25
end:p t r
b a c k u p ( e n d_ p t r , s t r t_ p t r ) ;
26
27
f o r ; s t r t_p t r < end_p t r ; s t r t_p t r += s i z e o f D i r E n t ry)
28
29
I s e e k C d i r , s t r t p t r , O) ;
30
r e a d ( d i r , &Di rEn t r y , s j ze o f D i r En t ry) ;
31
i f C i r En t r y . d i r_name [OJ
' \0 ' )
32
?
33
end- p t r - ba c k u p C e n d p t r , s t r t p t r) ;
34
I '" l ea v e s D u En t ry wit h g o o d d a t a *1
35
36
i f ( end p t r < - s t r t -p t r )
br eak ;
37
l S e ek d i r , s t r t p t r , 0) ;
38
w r i t e d i r , &Di rEn t ry� s l z e o f Di r En t r y ) ;
39
l s e e k d i r , e n d p t r , u) ;
40
wr i t e d i r . " " , - 1 ) ;
41
} end_p t r - b a c k u p ( end_p t r , s t r t_pt r ) ;
42
43
44
}
e x i t (O) ;
45
46
J
47
48
49
50
51
l on y b a ckup ( end p t r , s t r t p t r)
52
ong end_p t r � s t r t _p t F ;
l
53
s i ze o f D i r E n t ry)
f o r ; end_p t r >- s t r t _p t r ; end_p t r
54
55
l s e ek C d i r , end p t r , 0 ) ;
56
57
r ead C d i r , &Di rEn t r y , s ze o f Di r Ent ry) ;
i f (Di rEn t r y . di r-name [O
1 = ' \0 ' )
58
}
b r eak ;
59
60
r e t u rn ( end_p t r ) ;
61
62
�
==
=
.
=
=
f
==
!
t
- =
f
'Jl18J
05 - 9 U s e r No t e s Vo l ume I
•
Part 2
REV I EWS
Re v i ew s
119
�
OS - 9 U s e r N o t e s Vo l ume
I
A
be p o s s i b 1 e
to
1 1 5 t 5 7 opt i o ns :
REV I EW OF O-F
o
1
A f ew wee k s a go I s p e n t mos t of a Sa t u rday
hook i ng my o l d SWTP C F L E X m aC h i ne t o my new
mach i ne as a r e m o t e compu t e r s o 1 cou l d use
it
to
w r i te
a
F L E X - f or m a t
d i sk .
It
fel t
r a t he r odd u s i ng my
" s m a r t t e rm i na l " p r o ­
g r am
to
commu n l c a t e
with
a
mach i ne
l es s
t ha n
a
f oo t
away .
T he
p ro ce s s
i nv o l ves
s h u f f 1 i n g d i sk s d r i v e s back and f or t h , and
much ope'l i ng
and S h u t t i ng o f
c ab i ne t s .
I
don ' t
1 i ke
i t
much .
My
new
mac h i ne
has
GIMIX
s o f t wa re
Sw i t c h i ng ,
so
I
can r u n
2
3
4
5
6
F LEX
R e f ormat 0 5 9 D i s k
E x i t program
FLEX f i l e name t o c o py -C opy to 059 des t i n a t l on p a t h
The
· C ompa t i b l e
s ou r ce
Dr i v e
10'
is
t he
dev i ce name f o r t he d i s k t h a t has been ref ­
orm a t t e d ; t ha t wasn ' t t oo c l e a r to me . T he
· C opy O S 9 p a t h t o F L E X · d i a l ogue i s :
Dr i ve 10 -FLEX F i l e name t o wr i t e (Caps )
C opy FROM 059 SOURCE path - T o de l et e a
FLEX
f i le,
r e f o r ma t t i ng
a
' k
( T h i s i s a F L EX C O P y d _
____ _
___ _� _l s__)
__
__
__
T he s e e nt r i es app e a r i f you do a D I R c o m ­
m a n d o n t he r e f o r ma t t ed d i s k ,
l e t t i r,g you
k now very qu i Ck l y t hat
th i s d i sk
i s s pe ­
cia1 .
ID
d i sk
i s
I t r i ed r e f o r ma t t i ng a n d w r i t i ng on 5 i nc h
d i Sk s
( S S / SD ,
S S /DO .
40
t ra c k
a nd
80
t ra c k ) .
and 8
i nc h d 1 S k S o f a l l
permu t a ­
t i on s .
I t w o r ked o n t he 5 i nc h d i s k S ,
a nd
on
SS
s i ng l e
and
doub l e
dens i t y
8
i nc h
d i s k s , I was ab l e t o read p s u e do - F L E X f i l es
c re a t e d by O - F f rom F L E X w i t hout a n y t ro u ­
ble.
O-F
had
no
t rou b l e
read i ng
f i l es
wr i t t en by F L E X on d i s k s ref orma t e d by O - F .
T he r e f o r ma t ted d i s k s were a l so f u l l y u s a ­
b l e in F L E X .
F L E X t ru l y t h i nk s t he r e f o r ­
m a t t e d d i sk
is
one o f
i t s own .
One n i ce
t ou c h i s t ha t t he p r o g r am p u t s t wo e nt r i e s
i n t he 0 5 - 9 root d i r e c t o r y o f t he r e f o r ma t ­
ted d i sk :
rs t s t a r t
i n sou rce
it. If i t
I t shou l d
__
t he n :
Dr i V e ID
Ar e you s ur e ?
Overwr l t e - - < o l d v o l ume nam e >
Ar e y o u s u r e ? - 5 - i n or 8- i n d i s k ? --
OPERAT I ON
__
4,
FLEX f i l e name t o de l e t e ( us e
p r op e r c a s e) - -
O n l y f re s h l y f o rma t t e d , s i ng l e s i d ed 5 o r 8
i nc h d i s k s w i t h no b a d sec t o r s c a n be u s ed ,
a nd t here i s no w a y to u se a d i sk wh i c h i s
l n r e a l F L E X f or m a t ( f o r ma t t ed by t he F L E X
NEWD I S K
or
F O RMAT
p ro g r a m ) .
T he
FLEX
to
0 5 - 9 copy p a r t o f t he p rogram expands t a b
charact e r s
i nto
s t r i ng s
of
b l anKS
by
def au l t , but t here i s a n op t 1 0n wh i ch c a u s ­
es the f i l e to be c op i e d i n t a c t . Of c ou r se ,
t h i s p r og ram does n ' t
m a k e any a t t em p t
to
conver t
F L E X p r o g r am s
; n t o 0 5 - 9 p r ograms .
T h a t i s w o r k f or o t h e r p r o g r ams .
**
0 0 S 9 F_
N_
e_
l_
ow
l_
'_A l _
_e_d _
__ i_
s e l ec t
F l ex c ompa t i b l e s o u r c e Dr i ve
L I M I TAT I ONS
__
program
D i rec t i o n s
F L E X D i rectory
Copy F L E X t e� t f i l e to 0 5 9
Copy OS9 p a t h t o F L E X
D e l e t e F L EX F i l e
T he
d i a l ogue
for
v e r y c au t i ou s :
__
T he
FLEX Comp a t i b l e s ou r c e Dr i ve ID
OS9/FLEX
copy
program
is
a
B A S I C09
Th i S
p ro g r a m wh i c h a l l ows t he user t o c o nv e r t a n
0 5 - 9 f o r ma t d i s k i n t o a hybr i d f o r m w h i ch
c a n be
read a nd wr i t t e n by
F L EX .
In
the
p roce s s
of
dO i ng
this
it
makes
the
d i sk
i na c c e s s i b l e
to
0 5 - 9 except
as
an e n t i r e
d i sk
( i .e.
IDnC' ) bu t O - F
i s a b l e t o copy
f i l e s to a nd f rom t he hybr i d d i s k , and read
t he F L E X di r e c t o ry .
Tne d i s k t ha t r e s u l t s
f rom t h e r e f o r ma t t i ng i s enough 1 i k e s t an ­
d a r d F L E X f o rmat t ha t F L E X aoesn ' t k n o w t he
d i s k i sn ' t o n e of i t s own .
__
i t .
t i on
in
t he
d i r ec t o r y
of
a
pseudo - F L E X
d i sk :
f i le
name ,
Be g i n ,
End ,
S i ze .
a nd
da t e .
I t a l so g i ves t he number of sec t o r s
used on t he d i s k . a nd t he numbe r o f s e c t o r s
l ef t . T he " C opy F L E X t ex t f i l e t o 0 5 9 " d i a ­
l og u e i s :
GENERAL SY STEM DESCR I PT I ON
I n o r de r t o run O - F you mus t f i
Ba s i c09 . T he ve r s i on I t e s t ed was
f o r m . s o I had to l oa d i t a nd run
i s d i s t r i bu t ed a s B a s i c09 I - Code
run
a n d prom p t s f o r a s e l e c t i on .
" D i r ec t i ons "
produces a qu i Ck summa r y of t he f unc t i o n o f
t he
program ,
about
ha l f
a
screen
f ul l .
" F L E X D i rec t o r y "
l i sts
t he ba s i c
i nf o rma­
on
it,
bu t even t he
rema r k a b l e G I M I X CPU
boa r d ca n ' t
run both opera t i ng s y s t ems a t
once .
O n occas i o n I
have up l oaded a f i 1 e
f rom one OS t o a n I BM a nd t he n dow n l oaded
it
w i th
t he
o t ne r
OS ,
a c comp l i s h i ng
a
C hange o f d i s k f o rma t f rom F L E X t o 0 5 - 9 o r
v i c e - ve r sa .
T h e se m e t ho d s a re a l l
i ne l e ­
gant .
ad
hoe s o l u t i on s
to a p rob l e m .
Dr .
Mat t hew S c u d i e re h a s c ome up w i t h a much
c l eaner
so l u t i on :
He
has
wr i t ten
an
O S - 9 / F L E X copy program ca l l ed O - F .
[___*_*
j us t
__
____
__
__
__
__
__
__
__
__
__
J
EVALUAT I ON
Th i s
i s a compe t e n t
and very u s e f u l
pro­
gram .
It
i s espec i a l l y we l l
equ i pped w i t h
error
messages
and
i nf or ma t i ve
text .
In
f a c t . a l t hough i t came w i t ho u t a manua l .
I
w a s ab l e to f o l l ow t he bu i l t - i n d i r e c t i ons
w i t ho u t any t r oub l e . I do hope t h a t a m a n u -
A Rev i e w of Q-F
121
a1
i s av a i l ab l e by
t he t i me t l"l i S p r o g r a m
h l t s t he ma r k e t . A p r og r a m w i t ho u t a manua l
s e em s s omehow unba l anced even , f i t i s u s a ­
bl e
w i t ho u t
documen t a t i on .
A
· �a t
i t
ap pe a r s
t ha t
thi s
d i s t r i bu t ed i n s o u r c e f o r m .
n i ce
e x t ra
program
i s
may
be
O-F
wor k s
by
t r i ck i ng
F L EX .
Thi s
t oge t ne r w i t h t he v a r i e t y of d i s k f o r ma t s
t ha t F L E X m i g h t u s e f o r c e s t he p r o g r a m have
some
oed
r es t r i c t i ons .
T he
mos t
s e r i ou s
i s t h e r e s t r i c t i on t o spec i a l l y
l i m i t a t i on
f or ma t t ed d i s k s . l t c e r t a i n l y w ou l d be n i ce
t o be a b l e t o d ra g ou t a f o u r year o l d F L E X
c l sk
a nd
read
it
wi th
thi s
prog ra m .
T he
r e s t r i c t i on t o s i ng l e s i ded d i s k S
i s rea­
s onab l e
in
t he
c on t ex t
of
copy i ng
f i l es
one
format
to t he o t he r .
F o�
some
f rom
p eop l e t he m o s t
i mp o r t an t
l i m i ta t i on w i l l
be t he l anguage requ i re m e n t . S i nce t h i s i s
a S a s i c09 p r og r am , you m u s t h a v e B a s i c09 t o
o e a b l e t o r un i t . I t c ou l d be a mea s u r e o f
t he d e s p e r a t e need f or a p ro g r a m l i k e t h i s
one t ha t i t i s be i ng hus t l ed o u t i n B a s i c09
f o rm .
O ne o f O - F ' s
c a u t i ous
a p p r oach
s t ronges t
i t
t a ke s
po i n t s
i s
t he
to
t he
user .
05 - 9 U s e r N o t e s Vo l ume I
Th 1 5
program
doub l e
s i de d
doe s n ' t
d l Sk s ,
k now
how
to
dea l
w i th
but
i t
doe s n ' t
j us t
t e l l you s o ,
i t won ' t l e t you u s e t hem . You
get
a
me s s a ge
c l ear l y
t e l l i ng
you
t ha t
doub l e s i de d d i s k s a r e n o t - o k i f you t r y .
S i m i l a r me s s a g e s appea r i f you t ry t o u s e a
d i sk
t ha t
i s f l awed
i n a number of o t he r
ways .
SUMMARY
O-F
is
a va i l ab l e
f ro m
D .6. T A - C OMP .
It
i sn ' t
rea 1 1 y a
program of
gene r a 1
i nt e r e s t
t he r e
a re
p ro b a b l y
s ome
05-9
users
who
don ' t
have
FLEX
or
f r i ends
w i th
F L EX .
Thos e peop l e have v e r y l i t t l e u s e f or t h i s
p rogram .
T h e gr oup of peop l e t h i s p rogram
s h ou l d p rove m o s t u s e f u l
to are t he own e r s
o f s o f t wa r e - s w i t ch i ng mach i ne s . U s i ng t h i s
p r o g r a m t he y c a n conven i en t l y t ra n s f e r d a t a
b e t w een oper a t i ng s y s t em s . There a r e a l o t
o f F L E X u s e r s ou t t he r e - - o u r c l ose r e l a ­
t i ve s i n t he compu t e r w or l d . I t i s good t o
be a b l e to ex change d i s k s w i t h t he m even i f
have
to
be
t ne
on es
to
p r o v i de
t he
we
d i Sk S .
REV I EW OF O S - 9
ENHANCEMENTS
C I S COBO L
OVERV I EW
COBOL
i s
a
big
1 anguage .
an
0Id
I an­
guage .
and a n e x t reme l y popu l a r
l a ng u a ge .
Some l a nguages were des i g ned to be comp i l e d
and r u n on s ma l l comp u t e r s : C O B O L w a s n o t .
C O B O L i s veheme n t l y det e s t e d by many peop l e
i n vo l ved w i t h compu t e r s ,
bu t .
desp i t e a l I
t he nas t y pub l i c i t y i t g e t s . COB O L i s p r o b ­
a b l y t he mo s t u s e d compu t er l a nguage i n t he
I f y o u need t o h i re an expe r i e n ced
wo r l d .
progr ammer f o r a bu s i nes s app l i ca t i on . you
w i l l f i nd t he h u n t i ng bes t i f you s noot f o r
COB O L w a s o ne o f t he
a C O B O L p r o g r amme r .
f i rs t comp i l ed l a n guages deve l oped f or c o m ­
pu t e r s ( a r o u nd 1 96 0 ) , a n d i t ha s bee n b e i ng
( arguab l y )
i mproved s i nc e t hen .
T he f u l l y
• i mp roved "
ve r s i on o f C O B O L i s a n e no r m o u s
l a ng u a ge w h o s e comp i l e r i s f u l l y capab l e o f
need i ng t he b e s t p a r t of a megaby t e o f mem ­
o r y t o r u n p r ope r l y .
T he re a r e 5 t a nderds aga i ns t wh ; c h a n y
v e r s I o n o f COBO L shou I d be meas u r e d .
ANS I
( Amer i c a n N a t i ona l S t a nd a rds I ns t i t u t e ) ha s
d ef i ned a C O B O L s t a nd a r d wh i ch c o ns t i t u t e s
t he
off i c i al
def i n i t i on
of
t he
l anguage .
CIS
C O B O L wa s w r i t te n t o c on f o r m t o t he
ANS I s t a nd a r d d e f i n i t i on of COBO L .
q u o t e t he manua l : " C I S C O B O L i s A N S I
as g i ve n i n ' Amer i c a n N a t i on a l S t a n ­
dard
P r og r amm i ng
L a ng u a ge
C O BO L '
( AN S I
X3 . 23
1 9 74 ) . "
It
i nc l ud e s l eve l
1
of
t he
ANS I d ef i n i t i o n of COBOL a l ong w i t h a - fe w
par t s o f l ev e l
2.
T h i s doe s n ' t mea n t ha t
C I S C O B O L i s t he ver s i on o f t he l a ngu a ge
y o u may have u s e d o n a m a i nf ra m e compu t e r .
but i t does mean t ha t i f you don ' t u s e t he
enhancement s t he t C I S C O B O L
i nc I udes .
t he
pr og r ams you w r i t e u s i ng i t w i l l run e s se n ­
t i al l y
u nmod i f i ed
on
a ny
other
comp u t e r
t h a t r u n s l eve l 2 o r h i gher of A N S I C O B O L .
A l so . s i nce C I S CO B O L i s comp i l ed t o i n t e r ­
med i a t e code , prog r a m s w r i t te n i n i t c a n be
r u n on any compu t e r t ha t has the a p p r o p r i ­
a t e i nt e rp r e te r .
I f you read t he a dd s i n
B Y T E , you w i l l see t ha t C I S COBO L 1 s i mp l e ­
men t ed f o r many compu t er s .
To
C OB O L
I
d i dn ' t
test
C I S COBOL e x h a u s t i ve l y
f o r c o n f o rm a nce t o t he s t andar d , b u t I d i d
wr i t e a f ew p r og r ams i n i t .
I am used t o
I BM ' s
V S - COBOL .
a nd
a ve r s i on o f U N I V A C
COB O � ; b o t h a r e h i gh l y e n hanced ve r s i on s o f
h i ghe r l eve l s o f A N S I COB O L t ha n C I S C O BO L .
I t t ook me a wh i I e t o l earn w h i cn of m y
f avor i te p r ogr amm i ng t r i ck s a re n ' t p o s s i b l e
under l ev e l
1 of ANS I COBOL . b u t .
af ter I
l ea rned t he l i m i t a t i ons I had t o l i ve w i t h .
I f ound t h a t I cou l d w r i t e prog r a m s w i t h n o
m o r e d i f f i cu l t y t ha n I usua l l y e x pe r i ence
when lOr i t i n g i n COBOL .
I w i s h I h ad been
a b l e t o t ra n s f e r a program f rom t he I BM t o
m y m i c r o a n d comp ; 1 e i t , b u t I don ' t know
o f any rea l p r og r a m s wr i t t en to be comp i l ed
by A N S I l ev e l 1 COBO L .
T rans f er r i ng a p r o ­
g r am i n t he o t he r d i rect i on i s n o p r ob l em .
S ta nd a r d
COBOL
doe s n ' t
suppo r t
t he
i n t e r ac t i ve m i c r ocompu t e r env i ronment
very
bu t C I S C O B O L
i nc l udes enhanceme n t s
we l l .
to t he A C C E PT a nd D I S P L A Y s t a t eme n t s
that
make i t r e l a t i ve l y e a s y t o d i sp l ay s c r e e n s
of
da t a ,
a nd
ac cept
data
f rom
f i el ds
def i ned on t he s C r ee n .
I nf or m a t i on c a n be
a cc e p t e d f rom . or d i sp l ayed a t , a par t 1 c u ­
l a r c u r s o r l ocat i on .
A n i npu t f i e l d c a n b e
def 1 ned a s nume r i C o n l y .
i n wh i cn c a se a n y
( l i ke
won ' t
"A " )
i nappropr i a t e c h a r ac t e r s
be
a c c ep t e d .
When
a
f ield
is
f i l i ed
w i th
da t a , t he c u r sor a u t o ma t i ca l l y j umps t o t he
beg i nn i ng
of
the
n ex t
field.
T he r e
are
spec i a l keys wh i ch j ump t he c u r so r f or w a r d
a n d b a C k w a r d a f i e l d a t a t i me .
Spec i a l
f unct i o n
keys
can
be
def i ne d .
They
act
1 1 ke
a
c a r r i age
return
( te r m i na t e
ent ry
i n t o a s c r ee n ) , b u t a p ro g r am c a n de t e r m i ne
whe t her a s c r ee n w a s t er m i n a t e d b y a c a r ­
r i a ge r e t u r n o r a f u n c t 1 0n k e y . a n d wh i ch
f u nc t i on key wa s u s e d .
T he l oc a t i on of t he
c u r s o r when c ar r i a g e r e t u r n w a s p r e s s e d i s
a l so
a va i l ab l e .
T ne
net
e f f ec t
of
t he s e
e n h a nceme n t s i s t h a t
i t
i s f a i r l y easy to
w r i te C I S
C OB O L p r o g r a m s t ha t a c c e p t a nd
d i s p l ay s creens of d a t a .
In
a dd i t i on
to
t he
u sua l
COBOL
f i le
( i nc l ud i ng
o r g a n i za t i on s
1 51M ) . C I S C O B O L
a l l ow s
an
o r g an i za t i on
t hey
ca l l
" l i ne
sequent i a l . "
L i ne
s equ en t i a l
f i l es
are
v a r i ab l e l en g t h r eco r d f l I e s ,
i n wh i ch t he
r e C o r d s a r e t e r m i n a t e d by c a r r l age r e t u r n s .
T h i s m a k e s i t e a s y t o r e ad a n d w r i t e f i l es
t n a t P a sca l wou l d c a l l " f i l es of t e x t . " T h e
mos t gen e r a 1 I Y ; mpor t a n t examp 1 es o f f I I e s
of t h i s t ype a r e f i l e s c r ea t ed b y t e x t e d j ­
t o r s , a nd l i ne by l i ne o u t p u t t o a t e r m i na l
or pr i nter .
The o t he r a c ce s s modes
sup­
por t ed b y C I S C O B O L a r e : sequent i a l ,
rel a­
t 1 ve . a nd i ndexed .
The names o f f I I e s c a n
b e s pec i f i ed a t r u n t i me u s i ng s ta t eme n t s
I i ke :
SELECT F I LE- I 5 ASS IGN TO
F I LE - I 5-NAME
.
ACCEPT F I LE- I 5 -NAME .
OPEN INPUT F I LE- 1 5 .
•
.
.
I n a dd i t i on t o t he s t andard A N S I debu g f ea ­
t u r e s , C I S COBOL has a r e s pec t ab l e I nt e r a c ­
t i ve
debugger .
T he
commands
a v a i I ab I e
u n d e r t h i s debugger a re :
T he r e i s f a r t oo much t o C I S COB O L f o r
me t o say w i t h ce r t a i n t y t ha t i t a l l w o r k s .
I
u n de r s t a n d
that
t he
l an g u a ge
has
but
a c t ua l l y b e e n succe s sf u l l y t e s t e d a ga i ns t a
se t of s ta nd a r d t e s t p rograms .
Rev i e w o f OS- 9 C I S COBOL
123
r
Di s p l a y the c�rrent pr ogram c o un t e r
G
S e t a b r ea k p o l n t
X
S i ng l e s t ep
D - Di s p l ay data a t s p e c i f i e d o f f s e t i n da ta d i v i s i on
A
Chan g e memory (ASC I I )
S
S e t b l o c k f o r d i s p l ay or c hang e
/
Di s p l ay b l o c k
- Change byt e s i n b l ock
T
T r a c e paragraphs
L
Wr i t e CR , LF
M
De f i n e a d e b ug mac r o
End a ma c r o d e f i ni t i on
$
Di s p l ay a s p e c i f i ed c ha r a c t e r
C
p r e c ed e s a c omment ( f o r d e s c r i b i ng mac ro s )
P
I
T he
-
-
i nt e r ac t i ve
debugger
can
b e used o n any
+D
C O B O L p r o g r a m by
i nc l ud i ng
m a n d 1 i ne t ha t
i nv o k e s
t he
' : u nC +0
u s e t he
i ng
to
on
test . i nt .
T h i s mean s
debugge r on a p r o g r a m
do
a n y t h i ng
s p ec i a l
t he
p r o g ra m ,
com­
e.g. ,
T he
t ha t you c a n
w i t ho u t h a v ­
when
you
Nuc l eu s
T ab l e
Ha nd l i ng
Sequen t l s 1
R e l a t i ve
comp i l e
I ndexed
i t .
I npu t
and Output
and Output
a n d O u t pu t
Segmen t a t i on
L i b r a ry
M i c r owa re
ln
t i ne s
Can
be
do
a
has
t he
i nc l u de d
C OB O L
ca 1 1 ed
is
MO V E - B LOCK
to
I np u t
I np u t
h l gh
run
t i me
f rom
a
a
ABORT
t e r m i na t e s
CHA I N
t he
makes
that
of
a
f i nd
i ns t ead
wh i ch
i f
of
t he
one .
' d
t i me .
it
a
change
CHD
_ , r e c t o r i es
for
w i th
an
e r ro r
OS-9
F $C he i n
was
p r e s sed
key ,
t he
da t e
SHE L L
and
a
i nvokes
s t r i ng .
e x e cu t i on
a nd
CHX
l oo k s
or
in
t he
run
t i me
s y s t em
Obj e c t
code .
T he
CALL
•
Nes t ed
•
P E R FORM
•
T he
•
•
w he t he r
i s
a l ready
t he
I - code
•
•
f or
in
t he
modu l e
If
t he r e
CA N C E L
t he
m o du l e ,
CALL
verb
memor y
i s
t he
un 1 i n k s
i s
a
i nt o
and ,
l em s
memo r y
i f
on
t ha t
w i th
a dd i t i on
r em a i n
t he
on
or
use
e x t ra
d i sk
IF
memory
ON
OVERF LOW
c l ause
ou t
T he
bu t
contr o l
subrout
i ne ,
f re e i ng
to
m e t hods
unt i l
mem o r y
I /O
i nt o
can
they
are
s h a r i ng
a
ca l l i ng
suppo r t s
be
s e c t i on s
e f f i c i en t l y
by
of
COBOL
u se d
t ha t
needed ,
at
to
wi 1 1
a dd i t i on
1 ,
cos t
of
common
poo l
of
ANS I
a
I
am
not
very
some
a nd
t he
c u s t om i z e
prob­
C ON F I G
the
t ype
of
It
u sed
to
were
run
of
ter­
i n
i s
COBO L
s or t ,
e 1 i m i na t e a s o r t
m aj o r redes i gn .
f ro m
popu­
COBO L
n u mb e r
i nc l ude
w ou l d
a
a ro u nd
CIS
s u r p r i s i ng
i t
in
wi th­
very
in
p r og r am s
and
do
work
A n o t her
A
of
OR
s t a t emen t s ,
to
m i S S i ng
and
to
I F
h a v i ng
s t a temen t .
prOduc t i on
l eve l s
AND
PO S S i b l e
t ha t .
w h i ch
SORT
one
i s
l i ke
f e a t u re
l ea s t
a d va nced
mos t
opera t i o n s
not
l i m i t a t i on
t he
of
m i s s ed
bOo l e a n
The
the
run
COBO L
t i me
be
p ro g r a m
COBO L
i nc 1 ud i ng :
c a l l ed
t e rm i na l
at
ha r d
to
w i t hou t
My
was
m i na l
in
up
a nd
COBOL
0 5 - 9 U s e r Not e s Vol ume I
m i nd .
t ry , ng
T e 1 eV i deo
mo re
c l ea r l y
8
to
t u r ned
to
l i ke
wha t
r u nn i ng
in
not
uses
my
ten
t he
wi th
for
H- 1 9 ,
F i nal l y ,
whi ch
wa n t ed
m i nu t es .
my
t wo
conf i gured
s u c c es s .
cus ­
wi t h
ANS I
sequences
s t rugg l ed
CONf I G
is
p ro g r a m
i mp r e s s e d
wr i t ten
RunC
i nc l u d e s
I t
u t i l i ty
c on t r o l
get
no
a
i n t e rp r e t s
a 1 so
t e rm i na l
not
I
witn
by
wa s
t e r m i na l
CONF I G
n i ng s
I
f av o r i te
Wh i ch
code
c on t ro l .
t e r m i na l
CONF I G .
CONF I G .
s y s t em
i n t ermed i a t e
for
s ta n d a r d
124
t he
C O BO L
Seg­
t he
suppor t i ng
but
pa r t i cu l a r
f e a t u res
r o u t i ne s
to
to
of
of
by
suppor t ,
a
s ome
upset
u se d
for
t om i zed f o r a
In
and
commu n i ca ­
1 e ve l
C OBO L ,
more
is
w i th
l ow
CIS
am
t e r m i na l
t ha t
I
l ar
t he s e
t he
for
I
s t a t em e n t s .
in
get s
of
t ha t
T ne
room
o v e r l ay memo r y .
1 eve 1
Re l a t i ve
I nt e r - program
2
d i sappo i n t e d
paCkage
COBO L
no
u s i ng .
p rogram
d i sk
men t s
f or
m i na 1 .
i t
i nt er p r e t e d
s u b r ou t i ne s ,
CIS
e x t e r na l
p r o g r a m segmen t a t i on , w h i c h
d i v i de
s t a t em e n t
l ev e l
wa s
is
In
COBOL
L I M I TAT I ONS
ut i 1 i ty
depend i ng
i nd i Ca t es
code ,
s t a t em e n t
i t
ANS I
I /O
i mp l emen t e d
•
l oaded
header
o b j ec t
new
t he
is
t he r e ,
or
execu t ed .
of
2
t i on
s u r p r i sed .
•
o r o g r a rr
not
START
Ful l
t i me
ca l l ed
l ev e l
UNT I L
r e s t r i c t i ons
•
is
of
IF
I ndexed
s t a t e me n t
1 i ke :
•
� t
pa r t s
i nc l ud i ng :
data
CALL " /DO/ S UB L I B / TE S T . SUB . 1 "
USING
ON OVERFLOW
T he
suppor t s
C I S C OB O L
and ,
a r e ca l l ed by numbe r .
C I S COS O L c a n a l s o
cal l
s u b r ou t i ne s
wh i ch
a re
e i t he r
COBO L
I - code ,
debug
t he p r og r a m .
s u b r ou t i ne s
T he
used
da t a .
spec i f i ed
t he
be
of
return
returns
t he
pa s s i ng
,
can
key
ca r r i age
wh i c h
F UN - K E Y s u b r ou ­
ACC EPT s t a t em e n t
f un c t i on
OA T E
o p t i on a l l y ,
'5 '">e 1 1
a
out
( C opy )
I n t e r - p r o g r a m commun i c� t i on
p r og ram .
b l ock
s t a nd a r d
s y s t em ca l l
a va i l ab l e .
The
t l ne can be u s e d a f t e r a
to
s y s t em
program
t he
subrou­
COBO L
procedure
speed move
c ode .
e i gh t
ter­
eve­
for
my
I
gave
was
much
I
T he r e
had
were
t h ree
f u ndame n t a l
p r ob l ems
w i th
hand l i ng of my Te l e V i deo ' s cont r o l
CONF I G ' s
sequenc ­
es .
CDNF I G expec t e d mo s t t e r m i na l c o n t r o l
s t r i ngs t o be n o more t han t hree cha r a c t e r s
l ong ; s e ve r a l o f t he ANS I s t r i ngs a r e l o n g ­
er
t ha n
t ha t .
CONF I G
s i mp l y
ca n ' t
dea l
w i th
t he
ANS I
d i rect
cursor
po s i t i on i ng
sequence ;
I
c i r c umvented
t ha t
p rob l em
by
p r e t e nd i ng t ha t my
t e r m i na l
d i dn ' t have a
d i rect
cursor
p os i t i on i ng
command ,
and
re l a t i ve
PO S i t i on i ng .
CONF I G
spec i f y i ng
c a n on l y dea l
w i t h commands t ha t move t he
c u r s o r one r ow or co l umn a t a t i me i n r e l a ­
t i ve
pos i t i on i ng
mode .
S i nce
t he
ANS I
s t r i ng s t h a t c a u s e t he c u r s o r to move one
row
or
co 1 umn a r e
t h ree
charac t e r s
l ong ,
th i s
i s a s l ow
way
to a d j u s t
t he c u r s o r
T he c l e ar - s c reen sequence f o r my
pos i t i on .
t e rm i na l
is
f our
c ha r a c t e r s
l ong ;
so
I
c ou l dn ' t
use
i t .
RunC
t r i es
to
f ak e
a
c l ea r - s c reen someho w , but
i t mak es a
rea 1
mess
of
i t .
T he
c l ea r - s c r een
sequence
somehow came out as a st r i ng of t housands
o f <be l l > cha r a c t e r s .
I unde r s t a nd t ha t a
more re ce n t v e r s i on of C O N F I G t han t he one
I
have a l l ow s a f o u r c h a r ac t e r s t r i ng f o r'
t he
c l ea r - s c r ee n
s equence .
I
t h i nk
that
wou l d have made
i t p os s i b l e f o r me t o g e t
my T e l e V i de o wo r k i ng w i t h COBOL .
CONF I G
f orms
a
t rap
f or
t he
unwa r y
user .
Once you s t a r t i n t o i t t here
i s no
t u r n 1 ng
back .
If
you
c hange
your
m i nd
abo u t t he response you j u s t keyed i n ,
you
have to wa i t un t i l you reach t he end Of t he
e n t i re ( l ong ) s t r i ng of ques t i ons ,
and a s k
t o b e a l l owed t o c hange a 1 arge s u b s e t o f
your a n swers .
When y o u a r e g o i ng t hr o u g h
C ON F I G t o f i x a m i s t ake or change an eX i s t ­
i ng t e rm i na l d es c r i p t i on t o f i t a new t e r ­
m i na 1 .
you
have
to
f i l l
in
t he
correct
a n s wer t o each que s t i on .
There i s no way
t o s e l ec t a def au l t , o r k e e p t he o l d va l ue
I t i s t rue t ha t C O N F I G i s not 1 i ke l y t o be
a heav i l y u sed u t i l i t y , but I f ound i t s o
h ard t o u s e t ha t I wou l d much r a t he r' have
a
f ew
s u b r ou t i nes
to
suppo r t
my
w r i t t en
t e rm i na l s .
Once I got t he s c r een supp o r t w o r k i ng .
f ound t ha t I w a s n ' t p l eased w i t h t he way
i t worked .
I be l i eve t ha t when t he c u r s o r
l eaves a numer i c f i e l d , t he f i e l d s hou l d be
j u s t i f i ed
a nd
zero
f i l l ed .
T he
r i g ht
s c reen hand l i ng pack age i n C I S C O B O L seems
to a g r ee w i t h me to some ex t en t .
I f you
enter a
" "
in
an
i n teger f i e l d
it
wi 1 1
r i ght
j us t i f y
and
zero f i l 1 .
I:lu t
if
you
e x i t t he f i e l d w i t h a ca r r i age r e t u r n ( en d ­
i ng t he e n t i re s c reen ) or down a r r ow ( mo v 1 ng t o t he next f i e l d ) , a t e s t f o r numer i c
i n t he p r og r am w i l 1
i nd i ca t e t ha t t he f i e l d
15
no t numer i c .
I f t he f i e l d ha s ed i t i ng
c ha l" a c t e r s i n
i t t he f i e l d i s i nc l i ned t o
end u p l ef t j U s t i f i ed and zero f i l l ed .
am used t o ge t t i ng usefu l ,
eng l i s h
e r r o r mes sages f rom COBOL ; C I S C O B O L g i ve s
e r r o r mes sages w i t h nume r i C codes i n them
i nd i ca t i ng w ha t t he error i s .
Even a f t er I
l oo k ed up t he e r r o r ,
i t wasn ' t c l ea r wha t
t he
p r Ob l em
was .
For
i ns t ance ,
when
I
had n ' t dec l a r ed a var i ab l e i t t o l d me t ha t
t he re was a t ype m i sma tch i n the s t a t eme n t
U S 1 ng
t he
�nd�c l a red
va r i ab l e .
When
r
t r i ed
to u s e AND and OR ,
i t gave me t he
same e r ro r .
I ended up t reat i ng t he e r r o r
message a s " some t h i ng ' s wrong around here . "
BENCHMARKS
ran
t w o benchma r k S
aga i ns t
th i s
COBO L :
one
for
s peed at
nume r 1 c proces s 1 ng
( t he
s i e ve ) ,
t he
o t he r
f or
speed
in
hand l i ng
I SAM f i l es .
a d j u s t ed t he p r i me number
p r ogr am f r om t he Janua r y 1 98 3 B Y T E s l i g h t l y
t o f i t A NS I
l eve l
one ,
and ran
it .
This
ve r s i on o f C O B O L wou l d ha'ie f a l l en nea r l y
at
t he bot t om of
t he cha r t g i ven i n t ha t
B Y T E , be t ween M i c r o s o f t COBO L and R MCO B O L .
I t t ook 5 4 1 seconds to f i n d t he f i r s t 1 8 99
p r i me s .
somewhat
I cou l d have made t he program run
f a s t e r b y u s i ng
i ndex i ng
i ns t e ad
of
SUbS c r i p t i ng ,
but
t ha t
wou l d
ha ve
s po i l ed
t he
benchma r k .
I
have
to
a dm i t
t ha t
I f e l t s i l l y wr i t i ng a E ra t o s t he n e s
S i e ve prog r a m i n C O B O L .
T e s t i ng COBO L f o r
i t s a b i 1 i t y t o f i nd p r i me number s i s 1 i ke
t e s t i ng p r og ramme r s
for
t he i r
abi l i ty
to
read L a t i n ;
t hey m a y b e ab l e t o d o i t b u t
it
i s ha r d l y re l eva n t .
I r an t ha t bench­
mark bec a u s e i t i s t he mos t u s ed benchm a r k
f o r m i c r o computer l anguages , b u t I a l so ra n
a no t he r
non - s tandar d ,
bu t ,
I
t h i nk ,
more
r e l ev ant , benchma r k .
con s t r uc t ed a benchma r k p ro g r a m wh i ch
g 1 ves
a
good
mea s u re
of
t he
s peed
w i th
wh i ch
t he
l a nguage
hand l e s
i ndexed
I /O .
I n dexed I /O i s ver y i mpo r t a nt t o t he g r oup
I n t er p r e t i ng
o f u s e r s who m i ght u se C O B O L .
t he
r e su 1 t s
of
a benchma r k
t ha t
i nv o l ves
r io i s a l i t t l e t r i ck y .
Cer t a i n l y t h e f i l e
s t r u c t u re t he l a nguage u se s i s very i mp o r ­
t a n t , espec i a l l y w i t h a l a rge i ndexed f i l e ;
but
t he
access
t 1 me
for
t he
d i sk
is
an
i mp o r t a n t f ac t o r , and t he t i me t he oper a t ­
sw i t ch
is
i ng s y s t em t akes f o r a con t e x t
somewha t i mpo r t a n t .
I bu i 1 t a f i l e 1 0 , 000 reco r d s l o ng of
55
byte
records
w i t h f i ve b y t e k e y s
and
t hen read i t random l y read i ng t wo reco r d s
a l t e r na t e l y f rom e a c h end .
It
took 26 i 5
seconds t o bu i l d t he f i l e and 3 2 3 3 seconds
to r ead t he f i l e ( i t w ou l d , of c o u rs e , have
been pos s i b l e t o read
i t faster
if
I
had
read sequ e n t i a l l y ) .
I ran t hese benchma r k s
on a G I M I X s y s t em w i t h a C M 5000 W i nche s t e r
( a f i l e t ha t s i ze wou l d n o t have f i t o n m y
8 " f l opp i e s ) .
I used O S - 9 Leve l T w o on a 2
mhz 6809 .
The perf ormance wou I d have been
much wo r s e i f I had u se d a f l oppy i ns t ea d
of a W i nches t e r ,
and somewhat be t t e r i f I
had u sed GM X - I I I .
I comp i 1 ed t hree C O B O L progr ams on t he
s a me mach i ne I
r an t he benc h ma r k s on .
A
S i mp l e
merge
program
wh i ch
I
haven ' t
i nc l uded w i t h t h i s rev i ew t ook 4 5 seconds
to comp i l e ,
t he s i eve comp i l ed i n :3 5 sec ­
onds ,
and
t he
I SAM
t es t
program
t ook
43
seconds .
SUMMA RY
It
is
pOS S i b l e
to
get
past
t he
p r ob l ems
w i th
CONF I G ,
to
l ea r n
to
l i ve
w i th
t he
p r i m i t i ve e r r o r m e s s a ges , and to f e e l c o m ­
f o r t ab l e w i t h t he s c reen hand l i ng c onv e n ­
t i ons .
W ha t
is
l ef t
is
a
s ub s t a n t i a l
1 mp l emen t a t i on of a n O l d ,
bu t usef u l
l an ­
guage .
I
don ' t t h i nk everyone s hou I d run
o u t a nd bU y thi s pac k age ,
but ,
for a f e w
peop l e ,
it
cou l d b e u n i que l y u sef u l .
If
you want t o u se a g r oup o f COBO L pr ogr a m s
on
m i c r ocompu t e r ,
it
wou l d
c er t a i n l y
be
eas i e r t o conve r t
t hem f rom one
l ev e l
of
Rev i e w o f 05 - 9 C I S COBOL
125
t o a n o t her t ha n to
t r a n s l a t e t hem
an ent i re l y d i f f erent l a nguage .
CIS
COBOL
w ou l d be a good teach i ng too l
for
schoo l s unab l e t o a f f o r d t i me on a mac h i ne
w i th
a
f u l l - b l own
COBOL
comp i l e r .
It
s hou l d be r e l a t i ve l y e a s y t o f i nd program­
who can work
i n COBOL .
W , th CIS
mers
C OB O L , a m i c r ocompu t e r cou l d be used as a
deve l opment env i ronment f o r C O B O L p r ograms ,
t hough t he l ow l eve l
of C I S C O B O L w ou l d
prevent t h i s i n m o s t caSes .
P e r haps t he
mos t
s i gn i f i ca n t
advant age of
CIS
COBOL
o v e r o t her l anguages i s t ha t p ro g r ams w r i t ­
ten i n C I S C O B O L can be moved I n I - Code
f o r m to a va r i e t y o f o t h e r mach i nes a nd
opera t i ng s y s tems , a nd r u n w i t hout sou rce
code .
UCSD P a s c a l
has s hown t ha t t h i s ; s
ar a s s e t even t hough 1 t C a n ' t ge nera l l y r un
under a nor ma l ope r a t i ng s y s tem
COBOL
i nto
C I S COBOL
was w r i t t e n by M i cro F ocus
L i m i t ed .
M i c rowa r e w r o t e a run t i me pack ­
age f o r i t t ha t a l l ows any p r og r a m w r i t t en
i n C I S COBO L , i nc l ud i ng C I S COBOL i t s e l f .
COBOL TEST
**
* '�
t o be r u n u nder O S - S .
B y Io.' r , t i ng a
run
t i me package f o r C I S C O B D L , a nd a r r a ng i ng
t o 1 i cense
i t for OS-9 .
M i c r oware made a
l a rge
co l l ect i on
of
bus i ness
s o f t w a re
ava i l a c l e to O S - 9 use r s .
I f you a re l ook ­
i ng f o r a n i ce accoun t i ng s y s t em , pay r o l l ,
MRP s y s t em , or whateve r . check w i t h M i c r o ­
ware .
T hey have a l o ng l i s t o f vendors
o f f e r i ng prog rams wh i ch r u n u nder t he C I S
C O B O L r u n t i me s y s t em .
S ome sma 1 1 number o f peop 1 e w i 1 1 f i nd
M i c rowa r e ' s vers i on of C I S C OBO L j us t what
t hey nee d .
I f y o u t h i nk you a re one of
t hose peop l e . I recommend t h a t you g e t t he
manu a l cef o r e you comm i t to t he l anguage .
T he manua l s won ' t be any he l p t o you i f you
d on ' t k now C OB O L , but . i f you dO , t he y w i l l
l eave you w i t h a n accu r a t e i mpress i on o f
t he l anguage , a nd e i t h e r l eave you i mp a ­
t i en t t o g e t t he sof t w a r e , o r d i s appO i n t e d
abou t some i mportant m i s s. i ng f e a t u re ( mo s t
l i ke l y s o r t ) .
PROGRAM
C I S COBOL '4 . 4
Te s t . CB L
PAGE : 000 1
I DENTI F I CAT I ON D I V I S I ON .
PROGRAM- I D . F I R S T- TEST . PROGRAM .
AUTHOR . P ETER D IBBLE .
ENV IRONMENT D I V I S I ON .
CONF I GURAT I ON SECT I ON .
SOURCE-COMPUTER . G IM I X .
OBJECT-COMP UTER . G IM I X .
I NPUT-OUTPUT SEC T I ON .
F I LE-CON TROL .
SELECT I N PUT- 1 AS S IGN " : C I : "
ORGAN IZAT I ON I S L I NE S EQUENT I AL .
S ELECT MERGE- F I LE ASS I GN MERGE-NAME .
SELECT TEMP - F I L E ASS IGN "MERGE . TEMP " .
DATA D I V I S I ON .
F I LE SEC T I ON .
FD I NPUT- 1 ;
RECORD 40 ;
B LOCK 5 ;
LABEL RECORDS ARE STANDARD .
0 1 I NPUT- I - LINE
P I C X ( 40) .
FD MER GE- F I L E ;
RECORD 2 0 ;
B LOCK 1 0 ;
LABEL RECORDS ARE STANDAR D .
P I C X ( 20) .
0 1 MERGE-LINE
FD TEMP - F I L E '
RECORD 20 ;
BLOCK 1 0 ;
LABEL RECORDS ARE S TANDARD .
P I C X ( 2 0)
0 1 TEMP- LINE
WORKING-S TORAGE SECT I ON .
P I C X ( 40) VALUE SPACE S .
0 1 I N- TH I S
0 1 L INE- FMT REDE F I NE S IN-TH I S .
02 KEEP- TH I S .
P IC X ( 9)
04 FI LLER
PIC X.
04 CARR IAGE-RETURN
P IC X (20) .
02 F I LLER
P I C X (20) VALUE SPACES .
01
MERGE-THI S
P I C X VALUE " 0 " .
01
F I LE- S TAT
PROCEDURE DI V I S I ON .
S TART-UP .
* PARAMETERS ARE G I V EN IN THE F I R S T RECORD OF STD . I NPUT
OPEN I NPUT I NPUT- 1 .
READ INPUT- 1 INTO MERGE-NA�E .
OPEN INPUT MERGE-F I LE .
OPEN OUTPUT TEMP - F I LE .
DISPLAY I fMER G ING S TANDARD I NPUT W I TH I f , MERGE-NAME .
•
•
l2 6
OS - 9 U s e r No t e s Vo l ume
I
,
.
**
Te s t . CBL
C I S C OBOL V 4 . 4
PAGE : 0002
READ I NPUT- 1 INTO IN-TH I S ;
AT END MOVE H I GH- VALUES TO IN-TH I S .
PERFORM F I X- IN .
READ MER GE - F I L E INTO MERGE-TH I S ;
AT END MOVE H I GH- VALUES TO MERGE-TH I S .
MAIN-SEC T I ON .
PER FORM MERGE- LOOP UN T I L F I LE-STAT EQUAL TO " 1 " .
MOVE " 0 " TO F I LE-STAT .
CLOSE MERGE- F I LE .
OPEN OUTPUT MERGE- F I LE .
CLOSE TEMP - F I LE .
OPEN I NPUT TEMP- F I LE .
P ER FORM R EAD- TEMP .
PER FORM COPY- TEMP- TO-MERGE UNT I L F I LE- STAT EQUAL TO " 1 " .
STOP RUN .
MERGE-LOOP .
PER FORM P I CK-NEXT .
WR I TE TEMP - L INE .
END-MERGE- LOOP .
EX I T .
P I CK-NEXT .
I F KEE P - TH I S < MERGE-TH I S
THEN
P ERFORM FIX- IN
MOVE KEEP- TH I S TO TEMP - L I NE
READ INPUT- 1 INTO IN-THI S ;
AT END P ERFORM END- I N
ELSE
MOVE MERGE-TH I S T O TEMP - L INE
READ MERGE- F I LE I NTO MERGE-THI S ;
AT END P ERFORM END-MERGE .
P I CK-NEXT-END .
EX I T .
END- I N .
MOVE H I GH- VALUES TO IN-TH I S .
I F MERGE-THIS
H I GH- VALUES
THEN
MOVE " 1 " TO F I LE-STAT .
END-MERGE .
MOVE H I GH- VALUES TO MERGE- TH I S .
I F IN-TH I S = H I GH-VALUES
THEN
MOVE " 1 " TO FI LE- STAT .
FIX- I N .
MOVE X " OD" TO CARR IAGE-RETURN .
COP Y -TEMP- TO-MERGE .
WRI TE MERGE-L I NE .
PER FORM READ-TEMP .
END-COP Y - TEMP- TO-HERGE .
EXI T .
READ- TEMP .
READ TEMP-F I LE ; AT END PERFORM END-TEMP .
MOVE TEMP- LINE TO MERGE- L I NE .
END-READ-TEMP .
EXI T .
END-TEMP .
MOVE " 1 " TO F I LE-STAT .
END- INPUT .
MOVE H I GH-VALUES TO I N-TH I S .
END-MERGE- I N .
MOVE HI GH-VALUES TO MERGE-TH I S .
END- PROGRAM .
EX I T
URN r p /
** C I S COBOL V4 . 4 REV I S ION 0
** COMP I LER COPYR I GHT ( C) 1 9 78 , 1 9 8 1 M I CRO FOCUS LTD
* " ERROR S= OOOOO DATA=0079 1 CODE=00489 DICT=00654 : 0 1 22 9 / 0 1 88 3 GSA FLAG
c
•
Rev i ew o f OS - 9 C I S COBOL
127
COBOL
**
S I EVE
s i ev . c b 1
C I S COB O L V 4 . 4
I DE N T I F I CA T I O N D I V I S I O N .
PROGRAM- I D . S I EVE .
AU THOR . P E T ER D I B B LE .
E N V I R ONMENT D I V I S I ON .
WOR K I NG- S TORAGE SECT I ON .
77
PR I ME
77
PR IME-COUNT
77
I
77
K
0 1 B I T-ARRAY .
03
PAGE :
!j
PIC 9 5
PIC 9 5
PIC 9 4
PIC 9 5
B I T OCCURS 8 19 1 T I MES
PIC
CaMP .
COMP o
COMP o
CaMP .
9 COMP o
PROCEDURE D I V I S I ON .
STAR T- U P .
D I S P LAY " TEN I TERAT I ON S " .
P ER FORM S I EV E THROUGH S I EV E-END .
D I S P LAY " P R I M E S FOUND : " , PR I ME-COUN T .
S T O P R UN .
S IEVE.
MOVE ZERO TO PR I ME-COUNT .
MOVE 1 TO I .
P ER FORM I N I T- B I TS 8 1 9 1 T I MES .
MOV E 1 TO 1 .
PERFORM SCAN-FOR-PR I MES THROUGH END-SCAN- FOR - P R I MES
8 1 9 1 T I ME S .
S I EVE-END .
EX I T
I N I T-B I T S .
MOVE 1 TO B I T ( I ) .
ADD 1 TO 1 .
END- IN I T-B I T S .
EX I T .
SCAN-FOR -P R I ME S .
I F BIT 0)
0
THEN
GO T O NOT- P R I ME .
ADD I I 1 G I V ING PR IME .
;,
DISP LAY PR I ME .
ADD I P R I ME G I V ING K .
PERFORM STR I KOUT UNT I L K > 8 1 9 1 .
ADD 1 TO P R I ME-COUN T .
NOT-PIUME .
ADD, 1 TO I .
EN�SCAN-FOR -PR I ME S .
EXI T
S TRIKODT .
MOVE 0 TO B I T (K) .
ADD P R IME TO K .
END-PROGRAM .
EXI T .
URN
* �, C I S COBOL V4 . 4 R E V I S I ON 0
=-
128
o s � U s e r Not e s Vo l ume
I
rp/
0001
COBOL BENCHMARK PROGRAM
* * C I S COBOL V4 . 4
)'r. ,'(
Bnch . CB L
PAGE ; 000 1
I DEN T I F I CAT I ON DIV I S I ON .
PR OGRAM- I D . I SAM- BENCHMARK
AUTHOR . PE TER D I BBLE .
ENV I R ONMENT D I V I S I ON ,
CONF I GURA T I ON S EC T I ON .
S OURCE-COMPUTER . GI M I X .
OBJECT- COMPUTER . G IM I X .
I NPUT-OUTPUT SECT ION .
F I LE-CONTROL .
SELECT I SAM- F I LE - l ASS IGN " I SAM . F I LE " ;
ORGAN I ZAT I ON I S I NDEXED ;
ACC ESS MODE I S SE QUENTIAL ;
RECORD KEY I S ISAM-KEY - 1 .
SELECT I SAM- F I LE-2 ASS I GN " I SAM . F I LE " ;
ORGAN I ZATION I S I NDEXED ;
ACC E S S MODE I S RANDOM ;
REC ORD KEY I S I SAM-KEY - 2 .
DATA DIV I S I ON .
F I LE S E C TI ON .
FD
I SAM-F I LE- 1 ;
DATA RECORD I SAM-RECORD- l .
01
I SAM-RECOR� l .
03
I SAM-KEY- l
P I C 9 ( 9) COMP-3 .
03
F I LLER
P I C X (50) .
FD I SAM- F I LE- 2 ;
DATA R EC ORD I SAM-RECORD- 2 .
01
I SAM-RECORD-2 .
03
I SAM-KEY-2
P I C 9 (9 ) COMP-3 .
03
F I LLER
P IC X ( 5 0 ) .
WORKING- S TORAGE S EC T I ON .
77 KEY-NO
P I C 9 9 COMP-3 VALUE O .
P I C 9 9 COMP - 3 .
77 H I -NUMBER
7 7 LO-NUMBER
P I C 9 9 COMP-3 .
77 DATE
P I C XXX VALUE l f 004" .
0 1 WORK-DATA .
P I C 9 (9) C OMP-3 .
03 WORK-KEY
03
I-DATA
P I C X (SO)
01
S Y STEM-DATE .
P I C 99 .
03
YEAR
03 MONTH
P I C 99 .
P I C 99 .
03 DAY
01
SYSTEM-T IME .
P I C 99 .
03 HOUR
03 M I NUTE
P I C 99 .
P I C 99 .
03 SECOND
PROCEDURE D I V I S I ON .
S TART-UP .
OPEN OUTPUT I SAM-F I LE- l .
MOVE "AS SORTED DATA : NAME , ADDRE S S , ETC , OR WHATEVER " TO
I-DATA .
ADD 1 KEY-NO G I V ING LO-NUMBER .
MOVE KEY-NO TO WORK-KE Y .
DI SPLAY " S TART BU I LD" .
CALL DATE US ING S Y S TEM-DATE . S Y STEM- T I ME .
D I S P LAY " T IME " HOUR , " : " . M INUTE . " : " , SECOND
��
•
Rev i ew of OS - 9 C I S COBOL
129
**
C I S COBOL V4 . '
Bnch . CB L
PERFORM ADD-R ECORD 1 0000 T IMES .
;� ��
in"
**
PAGE : 0002
C LOSE I SAM-F I LE- l
DI S P LAY " BU I LD DONE " .
CALL DATE U S I NG SYSTEM-DATE , SYSTEM-TIME .
D I SP LAY "T IME If HOUR , H : " , MINUTE , It : " , SECOND
MOVE WORK-KEY TO H I -NUMB ER .
D I S P LAY " R EAD S TART I NG " .
OPEN I NPUT I SAM- F I LE-2 .
PERFORM TEST-READS 2500 T IMES .
C LOSE I SAM- F I LE-2 .
CALL DATE U S I NG S YS TEM-DATE , S Y STEM-TIME .
D I S P LAY " TI ME " HOUR , " : " , M INUTE , " : " , SECOND
D I SP LAY " R EAD DONE" .
S TOP RUN .
ADD-RECORD.
ADD 1 TO WORK-KE Y .
WRI T E I S ��-RECORD- l FROM WORK-DATA :
I NVAL ID KEY PERFORM ERROR - I .
ERROR - I .
D I S P LAY " INVAL I D KEY : " , I SAM-KEY- l .
TEST-READS .
PERFORM R EAD-HI GH .
PERFORM R EAD-HIGH .
P ERFORM R EAD- LOW .
PERFORM READ-LOW .
R EAD-HI GH .
MOVE HI -NUMBER TO I SAM-KEY-2 . WORK-KE Y .
R EAD I SAM- F I LE-2 ; INVAL I D KEY P ER FORM ERROR- 2 .
SUBTRACT 1 FROM WORK-KEY G I V ING HI -NUMBER .
ERROR-2 .
D I S P LAY " INVAL I D KEY : " , WORK-KEY .
R EAD- LOW .
MOVE La-NUMBER TO WORK-KEY , I SAM-KEY-2 .
READ I SAM- F I LE-2 : I NVAL I D KEY P ER FORM ERROR-2 .
ADD 1 WORK-KE Y G I V ING La-NUMBER .
END-PROGRAM .
EXI T .
C I S COBOL V4 . 4 R EV I S I ON 0
URN rp/
COMP I LER COPYR I GHT (C) 1 978 , 1 98 1 M I CRO FOCUS LTD
ERRORS-OOOOO DATA-00705 CODE=00703 DICT=006 1 2 : 0 1 27 1 /0 1883 GSA FLAG
�
OS - 9 U s e r No t e s Vo l ume I
REV I EW OF SOFTWARE BY
CLEARBROOK SOFTWARE GROUP
DED I T
Ove r v i e w
D E d i t i s a s creen - o r i e n t e d ed i t o r wh i c h i s
i nt e n ded f o r use o n n o n - t e x t f i l es
It
d 1 sp l a y s t he con t en t s o f a f i l e ( o r a n
ent i r e d i sk ) i n what amoun t s t o " dump · f o r ­
mat
for
i nspec t i on a nd
mod i f i ca t i on .
I
t h i n k i t shou l d be p o s s i b l e t o conf i gu re
D E d i t for a ny term i na l t ha t has d i rect cu r ­
s o r po s i t i on i ng suppor t .
De t a i l s
D E d i t i s a m i n i ma l , b u t adequa t e , ed i t o r .
I t na s a set of 1 6 one - k ey s t roKe commands
cons i s t i ng
of
f i ve
cursor
cont r o l
keys
( uP . down , 1 e f t , r i gh t , and home ) , e i ght ed i t o r cont r o l keys ( ex i t , r e read s ec t o r . next
sec t o r . prev i ous s e c t o r , wr i te sec t o r , a nd
read spec i f i ed s e c t o r ) , t hree keys to con­
t r'o l a " f i nd " f ac i l i t y ( f i nd , a ga i n , a nd
a bo r t
f i nd ) .
T he
rema i n i ng t w o commands
con t r o l t he e d i t " w i ndows . "
D E d i t c a n d i s p l a y e i t he r t w o o r t h ree
w i ndows at a t i me .
The ma i n w i ndow i s a
hexadec i ma l f orma t d i sp l a y of a s e c t o r of
t he f i l e be i ng ed i t ed . To t he r i gh t of t he
hexadec i ma l d i sp l ay i s a n A SC I I d i sp l a y of
t he p r i nt ab l e c ha r a c t e r s i n t he sect o r . T he
t h i r d w i ndow , pos i t i oned near t he t op of
the s c ree n , i s the b i na r y represen t a t i on of
t he c ha r a c t e r wh i c h t he c u r s o r
i s pO S i ­
t i oned t o . T here i s a commend t o move t h e
cursor f rom w i ndow t o w i ndow , a n d a command
to t u r n the b i na r y w i ndow on and o f f .
The characters c o r r e s pond i ng to t he 1 S
commands a r e spec i f i ed b y a t eb l e i n the
D Ed i t program who ' s 1 0C8 t i on i s g i ve n i n
I f ou nd t he cho i ce of
t he document 8t i on .
command charact e r s s t r ange ,
and p rompt l y
changed t hem t o somet h i ng ! cou l d remembe r ;
i t was f a i r l y e a s y to change the t a b l e w i t h
debug ( I c ou l d have u sed D E d i t ) .
A no t h e r
t ab l e
in
t he
D Ed i t
program
descr i be s the c ha r ac t e r i s t i cs o f your t e r ­
m i na l . D E d i t i s s up p l i ed conf i gured f o r t he
T V I 9 1 0 , but can be a l t e re d t o work w i t h
mos t
o t he r
term i na l s .
T he
term i na l
mus t
suppo r t d i rect c u r s o r POs i t i on i ng .
and a
c l ea r sc reen / horne c u r so r sequence that i s
no more t ha n four bytes l ong .
wou l d have f o r
T he t h ree ma i n uses
t h i s k i nd o f e d i t o r a r e p l a c i ng speC i a l
c ha rac t e r s
in
text
f i l es ,
f u s s i ng
with
d i r e c t o r i e s ( u neras i ng f i l es ) , ana zapp i ng
modu l e s .
F o r zapp i ng t e x t f i l e s i t wou l d
be n i ce t o be a b l e t o e l i m i na t e t he hex
w i ndow f or qu i c k scann i ng of a f i l e .
Per­
h a p s a o n e b y t e he x w i ndow cou l d be kept a t
t he t op of the sc reen t he way t he b i na r y
w i ndOW i s . F us s i ng w i t h d i re c to r i es w ou l d
be much e a s i e r i f t he e d i t o r wou l d f o r m a t
t he d i r ec t o r y i n a mean i ng f u l way - - t he
f o r m a t i s r i g h t t h e r e i n t he S y s t e m P r o ­
g r a mmer ' s Manua l , bu t I apprec i a t e p r o gr ams
t ha t make t h i ngs e a s i e r for me . The modu l e
f or m a t i s a no t he r one t ha t c ou l d b e d i S ­
p l a ye d more mea n i ngf u l l y . T he modu l e header
c ou l d be sepa ra t ed f rom t he rest o f t he
mOdu l e and t he pa r t s of i t l ab e l ed .
D i sa s ­
semb l ed f o r mat wou l d be another n i ce f ea ­
t ur e .
E ven a bare- bOnes e d i t o r needs a gOOd
manua l .
D E d i t ' s manua l
i s no t good .
For
anyone but a b rave and expe r i enced hacker
t he poor document a t i on cou l d ent i re l y r u l e
out u s e of th i s program . T he commands a "e
al l
desc r i bed on one page t oge t he r w i t h
d i rec t i ons f o r Chang i ng t he command charac­
ters .
The
t e rm i na l
d e s c r i p t i on t ab l e
is
descr i bed i n t w o a nd a h a l f pages I n s u f f i ­
c i e n t d e t a i l t ha t a n y exper i enced a s s emb l y
l anguage p r ogr ammer shou l d be ab l e t o con­
f i gu r e the program
for
a
term i na l
eve n t u a l l y . I spe n t qu i t e a w h i l e l ea r n i ng
t ha t
the
nume r i c
f i e l ds
were
u n s i gned .
Desp i t e t he f a c t t h a t one- byte f i e l ds a re
a l mos t a l ways s i g ne d i n 6B09 mac h i ne l an­
g uage , t he uns i gned na t u re of t hese f i e l dS
was never ment i oned . Pe r haps i t s ho u l d have
been Obv i ou S t o me ( a f t e r a l l , cursor pOS i ­
t i ons a re neve r nega t i ve ) , but I used about
t e n m i n u t es f i gur i ng t h i s out .
Summa ry
F o r s omeone who needs a d ; s k ed i tor r i ght
now , D E d i t wou l d be a u s e f u l u t i l i t y . F o r
a nyone w h o can wa i t .
I
wou l d
recommend
hang i ng on ; t h i s program has more f e a t ures
t ha n t he v a r i ous f r ee ones I know o f , b u t
not e n o u g h t o m a k e i t w o r t h t he money t o
someone who w i l l o n l y u s e i t occas i ona l l y .
BT9
Ove r v i e w
B T 9 i s a mOdu l e w h i c h ma i nt a i ns f i l es i n a
b i na r y t ree f o r ma t . The BT9 mOdu l e ca n be
ca l l ed f rom Bas i o09 , or any o t her l a nguage
wh i ch can use t he 8a s i c09 ca l l i ng sequence .
L im i ta t i on s
T here
are
no
s e r i ous
d r awba c k s
to
D E d i t . I t w o r k :; r e l i a b l y , and ha s enough
feat u res to be u s e f u l . D E d i t seems to have
been deS i gned to
be u sed
for
emergency
repa i r s to d i rec t o r i es . a nd o t he r spec i a l
purposes . T h i s k , nd o f use doe s n ' t c a l l f o r
a f e a t ure packed ed i t o r ; s t i l l , I am d i sap­
po i n t e d i n t he bare-bones appr oach C l ea r ­
b r ook t ook t o t h i s p r ob l em .
De t a i l s
F ou r t ee n commandS c a n be p a s s ed
to B T 9
a 1 : ow i ng
r a ndom
a ccess ,
and
sequ e n t i a l
access
( f o rward
or
b a c k w8 r d s )
to
f i l es
bu i 1 t and rna i n t a i ned t hrough 8T9 . The com­
mands a re :
Rev i e w o f So f t w a r e by C l ea r b r ook S o f t wa r e G r o up
131
f i le
Read
heade r
-
Wr i te
-
Read
-
Wr i t e
a
-
Add
record
-
Qu i ck add
Up da t e cu r r e n t
record
t he
record
work
( done
f i le
after
-
a
a
a
ope n )
hea der
( done
T he
D-5ER I E 5 UT I L I T I E S -- DD I R ,
DDEL , DeOPY AND DATTR
-
be f o re
c l os e )
Ove rv i e w
record
record
I
De l e t e
current
-
F i nd
-
F i nd
>"
key
-
F i nd
r ec o r d w i t h
l owe s t
-
F i nd
record w i t h
h i ghes t
-
F i nd
next
h i gher
record
-
F i nd
next
l o wer
"
be�
p r og r a ms .
DIR,
on
is
demons t r a t i on
key
record
A1 1
ma r g i na l ,
program
bu t
w h i ch
t here
is
a
is
g re a t
<f i l e
spec>
name .
an
PE
t remendous
T he y
ture .
b i na r y
of
when
b i na r y
t ree
t u re
p i cked
t r ee
c ho i ce
t he
data
in
fOr
is
wha t
t he
use
BT9
da t a
i s
added
t he
i de a
of
a
i n
trees
f r om
have
don ' t
a
in
f c r ma n c e
u se s
t r ee
t he
wi t h
<f i l e
Mos t
da ta
i nc l ude
AVL
t rees
T he
mos"t
t ype
B - t ree .
t ree ,
A
T he
c o l umn )
of
it
2-3
a nd
t ree
to
is
use
s truc­
have
t ree .
and
1t
is
much
the
b i nary
t ree w h e n t h e da t a
lS
a c c u , i ng
da t a
r e a s onab l e
l em s ,
to
bu t
that
takes
d i sk
�u t
be
a
e ny
one
good
d i sk
d i rector i es
poor
of
dea l
t he
f rom
for
a
t he
fi le.
p r omp t
l i st
t he
the
l ower
t he
t he
l ev e l
b i na r y
T he
owner
It
tht s
not
wh i ch
one
but
wi l l
be
S i mp l e
( o ne
wh i c h
me e t
of
it
s p eC i f i ed
l ower
oo I R
l evel
qu i t e
l ev e l
i s
for­
i nt o
t he
readab l e .
The
t he
f i l es
I t
can
de l e t 1 ng
t he y
a re
each
de l e t e d ,
di rectory
Onl y
superuser
t ha n
t he
a
of
c ha nge
opt i o n s
t he
a nd
al l
are
a dd i t i on
new
f i l es
t rle
of
t he
a
f i le
s e l ec t i o n
same
set
as
of
0)
does n ' t
and
cr i ­
for
Ooe l
opt i o n s
a t t r i ou t e s
( user
he
a t t r i bu t e s
t he
and
can
to
owne r .
c h an g e
t he
own .
us i ng
s eems
T he
prob­
me e t i ng
prob l em
to
f i x .
t Ow a r d
t he
1n
e r r o !"'s
program
recovery
oCopy
t he
s e l ected
comma n d
•
l i st
"
copy
al l
cr i t e r i a
to
T he opt i o ns
p r om p t
cop i e s
s e l ect i o n
d i r ec t o r y
d i rected .
user .
p rogram
Of
as
m e e t i ng
spec i f y
e as i er
l:I e f o r e
can
faster
of
al l
cr1 ter 1 8 .
f i l es
f r om
a
se1 e c t e d
a no t her
are :
bef O r e c o p y i ng
f i l es
as
t he y
are
cop i ed
to
f r om
fi les
i n
speC i f i ed
and
l ow e r
d i rector i e s
i mag i n e
prO l:l l em
wou l d
be
O - Se r i es
a
in
de l e t e s
f i l es
m a k e d i r ec t o r i e s
f i l es
d e s t l na t i on
modu l e
a
each
spec i f i ed
f i l es
d e l et e
on l y
can
PR
d i r e c t o r i es .
PA t t I"
of
ter i a .
S umma ry
a
to
this
•
can
t he
w h i ch
in
s e l ec t i on
s ea r c h
e r ror s .
$ :, l ve
fOr
command
opt i ona l l y
and
is
at t i t u de
a u t oma t i C
S
0
D
pa r e n t he s i s .
f i l es
of
wh i c h makes
ooe l
o t her
II
ou tpu t
w i th
t re a t me n t
g i ve s
t he
opt i ona l l y ,
ha b i t s 1 i ke
to
by
f l l es
fi le
or
These
and
used
i nd e n t i ng
T he
t he y
on d i S k .
c a l l 1 n9
f i les .
t he
al l
The
me e t 1 ng
per­
texts
maj o r
repo r t e d
to
s l oppy
f o rm
o t her
( 1e
number ,
cr i t e r i a
a nd ,
d i re c t O r i e s .
hard l y
any
cesua 1
i mp o s s i b l e
any
it
f i le
NOT
T he
a
of
ho r r i f y -
p rogram
w i th
T h e y a re
Th i s
i t
a t t emp t
d i sk
a
r e f l ec ted
way .
ma k e s
is
r a t he r
e r rors .
not
b o t her
t here
wou l d
BTS
this
s t ructure
i s
se l e c t
s e l e c t i on
owner
w r o ng
own
<f i 1 e
a
par t
user
OR .
command
On
l i ke
nas t y
ANC ,
spec>
ma t t e d b y
d i sks
s o me t h i ng
aOe s n ' t
b i nary
After
on
wh i c h
p a r ame t er s .
t he
a
of
t he
p r Obal:l l y
on
of
E ) ,
DD I R
d i rec t O r y
t ha t
t rees
and
t he
the
commands
i nc l ude
t he
i nc l ude
1 i st
speed
s t ruc t u r e s
popu l a r ,
B - t r ee
but
for
on .
plain
b i c h r oma t l c
caus i n9
of
user ' s
to
when
just
c ha r a c t e r i s t i c
b r a nches
a nd
way
o r de r .
is
data
A
wi l l
ca l l e d
l ong
f a m ; l y· .
be s t ,
wa i t i ng
this
h i gh
pos s i b l e
fami l y
t he
g r ow
W
i nd i ca t e
1 ng .
T re e s
ATTR
command
one
can
comb i ned
s t ruc­
t he
stat i c .
sorted
b i nary
fi le
even
not
WO r s t
the
with
w rong
i sn ' t
dat a
l i ke
p r ob l em
the
as
a t t r i bu t e
R
ccmmands
program .
s t ruct ure
D - Se r i e s
o p t i on
ac t ed
memo r y
COPY , and
mu l t i p l e f i l e s .
the
T he
L i m i t a t i O.n s
A
been
gene r a l i z a t i o ns
DEL .
spec>
PW
a
ha s
are
Deta i l s
key
he l p .
is
user
T he y
key
documen t a t i on
T he r e
05-9
every
t he s e
be
was
in
us i ng
a
very
qu i ck
this
and
d i f f i cu l t
upwa r d l y
modu l e
d i rty
to
u s e d a B - t ree d a t a
ex i s t
in
to
way .
wr i t e
compat i b l e
0111 rea dy
wh i ch
d i rectory
a
w i th
Pr obl ems and L i m i t a t i o n s
s t ru c t u r e .
T he
f i le
s e l ec t i o n
commands
ter i a
are
t he
not
cri ter i a
e q u i va l en t
p a r t i cu l a r
t he r e
used
e 1 abora t e
as
are
UNI X
no
w i th
as
t he
commands
wild
cards
t he s e
cr i ­
use .
Or
In
pa t ­
t e r n ma t c h i n g opt i ons .
If
7
a ny
spec i f i ed
S i nc e
has
this
rev i ew
announced
a
was
wr i tten
pac k age
C l e a r b r ook
that
suppo r t s
a - T rees .
132
05- 9 Use r No t e s Vol ume I
comma nds
ed
on
command
f Or
t he
t he
t he
d i rect ory
command
l i ne
DD i r .
pa rame t e r s
ooe l ,
name
l i ne .
mu s t
Mos t
a nd
be
OS-9
are
DA t t r
i nc l u d ­
commands
use " . "
D-Ser i es
g i ven .
don ' t
as t he de f a u l t d i r e c t o r y , and
commands do i f no p a r a me t e r s
It
seems
a l ways
i ncons i s t e n t
a l l ow
t he
t ha t
d 1 rectory
to
t he
are
t h ey
be
d e f au l t e d .
T he DD I R command some t i mes a r e t u r n s w i t h
an
error
211
( e nd
of
f i l e) .
It
is
my
t he o r y t ha t t h i s i s re t u r ne d f r om t h e l a s t
read
of
t he
d i re c t o r y ,
a nd
is
ent i re l y
i nno c e nt , bu t s h ou l d n ' t be r e t u rned t o t he
s he l l
t i on :
in
m i no r comp l a i n t
e v e r y t i me " p r
t he
abou t
t he documen t a ­
p w " s hou l d have been
d o cumen t a t i on ,
" pr
pr "
was
t he r e
i ns t ead .
Summ a r y
T he D - Se r i e s commands a re very u s e f u l . T hey
a re not w i t ho u t f a u l t s , b u t , espeC i a l l y f o r
s y s t em s w i t h l a r ge capac i t y d i s k s ( l o t s of
f i l e s ) , t he y are a l mo s t e s s e n t i a l .
Re c o n s i d e r a t i o n
s e n t t h i S rev i ew to C l ea rbrook Sof t wa r e
G r oup
for
t he i r
c ommen t s .
They
r e t u r ned
t he l e t t e r wh i ch I have i nc l uded w i t h t h i s
r ev i ew ,
re v i s i on s t o t he docume n t a t i on f o r
t he e d i t o r ,
a
n e w e d ht o r ,
and a conf i g
p ro g r am f o r t h e e d i t o r .
The
documenta t i on
is
much
i mp r oved ,
a l t hough i t s t i l l s u f f e r s f rom hav i ng been
wr i t t en
by
a
k now l edgeab l e per s o n .
T hey
i nc l uae d i r e c t i ons f o r recover i ng a de l e t ed
f i l e wh i c h a re u s e f u l , a n d wha t appe a r s to
be a s c r e e n dump O f a d ed i t s c r een wh i ch 1 S
a l s o n i ce t o have . W i t h the o r i g i na l doc u ­
menta t i on ,
I spent a wh i l e t ry i ng t o u s e
D E d i t be f o re I rea l i zed t ha t I had i t c o n ­
f i gu r ed w r on g .
had
t r oub l e
w i th
the
· co n f i g d ed i t "
p r og r am
t he y
sent
me :
it
some t i mes
j us t
s t opped .
I t was a packed Bas i c09 p r o g r a m
s o I cou l dn ' t t e l l whe t he r 1 t was an i ncom­
pa t i b i l i t y
w i th
my
B a s i c09 .
or
some t h i ng
e l se .
T h e new ve r s i on of D E d i t
is
i de n t i ca l
t o t he one I a l ready had .
I ran t he O S - 9
compa r e
ut i l i ty ,
cmp .
a ga i n s t
t hem
and
f ou n d t he y o n l y d i f f e r ed i n t he by t e s t ha t
a r e changed when t he t e r m i na l conf i gu r a t i on
i s done .
T he
t o t he document at i on
i mprovement s
a re
n i ce ,
a nd
t he
conf i gura t i o n
p r og r am
seems
l i ke
it
m i g h t make
it a
good
dea l
e a s i e r to s e t D E d i t up f o r a t e r m i na l ,
if
i t wou l d w o r k .
a
Th i s
p r ob l em
( e r r or
211)
has
s i nce
been
f i xe d
9
T he
l etter
i sn ' t
i nc l uded h e r e ,
but
it
d e ta i l e d t he i mp r oveme n t s t hey had made ,
and
sa i d
that
D E D I T d i d what
it
was
i n t e nded t o do ve r y n i ce l y .
Rev i e w o f
So f t w a r e
by C l e a r b r o o k S o f t w a r e G r o up
133
1 34
'0 5 -3 U s e r N o t e s V o l ume I
A REV I EW OF DYNACALC FOR
OS- 9
prope r l y
to
work
D Y NA C A L C
( us i ng t he I NS T A L L u t i l i t y ) ,
s e nd us you r o r i g i na l D Y NA C A L C
d l sk e t t e and a copy o f
the
for
you r
o pe r a t or ' s
manua l
C RT . We w i l l e i t he r mak e i t
work on your t e rm i na l , a t no
e x t r a cha r ge t o you , or r e f u n d
your fu l l
DYNACALC
p u r c ha s e
p r i ce .
OVERV I EW
D Y NA C A L C
is
a
very
capab l e
e l ec t ro n i c
s p r e a d s he e t p ro g r a m . I t i s e nough 1 1 k e e l l
t he
o t he r
s p read
sheet
p r og r a m s
(vi s1c l one s ) 5 0 anyone f am i l i a r w i t h one o f t hem
shou l d be a b l e t o a d j u s t to D Y N A C A L C v e r y
qu i ck l y ,
D Y NA C A LC
is
no t
a
g re a t
l ea p
b e y o n d a l l o t he r e l e c t ron i c spread shee t s ,
b u t i t i s a v e r y good examp l e of t he c u r ­
r e n t s t a t e of t he a r t .
T he t i s a very i mp re s s i ve comm i tment !
If
you have sev e r a l u s e r s or you r s ys t em w i t h
d i f fe re n t t yp e s of t e rm i na l , you can get
D Y N A C A L C t o suppo r t t hem a l l concu r re n t l y
i f you have each t e rm i na l t ype u s e a d i f ­
f e re n t da t a d i r e c t o r y , and put t he app r o ­
p r i a t e t e rm i na l f i l e i n eaCh d i r e c t o r y .
A e l ec t r on i c s p r e a d s he e t p r o g r a m makes
t he t e r m i na l appea r t o be l oo k i ng a t a s e c ­
t i on of a l a r ge g r i d . T he " c e l l s " i n t he
gr i d can each conta i n a number , equa t i on ,
or cha r a c t e r s t r i ng , T he equa t i on s u s ua l l y
ope r a t e on the con t e n t s of o t he r ce l l s ( A
co l um n
of
cel l s
m i ght
conta i n
mont h l y
expenses', and anot h e r ce l l someWhere on t he
g r i d m i ght conta i n t he sum of a l l t he ce l l s
i n t he co l umn of expenses . ) T he s pec i a l
t h i ng abou t
e l e c t r on i C s p r ea d shee t s a s
opposed t o paper s pread sheet s i s t h a t when
a
number
or
e q u a t i on
on
an
e l e c � ron i c
s p re a d Sheet i s changed , a l l t he c e l l s t ha t
depend o n t ha t v a l u e a re upda t ed t o r e f l ec t
t he change . T h i s i s a s i mp l e i de a , b u t s u c h
a g o o d i de a t ha t I k now of many peop l e who
have purchased compu t e r s j us t t o be get a t
t h i S k i nd of p rogram .
OYNA C A L C can save t he con t en t s of
a
s p r e a d s heet i n a f i l e t ha t can be r e a d by
o t he r p rogr ams . I wou 1 dn ' t ca 1 1 t h e f i 1 es
e a s y to u se , but t he y a r e n ' t i mp o s s i b l e t o
u s e e i t he r , a n d t he f o rmat i s c l ea r l y docu ­
ment ed . D Y N A CA L C ' 5 s a ved d a t a i s ha r d t o
u s e because t he f o r m a t O f t he f i l e r e f l e c t s
D Y NAC A L C ' s f l ex i b l e a t t i t ude t ow a r d s
t he
u s e r - i t w i l l t a k e any s o r t of d a t a s ca t ­
t e re d a r ound anywhe r e you l i ke . I f you w a n t
t o c rea t e a f i l e f o r D Y NA C A L C t o u s e a s
d a t a f o r a s p read shee t , you don ' t have t o
cope w i t h t he v i c i s s i t udes o f human s . I t i s
a
r e l a t i ve l y s i mp l e
J Ob
t o c re a t e d a t a
f i l es f o r D Y N A C A L C ,
An exce l l en t he l p f ac i l i ty i s an i nt e ­
g r a 1 p a r t o f t he p r og ram , t hough you c a n
remove i t t o s a ve s pace ; f y o u want . M o s t
o f t he t i me y o u can t ype a " 7 " t o a cc e s s a
s c reen
Of
t e r se
exp l ana t i ons
of
your
opt i ons , The he l p sc r eens do not t a k e t he
p l ace of read i ng t he manua l , bu t t he y c a n
p r ov i de a qu i Ck j og o f t he memory . T he re
a r e a l s o 1 2 e r ror coaes wh i Ch I w i s h a l l
v i s i c l ones had .
Spread shee t s can t a k e on
s ome of t he a t t r i bu t e s of comp l i ca t ed p r o ­
g ra m s , e s peC i a l l y ha r d t o f i nd b u gs .
I ma g ­
i ne t r y i ng t o debug a program w i t h on l y one
e rror
message
l i ke
· S or ry ,
I
c an ' t
do
t h a t , " · Sa y Wha ? " or wha t e ve r .
SOME DETA I LS
D Y NA C A L C i s a l a rge 6 8 09 a s s emb l y l a ngu age
p r o g r am w h i ch has bee � a va i l ab l e under F L EX
s i nce l as t yea r , It i s now a l so av a i l a b l e
under O S - S . T he O S - 9 v e r s i on doesn ' t seem
l i ke w a r me d over F L E X code ;
i t s e ems t o
have been des i g ne d f o r O S - S . I t i s r ee nt ­
r ant ( t he same modu l e can be u s ed by a n y
numb e r o f
s i mu l t aneous u s e r s ) ,
a n d u se s
s t a nd a r d i np u t a n d o u t pu t . P ra c t i ca l l y a n y
CRT
type t e rm i na l
c a n b e suppor t ed ,
In
f ac t , t he wa r ra n t y f o r D Y NA C A L C s a y s t ha t
i f you have a C RT t e rm i na l w i t h a t l ea s t 80
c ha r a c t e r s
per
1 i ne
and
d i rect
cu r so r
addreSS i ng :
My copy of O Y NA C A L C came t he t e rm i na 1
f i l es
l i s ted
in
F i gu r e 7 .
I
r ec og n i ze
Haze l t i ne ,
A dds ,
Hea t hk i t / Z en i t h ,
SWTPC ,
ADM , a n d T e l ev i deo i n t h e r e
Even i f your
t e rm i na l i s n ' t i n t ha t 1 ; s t , you can u se
t he I NS T A L L . DC u t i l i ty to bu i l d a t e rm i na l
f i l e for you r t e rm i na l .
t he
t erm i ne I
has
If
you r
requ i red cha r a c t e r i s t i cs , b u t
you a r e unab l e t o conf i gu r e
F i gu I" e
7:
c 8 2 00 92
h 1 420
h-1 9
tv 912
tv-950
c8200
h 1 40 0
aCId�_ 3a
an S i
i CL1 20
c t 82 92
c82 w-9 2
adds vpt
adm 3 a
i nfo 1 00
c t 82
c82 w
h 1'500
act i v
p e '550
D ynac.a l c T e r m i na l Suppor t
A p a r t i cu l a r l y s t rong p o i n t o f O Y N A C A L C
i s t he s e t o f powe rf u l f u nc t i ons i t s u p ­
p or t s , i nc l ud i ng bas l c ma t h ( t r i g , l og/exp ,
square r.Jot , max/ m i n , p i , i n t , round , and
a b so l u t e va l ue ) ,
" g roup "
f u nc t i ons
( s um ,
a v e r a ge ,
s t andard dev l a t i on ,
net present
va 1 ue , choose ,
l ookup , and i ndex )
and a
Dunch of m l sc e l l a ne o u s f u nc t i o ns .
C r,oose
s e l e c t s t he nth e n t ry f rom a l i s t , l oo k up
i s t he s t a ndard v i s i c l one l ookup f un c t i on ,
a n d i nd e x i s l i k e l OokUP except t h a t
it
s ca n s f or a n e x a c t ma t ch i ns t ead o f g r ee t e r
t han .
Many o f D Y N A C A LC ' s f unc t i ons
work
wi t"
e i t he r cha r a c t e r s t r i n g s o r numbe r s .
T h i s e xpands t he u se f u l ness of t he f un c ­
t i on s s u b s t a n t i a l l y .
•
_,
D Y N A C A L C has commands wh i Ch move r o w s
and
do
i ns e r t
and
and
c o l umns
a round .
d e l e t e o pe r a t i ons on t hem .
The f anc i es t
A \ Re v i e w o f
DynaCa l c
f o r OS - 9
135
•
au i ck 1 y .
DYNACALC
command i n t h l S f am i l y i s t he s o r t comma nd ,
w h i c h a l l ow s
you
to sort
rows o r c o l umns
based
on
t he
va l u e s
in
a
Co l u m n o r
row
whl 1e
r e s p e c t i ve l y .
but
I
1t
wou l d h a ve
s u pp o r t
more
st i l l
w i sh
it
s u p por t l ng
been h a r d
to m a k e
adva nced
t e r m i na l s
" dumb "
t e r m i na l s ,
had been done .
I
have neve r been e n t i r e l y p l eased w i t h
speed of a n y p r o g r am . Of c o u r se I w i s h
D Y N I>. C A L C r a n f a s t e r , bu t I do n ' t remember
us i ng a s p r ea d s heet p ro g r a m o n a m i c r ocom­
pu t e r t ha t ran f a s t e r .
t he
L I M I TAT I ON S AND PROBLEMS
T he o n l y rea l p r ob l em w i t h D Y N A C A L C i s w i t h
i t s t e r m i na l
s upp o r t ,
a nd I ' m n o t s u r e i t
cou l d have been done m u c h be t t e r w i t ho u t
genera l i t y .
T he
t e rm i na l
s uppo r t
l O S i ng
pr o b l em
is
not
a
ma j o r
one .
In
fact ,
I
i ma g i n e t ha t
after a
f e w mon t h s of
u s i ng
t he p r og r a m I w i l l f e e l no t h i ng b u t a f f ec ­
t l on f o r i t .
I t i s h a r d to C h o o s e c ha r ac t e r s to u s e
as
a r row · k eys .
DYNACALC
uses
cur l y
a nd
� q u a r e b r a c k e t s as c u r s o r con t r o 1
k ey s by
o e f a u l t . T h i s i s a good cho i ce i f you w a n t
t o c r i ve i t w i t h a d i s k f i l e , b u t no t v e r y
i n t u i t i ve .
I f y o u 1 i k e t h i s c ho i ce a s 1 i t ­
tIe
as
I
did
you
can
c ha n ge
i t
w i th
I N ST A L L .
U nf o r t u na t e l y
i ns t a l l
o n l y a l l ow s
you
to
use
s i ng l e
cha rac t e r s
as
co n t r o l
k e ys ;
my
t e r m i na l ,
l i ke
most
t e r m i na l s ,
s e nds es cape s equences when t he a r r ow k e y s
a r e p r e s s ed .
S c reen
not
as
fast
and
upda t i ng
is
s m oo t h a s i t i s o n mach i nes t ha t have i n t e ­
gra l
s c reen s u ppo r t .
I j u n de r s t a nd t ha t
a
9 6 00 baud t e r m i na l c a n ·' t p o s s i b l y compe t e
w i th
mem o r y
mapped
v i deo ,
but
I
be l i e ve
t ha t ,
if
t he
i nsert
a nd de l e t e cha ra c t e r
a nd
l i ne
f ac i l , t l es
on
my
t e r m i na l
were
u sed ,
the
s c reen
c ou l d
be
upda t ed
more
1'3 6
0 5 - 9 U s e r No t e s Vo l ume
I
SUMMARY
D Y NA C A L C i s a f i ne p r o g r a m , bu t a l t h o u g h i t
seem s t o have been w r i t t e n by a p r og rammer
f am i l i a r
w i th
OS-S ,
i t
does n ' t
m a ke
t he
f u 1 1 e s t u s e of
t he powe r o f O S - S .
I
101 i s h
D Y NA C A L C
c ou l d
use
al I
a va i l ab l e
memor y
i ns t ead of
j us t 64K ,
and I
w i s h p r i n t i ng
was
hand l ed
by
a
sepa r a t e
process
so
I
cou l d
start
a
copy
of
a
s he e t
pr i n t i ng ,
t hen con t i nue w o r k on t he o r i g i na l . E x t e nd ­
ed
memo r y
p robab l y
co u l d
have
been
u sed
u n d er Leve l Two w i t ho u t deg rad i ng t he p r o ­
g r a m u n d e r L ev e l O ne , a nd mu l t i p l e p roc e s s ­
e s a re s uppo r t e d b y bo t h l eve l s o f O S - S .
I f i nd mys e l f expec t i ng a g r e a t dea l of
D YNACALC .
My c a r p i ng a t
i t s t e r m i na l
sup­
port
( wh i Ch
is
in
many
ways
unusua l l y
good ) ,
and
pu s h i ng
for
s u ppo r t
of
f a ncy
OS-S
feat ures
is a
r e f l e c t i o n of my v e r y
h i gh op i n i on of t he p r o g r a m .
1 k now peop l e who f i nd i t r e a s onab l e t o
buy a
p e r s o na l
comp u t e r
j us t
t o have
an
e l ec t r on , c
spread
shee t .
DYNACALC
is
an
exce l l e n t s p reao s he e t p r o g r a m . I t c a n he l p
w i t h a n y numbe r of b u s i n e s s p r ob l ems ,
S i m­
ple
p r o b l ems
in
t he
sc i ences ,
and
j us t
p l a i n Show i ng o f f t he compu t e r t o t h e u n i n ­
i t i a ted .
I
t h i nk
D YNACA L C
is
a
prog ram
w h i c h s hou l d be i nc l u d ed i n t he t oo l k i t o f
mos t
0 5 - 9 u s e r s . O ne w a r n i ng , spreads h ee t
p r ograms
t e nd
t o be pop u l a r .
I
a m af ra i d
t ha t I w i 1 1 ha ve t o lola i t f o r a c r ac k a t m y
m a ch i ne mor e of t e n now t ha t I have D YN A C A L C
on i t .
REV I EW OF DYNAM I TE
code
can .
b l er .
D ynam i t e
is
a
d i s a s semb l e r
f or
t he
6 8 09 / 6 8 00 so 1 d by compu t e r Sys t ems C e n t e r .
I t e s t ed r u n s unde r 0 5 - 9 .
bu t
T he v e r s i on
t he r e a r e o t her ve r s i ons f o r F L E X a nd Un i ­
FLEX .
D i s a s s emb l e r s a re ab l e t o c onve r t a
f i le
of
e xe c u t ab l e
ob j ec t
( ma c h i ne )
code
i n t o a p r o g r a m i n a s s emb l y l a nguage .
It is
i mpor t a n t
to
rea l i ze
that
Dynam i t e
wo n ' t
w o r k o n i n t e r med i a t e code . s u c h as B a s i c09
packed f i 1 e s .
and
i t won ' t a 1 ways c o n v e r t
f i l es
i nto
t he
o r i g i na l
l a nguage .
obj e c t
Dynam i t e c a n conve r t
an execu t ab l e ob j ec t
modu l e
g e ne r a t ed
by
any
l a nguage
i nto
a s s emb l y l a nguage .
E ven i f t he p r og r a m w a s
w r i t t en
in
a
h i gher
l ev e l
l a ngu age
l i ke
Pasca l
or
C .
D y nam i t e
wi l l
on l y
p r oduce
a s s e mb l e r .
I f you have r e l i ab l e s o f t w a r e a n d don ' t
l i k e t o d i g a r ound i n your s ys t em m u c h . you
have
no
need
for
Dynam i t e .
D on ' t
was te
y o u r money .
I f y o u wou l d l i ke t o f i x ( mo d ­
i f y ) you r s o f t w a r e . o r j u s t w a n t t o un de r ­
s t a nd
i t a s o n l y someone w i t h t he s o u rce
T ab l e
X
$
l
&
@
�
Dynam i t e ,
va l u a b l e .
or
1
some
2:
Dynam i t e
o t he r
have
many pages of code by ha nd .
w o r k qua l i f y m e t o s a y t h a t
j u s t t he t ype o f wor k wh i ch
t o compu t e r s .
OVERV I EW
o
L
1S
d i s a s se m ­
d i s a s s emb l ed
Those hou r s o f
d i s a s semb l y i s
s hou l d be l ef t
SOME DETA I LS
Dynam i t e c a n be u s ed t o get a qu i c k l ook a t
s o u r c e t ha t cou l d ha v e ge ne r a t ed a n ob j e c t
f i le.
T he command :
DYNAMITE f i l ename a
wi l l
d i s a s semb l e
t he
modu l e
in
t he
file
ca l l ed f i l ename and s en d i t s o u t pu t . wh i c h
l oo k s l i k e t he t he ou t p u t of an a s semb l e r .
to
t he
t e r m i na l .
The
"a"
o p t i on
te l l s
D y n am i t e
t o g i ve
t he a s c i i
equ i va l e nt
of
ea c h p r i n t ab l e cha r ac t e r i t encou n t e r s du r ­
i ng t he d i s a s semb l y .
T h i s s i mp l e d i s a s sem­
b l y i s enough i n many c a s e s .
I f t he modu l e
i s m o r e comp l i ca t e d t h a n i s e a s y t o u nde r ­
s t a n d w i t ho u t mean i ngf u l
l abe l s .
t he nex t
s t ep i s t o he l p Dynam i t e do a be t t e r j ob o f
decod i ng
t he
modu l e
un t i l
i ts
output
1s
u n de r s t andal:> l e .
L a be l
C l a s s es
Di rect r e f e r enc e s
FeR ref erences
Ext ended references
Hex c ons t ant
Dec imal cons t ant
Dec imal or Hex cons t ant depending on magni tude
ASC I I cons t ant
Sys t em func t i on name
-------
T ab l e
3:
D ynam i t e A ddre s s i ng Modes
one byt e immediate (any regi s ter)
#1
#0 - Immed � a t e wi th Accumu l a t or 0
#X , #Y , #U , #S Imm e d i a t e wi th other reg i s t ers
X , Y , U 1 S - Indexed by X , Y , U , o r SF
o
Duect page
E
E t end e d address ing
R Relat ive
-
-
x
D ynam i t e
doe s n ' t
d i s t i ngu i s h
b et ween
da t a a nd
i n s t r u c t i on s wh i l e d i sas semb l i ng .
T h i s r e su l t s i n some very s t r a ng e o u t p u t a s
b l o c k s of c o n s t a n t s a r e d i s a s semb l ed .
E ven
t he name of t he program po i n ted to i n t he
mOdu l e hea d e r i s decoded i nt o as semb l y l an ­
guage
i n s t r uct i on s .
The
"a"
op t i o n makes
i t e a s y to f i nd t he d a t a a reas . a n d D yn a ­
m i te
can
be
to l d
where
they
a re
e i t her
t h rough i t s s ta ndard i npu t or i n 1 t s com­
mand f i 1 e .
Once Dynam i t e k nows where the
da t a a rea s a r e .
i t w i l l s t op d i s a s semb l i ng
t hem
as
i n s t ru c t i ons .
I ns t ea d .
it
wi l l
l a be l
t he e n t r i e s
i n t he d a t a
a r ea ,
a nd
cons t a n t s
t hem
i nto
d i s a s semb l e
( f cb . f c c . . . . ) .
When Dynam i t e i s run w i t ho u t a n y gu i ­
dance .
it
i nven t s names f o r e v e r y t h i ng
it
encou n t e r s t ha t m i ght have had a name
in
t he o r i g i na 1
program .
Addre s se s .
off set s .
a nd
i mmed i a t e
da t a
al l
are
g i ven
names .
Names
for
i mmed i a t e d a t a
and
o f f set s a r e
usefu l .
Names f o r of f se t s
i n p e R i ns t r u c ­
t i on s
a re
VERY
u s ef u l
beca u s e .
a l t hough
d i f f erent
refe rences
to
a
l oc a t i on
wi l l
have
d i f f erent
PCR
of f se t s ,
D ynam i t e
r e s o l ves t hem t o t he s a me name .
An a s semb l y l an gu a ge p ro g r am more t ha n
about a page l ong i s ha r d t o r ead u n l e s s i t
ha s mean i ngf u l name s .
D y n am i t e g i ve s names
t ha t
cons i s t
of
a
l e t ter
a nd
a
numbe r .
More mean i ngf u l
names c a n be a s s i gned b y
u s i ng a l abe l f i l e .
Dyna m i te can u s e t w o c l a s ses of f i 1 e s
w i th
l abe l
d&f i n i t i o n s
in
t he
form
of
equa t e s .
It
a l wa y s u s e s
a
" sy s t em name "
f i l e wh i c h c ont a 1 n s t he names used f o r e a c h
059 c a l l .
When t he i ns t r u c t i on :
OS9 I$Open
Rev i e w
of
Dynam i t e
137
is
deceaed
t he
" I $Ope n "
name
f i 1e .
T he
tem
l a be l
d e f i n i t i o ns
come s
f ro m
second
is
the
the
fiIe
" l abe l
sys­
opt i on
of
modu l e
fu 1 1
file. "
l a oe l
fi le's
name
has
to Oe g i ve n
Dynam i te
command
1 i ne .
Each
1 i ne
l a b e l f i l e i s o f t he f o r m :
The
in
in
of
I
use
i ng
"L"
a nd
l abe l
T he s e
is
t he
l ab e l ,
t he
c l asses
c l asses
d i s a s s e mb l y ,
$24
c l as s .
is
t he
I ni t ial ly
ters
A
. Z
can
oe
!
when
f ou n d
e i ght
comma n d s
Ta b l e 2 .
a s i mp l e
m ys e l f
d e f i n i ng
used
new
c l a ss e s .
d i s a ss e mb l e
as
modu l es
For
f r om
05 - 9 .
I
u s ua l l y have to def i ne l abe l s f o r
o f f se t s
i n t h e S y s t e m D i re c t P a g e . a nd t he
p roces s d e s c r i p t o r .
F o r t he S y s t em D i rec t
P a ge t he D c l ass i s f i n e , b u t f o r t he p r o ­
cess
de s c r i p t o r
I
have
t l:1
d e f i ne
a
new
c l ass .
I u s ua l l y use P .
Dynam i t e
l abe l s
of
wi l l
use
whe rever
unl ess
it
is
another c l as s
b l e r needs t o
i ts
t ne y
d e f au l t
a re
c l asses
a pp ropr i a t e
g i ven
i ns t ruct i o n s
to
u se
of
l abel .
A g o o d d i s a s se m ­
b e ab l e t o a s s i gn
l a be l s t o
va l ues
very
spec i f i ca l l y .
A l t houg h
8
is
t he
off set o f
t he
P $U s e r
in
t he
p ro c e s s
d es c r i p t or c on t r o l
b l oC k .
i t wo u l d n ' t gen­
e r a l l y b e a good i de a to a S s i gn t he name
� $ U se r t o t ne v a l ue 8 t h r ou g h o u t a p r og r a m .
- !!om i t e g i ve s
you
t wo w a y s
to
l 1mit
t he
. ope
i n w h i C h a l abe l
i s used .
A c l as s o f
abe l
i s
a c t i va t ed
by
a
command
of
t he
f o rm :
modes are
is a
l ab e l
l i s t ed
in
def a u l t c l as s ,
or
fi le.
T he o f f se t
3.
i ab 1 e
be
used
to
T he
the
g e ne r a t e
ule
d i s a s s emb l y .
of
offsets
b e i ng
T he
f ro m
the
d i s a SSemb l ed
p i ng g i v e n by
t hen
Tn i s
i n s t ru c t i o ns
C ommands
can
come
r a nge
wh i ch
pat i b l e
ca l
can
be
s tandard
a ss e mb l e r
t he
i t se l f )
c hew
I
away
have
at
i t
the
reduced
f r om
s uc h
a
a s s emO l ed
g i ve
a
or
with
any
modu l e
s ame
I
j ust
def i ne
1 abe 1 s .
l aw s
t r i c ky
set
up
D y n am i t e ' S
T he n
the
I
go
p o l i s h i ng
do w i t h
and h a s
has
to
be
and
mo r a l
ob l i ga t i o n s
p a s s i ng
a pp l y to
ou t
t he
work .
t o be
but
it
is
Sk i pped
adve r t i s i ng
1 it­
t ha t
comp l e t e .
t n r ou g h !
m i ght
l ea d
a
d i s a s s e m b l i ng a modu l e i s
ha r d .
Y ou h a v e
t o f i gu r e o u t a l l t he t r i ck s t he p e r s o n w h o
wrote
t h e p r og r am u s e d .
Th i s
i s no t
toe
h a r d t o d o f o r a s ho r t , s i mp l e p r ogram , b u t
l ong
modu l es
are
much
harder
to
t a ng l ed
d i s a ss e mb l e
It
t ha n
s ou rc e
to
s ou r ce
f r om
f i rst
few
p e r s on t o be l i eve t h a t d i s a s s emb l i ng a m o d ­
u l e w i t h D y nam i t e i s easy .
Y ou r u n Dyna ­
m i t e a g a i ns t a f i l e a n d i t f a l l s a pa r t i nt o
nea t
code .
Thi s
is
not
t r ue
at
al l . . .
s t a nd a r d
or
t ne
i s not
hard
s t a r t ed ,
a
t o u s e Dynam i t e .
T he manua l
is a
br i e f f o r t he manua l
of a p r og ra m
map ­
e f f ec t .
At
and
D e t e r m i ned not t o be unf a i r . ! s a � down a n d
r e a d t he manua l
f r om
start
t o f i n i sh .
I
w on ' t s a y i t w a s e a s y r e a d i ng , but once I
·
h a d chewed my w a y t h rough i t
I
unde r s t o o d
the
in
f i l es .
U S i ng
thi S
l abe l s a n d
When I f i r s t t r i ed t o u s e Dynam i t e , I h a d a
t e r r i b l e t i me .
1 O l amed t he documen1 a t i on .
w h i Ch
1s
al l
i ts
d e f au l t s .
start
bu i l d i ng
t he
L I M I TAT I ON S
m e n t ed
unde r s t a n d
i s
i n
f r ont
seems
a
d 1 S a s s emO l e r
commen t s
in
a
t hey
form .
are
a nd
even
of
to
read
s ome
in
com ­
modu 1 es
when
t he
are
o r i g i na 1
you .
1 ittle
s i l l y
to
d e s i gn
a
w i th
t ne
ab i l i t y
to
i ns e r t
i ts
output .
but
Dynam i t e
i s
comp l e t e
product
t ha t
I
am
a
l ittle
d i s appo i n t ed
t ha t
t he r e
is
no
way
to
" c omment f i l e "
i n t he
i npu t f o r
i nc l ude a
Dynam i t e .
I u n de r s t a nd t h a t Compu te r S y s ­
t ems C e n t e r i s wor k i ng on t h i s s ho r t com i ng .
t he
com­
i de n t i ­
t o t he o r i g i na l .
0 5 - 9 ver s i on of Dynam i te expe c t s t o
d i s a s semb l e
6809
i ns t ru c t i on s
f r om a f i l e
w i t h modu l e s i n 0 5 - 9 f or ma t ,
but
there
is
a n o p t l on W h i c h c a u s e s
i t t o d i s a s semb l e a
f i le
i nt o
6800
l ns t r u c t i on s
a nd
a no t h e r
T he
138
of
unt i l
that
s ho u l d
p r e vent
you
f ro m
c o p i e s of t he o r l g i �a l p r o g r a m
d i s a s s e mb l e d p r o g r am .
mod­
a s semb l e r ,
to
t he
i ns t e a d
P l e a s e re a l 1 Ze t ha t i f you d i s a s semb l e
p r op r l e t a ry
sof tware
( S UCh
as
Dynam i t e
such
M i cr oware
sort
n o comme n t s .
T he f i na l
d o n e w i t h a n ed i t o r .
t he
e i t he r
is
g i ve s
I f t he r e a s o n f o r d l s a s semb l i ng a mod ­
ule
i s t o l earn how
i t w o rk s ,
t he 1 i s t i ng
gene r a t ed by Dynam i te s h ou l d be enough .
If
t he g o a l i s t o r ev i se t he or i g i na l p r o g ra m .
D y n am i te c a n gener a te a f i l e w h i C h cont a i n s
source
f i nd
in i t .
T h i s f i l e i s t he b e s t I c a n
Dynam i t e
I t i s n ' t we l l f o rma t t ed ,
of
start
over
t h i s command
i np u t a f t e r Dynam i t e
command f i l e .
to
f o rma t
u n t i l t he l i s t i ng s a t i s f i e s me .
T he n I a s k
Dy n a m i t e t o gene r a t e a f i l e w i t h t he s o u r c e
c l as s
one d e f i ne d
i n t he
i s a dd e d to a va l u e
l da IICR +$80
1n
expect
F L E >:
t h r ou g h
a
c yc l e
of
runn i n g Dynam i t e
t hen
u s i ng t he o u t p u t t o r e f i ne a nd extend t h e
cont e n t s
of
t he commands end
l aoe l s f i l e s
It
. e:
r a n ge
to
p r og ra m
a r eas
does
b e f o re t he p ro p e r l a O e l
i s l oo ked up ,
"e l u ded
i n t h e d l s a s se mb 1 y l i s t i ng .
ld
da t a
how
tle
<mode> < c l as s > [< o f fs e t >]
< range>
T he
a
u s i ng
l i s t i ng ,
c l a s se s v e r y s o o n .
A c lass
is
a dd i t i o na l
d e f i ne d oy p u t t i n g some l aO e l s i n t he l abe l
A l l t he u n u s e d l e t ­
f i I e w i t h that c l a s s .
examp l e .
Dynam i t e
of
va l u e
see
for
are
d e f i ne d :
a re s u f f i c i e n t
but
to
or
t o an u nd e r s t andab l e l i s t i ng .
F i rs� I
l et
Dynam i t e h a v e i t s head . and p r oduce a l i s t ­
Ini t EQU $24 L
i s
i t
0 5 - 9 f o rma t .
t h e u s ua l
edges
Init
tel l s
Motoro l a
OPERAT I ON
e x a mp l e :
Whe r e
in
the
the
l abe l EQU va l u e c l a s s
for
wh i c h
05 - 9 U s e r No t e s Vo l ume I
SUMMAR Y
1
am
abou t
very
as
i mp re s s e d
good
d i s a s s emb l e
examp l e ,
fal l s
in
if
t he
a
a
j ob
W i t h D y n am i t e .
of
modu l e
he l p i ng
as
Dynam i t e
m i dd l e
it
f i nd s
of
an
a
It
does
p e r s on
can
do .
t ha t
a
to
For
l a be l
i ns t ru c t i on ,
i t
in
t hrows
l ab e l
Thi s
ORG
an
fal l s
at
to
t he
adj u s t
start
t he
of
an
PC
so
t he
i ns t ru c t i on .
data
a r ea s
f r om
t n row i ng
t he
d i s a s semb l y o u t of W h a c k ; usu a l l y i f t he r e
i 5
a d a t a a r ea
in
a p ro g r a m .
there
is a
r e f e r ence
to
t he
f i rst
i ns t r u c t i o n
a f ter
t he da t a a r ea w h i c h Dynam i t e c a n u s e t o g e t
i ts e l f
l i ned
up
aga i n
if
it
ha s n ' t
bee n
tol d
k eeps
t h at
got t e n
t ry i ng
t he
i t se l f
to
t u r n da t a
Dyna m i t e
severa l
The
is
area
is
i nt o
a nd
t he
axl e
be
to
can
T he
of
be
u s ef u l
by
for
d i s a s s emb l y .
done
mo s t
l i s t i ng
power
can
way
in
and
s u pp l i ed
be
Dynam i te
a
j us t
f l ex i b i I
can
f ew
i ty
i nt e r a c t i ve l y .
p r O d u ce
m i nu t e s .
of
t he
a
program
up
when
a
h i gher
qu a l i t y
l i s t i ng
goa l .
D y nam i t e l e ndS i t s e l f to t he
of
s u c c e s s i ve
c l ea r
ref i nemen t s
u sab l e
The
t ha t
ful l
shows
is
t he
p r ocess
I eads
to
a
d i s a s s emb l y .
ha s
i ns t r u c t i o n s .
t ypes
d i sa ss emb l y
any
f i l es .
t he r e
a r o und
des i gned
d i f f erent
qu i ck
bu i l d i ng
da t a
w r apped
i nf orma t i on
U s ed t h i s
W i t ho u t
05-9
don ' t
recommend
Dy nam i t e
f or
every
I n f ac t ,
I
i ma g i ne
t here
n o ":
many 0 5 - 9 u s e r s who ha v e a need
th15
t y pe
of
sof tware ,
but f o r t hose
need
it
user .
a
d i s a s s e mb l e r ,
s hou l d
D y nam i t e
is
are
for
who
eve r y t h i ng
be .
i mpO r t an t
Rev i e w o f Dy nam i t e
139
1 4-0
OS - 9 U s e r N o t e s Vo l ume
I
A REV I EW OF RMS
RMS ( Record Management S y s t em ) i s a p r i m i ­
t I ve . but u s e f u l
t o o l f or o r g a n i z i ng a nd
p r oce s s i ng d a t a .
I t i s n ' t a d a tabase s y s ­
tem , o r e v e n a p o I i shed record ma nagement
system,
but ,
neve r t he l e s s ,
I
r a t he r l i k e
it.
OVERV I EW
RMS s t o r e s da t a U S i ng at l ea s t t wo f i l es .
The
r m s f i l e conta i ns d a t a .
I t m u s t be
f orma t t ed i n advance u s i ng t he RMSNEW u t i l ­
T he _d i c f i I e con t a i n s a d e s c r i pt i on
i ty .
of t he da t a I n t he
rms f i l e .
T he
dic
f i l e m u s t be c r e a t ed w i th a t e x t e di t o r
be f o r e a n y da t a c a n b e p l aced i n t he _rms
file.
A
t h i r d f i I e t ype
n d )( ( i nd e x ) i s
u s e d when a _rms f i I e must be s o r t e d on
some key o t he r than t he one d e S i gna t ed i n
the d i c t i on a ry f i l e .
Many
ndx f i l es can
be g e ne r a t ed , one for each or d e r i ng o f t he
fi le.
I ndex f i l es can be c r e a te d ' w i t h t he
I ND E X u t j 1 I t y ,
or a n y o t he r p rogram t ha t
genera t es a f i l e w i t h a key va l ue o n each
1 i ne .
RMS has t o k n o w many t h i ng s about your
t e rm i na l be f o r e i t can be u s e d .
A
f i le
ca l l e d rms - t rm mus t be bu i l d w i t h a t e )( t
e d i t o r and p l aced i n t he root d i rec t o r y of
/00 ,
o r t he d i r e c t o r y wh l cn w i l l be t he
i s run .
defau l t da t a d i r e c t or y when RMS
The r m s t rm f i l e must con t a i n t he hexadec i ­
ma l
re present a t i on s of 8 8 b y t e s of d a t a
i nC l ud I ng 3 1
t e rm i na l cha rac t e r i s t i cs a nd
command code s .
SOME DETA I LS
RMS saves i nf or ma t i o n i n record g roups c on ­
s i s t i ng o f o n e " pr i ma ry " record a n d any
number of
" seconda r y " r e c o r d s r e l a t ed to
t he p r i ma r y recor d .
T he seconda ry records
aren ' t
re�u i r e d ,
but
t he y a re
i mp o r t a n t
when a va r i ab l e amou n t of i nf o rma t l 0 n i s t o
be a s sOC I a t ed w i th each p r i ma r y r e co r d .
I u s e pr i mary and s econda r y r e c o r d s i n
t he database of P ra i r i e Home Compan i on ( a n
exce l l en t program on Pub l i c Rad i o eaCh S a t ­
u rday
even l ng )
p r og ra1'As
I
keep .
Some
i nf o r ma t i on abo u t
each week ' s
s ho w f i t s
n i ce l y i n the pr i ma ry record : a d a t e , and a
comme n t to a c t as a t i t l e f o r t ha t week ' s
s hOw .
I ma i nt a i n s econd a r y records t o save
t he names of t he gues t s , n o t e s o n each mon01 og , and notes on each " adver t i s eme nt . "
u s e t he s econdary recor d s because a 1 t hough
I cou l d p robab l y pu t a ce i l i ng on t he num­
ber of Que s t s , mono l og s a nd adds that m i ght
occu r i n a p rogr am , t he ce i l i ng s wou l d have
t o be much h i gher t han t he usua l numbe r s .
RMS a s s umes that a l l f i e l d s w i l l have d a t a
i n t hem when
i t a l l oca t e s
space
for
a
r ec or d ;
so
l eav i ng
space
f o r da t a
that
i s n ' t u s u a 1 1 y needed wou 1 d w a s t e l o t s o f
f i l e space .
S i nce I o n l y u s e a s m a n y s e c ­
onda r y records a s I need , t h e y u s e s pace
compa r a t i ve l y e f f i C i en t l y .
T he
d i ct i onary
file
a s soc i a t ed
w i th
each RMS f i l e def i ne s t he s t ru c t u r e of t he
d a t a i n t he f 1 1 e and t he way t he r eco r d s
a re d i sp l ayed on t he s c re e n .
I f s econda r y
r e c o r d s a r e u s ed , t he d i c t i onary f i l e c o n ­
t a i ns t he f orma t s f or p r i ma r y and s econda r y
records .
T he f i rs t 1 i ne i n t h e d i c t i ona r y f i l e
c o n t a i ns t he t i t l e f o r t he p r i mary r e co r d s .
T h i s t i t l e 1 s d i sp l a yed on t he s c r e e n when
t he R M S e d i t o r i s be i ng used t o ed i t a p r i ­
ma r y
record .
L i ne s f o l l ow i ng
t he
title
1 i ne
a re used t o def i ne
f i e l ds
in
t he
r e co r d ,
one f i e l d per
l i ne .
The
f i rs t
f i e l d i s t he " key " f o r t he record .
T he k e y
c a n be u s e d t o s e l e c t records f o r e d i t i ng
v e r y qU i ck l y .
T h e l i ne def I n i ng a f i e l d
c o n t a i ns t he name o f t he f i e l d , t he l e ng t h
o f t he f i e l d , t he t yp e o f da t a t o be s t o r e d
in
it
( a l phanume r i c ,
numer l C .
money ,
or
d a t e ) , t he promp t t o u s e i n t he ed i t o r . a n d
T he f i e l d
v a r i ou s d a t a va l i da -t i on opt i on s .
can be made opt i o na l , a m I n i mum l e ng t h c a n
be spec i f i ed , a nd a range or l i s t o f accep­
t a b l e va l u e s can be g i ve n .
T he d i ct i on a r y f i l e I USe f o r my P ra i ­
r i e Home Compan i on f i l e demon s t ra t e s some
of the f ea t u res of RMS .
I i nc l ude i t he re
as an examp l e .
1
C o m p a n i o n"
H o m e
"p r a i r i e
"Da t e a i r e d : " ;
8
D
DATE
II
A*
C omm e n t s : " ;
COMME N T l
50
u
u
A*
50
COMMENT2
.
"
i
" Sp, e c i a l N o t e s :
15
A,
POINTl
tt
,
•
15
P O I N T2
A*
•
$
"D e t a i 1 s "
D
8
DATE
A
1
TYPE
50
SUB JECT
A'�
A*
S UB J EC T2
40
A*
SUBJECT)
40
$
F i gu r e 8 :
"Da t e a i r ed : " ;
" Type (Spon s o r ,
"S ubJi e c t : "
It
U
U
It
•
'
•
t
P owderm i l k , Mon o l og ,
Gue s t ,
Other) : "
[
S,p
M , O , G]
t
Samp l e R M S Def i n i t i on
L ___�__________________________________________________________________ J
The on l y f i e l d s on wh i c h I u s ed va l i da ­
t i on a r e t he d a t e f i e l ds . wh i ch R M S va l i ­
dates
f o r poss i b l e d a t e s ,
a nd
t he T Y P E
f i e 1 d , wh i c h I on l y p e rm i t t o t a k e o n e o f
f i ve va l ues .
R M S f or ma t s t he da t a o n the
s c re e n
u s i ng
a
few
S i mp l e
ru l es
The
f i e l ds a r e p l aced i n o r de r S t a r t l ng i n t he
upper l e f t co rner a nd wor k i ng l ef t - t o - r i gh t
a n d t op - t o - bot t om .
R M S won ' t s p l i t a f i e l d
and i t s p rompt b e t ween t wo l i nes .
It is
pOS S i b l e t o have some e f f ec t on t he s c r e e n
A Rev i ew of RMS
141
f o rmat by a d d i ng l ead i ng b l a n k s to p rompt s ,
bu t not muc h .
T ry i ng t o do some t h i ng rad i ­
ca 1
1 i k e a d d a b l an k 1 1 ne
makes a
: e r r i b l e m e s s on t he s c re e n .
T he do l l a r s i gns
record de f i n i t i on .
ma r k
t he
end
of
each
T he l e ng t h s o f t he p r i ma r y and secon­
aary records a r e 1 38 by t e s and 1 39 byt e s .
I k e p t t he l e n g t h s abou t t he s a me because
R M S a l l oc a t e s on l y one s i z e o f rec ord .
It
mu s t 1 eave s pace f o r t he l a r g e s t pos s i b l e
reco r d ;
so ,
w hen t w o r ecord f o r ma t s a re
u s ed . t he d i f f e rence i n s i ze be t ween t he
t wo records i s wa s t ed f o r each s ma l l record
s tored in t he f i l e .
I u s e d a n i m por t a n t t r i c k on t he secon­
d a r y reco r d .
S i nc e RMS onl y unde r s t ands
t w o record f o rm a t s ,
I u s e d t he s econdary
f o rmat for f i ve d i f f e r e n t t y p e s o f record s .
T he T Y P E f i e l d i n a secondary record i nd i ­
c a t e s t he mean i ng o f t he i nf o r ma t i on i n t he
r e s t of t ha t r ecord .
The RMS ed i t o r
and upda t e r e c o r d s
a l so ab l e t o s e a rCh
seouent i a l l y . o r by
i s u s e d to add , d e l e t e ,
It is
i n a n RMS f i l e .
t h ro u gh t he f i l e e i t her
k ey .
The RMS repo r t w r i t e r .i s powe r f u l . b u t
not v e r s a t i l e .
I t t a k e s a s i npu t a n r m s
f i le.
a
report
s p ec i f i c a t i on
f ile.
a nd
so�e t i mes an i ndex f i l e .
The repor t speC i ­
f i c a t i o n f i l e i s some t h i ng l i k e a p r ogram
'q,e 1 anguage u s e d rem i n d s me o f RPG .
It
can
con t a i n
commands
wh i c h
se l e c t
or
e x c 1 u e e recor d s .
Any number of 1 i n e s c an
be p r i n t ed f o r
each record s e l ec t ed .
Spe­
c i a l I i ne s can be p r i n t ed at t he s t a r t of a
repo r t , at t h e end of a repor t . a t t he e nd
of a g r o u p of record s , a nd a t t he t o p of
"lach page .
Page b r e a k s happen when a page
i s f U l l . or ( op t i ona l l y ) a f t er each p r i ma ­
ry ,
or
s econda ry
record
is
proce s sed .
i ne r e are no a r i t r.me t i c commands
i n t he
r'e p o r t gene r a t o r , b u t va r i OUS a ccumu l a t o r s
are k ept : t he number of s e l e c t ed record s ,
t he numbe r of s e l e c t ed g roup s . t he numbe r
of se 1 e c t e d secondary r e cords . and t o t a 1 s
an d s u b t o t a l s f or e ac h numer i c f i e l d .
B y d e f au l t r epor t s a r e ge n e r a t ed w i t h
records s o r t e d i n asce n d i ng o r d e r on t he i r
key .
O t her o r de r s can be s pec i f i ed cy
u s i ng a n i ndex f i l e .
I ndex f i l e s c a n be gener a t ed by t he
, f .D E X u t i l i t y .
I ND E X prOduces a f i l e t ha t
If
conts i n s iii. 1 i s t o f r ec o r d key v a 1 ues .
records a r e s e l e c t ed f r om t he RMS f i 1 e i n
t he o r d e r spec i f i e d i n t he H'Idex f i 1 e t hey
w i 1 1 be i n t he o r der spe C i f i ed when I ND E X
w a s r u n to c r e a t e t he
i ndex f i l e .
F or
examp l e :
INDEX pbc P o i n t s P o i n t !
wou l d gene r a t e a n i ndex f i l e ca l l ed Po i n t s
w h i c h cou 1 d b e u s e d t o s o r t t he phC R M S
fi'e
In
a s cend i n g
orde r
on
t he
PO I N T 1
f ield.
I ndex f i l es can be ed i te d t o gener ­
a t e o r d e r i ng s t h a t are beyond I NDe X ' s ab i l ­
i t i es .
T he RMSCOPY u t i l i t y can be u sed t o copy
RMS f i l e s , but i t can a l so d o much mor e .
RMS C O P Y can be u s ed t o add f i e l ds to a
f i 1 e . remove f i e 1 ds , or merge s i m i l sr R M S
f i 1 es .
142
OS - 9 U s e r No t e s Vo l ume
I
FLAWS
Se t t I ng R M S up i s excep t i 01""1 8 l l y d i f f i c u l t .
It
t ook me
hou r s t o g e t t he _ t rm f i l e
r i ght .
T he wo r s t pa r t of my prOb l em wa s
t ha t R M S d i dn ' t he l p me uncove r prob l ems .
i t j u s t w ou l dn ' t wo r k .
I have a t e r m i na l
w h i c h u s e s ANS I s t andard cont r o l sequences
wh i ch
some
programs
have
t roub l e
with.
O t he r peop l e 1TJ l gh t not have qu i t e a s h a r d a
t i me as I d i d .
T he docume n t a t i o n keep s r e f e r r i ng
to
f i l e name s
W I t h dots
i n t h em ,
but
RMS
a l w a y s u se s u nd e r s c or es .
I ca l l ed t he p r o ­
gram ' s a u t ho r t o a s k abou t t h i s .
I t s eems
t ha t when RMS was w r i t t en for O S - 9 do t s
weren ' t a l l owed i n f i l e names .
I a s s ume
t ha t t he r e i s a F L E X v e r s i on of RM5 w h i ch
uses dot s where t he manua l says t hey s hou l d
be .
S l nce 0 5 - 9 now perm i t s do t s i n f i l e
names , RMS c ou l d be adj u s te d t o f i t i t s
manua l . or t he docume n t co u l d be upda t e d t o
ref l ec t t he u s e o f unders c o re s .
T ha t ne i ­
t he r of t he s e t h i ng s has been done i nd i ­
c a t e s a ne g l i gent a t t i t u de t ha t i s d i s t u rb ­
i ng .
I t i s p r a c t i c a l l y i mp o s s i b l e t o f o rma t
t he sc reen a n y way o t h e r t ha n t he way RMS
wan t s i t .
T h i s wo u l d be eas i e r to t a k e i f
I l i ked t he way RMS f o r ma t s t he s creen .
I
p r e f e r to u s e up t he w ho l e s c r ee n , an d RMS
p acks t he f i e l d s a s c l ose t og e t h e r a s po s ­
sible.
RM5 ' s f i l e
s t r u c t u re
is
wastefu l
of
d i sk
s p a ce .
S I nc e
it
can ' t
h a nd l e
var i ab l e - l e n g t h f i e l ds or records , I t u se s
more s pace p e r record t han i s nece s s a r y i n
a l mo s t every c a s e .
I t a l s o has t o f o rma t
t he e n t i re f l l e be f o re any r ecords c a n be
p l aced I n i t .
I t wou l d be mor e cons i s t e n t
w i t h 0 5 - 9 conven t i on s t o s t a r t o f f w i t h a
s ma l l f i l e and en l a r g e i t as requ i re d .
I ndex f i l e s a r e n ' t a u t omat i c a l l y u p da t ­
ed .
T ha t means t ha t i f you generate a n
i ndex f i l e , t he n i ns e r t o r de l e t e records
i n t he
rms f i l e , t he i ndex f i l e i s out of
dat e a nd h a s t o be made ove r a ga i n .
It is
e a s y t o f o rge t t o make new i ndex f i l es . a nd
RMS does n ' t do an yt h i ng to make i t eas i er .
SUMMAR Y
I f i nd RMS u s e f u l . b u t f r u s t ra t i ng .
It is
not a da t abase program ;
'1 t does n ' t even
p r e t end t o be .
B e f o r e I cou i d d i s cover how
u se f u l RMS i s ! had t o g e t i t set u p a n d
g o t u s ed t o i t s l i m i t a t i on s .
T he s e w e r e s o
d i s courag i ng t ha t I a l mo s t gave up o n t he
p rogram .
I ' m g l ad I d i dn' t .
I u s e t he RMS
e d i t or
as
t oo l
f or
s e a rCh i ng
qu i Ck l y
t hr ough l a rge f i l es , and gene r a t i ng r epor t s
I w i s h RMS
o n t he con t e n t s o f t hose f i l es .
c ou l d dea l
w i t h mu l t i p l e keys ,
bu t ,
for
many a pp l i ca t i on s , o n e k e y i s p l en t y .
As a
repor t gener a t o r RMS i s qu i t e good . i nc l u d 1 ng a l l t he mos t common l y u sed f e a t u re s .
I t .... ou l d be be t te r i f t here was some w a y t o
do a r i t hme t i c . b u t I ' m s u r p r i se d h o lo/ we '1 1 I
can make do w i t h what ' s t he r e .
had heard t ha t RMS was i nc 1 i ned t o
c ra s h . b u t I have n ' t b e e n a b l e t o g e t i t t o
do any t h i ng unexpe c t e d except w h e n I m e s s e d
u p i t s _t rm f i l e , o r t r i ed t o g e t i t t o
f ormat t he s c reen i n a w a y con t r a ry t o I t s
nat u re .
RMS
In
a
fact ,
s l oppy
is
not
it's
sense
a
h i gh l y
pr i m i t i ve .
. . .
hewn . . .
1 i ke a
m a k e s me want t o
more
po l i S l1ed
Not
p r og r a m .
p r i m i t i ve
s i mp l e
and
in
rough­
we 1 1 bu i 1 d l og cab i n .
It
wr i te a rea l database p r o -
g ram
f or
OS-9 ,
but ,
s i nce
I
prObab l y
w on ' t
a r ound t o t ha t , I expect t ha t R � S w i l l
con t i nue t o get a
mode r a t e amou n t
of
use
ge t
a r ound
her e .
A Rev i e w o f RMS
143
144
05-9 U s e r Not e s Vo l ume
I
data .
RMA ( R e l oc a t i ng Mac ro A s s emb l er ) and R L I NK
( R e l o c a t i ng
L i nker )
are
new programs f r om
loll i c r o wa r e .
T hey are
requ i red
for
C
( a nd
p r obeb l y f o r f u t u r e
I a nguages f r om M i c r o ­
ware ) ,
a nd
a r e c u r r e n t l y bund l ed w i t h C .
T hose who a 1 r e a dy have t he C comp i 1 e r f r om
pu r c h a s i ng
s hou l d n ' t
conS i de r
M i c r owa r e
RMA/ R L I NK - - t hey a l r e a d y have t hem u nd e r
t he n a m e s c . a s m and c . 1 i nk .
SOME DETA I LS
R M A i nc l udes
s t a t emen t s :
t he
usua l
c o nd i t i o n a l
a s semb l y
FAI L
Gene r a t es
message .
an
a s semb l e r
error
a nd
a
] F /E L SE/ENDC
OVERV I EW
Do
j ust
what
opt i ona 1 .
It
is
eas i e r
to
exp l a i n
R L I NK ' s
purpose
t han RMA ' s .
R L I NK t a k e s one o r more f i l e s
c r e a t e d by RMA a n d t u � n s t hem i n t o an ex e ­
c u t a b l e modu l e .
RMA i s a t o o l wh i c h m a k e s
w r i t i ng l a r g e p r ograms e a s i e r w i t h a mod e r ­
a t e l y g o o d mac r o f ac i l i t y a nd a v a r i e t y o f
t oo l s w h i c h pe rm i t a p r o g r a m t o b e d i v i ded
i n to se v e r a l p i e ces wh i c h can be a s semb l e d
sepa ra t e l y .
This
sepa r a t e
a s s e mb l y
is
t he
rea l l y
i mpo r t a n t
part
of
RMA .
W i th
sepa r a t e
a s semb l y i t i s e a s y t o b u i l d a 1 i b r a r y o f
wh i c h
can
be
ca l l e d
f r om
any
p r ocedu r es
S t r u c t u r ed
p r og r amm i ng
requ i r es
program .
t ha t
e ach p r ocedu re be as
i ndependent
of
o t he r p r ocedu r e s
as p o s s i b l e .
It
i s much
e as i e r
to
do
thi s
when
each
modu l e
has
c l ea r
c o nnec t i o ns
t o o t he r modu l e s
in
pa r t i cu l a r , any s ha r ed d a t a s hou l d be no t ­
ed ;
RMA
make s
it
easy
to
i so l a t e
proce ­
dures ,
and makes
it
hard
t o h i de s h a red
r
t hey
S h ou l d .
E LSE
is
REPT/ENDR
r e pe a t s a s et o f s t a t emen t s
f i ed number of . t i mes .
a
spec i ­
These s t a t ement s can be u s e d i n t he body o f
a p r o g ra m , o r i n mac r o s .
M a c r o s amount t o
p r oced u r e s ,
or
spe c i a l l y def� ned
i ns t r u c ­
t i ons w h i c h c a n b e u s ed v e r y mu c h as
if
t hey were 6 8 09
i n s t r u c t i o ns .
A
macro
is
def i ned
by
t he
MA C R O / E NDM
s t a t eme n t s .
A
ma c r o
can
be
g i ve n
p a r a me t e r s
wh i ch
are
r e f e r r e d t o w i t h i n t he mac r o by a back s l a s h
f o l l owed b y a numbe r : \ 1 wou l d b e t he f i r s t
parame t e r . \ 2 t he second , e t c .
T he number
of
p a r a me t e r s
g i ven
is
ava i l ab l e
t h rough
t he spec i a l ope r a t o r \ N , a nd t he l e ng t h o f
a ny
p a r ame t e r
is
a va i l ab l e
t h r o u gh
the
ope r a t o r \ L n where n i s t he numbe r o f t he
a r gument whose l e ng t h i s i n qu es t i on .
Swap MACRO
ex changes b y t e s in memory
*
a r g l -- p o i n t s t o memory l oc a t i on
*
arg2 -- an o t h e r l oc a t i on
*
arg 3 -- the number o f byt e s t o s wap (a c ons t an t )
IFNE \#
3
check t he numbe r o f args .
FAIL Swap : mus t have exac t l y t h r e e argument s
ENDC
pshs A B .z. X , y
Mak e work s p a c e o n s t a c k
l eas - 1 , ::,
addr e s s o f f i r s t var i ab l e
l eax \ l , ll
addr e s s o f s ec ond var i ab l e
l eay \2 , ll
number o f byt e s t o s wap
l db 1/\3
i f none ; s t op
b l e \@Lx
I da B , X
\@Lp
sta ,5
I da B , Y
s t a B .z. X
I da , ::'
s ta B , Y
decb
bne \@Lp
c l ea r work s pa c e
\@Lx
l eas I , S
pu l s A , B , X , Y
ENDM
-
F i gu r e 9 :
Rill A M a c r o
Re v i e w of
RMA a n d RL I NK
145
When 8 mac r o needs un i que l abe I s . RMA
offers
t he
\�
ope r a t or .
This
ope r a t o r
r e t u rn s a n � f o l l owed b y a number u n l qu e t o
each i nvocat i on o f each macro .
A s a mp l e RMA macro c a n be f ou nd i n F i g ­
ure 9.
T h i s m a c r o c ou l d b e i nvoked w i t h
t ne s t a t eme n t :
Swap V a r l , V a r 2 , 2 0
w h : c h cou l d be u s ed a s meny t i mes as nece s ­
s a ry 1 n a p r ogram w i t h Swap def i ne a .
The
S e pa r a t e As s emb l y F ac i l i t y
RMA i nc l udes s t a te me n t s wh i c h
d i f f e r e n t " p r ogram s ec t i ons . "
d e f i ne
t hree
T he P S E C T s e c t i o n con t a i ns program code
cons t a n t s .
RMA can on l y dea l w i t h one
P S E C T pe r a s s e mb l y .
T he P S E CT s t a t em e n t
i nc ; u d e s 8 1 1
t he d a t a g i ve n
i n the MOD
s t a t em e n t i n A SM e xcept the modu l e l e ng t h .
b u t o n l y t he e n t r YPo i nt a rgument t o P S E C T
i s a n address .
T he pa r a me t e r s a r e :
and
•
NAME
up t o 20 b y t e name f o r t he P S E CT
•
T Y PE L ANG
t he t ype/ l ang u a g e f o r the P S E C T
A T T RR E V
t he a t t r i bu t e ( Re � n t
l e ve l of t he P S E C T
7)
and
to
•
of
t he
s t ack
for
ENTRY
T he Labe l u s e d for t he f i r s t i ns t ru c ­
t l on t o be execu t ed i n t h e P S E CT .
I f t h e P S E C T i s t he m a i n l i ne s e gment of t he
program be i ng w r i t t e n . a l l
t he a rgumen t s
m u s t have va l ue s : f or examp l e :
PSECT Examp l e , P r g rm+Obj c t ,
R eEn t + l , l , 25 0 , En t ryp t
P r ocedu res wh i c h a r e used a s subrout i ne s
mu s t have z e r o s i n some f i e l d s ; f o r e x a m ­
ple:
P SECT Sub P r o c , O , O , O , l OO , O
T he P S E C T s e c t i on c o n t a i ns o n l y c o n ­
s t ant da t a :
i ns t ru c t i on mnemon i CS .
059 ,
f c c . f db . f c s . f co . r Z b ( re s e r ve z e r o - v a l u e
b y t e s . V S E C T . E ND S E C T . end END .
I n part i c­
� l a r rmb i s not a l l owed i n a P S E C T .
T he V S E C T s e c t i on r e s e r ves memo r y l oca ­
t 1 0ns .
I t h a s t wo f orms :
V SECT DP
r e s e rves space i n the d i rec t page , and j u s t
146
05 - 9 U s e r N o t e s Vo l ume I
I f VS E CT i is u s ed i ns 1 de t he P S E C T . a s
i t u s ua l l y i s . i t w i l l cause the l i n k e r t o
13 1 l oc a t e space f or t he v a r i ab l e s i n i t .
If
a V S E CT i s p l aced o u t S i de t he P S E C T i t w i l l
mak e t he v a r i ab l es i n the V S E C T k nown i n
t he code ,
but not a l l oc a t e a n y s to r a ge .
T h i s i s a u s ef u l t r i Ck f o r c a s e s w h e n you
k n o w t ha t a b l ock of v a r i ab l es h a s a l ready
been a 1 1 ocated a nd you want a c c e s s to a I I
of t hem .
I haven ' t t r i ed t h 1 S . a n d I c a n ' t
f i nd
it
ir
t he
manua l ,
but
M i c r ow a r e
dec l a re s i t w i l l work .
E ve r y program s e c t o r mu s t be t e r m i n a t ed
w i t h an ENO S E C T
A P S E Ci can con t a i n o t he r
sec t o r s , but i n genera l s e c t o r s Shou l d not
be n e s ted .
ST ACKS I ZE
T he e s t i ma t ed s i ze
t h i s p r ocedu re .
A S many V S E C T s a s conven i e nt can a pp e a r
i n a P S E CT .
t he
rev i s i o n
be u s e d f o r
r e s e r v e s space ou t s i de
t he d i r e c t
page .
T h e V S E C T s a r e u se d f o r t he v a r i ab l es t ha t
wou l d norma l l y b e addre s s e d o f f t he U r eg ­
Norma 1 1 y o n l y
i st e r i n an O S - 9 program
t h e rmb i ns t ruc t i on i s u s e d i n a V S � C T . b u t
f o r e l abo r a t e programs i t i s p o s s i b l e t o
h a v e va r i ab l e s a u t omat 1 ca l l y i n i t i a l l i z e d .
I f you a r e w i l l i ng to i nc l ude t he i n i t i a l ­
l i za t i on
code
in
your
program
(it
is
i nc l uded w i t h RMA ) you c a n u s e f cc . f db .
f c s . f cb . a nd rzb i n a V S E C T a l ong w i t h
rmb .
It
is
i mpo r ta n t t ha t
t he re
i s no
of f i c i a l way to k now w he r e v a r i ab l e s a l l o ­
c a t e d i n a V S E C T w i l l be re l a t i ve t o o t h e r
va r i ab l e s .
Y o u r p rogram w i 1 I be a b l e t o
f i nd i t s va r i ab l es . but f i nd i ng re l a t i on ­
s h i p s be t ween t he addr e s s e s of v a r i ab l e s a t
a s semb l y t 1 me i s ha r d .
A C S E C T i s j us t a way to a s s i gn va l u e s
t o names .
T he y a r e used e x tens i ve l y i n t he
D E F S f i l es f o r RMA .
O n l y t he rmb s t a t ement
can be used i n a C S E C T .
If
t he C S EC T
s t a t ement i s g i ven a n ar gume nt . t ha t a r gu ­
ment i s t he s t a r t i ng va l ue i n t he CSE C T .
o t herw i s e the va l ues i n t he C S E CT s t a r t a t
zero .
E D I T I ON
t he ed i t i o n numbe r
execu t a b l e modu l e .
V SECT
A l abe l c a n be mace g l oba l l y ava i l ab l e
b y f o l l ow i ng i t w 1 t h a co i on " : " when i t i s
it is
d e f i ned .
I f a I a b e I i s n ' t 9 I oba 1 .
on l y
k nown
in
t he
PSECT
whe r e
it
is
def i ne d .
I f a l abe l i sn ' t g l oba l . i t c a n
be u se d t o represent a d i f f e re n t t h i ng i n
each , sepa ra t e l y a s semb l ed . f i l e .
Speak i ng o f l abe l s : R M A perm i t s l abe l s
u p t o n i ne Cha ract e r s l on g and a l ways d i s ­
t i ng u i s he s upper ano l ower case l e t t e r s
T h e f i 1 e s t ha t a r e prOduced b y RMA .
c a l i ed r e l oca t ab l e f i l e s . can be decoded b y
a p r o g r a m ca 1 l ed ROUMP w h i c h i s i nc I u de d
w i t h RMA . ROUMP c a n g i ve anyt h i ng f rom a
q u i ck
summa r y
to
an exhau s t i ve dump o f
i nf o rma t i on about
symbo l s r e f e r e nced and
def i ned i n t he f i l e be i ng i nv es t i ga t e d .
SOME
1 NTERNALS
S i nce RMA has no way of t e l I 1 ng wha t o f f ­
s e t s R L I NK w i l l a S S i gn t o var l ab l e s d e f i ned
i n V S E C T S . i t i s o f ten unab l e to use t he
s ma l l - o f f se t f orms of t he i ndexed i ns t r u c ­
t i on s .
R e f e rences t o d a t a i n V S E C T S a r e
a s semb l ed a s 1 6 b i t of f se t s .
RMA records
and
d e f i ned
v a r i ab l e s
abou t
i n f o r mat i o n
used
in a
PSECT
wh i ch
i s u s e d by R L l NK ,
R U NK goes t h rough t he f i l e s i t i s l i n k I ng
f i I l i ng i n t he b l a n k s l ef t by RMA ,
R U N K a c c ep t s a l i s t o f f i l es to l i nk
and l i b r ar i e s to u s e ,
I t w i l l l i nk a l l the
f i l es o n t he command l i ne even i f t he m a i n ­
PSECT
doesn ' t
r e f e rence
a n yt h i ng
in
l i ne
t hem ,
If
t he re
are
any
r e f e rences
l ef t
the
u n r e s o l v ed ,
R L I NK
wi l l
s ea r c h
I i b r a r y ( s ) f o r t he P S E C T s needed t o r e s o l ve
t he
refe rences ,
A
I i br a r y
i s
S i mp l y
a
t he
g roup of P S E C T s m e rged t o g e t h e r :
command
does
thi s
n i ce l y ,
PS ECTS
� E R GE
in
C o nve r t i ng
a s s emb l e r
to
p r o g rams
RMA
is
not
f r om
t he
as
s i mp l e
s t a ndard
as
one
m i gh t
t h i nk .
To
s tart
w i th
t he s t a n dard
D E F S f i l es w o n ' t w or k . a n d M i c r o w a r e d i dn ' t
i nc l ude comp l e t e D E F S f i l e s w i t h RMA ,
I
f re Qu e n t l y u s e " , "
t ha t had t o be dea l t
w i th.
RMA c a n ' t h a nd l e a s many symbo l s a s
t he
s t andard
a s semb l e r
b e f o re
t he
s ymbo l
t ab l e
ove r f l ow s ,
ThiS
mea n t
that
1
c ou l dn ' t j u s t conv e r t a p r o g r am i n t o R M A , I
had
to u s e RMA .
A I a rg e p r o g r a m MUST be
b r o k e n down i n t o s e v e r a I P S E CT s and a s s e m ­
b l ed
i n p i ec e s t hen
l i nk e d .
a
l i brary can c a l l
one a n o t he r ,
but .
s i nce
t he
l i brary
is
read
sequen t i a l l y ,
unre­
s o l ved r e f e r e n c e s m u s t be t o P S E CT f u r t he r
a l ong
in
t he f i l e ,
or
i n ano t he r
l i br a r y
w h i c h w i l l b e s e a rched l a t e r ,
L I M I TAT I ONS
haven ' t been a b l e t o d i s c o v e r a l'\ e a s y
w a y t o have RMA c a l cu l a t e t he l en g t h of a
T he concept
group of v a r i a b l e s i n a V S E CT ,
of a usef u l
data po s i t i on coun t e r ( " . n
in
A S M ) doesn ' t ex i s t i n RMA .
T he r e a r e s e v ­
era l
coun t e r s
( D i rect
Page ,
U n i n l t i a l i zed
dat a .
a n d i n i t i a l I i :zed d a t a ) ,
and ,
i n any
on
cas e ,
t he
l i nker
has
t he
l as t
word
I g o t u sed to t h i s prOb l em . and
addre s s e s ,
I ca n ' t t h i nk of any way f o r M i c r o wa r e t o
des i gn
it
out
of
RMA
w i t hout
i n t r Oduc i ng
ot h e r p ro b I ems ,
but
it
i s a s e r i ous p r o b ­
l em ,
T he l ac k o f a . , " c a u s e d o t h e r ha b i t s
have t o g e n e r a t e e r r o r s a s w e l l .
RMA ' s i nab i l i t y to de t e rm i ne o f f s e t s i n
a V S E C T c a u s e s t he 1 6 b i t o f f s e t
i n s t ru c ­
t i o n s t o b e u s e d more t ha n t h e y a r e i n p ro ­
g r a m s a s s emb l e d w i t h ASM ,
T he s e
i ns t r u c ­
t i ons
are
r e l a t i ve l y
l o ng
and
s l ow ,
At
f i r s t t h i s rea l l y upse t me , but m y exper i ­
ence
and
M i croware ' s
i nd i ca t e s
that
i t
i s n ' t a s i gn i f i ca n t p r ob l em .
I
conve r t ed
s ev e r a l v e r y l a r g e ( 5 000 t o 1 0000 l i n eS o f
code )
p r o g r ams
f r om
A SM t o R M A a n d
t he y
gen e r a l l y g o t a l i t t l e sma l l e r .
M i c roware
dec I a res
that
t he y have conve r t e d Bas i c09
f ro rr A S M to RMA .
and t ha t i t got a l i t t l e
s ma l l e r t hr ou g h t he conve r s i on .
I
at t r i ­
bu t e t he sma l I
decr e a se i n s 1 ze to bet t e r
c o d i ng hab i t s t ha t R M A encou r ages .
St i l l ,
i n t he l a s t a na l ys i s , p r ograms a s s e mb l ed b y
A S M c a n b e made t o r u n f as t e r t ha n p r o g r ams
a s s e mb l e d b y RMA ,
SUMMARY
th i n k
R M A / R L I NK
is
wonde r f u l .
am
a
s e r i OUS
a s s emb l y
l anguage
p r o g r amme r .
w r i te l a r ge p ro g rams t ha t t a ke a l on g t i me
t o a s semb I e ,
and h a v e q u a n t i t i e s of c h u n k s,
of code t ha t I " US E " i n a s semb l er p r o g rams
to p r e v e n t
myse l f
f r om
hav i ng
to r e w r i t e
commo n l y
u s ed
pr ocedure s ,
R MA
l ets
me
bui ld
l i brar i es .
and
a s semb l e
on l y
t he
s ma l l
pa r t of a p r o g r a m t ha t I c h a ng e ,
I
a l s o c a r e about s t r u c t u re d prog r amm i ng , a nd
R M A l e t s me u se t h a t d i s c i p l i n e f o r a s se m ­
b l y l a ng ua g e p ro g r a m s .
A s semb 1 Y
I a ng u a ge
p r ocedu r e s
to
be
c a l l ed f r om C m u s t b e w r i t t e n i n RMA . a nd I
have b e e n ab I e t o ca I 1
C p r oc e d u r es
f r om
RMA p r o g r am s .
R MA comes w i t h t he c c omp i ­
l er , b u t t he documen ta t i o n t h a t i s i nc l udea
i n t h e C manua l
i s n ' t s u f f i c i en t
t o make
f u l l u s e of c , a s m/ c . l i n k ,
T he i nf o rma t i on
1 have g i ve n i n t h I S rev i ew may supp l em e n t
t he C manua 1
e n ou g h . but .
i f not ,
I wou I d
r e commend
pu r c ha s i ng
a
copy
of
t he
R M A / R L I NK manua l f r om M i c r owa r e ,
T he s t a ndard a s s e mb l e � 1 s e a S i e r t o u s e
f or s h o r t a nd s i mp l e pr ograms ,
RMA h a S a
l ot
more
power .
a nd
is
c o r r e spond i ng l y
h a r de r t o u s e ,
N e v e r t he l es s .
if
you are
s e r i ou s
about
a ssemb l e r ,
R M A / R L I NK
i s
i mp o r t a n t
to
have ,
E v en
if
t he
addea
s t r u c t u r e doe s n ' t mean a n y t h i ng to you , t he
l a rge amo un t s of t i me t h a t y o u wo n ' t s p e n d
w a i t i ng f or b i g p ro g r a m s
to a s semb l e w 1 l l
b e wo r t h t h e i n v e s t ment
i n money a n d t i me
t ha t RMA requ i r e s .
Th i s
1 5
r ea l l y
n i t -p i ck i ng .
but
the
command 1 i ne o p t i on wh i ch s hou l d
set
t he
w i d t h of t he l i s t i ng w h i ch RNA can p r oduce
d o e s n ' t w or k ,
I t ' S n o t t h a t i mpo r t an t . but
1 , t t l e p r O b l ems l i k e t ha t cou l d g i ve a l es s
f o r g i v i ng p e r s o n t han me a bad
i mp r es s i o n
t h a t w ou l d s po i l t he exce l l en t j Ob done o n
t he r ea l l y i mp or t a nt p a r t s of t he produ ct .
prob 1 ems
i n t he f i rs t
I f ou n d sever a l
copy o f RMA t ha t I got . some o f t hem qu i t e
s e r i ou s ,
I
now h 8 v e e d i t i on f i ve .
I f you
have an e 8 r l i e r e d 1 t i on ,
I wou l d s t r o ng l y
recommend g e t t i n g an updat e ,
I f you mea n
to
u s e c , a s m a s a s t and - a l one a s sEtmb l e r .
y o u s h ou l d a l s o see t o i t tha t you have a n
u p - t o -d 8 t e
rev i s i on .
The
p r o b l ems
wer e
t r i c k y t h i ng s t ha t wou l dn ' t gen e r a l l y s h o w
up w i t h c o r r e c t code ,
but
I
heven ' t b e e n
eb 1 e
t o uncover
any b u g s o t he r t ha n
the
p r ob l em w i t h t he w i d t n Of t he
1 i s t i ng i n
t h e cur rent r e v i s i on o f RMA
Rev i e w o f RMA and RLI NK
147
��
05- 9 U s e r No t e s Vo l ume I
I NDEX
ACIA "
A c t i ve
ANS I
, 48
P r oce s s Queue
P r o t oc o l
A pp l i ca t i o n
Dev i ce
58
39
. "
Desc r i ptor
D ev i ce D r i ve r
Beeper
P r og r ams
35
Nu l l
B - T rees
B a s i c09
131
B a s i c09
. . ,
.
Buffers
'
131
. "
.
.
,
'
Dev i ce
25
F un c t i on s
CHX
-
. . .
F l oa t i ng
Po i n t
. , .
. . .
123
Sof t w a r e G r ou p
C o C o D i s k D r i ve r
Commands . , . 9
. . .
37 .
OIR . , .
DSAVE .
55 ,
. . 9
1 24
, . .
1 03 .
CHX . . . 3 7 . 48 .
OCHE C K . . , 1 1 3
D E LD I R . . ' 9
. .
,
F o rma t
I D E NT .
Ki l l
. .
LOAD . .
L OG I N .
MAKD I R
87
Setpr
1 05
1 03 .
105
1 03 - 1 04
Compus e r ve
. . .
DO i r . . .
Debugger
77.
Debugg i ng
1 32
1 32
1 32
1 32
. . .
' . .
37
UpCla t ; ng
, . .
50
.
. .
1 05
. . .
1 07
. , .
26
1 37
DynaSpe l l
Dyna S t a r
96
. . .
. . .
8 1
35 ,
35
35
56
l OB
A t t r i bu t es . . , 55
Oescr ; ptor . . . 1 0B
S ecu r i t y . . . 5 5
Shar i ng . . , 5 5
. . .
55
95
Hogg
F u j i tsu
. . .
1 13
F i le
. . . 1 07
13
1
57
Labs
. , .
. . .
35
47
16
89
Gener i c 05-9 . . . 1 07
G E T ST A T / PU T S T A T . . , 39
Gimi x
. . .
47 ,
81
GIMIX I I I . . . 6
GOT O X Y . . , 39
Graph i c s . . . 6 1
87
Graph i c s hardware
1/0
1 /0
I /O
Man�ge r s . , . 7 4
red i r e c t i on . . .
Sys t em
I F J'.I 1 / E NDC
35
D ed i t . . . 1 3 1
De f s L i s t . , . 2 7
. . .
1 18
D r i ve r . De v i c e . . .
D r i ve r 2 . . . 2 2
1 35
D 'YNA C A L C
D yn a f o r m . . . 3 5
Dynaml t e . . . 1 3 7
F r ank
1 32
D - S e r i es ' "
D / A Conve r t e r ( C oC o )
Data B a s e . . . 1 4 1
D a ta D 1 r e c t o r y . . . 3 6
DOe 1
131
F l ex
78
. . .
. . .
78
F i l e . A t t r i bu t e s
F l l ter . . , 39
B u s y Wa i t i ng . . . 2 5 . 5 7
E xe cu t i on Sequence . . . 2 5
Lockout . . . 25
, . .
. . .
74
E x e cu t i on D i re c t o ry . . . 36
F o r ma t t e d l i s t i ng . . .
113
L.oca t i on o n D i s k . . . 4 8
MA KD I R . , . 36
F i le
F i 1e
F i le
F i le
C o nc u r r e nc y p r ob l ems
DAt t r
DCopy
. . ,
E xec u t i on D i r ec t or y . . . 3 6
E xec u t i on f i l e a t t r i bu t e . . ,
25
E xecu t l on Sequence
56
.
26
E d i tors . . , 88
E nqueue/Dequeue . . . 1 6
E nt r y Po i nt . . . 28
E xecu t e O n l y f i l e s . . .
48
UN L I NK "
W • • • 48
96
Edi t
. . 1 03
. 9
48
78
. 56
. . 36
. . .
. . ,
57
49
D a t a D i r ec t oy . . . 3 6
De f au l t d i rec t o r i es
D i s s a s s em b l e r s
Dr . . . 1 1 5
76
MD I R ' "
MF R E E . . . 7 8
OS9GEN . , . 9
P R I NT E R R . . . 9
P IllD . . . 9
PXD . . . 9
T SMON
. . .
D i Sk C ont e n t i on . . .
D i spa t che r . . . 5 7
48
,
.
.
.
.
.
. . .
. . .
I ndependance
D i r$qz
A T T R . . . 37
B a c k up . . . 1 03 - 1 04
. . .
Rout i n e
S t o ralile
Mu l t i p l e L. i n k s t o a
Read i ng D i rec t o r i es
R oo t . . . 36
COBOL , . . 1 23
C O B O L D ebugger . . .
CoCO . . . 6 2 . 7 7 . 8 1
EX
74
37
C l e a r brook
26
D i r command . . . 1 04
D i r e c t or i e s as f i l e s
D i r S qz . . . 1 1 8
Dr " . 1 1 5
2 1
CHX . , . 3 7
C I S COBO L . . .
CHD
, . .
1 13
Carry B i t
29
Cha n g i ng D i s k s . "
78
C hang i ng I / O C o n f i gu r a t i on
C he r C t . .
60
CHD
7
. , .
Chang i ng D i s k s
CHD . . . 3 7
145
C L a nguage . . . 9 6 .
C L i nk . . . 1 4 5
C ac h e . . . 4 9
Cal c
9
26
W a i t i ng
60
SWord
C
Serv i ce
Stat i c
. . .
D i re c t o r i e s . . . 3 6
Anonymou s . . . 3 7
Susy
C Asm
48
6
P r ogram
Dev i ce D r i ve r s
Cons t r uct i o n
BT9
77
, "
9
'
82
. , .
05-9 S e r v i ce
131
6
. , .
Nu l l
1 5 . 35
I n s t a l l at i on
B i n a r y T re e s
B oo t f i l e . ,
' "
L. 0lil i ca l
74
. . ,
lni t ,al
. .
,
. . ,
73
73
27
P r og r a m
. . . 56
I n i t i a l i z at i on T a b l e " . 7 5
I n t e r r upt S e r v i ce R o u t i ne . , .
I n t e r r up t s
. . .
57 ,
Be
I ndex
57
149
:' s am
.
.
,
47 ,
Beeper
0 3 M Group
. . .
Johnson ,
47
(D.P . )
Dan
. .
L eve l I I Memo r y
LOCKer . . . 18
L o c k i ng
16-
. .
Lockout
Macros
25
BWord
M 1 ce
.
Modu l e
II
. .
.
. , 87
1 07
.
.
.
27
16
Po i n t
16
28
16- 1 7
.
.
.
L o c k i ng . . .
M e m o r y r equ ' r e m e n t
Modu l e S i z e . . .
17
Modu l e T ype . . . 2 7
Reen t r a n t . . . 2 7
.
.
.
V e r s l o n Number
M ::J T ::J . . . 5 6
. . .
O-F
. . .
:J S 9 P l
OS9P3
28
P/V
.
. .
P a ramod
�asca l
82
. .
1 05
S t r i ng
t e r m i na t o r
. . .
.
f rom p r o g r a m s
E xamp l e of a P i pe l i ne
F i l t er s . . . 5 9
i nt e r na l s . . . 6 1
I nt erprocess
Overv i ew . . .
Words
(Fi
,
"
. . .
.
. . .
'
. . .
1 15
D r i ve r
O ne
60
22
Ge t t i ng a
Mix
gOOd
One
.
, .
. . .
25
13
92
86
99
"
51
55
R a s t er i za t i on . . .
R e c o r d Manageme n t
Recovery . . . 1 1 3
61
Reent r a n t
Rev i s i o n .
R L I NK . . .
27
14 1
.
. .
.
SetStat
60
60
59
41
.
145
10
.
SS . S I G
97
Sha red modu l es
Shel l
. . . 28
SHE L L
Commands
SHE L L
Smoke
Push .
S i gna l
16
48
. .
48
. . .
47 ,
81 ,
r e f i d = P roces . Su spend S t a t e
. . .
57
Sort
Sound
1 07
B r oadca s t i ng
I nt e r p r o c e s s
Mix
. . .
'
16
"
. . .
. .
11,
. .
73
73
S t anda r d O u t p u t . . . 7 3
S t andards . . . 39 ,
101
25
25
S t a r tup
15
15
26
.
E rror
E r r o r Pa t h . . .
I / O P a t hs . . .
I np u t . . . 7 3
Fi le
.
. .
56 ,
S t o rage Requ i remen t
Suspend S t a t e
.
81
96
49
1 35
97
. 1 13
. . , 73
S t andard
S t a nda r d
S t andard
57
Commun i ca t i on
L ockout . . . 2 5
P a r a me t e r A rea
. . 4 7 , 60
Gene r a t i on
S t andard
15
"
.
S pe l l i ng Chec k e r
Sp l i t S c reen . . .
Spread S he e t . . .
S S . S I G Setstat
S t ab l e S t orage
27
Get t i ng a gOOd
SWTPc
. . .
. . .
73
. . .
27
T erm l na l
OS - 9 U s e r N o t e s Vo l ume I
.
, .
.
.
47
97
Commands
28
57
1 07
T a no D ragon
T e l ev i deo .
150
14
D r i ve r Two
F R exp . . .
1 00
Sepa r a t e A s semb l y
S e r v i ce Reques t s .
F $ F o rk . , . 1 1
F S Send . "
57
F ork . . . 1 0
L i nk . . .
16
59
Sequence
l eng t h
1 12
1 18
1 09
1 10
101
1 ter )
Conc u r r e n t
.
. .
S c hoo l s
36
59
Concu r rency p r ot l em s
Pr i or i t y
. . .
59
Address Space . , . 1 2
Background . . . 48
Bus y Wa i t i ng . . . 2 5 ,
P r ogram
28
62
P O p t . . . 2 7 , 30
� o r t i ng O S - 9 . . .
� � i n t e r Opt i ons
"' r i o r i ty . . , 2 6
"' r i vsc . . . 4 7
P roce s s e s . "
10
E xecu t i on
D L i st
D L i st2
School
'
V i r t u a l S t o r age . . . 5
� Slolord . . . 56
' c s s wo r d f i l e . . . 5 6
� i pe s . . . 5 9
A l g or i t hm P a r t i t i on v i a
B u g i n P I P EMan . . . 60
. . .
.
1 29
128
1 26
. .
16.
. . 27
1 45
RMA . . . 1 4 5
RMS . . . 1 4 1
R u nB . . . 60
. .
S ne l l
D i rSqz
TstS S i g
Vc i a . . .
P r o t ec t i on
1 07
.
42
5 , 35-36
B r i e f Rev l ew . . , 3 5
M i c r owa r e ' "
5
R e l e a s e 2 . 0 ( M i c r ow a r e )
D i rect
S i e ve
T e s t Beep
16
.
Cobo l
T B e ep2
41
121
95 ,
1 07
97
P a rameter
B e n c hma r k
27 , 30
70
' 83
S t r t T a sk . . . 6 7
28
' , ::;, "'> - S t anda r d Ha r d w a r e
O F l ex
64
COBOL
POpt . . .
Rast . . .
Sound . .
88
" � l t i t a s k l ng
. .
1
. .
.
S t r t Task
� l t i - P roce s s o r s
.
63
2
Grapher . . . 6 6
45
He l p_B
ld . . . 1 1 1
Locker . , . 1 8
Modf . . .
1 00
P a ramMod
44
78
R ev i s l on . . . 2 7
Shared . "
16
S t o r a ge Requ i reme n t
I�,.JMP S
CharCt
Dr
Da t a Modu l e s
E nt r y
.
88
25
T ype
Modu l e s
. . .
. . .
Cobo l T e s t
D F ormat . .
M a n a gement
,
.
81
17
145
. . .
. . '
R e q u i r eme n t s
Memo r y f o r Leve l
Mlx
13
84
. . . 90
. .
.
Beepe r 2
87
Ca l c
M e mo r y
. . .
P r og r a m s
1 23
. . .
40
T e r m i na l
Hand l i ng
T e r m i na l
Suppor t
T i me S na r i ng
'
"
. .
. . .
56
.
1 23
39
T one G e n e ra t i on . . . 8 9
T r a ns l a t i on L ow e r t o Upper
T u n i ng . . . 2 6
. . . 60
. . ,
36
U S E . . . 27
User N u mber
Un i q
UN I X
. . ,
U s e r Sem i na r
U s e r s G r oup .
.
.
.
.
. . .
51
Vers i on Number
.
47
29 ,
47 ,
62
Ve i a
Case
28
VTerm
. .
.
.
.
.
28
49
Wave f o r m
82
X O n! X O f f
9
56
I nd e x
1 51
1 5':2
05 - 9 U s e r N ot e s Vo l ume
I