Ih e 4 / 10 5 - 81 :=

Apple Disk Interface nna Operating Mystem

R ef e r on n> M n n u n ;

N ov emb e r 1981

Copyright (C ) - 1981 A ll R tgh ts R eserved W o rldw id e

Th e s0F T W AQ ERO U S E P . 0 . B ox 1117 4 nonolulu r Hawa ii 96 82 8 U . S . A . X M TO G C E

C opy righ t (C), 19 81 by Th e Soft W areh ouse. A ll R iqhts R ese rv ed W o rldw id e . No Pa rt of th is m anual n ay be r e p r o d u c e d , t r a n s m i t t e d , t r a n s c r i b e d , s t o r e d i n a re tr iev al sy stem , oz trans lated into a ny hum œ n or com p u ter l an g u aq e : in any f o rm o r by a ny m e a n s , e l e c t ro n ic , m echan icalz m açneticr op tica l, chen icalr m anual , o: oth er- w ise , w ith ou t khe exp ress w ritken p e rm zss ion o f The Sof t W areh ouse , P.O . Box 1117 4 , Eon o lulu , Eaw ai i 96 82 8 , D.S .N

TQ A D FA A P K M T N c

A D IO S is a tr ad en a rk o f T h e S o f t W a r eh o u s e . A p p l e I I r r e f e r r e d t o th r o u g h o u t t h i s n a n u a l , i s a r e g i s t e r e d t r ad e m a r k o f A p p l e C o m p u t e r Inc ., 1 0 26 0 B an d l ey D r iv e , C up e rt in o , C a l i f o r n i a , U .S .A .

D T M A TY

T h e S o f t W a r eh o u s e m a k e s n o r ep r e s en ta t io n s o r w arranties w ith respect to the con tents he reof and sp ec i- f ic a l ly d i s c l a im s any im p l ie d w a r r an t i e s o f m e r c h an t i- b il i ty o r f i tn e s s f o r a n y p a r t ic u l a r p u rp o s e . F u r t h e r , Th e S o f t W a r eh o u s e r e s e rv e s th e rig h t t o r e v i se th i s p ubl ication and to m ak e chang es from ti m e to ti m e in th e con ten t h ereo f w ithout ob l iqa tion of Th e S of t W a reb ouse to n ot ify an y p e r so n o r o r g a n iz a t i on o f su c h re v is i o n o r ch an g es .

ii m An K.R 0 F r

T i tl e P ag e ...... i

N o tic e s ...... ii

T ab l e of C on t en ts ...... ii i

1 . In trod uc tion ...... l

2 . Sy s tem R eq u ir om en ts ...... 2

3 . Sy st en S ta rk Up ...... 3

4 . C omm nnd P rom p t ...... 4

5 . C om mA nd Sy n ta x ...... 5

6 . AD IOS C om mn nds ...... 7

7 . L ine Ed iting F ac il ities ...... 11

8 . N on-s tAnda rd le Ch a rac ters ...... 12

9 . The D iskcopy rt il ity ...... 13 l 0 . Er r o r M e s s a g e s ...... 1 4

1l . App l icat ion P rog rmm m ing G u id e ...... 16

A P P E N D I C B S

App end ix 1 : Mom ory MAp ...... 1 8

App end ix II : Zero Paq e U sag e ...... 1 9

App end ix 111 : J nm p T Ah l e ...... 2 0

App end ix rV : C nm mand Snmm A ry ...... 21

In d ex ...... 2 2

iii M I0 S - 8l R ef e ren c e M An ua l

l . In t rM uc t ion

T h e A p p l e 1 1 C o m p ut e r h a s b e c o m e e sp e c ia l ly p o p u l a r in th e e d u c a t io n a l an d en g in e e r in g f i el d s . T h i s p ro v id e d T h e S o f t W a r e - h o us e w i th a st r o n g in c en t iv e t o n a k e th e m U K A T H Sy e o l ic K a t h Sy s t e m a n d K U L IS P L IS P L a n g u a g e Sy s t em av a il ab l e o n t h e A p p l e I I . H o w ev e r , th e l a r g e s i z e o f m u M A D an d n UL I S P m a d e i t n e c e s s a ry t o c r e a t e a n o p e r a t in g sy s t e m w h i c h u s e d l e s s m e m o ry s p a c e th a n t h e A p p l e X S .

The Apple D isk In terf ace and ON ratàng A stem is th e resul t. M IQS- 8l is a sp ac e eff icien t and f lex ib l e op e ra tin g sy st em f or the A p p l e II . It i s a s i n p l e sy st em t o u s e a nd f u l ly s u p p o rt s : 0 th nlu M c an d m UL IS P . S in c e M IO S is a g en e ra l p u rm se sy st em , it c a n supm rt use r w ritt en 6502 m ach in e languag e app l ication p rog rr s as w e l l .

ADIOS supports console I/o and sequential disk I/O f or up to s ix d is k d r iv es . A H l ica ti on p rog r am s , s uch as m US IM P a n d m UL ISP , c a n e a s il y b e l oa d e d a n d r un u s in g s i m p l e M IO S co m m a n d s . Q th e r com m ands d isp lay d irec to ry in f o rm a tion , f o rn at d isket tes , and p e r- f orm f il e m ain t en ance , includ ing th e sav ing , ren am ing , copy ing , and deleting of disk f iles. Access to the App le 11 K on itor (either the Autostart ROM or M onitor K M ) is gained through the use of an other M IOS C o n m an d .

l A D I0 S - 8l R e f e ren c e M a nua l

2 . qyste- Reqgir----ts

T h e A D IO S - 8 l o p e r a t in g sy s t e m r e q u i r e s a s a m in i m u m t h e f o l low in g con p u t er ha rdw a re in or d e r to op e ra t e :

1 . A n A pp l e 11 o r A pp l e 11 Pl us C om p u t er

2 . At least 48K (48 kilobytes) of RAM memory

3 . A t l ea st o n e stA nd a rd A pp l e 11 d is k d r iv e w ho se con t ro ll er c a rd is in s ta l l ed in p e r ip h e ral ca rd sl o t #6

4 . A pp le D os v er sion 3 .3 w b ich rec ord s 16 sectors p er track on th e diskette (If you are using an earlier version of Apple DOS, a 16 se c to r R O M f o r y o u r d is k co n t ro ll er c a rd is av a ilab l e f ro n y o u r App le dealer.)

