Sei sulla pagina 1di 68

5 I /O SUBSYSTEI'I

T h i s s € c t i o n d i s c u s E e s t h e I / O E U b s U s t e mo f t h e O p e r a t i n g S g s t € m . T h e
I/O subsgsteft conpriEEs € rolleEtion of routines thEt allou qou
to aacess peaipheral and Iocal deviceE at threE different levels. The
CIO (Central I/O Utilitg), provideE the higheEt 1€veL tl€vice
independent Ecce65 to device6. The 6econd Ievel al!ot!6 comounication
uith the device handlers. The lou,eEt level is the 5IO (SeriaI I/O bus
Utilitq, r'outine. Ang louet level sEceEs to a device involveB the
direct reading €nd uriiting of the hard(,are registets associ€ted uith
the device.

The d:ts bqte i6 the basic unit of input/outFut. A data bgte can
rontain eithea "binai!" (non telt) info?dation, or entoded tett
in+ormation. The t€xt encodint gchemesuPPorted bg the OS i9 called
ATASCIL derived from the uordi 'ATARI ASCII. " Ho6t ATASCII codes aie
the €atre aE ASCIL t ith the prima?9 deviations being the control
codeE. Appendix D shous the ATASCII cher:cter 5et, 3nd AppenditeE E,
F, and C shou devi.e-gpecifiE i plefi6ntetions for the di6p1aq,
l e r J bo a a d , a n d p r i n t e r .

The \Etiucture o f t h e I / O 6 u b s g s t e m i 5 s h o u r no n t h e f o l l o { t i n g page.

S Y S T E t IC o 1 6 5 5 5 - -
oPERATTNG Section 5
+---------+
I uEer i
+-----_--__-------i progrEo l-_____--_----------------_-+
+---------+
+--_------+ i
I IOCB.s I **lrt **+** I
+---------+ | i
++------------+
Resident I clo I +-----*---+ i
H a n dl e r I Utilitq I i DCB I *+***** I
V e c t o i T e b1 a +---*-----+ .*
++------*---__+ :l
i
+---------+ +---------+ * i
r zloc8 | i DeviGe I lDisl Filel * |
+-----:----t i T€ble i +----i l'lanag€lt l -----+ !
i +---------+
+--+-------**---+------+------+--.i--, .
i ! l i
+---------+ +-rE------+ +_-----r__+ +-------r-.i
iPtinter I i CEe5€ttel !... I I K e r r b o a i di I DiEk !
iHandler I i Handlsi I I Handter I I H a n dI 6 r i i H e n dI e r I
+---------+ +----__--_.1, l"---------+
t t :
-----+------+--*--
t---------+
I DCS l4*+ta*+***
+---------+
+---------+
I slo !
! Utilitg I
+---------+

$lher€: ---- sho{r5 e control pEth. +t{* shot s the date structure
r e q u i r e d f o l . e F at h .

Note thE +oI Iouing:

o Tfie Kegboard/Displag/Scr€en Editor. Handl€r,s don,t use SIU.


o The Di6tette hsndler cannot be Eel led dit.ectlg from CIO.
o The DCB is shoon turice in the diagrao.
Figure 5-1 L/O Subsgste.n Structufe Flou Diagram

APERATINOSYSTEiI CO16555 -- S€rtion g


C F N T R A LI / O U T I L I T Y

The centrel I/o utilitg provideE qou 'r,ith e eingre interfa'e in u'hich
to a.cess all of the sqEtsm peiiPherel devieeE in a d e v i t e - i n d ependent
n:nner'. The mininun unit of datE tiensfer i5 the data b g t e . T h e CIO
a l s o s r . r p p o r t sf l u l . t i p 1 e b g t e t t a n E f e r s . A l l l / B o p € r ' e t i o n E a r €
perfoined on a 'raeturn_to-uEei-uhen-comPlete" baEis; there is no uag
to initiate concrr?ent "ovel.lapPed" I/O proEesseE

I/O is organized bg "fiIes,'t uhere a file iE e sequential


co]lection of date bgtes. A +ile ctsn oi nag not contain tertual
" uhere a
date end it ren oi rnaqnot be org€nired bg "records,
r'ecord is e Eontiguous group of bqtes terdinated btJ an EOL (End of
L i n e ) c h a ? a € t e r . s o { n e f i l e s a r e B g t r o n U m o uuEi t h a d e v i c e ( a 9 o i t h
the giinter end the Screen Editor), uhila otheF devices can tontain
m!ltiple file6, eeEh urith e unique nane (as trith the disk drive).

CIO €IIorrs qou to Ecce95 up to eight independent device/fiIeE


e t o n e t i m e , b e r a [ r s e t h e ? e a r e e i g h t I / O C o n t r o l B l o c t s ( I O C E ' E) i n
the 6gstem. Each of the IOCB's can be e53igned to Eofltrol anv
deviae/+i1e be.€u9i there Ete no preferiad eEsignlnentg, excePt that
I O C B* O i e e E E i g n e d t o t h e S c r e e n E d i t o r a t p o u e r - u p a n d
! i q s t e m r e 9 et .

To acce69 a peiiphei'al, gou +irst eet up €n I{ICB for the OPEN


rommand,th€t supplies the sgstem neme for the devic€ to be
eccesged (e. g. K:, +or the teUboeid, P: , fol' the print€r, D :S T A R S
for a diekette file naned ' S T A R S ' . etc). You then calI t h e ClO,
telling i t t o e r a m i n e t h e I O C B t o + i n d t h e O P E Ni n f o i ' | n a t i o n . C I O
attempti to +ind the specified device/file.nd r€turns e stittug
b g t e i . n d i c a t i n g t h e E U c c e E Eo f t h e s e a r c h . I f t h e s p e c i + i e d
devire/file can be +ound bg CIO, then CI0 5toreE Eontrol
information in the lOC8. The IOCB is nou, uged for as long aE thEt
file iE open.

Onc€ € *ile is open, it can then !e €cc€96ed using deta-r€ad or


deta-{'l ite tgpes o+ comm€ndE; in gener.€1, reading qan pioceed until
there i6 no noae data to read (Ehd of Filet and uaiting E€n pioaeed
until there is no more fiediuD to store dEta on (End of Medium),
although neither reading nor tr.iting need procaed to that point.
The reeding €nd ufiting of data geneiallg occurs into and out of
user-6upplied data buffe.s (although e EpeEial cE6e ellouinq 9ingle
bgtE tren6{err using the 6902 A register is ptovided}.

l",henthete are no {nore €caesries to be peiforltred on an open


device/file, gou perfoi|n the cl06e opeiation. This
a c c o o pI i s h e s t u o f u n E t i o n g

o 1+ teicrinete5 and oekes permanent €n output file (egsential


for diskette end ca6sette).

o It releeses thet IOCB to be u6ed for another I/O oDeiation.

O P E R A T t N eS Y S T E I IC O 1 6 5 5 5 - - Section 5
CIO Design PhilosoFhg

The CIO utilitq u€s deEigned .pecificatlg to fteet the foltot ing
deEign caiteria.

o The transfer of d€t€ devi ce independ€nt.

o Sqte-at-a-time, nu 1t i p l e b ' J t e a n d r ' e r o r d - a I i g n e d ecceE€e9 ara


supporteal.

lt!1tip1e device/file9 .an be acce5sed aonEUrrentlg.

o Error hEndling is largelq devic€ independent.

N e q ,d € v i c e h € n d l e r 6 c e n b e e d d e d u i t h o u t alter.ing the Eqstem


RAH.

Device IndeDendence

CIO !rovides devire indepeodencebq havihg e Eingle entrg point for.


al1 deviceE (End +or all operations) snd bg heving a
device_indspend€nt €alling sequ€nce. Once a device/+ite is opened,
d€ta tran6fers orrur {rith no regard to the actuel devire involved.
Uniform ruleE +or hEndling bgte- 6nd iecord-oriented datE trans+e.s
atlot, the ectuel deviEe Etor'€9e $loct sizes to be transparent to gou.

Data AccesE l'lethodg

The CI8 sllports tuo file access methods: b{te-aligned €nd


record-e1itned.

BVte-€1igned accegsaii allou qou to tieat the devi€e/fiI€ as a


sequential bgte €tr.eaft; €ng ntJlnbei of bqtes can be re€d or {'r itten
snd the +o11or!ingoperation uiII continue ohere th€ pr.ior one left
o + f . R e c o r d 6 6 r e o f n o c o n E e q u s n a ei n t h i i o o d e , a n d r e E d E o r
rrriteE cen enconpassfiu1tip1e i€€oid$ i+ desired.

R e E o r . d _ a l i g n e de c c e s s e s e 1 1 o { , g o u t o d e e l u i t h t h € d a t E s t . e a m
at e highet level, that of the data reco.d o" "!ine o+ text. " Each
ancl evert ui.ite operation createE a single recor.d (bg detinition).
Each read operation essur€e that the follouing read operation
trrill 6ta|"t at the beginning of a re.ord. Record-aligned eccesEeg
cannot d€al u,ith pol'tions of {nore than one record at a time.
Record-aligned accasses are ugeful onlg uith text dete or. uith
bin€rq datd gusranteed not to contain the EOL character (!999) ag

Note that ang file can be acce5sed lJ6inq the bgte-align€d eEce6s
m e t h o d . r e g a r . dl e s s of hol, t h e f i l e lraE created. 8ut not ell files
can be s!creiSfullg read uEing record-aligned eccesses; the file

OPERATINGS Y S T E M C D l 6 5 5 5 - - Se.tion 5
nust contEin EOL ch€racters at the end o+ each record and at no
other qlEce.

l v l u l t i p l e D e v i E e . / F i 1 e Co n c u r r e n c U

Up to eight device/+i1€s can bs accessed concu.rentlg r . r s i n gC I 6 ,


e a ch o p e a et i n 9 i n d e p e n d e n t l q o f t h s o t h e r s .

Unif ied Er.ror Handling

All error detection and ?ecov€rg arccursu,ithin the CIO sub6gstem.


The 6tetus in+orrhetion that reacheE 9ou is in the fo?n of a
status bgte foi ee€h device,/+i1e. Error codes are devi.e
independEnt 69 ftuEh a5 poiEible (see Appendix B).

Device Erpaheion

Devi€es ar.e tnoun bq sinqle .haracter neftei such €s l( or p, and a


number of deviEe hendleis aie part of the residsnt Egsten ROM.
Hou€vet, additional devic€ handlers can be added to the sqgte'll
using the RAf'|-aa3ident device tsblei this i6 norrflallU done at
pouer-up time as {rith the di6|(ett€ boot tr.or€6c, but can be done et
ang poinf, in tifie.

CIO Cilling l.lechanisir

The input/ostput contr.ol bloct (IOCB' iE the pr.im€rq paraneter


paEsing str'ucture bet{r€en gou and CIU. There are eight IOCB.g
i n t h e s g s t e m , a r r a n g € d l i n e a r . l g i n R A t . !e s B h o { r n b e t o u r :

+--------+ lou addre96 [O34O]


l I o c E 0 r
+--------+
I I O C B1 t
+------*-+

I IOCB 6 |
+---*----+
i l a c s T r
high eddieEs

Fi 9 ut'e 5-? CIO CElling Me€htsnisil

I O16599 --
O P E R A T I N eS Y S T E F C Ss.tion 5
One IOCB ia iequired for each open device,/+ile. An{ IOCB cdn be tised
t o c o n t r o l a n g d e v i c e . / f i 1 e , a l t h o u g h I O C BO i s n o r a l l g a g s i g n e d t o
t h e 5 c . e e n E d i t o r ( E : ) . Y o u p e r f o r . , ne t g p i c a l I / O o p e r a t i o n b q :

Inieating appropriate p€r€meters into an IOCBof {our choosing

o Putt ing the IOCBnumbei tianes 16 into the 65Oe X i€gister

o Perfortaing a lrSR t o t h e C I O e n t r g p o i n t CIOV tE456l.

CIO returns to tjo! qrhen th e oPer€tion is coftplete or if atl


e?tor u,aE enEounte?ed. The o p e r a t i o n s t a t u E i s i n t h e I O C E u 6 e d , a 9
uell a5 in the 650! Y regi ster. Th€ 6902 Eondition cod€s uill a1!o
refl€ct th€ velue in the Y register. ln EomeaaseE a data bgte uill
be in the 6902 A !.e9ister. T h e X r 6 9 i s t o f u i l l reoain !nahanged for
a l I o p € r e t i o n s a n d c o n d i t i ons. An exa|rrtle is shou,n belo|,:

I o C B 2 X= 6 2 0 ; INDEX F6R IOCS {+?

*tac82x
CIOV
CPY l+O ; ( optional )
BII I ERROR
This eector describee €ach IBCB bqt., uith it5 fite nameand
addr€s6. Each IOCS is 16 !gtes long. Somebgtes can be 6ltsred bq
{ou 6n{l some Ere reserved for uEe bg CIO and/or the device
handlers.

Hand16r lD -- ICHID tO34Ol

T h € h a n d l e r I D i s a n i n d € r i n t o t h e s gs t e o d e v i E e t a b l e ( s e e
Seatlon g) €nd is not uEer-sIter.abl e . T h i i b g t e i s 6 e t b q C I o e E
t h e r e s u l t o f a n O P E N E o m m a n da n d i E l e f t u n c h a n g e d u n t i l t h €
device/file ii closed, at thst time CIo t itl set the bgte to $FF.

D e v i c e N u m b e r- - tcDNo t 03411
T h 6 d o v i c e n u o b e . i E p r o v i d r d b { C I O E E the result of an OPEN
conngnd and i6 not user-altereble. This brrte is uEed to
distinguish bet{reen multi.D}e deviceE of thE Eanetgpe, such as
D1: end D2:.

OPERATINASYSTEI{ c o 1 6 5 5 5- - S e ct i o n 5
command 8{te -- ICCI{D to342l

Y o u E e t t h e c o m m a n db g t e . I t 6 F e c i + i e 5 t h e c o m l n a n dt o b e
peiformed bq the CIO. Thie bgte is not altered bq CIO.

St€tus -- ICSTA to343l

The CI0 conveUe operation statug to gou uith the coo{rand


5tetuE bute as a result of eBch and everg CIO call.. Each and
everq CIO ra11 updateE the co$nand statu5 bqte. The ,noEt
signi+ic€nt (6ignl bit i.s a one for erroi conditions and zero fot
non-error conditiong, and the reln€ining bits repr.eEent an error'
nunber. See Appendir B for a liEt of status iodes.

Bu*fe. AddreEs -- ICBAL t0344l and ICBAH tO349J

You Eet this 2-b{te pointefi it iE not alteied bg CIg. The


point€r contain6 the eddre6s of the beginning (Iou addressl of a
bu f f e r t h a t :

o ContainE date for read and urite oper.Etions

o C o n t a i n E t h e d e v i c s / f i l e n a f l r €s o e c i f i c a t i o n sor the OPEN


€omnand,

Yo! can alter the pointer at ang ti.ne.

PUT Address -* ICPTL t0346l and ICPTH to347l

T h e C I 8 E e t E t h i s 2 - b q t e p o i n t e r e t O P E Nt i f i E t o t h e h a n d l e r ' s
P U T C H A R A C T EeRn t r g p o i n t ( - 1 ) . T h e p o i n t e r l r a 6 p r o v i d e d t o
a c c o m m o d a t et h e p e o p l e u t i t i n g the ATARI BASIC caittidge, and has
no legitimBte use in the sgEtem. This veFieble iE cet to point to
CIO's "IOC8 not OPEN" routine on CLOSE, Pourei-ur and
ISYSTEM.RESETI.

Bu+fei Length,/BUte Count -- TCBLL IO348l and ICELH t03491

Yo! set thiE 2-bqte count to indicate the 6ize of the data
buffer pointed to bg ICAAL and ICBAH for read and ut'ite
opergtidns. lt is not required fo" OPEN. Aft€l. ea.h read or u,rit€
oper.etion, CIO rril1 set this pa?amet€r to the nuober of btJteE
actlaIlq treng+erred into or out of the data buffer. FoF
record-6ligned acceeE, the record length crn uell be less then
the buffer' length. AIEo an end of +iIe condition or an errof cen
cd!5e the brJte couflt to be leEs thsn the bu+fe. length.

Auxilierg Info.mation -- ICAXl tO34Al and ICAXa I0348]

O P E R A T I N OS Y S T E HC O 1 6 5 5 5 - - Section 5
40
You Eet theEe 2-b9tes. Theg rontein inforo€tion that iE
u E e d b g t h e O P E N c o m | l l s n dp r o c e 6 s € n d / o r i s d e v i c e - d e p e n d e n t .

For OPEN, t'!o bit6 of ICAXl are €1rrEg6 ugsd to specifq the OPEN
diiection aE sho{rnbelou, lrhere R i€ set to l for input (r€ad}
enable end lJ is set to l for outDUt (urite) enable.

+-+-+-+-+-+-+-+-+
i i i I rt,lrRri i
+-+-+-+-+-+-+-+-+

ICAX1 is not alter.ed b! CIO. You 6hoold not alter ICAX1


once the device/+ile is o!en.

The remaining bit6 of ICAXl efld a1] o+ ICAXz contei.n onlq


device-dependent data and are explained later in this section.

R e m ai n i n g B r J t e s ( I C A X S - I C A X 6 )

The h:ndlei reseives the four .emeining bUt€s fo!'pr.oce€iing the


I / O c o m n a n df o r C I B . T h e r . e i E n o + i r e d u s e f o r t h e 6 e b q t e s . T h e !
3re not u6er-Elter€b1e ercept a5 specified bq the pa.ti.cular
devi€e {tesrriptionE. These bgtes uill be Feferred to B6 ICAX3,
I C A X 4 . I C A X Sa n d I C A X 6 , e l t h o o g h t h e r e € t ' s n o e q u a t e s f o r t h o s e
names in the OS equate file.

CIO Functi6n6

The CIO supports r'ecordE and blocks €nd the hendlerE support
Eingle bgt€6. A11 of the sgstem hendlerg suppoat one oa no.e
of the eight basic funEtiong subJect to Destriction6 besed
upon the diiection o+ data transfer (e. g. one aannot reBd date
+ron the pri.nter). Tfie baEic {unf,tions are: OPEN, CLOSE, eET
CHARACTERS,PUT CHARACTERS.GET RECORD, PUT RECARD, CET STATUS,
End SPECIAL.

O P E M- - AsEign DeviEe/Filename to IOCB and Reedq for Acc€EE

A device/+ile mu6t be opensd before it tan be €cceEEed. Thig


proce6g lin&9 e specific lOCB to the apprdpriate device
handler.. initieliz€E the device/file, initiali!es all CIO
control varieble€, and peises device-6pecific options to the
device hand1€r.

O P E R A T I N GS Y S T E Mc u 1 6 5 5 5 - - Section 5
41
You 6et up the $ollorrring IOCB paraneters prior. to calling CIO foi an
BPEN operation:

COI'll"tANDBYTE = EO3

B U F F E F A D D R E S S= p o i n t e r to E d€vice,/fi1en:ne specification.

A U X l : O P E Nd i r e c t i o n bits, plus deviEe-dependent in+ormation.

AUX2= devic€-dependent informat i on.

A f t e a a n O P E No p e r e t i o n , CIO ni11 have altered the +otlouring tOCB


oarEmeter.5:

H A N D L E RI D = i n d e r t o t h e E q s t e m d e v i E e t e b l e , this i6
ug€d onlq bg CIB and nugt not be tsItered.

D E V I C E N U I ' I B E R= d e v i € e n u f t b e r t a k e n * r o o the device/filenade


Epecifiration and muet not be altered.

S T A T U S= r e E U l t o + O P E No p e r a t i o n ; E e e A p p e n d i x B f o r s l i e t
of the p06sible statu6 codes. In general, e negative Et:tus
t ill indicate a failule to open properlq.

P U T A D D R E S S= p o i n t s r . t o t h e P U T C H A R A C T E RrSo o t i n e for tne


devica handler Just opened.

It is F e c o f l m e n d e dt h a t thi6 sointer not be !6ed.

C L D S E_ - T e r o i n a t e A c ( e s s t o D e v i c e / F i l e and Releaie IOC8.

You iEsu€ a CLBSE coltlnandafter 9ou ere through :tcresEinq a


given device/fi1e. T h e C L O S Ep r o c e E E c o n p l e t e E € n U p e n d i n g d s t a
uriite6, goes to the device hsndle" for anV device-ipecific
actions, end then releaEes the IOCB.

You set the +olloning IOCEpa16flete? prio. to calling


cIo:
COttl.lAND BYTE = $oC

The CIO alters the +ollorring IOCB perameters as a re6ult of the


C L O S Eo o e r . e t i o n :

HANDLER ID = $FF

S T A T U S= R e 5 u 1 t o + C L O S E o p e " a t i o n -

P U T A D D R E S S= p o i n t e r to "IOCB not OPEN" routine.

A P E R A T I N CS Y S T E MC O 1 6 5 5 5 - - section 5
O E T C H A R A C T E R-S- Read n Cherecters (8gte-Aligned Acce6E)

The Epecified nuflber of cher€cteis are read *roln th€ device/fi1e


to the usef-supplied bsffer. EOL .haracters heve no ter|l|ination
featll.eE urhen ssing thiE function, there c:n be no EOL. or |n€ng
EOL'8, in the buffer after oper.€tion cornpletion. There iE a
speEisI Eese provided that passes s Eingle b{te of dat6 in th€
6$02 A tegi5ter ohen the bu+fei lenqth i6 Eet to zero.

You Eet th€ +ollolring IOCBpaiameters priof to celling CI0:

cOtt'IAND SYTE = $O7

S U F F E RA D D R E S S= D o i r t c r to deta buf+ei.

B U F F E RL E N C T H= n u f i b e r o f b q t e g t o r e a d , i f t h i s i6 zero,
the d6te ui11 be .etu.ned in the 650A A reqister onI'J.
The CIO elters the foltouing IOCSpa.ameters as a resutt of the
O E T C H A R A C T E RoSp e r a t i o n :

S T A T U S= r e s u l t o f C E T C H A R A C T E RoSr e r a t i o n .

EYTE COUNT/EUFFERLENoTH = nu ber of b{tes r.ead to the


b u f + € r . T h e S Y T E C O U N Tu i 1 1 a l { r , a g e e { u e 1 t h e E U F F E RL E N O T H
ercept uhen en el.ror or an end-of-fi1e condition ocrur-E.

P U T C H A R A C T E R-S- trrite n Characters (9gt€-Aligned AcceEs)


T h € G p F c i f i e d n u n b e r .o f c h e r e c t e r s e r . e t r i t t e n froft the uEer-supplied
b!+far to the deviEe/+ile. EOL charscterE have no buffer
termineting pr6pertieE, eltho[r9h theg have their st€nderd ft,1eaning
to thE davice/fiIE r.ereiving themi no EOL,s dte generated bg CIO.
There is a 5p€riE1 c5se thEt allous a Eingle rharacter to be
patsed to CIO in the 6902 A "egister it the buffei tength is

You E€t the follouinq IOCBparEo€te.is prior to initiating the pUT


C H A R A C T E RoSp e r a t i o n :

CATHAND SYTE = $OB

B U F F E RA D D R E S S= p o i n t e r . t o d E t e b u f f e r .

S U F F E RL E N o T H = n u m b e r o f b g t e g o + d a t a in bu+fef.
The CIO alterE the fo11o{ring IOCBparameter as a resuIt of the
P U T C H A R A C T E Ro9p e r 6 t i o n :

S T A T U S= r e s u l t o f P U T C H A R A C T E RoSr e r . e t i o n .

OPERATTNGSYSTET{CO16555 -- gection 5
43
O E T R E C O R D- - Re:d Up To n Characters (Record-Allgned Atce55)

C h a r . a c t e r Ee r e i e € d + r o m t h e d e v i c e / f i 1 e t o t h e u 6 e r - s u p p l i e d
buffsr until either the buffe!. is full o? en EBL €haracter i5
read and put into the buf*€r. I+ the bu+fer fill€ before en EDL
ii reed, then the CIO continueg reading chEtacter'6 frofi the
device/file until an EOL i6 read,, and setE ihe statuE to
indicete that a tiunceted i€cord u,as read. No EOL 'r,ill be lut at
the end o+ the buffer'.

You set the follduing IDCB peraneters prio. to calling CIO:

col'll"lAND BYTE = 9O3

B U F F E RA D D R E S S= p o i n t e i to data bu+fer'.

B U F F E F L E N C T H= & a x i m u m n u { n b e i o f b { t e s to r€ad (including


th€ EOL charactei,.

The CI0 aIt€r'5 the +ollouino IOCB paraoeters as e l"EeLrltof the


G E T R E C O R Do p e i a t i o n :

S T A T U S= r . s i u l t o f G E T R E C O R Do p e r a t i o n .

SYTE COUNT/BUFFER L E N G T H= n u m b e r o f b { t e i r e a d t o d t s t a
bu+fefi thi5 can be 1es6 th6n the fiarimln buffer length.

F U T R E C O R D- - t'h'ite Up To n Character'6 (Reco.d-AIigned Access'

Cha.a.ters are ur.itten froft the us€r-supplied buffer to the


device/file until either the buffer iE emptg or an EOL character
is uritten. 1f the buf+et i5 ernptied uithout t iiting en EOL
ch6racter to the deviEe/file, then CIO uiIl send €n EOL after the
l a E t l ] s e i - E U p pl i e d E h a r e c t e f .

You set the +ollouing tOCBparameteis prior to calli,ng Ctg:

COM|'IANDAYTE = $O9

B U F F E RA D D R E S S= p o i n t € . to dat€ brJffer.

B U F F E RL E N O T H= f t a r i d u . r nn u n b e t o f b t ] t e s i n b o f f e r .

The CIU alt€r'r the fol1o!,in[ IOCE taraneter €s d resolt of the

S T A T U S= r € s u l t o f P U T R E C O R Do p e r a t i o n .

OPERATINGSYSTEM CO16t95 -- Section 5


44
G E T S T A T U S- - Retuin Device-Oependent Ststus B!tes
The devire contfoller i 6 B e F t a S T A T U Sc o r n n € n d , a n d t h e
control.lei returnE four b{tes of Etatus informEtion thEt are
stor€d in DVSTAT [O2EAL

Yo[, Eet ths folIo{ring IOCDpar€neterg piior to catting CIO:


BYTE = $oD
COMMAND

B U F F E RA D D R E S S= p o i n t e r t o e d e v i c e / f i l e n € m e 6pecifiE€tion
if the IOCB is not atreadg OPEN,5ee the disEussion of the
i f t p l i e d U P E No p t i o n b e t o u .

A f t s r a e E T S T A T U So p € r € t i o n , CIO r/iIl have altered the +oI1olrino


Pefametefs:

S T A T U S= r . e s u l t o f e E T S T A T U So p e . a t i o n i see Appendir I fo.


a Iist of the po6gible Etatus codes.

D V S T A T= t h € f o u r - b g t e regponse froo the device controller.

S P E C I A L- - Specidl Function

Ang codoand bgte value greater than SOD ir treated bg CIo a9 E


s p e r i a l c a E E . S i n c e C I O d o e s n o t * n o u ,0 r h a t t h e f u n c t i o n i s , C I O
'_
tiansfers control to the device handler for complet€ proae€6ing
of the ooeration.

The uier E€tE the follouing IOCB paraoeterE prior to


c a l l i n g CI O :

COHMANDEYTE > $OD

B U F F E RA D D R E S S= p o i n t e i to a device/+ilenao€ spe.i+icetion
i.f the IOCB iE not alieedg openi Eee th€ discuEsion o+ the
implied 0PENoption belour.

Other IOCBbgteE can be set Lrp, depending !pon the 6pecific


S P E C I A L c o m m a n db e i n g p e . + o r o e d .

Afte. a S P E C I A Lo p e r . a t i o n , C I O u i l I have altered the +ollouing


paf:ttneteaB:

S T A T U S= r e s u l t o f S P E C I A Lo p e r a t i o n ; 5e€ Appendir I +or a


Iist of the posEible statuE cores_

Other bUtes csn bs €lter.ed, dependihq upon the Epecific


SPECIAL c olhftand.

O P E R A T I N eS Y S T E MC O l 6 5 3 5 - - 9ection 5
45
I o t 1 i e d O P E NO D t i o n

T h e G E T S T A T U S€ n d S P E C I A L c o m m a n d s a r e t r e a t € d s p e r i e l l t J bg CIO,
theq can uge an €l.eadg open IOCB to initiate the pr.oc€9s or th€g
can uge alr unopened IACB. If the IOCB is unopened, theh the
buffar' addre6s nust contain e pointer- to a devi€e/filenade
specification, J s s t € s f o r t h e O P E Nc o n n e n d , C I 8 | , i l l t h € n o p e n
t h a t I O C B , p e r f o r o t h e s p e c i + i e d c o m m € n da n d t h e n c t 0 6 e t h e I O C E
aga1n,

Device/Fi lenaoe Srecif isEtion

Ae pErt of the OPENEoilnend, the IOCB buffer eddregg parafieter


points to a device/+ilenefle 6p€cification, thet is a stiing o+
ATASCII rieractefg in the follotllina foroat:

< s p e c i f i c a t i o n > : | = 4 d e v i c e l f < n u n b e r > l :t . i + i l e n e o e ) l < e o 1 >

< d € v iE € ) : : = C ! D l E l K l P i R l S
{nunber} : := 1l2i3i4i5l6l7l8
<tilenane> ha6 dsvice-dependent chtsr"EcteriEtica.
<eol) ::= $98

Th€ follouiing devicB6 e?e EUpportsd at this l,!.iting:

C = Cegeette drlve
D1 throrrgh DB = FIoppg diEkette drives *
E = S c r e e n E di t o r
K = K e gb o a . d
P = 4O-tolumn or intei
P2 = 8o-colu.nn printea *
R1 through R4 = RS-23a-C int€rface6 *
S = Screen disp lag

Devices flagged bg asteiirtE (*, €re Eupported bU nonresid€nt


h a n dl e r s .

If <numbel.) is not 6Decified, it i6 sgsuoed to bs 1

The follouing exa|npleE shou, valid device/filenade specifications:

c: CasEette
D2:8DAT File "BDAT" on disk drivE *2
D: HOLD Fi1e "HULD" on disk drive *1
11: Keqboard

OPERATINC SYSTEM c o 1 6 5 5 5 - - Seetion I


46
I/B Exaop 1e

The exatrlple provided in thi! E€ction illuEtratei a EimpLe ex€mple of


' an I/O operation using th€ CIO "outine.

, This cod€ Eegnent illuEtr€tes the gimple erample of reading


, t e x t l i n e 6 ( r e r o r d s ) f r o m a d i E t e t t e f i l € n a n e d T E S T E Ro n d i s k
, dFive *1. Al1 sgmbols uEed are equated {rithin the pr.ogrein
, €ltholgh nanq of thE gqnbols are in the OS equate file.

; The progra,0 per*or s the follor!ing stepr:

1 . O p e n s t h e + i l e ' D 1 : T E S T E R '! s i n g I B C B * 3 .
?. R€ads recordg until en eiror or EOF iE reaEhed.
; 3. Close6 the file.

r I/O ECUATES
-. EOL- $98 i END OF LINE CHARACTER.
IOcA3= 93O ; 1OCB *3 AFFSET ( FRBf'l IOCB *O).

ICHID= 3O34O ; ( H A N D L E RI D - - S E T B Y C I O ) .
ICDNo= ICHID+1 ; (DEVIC€ * -- sET 8Y CIO).
ICCOT{- ICDNO+1 I COI{I{ANDBYTE-
ICSTA= ICCOtt+1 r STATUS DYTE -- SET BY CIO.
ICBAL= tCSTA+1 / EUFFER ADDRESS (LO!.,t.
ICgAH= ICBAL+1 ; BUFFER ADDRESS ( HIOII ).
- ICPTL= ICBAH+1
ICPTH= ICPTL+ 1
ICELL= ICPTH+t ; BUFFER LENeTH (LO!r).
ICBLH- ICBLL+ 1 ; BUFFER LENoTH ( HICH ).
ICAXl= ICgLH+1 ; AUX 1.
ICAX2= ICAXl+1 , AUX 2.

APEN= *O3 , OPEN COt'il'lAND.


GETREC= 3Og , GET RECORD COI'{MAND.
CLOSE- SOC , CLOSE COMMAND.

OREAD= 9O4 , OPEN DIRECTIUN = READ.


Ol.lRI T= tOE r D F E N D I R E C T I O N= N R I T E .

EOF= *AB r END OF FILE STAIUS VALUE.

CIOV= 5E456 r CIO ENTRY VECT0R ADDRESS.

, T T R S T T N T T T E L T Z ET H E I O C B F O R F I L E " O P E N " .

LDX {tIOC83 , SETUP TO ACCE9S IACB #3.

O P E R A T I N GS Y S T E | !c O 1 6 5 9 5 - - Sertion I
47
LDA IiOPEN ; SETUP oPEN COMiIAND.
STA ICCOH,X

LDA *NAr'lE , SETUP SUFFER POINTER TU ...


STA ICBAL,X ;..- P O T N TT A F I L E N A M E .
LDA *NAI.IE./256
STA ICBAH, X

LDA *OREAD ; SETUP FOR OPEN READ.


STA I C A X1 , X

LDA {aO ; CLEAR AUX ?.


STA ICAXz,X

, "OPEN" THE FI LE.

.JSR CIOV , PERFORI'I"OPEN" OPERATION.


BPL TPlo , STAIUS llAS P0SITIVE -- oK.

Jl'lP ERROR , NO -- |'OPEN" PRABLET''|.

r SETUP TO READ A RECORD.

TPlo LDA *GETREC , SETUP "CET RECORD"Cot'lt'{AND.


STA ICCOH,X

LDA *BUFF ; SETUP DATA EUFFER POINTER.


STA IC8AL, X
LDA *EVFF /25b
STA ICBAH, X

; READ REC0RDS.

LOOP LDA {*EUFFSZ i SETUP l'lAX RECARDSIZE . . .


StA ICBLL,X ;... P R I 0 R T O E V E R YR E A D .
LDA *SUFFSZ/456
gTA ICBLH, X

'rSR CIOV , READ A RECORD.


Bf'lI TPzO , MAY gE END OF FILE.

; A RECURDIS NOS, IN THE DATA SUFFER "BUFF". IT IS TERMINATEDSY

O P E R A T I N OS y S I E M C 4 1 6 5 5 5 - - geition 5
4S
; 4!-qBL CHARACTER, LENCTHrS rN "ICALL. 3nd ,,ICBLH.,.
AND THE RECORD
, THI$ EXAHPLE
urLL Da NoTHrNewrTHTHEneionp _lUii-ileu.

JMP LC]OP , READ NEXT RECORD.

; NEOATM STATUS ON READ -- CHECK FOR END OF FILE.

TP?O CPV *EOF , END 6F FILE STATUS?


BNE ERROR , NA -- ERROR.
LDA {+CLOSE ; YES -- CLOSE FILE.
sTA ICCOH,X

JSR C IOV , CLOSE THE FILE.


'Jt'tP ,! , *** END OF PROCRAH***

; DATA REEION OF €XAI.IPLE PROCRAII

NAI'|E . BYTE ,'Dt: TESTER,,,


gOL
\-7
DUFFsz= ao ; go cHARAcTERREcoRD nAx
( INCLUDESEOL'.
BUFF= * , READSUFFER.
*+EUFFSZ
. gND
Figlre g-3 An I/O Eradple

OPERATINe SYSTEi4COl6SSg -- geEtion 5


49
Device-SDecif ic Inf ormation

This section provide6 deviEe-EpeEific inforrnation regerdinq the


device hendler6 thet inter+ace to CIO.

K e q b o e r d H a n dl e r (K: )

The leqboar.d device i9 a reed ontg d€vice uith: hendle" that


supportE the +ollouinq CIO function6:

OPEN
CLOSE
EET CHARACTERS
OET RECARD
GET STATUS(oul l function)

The Kegbo€rd Handlei can Droduce the follouino error. statuEes:

$aO -- IBREAKI |(eg abort.


f88 -- end-of-tile (produred bg pressing fCTRLI 3).

The Kelbo€Fd HandleI' iE one of the re5ident handler.s. It has a


Eet of devi€e vectors 5ter.ting at location E42O.

The kegbo€rd can produce ang o+ the e96 Eodes in ths ATASCII
cheraeter 9et (Eee Appendir F). Note th€t € +e{, of the teqbo6id
kerrs do not generate data at the Kegbodrd Hsndler 1eve1. Th€se
leg6 ar.e described belou:

t/l\I - The ATARI keq toggles € +1a9 th€t en:btes/disables the


inve,'sion of bit 7 o+ each dats ch:recter r.ead. The
Sci€en Editor editing ke!s are exempted f.on glJch
i nveiE ion, hou,evel.

C A P S - T h e t C A P S , / L O W RkI e g p r o v i d e s three flnctions:

t S H I F T I t C A P S , / L O U R I- - Alphe caps 1ocft.


t C N T R L I I C A P S , / L O W R- I- Alpha ICTRLI locl.
tCAPS,/LOIIRI -- Alpha !n1ork.

I O15555 --
O P E R A T I N GS Y S T E I ' C Section 5
50
The 69Etem potrers up and {ril.1 €gEten r€6et to the alpha
c a p s l o E k o pt i o n

S o { r l e* e g c o r n b i n e t i o n ' a f e i g n o r e d b g t h e h t s n d l e r , s u c h e E
tCTRLI 4 through tCTRLI 9, ICTRLI O, tCTRLI 1, tCTRLI ,/, and
all teg combin€tions in that the tSHIFTI and tCTRLt te{r6 are
d e p r e s s e d s i m u l t e n e o u sl g .

The ICTRLI 3 keg generateE dn EOL Ehar.actei and r.eturng EOF statu6.

The IBREAKI teg gener€teE en EOL Eha?aEter €nd retur.ns BREAKststuE.

CIO Function DeEcriptions

T h e d e v i E e - r p e c i +i c r h a r a c t e r i 6 t i € E of the Etandard CIO functions


(descr'ibed earliea in this seation) ere deta i Ied belou:
OPEN

The device neDe is K, and th€ handlei iqnoreE ang device nlmber
and fileneme speci+ication, i+ inal!dad.
Theta er.e no device-depandent option bits in AUX1or,AUXA.

No rpeciel handl.er aationE.

eET CHARACTERS
and eET RECORD

The handler retrrn6 the ATA$CII keg codes to CIO as theg €re
enter.ed, uith no faciliiq foi editing.

OET STATUS

The handler doee nothing but set the stetus to $Ol_

T h e o r g o f O pe r a t i o n

Pre55in9 a legboaad leg generates an IRO interrupt and vectorE to


th€ Kegboard Handler.s i.nterrupt ser.vice Foutin€ (Eee Section 6).
The leq Eode for the keU pressed is then read and Etor.ed in ctata
bdte vErieble CH lOAFCl. Thi.s oc€ur€ uhether or not there r,E en
active read requeit to th€ K€gbo€rd Handler, end effects a one-bqts
FIFO for teqboard entrq. See App€ndir L (EE) for s discu!6ion of
the auto iep€at festurE.

OPERATTNCSYSTEM C416555 -- Section s


The Kegboerd Handler monito.6 the CH vaiiable for not aontaining
t h e v a l u e $ F F ( e m p t r Js t € t e ) u h e n e v e r t h e r e i F a n a c t i v e r e a d
request for the handler. WhenCH Bhous nonemPtg, the handle.
tales the keg code fron CH snd Eets CH to $FF again. The lerl code
bute obtained from CH is not an ATASCII code and has the
fo I Io|lJing +orm:

o
+-+-+-+-+-+-+-+-+
l Ci S i k e g c o d e I
+-+-+-+-+-t-+-+-+

[ , l h e r e r C = 1 i f t h s C C T R L ]k e g i s p i e s s e d .
S = 1 i.f the ISHIFTI keg is preEred.

The rarnaining Eix bit6 are the hardqrare ketj code.

The leV code obteined is th€n converted to ATASCII using the


SirEt o+ the follo{ring rules that applies:

1. Ignoie the code if the C €nd S bits are both set.


2. IS the C bit is setl proces5 the fte{ €6 a ICTRL] code.
3. If the S bit is Eet, proce5s ihe keg aE e tSHtFTl code.
4. If CCTRLIIorft iE in e+fect, proceEs alphs rharacters es CTRL
codeE, all other6 aE lE(,ercase.
5. IF tSHtFTl lor& i6 i'| effect, proceiE alpha chareEterE as SHIFT
aodes, all other.E €E louetcage.
6, Else, proEe6s as 1o{refcase rharacter,

Then: I+ the resultant code i6 not a ScrEEn Editor Eontrot code,


and iS the video inveree tlag is set, then Eet bit 7 of the
ATASCII code (uill €eu6e inver.se video {rhen diBpla{ed)

O P E R A T I N GS Y S T E MC O 1 6 5 5 5 - - Section 5
KEY CODE TO ATASCTI CONVERSIONTABLE

Keg KeV L'/r. ISHIFTI ICTRLI Keg Ke! Lt r. SHIFT CTRL


Code Cap C€se C o d e c€P Ca€e
o o L 6 C 4C OC ?o 2e 58 00
0 1 J 6 A 4A OA 20 eo
O ? ; 3 8
:1 '_: 22
N
5D 60
o4
0 5 K 6 8 4E OB t't ,: 4D
0 6 + e B 5C 1E ::
0 7 + e A /i\
O B O 6 F 4F OF aa
::
O A P T O 50 10 2A ; 45 ;;
o B u T s 55 15 59 19
OC REI 9F 98 9B TAB
O D I 6 9 49 09 T 54
O E - ? D t4 67 17
O F = 3 D 7C 1D 71 51
10 v 76 30
Lt :: !:_ 39
1 ? C 6 3 43 03 ;- 30 29
33 7
14 34 8ACKS 7E 9C FE
15 B 62 35 E 38 40
1 6 x 7 8 1B 36 3C 7D 7D
t 7 z 7 A ) 3E 9D FF
1 9 4 3 4 3B 6& 46 06
1g 39 H 6e 4S OB
1A 3 33 3A
18 6 36 ?6
98*
3E 3_ 44 44 04

1C C E S C T1 S 1B 3C CAPs - -
1 D 5 3 5 3D 67 47 07
l E 2 3 2 3E s 73 53 13
lF 1 31 ?L 61 41 01
* ICTRLI 3 returns EOF 6tetuE.

A c o t h p l e t n e n to f t h i g table (AIASCII to kegstroke) is qiven in


A pp e n d i r F .

Figur'e 5-4 Kegcode to ATASCII Conversion TabIe

O P E R A T I N OS Y S T E MC U 1 6 5 9 3 - - Section 5
Displag HandI€r (S: l

The displag devi..e !5 a reed/{f ite device uith a h€nd1er.


t h E t E u p p o tt s t h e f o l l o r r i n g C I 0 S u n c t i o n e :

OPEN

GET CHARACTERS
EET RECORD
FUT CHARACTERS
PUT RECARD
e E T S T A T U S( n u 1 l + u n c t i o n '
ORAW
FILL

The DiEplag Handlcr Ean produce the fo11ouin9 erfor EtatuseE:

S84 -- lnv€1id Epeci€l comftand.


sBD -- CurEor out-o f-reng e.
1 8 9 1- - Screen mod6 > 11
$93 -- N o t e n o u g h m e m o ? gf o r s c r e e n f i o d e E e l e c t e d .

The DisplE,J Handler iE one of the iesident handIerg, and


ther'efore has a 5et of devire vector'9 gtertino at locetion E41O.

S c r e e n l ' l o de 6

You can operate the di6pl€g screen in ang of ?O


configuaEtions (ftodes 1 through 8, r/ith or 0rithout split
screen; plus mode O, and modes 9 th?ouqh 11 '!ithout split
scr.een). tlode O is the text displaging mode. Hodes 1 thiough
1 1 a r e a l 1 g r e p h i c s n o d e s ( € l t h o l g h m o d s sa a n d 3 d o d i s p t a g a
subset of the ATASCII charecter set). Mod€s 9 through 11
req!iie e CTIA chit to be inEtts11ed in plEce o+ the standard
CTIA chip.

TEXT I'IODE O

In taxt node O the Erteeh is comprised of 24 Line6 oS 40


chare€ters per 1ine. Ptogian alterable left €nd l.ight ftargins
lirnit the dieplau afea. Th€g defat]1t to 2 and 3? {of a poEeible O

,IO16555 --
O P E R A T I N OS Y S T E T C Section 5
54
A pi09iam-qontfollable EUrEor shoos the destinetion of the nert
charactet to be output onto the gcieen. The curEot is visible a6
the inverEe video representetion of the current cheract€r. €t the
destinati on poEition.

The text gcreen deta is internallg organi!ed :s v€riable length


l o g i E a l l i n e s . T h e i n t e r n a t r e p r . e E e n t : t i o n i s e 4 I i n e s o r h e nt h e
s c i e e n i 6 c l e a r e d . E e e h E O L m a r . k Et h e e n d o f a l o g i c a l l i n e € s
text iE sent to the screen. If oo.e than g phlrsical lineE of text
are Eent, a logical line uill be forfled evert, A phqsicel lines.
The,number of phgsical lines used to cooprisi a iogicat line (1
to 3) iE aluags the minimuo required to hold the data for thet
logirat ! ine.

T h e t e x t g r r e e n ' r i a r - o l l s , , u p t r r € r du h e n e v € r € t e x t l i n e a t t h e
bottoanroa, of the screen extendB pest thsr'ight m€rgi.n, or a text
1in€ at the bottom rou is terninated bt, an EOL. Scrillrng removes
the entire logiEEI line that st€i,ts et the top o+ the screen, and
then noves €11 subEequent lineg uFU€rd to fill io the void. The
cur.9or al.so noves upuard, if th€ logiE€l line deI€ted exceeds one
phgsicel I ine.

AII_dsta going to or eonir|g +rom thE tert screen iE represente.,


in €}-bit ATASCII code eE 6houn in Agoendir E.

TEXT HOD€S 1 AND 2

In text ftode6 1 €nd Z the 6creEn co{rpri3€s either 24 lines of 20


characters (|node 11, or. 12 lines o f 2 0 c h a r a c t e F F ( r o o d e2 ) . T h e
left and iight nEpging are o* no con9€q{Jenre in th€6e nodes and
there is no visible csr5or. lheie e r e n o I o g i E e I I i n e s e 6 s o ci a t e d
rrith the dEta and in all tegerds thege flodes ere tfeBted aE
9 r ' s p h i c a | n o d e 6b g t h € h € n d l e r .
Dat€ going to or coning +rom the screen is in the form shoun
bElou'

o
+-+-.i-+-+-+_+_+_+
i c t D l
+-+-+_+_+_+_+_+_+

l ^ l h a . eC
: is the color/character-set Eelect fi€1d

O P E R A T I N eS Y S T E I IC O 1 6 S 5 9 - - gection s
55
CoIor Character Char.acter
Value (defaultl Registel. Set
(see CHBAS=SEO CHEAS=3E?
A pFe n d i x
H)

0 ( PF1 ) t - '] IHEART] TARROI.J]


9feen
1 gold (PFO) ? THEART] TARROI.I]
gold (PFO) e - TD I AI1OND
] TTRIANOLE ]
3 gi.een (FF1) TD I AI1OND
] TTR IANGLE ]
red (PF3) ! - t IHEART] IARROT^' 1
J blue (PF?} t - tHEARTI tARRO(ll
6 blue (PF2 } e - tD IAHOND] I TRIANCLE1
7 real t ! - I DI AMOND] I TRIANGLE]

D i s a 5 - b i t t r u n c a t e d A T A S C I I c o d e t h a t s € l e c t 6 t h e s p e ci f i c
Eh€racte. uithin the Est selected bg the C field. see AppendixE
for the giaphics repre6entations of the chafactsas,

D a t a b a e e v e r i a b l € C H B A Sl O 2 F 4 l a l l 0 ! 1 6 f o ! . t h e E e l e c t i o n o f
either of t{ro data Eets. The default vatue of +EO provides the
capit€l I€tterE, number6 €nd punctuation charecterE; the
tslternate value o+ 382 provides lourercsse letter6 ind the sDeaial
c h e r e E t e i g r a p hi c s s et .

Figure 5-5 Tert ilodes 1 End 2 Deta Forn

C R A P H I C SI I O D E S ( H o d e s 3 T h r o u g h 1 1 )

The 6creeh ha5 v€rging phgsical €h€rtscteriEtica foi each of the


g t € p h i c a | n D d e Ea s s h o u n i n A p p e n d i x H . D E p e n d i n q u p o n t h e n o d e ,
1to 16 color' 6€lection iE aveil€b1e for each pirel and the
Ecteen 9ize varies from 20 bq le (lone6t reiolrJtion) to 3AO bq
192 (highest resolut ion) pirels.

There is no visible curso? for the graphics mod€ output.

D a t a g o i n g t o o r c o n i n q f r o f t t h e g r € p h i c s 6cr e e n i E r e p r e s e n t e d
as I to B-bit c o d e s e 9 s h o u n i n A p p e n d i r H e n d i n the CET/PUT
d iagr€m6 f ol lot!ing.

SPLIT_SCREEN CONFIGURATIONS

In spli.t-scr€en configrrr.ations, the bottom o+ the Brr.een iE


resetveit +or four lines o{ mode O text. The tert aeoion is
controlled bq the Scresn Editor, and the graphiEs "igronr't
c o n t r o l l s d b r J t h e D i E p I a q h s n d l e r . T u r oc u r E o r s a r . e n a i n t a i n e d i n
this configuration so thst the Ecreen segments cen be managed
independentlrJ.

O P E R A T I N eS Y S T E MC O 1 6 5 5 5 - - $ection 5
56
To operate if| split'scfeen mode, the Screen Editor n!9t +irst be
opened and th€n the Displeg HandIe" nuEt be opened using a
s e p a . a t e I O C B ( u i t h t h e s r l i t - 6 c r e e | 1 o D t i o n b i t s e t i n A U X l) .

CIO Function DeEcription6

The device-6pecific Eher.€cteristicE of the stendsrd CIO functions


(deB€ribedea"Ii€r in this section) are deteiled belou:

OPEN

T h e d e v i c e n a n e i 9 S , a n d t h e h e n d l e r i g n o r e s e n g d e v i c E n u | l l b e rE n l
f i l e n a m €s p e c i f i c a t i o n , i? included.

The handler supports the follouring optioni:

7
+-+-+-+-+-+-+-+-+
AUX1 r icrgt{,,lrRt r
+-+-+-+-+-+-+-+-+

Where: C r 1 indicate6 to inhibit sii€€n .lear on OPEN.


S = 1 indicEtes to set up a split-6creen configuration (for
oodeslth rolghIonlq).
R a n d { ^ ,a r e t h e di?ection bits (read €nd urite).

7 o
+-+-+-+-+-+-+-+-+
AUXa i I mode !
+-+-+-+-+-+-+-+-+

Where: node i5 the scr€en mode (O ihrough 11,.

- Note: If the Ecreen ode se!€cted iE O, then the AUX1C and


S o p t i o n 6 a T e € E 6 u m € dt o b e O .

You 6hare menorq utiliretion uith the Displaq Handler


inforfletion. Shering is neceEs€?gbecause the DiEpleg Handler
d g n a m i c € 1 1 9€ 1 1 o c a t € 6 h i g h s d d r e s s m e n o r ! f o r u E e i n g e n e r a t i n g
t h e E 6 r . e e nd i s p l a g , e f l d b e c a u 5 e d i t + e i e n t t s o o u n t s o f m e n o r g a ? e
n e e d e d f o r t h e d i f + e r e n t s c r e e n { r l o d € s .P r i o l . t o i n i t i s t i n g an
O P E N c o . n n € h d t h e v a r i a b l e A P P t ' l H It O O O E I s h o u l d t o n t a i n t h e
h i q h e 6 t a d d r e 6 E o f R A MU o u n e e d . T h e S c r e e n h 8 n d l € i
uill opefl the E.reen onlu if no RAMis needed at or beldu that
acdie6E.

Upon ret{rrn fl'o'n: EEreen UPEN, the veriable I " I E M I O Pt O A E S I ' l , i l l


contein the address o+ the ltsst free bgte €t the end of RAH
menorg priof to the screen-rsquiaed menorg.

S F E R A T I N OS Y S T E MC O 1 6 5 9 5 - - Section 5
A s a i ' e s u l t o { e v e r q O P E Ne o m m a n d ,t h e f o l l o r ! i n g Ecreen vari€b1es
ere elter.ed:

T h € t e x t c o r G o r i s e n a b l e d ( C R S I N H= O r . T h e t a b s a r s s e t t o
the defeult settings (a end 39). The coIo. registe.E are sef,
to the default vBIues (9houn in Appendix H).

Tab6 or.e set at poiition! 2,15,A3,jr.,3q,


4 7 , 5 5 3 56,3 , 7 L 7 9 , e 7 , 9 3 , 1 0 3 , 1 1 r , 1 r 9 .

N o s p e ci a 1 h a n d l e r a . t i o n s .

CET CHARACTERSand GET RECORD

Returns data in the +o11o{ringEcreen node dependent +orms, uher€


eech b{te cohteins the dat€ for ofle cursor poiition (pixel); th€re
is no f€cilitq fot heving the hsndler r€turn pacted graphicr d€ta.

7
+-+-+-+-+-+-+-+-+
I ATASCII i l.lode O
.t-+-+-+-+-+-+-+-+

+-+-+-+-+-+-+-+-+
I C ! D I f , l o d e s1 , e - - C = .olor/data
+-+-+-+-+-+-+-+-+ set.

D = trun.ated AIASCIL
+-+-+-+-+-+-+-+-+
I rero tDl M o d e s9 , S , 7 - - D = color.
+-+-+-+-+-+_+_+_+

+-+-+-+-+-+-+-+-+
I zsro iD[ M o d e s4 , 6 , 9 - - D = co1of.
+-+-+-+-+-+-+-+-+

+-+-+-+-+-+-+-+-+
i zeio i D i Modeg9,10,11 -- D = dtsta.
+-+-+-+-+-+-+-+-+

Figuie 5-6 craphi.is Mode 3-11 6ET D€tts Foim

The cut5or ftoves to the next po6ition a5 erch data bqte ig


retuinad. Fo. mode O, the cur.sor urill stag uithin the 6pecified
ma.gins; for aIl other oodes, the curror ignore6 the margins.

I O16555 --
O F E R A I I N OS Y S T E I ' C Section 5
5A
PUf CHARACIERS End PUT RECt]RD

. Tha handle!' accepts diEpleg data in the follo0ring sEre€n ode


dependent fotns; theie i9 no facilitq for thE handler to receive
graphics data in packed form.

o
+-+-+-+-+-+-+-+-+
i ATASCII i Mdde O
+-+-+-+-+-+-+-+-+

+-+-+-+-+-+-+-+-+
I C i D I M o d e s1 , 2 - - C. coloi/date
+-+-+-+-+-+-+-+-+ se t,
D = truncated A T A S CI L
+-.ti_+_+_+_+_+-+_+
i ? iDl 6,1,7 --D
l,lode3 = color.
+-+-+-+-+-+-+-+-+

+-+-+-+-+-+-+-+-+
| 2 iDl l ' l o d e E4 , 6 , 8 -- D = color.
+-+-+-+-+-+-+-+-+

+-.i-+-+_+*+-+-+-+
| ? i D i t{odes 9, 10, 11 -- D = d€ts.
+-+-+-+-+-+-+-+-+

Figlre 5-7 craphics Mode 3-11 pUT Data For'rn

NOTE: For. all ftod€s, i+ the output deta bgte equats T9B (EOL), that
bgte {rrill be ti.eEt€d aE sn EOL chara{t€r'; end i+ the output
dsta brtte equals $7D (CLEAR) that bqt€ oilI be tr€at€d as a
\-- 9treen-E leaf char'atter.

The csigor ooves to the ne*t curEor posltion dE each deta bqte iE
t t l ' i t t e n . F o r o r o d eO , t h e c u ! ' s o r u i 1 1 s t a g u i t h i n t h e E p e c i f i e d
oargin9, +oa all other mod€s, the curgor ignores the tnar.gins.

tlhilr o!tputting, the Displeg Handler monitore the kegboErd to


deteEt the pre66ing of the ICTRLI 1 tetj combination. l{hen this
occuie, the h.ndler loops inte.naltg until thdt fte{ combinEtion
is presEed again: ThiE eff€cts a stot/3tsi,t +unction that
freezas the Ec.e€n displaV. Note that there is no ATASCII Eode
asEo.ieted uith €ithei the tCTRLI 1 l€! rombination or the
steit/stop function. The stop/star.t funrtion can be control led
onlg +|.oo the teVboerd (or bg altering dat€baEe variable CH €s
diEtug6ed in Appendix L, E4r.

UPERATINCSYSTEM C016555 -- Section 5


59
CET STATUS

No handle? €ction ex.ept to set the statuE to t01.

DRAW

T h i s s p e c i a l c o m n e n dd r a u 6 e s i f t u l e t e d " s t T a i g h t r ' l i n e f t o n t h e
turrent curEor position to the location speci+ied in ROl.lCRs
t o 0 5 4 l a n d C O L C R SE O O s s I . I h e c o l o r o + t h e l i n e i 6 t € k e n f i o m t h e
laEt char€cter procesEed bq the Displ.aq H6ndler oF Screen Editor'.
T o f o r c e t h e c o l o r , s t o r e t h e d e s i i e d v € l u e i n A T A C H RI O Z F B l . A t
the co$pletion of the cofim€nd,the cursoi uill be at the location
specified 69 ROWCRS €nd CoLCRS.

Ihe v€lue for the cofioand bute for D R A Wi E $ 1 1 .

FI LL

T h i s s p e c i a l c o f t m € n d+ i l ! 9 a n ere8 of the s€reen defined bg turo


lines 'rith e speEi+ied coloi. T h e c o m o a n d i s E e t u p t h e s e . n ea 6
in DRAtr,but E6 eech point of the line i5 dreurn, the r.outirie
scans to the right performing the pioced!re Eholrnbelou (in
P A S C A Ln o t E t i o n ) :

WHILE PIXEL fRolr,COLI = o DO


EEOIN
PIXEL tRolt, COLI := FILDAT,
COL := COL + 1i
I F C O L ) S c r e e n r i g h t e d g e T H E NC O L : = 0
END;

An exemple of a FILL op€r€tion is ghoon belon:

+ 1

+-------------------------------+
4 +-----------------------------+
+
+ 2

Where: '-' iepiesent6 the fill operation.


'+' are the line point6, uith '+/ for. the endpointg.

1-- set cui5or and plot point.


2 -- set cursor and DRAII 1i.ne.
3 -- 6et cureor end plot point.
4 _- :et +i11 datE velus, set cur.so!., and FILL.

O P E R A T I N GS Y S T E HC O l 6 5 5 5 - - Section 5
60
FILDAT IOAFDI containe th€ fitl d 6 t a , a n d R O I , C R Sa n d C O L C R S
contein the EUrsor coor.dinetes of the tine endqoint. Th€ vdlu€
i n A T A C H Rt O z F B l { r i l t b e u s e d t o d r a u t h e t i n E ; A T A C H Ra l u a q s
conteinE the I€st datE read or ur?itten, so if the st€p9 above
a r e f o l l o o r e d e x a a t l . g , A T A C H Ru i l t n o t h e v e t o b e r n o d i f i e d .

The value for the cofloand brJte +or FILL is S12.

User-AI tersb 1e Dat€ Bsse V€riables

Ceitain funrtions of the DiEpIsg Handler reqoire gou to


etemine and/or alter veritsbles in the OS dstabase. The follouinq
describer softe of the more corl.nonlg u6ed hsndl€r' vatiables. (Eee
Appendir L, B1-55. for eddition€t desEriptione).

Cursoa Po6ition

Tto ver.iableE neintain the cursor positi.on for the grEphics


E c r e e n o r | n o d e 0 t e r t E c r e e n . R O I I C R Sf O O 5 4 1 | | | a i n t a i n 6 t h e d i s p l a q
r o { , n l n b e r i e n d C O L C R St o o s 5 l l n a i h t a i n s t h e . t i E p l a g c o l u m n
number. Both nunbers rEnge from O to the rnexinum nunrber o+
t o r r r s / c o I u | n n s ,- 1 . T h e c u . s o r c a n b e s e t o u t s i d e o f t h e d e f i n e d
text margine {rith no i11 e+f€ct. Yorrcen read and urri.te thi
r e g i o n . T h e h o | n e p o s i t i o n ( O ,O ) + o r b o t h t e x t € n d g r a p h i c a i E t h e
uppea le+t corner of the 6creen.

R O W C R iS6 € 6 i n g 1 € b g t e . C O L C R Si 6 aintEined €t e-b!tes, !rith


the leaEt Eignificant bqte being at th€ lo|lrer add.e€8.

llhen gou alter. the6e varieble5, the Ecresn repreEentetion


of the cursor uill not novs untit the next I/O oDeretion
involving the di5pla'J is perfoimed.

I n h i b i t . / E n a bl e V i s i b l e Cursoi DiEFt€g

You can inhibit the displeq o+ the text rursol' on the sEreen
bg 6ettiflg the vBriebls CRSINH tO2FOl to ang nonzer.o v€Iue.
Subsequent I/O u,ill not generate a vi5ible cul'sot'.

You can enable the diEptag of the text cur5or bq s€tting


C R S I N Ht o z e r o . S u b 6 e q u e n t L / O u i l l then g€ner€te a visible
c ul.90f ,

T e x t M a r gi n s

The text 6.regn has ure?-elterable left €nd right ftar.9ihs. The OS
6ets these otsrging to e and 39. The vari€ble LI,IARGN tooszl
d e f i n e E t h E l s f t o a r g i n , a n d t h e v a r i a b l e R H A R C NE O O 5 3 l d e f i n e s
the right margln. The leftmost ftal"gin v€1{re is O and the

O P E R A T I N GS Y S T E f {C 4 1 6 5 5 5 - - Section 5
6L
right,noEt oargin value is 39.

The rnargin veluei inclusivelg define the useeble pol.tion of the


iicreen *or all operations in that gou do not erplicitl!
elter the cursor. location vaiiableE e6 described pr.ior to thig
paregreph.

C ol o r Contio1

The OS !pdates ha.duare color ?egiste|'s uEing data from the OS


d a t a b e 6 E a E p a r t o f n o r m a l S t a g € 2 V E L A N Kp r o c e s s i n g ( 6 e e S E t t i o n
6). Sho{rn bel.ou are the data bage var'iab1e na es, fhe ha!.drlj€re
regigt€? naoes, and the funEtion of each regiEter. See Appendix H
for' the mode dep6ndent uses +or the reqiEter.s.

Date Base Hardurere F u n ct i o n

COLORO CoLPFO PFO -- Plaufield O.


COLOR1 COLPF1 PF1 -- Plagfield 1.
COLOR? CALPF2 PFA -- Pl.agfield e.
COLOR3 COLPF3 PF3 -- Platfiald 3.
COLOR4 COLAK AAK -- Pleqfield bactg.ound.

PCOLRO COLPI{O P l , l O- - PlarJer/mi56ile O.


PCOLR1 COLPMI PH1 -- Pl€qer/mi6si1e 1
PCOLR2 cOLPt'l2 PH2 -- Plsrte./mis6i1e 2.
PCALR3 CALPM3 P l ' 1 3- - Plauer/miEsile 3

Theorg o+ Bpeiation

I h e D i s p l a g H a n d l e r a u t o r n a t i c a l l g s e t s u p a l l { n e m o r qr e E o u r c e s
r e q u i r e d t o c r € € t e a n d m a i n t a i n t h e 5 . r e e n d i E p l 6 q a t U P E Nt i m e .
The Ecreen genaration hardu:re requires that tlro di6tinEt data
areas etist fo. graphica modeE: 1) e displeg list end 2) a
screen data l.egion. A third d€ta aree must erist for text mode5.
This d€ta erea defines the Ecreen reprssentation foi ea.h gf the
t e x t € h a t ' a c t e r E . C o n E U l t t h e A T A R I H o r n eC o r n p u t e r
H a r . d u a l . el , l a n u a l f o r a c o n p l e t e u n d e r s t a n d i n g o + t h e n a t e f i a l thet
iE to fo I I orr.

O P E R A T I N CS Y S T E MC 0 1 6 5 5 5 - - Section 5
62
' The sidrplified block diagram beldur shorrethe reletionship6
betueen the neoor.g and h€id(ll€ie regiEte.s used to eet up e screen
di6plBg (urithort plaqer,/missile g?ephicE) bg the US Note that
the herdtare r.egiEter6 Ellot|, foi neng other possibilitie6.

DATA EASE HARDWARE


VARIAgLE RFGISTER
(Updated ever.q
VBLANK}
+----------+
I t'{El,,tTOP I
+

+---+------+
+---------------+

+---+-+-------+ +----------+ +-----_---+


I Di6plaq il SDLSTL i I DLISTL !
: List i + +----->+
= ! SDLSTH | | DLISTH !
t l i i !
+----------_-_+ +-----_____+ +_____-___+
i
i +----------+
Screen DatE l<-- SAVIISC I

Graphics
end/or +----------+
Tert
+-------------+
End o+ RAI'!nslno.r'g

+----------+ +---------+ :
I CHBAS=EOl--->l CHBASE +------
+---------+
+------+------+
! 9pe. ia IE andl EOOO
I Nu$bers !

I C a pi t a 1 | E1OO
! Letters I
i-------------+
! Special I EzOO
! G r a ph i E s I
+-------------+
I Lot eicase I ESOO
i Letterg I

OPERATTNOSYSTE|.ICO16555 -- Section 5
63
+---------+
icoLaRo i I cuLPFo I
= =--) I COLPFT !
i c o L o R1 i r cuLPF2 |
tcoLoR2 i i coLPF3 r
icoLoR3 i i coLBK I
ICOLOR4 i +---------+

Figu.e 5-8 Scr.eenDispl8g Block Diagram

The follo0ring retetionships are pregent in the preceding di€graft:

l' O a t a b e E e v € r i e b l e s S D L S T L / S D L S T Hr o n t € i n t h e a d d r e E B o f
the current displeg 1ist. ThiE eddr€es is 6t6ied in the
herduere displeq liEt add.ess regiitErE DLISTL and DLISTH
a s p a r t o f t h e V B L A N Kp r o c e s s .

2. The displaq li6t itEelf defines the characteristiEF of the


9cr'een to be displaged and points to the neinorg containing
the deta to be displa{ed.

3. D a t e b a 6 e v a r i a b l e C H B A S€ o n t e i n s t h e H S D o f t h e b a s e a d d r e s E
o+ the charecter represent€tions +or the charactei date (text
m o d e so n l u l .

The default value foi thiE v€riable is tEO. This vari€ble


declaies that the character rep?esentations start at nemorq
a d d r € € E € O O O ( t h e i h a r € E t e r E e t p r o v i d e d b { t h e O S i n R O I ')I.
Each character iE defined as 6n 8Xg bit (natrix, requiring B
butes per tharEcter. 10?4 bgt€s are rEquired to define the
large5t Eet, since a charecter code contain6 up to 7
eignificEnt b i t E ( s e t o f 1 e g c h a r a c t e r E ' . T h e O S R O I ' Ic o n t a i n 6
the defsult s e t i n t h e r . e q i o n f r o m E O O Ot o E 3 F F .

A11 chal'Erter codes tsie converted bg the handler from ATASCII


to en inter.nal code (and viEe ver6a), 6E Eholrnbelou:

ATASCI I INTERNAL
coDE cooE
oo-lF 40-5F
20-3F O0- 1F
40-5F 2C-3F
60-7F 60-7F
AO-9F CO-DF
AO-BF BO.9F
CO-DF AO_SF

O P E R A T I N eS Y S T E I 1C 8 1 6 5 5 5 - - Section 5
T h e c h a r a c t e l s e t i n R U t ' li 5 o t d e r ' e d b g i n t e r n a l code order. Thr€e
consider.ations di+feI'entiate the internel Eode frodr the exteanal
(ATASCII) code:

ATASCII codeg +or. ell but the speciel grephics EherscterE uet's to
be si,mitar to ASCII. The alphabetic, numeri.c, :nd punEtuation
char€cter codes |rre identical to ASCII.

In text mode6 l and e it usE desired thet one cheracter qubset


include capit€l letters, nirnbets, €nd punctuation and the other'
c h € r € ct e . s u b s e t i n c l L r d e l o u e r c a E e 1 € t t e r E a n d G p 6 c i a I g ? a p h i E E
chErEcters,

T h e c o d e E f o r . t h € E € p i t a l and IourerEeie letters uefe to be


i d e n t i € a l i n t e r t | n o d € s 1 and e.

D E t a b a s e v a r i a b l e E C O L O R Ot h r o u q h C O L O R 4r o n t E i n t h e c u r i e n t
color regiiter a s 6 i 9 f l l n e n t E , H € r d 0 r B r Ec o l o r r e g i s t e r s r e E e i v e
t h e g e v t s 1 u € 6 € E p a r t o f t h e s t e q e 1 V B L A N Kp r o c e s s ? t h u 6
providing 5gnchroni:ed eoloi ch€nge6 (see ApPendir H).

Databage v€r iab I € SAVHSC p o i n t E t o t h e I o u e s t m e m o r g a d d f e s 6 0 f


t h e i c r e e n d a t a r e g i o n . I t c o r r e E po n d g t o t h e d a t e d i s p l a q e d a t
the uooer Ieft coaner o+ the displag.

l r h e n t h e D i 6 p l e g H a n d l e r r e c e i v e 6 a n o p e n c o m m e n d ,i t f i r . i t
determinsE the Ecreen node tl.om the oPEN IOCB. Tien it alloc€teE
me oiU frofi the end of RAf'ldountard (as specified bq date ba5€
v € r ' i B b l e R A M T O P ) ,f i r E t $ o r t h e g c r e e n d€te and then for the
displaq 1i6t. lhe scl'een date region iE cleBred and the diEplag
list is €r€ated if sufficient memor{ is available. The displag
list addre5r is stoi'ed to the databaEe.

OPERATINOSYSIE}'{ C916555 -- gertion 5


S c i e e n E di t o r ' ( E : )

The 9creen Edit01. iE a read/uiite hendler thet uses the Kegboetd


Handler and the Di6pIag H a n d l e r t o piovide "line_at-a-time" input
{rith inte?srtive editinq functions, e E u e l l a s f o r m a t t e d o u t p ut

The Scteen Editor 6upports the follouing CIO +unctionE

OPEN

CET CHARACTERS
GET RECORD
PUT CHARACTERS
PUT RECORD
O E T S T A T U S( n u 1 1 f u n c t i o n )

S e e K e q b o a r d H a n d I e P a n d D i E p I e g H e n dl e r ' S e c t i o n E for
d i 6 c u g s i o n o f S cr e e n Ed i tor eiror stat{J9e5.

The Screen Editot' i5 one of the resident htsndlerE, and


therefore hes a 6et o+ device vectors staiting €t location
E400.

The screen Editor i.s a program thet ?ead6 keq dsta fI.om the
Kegboard Handler and sends each chsracter to the Di5pleg Handler
for' immediate diBpIag- The SciEen Editor' 315o acteptE data fr'om
g o r . ,t o s e n d t o t h e D i s p l a g H e n d l e r , a n d r e a d E d e t € f r d l n t h e
D i E g l a r j H a n d l e r ( n o t t h e K e { r b o t s r dH a n d l e r ) f o r q o o . I n f a c t ,
the !{eVbo€rdHandler, Displ€q Handler, end the Screen Editor a?e
al1 cont€ined in one monolithic hunk of code

l.{ost o+ the behavior6 elreadq de+ined for thE Kegbo€rd Handler


and the Di6ptag Handler applg eE u,ell to the Screen Editar: The
discuEEions in this Section ui11 be lilnited to dsviation6 fion
those behaviors, or to additional +e;ltures that aI.e part of the
Screen Editoi ontg. The SEreen Editoi dea15 onlg uith tert data
( g c r e e n m o d eO ' . T h i s S e € t i o n a 1 5 o e x p l a i n s t h e 6 P l i t - E € r e e n
E o n +i g u r a t i o n f e a t u r e .

T h e S c 1 . e e nE d i t o r u t e E t h e D i E P I a g H e n d l e r t o f e e d d a t a f l . o m
grephics €nd text sE.eens oi demend. You !5e the Screen
iditor t o d e t e ! ' n i n e u h e n t h e p r " o g i a t n! J i l 1 r e a d S c r e e n d a t € , e n d
urhete upon the E€r'eenthe deta llrill be read fron. Yot
+irst loc€teE the cui6or on the 6creen to detsrnine the 5creefl
a r e a t o b e r e a d , g o ! t h e n p r e s s t h e t R E T U R N Ik e g f , o d o t e i f l i n e
uhen the piogfem urill begin to r€ad the data indicated'

O P E R A T I N GS Y S T E Hc O 1 6 5 9 5 - - SeEtion I
66
t R E T U R NkI e g i s p r e s E e d , t h e e n t i i . e t o g i c e t l i n e G , i t h i n
Il nl :el t !t hl tE"
curEor .eEides is then made av€ilsble io the calling
program: Tt.ailing blenks in a logi.c€l line
are never returned a6
dat€, ho{rever. After. a1l of the data in the line
haE been sent to
th€ Ealler (thi6 Edn ent€il $ultiple R E A DC H A R t a T i i i i u n c t i o n s i f
de6ir€d), an EOL char€€ter is returned anO the iursor
positioned to the b€qinning of the Iogic€I rE
line foliouing the one
JUSt r.ead.

CIO F0nction Descriptions

The device-gp€cific characteristics of ths st€ndaid CID


functions are detai led belou:

OPEN

The devire nade is E, and t h e S c r ' e e n E d i t o r


ignores €ng
devi.re nutnber and {ilename s p e c i + i c e t i o n , i +
included
The Screen Editor s u p F o r t s t h e + oI l o u i n g o p t i o n :

7 o
+-+-+-+_+_+-+_+_+
AUXl i it,iRl iFi
+-+-+-+-+-+-+-+-+

l,lhere: R and W are the d i r e c t i o n b i t s ( r € € d


and {,rite).
F = 1 ind icBtes that a iforc€d read,, i6 desired (see
OET
CHARACTERa n d c E T R E C O R D+ o r o o r e i n f o r m s t i o h ' -

cLosE
No speciel handler actions.

eET CHARACTEREnd GET RECORD

l:11,.-It,l th€ S.r.een Editor {,ri1l r.eturn data onlq uhen gou p!.esE the
tRETURNI tes €t the |teuboard. Houever, th. "+;;;*;
allous gou to read teri data uithout rnt;;""n;;;;. ;;"d,, opEN oprion
READ-op.retion, the Screen Ediror u,ili .;;;;;";;;. t r i i . , , J o u c o d x o a n ua
the Iogical tine in orhich the tert cursor i r i, "n. start of
is Iocsted, €nd then
tnovethe cursor to the beginning of
the follorrring logicaf line. A
read o* the l€st logic€1 iine on the screen
oriIl cau6e rhe Ecreen
data to scl dl.1.

A 6pecial case occurg rlhen cheraEter'6


eie output uithout e
t€rni na t i.ng EeL, and t h e n a d d i t i o n a l
cheracter.s €re appended to
T]PERATINCSYSTEM CO16555 - - Section 5
t h € t l o g i c e l l i n e f r o o t h e k e g b o a ' . d . t r h e n t h e I R E T U R N ]t e q i s
preEEed, onl{ the teqboard entered cha.ecters are sent to the
.aller, uniesE the curEor hes been ooved out o+ and then baEk
into the logi€€l line, in that care all o+ the logiEEl line uill
be 6ent.

PUT CHARACTERand PUT RECORD

The HdndlEr e€Ee9ts ATASCII chatatters a5 one chat{cter Per bqte.


gixteen o+ the 256 ATASCII characters €te control codesi the EBL
code haE universsl nesning, but moEt of the other contr('l E!des
have Bperial fteening ontq to a diEPIag or' print device. The
Screen Editoi proceEriing of th€ ATASCII Eontrol rodeE is
€ r p l a i n e d b e1 o u :

CLEAR (*7D) -- The S€|.een Editor clearE the current displaU of


alI date and the cuagor iE placed et the hooe gosition (upP€r
left cornel' o+ the Ecreenl.

C U R S O RU P ( $ 1 C t - - T h e c u r E o . m o v e i u p b g o n € p h g 5 i E E l l i n € . The
curEor urill u,r€p ft'om t h e top line o f t h e d i s P l a g t o t h e b o t t o l n
I ina.

C U R S { I RD O t r N ( $ 1 D } - - T h e c l r E o r n o v e 5 d o u , n b { o n e p h q s i c a l l i n e .
The cureo. rrril1 |,rap +r'om the botto.n line of the displaq to the
toD I i ne.

C U R S O RL E F T ( t l E l -- lhe corsor tnoves le+t bg one tolufin. The


ruf5or u,ill ufap from the le+t $Eigin of e line to the t'ight
mar'9in of the 6aoe line.

C U R S O RR I G H T ( $ l F l - - T h € c u r s o r d o v e e r i g h t bq one coluon. The


cur.sor u,ill q r r a p froft the riqht margin of a line to the left
margin of th€ sane line.

B A C K S P A C E( $ 7 E ) - - T h e c u r e o r m o v € € L e $ t b ! o n e c o l u n n ( b u t n e v a | .
past the bEginning of E logii€1 Iinet, €nd the charaEter at that
neu,position iE changed to a blant (S2O).

OPERATTNCSYSTET'IC016555 -- S€etion 5
6A
SET TAg (t9F) -- The Screen Editor eEtablishe6 a tab point et th€
Iogical line poEition at that the cur.sor is residing. The logical
l i n e t a b p o 6 i t l o n i 9 n o t s g n o n V n o u sd i t h t h e p h { E i c E l I i n e c o l u m n
position Ein.e the IDgicaI line can be up to 3 phgsical IineE in
length. For exarflple, tabs t€n be set at the 15th, 3oth, 49th,
60th €nd 75th char'acter positions o+ a logical line as shoo,n
belou:

O 2 I 19 29 39 SEreen column l+.


--L------+---------+---------+----*----R L/R = nargins.
-T--------------T----*--- A logical line.
xi------T--------------T--------------T- r = inac.esible
x t-------- co lu0ln5,

Note the e++ect o* the left |nargin in defining the li.mits oS the
loq ical line.

The Handler def€ult tab Bettings are shoun belo0r:

O 2 9 19 aP 39 Scieen colufin *.
--L------+---------+__-------+---------R L/R = mergins.

rrT----T-------T-------T-------T-------I A Iogi€€1 line.


rX---__T_____--T-------T-_-----T--_____T r = inacEesible
r r -----T-------T-------T-------T------_T c o 1 unn s.

CLEARTAB ($98) -- Tfie Screen Editor rlearE the current cursor


po6ition oithin the logicel line fl"om being a tab point. There is
no rrclear all tab point5" +€cilitg pt'ovided bg the Hendler-

TAB (57F, -- The cuisor movee to the next tab point in the
current logi€:l line, oi to the beginning o+ the nert li.ne if no
tab p o i n t is +ound. This function uilI not increase the logical
l i n e l e n q t h t o e c c o | n f i o d e t ea t € b p o i n t o u t E i d e t h e c u ? r e n t l e n g t h
(e.9. the Iogi€sl line length is 3e chars€t€rs and there i5 a tab
point at position 50)-

I N S E R TL I N E ( s 9 D ) - - A l l p h g s i t a l l i n e s a t a n d b e 1 o u , t h e P h u s i c e I
l i n e i n t h a t t h e c u r s o r r e s i d e E , a r e m o v e d d o u r nb g o n e p h v E i c a l
1in€. The Ia6t logiceL line ofl the digPIag can be trunaeted aE e
r e E U l t . T h e b l a n k p h q r i c e l l i n e e t t h e i n s e i t p o i n t b e a o | n e st h e
b e g i n n i n g o S t s t l e l ] ,l o g i r s l Iine- A logical 1in€ can be 5plit into
trro logical li.neE bg thiE p r 'ocess, the last helf of the original
l o q i c a l ! i n e b s i n g . o n c a t e n E t e du i t h t h e b l e n & p h v s i c a l l i n e
forfled at the inEert poiht.

0 P E R A T I N eS Y $ I E f . lC O l 6 5 5 5 - - Section 5
D E L E T EL I N E ( $ 9 C ' - - T h e t o q i c a l l i n e i n t h a t t h e c u r E o r r e s i d e s
i6 deleted and al1 data belou th€t Iine ie moved upuard to filt
the void. E{rptg logical lineE al'e €ieated at the bottom of the
di6plaq.

I N S E R TC H A R A C T E (R$ F F ) - - A l l p h g s i c € 1 c h a r s c t e r s a t a n d b e h i n d
the cufEor poBition on e logicel line are noved one position to
the right. The chera.tei et the €ur.sor position iE sst to blank.
The last theraEter of the logicsl line urill be !ost uhen the
logicel line is +u11 and a char€cter iE inserted. The nunbei of
phrJsiceL lines compriging e logical line can increaEe as € I.e6!1t
of this function.

($FE' -- the cheractei on uhi€h the cursor


D E L E T EC H A R A C T E R
resicteE iE rernoved/ €nd the remainder of the logical line to the
right of the deleted rharecter ic ooved to the left bq one
position. The nuftber o+ phqsical linei composing a logical Iine
ran decrease a3 a result of this function.

E S C A P E( 9 1 8 ) - - T h e n e x t n o n - E O L c h a r a c t e r + o l l o u i n g t h i e c o d e i e
diEpleued €s date, even if it uould normallg be treated a6 €
c o n t r o l c o d e . T h e i e q u e n c e E E S C I t E S C Ir r i l l c a r r g e t h e E e c o n d ( E S C I
c h e r d ct a i t o b e d i s p l € U e d .

BELL ($FD' -- An audible tone iE genereted; the diEplaq is not


rnodified.

ENDOF LINE ($9S) -- In addition to its record terminati.on


function, the EOL causeE the cu.6or to advance to the beginning
o f t h e n e r t l o g i c e l l i n e . l . J h e nt h e c u r E o r r e a c h e s t h e b o t t o n l i n e
of the screen, the reEeipt of an gOL ui11 cause the gcreen date
to 5cro11 upuard bg one logical line.

CET S'ATUS

The HEndler takes no action other then to set the 'tatug to $O1.

U E e r - A It e r € b I e D e t e B B s € V a i i € b 1 e s

Also see the Displaq Hendler data base ver.iable discussion.

| O16555 --
O P E R A T I N eS Y S T E i , C Section I
70
Cursor PoEition

Hhen in a split-screen configuration, R O t t c R Sa n d C O L C R Sa . e e E s o c i a t e d


' trith the graphi.s portion of the diEplag and tuo othei variableE,
T X T R O Wt O 2 9 O l a n d T X T C O L t O 2 9 1 l , a r e s s g . t c i a t e d u i t h t h € t e x t u , i n d o u .
T X T R O I iI r a i i n g l e b g t s , a n d T X T C O Li s e - b g t e s t i t h the leait
Eigni+i€ant bgte being at the lourer address. Note that the most
s i g n i , f i c a n t b { t e o f T X T C O Ls h o u l d E 1 u e g 5 b e z e . o .

The hone poqition (O,O) +or th€ tert uindou i6 the uppsr Left corner
o f t h € u i n do u .

Enable/Ihhibit of Contiol Codes in Text

N o i t n e I I q a l l t e r t { n o d ec o n t r o l t o d e s E r e o p e r ' a t € d u p o n 3 5 r e c e i v e d ,
but gometifies it i9 desit"able to h€ve the control codes displa{ed as
' if th€g ueie data ch€r.€atarE. This is done b9 setting the veriEble
D S P F L Ot O e F E l t o € n q n o n r € r o v a l u e b e + o r e o u t p u t t i f l q the detts
containing rontrol €odes. Settiog DSPFLe to zero restoreE nornal
proc€ssing o+ tert Eootrol codeE.

O P E R A T I N eS Y S T E MC O 1 6 $ 5 5 - - SeEtion S
7T
C a 5 E e t t € H a n dI e r (C: '

The Casgette device i6 e read or urite device {rith a Handler


that e!ppofts th€ fol lo|lrin9 CIO +lnctionE:

OPEN

EET CHARACTERS
EET RECORD
PUT CHARACTERS
PUT RECT]RD
GET STATUS (nu1l +unction r

Th€ Cas6ette HEndler can p?oduce the follo{ri.ng erroi status€s:

$AO -- IBREAKI ks{ tsbort.


$84 -- Invalid AUX1 bgte on OPEN.
588 -- end-of-f i le.
S A A - 9 O- - S I O e r r o r E e t ( s e e A p p e n d i x C ) .

The CasE€tte Handler is one of the resident handler,s, and ther.efore


h€s e Eet of deviEe veators 6taating tst location E44O.

CIU FunEtion Deicription6

Th€ device-Ep€cific .haracte?iBtics o+ the 6t€nde.d CIO fun€tions are


d e t € i 1 e d be l o l r :

OPEN

The deviEe nslne is C. and the H6ndler. ignores BnrJ devi€a nomber end
fi Ienaoe speciticatioh, i+ ihcluded.

The HEndler iopport5 the follotrring option:

O P E R A T I N eS Y S T E MC O 1 6 5 5 5 - - Section 5
+-+-+-+-+-+-+-+-+
AUX2 ict i
+-+-+-+-+-+-+-+-+

l^lhere:c = 1 indicates that the cesEette is to be read/u?itten urithout


s t o p / E t a r t b e t { r r e e nr e c o r d i ( E o n t i n u o u s m o d € } .

Opening th€ Ea5gette foi input generates : 5ingle eudible tone, as E


profi9t for gou to verifg that the ca5sette Pleqe'a iE 5et up
f o i r e a d l n g ( p o | , , e ro n ; S e r i € 1 B u s c a b l e c o n n e c t € d ; t 6 p e c u e d t o E t a r t
of fite, and PLAY button depreEsed'. t{hen the EeEsetta i5 re€dq,
gou cen pt€es an{ kegboard keq (ercePt tBREAKIt to initiate tape
ie€din9.

Bpening th€ caesette for ortput gener€te6 tuo closelg 6paced audibl€
ton€8, as a prompt for gou to ve"i{g that the tassett€ Plager'
iE set up +or tl,riting (as Ebove, Plus RECORD b!tton dapreEsed). Wh€n
the cassette i3 resdg, Vsu t€n Pre95 anV ke{boerd ketJ (erEept
tBEEAKI) to begin tepe uriting. There i3 no uag for the coilpute. to
v e i i f t J t h E t t h e R E C O R D9 r P L A Y b u t t o n i 6 d e p r e s s e d . I t i s p o 6 s i b I e t o r
t h e f i l e n o t t o b e ! , r i t t e n , o i t h n o i m | r | e d i a t ei n d i c a t i o n o f t h i 6 f e c t .

There is a potentiel piobl€tn {tith the €arsette in that uhen the


casEette iE opened for {rtitin9, the ftotor. keeps running until the
firet recoid ( 1 2 E }dat€ bqtes) is {tritten. If 128 det: bqtes are
uritten or' th€ tEEcette i5 cloied uithin Ebout 30 seconds of the OPEN,
and no other seriaI bus I/O is p e r ' f o r ' f i e d , then there iE no Problefi.
Houever, if those tonditions a r e n o t o e t , s o n e n o i s € { ti l I b€ {rr'itten
to th6 tdpe F.io. to the first reco?d and an e r . r o l . l r r i l l o E tur dh€n
that tare +i1e iE re€d Iater'. If tengthg del6rrs e r e a n t i t i p a ted
betueen the time the cassette file is opened e n d t h e t i t n e t h at the
+i?st cassette recgrd ( 1 2 8 data bUtes) i€ { r r i t t e n , t h e n a d u m n q' . e c o r d
EhouId be urittsn a€ part of the file, t{picaIlg 1 2 8 b q t e s o f 6o|ne
i n n o c u o u s d a t E d o u l d b e u , ri t t e n , g u c h as all r e r o s , E | I I $ F F 6 , or all
(
b l a n l e + 2 O) .

Ihe sgstem EometioeE e|nits urhistling noi5e5 E+ter cessette I/O has
occur';ed. the sound can be elitninat€d bq storing $OS to SKCTL tD2OFl'
t h u 6 b r i n g P O I ( E Yo u t o f t h e t u , o ' t o n e ( F S K ) n o d € .

The CLOSEo+ a tape iead Etops the cassette |rlotor..

T h e C L O S Eo f 6 t e p e u r i t e does the f o l l o u i n g :

Lt!'ite6 ang remaining user' data in the buffel. to taPe.


l , l ri t e s € n e n d _ o f - f i l e iecoid
Stop6 the cassette tnotor.

OPERATINGSYSTEH CO16595 - - Section 5


OET CHARACTERSand OET RECORD

T h e l . l e n dI € r . r e t u i n E det€ in the follouing +ormEt:

+-+-+-+-+-+-+-+-+
I data b{t€ I
+-+-+-+-+-+-+-+-+

PUT CHARACTERSend PUT RECORD

The H€ndler accepts data in the follouing format:

.t-+-+-+-+-+-+-+-+
i data b{te I
+*.1-+-+-+-+-+-+-+

The Handl€r'attaches no significen.e to the dets b{tes


uritten, a valus of 994 (EOL) cEUs€s no 6oecial Ertion.

CET STATUS

Th€ Handler. does no more thEn set the statos to tO1.

Theorq of 0peration

The Cesiette l{6nd}€r urriteE and reads el1 data in fired*length recor.dE
of the foamet Bhoun belour:

+-+-+-+-+-+-+-+-+
i o I o 1 0 1 0 1 i S p e e d n e a s u r e f i e n t b gt e s .
t-+-+-+-+-+-+-+-+
t o1 0 1 0 1 0 1 i
+-+-+-+-+-+-+-+-+
i control bgte I
+-+-+i+-+-+-+-+-+
i 128 i

i bqtee I
+-.t-+-'-+-+E+'+-+
i E h e ck s u m i (Menaged bq 5I0, not the
+-+-+-+-+-+-+-+-+ H E n d1 € r . )

FiOUre 5-9 C € s s e t t e H a n dl e r R e c o r d Fol'm€ t

O P E R A T I N GS Y S T E MC O 1 6 5 5 5 - - Section 3
The cootaol bqte containE one of three velue€:

o iFC indicates the recoid le a full. dat€ re.ord (1ag brJt€s).

o $FA indicates the iecord ir a pertiallg fu}l dstE reEordi qorr


EUppl!.d teuer than 129 bgteg to the record. ThiE ra:e cdn
oEaui onlq in the .eEord piior to the end-of-fi1e. The nuftbe.
o{ uEar-gupplied datE bqteg in the .ecord i9 rontained in the
bgte prior to the chectsuo.

o ]lFE indiEete6 th€ re.or.d is an End-of file r€coFd, the data


poFtioil is alI reroes +or. an end-o+-fi!e Fecord.
The 9IO roltine geneiatei and Ehects the chEctsu. It is pait of the
tape recor.d, but it iE not contained in th6 Handler's t€.ord buf+er
cAsEuF to3FDl.
T h e . p r o c e E g i n E o + t h e s p e e r l - m a a s u r € t t r e n tb r J t e s d u r i n g caBgette reading
is discussed io Appendir L, D1-DZ.

F i l e S t r . u ct u r e

Iha C6s3ette Handle. {'r iteg e file to the eas6ette device uith a fil€
Ett.uctr,rr€ that is totallt, iftpos€d btJ the Handler (Boft foitnet). A file
EonsiEts of the follouinq three e1€nentE:

o A 2o-geaond leader of martr tone.

o Anq nsobaf of data-rEcord +rafie6.

o An end-of-f i le fr.ame.

The c:rsette-deta reaord frathes aie foi.matteal aE ghoun b€lou:


faaahe= pre-iecoid rraite tone (pRWT',
+ alet3 rEaord,
+ poEt reEor.d 9ap (pRG)

Tha nondste gortion€ of a frane have Eher5cteristiEg thEt €re


d a p e n d e n t u p o n t h e u r i t e O F E Nm o d e , i . € . E o n t i n u o u 6 o r
Etrrt/Etoo.

Stop/ltart P R W T= 3 s e E o n d s o f r n a r l t o n € .
C o n t i n u o u s F R W T= . 2 5 s e c o n d o + t n a tl t o n e .

Stop/steit PRC * up to 1 €econd of ljnlnoon tone9.


Contin|Joug PRO * froo O to n seaondg o+ rrnknoun tones? uhere
n is dependent upon gour prograrn tining.

The inter-r.eeord g€p (IRC) betueen ang tuo record6 consi6tE of


the PRO o+ the first r s . o r d f o l l o { r e d b { , t h e P R W To f t h e s e c o n d
reco.|.t,

OPERATINOAYSTEI'ICU16995 -- g€ction s
Printer" H a n d! e r (P: )

The Fl'inter device iE a t|rrite-onlg device ulith € Handler' that


supports th€ follouing CIO +unctions:

OPEN

PUT CHARACTERS
PUT RECORD
GET STATUS

The P?inter Handler can pr'odu€ethe follotrinq error gtatuEes:

9SA-9O-- SIO €rior set (iee A9pendir C).

The P!'intes Handler is one of the resident hand1erg, and


there+ore heE a Eet of device vectors starting at locetion E43O.

CIO Fun.t i on Descriptions

The device-sperific charaEteristiE5 o+ the Etandard cIO functiong


€re deta i I ed belou:

OPEN

The device ns{ne is P. The Handler ignores ang device nuftber and
filenane sper ification, if included.

The Hendler. urites ang data remei.ning in its buffer to the


print€r device, !rith trailing bIentE to fill out the line.

PUT CHARACTERSand PUT RECORD

The H€ndler ec.epts print data i.n the +o1lourin9 format:

7 o
+-+-+-+-+*+-+-+-+
I ATASCI I
+-+-+-+-+-+-+-+-+

The onlg ATASCII control code of enq Eigni+ic€ore to the Handler


is the EOL charecter. The printer. device ignore6 bit 7 of everg
d€t€ bgte and prints a sub Eet o+ the ie aining 1eg aodes. (Eee
App€ndix C for the print€r character set).

The Handlei supports the +ollouring print option:

O p E R A T I N eS Y S T E MC O 1 6 $ 9 5 - - SeEtion 5
+-+-+-+-+-+-+-+-+
AUX? i grint node I
+-+-+-+-+*+-+-+-+

l.rhe.e: 94E (N) s e l e c t s n o r d r € l p r i n t i n g ( 4 0 c h € r E c t e r . E p e r l i n € ) .


5 5 3 ( S ) s e l e c t s s i d e 0 r a g Ep r i n t i n g ( 2 9 c h a r a c t e r s p e r l i n e ' .
$57 (W) 6elects !ride piinting (not 6upported bq pi,inter
devi€e).

Ang other value (inEloding OO) iE treated EE a norm6l (N)


print seleat, urithout producing an erroi stEtus.

CET STATUS

The Handler oht€ins a 4-b!te Etatl6 fro ths printer.


cont.olle. e n d p u t 6 i t i n s g s t e m l o c a t i o n D V S T A TE O Z E A I . T h e
foroat o+ the Etatu6 bgtss iE shoun betou:

+-+-+-+-+-+-+*+-+
I co|no€nd stat. i DVSTAT + O
+-+-+-+-+-+-+-+-+
i AUX2 of prsv. i + l
+-+-+-+-+-+-+-+-+
i tioeout I
+-+-+-+-+-+-+-+-+
i (un!sed) i
+-+-+-+-+-+-+-+-+

The coooand stetljs contains the +o1louin9 Etatug bits end


condition indiretions:

b i t O: an invelid connend fi.sms lra6 r.eceived,


b i t 1: a n i n v e l i d d E t € f f a m s u r e Er e c € i v e d ,
b i t 7: en intelligsnt cofltroller (nor$a11q = O).

The nert brrt€ containE the AUX2 velLre froo the previoog op€rstion.
The ti.m€out bgte contains a controller provided meriouln tifi€out
v a l u e ( i n s e c o n d s) .

T he o r g o f 0 p e r a t i o n

The ATARI AzOtTf,ll 4O-Colufln Printe!. is € line-at*a-tioe printe? ?ether


than a character-€t-€-time printei, so g o u t deta mrrst be buffered bg
the HandleF snd sent to the device in record6 rorresponding to one
pFint line (40 chal.acter6 for nornal, e? rharEcter: for sideueus).

U P E R A T I N OS Y S T E HC U l 6 5 5 5 - - SeEtion 5
77
The printer device doeE not ettEch anl si.gnificence to the EOL
character, Eo the Hendler' does the approFriate blank fill
lrhenever it cees 3n EOL.

DiEt File l{aniger. (D: )

The OS BUFpor'ts foui unique FiIe l'lanegementSubEgste{Ils et thp


time o+ thtE niiting. Ver6ion 1A is the original version.
Versi.on IB i5 a 5liqhtlg {rodlfied version of lA and is the one
d € s < r i b e d i n t h i s d o c u m e n t . l . , l o s to f t h i s d i 6 c u E s i o n a p p l i e s a s
{reIl to Ve|'sion tL that hendles a double-densitg dis*ette (7eO
e56-b{te ie{tors) in addition to the sin91e-densitU disl(ette (7?o
128-bqte gectorE'. Vergion III has aIl neu +i1e/direEto.U/map
structureB ahd can posEiblrJ contain changes to qour interf:ce
e s { r eI l .

The File lvlanagenenS t ub6gsteo includes € disk-bootable


( R A t l - r e s i d e n t ' D i s k F i l e M s n a g e r ( D F l ' 1 )t h a t m a i n t e i n E a
collection o + n a | n e df i l e E o n d i . e & e t t € s . U p t o 4 d i s k d r i v e E
(Dl: thr.ough D4: ) ran be accegsed, €nd up to 64 files per
diEkette cEn be arcessed. The sgstem diEtette6 5upplied b'J ATARI
€ 1 1 o u , a E i n g ! e d i . 6 l d r i v e ( D 1 ) € n d u p t o 3 O P E Nf i l e s , but
gou can alter these nunbefs es deEcribad later in
t h i E s e ct i o n .

The DiEk Fil.e ttanager EUpportE the follot ing CIO f,.rnctions:

OPEN F ILE
OPEN DIRECTARY
CLOSE
EET CHARACTERS
GET RECORD
PUT CHARACTERS
PUT RECORO
OET STATUS

NOTE
POINT
LT]CK
UNLOCK

RENA},IE
FORi.IAT

0 P E R A T I N eS Y 5 T € MC O 1 6 5 5 5 - - Sectlon 5
The Dist File I ' l e n e g e rc a n p r o d u c e t h e + o l l o u i n g errol' EtatuseE:

9O3 -- Last dat€ from file (EOF on next l'ead).


$88 -- end-of-fi le.
tAA-9O -- SI0 error 6et (eee Appendix C,.
+AO -- Drive nufiber Epecification err.oi.
tAl -- No iector buffer availeble (too manq open file€).
$A2 -- Disk full
3A3 -- Fatel I/O error in director.t or bitmap.
3A4 -- Internal file * mi5$atch (Tt?uctural p"oblem).
$AS -- File nane speci+ication error.
tA6 -- Point inforn€tion in error.
$A7 -- FiIe locted to thiE operetion.
$AB -- S o e c i a l c o m t n a n di n v a l i d -
3A9 -- Di.ector! fu11 (64 fi1€s).
tAA -- File not +ound.
3AB -- P o l n t i n v a l i d ( f i l e n o t B P E N e d+ o r . u p d € t e ) .

C I O F u n ct i o n D e E c r i p t i o n g

The device-6pecific cha?€cteristica of the Et€nderd CI0 *unctions


are detai Ied belo|ll:

IIPEN FILE

The d€viae name is D. Up to four. dis& drives can be €ccessed (D1


through 04,. The di6* filenefie can be fr.on 1 to C' ch€rarEers rn
length uith €n optionel l- to 3-character ettension.

I h e O P E NF I L E E o o m a n d E U p p o r t 5 t h e f o l l o r r i n g options:

7
+-+-+-+-+-+-+-+-.t"
AUX1 | tt.|tRt iAl
+-+-+-+-+-+-+-+*+

llhere: l,l and R Ere the dire.tion bitE.


tlR = OO iE invalid
O 1 i n d i c a t e E O P E Nf o r r e e d o n I g .
1 0 i n d i c e t e s B P E N4 o r u r i t e o n l q .
1 1 i n d i c a t s e O P E N* o r r e a d , / u r i t e ( u p d a t e ) .

A = 1 indicetes appendedoutput uhen W = 1.

You mag use theee fotlou,ing valid AUXl opti6ns:

O P E R A T I N GS Y S T E MC 0 1 6 5 5 5 - - Se(tion 5
7S
O P E NI n p u t ( A U X I = $o4 )

The ind ic€ted file i 6 o pe n e d f o r i n p u t . A n g u i I d_c6rd ch€r'acters


ete used to 5ea?rh for the f irEt oatch. If the +i1e is not found,
an e!.f01. 5tatus i5 r e t u r n e d , a n d n o f i 1 e u i I I b e o pe n e a l .

O P E NO u t p u t (AUX1 = 9OA)

The indicated file is opensd +or outp!t sterting uith the +irEt
b g t e o f t h e + i 1 e , i f t h e + i 1 e i E n o t tocked. AntJuild-card
chatacterE are u6ed to Search fol the firBt atch. I+ the fil6
e1r'€adgeri5t6, the existing file uril 1 be delet€d before oPening
the naned file as e neu file. If the +ile doeE not alaeadq eri9t,
it !rilI be creeted.

A file oD€n€d foi' ootput rrill not aFPeal in the diiectorg until
it hes been Elosed. If en output file i5 not pl'operll closed,
$ofle o!'eIl of the sectori thet urete €aquired for it ian be lost
until the diEk is reformetted.

A file that is opened +ol. output can not be oPened cotlcutrentlg


for enq other accesg.

oP€N Append (AUX1 = $O9)

The indicated file is opened fot outPut 6t€r'ting uith the b!te
after the laEt bgte of the exi.6ting +i1e (that nuEt €lreadtl
erist), if the +iIe i5 not locked. Anq urild-card EhErEcter5 ar'e
used to se€rch for' the first fiatch.

If a file opened fof append is not proper'Ig aloEed, the €ppended


deta rrill be lost. The eristing +i1e uitl ieoain un$odi+ied and
some oi e11 o+ the Eector6 th€t uere acquired *or the appended
oortion .an be lost until the diskette is reformett€d.

O P E NU p d a t e ( A U X I = 9 0 C )

The indicated +ile (thet muEt elreadq exi6t) uill be opened for'
update provided it i 6 n o t l o c k e d . A n g u r il d - c a r d c h a r a c t e r s a t e
used to Eeafch for the fii.9t metth.

The GET, PUT, NOTEand POINT opeiations aie all valid, and can be
i n t e t ' t n ix e d e s d e 6 i r e d .

If a +ile opened fo!' update iE not properl{ €Losed, { Bectot'€


uorth of infor.m€tion can be lost to th€ +ile. A file opened for
uDdate can not be extended-

OPERATINe SYSTEII CO16555 -- Eection I


ao
D e v i c e / F i l e n a m e S p e ci f i c e t i o n

The Handler expe€ts to find a device/fil€n€me specificetion of


the fol louinq forln:

D I 1 : n u m b E l . > l{: + i I e n a m e > { E O L >

{number} ::= 1l?13i4


< f i l e n e n e > : : = t < p r ' i m a r q > l C .C { e r t e n r i o n } I l < t e r d r i n a t o r }
<primerg) ::= an uppercase elpha EhEr.e.t€r fotloued b! O to 7
alphanuoeric chararters. I+ the prid|ar'g nane i9
IesE then g cheracters, it rri.ll be raddcd {rith
blankE, if it is greeter then E| characters, the
ertrE Ehaiacte?s urill be igngrad.

<€xteniion) | t = Z e l ^ at o 3 e l p h e n u D e r i c E h a r a c t e r s . I f t h e
erten6ion name iE (niEEing or Ie6i thdn 3
char€cterE, it Uill be padded {rith blanks, i+
it is greater then 3 cherecters, the extt a
E h a r a ct e r E u r i l l b e i g n o r e d .

<teFminatoi> : : = <EUL)[<blant>

Figure 5-1O D e v i c e , / F i 1 e n € m eS g n t a r

The fotlouing Bre all v€1id device/filenaflei for. the diEtette:

D1: oA|{E.SRC
D: |'1ANUAL5
D:.t{HY

D4: BRI DGE.OO2

Fi lenane tli ldc€rd in9

The filenane specification can be furthsr generalized to inctude


the u9e of the "{ri1d-cerd" charecters * and ?. TheEe uildEar.d
characfets al1ou, portions of the prim:rq and/or ertension to be
a bb r e v i a t e d a s f o I l o u s :

The ? iharacter in the Epeci+icetion allous ang filenaiDe


ch€racter at thst p6sition to produce a "natch. " For. exaftp1e, !,lH?
uill o a t E h f i l e s n e f l e d N H O , l . r H y ,S J H 4 ,e t c . , b u t n o t a f i l e n a m e d
WHAT,

D P E R A T I N CS Y B T E I 1C O 1 6 5 5 5 - - Section 5
a1
The t charerter causes the reoainde. o+ the primtsrq of erten5ion
field in that it is used to be effsctivelU padded uith ?
Ehe.ectels. F o r e r a o p l e , t ^ r H *l , i l l m s t c h W H U , W H E N . I I H A T E V S R ,e t c .

Soft€ valid useE o+ urild-cErd sDecifiEation5 ai'e Ehoun belou:


*. SRC Files having an extension o* SRC.
B A S I C .* Files n6ned SASIC 'rith Bnq extenliion.
*.r+ All +i1e6.
H*. ? FileE beginning orith H and having € O or 1
c h a r e ct e r e x t e n s i o n .

I f u r i l d c € r d i n 9 i E u s e d u i t h e n O P E NF I L E c o n | n a n d , t h e f i " 6 t fite
found (if ang, that neet6 the speci+ication uri11 be the one (and
onlq on€) opened.

OPEN DIRECTORY

T h e O P E N D I R E C T O R Yc o m n r a n da l l o u s 9 o u r s 6 d d i r e c t o r g
infornation for. the setected filena|ne(s), using normal GET
C H A R A C T E RoSr e E T R E C O R D€ o n m a n d e . T h s i n f o r . m a t i o n D e e d u i l l be
fo!'m€tted ss ATASCII iecords, Euitable for printing, a€ Ehourn
belo{t. Wildce?ding c€n be used to obtair| in+ormation foi nL,ltiple
files oi the entire dislette.

T h e O P € N D I R E C T O R Y€ o n l n € n d u s e s t h e E a m e C I O o a r a m e t e r s € E a s t a n d € r d
O P E NF I L E c o m f t e n d :

COtltlAND BYTE c $O3

= poj.nter to device/fi.lenane specificati.on.


E U F F E RA D D R E S S

AUX1 = $06

A+ter the directorg iE opened, a record urill bs returned to the


c a l l e r f o r e e c h + i l e t h € t f t : t c h e e t h e O P E Ns p e € i f i c a t i o n . The
r'ecord, thet coniainE on1'JATASCII chtsrscters, iE *ormatted at
shoun belou:

I
1 2 3 4 5 6 7 4 9 O 1 2 3 4 5 6 7 A
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
i s i b i p r i t n e r gn e m e l e r t ibicotntiel
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

O P E R A T I N OS Y S T E MC 0 1 6 5 5 3 - - Section 5
a2
l"lher€: s = * or ' 'r rrrith * indi.€ting file locted.
b = blent.
p r i n t a i g n E t n eg l e f t - J r r g t i + i e d n E m € q , i t h b l a n t + i t I .
ert = le+t-JUstified ertension {rith bIEnt fiIt.
b = blank.
.ount = nsnber of seEtorE conpriring the fi1e.
e = EOL ( *98 ).

Aftei the last filenane match reroid iE leturned, an eddition€1


record is rettJfnsd. Thii record indicate6 the number o+ unu$ed
seEtors av€ilable on the dislett€. The +ornat foi this record is shoun
belour:

x
1 2 3 4 5 6 7 A 9 0 1 2 3 4 5 6 7
.i-+-+-+*+-+-+-+-+_+-+_+_+-+-+_+_+_+
i r o u n t iF R E E S E C T O R g l e i
+-+-+-+-+-+-+-+-+-+_+-+-+_+_+_+_+-+

!|heie: count = the nuftb€r' of unuEed seetorg on t h e d i s k e t t e .


e = EOL ( 398 '.

The EOF st.tuses (tO3 end $88' sre returned as ih a nornEl data
f i l e { l ' h e nt h e l a s t d i r e c t o r g l . e c o i d i s r € a d .

The opsning of another dlslette filE uhite the diiec torg read iE
open ui11 Eaui€ s!bsequent di1.ectorq iead6 to malf!nction,6o
caie ougt be t€k€n to Evoid thi6 situation.

CLOSE

Upon c103ing a file rsed, the Handler ielea€aE sll intern€1


!.esourees being u9€d to support thEt fiIe.

Upon closing a file {riite, the Handler:

o rrr.iteE anq rEsidu€1 datE +.oft its file buf+er for that +iIe
to the dislette.

o updates th€ dir.ectorg and allocation $ap +ot the eEEocidtsd


distette.

o r€l.ea5es all internal resourc€s being utilired to support


that fi Ie

eET CHARACTERSand cET RECORD

Chararteig ere read fro t h e d i 6 k e t t e a n d P : 5 5 e d t O CIO as a rau,


data str€am. None of the ATASCII Eontr.ol character.g have anu
special 3ignificance. A 6tatuE of $gg is retrrned i f an atteop t
is nade to rEad past the lest blte of E f i l e .

OPERATINOSYSTEMCO15553 - - Sec tion


PUT CHARACTERSand PUT RECORD

Char'a€ter"s aie obtained faon CI0 and urritten to the di5kette aE a rau,
d€t€ stream. None o+ the ATASCII control chererter.g have ang sp€ciel
signi+ican€e.

GET STATUS

The indirated +ile is .herted end one of the follouinr status


b!te values is retu?ned in ICSTA end r.eqigter. Y:

$O1 -- Fil€ found €nd unlocfted.


EA7 -- File }octed.
$AA -- FiI€ not +ound.

S p e c i a l C I O F u n ct i o n E

T h e D F F Is u p p o r . t E € n u m b e r o f S P E C I A L c o m m e n d s , t h a t a r e d e v i c e
sFecifia. These €re erplained in the parEgrephr that follour:

NCiTE ( CBI.1I'IAND
BYTE = 925)

T h i s c o m o a n dr e t l r n s t o t h e c e l I e i t h e e r € r t d i E | ( e t t e l o c a t i o n o+
the nert bgte to be r€ad or uriitt€n, in th€ var'iab169 sooun
belou:

ICAX3 = LSg of the diE&ette sector nuftber.


ICAX4 = Sg of the diEkette sectoi nuftber_
ICAXS= l.elative sector displacement to b{te (O-r.24t.

POINT (CAHHANDBYTE = $p6)

T h i s a o m r E n da l l g r r s g o L , t o s p e c i f q t h e e x e r t d i F t 6 t t e l o E e t i o n o f
the nert bgte to be read oi uiitten. In order to use thiB com{roafld,
the *iI6 mirgt have been open€d {rith the ,'update" option.

ICAX3 = LSA of the diskette eector numbe..


ICAX4 = HSB o+ the dirtett€ sector number.
ICAXS= relative 5e.tor displacement to bgte (O-1241.

OPERATINe SYSTEII CO1655S -- g€ction g


a4
LOCK

T h i s c o m m a n da l l o o r e g o u t o p r e v e n t u r i t e s E E e s s t o e n q
number of named files. Locked files can not be deleted, renaoed,
nol. open€d +or outpr.rt unI€5i theq are first unloc&ed. Locking a
fils thet iF elreedg locled is a velid op€ration. Th€ Handler
erpects a device/filenede EpeEification, th€n ell occurrences of
the filenaoe EDecified uill be Iocled, usino the uild-card rules.

You set up theEe follou,ing I O C B p a r a m € t e r . 5p r i o r to


c 6 1 1 i n g CI O :

COI'{HANDBYTE = 923

A U F F E RA D D R E S S* p o i n t e r to device/filenane speEification.

A f t " r e L O C Ko p e . a t i o n , the follouing IOCB pe?emeter u,ill have


been Eltered:

S T A T U S= r e E u l t o f L U C K o p e r a t i o n ; E e e A p p e n d i x I for a list
of possible statu6 codes.

UNLOCK

ThiE coomand allorrs gou to reoove the loc|( statuE of anq


n u f i b e r o f n a r n e df i I e s . Unlocliing a file thet iE not lttcled is a
valid oo€r'Etion. T h e HEndler €xDects a device/filenarhe
.- specificEtion; t h e n e l l o c c L r r . r e n E e so f t h e f i l e n a m e s p e c i f i e d
uill be unlocled, urino the t ild-card role5.

You set up thes€ *ollouing IOcB p€refteter5 prior to


c a l l i n g CI 0 :

COMI{ANDBYTE = 324

B U F F E RA D D R E S S= p o i n t e r to device/fi.l.ename rpecific€tion.

A f t e r a n U N L O C Ko p c r ' a t i o n , t h e f o l l o u i n g !OCg paraneter uill have been


EI te?€d :

S T A T U S- . e s l l t o f U N L O C Ko p e r a t i o n , s e e A p p e n d i l B f o i a
l ist o+ possi.ble status codes-

D€LETE

T h i s c o r f t | l a n da I I o { r 5 ! j o u t o d e l e t e a n g n u m b e i o f u n l o t k e d
n a n r e df i l e s f r . o m t h e d i r e c t o r q o f t h e E e l e a t e d d i s f t e t t e e n d t o
deellorete the diskette space {rEedbg the files involv€d. The
Handler erpects a devics/filenatne spe.ific€tion, then €1I
occurences of the filen€ne 6pecified uii11 be deleted, using th€
rrild*aard ruler.

OFERATINe SYSTEfl CO16555 -- Section 5


85
You set up theie follo{ring IOCB paremeters prior to
c a l l i n g CI O :

COHMANDEYTE 3 921

B U F F E RA D O R E S S= p o i n t e r to device/filanane spe€i+icetion.

A f t e r a D E L E T Eo p e r . B t i o n , th6 follouing lOCg perameiei uill have


been altered:

S T A T U S= r e s u l t o f D E L E T Eo p e r a t i o n ; E€e Appendix g for e list ot


possible stEtus Eode6.

RENAI.lE

Thi5 .on|tland allolre {ou to change the +ilenamer of arlg


number of unlocled fites on a singIe di6kette. Th€ Handler
erpeatE to find a device/filenane sperifi.ation th€t +o11ou,s:

{ d e v i .c e s p e c ) : . { f i l e n a f l € 6 p e c > , { $ i l e n e m e s p e € X E B L >

A 1 1 o c c r . r r r e n c e so f t h e f i r s t fileneme uill be reolac€d {rith the


second fileneoe, using the urild-€€rd rules. No proteGtion i.E
paovided again6t forning duplicate nane5. Once forned, duplicate
name6 c€nnot be 6€paratelq ren8rned or deleted; hoo€ver', an OPEN
F I L E c o m m € n du i l l alu€qs 6elect the fir.5t file found that oatches
the filene$e 6pecification, 6o thet file uilt al{raq6 be
acceBEibl.e. The RENAI,IE c o m n r a n dd o e s n o t a t t e r t h e € o n t e n t o f t h e
fileE involved, lrterelq the name in the diiectorg.

Examples o* soloevelid RENAME


neoe sgecificationg are shoun
belou:

D 1 : + . S R C ,* . T X T
D:TEI,IP,FDATA
D2: F*, F+, OLD

You set up these +ollo{ring IDCB perianeters prioF to


c e I I i n q CI O :

COilt'lAND EYTE = $2O

E U F F E RA O D R E S S= p o i n t e r to device./filentslne specifi€ation.

A f t e r e R E N A H Eo p e r e t i o n , the follouing IOCBparaneter ui11 have


been eltered:

S T A T U S= r e E ! 1 t o f R E N A I ' I Fo p e r a t i o n , see Appendix B for ts


list of pos6ible status cod€s.

O P E R A T I N OS Y S T E MC O 1 6 9 5 5 - - Section 5
a6
FORi'IAT

Soft-sector diEtette6 oust be form€ttsd before theg cEn Etore


d a t a . T h e F O R M A Tc o o o € n d a l l o u s g o u t o p h g c i c 6 l l q +ornat a
diglett€. lhe ph{sic€1 formetting proc€ss {rr'ites a neu copg of
avarq EeEtor on the Eoft-seEtored diskette, uith the data poition
o f e a c h B e c t o r ( o n t E i n i n g a l 1 r e r o 5 . T h e F O R i i A Tp r o c e E s c r e a t e 5
a n ' r e t n F t t r r 'n o n E g s t e | n d i s k e t t e . l^lh€nthe tor.metting proce6E is
Eooplete, the FMg createg Bn initial Vo1l|naT€b1e of Contentg
(VTOCIand an initial File Di"ectofg. Th€ boot iector (l+1) is
plr|tlenentlg reserved ar pert of thig procoss.

You set up theEe folloqring IOCB pErEmeterg prior to


c a l l i n 9 Ct O :

COtlt'{ANDBYTE = aFE

B U F F E RA D D R E S Ss p o i n t e r to device EpeEi+iEEtion.

A f t e t e F O R M A To p € r ' e t i o n , the +olIouinq IBCB pei€meter ui11 have


been altered:

S T A T U S= r e s u l t o + F O R M A To p e r s t i o n ; 6€e Appendix I +or a


list of Dos€ibIe Et€tu6 codeE.

To creEte a sg5ten digkette, a copg o* the boot fil.e muEt then be


uritt.n to sectorE lf2-n. Thi6 iE 6EcompliEhedb9 nriting the file
n a f i e d D O S .S Y S . T h i s i E a n a { e t h a t i 6 r e c o g n i t e d b g t h e F M S e v e n
\_. though it i3 not in the directorg initi{119.

T h e o r q o f O pe r E t i o n

Th€ rerident OS initiates the dist-boot oioEeEs (see geEtion 10).


T h s O S . e a d E d i s * e t t e s e c t o r L 1 t o f t e m o r gE n d t h E n t r a n i * e r 6
c o n t r o l t o t h a " b o o t a o n t i n u E t i o n a d d ! . e E s t t( b o o t E d d r e s s + 6 ) .
The boot-Eontinuation pr.ogfa sontained in EeEtor {t1 then
continues to load the r.efiainder of the File l,lanatement gubBqEtem
to me. noiguEing additional in+ormation rontEined in seEtor l+1.
T h t F i l s l l a n a g e m e n tg u b 9 9 s t e l n l o e d e d , u i l l contain a Dist File
Manag€i , end optionatlq, a Disk UtilitieE (DOS) package.

l . r h a nt h a b o o t p r o E e s s i s c o m p l e t e , t h 6 D i g t F i l e M E n E g € ru i l l
a l l o c a t e a d d i t i o n a l R A l , lf o t t h e . r e a t i o n o f E e c t o r b u + + e r E .
Sector. b!ff€rs are Ellocatad ba6ed uoon information in the boot
reEortd as shoun bal0{r:

E V t e 9 = m a r i | n u on u f i b e r o + o p e n f i I e s , one buf+er per (the


m a x i m u nv a l u e i E 8 ) .

Sgte 10 = drive Eelect bits, one buffer oer (1-4 onlu)

OPERATINOSYSTEII CO16955 -- Section 5


a7
The Dis* File fldnager uill then inaert the n€t|le D and the Handle.
vector iable addresg in the device tabte.

MITE: There is a di6cr.epenEg betueen the Di6k File l{anager,s


numbering o+ distette sertorE (O-7191 end the dis|( conttoller.s
nutnbering o+ diskette sertor.s ( 1-72Oli EE a resslt, onlu sectors
1- 71? are used bg the DiEk File I'lanager.

Tha Disft File llanager- lsFs the Dist Handter to perfof|n all
disftette t€eds end uiitesi the DFtl.6 function iE to support end
{raintain the directorq/file/bitnap Etructur.es :E des.r.ibed in the
fol louing pege€:

OPERATINeSySTEtt CO1659S-- Section 5


AE
FMSDistctte Uti I i zetion

T h e o a p b e l o u s h o u r et h e d i s t e t t e 6ectoi utilizetion for a


E t a n d a r d 7 2 O € e ct o r d i 6 k e t t e .

- +-------_-----_-_+
' E O O Ta e c o r d i Sector 1
+---------------_+
FllS EOOT i gectoi 2 -+
= +ile
' DOS.SYS i SeEtor n +* Note 1
+----------------+ i
i Use|. i Setto. n+l -+
= FiIe
I Ar.ee i Settor' 359 ($167)
+----------------+
\: l vToc(note 2) | gertor 360 ($168)
+---------------_+
: File ! Sector 361 ($169)
= Directorq
i Secto. 3 6 4 ( $ 1 7 O)
+----------------+
. U6e? I
= FiIe
I Area I SeEtor 719 ($ACF)
+---i------------+
I unused i ge€tor 72O (izDol

Figure 5-11 FiIe M e n e g e n e n tg u b s { 5 t e f i D i E l e t t e Ssctor Utilization


HaP

N O T E1 - If the diskette i5 not a srretemdiskette, then gour'


Fite Aiea stsrts at secto.2 and no space iE reEerved for the FMS
B O O Tf i f e . Houevs!', " D O S " ( D O S .S Y S a n d D U P .S Y S ) m s t J s t i l l be
{,ri.tten to e di6kette that heE al.eadg !9ed eectots " a - N . r '

NOTE2 -- VTDC stendE for Volume Table of Contents.

A P E R A T I N OS Y S T E Hc O 1 6 5 5 5 - - Section 5
a9
Fl.|S Boot R6cdrd Forftat

T h e F l . l SB O O Tr e c o r d ( c 6 c t o r . l + 1 ) i s a 6 p e c i a l c a B E o f d i s t e t t e - b o o t e d
softuare ( s e e g e c t i o n 1 O ) . T h € f o i f t a t f o r t h e F t v l sS O O I r e c o r d i s
ihoo,n belo{|

+______-______--_+
i boot f lag = O i Egte O
+----------------+
! *sector5=1 I I
+----------------+
I boot addr€is i 2

[ = 07OO I
+----------------+
I init €ddr.€ss i
+

+----------------+
I JMP = rt4B i 6

i boot reed I
+ Eo n t i n u E t i o n +
I addres5 |

i marfileg=3 | | 9 N o t €1
+----------------+ |
I dfive bits = 1 i I lO Note 2
+----------------+ |
I al1o. dir,c * O i | 1r. Note 3
i
i boot iflage end i I
+ + i F M S
i address + 1 ! +------------- configuretion
+----------------+ i date
I boot f1a9 {} O I i 14 Note 4
i
i sector count | | 15 Note 5
+----------------+ i
I DOg. SYS | |
+ Etart ing + I
I sertor number I i
+----------------+ ---+
i code +or. 5erondi
i ph€se of boot i

Figure 5-12 F ! 1 e l v l € n € q e m e n tS u b E g E t e | n E o o t R € . o r d F o ? m a f ,

O P E R A T I N GS Y S T E I 4C O 1 6 9 5 5 - - Section 5
go
N O T E1 - Bqte I6pecifieE th6 naxiol,o nunber' o+ concurrentlV open
files to be sufport€d. Thie valle €€n renge +ro.n l to E,.

N O T E2 - 8 g t e 1 0 € p e c i + i e E t h e s p e c i + i c d i s l i d i i v e n u n b e r 6 t o b e
EUpported |Jsing a bit enEoding schene as shoun belolri

7 6 5 4 3 2 1 O
+-+-+-+-+-+-+_+-+
i i4l3!2111 uher€ a 1 indicates a sel€cted d?ive.
+_+_+_+_ii-+_+_+-+

N O T E3 - gqt. 11 rpecifieE the buffer allocation dire.tion, this


b g t € e h o uI d € q u a l O .

NOTE4 - gqte 14 mugt be nonzero +or the second phase of the boot
p r r o c e E Et o i n i t i a t e . Thi6 +ta9 indiceteE that the file
_ D O S .S Y S h a s b € . n d . i t t € n to tie di5tette.
N O T EI - T h i s b { t e i 3 a i 6 i g n e d a s b e i n g t h e E e . t o . c o u n t f o r the
D O SS . YS file. It iE actualt{ en unused b{te.

OPERATINOSYSTEH C4165$5 -- S€ction F


gL
Boot ProcesE Me org l'lep

The diEgram b€1orr shouE ho{, the boot gecto!' (p{r.t of +ile
DOSS . Y S l € ' l d + o l l o t r i n g g e c t o i s a r e ] o a d e d t o l r | e o o r ' ge E p a r . t o f
t h e b o o t Da o c e E s .

+----------------+ t'lenorgaddr'€5sO7OO
i data fron boot i
= E€ctor read E{ s
I res i d6nt OS I 077C
+----------------+
data +rofi r.est a77D
of DOS.SYg
i'ead bg the
= progr.em in the *
I boot sertoi. I
t !
e n d o + bo o t
FiEute 5-13 File l'l€nagenent Subs{stem goot P.ocesE tl€drorq l,lap

O F E R A T I N CS Y S T E MC O 1 6 5 5 5 - - SG{tion 5
Volufle Table o+ Contentg

T h e f o r m a t f o a the Fl"lS volutn€ table o f c o n t e n t E (VTOC, s6rtor


360) is rhourn in the diEgr.am beloor:

+----------------+
I dit'eEtorg tgpe I BUte o Note
++---------------+
i nar ilttun (10) I 1 Note
+ sector * +
! = ozCS (hi) i

i nunber of (lo) | 3 Note 3


+ E e rt o r s +
i avEileble (hi ) i

+----------------+
r i 10
= volune bit nap =
i l
+----------------+

t t
+----------------+

Figuie 5-14 File flenegefient Subsqste.n Volulne Teble o+ Contents

The volune bit mEp orgenization location fotlous:

7 o
+-+-+-+-+-+-+-+-+
I 112 3 4 3 6 7l Bgte 10 of VTOC
+-+-+-+-+-+-+-+-+
ts f . i 1t

+-+-+-+-+-+-+-+-+

Figure 5-15 File Hanegensnt Srb69stem Vol!fle Bit Hap

At eEch tnap bi.t po6ition, a O indicatei the dorresponding sector


iE in u6e and a 1 indicEteE that the sectol' is available-

NOTE I - T h e d i r e c t o r . g t g p e b g t e m u s t e q u a l O .

NOIE - T h e f t a x i f l r u mg e c t o r n u f l b e r i s n o t u € e d b e c a u E e i t i 6
i n c o r r e c t l g 5 e t t o 7 O 9 d e c i l n e t . T h e t r u e l n a xi d u n r s e c t o r
n u f l b e r i 6 € c t u a I l g 719 fo. the DFI'{.

OPERATINE SYSTEI'{c o 1 6 5 5 5 - - Section 5


93
N O T E3 - The number of ge€tots svailable iE initiallg set to 7O9
a+ter a diskette is freEhl! fornatted, thiE nuobet is
adJUsted EE files Et€ created snd deleted t6 Ehot! the
nunbeF o.f Eectors Evailable. The EectoaE that are
initiallq re5erv€d ere l and 360-368.

File Directorg Forftat

Th€ FMs reserve6 eight Eectors (361-364) fot' a file diiectoig.


Earh iector containing directorg infor'$ation +or' op to eight
fil€6, t h u s p r o v i d i r i g f o r a l l l s x i m u t no f 6 4 f i l e s for anq volutne.
The fordat o+ a 3ingle 16-bgte +i1e enttg is shotn belou:

I flag bgte I B'Jte O


+----------------+
I Ee.tor (Io) |
+ count
| (hi) I
+----------------+
I star"ting ( 10) I
+ s e Et o t +
i nlnber (hi) |

(1) |
+

+
(3' !
+
file (4) i

nane ! (5)
+ +
pr.im€rq (6) i
+
(7' i
+
(al I
+----------------+
file (l) |

nan€ (a) !

! ertension (3) i
i}-------------i--+

Figure 5-16 File Dir€ctorV For|nat

t r he r e t h e + l : 9 b r J t e h e E t h e f o l l o u i n g bits aesigned:

O P E R A T I N OS Y S T E Mc f 1 1 6 5 5 3 - - Section
94
bit 7 ! 1 if the fi le has been delet€d.
bit 6 = 1 if the +ile is in use.
bit 5 = 1 if the file i6 locked.
bit O=l i t O P E No u t put.

The fl€9 bgte cen ta*€ on tha +ol1o{ring valueg:

IOO = entrq not Vet used (no file).


$4O = entrq in u5e (no.flri1 CLASEd*i1e).
341 = entrg i n l s e T D P E No u t p u t f i l e ) .
$60 = €ntig in u6e t loc&ed f il.e).
98O = antrg available (prior fi1€ d€Ieted).

Sector coont i3 the nuftb€r of ie.to?s compri3inq the +ile.

FttS Fi Ie Sectoi Foroat

The fo.o€t of a gector in gour data file is ihoun belou:

o
+-+-+-,}_+-+-+-+-+
I dgta ! +O

+-+-+-+-+-+-+-+-+
I file * lhi ! +123
+-+-+-+-+-+-+ +
!to.usrd pointer I +126
+-+-+-+-+-+-+-+-+
iSl bgt€ count i +127
+-+-+-+-+-+-+-+-+

Fiquie 5-17 Fil! l , l 6 n e g s , r n a nSt u b s l s t e m F i l e Sector Fo!.mat

--
Th€ Fllg usee the +i1e L to verifg +ile integriig. Th€ file {t
is a iedundant oiece of information. The file number fieLd
cont.i.nE the value of the di.iecto?rJ position of that fi1e. If a
ilisrEtah oEEUrsbetlreen the file,s directorg position, and the
+ i l e n u o b e r a E c o n t a i n e d i n e s c h s e c t o . , t h e n t h e D F M' r , i I l
gene.ate the errof $A4_

The foruard pointer field contalns the 1O-blt v€Iue for the
diskette sector nuftber of the nert gector of the file. The
pointer €{!€ls zero for the 1a9t s€ctor of a file_

The S bit indlcate5 {rhether oi not the Eector i9 a ,,9hort sector,'


(a s€ctor containing Seuei then 125 dEta bgtee). S is equal to
l uhen the sectoi is Ehort.

OPERATINe SYSTEiI CO165S5 -- Se€tion 5


95
Ihe bqte-crunt field € o n t e i n E t h e n u | t l b e ro f d a t e 6 q t e e i n t h s
sectof.

Noh-CIA I/O

S o t n ep o t t i o n s o f t h e I / O r u b s g s t e r n a r a € c E e 6 E e d i n d e p e n d e n t l r J o f
the Central I/O Utilitg (CIO', thiE c€ction disruEse3 those
alaa!i.

R e si d e n t Device Hendler Vectot's

A I I o f t h e O S R O Hr e E i d e n t d e v i c e h a n d I e . . r a n b e a c . e E s e d v i a
sets of v€ctorr that are part of the OS ROH. The€. vector.€
increat€ the speed of I/O oper"etions that utiliza fired devi€e
a55ignft€ntr, Euch as oLrtput to the DispIa! Handl€r. For. each
resident Handler th€,re is a Eet of vectorE order.ed as shoun
belou:

+---------------+
+- 0PEN -+ +O
+- CLOSE -+ +e
+- GET BYTE -+ +4
{- PUT BYTE _+ +6
+---------------,
+_ GET STATUS -' +8
+-___________-__ia
+- SPECIAL -+ +1O
.r---------------+
+- JMP -+ +12
+- IN IT

+- SPARE
aYlE -+
+---------------+

Figure 5-18 Resident D€viee HandIe? Vectol.s

See S€Etion 9 $oi a detailed description of the d€ta interfaEe


+or e€ah of theFe Handlet entig points.

Each of th€ veEtorg conteing the addresE (Io,hi) of the HEndler


entrq point minus 1. A technique Eimilar to th€ one sholrn belou
is l.e{uired to access th€ desired routineE:

O P E R A T I N eS Y S T E MC O l 5 5 5 5 - - Section 5
96
VTBASE=$E4OO ; BASE OF VECTOR TABLE.

LOX *x I , OFFSET TO DESIRED ROUTINE


LDA data
JSR EOVEC , SEND DATA TO RUUTINE.

LDX {+g'J , OFFSET TO DIFFERENT ROUTINE.


.JSR GOVEC r OET DATA FROH ROUTINE.
SIA data

GOVECTAY , SAVE REOISTER A.


LDA VTBASE+I, X i ADDRESS I'ISB TO STACK.
PHA
LDA VTBASE, X ; ADDRESS LSB TO STACT(.
PHA
TYA , RESTOREFECTSTERA.
RTS , JUttP TO ROUTINE.

The Jl4P INIT slot in ea€h set of vectors Jumps to the Hindler
initialization entrg (not lnin!E 1).

The bese dddreEs of the vector Eet for eech of the r.esid.snt
h e n dl e r s i E s h o u n b e l o u :

SEre€n Editor (E: ) E4OO.


Displag Handler (g: ) 8410.
Kegboard Handler {K: } E420.
Printer Handlet' (P: ) E43O.
C€rsette Handle!. (C: ) E44O.

The reii.dent disftette Handler is not CIO-conoatible, 9o its


interfa€e do€s not use e vecto!. set.

R e si d e n t D i r t e t t e Hendler

The reEident Distette Hendler (not to be eonfus€d {rith the DiEt


FiIe t'laneger) is responEible *or alI phUiical aac€sses to the
diEkett€. The unit of dat€ tranE+er for thig HandI€r. is a 9ino1e
diEkette EeEtot containing le8 data brJtes.

C o a n o u n i c a t i o nb e t u e e n g o u a n d t h e D i s k e t t e H a n d l e r i s
effected using the Egstem/s Device Control BloEk (DCBl, th€t iE
also used for. H€ndler/SID comounication (se€ Se€tion 9). The DCB
i 9 1 a b r J t e s t o n g . S o o e b 0 t e i 6 ! . e u s e r - a l t e r . a b l e € n d E o m ea r e + o r
use bg the Diskette Handler and/or. the Serial L/O UtilitU (SIO).
You supplg the required DC! pa?eneters €nd then do a JSR
DSKINV tE433l.

U P E R A T I N CS Y S T E MC O 1 6 5 5 5 - - Section 5
Each of the DCB bgtes oill nou be desc.ibed, end the
sqsten_equate fi1€ name for e€ch ui11 be 9iven.

SERIAL BUS ID -. DDEVIC TO3OO]

The Di5tette Handler setE up this bgte to contain the Seri31 Bts ID
for the dt.ive to be accessed. It is not user-3!.te.able.

DEVICE NUI'IBER-- DUNIT [O3OI]

You set up this bqte to contain the disft dtive nu{rber to be


a c c e E s e d( 1 - 4 ) .

cotlt4AND BYTE -- DCOi'1NOr0302l

You Eet up thiE bgte to contain the disk device .ooosnd to


b€ t er forned.

STATUS BYTE -- DSTATS tO3O3]

T h i s b g t e c o n t a i n E t h e s t € t u s o { t h e c o t n m a n du P o n r e t u t n t o t h e
cal1ei. See AppendixC +or: li6t of the poesibte status codes

EUFFER ADDRESS-- DBUFLU CO3o4I and DBUFHI to3osl

This e-hgte pointel' containE the €ddreEs of the golrce oi


deEtination of the diskette sector deta. You need not suPplq
e n a d d t e s s f o r t h e d i s l s t e t ! 5 c o m m t s n d T. h e D i 5 l H e n d l e r u i I I
obtein the rtatuE and inEert thE addiess of the status buffer
into th i6 +ieId.

DISK TII'{EOUT VALUE -. DTIhLO 10306]

The Handler supplies this tlneo!t value (in uhole 5econdE) *or'

BYTE COUNT -- DBYTLO IO308l and DBYTHI IO3O9I

This 2-b'Jte counter indicateE the nulnbei of bgtes t!'anE{eI't'edto


o r f r o m t h e d i 5 t € 5 a r e E U l t o f t h e i n o s t ? e E e n t e o m f l a n d ,a n d i s
set up bg the Handler.

SECTORNUI'IBER-- DAUX1 TO3OA] ANd DAUXz TO3OB]


(1 - 72O)
ThiE 2-bgte n!.nber Bpecifies th€ diskette sector. nunber
to read or' 'rrite. DAUXl conteins the leest siqnificant bgte' and

O P E R A T I N GS Y S T E MC O 1 6 5 5 5 - - Section 5
9B
D A U X Zc o n t a i n s t h e . D o s t s i g n i f i c a n t bgte.

Diskette H a n dl e r Command.-

Ther.e€re five c o n t n a n d ss r J p p o r t e d b g t h e D i s k e t t e Handler:

G E T S E C T O R( P U T S E C T O R- - * * * not supported bU cur-rent handler ***)


PUT SECTOR$IITH VERIFY
€TATUS REAUEST
FORMATDISK

C E T S E C T O R( C o m m a n db g t € = * 5 e )

The Hendler reads the EFecified eectof to qour buf+er and ietlrns the
op€ration Etatus. You s€t the follorring D C B p a r . a m € t e r . Ep t ' i o r t o
€eIling the Distett€ Handlei:

COill.lAND EYTE = 952.

D E V I C E N U H B E R= d i s & d r i v e nsrnber (1-4).

B U F F E RA D D R E S S= F o i n t e r to qour 1e8-bqte bu+fer.

SECTORNUI'IBER= eeEtor number to read.

Upon ieturn +rom the sector, sEver€1 of the other DCB qarameuers
uill h a v e b e e n a l t e r e d . T h e S T A T U SB Y T € u i l l be the onlu
parameter of intereEt to gou, houever-

PUT SECTOR (Coninand bgte = $5O)

*** Not supported b{ CUirent Handler **lr


(But cao be scc€5sed thFough SIU dir.€ctlg. )

The H€ndler ur?ites the specified sector fron Uour buffer. and ?etuans
the operetion 6t€tus. You 9et the fo1lo{rin9 DCBparameteis prior to
cal1i ng the Di€kette Handler:

COI"IMANDEYTE = $5o.

D E V I C E N U I 4 B E R= d i s k drive number (1-4'.

B U F F E RA D D R E S S= p o i n t € r . to gour. t28 bqte buffe.r.

S E C T O RN U M E E R= 6 e c t o r nunbei to uiite.

Upon return fro{tl th€ oper€tion, gever.a1 of the othe!. DCE paf€fleteis
r r i l l h a v e b e e n a l t e i e d . T h e S T A T U SE Y T E u i t l be the onl|r one of
i .n t e i e E t g o | J , h o u e v e i .

O P E R A T I N GS Y S T E MC O 1 5 5 5 5 - - Section 5
99
PUT SECTOR$,lTH VERIFY (Coonand Bgte = $57)

The H€ndler uritas th€ EpeEifi6d sector +r.oo qour buffer


end r€tu!.ns the operation Et€tus. ThiE confiand differE froft PUT
S E C T O Ri n t h a t t h e d i 5 k e t t e r o n t r o l l e i i'eads the sector d.t6 after
uriting to verifg t h e 0 , l i.t e o p F r a t i o n . A s i d € f r o f t t h € C O I V I M A N D
EYTE vaIue, the calling se{uence is identi{al to PUT SECTOR.

STATUS REOUEST (Comltl5nd bgte e 693)

The Hendlcr obtEinE a 4-bgt€ 6tetus +roin the diskette controller and
p u t E i t i n s q s t e n l o c a t i o n D V S T A Tt O 2 E A l . T h e o p e r e t i o n s t a t u €
for.m€t iE shoon belou:

7
+-+-+-+-+-+-+-+-+
I Eofimand 6tet. I DVSTAT + O
+-+-+-+-+-+-+-+-+
i harduare 9tat. i + 1
+-+-+-+--r-+-+-+-+
i tioeout i
+-+-+-+-+-+-+-+-+
i ( unleed ! i
+-+-+-+-+-+-+-+-+

Figure 5-19. D V S T A T4 o - g g t € Operetion StatuE ForftEt

T h e c o o m a n ds t e t u s ronteing the follouino stetuE bitg:

Bit O = 1 indiEatEE an invalid coomand fr.afte oras rec!ived.


Bit 1= 1 indiEeteB en invalid date +?ane u.E received.
Eit 2 = 1 indiEateE that e FUT op€r.6tion aas unE{Jccess+ul.
8it 3 = 1 indicateE that the diEtette ie urite protected.
8it 4 = 1 indicates active/standb9.

Th€ harduare Btatus b{te containE the status regi5ter o+ the


INS1771'1 FIoppg DiEkette Controller chip ueed in the diEftette
€ontroller. See the docunentatiott for thEt chip to obtain
information relating to the fieaning of eech bit in the bgte.

The tioaoot bgte Eont€ins e controller'-provided marifiun titoeout


value (in secondg) to be uEed bg the Handler.

You Eet the follooing DCBpaian€t€t.E prio. to calling


the Dis l et te Handler:

COI'IMANDBYTE = $53.

= diik
DEVICE NU|,|SER d.ive nunber' (1-4).

Ugon r'sturn froo the operation, g€ve.€l of the other DCE paremeters
uill h a v e b e e n a l t e r e d . T h e S T A T U SS Y T E u i I I b e t h e o n l g o n e o f

DPERATINe SYSTEM C016995 -- Sef,tion 5


100
lnte.a6t t o go ! , houever.

' FORI'IATDISK (Coltloand 8!te = 321)

T h e H E n d l e . € o o d r a n d st h e d i s k e t t e c o n t r o t l e r to foroat the entir'e


d i s k c t t e a n d t h e n t o v e r i f q i t . A 1 1 b a d s e c t o r n u f t b e r 6 ( r . , pt o a
m€tinu$ o+ 63! are tetorned and put in the supplied buf+a.r.,
follo{red bg tto bqtes of a1I 1,s ($FFFFt. You 6et up the
follo{rin9 DCg paraoeterE prioi. to caltinq the Di6tette Handter:

COtlf{ANDSYTE = $21.

D E V I C E N U H B E R= d i s t drive number, (1-4,.

B U F F E RA D D R E S S= p o i n t e r to gour 128-br1te buffer.

Upon return, gou oight b€ inte!'ested in the foIIouing DCg pareneters:

S T A T U SB Y T E = e t a t u s o+ operati.on.

B Y T E C O U N T= n u l n b e r o f b q t e s o f b e d s € c t o r i n f E r o a t i o n in
g o r i b u { f e r , n o t i n c l u d i n g t h e ! 3 F F F Ft e r n i n a t o i . It ther.e
€le no bed EectofE, the count uill eoual zer'o.

UEl. T.| 1 EUE I/U

Inpot/Output to deviceE othe|' than the k€gboe.d, the e.reen, and


the ATARI Cotllputei controlLer port devires, must utilize the
Sel.ial I/O b!€. This bus containE data, control, and clork Iines
t o b e u s e d t o a l l o u t h e c o d p u t e r t o c o m m u n i c a t eu i t h e x t e r n a l
devices on thig "daiigchained" bu9. Everq device on the bus h€g
e uniqu€ idefltifier and 'ri11 respond onIg then directlq
addre6sed.
' (g1O), that
T h e r e s i d e n t E g E t e r np r o v i d e s a S e r . i a l L / O U t i l i t g
provide3 a standar.dired high-1eveI pr-ogra&inter{ace to the bus.
gIO iE 'rtilized bg the resident DiEtette, Printer, and CaEEette
handler's, dnd iE intended to b€ u6ed bg nonreEident handleis {see
Section 91, or' bq €pplication6? as {rel.1. For e detailed
de5ct.iption o+ the prograd/SIO inteiface and for. E detBiled bu5
Epeci$iEation refer to Section 9.

OPERATINOSYSTE|'i CU16555 -- Section 5


101