F o r sy st em s hav in g n o r e th a n on e d isk c o n tr ol ler ca rd , in sta l l th e sec on d c a rd in sl o t #5 an d th e th i rd c a rd in sl ot # 4 .

2 AD IO S- 8l R ef erenc e Mn nual

3 . #gstem Senrt Up

T o st a rt u p A D IO S s i m p ly tu rn o n th e c o n p u t e r an d i n s e r t an A D IO S d i s k e t t e in d r iv e 1 . If y o u r A p p l e h a s th e A u t o st a r t R O M , AD IO S should boot aut om atically . App les w ith th e M on itor Ro M n ust b e b o oted by ty p in g th e n um b er 6 f oll ow ed by

M prvR 1 ( M Iœ -8l Y AIœ Y * /A

(dd) Approprïate numbers will appear f or the version nont.h (mm) , day , and y ea r lyy ) . Th is v ersœon date should be inc luded in all inq u i'res conc ern in : A D I0 s. Im m ed iat ely b el ow th e head e r m e ssag e is th e A D IOS p rom pt . The sign if ica nce of th e p ro m p t is fully desc ribed in th e n ext sec t ion .

M a l te rn a t iv e w ay to st a rt up M IO S is f rom Ir m O BM IC CI or A PPL ESOFT BM ICtm . E ith er of the f oll ow ing RAK IC com m and s w ill d o th e tr ick :

> #6 o r PR #6

O n c e A D IO s is s t a r t ed , A D IO S c o m m an d s c a n b e en t e r ed a s de sc ribed in sec t io n 5 .

3 M IO S - 8l R ef e r en c e MA n u a l

4. 0 - -u pr+

The AD Iœ c o m m an d p ro m p k con s ists of tw o cha rac ters d isp lay ed b y th e c o m p u t e r n e x t t o th e l e f t m a rg in of th e sc r ee n . T h e f i r st p ro m p t c h a ra c t e r is a d r tv e a u m b e r b e tw e e n l an d 6 ; t h e se c o n d c h a r a c t e r i s a r ig h t p a ren th e s i s . T h e p ro m p t in d ic a t es th a t th e sy st em i s r ea dy to a c c ep t a n M IO S c o m m an d . T h e c o m n a n d s a I e d esc rib ed in S ect ions 5 and 6.

AD IOS ca n sup p o r t up t o 6 d is k d r iv e s . T h e av a i l ab l e d r iv e s a re ref erred to by a sing le nun b e r f rom l to 6. T h is is in con trast t o A p p l e D 0 S w h e r e b o th a p e r ip h e ra l c a rd s l o k n u m b e r an d a d r iv e n u m b e r a r e n ee d e d t o sp e c tfy a d r iv e . M IO S d r iv e s 1 an d 2 a r e d r iv e s l an d 2 o f s l o k # 6 ; A D IO S d r iv es 3 an d 4 a r e d r iv e s l an d 2 o f s l o t # 5 ; a n d M IO S d r iv e s 5 a n d 6 a re d r iv e s l a n d 2 o f s l o t # 4 .

The number disqlayed in the prompt is the drive nunber of the cu zren tly l o g g e d d r iv e . The sign if icanc e of the logged d r iv e w ill b e exp lained shortly .

4 A D I0 S- 8l Ref eren c e MA nual

5 . rnm-nna #yn+nv

ADIOS com mands take the form of a co- mand word: a spacl, and the c o m m a n d a rg u m e n t s , if any . The c om m and is n o t ac tual ly zssued un t il

rx m l r-z -u

f o l l o w ed by a . F o r th o s e w h o d o n 't g e t a th r il l o u t o f ty p in g : the C ATALOG c om m and can be abb rev ia ted to :

r A T

A s a m a t t e r o f f a c t , o n ly th e f ir s t O r ee ch a r a c t e r s o f a l l c o m m a n d s a r e c h e c k e d ) any ex tra ch a rac t ers a re ign o red . Th u s , th e f ollow ing com m and w il l also p roduc e a d ir ect ory list ing :

cm w zœ

Unl ike the CA TM X com m and , m ost M IOS com m ands req u ir e on e or two f ile namqs be given f ollowing the command word. Such a fàle n a - e sp e c if ica t i on (o r fn s f or short) con s ist s o f a f ile nam e ' f o ll o w e d b y a p e r io d f o l l o w e d by a f il e ty p e . A f il e 's n a m e a n d type consists of the upm r-case letters and/or numezals displayed by th e C A TA L X co n m a n d . T he n a m e c an b e up to t en cha ra c t er s lon ç ; th e f ile ty p e can b e up to G ree cha ract ers lon g . F o r inst anc e , tà e fn s f or a f ile nc ed APPL C of t> e P IE is *APPL S.P IM .

In o r d e r t o sp e c ify a f il e on o th e r th an th e l o g g e d d r i v e r th e f n s c a n b e p r e c e d e d b y t h e o t h e r d r iv e n u m b e r a n d a c o l o n . F o r ex an p l e , if th e l o g g e d d r iv e is c u r r en t l y l a n d y o u w i sh t o d e l e t e the f ile A PPL K P I: on d r iv e 2 , issu e the f oll ow ing c om m and :

D = .- 2 zA v .a .P zE

M a l t e rn a t iv e m e th o d o f d e l e t i n g tà e f i l e i s t o c h a n g e th e l o g q e d d r iv e f ro m l t o 2 a n d tà en d e l e t e th e f il e . T h i s w o u l d b e accon pl ished by th e f oll ow ing tw o M IO S com m a nds :

2 : D c Ap W .2 .P IE

In gene ral , to sw itch logg ed d rives , siz p ly en ter the des ired d r iv e n u m b e r f o ll o w ed b y a c o l on . T h e r e a f t e r , A D IO S w il l d i sp l ay tà e new l% g ed d riv e in th e p rom pt .

W h e n i s s u in g a n A D IO S co m m an d th e r e a r e tw o b a s ic ty p e s o f e r r o r s w b i cb c an o c c u r . If tb e c o m m a n d l i n e r ea d e r is un a b l e t o rec ogn iz e a con m and , a sy n ta x e r ro r occu rs. Th e oth er ty p e of error is usual ly th e result of in suff icient disk space or try in g to read a non-existent f ile (see section 10 f or details) . For either tym of

5 M I0 S- 8l R ef eren ce Mxnual

e r r o r , an aud io wb e ep * i s s o un d ed a nd th e AD lo s p ro p pt ts red i s- Ptlo ayreed- eodni t thteh en epxrte vliionues. coMmm adneds cMridb etdr yi na gsaeicnt.i onC o7é naznt dsi s w jgIcshs ibalree successf ully accom p lished do not resul t in a beep , and a b lank line is output before the ne xt p rom pt is d isp lay ed.

6 AD IO S- 8l R efe rence MA nual

6 . A D IOS C - *n8 =

Th is sect ion l ist s th e av ail ab le AD IO S com m ands in alphAhe t ica l - o r d e r . T h e f i r s t t h r e e c h a r a c t e r s o f e a c h c o m m a n d w o r d a r e i n bold face to em phas iz e th e n and at ory pa rt of th e w ord. Th e com m and w o r d i s im n e d ia t e ly f o ll o w e d b y a sy m b o l in d i c a t in ç t h e ty p e o f argun ent ls) the com m and requires, if any. Pile nan e specifications req u ired for c om m and argum en ts a re abb rev iated as fn s. F inal ly the ef f ec ts of eac h com m a nd a re d e ta il ed .

W h en an ap p l ic a t i on p rog ra m is ru n un dp r AD IO S , it is f i rs t loaded in to an a rea of m em ory ca lled the A p p l ic a t i on P r og r a m A r e a . Th e A PA beg ins at m en ory locat ion $1000 (1000 hexad ecim al). T h is r e l a t iv e ly l a r g e b l oc k o f m e m o ry i s th e g e n e r a l P u r p o s e Ww o r k in g s t o r a g e / a r e a f o r A D IO S . I t i s u s e d b y s e v e r a l o f th e A D IO S c om m and s l i sted b el o w .

6 .l CATALOG (Catalog CommAnd )

Sy n tax : FA T AL OG

The CA TA LOG com n and d isp l ay s al l th e A D IO S fil es o n th e d isk in t h e l o g q e d d r iv e . S p e c if i c a l ly , ea c h f il e ls s iz e , n a m e , a n d ty p e a re d i sp l ay ed i n th a t o r d e r . T h e s i z e o f th e f il e i s g iv e n a s a d e c im a l n u m b e r o f k il o b y t e s . A l s o g iv e n is t h e n nm h e r of k il oby te s o f f re e st or ag e av a il ab l e on th e d i sk .

6 .2 DCLETE (Delete Comm and)

Sy n t a x : D r .r E fn s

T h e D E L E T E co n m a n d e r a se s th e f il e sp e c i f i ed by fn s f ro m th e d i re c t o ry . T h e sp a c e u s ed b y th a t f il e th en b e c om e s f r e e f o r re- use . N a tu r a l ly th is com m a nd sh ou ld b e us e d w ith ca re .

6 .3 FQRMAT (Form at Com m and)

Sy n ta x r Pn PM A T

T h e F O Q M AT c o m m A na f o rm a t s a n ew d iske t t e on th e l og g ed d r iv e . It also in itializes th e AD IOS d irecto ry (See the IN IT IA L IZE con m and , Section 6.5).

T h i s c o m m a n d e r a s e s a l l th e f il e s o n th e d i s k e t t e in th e logg ed driv e and sh ould b e used w ith ca re.

6 .4 GW (Get Sy stem Commnnd )

7 AD IO S- 8l R ef erence M an ual

Sy n ta x : G E T

The G ET con n and reads th e AD IO S sy st em reco rded on the sy s t e- t racks (i.e. tracks 0 and 1) of the logged drive and loads then in to m em ory beg inn ing at th e ba se of th e Apm W hen th e G ET and PUT com m an d s a re used in su cc ess ion , th ey effec t iv ely tran sf er a copy of the AD IOs op e ra ting sy st em to a new d iak .

F o r th o s e f e w u s er z w h o w ïl l h av e t o m o d ify A D IO S f o r s om e rea son , the follow ing m em ory m ap giv es the loca tions w here th e G ET com m and l oad s the va rious sec tion s of AD IOS in n em ory .

$1000 Rnnt Loader (stored on track 0 , sector 0) $1100 Logical I/O routines (ultA'mntely loaded at $800) $1800 Physical I/0 routines (ultimately loaded at $B800) $2000 Commxnd Processor (ultimately loaded at $B000) $2600 End of data

W h i l e in n e m o ry an d u s in g th e A p p l e n o n i t o r , A D IO S c a n b e m o d lf l e d , a t y o u r o w n r i s k o f c ou r s e , b e f o r e u s in g th e P U T com m and to re sav e kh e sy st en on a diskette.

6 .5 IN ITIALIZE (Initialize Directory Command )

Sy n t a x z TM TT IA L I Z :

T h e IN IT IA L I Z E co m m a n d c l e a r s th e A D IO S d i r ec t o ry o f a l l e n t r i e s . I t s h o u l d b e u s e d if th e SC Z A M B L E D D IR EC T OR Y e r r o r n essage occurs (see Section 10).

W A K N T M Q T h i s c o m m a n d e ra se s a l l f il e s in th e d i r ec t o ry o n th e d is k e tte in th e log g ed d r iv e an d sh o uld b e u sed

- w i th c a r e .

6 .6 IN# (Input Commnnd )

Syn tax z IN # slot nllm he r

T h e IN # c o m m a n d d e t e rm in e s th e s o u r c e of c o n s o l e in p u t t o AD IQS. N o rm ally input is from th e A pp le k ey b oard ; how ev er, the IN # c o m m an d c a n c h a n g e th e so u rc e to a ny d e s i r ed s l o t . I t s e ffec t ts s im ila r to t: e BAS IC IN # com m and . S ee pag e 83 of the App le 11 M anual for details! Rem en b e r to pu t a sp ace fol low in g the com m and w ord a s is req u ared in all AD IOS c om n and s.

6 .7 LOAD (Load Cnmmmnd)

Sy n ta x : T'm n fns

Th e LnAn com m and reads th e fil e fns f ron th e d isk and loads ic in t o m e m o ry b e g in n in g f r om th e b a s e o f th e A P A . T h e f il e

8 A D IO S - 8l R ef e ren c e M a nua l

c o n t en t s c an th e n b e ex a m in e d a n d m o d if ied u s in g th e M O N IT O R c om m a n d .

6 .8 MON IX R (Monitor Commmnd )

Sy n ta x : n lm a

Th e M O N IX R c om m an d e x i ts M IO S en t i rely and tu rn s con tr ol ov e r to th e A pp l e 11 M on ito r in RO M m em o ry . W h il e in th is n od e th e AADppIlOSe 'sl inormal line edit routine is in ef f ect instead of thj n e e d i t o r . T o r e t u rn to A D IO S , u s e th e M o n i t o r ês MG com m and to jum p to th e w arm styrt locatign at $800 orp if it has not been dastuzbed w hile In the m onitor, y ou can jum p directly to the M los com m and proceszor at $B000.

6 .9 MQVE (Move Co= and )

Sy n ta x l m f n s l , fn s 2

The M OV E com m and m ake s a copy of fn s l and nam e s it f n s2 . Th is co m m an d h a s th e ad v a n ta g e tha t it d oe s n ot d i sku rb a n ap p l ic a- t i o n p r o g r a n r e s i d in g i n t h e A P A . H o w ev e r , M O V E i s v e ry s l o w f o r l a rg e f il e s . A m u c h f a s t e r w ay t o c o py a f il e i s t o f i z s t use V e LnAn com m and to l O d th e f il e in t o m em ory and then th e jAVE comnand to save khe f ile under a new nane or on a c if f e r en t d i sk et te .

6 .l0 PR# (Printer Commnnd)

A ntax : PR# slot nllmher

The PR # com m a nd de term ine s th e dest ina t ion of M IO S cha rac ter o u tp u t . N o rm a l ly ou tp u t is t o th e 40 c ol um n A pp l e sc z een . T h e P R # c o n m a n d c a n c h a n g e th e d e s t i n a t i o n t o a n y d e s i r e d s l o t . Its ef f ect is s im ilar to th e BM IC PR # com m and . See pag e 83 o f the V ple 11 Manual for de tails. A space is r< uire f ollow ing the c om m and w ord as in all M IO S c oa and s.

6 .ll PDT (Put System Command )

Sy n ta x : M

Th e PUT com m and w rites on to th e f i rst tw o tr acks of th e d isk a m em ory im age beg in nin ç f ron the b a se of the Y K N o rm al ly thi s com m a nd is is sued im m ed ia tely f ollow inq th e G ET con m and , m ak ing p o s s ib l e t r a n s f e r s o f th e A D IO S op e ra t in g sy s t em t o n ew ly f o r m a t t e d d i s k s . N o t e th a t th is c o n m a n d d o e s N O T d e s t r oy a n ex istin q M IOS d irec to ry o r any f il es on the disk rec e iv in g th e ne w sy st em .

9 AD I0 S- 8l R ef e zenc e MA nu a l

6 .12 PKMAM/ (Rename Commnnd )

Sy n tax : Q RM AMA fn s l , fn s2

T h e R E N A M : c o m n a n d s i m p l y r e n a m e s f n s l t o f n s 2 in t h e d i r e c t o ry . E n l i k e th e M OV E c o m m a n d , n o c o py in g o f t h e f il e

0 C C u r S .

6 .13 RUN (Run CommAnd )

Sy n ta x : pn M nam

T he R ;N con n and loads th e ap pl ication p ros ram fil e w hose nam e i a n a m a n d w h o s e ty p e is C 0 K in t o m e n o ry b e g in n in s f rom t h e b a s e o f th e A P A . I t th e n b eg in s e x e c u t i o n o f th e ap p l ic a t io n program by jum ping to location $1000. If the R;N conm and is given no argum ent, a jump is nade to location $1000 perm itting r e- e n t ry ln t o an ap p l ï ca ti on p r o g r am l l k e R US IM P . T h i s is con ting en t , of cou rse r on th e A PA not b e ing d istu rb ed since th e app lica tion p rog ram w as loaded or run .

6 .14 SAVE (Save Commmnd )

Sy n tax : SAV E fn s num

The SAV E com m and c rea tes a new fll e nam ed fn s con sist ing of a m em o ry im ag e b eg inn ing f rom the ba se of th e A PA for a leng th of num kiloby t es . num w il l b e the num be r d isp lay ed by th e CATAL QG co m m and fo r th e new f il e .

6 .15 TYPE (Type Commxnd )

bl nkax r TVPE fns

T h e T Y P E co m m a nd d i sp l ay s th e t e x t f il e fn s o n th e A p p l e s c r e e n . T h e d i sp l ay c a n b e 'f r o z en l a n d t h e n re s ta r t e d b y us ing

1 0 A D I0 s- 8l R ef eren c e MA nua l

7 . L ine pA *'+ A-nq Fac il it ies

Q c c a s ion a l ly z ty p ing e r r o r s w il l b e M a d e w h e n en k e r in g A D IO S c o m n a n d s . A s l on g a s th e c om m a n d h a s n o t b e e n t e rm in a t ed b y a

L àn e e d i t i n g is don e th rough th e use of co n t r o l ch a r a c t e r s and th e left and righ t a rrow k ey s on th e A pp le 11 k eyb oa rd. AD IO S line ed i tin g f ac il ities ar e very sim il a r to those norm a lly av all able on the Apple , except for the lack of escap e cod es . The best w ay to qet th e pf e el * o f AD IO S l in e ed i tïn q i s s im p ly t o exp e ri m en t w i kh œt. The fo llow in g desc rip tion is p rim a rily fo r ref erence p urp o ses .

Th e cur zen t lnp ut l ine is st ored in a 256 cell nhn ract er H zffer and henc e th is is th e m ax in un leng th of a co n m and. Ch a racter s ar e d isp lay ed a t th e cu rren t cu r s o r p o s i t i o n as th ey are en t ered .

T o en ter a c on t r o l c h a ra c t e r in a lin e of tex t, p re ss and th e n ty p e tb e d e s i r e d c o n t z o l c h a za c t e r . T h e c o n t r o l c h a r ac t e r ent ered in this w aY is display ed in rev erse video.

The lef t and riqht a rrow key s (i.e. *<-- * and *-- >M) and

T b e r i g h t a r r o w c a u s e s p r e v i o u s ly e n t e r ed c h a ta c t e r s t o b e r e s u r r e c t ed a n d r ed i sp l ay ed o n th e sc r e e n . S im il a r il y , ty p in g can be used to resu rrect the p rev iou s ly ty p e d l àn e of text fo r re- ed i t in g .

11 AD IO S - 8I R ef eren c e Mn nua l

8 . N ln- s+ nnd A td '4g le Ch n tne + ors

The s en nd ard App l e k ey b oard and 40 colum n d isp lay sc reen lac k eight of th e les s com m on ASC I I cha ract ets. KD IO S m akes it Po ss ib le t o e n t e r t:ae s e ch a ra c t e rs b y u s in g c o n t r o l c h a r a c t e r s in th e i r p l ac e . Th r ee oc tb e eigh t ch a racters a te av ail ab l e on th e 40 colun n s c r e e n . T h e o th e r f iv e ch a ra c t e r s a r e o u dp u t to th e s c r e e n a s sim ll ar l ookin g ch a ract ers in inv erse v id eo.

T h e f o l l o w ln g ta b l e l l s t s th e s e c h a r a c t e r s , th e eq u lv a l en t con trol cha racke rs to en t er inst ead r and th e App le sc reen cha ract ers w hlch w ill be d isp lay ed in their place.

Ch a racter Norm a l Con tr ol App l e Sc re en N am ê c h n rmn e o r C b a r ac t e r C h a r ac t e r

Left bracket ( (

Backslash N

Jnd e r sc o r e - CCT R r.- E : -

Left brace (

Right brace l tCTQT,-0: 1 (Inverse)

Back accent *

Vertical bar 1 o-w 1 (Inverse)

Tilde * KCTNL-T: * (Inverse)

A s is usual on tà e App le r

12 AD IOS - 8I R ef eren ce MA nual

9 . The D iskco/ f U* llity

T h e d i s kc o p y u t il ity p ro v id e s a c o n v en i en t m e an s o f c o p y in : AD IO S d i s k e t t e s . It s h o u l d b e u s e d t o n a k e a w o rk in g c op y o f y o u r m ast er disket te as soon as P ossibl e af ter receiv ing it. Th e ut il ity cop ies the s o u r c e d i s k e t t e in its en tirety on to th e t a rg e t d is k e t t e .

V A Q R A l l i n f o r 2 a t i on c u r r e n t l y o n t h e t a z g e t d i s k e t t e i s e r a se d w h e n th e d i s k c o p y u t il ity i s u s e d .

T herefore , w h en lea rn ing to use th is util ity , it is a go od idea to p u t a w r i t e- p r o t e c t ta b o n t h e s o u r c e d i s k e t t e t o p r ev e n t inadv ert ently era sing v aluab l e in f orm at ion.

The targ et d isk ett e m u st b e fo rm at ted b ef ore usin g the dlskcopy ut il ity . T h is can be done us ing th e FO QM A T com m a nd a s de sc rib ed in s e c t i on 6 .3 .

T o run th e u t il ity , b e s u r e a c o p y o f th e f il e D IS K C O PY .C O K i s on th e logged d r iv e. Th en sim p ly issu e the fo ll ow in g AD IOS c om m a nd fol low ed by a t

F r o m th is p o in k on , th e sy st e m w il l g iv e se l f -e xp l an a t ory p rom p t s o n h o w to p roc e e d . F o z t w o d r iv e sy s t em s i t is s im p ly a m a t t e r of sp ec ify in : th e so u r c e d i sk d r iv e n um b e r an d th e ta rg e t d isk d riv e nnm h e r . T he cop y ta kes ab ou t a m in ute .

I f th e sa n e d r iv e n u m b e r i s g iv en f o r th e so u r c e a n d t a zg e t d isk d r iv e s , the d iskcopy ut il ity assum e s tha t a sing le d r iv e sy st em i s b e in g u s e d . U se r s o f s uc h sy st em s v il l na tu r a l ly h a v e t o s w ap d iskettes sev eral tim es in ord er to m a ke a copy . The ut ility w ill ind icat e w h ich d iskette to in se rt by x ean s of p rom p t ing . S ince it i s p o s s ib l e to q e t th e so u r c e a n d t a rg e t d i s ke t t e s c o n f u se d w h il e sw app ins th em , w e st rong ly recon m end a w r it e- p ro t ec t *n h b e p u t o n the sou rce disk ette h oFore beg inn lng th e copy .

1 3 AD IO S- 8l R ef e ren ce Ma-n. ua1

lQ . E rrot M ae sages

T h e f o ll o w in g is a l i s : o f th e e r r o r m e s aa q e s w h i ch c an o c c u r w h il e op e cat inq Im d e r A9 f0 S .

10 .1 m - R EAD D ISK

Tf th e A pp l e is un a b l e to r e ad a n e ed ed s e ct o r of in f o rn at i on f rom the d iskett e, this m essage w ill occu r- It usual ly resul ks from try ing to read an un f orm at ted d iskette.

1 0 .2 W P TY R- D TIK

If an at tem pt is m ade vft w rite iafotx at ion on a w rite-p rotect ed d isk ette , th is m es sag e w ill occu r. If the w rite-p ro tec t 1Ah is r e x o v ed , th e E.E - T RT op t f oh ca n b e u s e d k o p roc e ed w i th th e w rît p .

1 0 .3 R An O R U N Fo p K k'sl r D TS K

I f an a t be n p t ts m ad e t / w r ik e o n a d e f ec k iv e o r tln f o r n a t t ed d iske tte , th is rhpssaq e w-11I G xlu r. r ne FOPUMA T com m and can be u s e d t o r e f o r m a t th e d l s k e t t e ) h o v ev e r , r e m en b e r to t r a n s f er any good f il es to ano th er d i skett e b efo r e fo rm a tting .

1 0 .4 Kr Q -- - T./ n D T Q RrRn E Y

Th is er ror occu rs w h en th e di rect ory inf orm ation on a d iske tte is not in the p rop e r AD IQS fo rn at (e.g . an Apple D OS fo rz a tted d iske tte). S ince th e re is no oth er satisfactory alternative, c o n t r o l is t ran s f e r r ed to th e A p p l e R O M m on it o r af t e r t h ï s m e s s a g e i s d ï s p l ay e d . T h e IN I T c o m m a n d w il l lc l e a n u p '' a s c r a m b l e d A D IO S d i r e c t o ry ; u n f o r t u n a t e ly h o w ev e r , i n th e P roc ess it d el et es any ex ist ing fil es on th e diskette .

10 .5 HN ARK A TO PnDM AT D TA K

T h i s m e s s a g e w il l on ly oc c u r w h il e u s i n g th e F O R M A T c o m m and . It is usu ally cau sed by a d efect ive d iskette .

10 .6 TR In PF IC TER P D TA K SPAr R

Th is m essage w il l only oc cu r w h il e using th e SAV E com m and . It in d i c a t e s th a t th e r e i s n ot en o ug h f r ee sp a c e on th e d i s k e t t e t o st or e th e f il e b e i n q sa v ed . So n e o th e r f il e s n u s t b e d e l e t e d o r a n o th e r d i s k e tt e n u s t b e u s e d if th e f il e i s to b e sav ed .

1 4 AD Io S - 8l R ef eren c e M a n ua l

10 .7 P IL E TCO T'/R

Th is m essag e w il l only occur w h il e us ing th e LOA D com m and . It in d i ca t e s th a t th e f il e b e in g l o a d ed i s t o o l a rg e to e n t i r e ly fit in the APA (i.e. 4: kilobytes). How evez, the part that w as l oaded r em ain s in ta ct and is st ill in m em ory .

T h e f i r s t f o u r m e s sa g e s c a n o c c u r e i th e r w h il e r un n in g a n a p p l lc a t i o n p ro g r am s u ch a s D US I M P , o r w h il e p r oc e s s in g a n A D I O S c o n m an d . Th e l a s t th r e e m e a sa g e s c n ly o c c u r v h il e p r o c e s s in g sp ec ific AD IOS c om m and s.

T h e f i r s t th r ee m e s s a g e s w il l b e f o l l ow ed by th e f o l l ow in g av a ilabl e op tion s m essag e :

p.q r x A- SP AM m Ic m c : p M O R EN :

This n essag e tn d ica tes the user h as th ree al t erna t iv e w ay s to h a nd l e th e er r or . Tbe A B O R T op t i on is sel ec t ed by b à t tin g th e

If y ou are ab l e to co r rect th e er roz , for exam p le b:z rem ov in g a w rite-p rotect eAh , th e R E- TR Y op t ion can b e sel ec ted by b ittin g the

F ina l ly , if y o u a r e d a rin g , h i t t in g th e sp a c e b a r w il l ca us e th e e r r o r t o b e i gn o r e d . A D IO S w il l a s s u m e t h e in f o rm a t i o n w a s co rrectly tranqf er zed to or f rom th e d isket te and act ac co rd ang ly . W e do not recom m end usin g th is IG N OR E op t ioq excep t in the m o st dire em ergen c ies .

1 5 A D TO 5 - 8l R e f z renc e M a nu al

Al o Ap pl lca ti oa P rtN r ' '---11-d*

This sec tion is intend ed fo r tho se few ind iv idua ls w ho m ay b e in t eraat ed in w ri.tin: 6502 n htlh iqe ianguag e appl ica tlon p rog ram s to run thn d e r l:e AD IG S op e t-a t in g sy st en . O th ers cm q sa. f e ly xsn o r e th is se c t ion .

AD I-O J r r ov i.d e s a c o n v en t en t , l oq ical in rezf acc De tw een app l i- ca tiop p rcg r ex s and t1 e Jp p l e T1 ha rdw a re. C om m u nica tlon w ith b o th the console and disk is v ia 1/0. Faciiities atc prov ided for c r ea t in g : w r i t in g l a n d c l o s in g d i s k f il e s , a s w e ll a s f o r op e n in g and read ir g d isk f zl es . np tt, 6 d civ qs can b e suppr ztcd.

Apv lica tion p rog rax s c> 4 rece ive cha rac t era dlrec tly fron th e k efrb o a ro o r f r o m a t l n e l n / u t b ù f f e r . r a zn g t= e œn p u t b u f f e r autom a tica lly p rov id es the app lica tion w ith Llze s tanda rd AD IO S line ed iting features (see s ection 7). The cu rrent key boa rd , or input s a u r c e , an d k hc c u z l e qt z c r e et', o z o u tp u t z im k : a I u d e t e rm l n e d b y tile A P IO S TN ; a nd PR # co p m a nds re sp e c t iv ely .

M ach in e language p rog ram s use th e F i l e C o n t r o l B l o c k , o r F C B , to sp ec ify a d r iv e n um b e r an d f il e nn m e and ty pe w hen ca l l in g A D IO S ro.-lt in as. T he FCB b eq in s fzo n loc a zlon $ûr e anu snou ld con tain in f orm at icn form a bted es fo llov z :

ld l name ltype l

Tlocatioq f4o a $P2 0: 0 l 2 3 4 5 6 7 8 9 A B C D

*d * s t a n d s f o r a d r iv e n u m b e r in th e r an g e o f 0 t o 6 . N u n b e r s b etw eer l an d 6 ip d lsca ie rb e resfe c live d r lv e. A d xiv e n um b er o f 0 in d i c a t e s t h a t th e l o g g.e tq J r tv e s h o u l d b e u c.e d . : h e n a m e f i e l d consis tc o f l to 1: stand e rd A sf'J -, (ah a rac dters Jadded w i/ l suffic ien t ASCII spaces (i.e. a binaçy num b-r 6.20) t-o fill the -rield. The type f i e l d c o n s i s t s o f l t o 3 c h a r a c t e r s a l s o p a d d e d w i th s u f f i c i e n t sp a c e s t m f ià l th e f ield .

#a 1 ADI0S Iautines are accessed througlA a jn-é kable located at $800. The follow ing is a description of the 11 e Al--xy points in the ta b l e l

$8:4 A j um p ko th is location effnatilrely term inates a running app licat ion p rog ram . T he An lo s C ow m n n d P z rw e s s o r iL loa d ed and th en run , resu l ting in th e M IO S p rom pt .

$803 This routl ne returns the 5502 qero fl.aq %.>t 1 : a.îlz.i onlr if no c h a r a c t e r h a s b e en ty p e d o n th e A p p l e kn y b oa rtl. N 'nt e : E v en if th e A D JO S IN # c o m m a n d b m s c h a n c m d th tt Ln l u t s t-zllr .7e k o a n ext e rna l k ey b oa rd , th is rou t in e w il l st il l ch ec k th e st a tu s o f th e A pp l a k ey b oa rd .

1 6 AD IOS- 8I Reference Manual

$806 This routine inputs a character from the current input source, n o rm a l ly th e A pr l e k ey b o a rd , a nd re t u rn s i t a s a n A SC I I c h a r- ac te r in the accum ula to r. T ru e A EC II is retu rned w ith th e hig h b i t s e t t o z er o.

$80 9 This routine outputa the ASCII character in the accun ulator to the cu rren t ou tput s in k : n o rm al ly tbe 40 c olum n Apple sc reen .

$80C This routine returns in the accum ulator the next ASCII char- a c t e r st o r ed in t: e l i n e in p u t b uf f e r. T h e 6 5 0 2 c a r ry fl a g i s se t i f a n d o n ly if tb e Am lo s l in e e d i t o r h a d t c b e c a l l ed t o inp u t ano th er line of tex t

$ 80F T his routin e op en s an ex ist ing f il e for inp ut. Th e dr iv e n um b e : a n d f il e na m e a n d ty p e g iv en in th e PC B i s u se d in a dir ectory search for kh e fïl e. If th e fil e is f ound : ït as m ad e the cu rrent inpu t f il e and th e 6502 ca r çy flag is returned set ; oth e rw ise , it is rese c

$812 This routine returns th e next byte read from khe current input f ïl e in th e a c c um ul a to r . Th e c a r ry fl a g i s r e tu rn e d z e s e t if an d on ly if an a t t em p t w a s m ad e t o r ea d p a s t th e en d o f th e f il e .

$81 5 This routine creates a new file for output. The drive num ber an d f il e n am e a n d ty p e g iv en in th e F CB is u se d t o m a k e a n ev d irectory en try for tbe f il e. The ca rry flag is returned rese t if an d on lr if th e rout ine w as unsuccessful.

$81 8 This routine w rites the byte in the accum ulator to the current o u tp u t f il e. T h e c a r ry fl a g i s r e t u r n e d re a e t if an d on ly if th ere is in suf f icien t room on th e d iskett e to store th e f il e.

$ 818 This routine closes the cu rren t ou tpu t f ile and m od if ies th e d ir ectory to refl ect th e f act . Th e ca rry fl ag is re tu rne d zese t if and on ly if th e sy stem is unnhl e to clo se tàe f il e ? p rob ab ly beca us e of L-œ u ff ic ien t d isk sp ace .

$ 81 E Th is coutine outp uts to the cu rrent outp ut sin k the ASC II n essage ïn n ediately follow lng the call to $8lE. The end of tàe m e s s a g e i s in u i ca t e d b y a û by t e . T h e f c l l o w in g is a ty p ic a l use of th is y ub rout ine :

JSR ;8lE DB 'IF E QU IC R BaoAr F0x ',0 O A m y l

* * *

$821 This ïs n ot an entry poinc but a by te w nich contains the nun be: o f Lh e l o g g e d d r iv e . I t is in i t ia l ly o n e an d is n o riua l ly changed b y tb e ADIOs change logged dizk com n and (see sectioz) 5).

The jum p table inform ation given above is summ arizcd in A p p e n d i x 1 1 1.

17 A D

3 - -x I z > -- -ry M p

A' d ress Fuqc t lco

$000-$0FP Zero page special locations

$l;C -$l'r Hardvara atack

$2:0-$22P Ltna input buffer

$400-$7FF Text and LO-QF-q grapbics screen memory

$800-$PFF Logical ADIOS operating syate u routines

$l000-$AFPF Applica tion Program Area (APA )

$B000-$B5eF ADIOs Cnmmmnd Processor (ACP )

$B6û0-$B6FF Disk input buffer

$B700-$B7FF D isk output buffer

SB8OO-@BFFF Physical disk I/O routines $C000-$CPFF Apple 11 I/O ZOM locations*

$DG00-$F7FP Intege: RXIIC RDM or Applesoft BASIC ROM

$F 800-$FPFF Monitor ROM or Autostart ROM

If M l c ro s o f t 's RA M CA R D K M , o r eq u iv a l e n t , i s p r e s e n t , i t rep l ac es th e RO M m en o ry from loca t ion $D 000 to $F FFF w i th RA M m em o ry .

* S ee App l e 11 R ef er en ce M a nua l

1 8 AD IO S- 8l R ef e ren ce Mn nual

iz II z Ze ro Pag e Usaç e

The follow ing table ind ica tes th e use of a pag e zerb m em ory - loca tion by th e A pp l e m on ito r w ith an *M L AD IOS p ag e zero usage is ind ica ted by >X *s .

I$0 $1 $2 $3 ;4 $5 $6 $7 $8 $9 SA $B $C $D $1 $F 1

$0c l 1 I l $l0 l I l I $20 l M M M M M M M M M M M M M M M M 1 l I

l l $40 I M M M M M M M M M M X X X X M M I I I $50 l M M M M M M l l l $60 l X X X X X I I l $70 l X I I I $80 l X X X X X X X x X X X X X X l I l $90 1 l l I $A 0 I x I I I $B0 I X I I l $C 0 I X X X X l l I $x I X I I l $Ec I l I I $P0 I I

1 9 A D IO S- 8l R eference Mnnua l

- III r J up p T Ah le

h a a r o A m n ln e t q'o n

$800 Tr nd and run the ADIOS ACP .

$803 Apple keyboard character ready status.

$806 Input character from input source . (unbuffered l x

$809 Output character to output sink .

$80C Input character fron line input buffev-

$80F open a file for input .

$812 Read next characteg from current input file .

$815 Create a new file çor output .

$818 Write a character to current output file.

$818 Close current output file .

$81: Print m essage follow inq call to screen .

$821 Current logqed drive nnmher .

20 M ZO S - W R ef erence Mmnua l

M R QW W Z C *RZ

r . .wa c yx .

r.Am T.œ D ispl ay ca talog of k il e s

D R r.m E f n s D e lete f il e fn s

FOR MA T F o rm a t d isk rq d ef a ul t d z iv e

c e G et op e rating sy st e in to R M

> # slot nllm her ' Input f rom slot nllmher

IN IT In it aal ize d irectory

rn an fns L oad f il e Vn s in to RAM .

MO M IT OR J um p to M on i to r ROM

KO VE fn sl , 214s2 C opy f ïl e 'nsl to fn s2

PRf slot numher output to slot nnmher

PUT Put op e ra tinq sy ste n on d is k

D EM AM E fns l , fn s 2 R enam e f il e fnsl to fn s2

DrN nan R un n am .coM com mn nd f il e

SAV E fns num Sav e f il e fns of num K -by t es

TXPS fns Gy pe f ile fns on console

21 AD IO S- 8l R ef erenc e Manu al

T n a -

AG om ' = 15 GW 7-8 K Iœ l & Iœ rm -na A = ssor (r ) 16 he er M saça 3 M Iœ o = e. 7 -1 0 W e 11 M crx v ter l Te p/ A iœ t 15 + le 11 < O r lr9 TND TAKIZE 8 + le = ' Ii iv t = ce 16 A llc kiœ Ptœ rc M ea (M A) 7 M W ICIO DZS! SPK F 14 Aœ lic tï œ R œ ra îng M de 16 > # 3 ,8

* 0R r- pMaM DISK 14 jo * le 16,20 > zc m.= nam 3 byte Im 16 lœ ged drive 4 1% G tœ 11 OANO > D I> 14 1% G tiœ fK ilitie 11 cm Tm 5 line o t buff er 16 cav Y 5 IX 8 c* acter M fer 11 cm nd arg- ts 5 Mœ oc > 18 c- na y r+ 4 M R 9 n- na s- 21 m 9 c- na a ntx x 5 cm na w rd 5 op ti= m esR ge 15 cœ trol Y acter (s) 11 œ + t sW 16 ce right no v ce il G -A 12 Prero iG im œ are 2 A B 12 M 9 = -e 12 m # 3 ,9 û> 12 D L 1 2 p - 10 ûM 12 RE-- om ' on 15 LD R 11 pM m N 5 ,11 > 12 > 10 LD V 12 C D X 11 M V E 10 = = M iti= 11 O AMRX DTPG A 14 œ M 12 D K .> 5 ,7 Soft Ware = e , o e i ,ii DTX O W ukility 13 & œ error 5 alM laimer ii e stœ rG r- ts 2 œ ive nle r 4 ,5 e stœ sœ t up 3 systœ tracks 8 Error x s- es 14-15 = 11 ,15 trad- k notice ii e= m e s 11 O E 10

File e krol Bl* (M ) 16 IY ART,R O m RMAT DI> 14 f ile na s- ific tiœ (f> ) 5 F= = = 15 versiœ œ te 3 fns 5 m - 7 = TT E-D- D = 14

22 AD IO s- 8l Ref erence Manua l

zero page usage 19

( left bracket 12 J tight bracket 12 N backslash 12 underscore 12 T left bzace 12 q 1( rïght brace 12 > % ac e t 12 I vertical * 12 * til* 12 - > right arr- key ' 11 <- lV t arrœ key 11

23 July 8, 1982 t e 00 Tf/7Mf l !H ' . P 0 Bnx 11174 / Hnnolulu, Haw all 96828-0174 Teleihone (208) 734-5801

T h e 6 5 0 2 A D IO S v e r s i o n o f m U S I M P u a s o r ig i n a l ly w r it t e n b y t r a n sl a t in g a n 8 0 8 6 v e r s i o n o f t h e in t e rp r e t e r . T h e 8 0 8 6 p se u d o - reg ist e rs a re sto red in pa ge z ero in th e f ol low ing l ocat ion s :

R eg ist er Loca t ion R eg ist er L ocation AX $0C 0 SI $0C 8 BX $0C2 DI ;OCA CX $0C4 BP $OCC DX $0C6

A rgun ents a re pa ssed t o m US IM P m ach in e l angua ge rout in e s on th e ''B P '' s t a c k . T h e f i r s t a r g u m e n t i s s t o r e d a t l o c a t i o n B P + 2 ; t h e s e c o n d i s a t B P + 4 ; th e t h i rd a t B P + 6 ; e t c . F o r e x a m p l e , t h e follow inq cod e ret rieve s th e f irst a rg um en t an d store s i t in S I :

G ETA RG I : LD Y #2 LDA (BPI,Y 5 cN.ï4 STA SI $Qe ? IN Y LDA (BY I,Y ek.''34 STA SI+1 iCq R T S qt The address of the muslMp function SPACES can be found using th e G RT D f un ction . A di sas s pm h ly of SPA C ES sh o uld l ook l ik e th is : (JUCJ SPACES: JsR cavaasl ;sz: AasuMsxœ zo spacEs JsR B IN ARY ;BX : B INARY BQD IVAL EF P OF ARG B c c S PA C E Z ;J UM P IF N O T 0 <= A RG < 6 4K B Bo sPAC E2 ;JUdP IF ARG = 0 s Pa C E l : J sR S PA C E ;O U TP U T A S PA C Z D : c B X B N E S P A / RI CL O OP F 0 R B X S PA C E S S PA C EZ : L DA CU RS O R ;A : C DR R ENna CUR SOR PQ S IT ION J M p G R NN M ;R E T UR N D I : C D R S O R PO S IT IO N

T h i s c o u e c on t a in s t w o u s e f u l a d d r e s seto y o u : B IN A R Y t a k e s a m US IM P in tege r and retu rn s th e D ina ry eq u iv al en t in B X . G ENN M ta ke s a b in a ry n u m b e r in t h e t h e 6 5 0 2 A re g is t e r a n u g e n e ra t e s a m U S I M P in t eg e r in D I , th e r eg ist e r u se d to r e tu rn v a l ue s t o m US IM P .

S in c e r e ly

œ

A lb e rt R ic h App l ied L og ic ia n - + #ûT: : H lpzt.o es ). ? J$S'e?. c pm s.6 4 çksej- d2pp

tb j w $.., lc

p q a - ( ) ; + a - ), ,.f ; ,m ) J. , s c . . r fe 1, , p, - - . -