Sie sind auf Seite 1von 304

!"# %&'()*+, -).

/)0
anl am Comul er ooks
As k your bookseI I er for lhe books you have mi ssed
THI AMI GADOS USIR' S MANUAL
by Commodore- Ami ga, Inc.
THI AIILI //c OOK
by iII O' ri en
THI COMMODORI 64 SURVI VAL MANUAL
by Wi nn L. Rosch
COMMODORI 128 IROGRAMMIR' S RIIIRINCI GUI DI
by Commodor e usi ness Machi nes, Inc.
IXILORI NG ARTI II CI AL I NTILLI GINCI ON YOUR AIILI II
by Ti m HarlneI I
IXILORI NG ARTI II CI AL I NTILLI GINCI ON YOUR COMMODORI 64
by Ti m HarlneI I
IXILORI NG THI UNI X INVI RONMINT
by The Wai le Grou / Irene Iaslernack
IRAMIWORK IROM THI GROUND UI
by The Wai le Grou / Cynlhi a Soor and Roberl Warren
HOW TO GIT THI MOST OUT OI COMIUSIRVI, 2d ed.
by CharI es oven and Davi d Ieyl on
HOW TO GIT THI MOST OUT OI THI SOURCI
by CharI es oven and Davi d Ieyl on
THI MACI NTOSH
by iII O' ri en
THI NIW 123 A GUI DI TO I M' S IC,>
by Wi nn L. Rosch
ORCHISTRATI NG SYMIHONY
by The Wai le Grou / Dan Shafer
IC- DOS / MS- DOS
45#265 7/'8# 9: 9"# -:59 ;:</0)2 +<#2)9'.( ,=59#& >:2 ;#25:.)0 ?:&</9#25
by AI an M. oyd
IOWIR IAI NTI NG: COMIUTIR GRAIHI CS ON THI MACI NTOSH
by Verne auman and RonaI d Ki dd / iIIuslraled by Gaser Vaccaro
SMARTIR TILICOMMUNI CATI ONS
@).85A+. 7/'8# 9: +.AB'.# ?:&</9#2 ,#2C'D#5
by CharI es oven and Slevarl Schnei der
SWI NG WI TH } AZZ:
B:9/5 1)EE :. 9"# -)D'.9:5"
by Dala lech IubIicalions Cor. / Mi chaeI McCarl y
USIR' S GUI DI TO THI AT&T IC 6300 IIRSONAL COMIUTIR
by Davi d . Iealroy, Ricardo A. AnzaI dua, H. A. WohI vend,
and Dala lech IubIicalions Cor.
!"# %&'()*+,
-)./)0
Commodore-Amiga, Inc.
ANTAM OOKS
T O R O N T O N I W YORK L O N D O N S YDNIY AUCKL AND
AMIGADO5 MANUAL
! #$%&$' #(() I *+,-.$-/ 0123
4(5+- 6+789% ,/ :; 4$-(<< !77(=8$&+7
!>> -89?&7 -+7+-5+6;
4(@/-89?& 0123 ,/ 4(''(6(-+ 4$@8&$>A B%=;
C?87 ,(() '$/ %(& ,+ -+@-(6.=+6 8% D?(>+ (- 8% @$-&A ,/
'8'+(9-$@? (- $%/ (&?+- '+$%7A D8&?(.& @+-'8778(%;
*(- 8%<(-'$&8(% $66-+77E #$%&$' #(()7A B%=;
I5BN 0-553-34294-0
F.,>87?+6 78'.>&$%+(.7>/ 8% &?+ G%8&+6 H&$&+7 $%6 4$%$6$
#$%&$' #(()7 $-+ @.,>87?+6 ,/ #$%&$' #(()7A B%=; B&7 &-$6+'$-)A =(%787&8%9 (< &?+
D(-67 I#$%&$' #(()7I $%6 &?+ @(-&-$/$> (< $ -((7&+-A 87 J+987&+-+6 8% G;H; F$&+%&
$%6 C-$6+'$-) K<<8=+ $%6 8% (&?+- =(.%&-8+7; L$-=$ J+987&-$6$; #$%&$' #(()7A
B%=;A 333 *8<&? !5+%.+A M+N5 O(-)A M+D O(-) 0P0PQ;
PRI NTED IN THE UNI TED 5TATE5 OF AMERI CA
H 0 9 8 7 6 5 4 3 2 1
?:.9#.95
C?+ !'89$RKH G7+-S7 L$%.$>
C?+ !'89$RKH R+5+>(@+-S7 L$%.$>
C?+ !'89$RKH C+=?%8=$> J+<+-+%=+ L$%.$>
;2#>)D#
Thi s book, !"# %&'()*+, -)./)0F is a combi nal i on of l hree searale ubI i cal i ons:
!"# %&'()*+, 45#265 -)./)0
!"# %&'()*+, *#C#0:<#265 -)./)0
!"# %&'()*+, !#D".'D)0 G#>#2#.D# -)./)0
The 45#265 -)./)0 conl ai ns i nf or mal i on of i nl eresl l o ever y Ami ga user .
The r e are ma ny mor e c omma nds l hal Ami ga DOS under s l ands l han are acces-
si bI e f r om l he Wor kbe nc h. If a us er us es Ir ef er ences lo l urn on l he CLI , l hes e
n e v c omma nds be c ome accessi bI e.
The *#C#0:<#265 -)./)0 descri bes hov l o us e Ami ga DOS f r om vi l hi n a
r ogr am ral her l han f r om a c omma nd I i ne i nl erf ace. Il aI so fuI I y doc ume nl s
l he Ami ga Mac r o As s embI er and Li nker. ( Nol e l hal l he Ami ga Mac r o As s e m-
bI er is avai I abI e as a searal e r oducl . )
The !#D".'D)0 G#>#2#.D# -)./)0 descri bes l he dal a sl rucl ures l hal Ami ga DOS
us es i nl ernaI I y. Il i ncI udes descri l i ons of ho v DOS di sk dal a is sl or ed, and
l he f or mal of l he " ob| ecl - f i I es " l hal Ami ga DOS us es . A deveI oer or exerl
us er vouI d f i nd l he i nf or mal i on i n l hi s l echni caI secl i on lo be ver y usef uI .
Togel her l hese l hree ubI i cal i ons, i n l hi s si ngI e voI ume, comr i s e l he es s en-
liaI gui de l o Ami ga DOS .
%&'()*+,
-)./)0
Intrnductinn
1. Intrnducing AmigaDO5
2. AmigaDO5 Cnmmands
3. EDThc 5crccn Editnr
4. EDITThc Linc Editnr
Appcndix: Errnr Cndcs and Mcssagcs
G!nssary
H.92:8/D9':.
Thi s manuaI descri bes l he Ami ga DOS and ils c ommands . The Co mma nd Li ne
I nl er r el er ( CLI ) reads Ami ga DOS c omma nds l yed i nl o a CLI vi ndov and
l ransI al es l he m i nl o acl i ons er f or med by l he comul er . I n l hi s s ens e, l he CLI
is si mi I ar l o mor e " l r adi l i onaI " c omul er i nl erf aces: you l ye i n c omma nds
and l he i nl erf ace di sI ays l exl i n rel urn.
ec aus e l he Wor kbe nc h i nl erf ace is suffi ci enl and f ri endI y f or mos l us er s l he
Wor kbe nc h di skel l es are s hi ed vi l h l he CLI i nl erf ace " di s a bI e d" . To us e l he
c omma nds i n l hi s manuaI you mus l " e na b I e " l he CLI i nl erf ace. Thi s ul s a
ne v i con, I abeI ed " CL I " on your Wor kbe nc h. Whe n you have seI ecl ed and
oe ne d l hi s i con, a CLI vi ndov be c ome s avai I abI e, and you can us e il l o i ssue
l exl c omma nds di recl I y lo Ami ga DOS .
@:I 9: J.)K0# 9"# ?:&&).8 B'.# H.9#2>)D#
ool your c omul er usi ng l he Ki cksl arl and Wor kbe nc h di skel l es. Oe n l he
di skel l e i con. Oe n l he " Ir e f e r e nc e s " l ooI . Near l he I ef l - hand si de of l he
scr een, aboul l vo- l hi rds of l he vay dovn you vi I I nol i ce " CL I " vi l h a bul l on
f or " O N " and a bul l on for " O I I " . SeI ecl l he " O N " bul l on. SeI ecl " S a v e "
( I over ri ghl arl of l he Ir ef er ences screen) lo I eave Ir ef er ences.
@:I 9: +<#. ) ?BH L'.8:I
To us e l he CLI c omma nds , you oe n a CLI vi ndov. Oe n l he " S y s l e m"
dr aver . The CLI i con (a cube conl ai ni ng " 1 > " ) shouI d nov be vi si bI e. Oe n
il.
45'.( 9"# ?BH
To us e l he CLI i nl erf ace seI ecl l he CLI vi ndov and l ye l he desi red CLI
c omma nds . The CLI vi ndov( s ) may be si zed and move d | usl I i ke mos l ol her s.
To cI ose l he CLI vi ndov, l ye " INDCLI " .
INTRODUCTION 3
L:2MK#.D" ).8 ?BHF !"#'2 G#0)9':.5"'< ).8 *'>>#2#.D#5
Tye " DI R" lo di sI ay a Iisl of fiIes ( and di recl ori es) i n l he cur r enl di sk
di recl ory. Thi s is a Iisl of fiIes l hal makes u your Wor kbenc h. You ma y nol i ce
l hal l here are mor e fiIes i n lhi s di recl ory l han l here are i cons on l he Wor k-
be nc h. Wor kbe nc h onI y di sI ays fiIe " X " if l hal fiIe has an associ al ed " X. i n f o "
fi I e. Wor kbe nc h us es l he " . i nf o " fiIe lo mani uI al e l he i con.
Ior examI e, l he di skcoy r ogr am has l vo fi I es. The fiIe " Di s k c o y " con-
l ai ns l he r ogr am and " Di s kc oy. i nf o" conl ai ns l he Wor kbe nc h i nf or mal i on
aboul il. I n l he case of ai nl i ng dal a fiIes I i ke " mo unl . i c " l he fiIe " mounl . i c . -
i nf o" conl ai ns i con i nf or mal i on and l he na me of l he r ogr am ( def auI l ) l hal
s houI d r ocess il ( Grahi Craf l ) . I n lhi s case, vhe n l he us er " o e n s " l he dal a
fiIe ( mounl . i c) Wor kbe nc h r uns l he r ogr am and as s es l he dal a fiI e na me
( mounl . i c) l o il.
Ami ga DOS subdi recl ori es cor r es ond lo Wor kbe nc h dr aver s . Ra ndo m ac-
cess bI ock devi ces such as di sks (DIO:) cor r es ond l o l he di skel l e i cons you
have seen.
Nol aII r ogr ams or c omma nds can be r un under bol h Wor kbe nc h and l he
CLI envi r onmenl . None of l he CLI c omma nds descr i bed i n Chal er 2 of l hi s
manuaI can be r un f r om Wor kbe nc h. Ior examI e, l her e are l vo sear al e
Di s kcoy c omma nds . The one i n l he ND0 di recl ory is r un f r om Ami ga DOS ( CLI ) .
The one i n l he s ys l em di recl ory ( draver) is r un f r om Wor kbe nc h.
?")<9#2 O
Inlroducing AmigaDOS
Thi s chal er r ovi des a generaI over vi ev of l he Ami ga DOS oer al i ng s ys l em,
i ncI udi ng descri l i ons of l ermi naI handI i ng, l he di recl ory sl rucl ure, and c om-
ma nd us e . Al l he end of l he chal er , you' I I f i nd a si mI e examI e sessi on vi l h
Ami ga DOS
1.1 Chal er Over vi ev /
1. 2 Ter mi naI HandI i ng
1. 3 Us i ng l he Ii I i ng Sys l em
1. 3. 1 Na mi ng Ii I es
1. 3. 2 Us i ng Di recl ori es
1. 3. 3 Sel l i ng l he Cur r enl Di recl ory
1. 3. 4 Sel l i ng l he Cur r enl Devi ce
1. 3. 5 Al l achi ng a Ii I enol e
1. 3. 6 Under s l andi ng Devi ce Na me s
1. 3. 7 Us i ng Di recl ory Convenl i ons and Logi caI Devi ces
1. 4 Us i ng Ami ga DOS Co mma nds
1. 4. 1 Runni ng Co mma nds i n l he ackgr ound
1. 4. 2 Ixecul i ng Co mma nd Ii I es
1. 4. 3 Di recl i ng Co mma nd I nul and Oul ul
1. 4. 4 I nl errul i ng Ami ga DOS
1. 4. 5 Under s l andi ng Co mma nd Ior mal s
1. 5 Resl arl VaI i dal i on Irocess
1. 6
CommonI y Us ed Comma nds : An IxamI e Sessi on
1. 7 Convenl i ons Us e d
O3O ?")<9#2 +C#2C'#I
Ami ga DOS is a mu! t i - prnccssi ng oer al i ng s ys l em des i gned f or l he Ami ga.
AI l hough you can us e il as a muI l i - user s ys l em, you nor maI I y r un Ami ga DOS
f or a si ngI e user . The muI l i - rocessi ng faciIily I els ma ny | obs l ake I ace si muI -
INTRODUCING AMIGADO5 5
l aneousI y. You can aI so us e l he muI l i - rocessi ng faciIily lo s us end one | ob
vhi I e you r un anol her .
Iac h Ami ga DOS prnccss r er esenl s a arl i cuI ar r ocess of l he oer al i ng
s ys l emf or examI e, l he fiIing s ys l em. OnI y one r ocess is r unni ng al a l i me,
vhi I e ol her r ocesses are ei l her vai l i ng for s omel hi ng l o hae n or have be e n
i nl er r ul ed and are vai l i ng lo be r es umed. Iac h r ocess has a pri nri t y associ -
al ed vi l h il, and l he r ocess vi l h l he hi ghes l ri ori ly l hal is f ree lo r un does
so. Ir oces s es of I over ri ori l y r un onI y vhe n l hos e of hi gher ri ori l y ar e
vai l i ng f or s ome r eas onf or examI e, vai l i ng for i nf or mal i on lo arri ve f r om
l he di sk.
The sl andar d Ami ga DOS s ys l em us es a numbe r of r oces s es l hal are nol
avai I abI e l o you, f or examI e, l he r ocess l hal handI es l he seri aI I i ne. The s e
r oces s es are knovn as ri val e r ocesses. Ol her ri val e r oces s es handI e l he
l er mi naI and l he fi I i ng s ys l em on a di sk dri ve. If l he har dvar e conf i gur al i on
conl ai ns mor e l han one di sk dri ve, l here is a r ocess for each dri ve.
Ami g a DOS rovi des a r ocess l hal you can us e , caI I ed a Cnmma nd Li nc
Int crIacc or CLI . Ther e may be severaI CLI r ocesses r unni ng s i muI l aneous I y,
numbe r e d f r om 1 onvar d. The CLI r oces s es r ead c nmma nds a nd l he n
execul e l he m. AI I c omma nds and user r ogr ams vi I I r un under any CLI . To
ma ke addi l i onaI CLI r oces s es, you us e l he NIWCLI or RUN c omma nds . To
r emove a CLI r ocess us e l he INDCLI c omma nd. ( You can f i nd a fuII descri -
l i on of l hes e c omma nds i n Chal er 2 of lhi s manuaI . )
O3P !#2&'.)0 @).80'.(
You can di recl i nf or mal i on l hal you enl er al l he l ermi naI l o a Co mma n d Li ne
I nl erf ace ( CLI ) l hal leI I s Ami ga DOS lo I oad a r ogr am, or you can di recl l he
i nf or mal i on lo a r ogr am r unni ng under l hal CLI . In ei l her case, a t cr mi na! (or
cnnsn! c) hand! cr r ocesses i nul and oul ul . Thi s l er mi naI handI er aI so er -
f or ms I ocaI I i ne edi l i ng and cerl ai n ol her f uncl i ons. You c an l ye ahe ad as
ma ny as 255 char acl er s l he ma x i mum I i ne I engl h.
To correcl mi s l akes , you r ess l he ACKS IACI key. Thi s er ases l he I asl
characl er you l yed. To r ub oul an enl i re I i ne, hoI d dovn l he CTRL key vhi I e
you r ess X. Thi s cnnt rn! cnmbi nat i nn is ref erred l o f r om l hi s oi nl on i n l he
manuaI as CTRL- X.
If you l ye anyl hi ng, Ami ga DOS vai l s unli I you have f i ni shed l yi ng bef or e
di sI ayi ng any ol her oul ul . ecaus e Ami ga DOS vai l s f or you lo f i ni sh, you
can l ye ahead vi l houl your i nul and oul ul becomi ng i nl ermi xed. Ami ga DOS
r ecogni zes l hal you have f i ni shed a I i ne vhe n you ress l he RITURN key. You
can aI so leII Ami ga DOS l hal you have f i ni shed vi l h a I i ne by canceI I i ng il. To
canceI a I i ne, you can ei l her r ess CTRL- X or r ess ACKS IACI unl i I aII l he
characl ers on l he I i ne have be e n er ased. Onc e Ami ga DOS is sal i sf i ed l hal you
6
AMIGADO5 U5ER'5 MANUAL
have f i ni shed, il sl arl s lo di sI ay l he oul ul l hal il vas hoI di ng back. If you
vi s h lo sl o l he oul ul so l hal you can read il, si mI y l ye any characl er
( ressi ng l he sace bar is l he easi esl ) , and l he oul ul sl os. To resl arl oul ul ,
ress ACKS IACI, CTRL- X, or RITURN. Iressi ng RITURN causes Ami ga DOS
lo l ry l o execul e l he c omma nd I i ne l yed af l er l he cur r enl r ogr am exi l s.
Ami ga DOS r ecogni zes CTRLA as an end- of - f i I e i ndi cal or. I n cerl ai n ci r cum-
sl ances, you us e l hi s combi nal i on lo l er mi nal e an i nul fiIe. ( Ior a ci r cum-
sl ance vh e n you vouI d us e CTRLA, see Secl i on 1. 3. 6. )
If you f i nd l hal sl range characl ers aear on l he scr een vhe n you l ye
anyl hi ng on l he keyboar d, you have robabI y r es s ed CTRL- O by mi s l ake.
Ami g a DOS r ecogni zes lhi s conl roI combi nal i on as an i nsl rucl i on lo l he cons oI e
devi ce ( CON: ) lo di sI ay l he aI l ernal i ve characl er sel . To undo l hi s condi l i on,
you r ess CTRL- N. Any f url her characl ers shouI d l hen aear as nor maI . On
l he ol her ha nd, you couI d r ess ISC- C l o cI ear l he scr een and di sI ay nor maI
l exl .
Nnt c: Any i nul l hr ough l he consoI e devi ce CON: i gnor es f uncl i on keys and
cur sor ke ys . If you vanl l o recei ve l hes e keys , you s houI d us e RAW: . ( Ior a
descri l i on of RAW: , see Secl i on 1. 3. 6, " Unde r s l andi ng Devi ce Na me s , " I al er
i n l hi s chal er . )
Ii naI I y, Ami ga DOS r ecogni zes aII c omma nds and ar gumcnt s l yed i n ei l her
ue r or I over case. Ami ga DOS di sI ays a I i ! cnamc vi l h l he char acl ers i n l he
case us e d vh e n il va s cr eal ed, bul f i nds l he fiIe no mal l er vhal combi nal i on of
cases you us e lo seci f y l he f i I ename.
O3Q 45'.( 9"# R'0'.( ,=59#&
Thi s secl i on descri bes l he Ami ga DOS fiIing s ys l em. In arl i cuI ar, il exI ai ns
ho v lo na me , or gani ze, and recaI I your fi I es.
A fiIe is l he smaI I esl na me d ob| ecl us ed by Ami ga DOS . The si mI esl i denl i f i -
cal i on of a fiIe is by ils f i I ename, di scussed beI ov i n Secl i on 1. 3. 1. Hove ve r , il
ma y be neces s ar y l o i denl i f y a fiIe mor e fuI I y. Suc h an i denl i f i cal i on ma y
i ncI ude l he devi ce or voI ume na me , and/ or di recl ory name( s ) as veI I as l he
f i I ename. The s e vi I I be di scussed i n f oI I ovi ng secl i ons.
O3Q3O S)&'.( R'0#5
Ami ga DOS hoI ds i nf or mal i on on di sks i n a numbe r of Ii!cs, na me d so l hal you
can i denl i f y and recaI I l he m. The fiIing s ys l em aI I ovs f i I enames lo have u l o
l hi rl y char acl er s, vher e l he characl ers may be any ri nl i ng characl er excel
sI ash (/) and coI on (: ). Thi s me a ns l hal you can i ncI ude sace( ) , equaI s ( ) ,
I us ( + ) , and doubI e quol e ( " ) , aII seci aI characl ers r ecogni zed by l he CLI ,
vi l hi n a f i I ename. Hovever , if you us e l hese seci aI characl ers, you mus l
INTRODUCING AMIGADO5 7
encI ose l he enl i re f i I ename vi l h doubI e quol es . To i nl r oduce a doubI e quol e
characl er vi l hi n a f i I ename, you mus l l ye an asl eri sk () i mmedi al eI y bef or e
l hal characl er. I n addi l i on, l o i nl r oduce an asl eri sk, you mus l l ye anol her
asl eri sk. Thi s me a ns l hal a fiIe na me d
A C "
shouI d be l yed as f oI I ovs:
i n order f or l he CLI lo accel il.
Nnt c: Thi s us e of l he asl eri sk is i n conl rasl l o ma ny ol her oer al i ng s ys l ems
vhe r e il is us e d as a uni versaI wi ! d card. An asl eri sk by i lseI f i n Ami g a DOS
r er esenl s l he keyboar d and l he currenl vi ndov. Ior examI e,
COIY f i I e na me l o
coi es l he f i I ename lo l he scr een.
Avoi d saces bef or e or afler f i I enames becaus e l hey ma y caus e conf us i on.
O3Q3P 45'.( *'2#D9:2'#5
The fiIing s ys l em aI so aI I ovs l he us e of di rcct nri cs as a va y l o gr ou fiIes
l ogel her i nl o I ogi caI uni l s. Ior examI e, you ma y us e l vo di f f erenl di recl ori es
lo sear al e r ogr am source f r om r ogr am doc umenl al i on, or l o kee fiIes
beI ongi ng l o one er s on di sl i ncl f r om l hose beI ongi ng l o anol her .
Iach fiIe on a di sk mus l beI ong lo a di recl ory. An eml y di sk conl ai ns one
di recl ory, caI I ed l he rnnt di rcct nry. If you creal e a fiIe on an e ml y di sk, l hen
l hal fiIe beI ongs l o l hi s rool di recl ory. Hovever , di recl ori es ma y l hems eI ves
conl ai n f url her di recl ori es. Iach di recl ory ma y l heref ore conl ai n f i I es, or yel
mor e di recl ori es, or a mi xl ure of bol h. Any f i I ename is uni que onI y vi l hi n l he
di recl ory il beI ongs l o, so l hal l he fiIe " f r e d" i n l he di recl ory " bi I I " is a c om-
I el eI y di f f erenl fiIe f r om l he one caI I ed " f r e d" i n l he di recl ory " ma r y " .
Thi s fi I i ng sl rucl ure me ans l hal l vo eoI e shar i ng a di sk do nol have lo
vor r y aboul acci denl aI I y overvri l i ng fiIes creal ed by s ome one eI se, as I ong as
l hey aI vays creal e fiIes i n l hei r ovn di recl ori es.
WARNI NG: Whe n you creal e a fiIe vi l h a f i I ename l hal aI ready exi sl s,
Ami ga DOS deI el es l he r evi ous conl enl s of l hal fi I e. No mes s age lo l hal
ef f ecl aear s on l he scr een.
8
AMIGADO5 U5ER'5 MANUAL
You can aI so us e lhi s di recl ory sl rucl ure lo organi ze i nf or mal i on on l he di sk,
keei ng di f f erenl sorl s of fiIes i n di f f erenl di recl ori es.
An examI e mi ghl heI lo cIarify l hi s. Cons i der a di sk l hal conl ai ns l vo
di recl ori es, caI I ed " bi I I " and " ma r y . " The di recl ory " bi I I " conl ai ns l vo fi I es,
caI I ed " l e x l " and " I e l l e r " . The di recl ory " ma r y " conl ai ns a fiIe caI I ed " da l a "
and l vo di recl ori es caI I ed " I e l l e r " and " i nvoi c e " . Thes e sub- di recl ori es each
conl ai n a fiIe caI I ed " | u n I 8 " . Ii gure 1-A r er es enl s l hi s sl rucl ure as f oI I ovs:
ROOT
I LL M A R Y
T I XT LITTIR DATA LITTIR HSTVOICI
! !
} LTN18 }TT}5U8
Figurc 1-A: Using Dircctnry 5tructurc
Nnt c: The di recl ory " bi I I " has a fiIe caI I ed " I e l l e r , " vhi I e l he di recl ory
" ma r y " conl ai ns a di recl ory caI I ed " I el l er " . Hovever , l here is no conf us i on
her e becaus e bol h fiIes are i n di f f erenl di recl ori es. Ther e is no I i mi l lo l he
del h l hal you can " n e s l " di recl ori es.
To seci f y a fiIe fuI I y, you mus l i ncI ude l he di recl ory l hal ovns il, l he
di recl ory ovni ng l hal di recl ory, and so on. To seci f y a fi I e, you gi ve l he
na me s of aII l he di recl ori es on l he al h lo l he desi red fi I e. To sear al e each
di recl ory na me f r om l he nexl di recl ory or f i I ename, you l ye a f oI I ovi ng sI ash
(/). Thus , l he fuII seci f i cal i on of l he dal a fiIes on l he di sk s hovn in Ii gure 1-A
above is as f oI I ovs:
bi I I / l e xl
bi I I / I e l l e r
ma r y / da l a
ma r y / I e l l e r / | u n I 8
ma r y / I nv o i c e / | unI 8
O3Q3Q ,#99'.( 9"# ?/22#.9 *'2#D9:2=
% fuII fiIe descri l i on can gel exl r emeI y c umber s ome lo l ye, so l he fi I i ng
s ys l em mai nl ai ns l he i dea of a currcnt di rcct nry. The fi I i ng s ys l em sear ches f or
fiIes i n l hi s cur r enl di recl ory. To seci f y l he cur r enl di recl ory, you us e l he CD
( Cur r enl Di recl ory) c omma nd. If you have sel " ma r y " as your cur r enl di recl ory,
l hen l he f oI I ovi ng name s vouI d be suffi ci enl lo seci f y l he fiIes i n l hal di recl ory:
INTRODUCING AMIGADO5 9
da l a
I e l l e r 7 | ui i I 8
i n v o i c e / | u n I 8
You can sel any di recl ory as l he cur r enl di recl ory. To seci f y any fiIes vi l hi n
l hal di recl ory, si mI y l ye l he na me of l he fi I e. To seci f y fiIes vi l hi n s ub-
di recl ori es, you need l o l ye l he na me s of l he di recl ori es on l he al h f r om l he
cur r enl di recl ory seci f i ed.
AI I l he fiIes on l he di sk are sliII avai I abI e even l hough you' ve sel u a cur r enl
di recl ory. To_ i nsl rucl Ami ga DOS lo search l hr ough l he di recl ori es f r om l he
rool di recl ory, you l ye a coI on (:) al l he begi nni ng of l he fiIe descr i l i on.
Thus , vhe n your fiIe descri l i on has l he cur r enl di recl ory sel l o " ma r y " , you
can aI so obl ai n l he fiIe " da l a " by l yi ng l he descri l i on " : mar y/ dal a" . Us i ng l he
cur r enl di recl ory me l hod si mI y saves l yi ng, becaus e aI I you have l o do i s
seci f y l he f i I ename " da l a " .
To obl ai n l he ol her fiIes on l he di sk, firsl l ye " : bi I I / l exl " a nd " : bi I I / I el l er"
resecl i veI y. Anol her vay mi ghl be l o CD or l ye / bef or e a f i I ename. SI ash
does nol me a n " r o o l " as i n s ome s ys l ems , bul ref ers lo l he di recl ory above l he
cur r enl di recl ory. Ami ga DOS aI I ovs muI l i I e sI ashes. Iach sI ash ref ers lo l he
I eveI above. So a Uni x ( TM) ../ is a / i n Ami ga DOS . Si mi I arI y, an MS- DOS
.A is a / i n Ami ga DOS . l h u s , if l he cur r enl di recl ory i s " : mar y/ I el l er " , you ma y
seci f y l he fiIe " : mar y/ i nvoi c e/ | unI 8" as " / i nvoi c e / | unI 8" . To ref er lo l he fi I es
i n " : bi I I " , you couI d l ye:
CD .-biII
or
CD //bi I I
The n you couI d seci f y a ny fiIe i n " bi I I " vi l h a si ngI e f i I ename. Of c our s e, you
couI d aI vays us e l he // f eal ure lo ref er di reclI y lo a seci fi c fiIe. Ior examI e,
TYI I / / bi I I / I el l er
di sI ays l he fiIe vi l houl your firsl sel l i ng " bi I I " as l he cur r enl di recl ory. To go
sl rai ghl l o l he rool I eveI , aI vays l ye a coI on (:) f oI I oved by a di recl ory na me . If
you us e sI ashes, you mus l knov l he exacl numbe r of I eveI s back desi r ed.
2. 3. 4 ,#99'.( 9"# ?/22#.9 *#C'D#
Ii naI I y, you ma y have ma ny di sk dri ves avai I abI e. Iac h di sk devi ce has a
na me , i n l he f or m DIn (for examI e, DI1) , vher e l he " n " ref ers l o l he numbe r
of l he devi ce. ( Currenl I y, Ami ga DOS accel s l he devi ce na me s DIO l o DI3. )
10 AMIGADO5 U5ER'5 MANUAL
Iach i ndi vi duaI di sk is aI so associ al ed vi l h a uni que na me , knovn as a voI ume
na me ( see beI ov f or mor e del ai I s) .
In addi l i on, l he I ogi caI devi ce SYS: is assi gned lo l he di sk you sl arl ed l he
s ys l em u f r om. You can us e lhi s na me i n I ace of a di sk devi ce na me (Iike
DIO: ).
The cur r enl di recl ory is aI so associ al ed vi l h a currcnt dri vc, l he dri ve vhe r e
you ma y f i nd l he di recl ory. As you knov, ref aci ng a fiIe descri l i on vi l h a
coI on ser ves lo i denl i f y l he rool di recl ory of l he currenl dri ve. Hove ve r , l o
gi ve l he rool di recl ory of a seci fi c dri ve, you r ecede l he coI on vi l h l he dri ve
na me . Thus , you have yel anol her va y of seci f yi ng l he fiIe " d a l a " i n di recl ory
" ma r y " , l hal is " DII : ma r y/ da l a " . Thi s as s umes l hal you have i nser l ed l he di sk
i nl o dri ve DI1 . So, lo r ef er ence a fiIe on l he dri ve DIO caI I ed " r o| ec l - r eor l " i n
di recl ory " e l e r " , you vouI d l ye " DIO: el er / r o| ecl - r eor l " , no mal l er vhi c h
di recl ory you ha d sel as l he cur r enl one.
Nnt c: Wh e n you ref er lo a di sk dri ve or any ol her devi ce, on ils ovn or vi l h
a di recl ory na me , you shouI d aI vays l ye l he coI on, f or examI e, DI1 : .
Ii gure 1- i I I usl ral es l he sl rucl ure of a fiIe descri l i on. Ii gure 1-C gi ves s ome
examI es of vaI i d fiIe descri l i ons.
LcIt nI t hc: Ri ght nI t hc: Ri ght nI a/
Devi ce na me Di recl ory na me Subdi r ecl or y na me
or or or
VoI ume na me Ii I ename Ii I ename
Figurc 1-B: Thc 5tructurc nI a Fi!c Dcscriptinn
S YS c o m m a n d s
DIO: bi I I
DI L ma r y / I e l l e r
DI 2 : ma r y / I e l l e r / | u n I 8
DOC: r eor l / s ec l i onI / f i gur es
IOMTS: s my- f onl
C: cI s
Figurc 1-C: Examp!cs nI Fi!c Dcscriptinns
To gai n access l o a fiIe on a arl i cuI ar di sk, you can l ye i ls uni que na me ,
vhi c h is knovn as l he di sk' s vn! umc namc, i nsl ead of l he devi ce na me . Ior
i ns l ance, if l he fiIe is on l he di sk " M C C " , you can seci f y l he s ame fiIe by
l yi ng l he na me " MCGe l e r / r o| e c l - r e or l " . You can use l he voI ume na me l o
ref er lo a di sk regardI ess of l he dri ve il is i n. You assi gn a voI ume na me lo a
di sk vhe n you f or mal il (for f url her del ai I s, see " I O R M A T " i n Chal er 2,
" Co mma n d s , " I aler i n l hi s manuaI ) .
INTRODUCING AMIGADO5
11
A devi ce na me , unI i ke a voI ume na me , is nol reaI I y arl of l he na me . Ior
examI e, Ami ga DOS can r ead a fiIe you creal ed on DIO: f r om anol her dri ve,
such as DI1: , if you I ace l he di sk i n l hal dri ve, as s umi ng of cour se l hal l he
dri ves are i nl er changeabI e. Thal i s, if you creal e a fiIe caI I ed " bi I I " on a di sk i n
dri ve DIO:, l he fiIe i s knovn as " DIO. bi I I " . If you l hen move l he di sk l o dri ve
DI1 : , Ami ga DOS can sliII r ead l he fi I e, vhi c h i s l hen knovn as " DII : bi I I " .
O3Q3T %99)D"'.( ) R'0#.:9#
AI l hough a f i I ename can gi ve s ome i nf or mal i on aboul ils c onl enl s , il is of l en
neces s ar y l o I ook i n l he fiIe ilseI f l o f i nd oul mor e. Ami ga DOS r ovi des a
si mI e soI ul i on l o lhi s r obI em. You can us e l he c omma nd caI I ed II LINOTI
l o al l ach an associ al ed c omme nl . You can make u a c omme nl of u l o 80
characl ers ( you mus l encI ose c omme nl s conl ai ni ng saces i n doubI e quol es ) .
Anyl hi ng can be ul i n a fiIe c ommenl : l he day of l he fi I e' s creal i on, vhe l he r
or nol a bug has be e n f i xed, l he ver si on numbe r of a r ogr am, and anyl hi ng
eI se l hal ma y heI l o i denl i f y il.
You mus l associ al e a c omme nl vi l h a arl i cuI ar f i I enol aII fi I es ha ve l he m.
To al l ach c omme nl s , you us e l he II LINOTI c omma nd. If you creal e a ne v
fi I e, il viII nol have a c omme nl . Iven if l he ne v fiIe is a coy of a fiIe l hal has a
c omme nl , l he c omme nl i s nol coi ed l o l he ne v fi I e. Hove ve r , any c omme nl
al l ached lo a fiIe vhi c h is overvri l l en is rel ai ned. To vri l e a r ogr am l o coy a
fiIe and ils c omme nl , you' I I have lo do s ome exl ra vor k lo c oy l he c omme nl .
Ior del ai I s, see Chal er 2 of l he %&'()*+, *#C#0:<#265 -)./)03
Wh e n you r e name a fi I e, l he c omme nl associ al ed vi l h il does n' l c hange . The
RI NAMI c o mma nd onI y c hanges l he na me of a fi I e. The fi I e' s conl enl s a nd
c omme nl r emai n l he s ame regardI ess of l he na me c hange. Ior mor e del ai I s,
see LI ST and II LINOTI i n Chal er 2 of l hi s manuaI .
2. 3. 6 4.8#259).8'.( *#C'D# S)&#5
Devi ces have na me s so l hal you can ref er lo l he m by na me . Di sk na me s s uc h
as DIO: are examI es of dcvi cc namcs . Nol e l hal you ma y ref er l o devi ce
na me s , I i ke f i I enames , usi ng ei l her uer or I over case. Ior di sks, you f oI I ov
l he devi ce na me by a f i I ename bec aus e Ami ga DOS suor l s fiIes on l hes e
devi ces. Iur l her mor e, l he f i I ename can i ncI ude di recl ori es bec aus e Ami g a DOS
aI so suor l s di recl ori es.
You can aI so creal e fiIes i n me mor y vi l h l he devi ce caI I ed RAM: . RAM:
i mI e me nl s a fi I i ng s ys l em i n me mo r y l hal s uor l s a ny of l he nor maI fi I i ng
s ys l em c omma nds .
Nnt c: RAM: requi res l he I i brary 1/ ram- handI er lo be on l he di sk.
Onc e l he devi ce RAM: exi sl s, you can, f or i ns l ance, creal e a di recl ory l o
c oy aII l he c omma nds i nl o me mor y. To do l hi s, l ye l he f oI I ovi ng c omma nds :
12
AMIGADO5 U5ER'5 MANUAL
MAKI DI R r a m: c
COIY s ys : c TO r a m: c
AS S I GN C: RAM: C
You couI d l hen I ook al l he oul ul vi l h DI R RAM: . Il vouI d i ncI ude l he
di recl ory " c " ( DI R Iisls l hi s as c(di r). ) Thi s vouI d make I oadi ng c omma nds ver y
qui ck bul vouI d I eave IillIe r oom i n me mor y for anyl hi ng eI se. Any fiIes i n l he
RAM: devi ce are I osl vhe n you resel l he mac hi ne.
Ami ga DOS aI so r ovi des a numbe r of ol her devi ces l hal you can us e i nsl ead
of a r ef er ence lo a di sk fiIe. The f oI I ovi ng ar agr ahs descri be l hese devi ces
i ncI udi ng NI L: , SIR: , IAR: , IRT: , CON: , and RAW: . In arl i cuI ar, l he devi ce
NI L: i s . a dummy devi ce. Ami ga DOS si mI y l hr ovs avay oul ul vri l l en l o
NI L: . Whi I e r eadi ng f r om NI L: , Ami ga DOS gi ves an i mmedi al e " end- of - f i I e"
i ndi cal i on. Ior examI e, you vouI d l ye l he f oI I ovi ng
IDI T a b c TO ni I :
l o us e l he edi l or lo br ovs e l hr ough a fi I e, vhi I e Ami ga DOS l hr ovs avay l he
edi l ed oul ul .
You us e l he devi ce caI I ed SIR: lo ref er lo any devi ce c onnec l ed l o l he seri aI
I i ne ( of l en a ri nl er) . Thus , you vouI d l ye l he f oI I ovi ng c omma nd s equenc e:
COIY x y z TO s e r :
l o i nsl rucl Ami ga DOS l o s end l he conl enl s of l he fiIe " x y z " dovn l he seri aI I i ne.
Nol e l hal l he seri aI devi ce onI y coi es i n muI l i I es of 400 byl es al a l i me.
Coyi ng vi l h SIR: can l heref or e aear granuI ar.
The devi ce IAR: ref ers lo l he araI I eI orl i n l he s ame vay.
Ami g a DOS aI so rovi des l he devi ce IRT: (for IRi nTer ) . IRT: is l he ri nl er
you c hos e i n l he " r e f e r e nc e s " r ogr am. I n l hi s r ogr am, you can def i ne your
ri nl er l o be c onnec l ed l hr ough ei l her l he seri aI or araI I eI orl . Thus , l he
c omma nd s equenc e
COI Y xyz TO IRT:
ri nl s l he fiIe " x y z , " no mal l er ho v l he ri nl er is c onnec l ed.
IRT: l ransI al es ever y I i nef eed characl er i n a fiIe lo carri age rel urn I us
I i nef eed. S o me ri nl ers, hovever , requi re fiIes vi l houl l ransI al i on. To s end a
fiIe vi l h l he I i nef eeds as | usl I i nef eeds, you us e IRT: RAW i nsl ead of IRT: .
Ami ga DOS suor l s muI l i I e vi ndovs . To make a ne v vi ndov, you can
seci f y l he devi ce CON: . The f or mal f or CON: is as f oI I ovs:
CON: x/ y/ vi dl h/ hei ghl / | l i l I ej
^INTRODUCING AMIGADO5 13
vhe r e " x " and " y " are coor di nal es, " vi dl h" and " he i g hl " are i nl eger s descri b-
i ng l he vi dl h and hei ghl of l he ne v vi ndov, and " l i l I e " , vhi c h i s ol i onaI , is
a sl ri ng. The lilIe aear s on l he vi ndov' s lilIe bar. You mus l i ncI ude aII l he
sI ashes (/), i ncI udi ng l he I asl one. Your lilIe can i ncI ude u lo l hi rl y characl ers
( i ncI udi ng saces) . If l he lilIe has saces , you mus l encI ose l he vhoI e descri -
l i on ii doubI e quol es (") as s hovn i n l he f oI I ovi ng examI e:
" CON: 2 0 / 1 0 / 3 0 0 / 1 0 0 / my vi n do v"
The r e i s anol her vi ndov devi ce caI I ed RAW: , bul il i s of IillIe us e lo l he
gener aI user . ( See Chal er 2 of l he %&'()*+, *#C#0:<#265 -)./)0 i n l hi s book
f or f url her del ai I s. ) You can us e RAW: lo creal e a r av vi ndov devi ce si mi I ar l o
CON: . Hove ve r , unI i ke CON: , RAW: does no characl er l ransI al i on and does
nol aI I ov you l o c hange l he conl enl s of a I i ne. Thal i s l o say, RAW: accel s
i nul and r el ur ns oul ul i n exaclI y l he s ame f or m l hal il va s ori gi naI I y l yed.
Thi s me a ns characl ers are senl lo a r ogr am i mmedi al eI y vi l houl I el l i ng you
er ase anyl hi ng vi l h l he ACKS IACI key. You usuaI I y us e RAW: f r om a
r ogr am vhe r e you mi ghl vanl l o do i nul and oul ul vi l houl characl er
l ransI al i on.
W A R N I N G : RAW: is i nl ended f or l he advanced user . Do nol us e RAW:
exer i menl aI I y.
Ther e is one seci aI na me , vhi c h is ( asl eri sk) . You us e l hi s l o ref er l o l he
cur r enl vi ndov, bol h f or i nul or f or oul ul . You can us e l he COIY c om-
ma nd lo coy f r om one fiIe l o anol her . Us i ng , you can c oy f r om l he cur r enl
vi ndov lo anol her vi ndov, for examI e,
COPY TO C01ir:20/50/350/150/
f r om l he cur r enl vi ndov l o l he currenl vi ndov, for examI e,
COPY TO
or f r om a fiIe l o l he currenl vi ndov, f or examI e,
COPY bi I I / I el l er TO
Ami ga DOS f i ni shes coyi ng vhe n il c omes lo l he e nd of l he fi I e. To leII
Ami g a DOS lo sl o coyi ng f r om , you mus l gi ve l he CTRLA combi nal i on.
Nol e l hal i s NOT l he uni versaI vi I d card.
14
AMIGADO5 U5ER'5 MANUAL
O3Q3U 45'.( *'2#D9:2= ?:.C#.9':.5 ).8 B:('D)0 *#C'D#5
I n addi l i on l o l he af or emenl i oned hysi caI devi ces, Ami g a DOS suor l s a
vari el y of usef uI ! ngi ca! dcvi ccs. Ami ga DOS us es l hese devi ces lo f i nd l he fiIes
l hal your r ogr ams requi re f r om l i me l o l i me. ( So l hal your r ogr ams can ref er
l o a sl andar d devi ce na me regardI ess of vher e l he fiIe acl uaI I y i s. ) AI I of l hes e
" I ogi caI devi c es " may be r eassi gned by you l o r ef er ence any di recl ory.
The I ogi caI devi ces descri bed i n lhi s secl i on are as f oI I ovs:
Na mc Dcscri pt i nn
Dircctnry
SYS:
Sys l em di sk rool di recl ory
C: Comma nds di recl ory C
L: Li brary di recl ory L
s: Sequenc e Li brary
S
LI S: Li brary f or Oe n Li brary caIIs
LI S
DIVS : Devi ce for Oe n Devi ce caIIs DIVS
I ONTS :
LoadabI e f onl s for Oe n Ionl s
I ONTS
Temor ar y vor ks ac e T
Figurc 1-D: Lngica! Dcviccs
B:('D)0 8#C'D# .)&#N SYS:
!=<'D)0 8'2#D9:2= .)&#N My. ool . Di s k:
" S Y S " r er es enl s l he SYSl e m di sk rool di recl ory. Whe n you firsl slarl u
l he Ami ga s ys l e m, Ami g a DOS as s i gns SYS: l o l he r ool di r ecl or y n a me
of l he di sk i n DIO:. If, for i nsl ance, l he di sk i n dri ve DIO: has l he voI ume
na me My. ool VDi sk, l hen Ami ga DOS assi gns SYS: lo My. ool . DI SK: . Af l er
lhi s as s i gnmenl , any r ogr ams l hal ref er lo SYS: us e l hal di sk' s rool di recl ory.
B:('D)0 8#C'D# .)&#N C:
!=<'D)0 8'2#D9:2= .)&#N My. ool . Di s kx
' C r er es enl s l he Co mma nds di recl ory. Wh e n you l ye a c o mma nd l o l he CLI
( DI R < c r > , f or examI e) , Ami ga DOS firsl sear ches for l hal c omma nd i n your
cur r enl di recl ory. If l he s ys l em cannol f i nd l he c omma nd i n l he cur r enl
di recl ory, il l hen I ooks f or " C: DI R" . So l hal , if you have as s i gned " C : " l o
anol her di recl ory (for examI e, " ool di s k: c " ) , Ami ga DOS reads and exe-
cul es f r om " ool di sk: c/ DI R" .
B:('D)0 8#C'D# .)&#N L:
!=<'D)0 8'2#D9:2= .)&#N My. ool . Di s k: I
" L " r er es enl s l he Li brary di recl ory. Thi s di recl ory kees l he overI ays for I arge
c omma nds and nonr es i denl arl s of l he oeral i ng s ys l em. Ior i ns l ance, l he
di sk bas ed r un- l i me I i brari es ( Ram- HandI er , Ior l - HandI er, Di sk- VaI i dal or, and
so f orl h) are kel her e. Ami ga DOS requi res l hi s di recl ory lo oer al e.
INTRODUCING AMIGADO5 15
B:('D)0 8#C'D# .)&#N S:
!=<'D)0 8'2#D9:2= .)&#N My. ool . Di s k: s
" S " r er esenl s l he Sequenc e I i brary. Sequenc e fiIes conl ai n c omma nd s equenc es
l hal l he IXICUTI c omma nd sear ches for and us es . IXICUTI fi rsl I ooks for
l he s equence (or bal ch) fiIe i n your currenl di recl ory. If IXICUTI c annol f i nd
il l her e, il I ooks i n l he di recl ory l hal you have assi gned S: l o.
B:('D)0 8#C'D# .)&#N LI S:
!=<'D)0 8'2#D9:2= .)&#N My. ool . Di s k: LI S
Oe n Li brary f uncl i on caIIs I ook her e for l he I i brary if il is nol aI ready I oaded
i n me mor y.
B:('D)0 8#C'D# .)&#N DIVS:
!=<'D)0 8'2#D9:2= .)&#N My. ool . Di s k: DIVS
Oe n Devi ce caIIs I ook her e for l he devi ce if il is nol aI ready I oaded i n me mor y.
B:('D)0 8#C'D# .)&#N IONTS :
!=<'D)0 8'2#D9:2= .)&#N My. ool . Di s k: IONTS
Oe n Ionl s I ook her e for your I oadabI e f onl s if l hey are nol aI ready I oaded i n
me mor y.
Nnt c: In addi l i on lo l he above assi gnabI e di recl ori es, ma ny r ogr ams oen fi I es
i n l he " : T " di recl ory. As you recaI I , you f i nd fiIe ( or di recl ory) na me s r edi cal ed
vi l h a " : " i n l he rool di recl ory. Theref or e " : T " is l he di recl ory T, vi l hi n l he rool ,
on l he cur r enl di sk. You us e l hi s di recl ory l o sl ore l emor ar y fi I es. Ir ogr ams
such as edi l ors I ace l hei r l emor ar y vor k fi I es, or bac ku coi es of l he I asl
fiIe edi l ed, i n l hi s di recl ory. If you run oul of sace on a di sk, l hi s is one of l he
firsl I aces you shouI d I ook f or fiIes l hal are no I onger needed.
Wh e n l he s ys l em i s firsl bool ed, Ami g a DOS i ni li aI I y assi gns C: l o l he : C
di recl ory. Thi s me a ns l hal if you bool vi l h a di sk l hal you had f or mal l ed by
i ssui ng l he c omma nd:
IORMAT DRI VI DIO: NAMI " My. ool . Di s k"
SYS: is assi gned lo " My. ool . Di s k" . The " I ogi caI devi c e" C: is as s i gned l o l he
C di recl ory on l he s ame di sk (lhal i s, My. ool . Di s k: c ) . Li kevi se, l he f oI I ovi ng
as s i gnmenl s are made
C: My. ool . Di s k: c
L: My. ool . Di s k: I
S: My. ool . Di s k: s
LI S : My. ool . Di s k. I i bs
DIVS: My. ool . Di s k: devs
IONTS: My. ool . Di s k: f onl s
16 AMIGADO5 U5ER'5 MANUAL
If a di recl ory is nol r esenl , l he cor r esondi ng I ogi caI devi ce is as s i gned lo
l he r ool di recl ory.
If you are so I ucky as lo have a har d di sk (caI I ed DHO:) and you va nl l o us e
l he s ys l em fi I es on il, you mus l i ssue l he f oI I ovi ng c omma nds lo l he s ys l em:
AS S I GN SYS: DHO:
AS S I GN C
AS S I GN L:
AS S I GN S
DHO: C
DHO: L
DHO: S
AS S I GN LI S : DHO: LI S
AS S I GN DIVS : DHO: DIVS
AS S I GN IONTS: DHO: IONTS
II ease kee i n mi nd l hal as s i gnmenl s are gI obaI l o aII CLI r oces s es . Chang-
i ng an as s i gnmenl vi l hi n one vi ndov c hanges il for aII vi ndovs .
If you va nl l o us e your ovn seci aI f onl I i brary, l ye
AS S I GN IONTS: " Se c i a I f onl di s k: myf o nl s "
If you vanl your c omma nds lo I oad f asl er ( and you have me mor y " l o b ur n" ) ,
l ye
ma k e d I r r a m: c
c oy s ys : c r a m: c aI I
a s s i g n c: r a m: c
Thi s coi es aII of l he nor maI Ami ga DOS c omma nds l o l he RAM di sk and
r eassi gns l he c omma nds di recl ory so l hal l he s ys l em f i nds l he m l her e.
O3V 45'.( %&'()*+, ?:&&).85
An Ami g a DOS c omma nd consi sl s of l he c omma nd name and ils ar gumenl s , if
any. To execul e an Ami g a DOS c omma nd, you l ye l he c o mma nd na me and ils
ar gumenl s af l er l he CLI r oml .
Wh e n you l ye a c omma nd na me , l he c omma nd r uns as arl of l he Com-
ma nd Li ne I nl erf ace ( CLI ) . You can l ye ol her c omma nd na me s ahead, bul
Ami ga DOS does nol execul e l he m unl i I l he currenl c omma nd has f i ni shed.
Wh e n a c omma nd has f i ni shed, l he currenl CLI r oml aear s . I n lhi s case,
l he c o mma nd i s r unni ng i nl eracl i veI y.
The CLI r oml is i ni li aI Iy n > , vher e n is l he numbe r of l he CLI r oces s.
Hove ve r , il can be c hanged lo s omel hi ng eI se vi l h l he I ROMI T c omma nd.
( Ior f ur l her delai I s on l he IROMIT c omma nd, see Chal er 2 of l hi s manuaI . )
INTRODUCING AMIGADO5 17
WARNI NG: If you r un a c omma nd i nl eracl i veI y and il fai I s, Ami g a DOS
conl i nues lo execul e l he nexl c omma nd you l yed anyvay. Ther ef or e, il
can be danger ous lo l ye ma ny c omma nds ahead. Ior examI e, if you
l ye
COIY a TO b
DILITI a
and l he COI Y c omma nd faiIs ( er has bec aus e l he di sk is fuI I ), l hen DILITI
execul es and you I ose your fi I e.
O3V3O G/..'.( ?:&&).85 '. 9"# W)DM(2:/.8
You can i nsl rucl Ami ga DOS lo r un a c omma nd, or c omma nds , i n l he back-
gr ound. To do l hi s, you us e l he RUN c omma nd. Thi s creal es a ne v CLI as a
sear al e r ocess of I over ri ori ly. I n l hi s case, Ami ga DOS execul es s ubs e-
quenl c omma nd I i nes al l he s ame l i me as l hose l hal have be e n RUN. Ior
examI e, you can exami ne l he conl enl s of your di recl ory al l he s ame l i me as
s endi ng a coy of your lexl fiIe lo l he ri nl er. To do l hi s, l ye
RUN TYII l e x l _ f i I e l o IRT:
LI S T
RUN creal es a ne v CLI and carri es oul your ri nl i ng vhi I e you Iisl your
di recl ory fiIes on your ori gi naI CLI vi ndov.
Yo u c an as k Ami ga DOS l o carry oul severaI c omma nds us i ng RUN. RUN
l akes each c omma nd and carri es il oul i n l he gi ven order. The I i ne conl ai ni ng
c omma nds af l er RUN is caI I ed a c omma nd I i ne. To l er mi nal e l he c o mma nd
I i ne, r ess RITURN. To exl end your c omma nd I i ne over severaI I i nes, l ye a
I us si gn ( + ) bef or e r essi ng RITURN on ever y I i ne excel l he I asl. Ior
examI e,
RUN } O I N l e x l _ f i I e 1 l e x l f i I e 2 AS l e xl f i I e +
SORT l e x l f i I e TO s or l ed l e x l +
TYI I s or l ed l e x l l o IRT:
O3V3P JX#D/9'.( ?:&&).8 R'0#5
You can aI so us e l he IXICUTI c omma nd l o execul e c omma nd I i nes i n a fiIe
i nsl ead of l yi ng l hem i n di recl I y. The CLI reads l he s equenc e of c omma nds
f r om l he fiIe unl i I il f i nds an error or l he e nd of l he fi I e. If il f i nds an error,
18 AMIGADO5 U5ER'5 MANUAL
Ami ga DOS does nol execul e s ubs equenl c omma nds on l he RUN I i ne or i n l he
fiIe us ed by IXICUTI, unI ess you have us ed l he IAI LAT c omma nd. See
Chal er 2 of l hi s manuaI f or delai I s on l he IAI LAT c omma nd. The CLI onI y
gi ves r oml s af l er execul i ng c omma nds l hal have r un i nl eracl i veI y.
O3V3Q *'2#D9'.( ?:&&).8 H.</9 ).8 +/9</9
Ami ga DOS rovi des a vay for you lo redi recl sl andar d i nul and oul ul . You
use l he > and < symboI s as commands . Whe n you l ye a c ommand, Ami gaDOS
usuaI I y di sI ays l he oul ul f rom l hal c ommand on l he screen. To leII Ami ga DOS
lo s end l he oul ul lo a fi I e, you can us e l he > c omma nd. To leII Ami ga DOS lo
accel l he i nul lo a r ogr am f r om a seci f i ed fiIe ral her l han f r om l he
keyboar d, you us e l he < c omma nd. The < and > c omma nds acl I i ke lraffi c
cos vho di recl l he f I ov of i nf or mal i on. Ior examI e, lo di recl l he oul ul f r om
l he DATI c o mma nd and vri l e il lo l he fiIe na me d " l exl f i I e" , you vouI d l ye
l he f oI I ovi ng c omma nd I i ne:
DATI > l e x l _ f i I e
See Chal er 2 of l he 45#265 -)./)0 f or a fuII seci f i cal i on of l he < and >
s ymboI s .
O3V3V H.9#22/<9'.( %&'()*+,
Ami ga DOS aI I ovs you lo i ndi cal e four I eveI s of al l enl i on i nl errul vi l h CTRL- C,
CTRL- D, CTRL- I, and CTRL- I. To sl o l he currenl c omma nd f r om vhal ever il
va s doi ng, ress CTRL- C. In s ome cases, such as IDI T, r essi ng CTRL- C
i nsl rucl s l he c omma nd lo sl o vhal il vas doi ng and l hen l o rel urn lo r eadi ng
mor e IDI T c ommands . To leII l he CLI lo sl o a c ommand sequence i ni li aled by
l he IXICUTI c omma nd as s oon as l he currenl c omma nd bei ng execul ed
f i ni shes, r es s CTRL- D. CTRL- I and CTRL- I are onI y us ed by cerl ai n c om-
ma nds i n seci aI cases. See l he *#C#0:<#265 -)./)0 i n l hi s book f or del ai I s.
Nnt c: Il is l he r ogr ammer ' s resonsi bi I i l y lo del ecl and r es ond lo l hes e
i nl er r ul i on f I ags. Ami ga DOS viII nol kiII a r ogr am by i lseI f.
O3V3T 4.8#259).8'.( ?:&&).8 R:2&)95
Thi s secl i on exI ai ns l he sl andar d f or mal or ar gumenl l emI al e us ed by mos l
Ami ga DOS c omma nds l o seci f y l hei r ar gumenl s . Chal er 2 of l hi s manuaI
i ncI udes l hi s ar gumenl l emI al e i n l he documenl al i on of each of l he c om-
ma nds . The l emI al e rovi des you vi l h a greal deaI of fIexibiIily i n l he or der
and f or m of l he synl ax of your c ommands .
The ar gumenl l emI al e seci f i es a Iisl of kcywnr ds l hal you ma y us e as
INTRODUCING AMIGADO5 19
s ynonyms , so l hal you l ye l he aI l ernal i ves af l er l he keyvor d, and searal e
l he m vi l h an
Ior examI e,
AC, WWW, XYZ ZZZ
seci f i es keyvor ds , AC, W W W , and XYZ. The user ma y us e ke yvor d ZZZ as
an aI l ernal i ve lo l he keyvor d XYZ.
The s e keyvor ds seci f y l he numbe r and f or m of l he ar gumenl s l hal l he
r ogr am execl s. The ar gumenl s ma y be ol i onaI or requi red. If you gi ve l he
ar gumenl s , you ma y seci f y l hem i n one of l vo vays :
By pnsi t i nn I n l hi s case, you rovi de l he ar gumenl s i n l he s ame or der as l he
keyvor d Iisl i ndi cal es.
By kcywnr d In lhi s case, l he order does nol mal l er , and you r ecede each
ar gumenl vi l h l he reI evanl keyvor d.
Ior examI e, if l he c ommand MYCOMMAND r ead f r om one fiIe and vr ol e lo
anol her , l he ar gumenl l emI al e vouI d be:
I ROMT O
You couI d us e l he c omma nd seci f yi ng l he ar gumenl s by osi l i on:
MYCOMMAND i nul - f i I e oul ul - f i I e
or us i ng l he keyvor ds :
MYCOMMAND I ROM i nul - f i I e TO oul ul - f i I e
MYCOMMAND TO oul ul - f i I e I ROM i nul - f i I e
You couI d aI so c ombi ne l he osi l i onaI and keyvor d ar gumenl seci f i cal i ons,
f or examI e, vi l h l he f oI I ovi ng:
MYCOMMAND i nul - f i I e TO oul ul - f i I e
vhe r e you gi ve l he I ROM ar gumenl by osi l i on, and l he TO ar gumenl by
keyvor d. Nol e l hal l he f oI I ovi ng f or m is i ncorrecl :
MYCOMMAND oul ul - f i I e IROM i nul - f i I e
becaus e l he c omma nd as s umes l hal ' oul ul - f i I e' is l he firsl osi l i onaI ar gumenl
(l hal i s, l he I ROM fi I e).
20 AMIGADO5 U5ER'5 MANUAL
If l he ar gumenl is nol a si ngI e vor d (l hal i s, s ur r ounded or " de I i mi l e d" by
saces) , l hen you mus l encI ose il vi l h quol al i on mar ks ( " ) . If l he ar gumenl has
l he s ame vaI ue as one of l he keyvor ds , you mus l aI so encI ose il vi l h quol al i on
mar ks . Ior examI e, l he f oI I ovi ng:
MYCOMMAxTD " f i I e n a m e " TO " de s l i na l i o n"
suI i es l he l exl "f i I e n a m e " as l he I ROM ar gumenl , and l he fiIe na me
" de s l i nal i on" as l he TO ar gumenl .
The ke yvor ds i n l hese ar gumenl I i sls have cerl ai n quaI i fi ers associ al ed vi l h
l he m. The s e quaI i fi ers are r er es enl ed by a sI ash (/) and a seci fi c I el l er. The
meani ngs of l he quaI i fi ers are as f oI I ovs:
/ A The ar gumenl is requi red and may nol be omi l l ed.
/ K The ar gumenl mus l be gi ven vi l h l he ke yvor d and ma y nol be us ed
osi l i onaI I y.
/ S The ke yvor d is a svi l ch (l hal i s, a l oggI e) and l akes no ar gumenl .
The quaI i f i ers A and K ma y be c ombi ned, so l hal l he l emI al e
DRI VI/ A/ K
me a ns l hal you mus l gi ve l he ar gumenl and keyvor d DRI VI.
I n s ome cas es, no keyvor ds ma y be gi ven. Ior examI e, l he c omma nd
DILITI si mI y l akes a numbe r of fiIes for Ami ga DOS lo deI el e. In l hi s cas e,
you si mI y omi l l he keyvor d vaI ue, bul l he c ommas nor maI I y us ed l o sear al e
l he keyvor ds r emai n i n l he l emI al e. Thus , l he l emI al e f or DILITI, l hal can
l ake u lo l en f i I enames, i s
) ) ) ) )
Ii naI I y, consi der l he c omma nd TYII. The ar gumenl l emI al e i s
IROM/ A, TO, OIT/ K
vhi c h me a ns l hal you ma y gi ve l he firsl ar gumenl by osi l i on or by ke yvor d,
bul l hal firsl ar gumenl is r equi r ed. The s econd ar gumenl ( TO) i s ol i onaI , and
you ma y omi l l he keyvor d. The OIT ar gumenl is ol i onaI , bul if il is gi ven,
you mus l r ovi de l he keyvor d. So, l he f oI I ovi ng are aII vaI i d f or ms of l he
TYII c omma nd:
INTRODUCING AMIGADO5
21
TYII f i I e na me
TYII IROM f i I e na me
TYI I f i I e na me TO oul ul - f i I e
TYII f i I e na me oul ul - f i I e
TYI I TO oul ul - f i I e IROM f i I e na me OIT n
TYI I f i I e na me OIT n
TYI I f i I e na me OIT n TO oul ul - f i I e
AI l hough lhi s manuaI Iisls aII l he ar gumenl s execl ed by l he c omma nds , you
can di sI ay l he ar gumenl l emI al e by si mI y l yi ng l he na me of l he c om-
ma nd, f oI I oved by a sace and a quesl i on mar k (`).
If l he ar gumenl s you seci f y do nol mal c h l he l emI al e, mos l c omma nds
si mI y di sI ay l he mes s age " a d a r gs " or " a d a r gume nl s " and sl o. You mus l
r el ye l he c omma nd na me and ar gumenl . To di sI ay on l he s cr een heI on
vha l ar gumenl s l he c omma nd execl ed, you can aI vays l ye a quesl i on mar k
(`)
O3T G#59)29 Y)0'8)9':. ;2:D#55
Wh e n you firsl i nserl a di sk f or udal i ng, Ami ga DOS creal es a r ocess al I ov
ri ori l y. Thi s vaI i dal es l he enl i re sl rucl ure on l he di sk. Unl i I l he resl arl r oces s
has comI el ed lhi s | ob, you cannol creal e fiIes on l he di sk. Il is ossi bI e,
hovever , l o r ead fi I es.
Whe n l he resl arl r ocess comI el es, Ami ga DOS checks l o see if you have sel
l he s ys l em dal e and l i me. To sel l he dal e and l i me, you us e l he DATI
c omma nd. If you do nol seci f y l he s ys l em dal e, Ami ga DOS sel s l he s ys l em
dal e lo l he dal e a nd l i me of l he mos l recenl I y cr eal ed fiIe on l he i nser l ed di sk.
Thi s ens ur es l hal ne ve r ver si ons of fiIes have mor e r ecenl dal es, even l hough
l he acl uaI l i me and dal e viII be i ncorrecl .
If you ask f or l he dal e and l he l i me bef or e l he vaI i dal i on is c omI el e,
Ami ga DOS di sI ays l he dal e and l i me as uns el . You can l hen ei l her vai l f or
l he vaI i dal i on l o comI el e or us e DATI lo enl er l he correcl dal e and l i me.
VaI i dal i on shouI d hae n al once, ol her vi s e, il s houI d never l ake I onger l han
one mi nul e.
O3Z ?:&&:.0= 45#8 ?:&&).85N %. JX)&<0# ,#55':.
Thi s manuaI descri bes l he vari ous Ami ga DOS c omma nds . The Co mma n d Li ne
I nl errel er (CLI) reads Ami ga DOS c omma nds l yed i nl o a CLI vi ndov and
l ransI al es l he m i nl o acl i ons er f or med by l he c omul er . I n lhi s s ens e l he CLI
22
AMIGADO5 U5ER'5 MANUAL
is si mi I ar lo mor e " l r adi l i onaI " comul er i nl erf aces: you l ye i n c omma nds
and l he i nl erf ace di sI ays l exl i n rel urn.
ec aus e l he Wor kbe nc h i nl erf ace i s suf f i ci enl a nd f ri endI y f or mos l us er s ,
l he Wor kbe nc h di skel l es are s hi ed vi l h l he CLI i nl erf ace " di s a bI e d" . To us e
l he c omma nds i n lhi s manuaI you mus l " e na b I e " l he CLI i nl erf ace. Thi s ul s a
ne v i con, I abeI ed " C L I " on your Wor kbenc h. Whe n you have seI ecl ed and
oe ne d lhi s i con, a CLI vi ndov be c ome s avai I abI e, and you can us e il lo i ssue
l exl c omma nds di recl I y lo Ami ga DOS .
@:I 9: J.)K0# 9"# ?:&&).8 B'.# H.9#2>)D#
ool your c omul er us i ng l he Ki cksl arl di skel l e and a vri l abI e coy of your
Wor kbe nc h di skel l e. Oe n l he Wor kbe nc h di skel l e i con. Oe n l he " Ir ef er -
e nc e s " l ooI . Near l he I ef l - hand si de of l he screen, aboul l vo- l hi rds of l he va y
dovn you vi I I nol i ce " C L I " vi l h a bul l on for " O N " and a bul l on " O I I " .
SeI ecl l he " O N " bul l on. SeI ecl " S a v e " ( I over ri ghl arl of l he Ir ef er ences
screen) lo I eave Ir ef er ences.
@:I 9: -)M# ) S#I ?BH L'.8:I
To us e l he CLI c omma nds , you oen a CLI vi ndov. Oe n l he " S y s l e m"
dr aver . The CLI i con (a cube conl ai ni ng " 1 > " ) shouI d nov be vi si bI e. Oe n il.
45'.( 9"# ?BH
To us e l he CLI i nl erf ace, seI ecl l he CLI vi ndov and l ye l he desi red CLI
c omma nds ( descri bed vi l hi n lhi s manuaI ) . The CLI vi ndov( s ) ma y be si zed
and move d | us l Iike ma ny ol her s. To cI ose l he CLI vi ndov, l ye " I NDCL I " .
L:2MK#.D" ).8 ?BHN !"#'2 G#0)9':.5"'<5 ).8 *'>>#2#.D#5
Tye " D I R " l o di sI ay a Iisl of fiIes ( and di recl ori es) i n l he currenl di sk
di recl ory. Thi s i s a I i sl of fiIes l hal makes u your Wor kbe nc h. You may nol i ce
l hal l her e are ma ny mor e fiIes in l hi s di recl ory l han l her e are i cons on l he
Wor kbe nc h. The r eas on f or lhi s is l hal Wor kbe nc h viII onI y di sI ay fiIe " X " if il
has an associ al ed " X. i nf o " fi I e. In facl l he " . i nf o " ( r onounc ed " dol i nf o" ) fiIe
conl ai ns aII of l he i con di sI ay i nf or mal i on.
Ior examI e, l he di skcoy r ogr am has l vo fiIes associ al ed vi l h il. The
fiIe " Di s k c o y " conl ai ns l he r ogr am and " Di s kc oy. i nf o" conl ai ns l he Wor k-
be nc h i nf or mal i on aboul il. I n l he cas e of ai nl i ng dal a fiIes I i ke " mo unl . i c " ,
l he fiIe " mounl . i c . i nf o " conl ai ns i con i nf or mal i on and l he na me of l he r o-
gr am (defauI l ) l hal shouI d rocess il ( Grahi Craf l ) . In lhi s cas e, vhe n l he
INTRODUCING AMIGADO5 23
us er " o e n s " l he dal a fiIe ( mounl . i c. i nf o) , Wor kbe nc h r uns l he r ogr am and
as s es l he dal a fiIe na me ( mounl , i c) lo il.
Ami ga DOS sub- di recl ori es cor r es ond l o Wor kbe nc h dr aver s. Ra ndom ac-
cess bI ock devi ces such as di sks (DIO:) cor r es ond l o l he di skel l e i cons you
have seen.
Nol aII r ogr ams or c omma nds can be r un under bol h Wor kbe nc h and l he
CLI envi r onmenl . None of l he CLI c ommands descr i bed i n Chal er 2 of l he
%&'()*+, 45#265 -)./)0 can be r un f r om Wor kbenc h. Ior examI e, l her e are
l vo searal e Di s kcoy c ommands . The one i n l he :c/ di recl ory vor ks vi l h
Ami ga DOS ( CLI ) . The one i n l he s ys l em di recl ory ( draver) vor ks vi l h
Wor kbe nc h.
%. H.92:8/D9':. 9: ,:&# :> 9"# %&'()*+, ?:&&).85
AI l hough aII of l he c omma nds l hal are avai I abI e l hr ough l he CLI are exI ai ned
i n delai I i n l he r ef er ence arl of l he %&'()*+, 45#265 -)./)0F ve have f ound
l hal mos l user s vi I I us e ver y f ev of l he advanced ol i ons. Ther ef or e ve have
r ovi ded a s umma r y her e s hovi ng vari ous c omma nds i n l hei r mos l c o mmo n
f or m.
The c omma nds s ummar i zed beI ov ( aI ong vi l h l he acl uaI Ami ga DOS c om-
ma nd na me ) ask Ami ga DOS lo do such c omma nds as
Coy a di skel l e ( DI SKCOIY)
Ior mal a ne v di skel l e ( IORMAT)
Ma ke a f or mal l ed di skel l e bool abI e,
creal e a CLI di sk ( I NSTALL)
ReI abeI a di skel l e ( RILAIL)
Look al l he di recl ory of a di skel l e ( DI R)
Gel i nf or mal i on aboul fiIes ( LI ST)
Ir evenl a fiIe f r om acci denl aI deI el i on ( IROTICT)
Gel I nf or mal i on aboul a fiIe s ys l em ( I NIO)
Cha nge a cur r enl di recl ory ( CD)
Sel l he dal e and l i me ( DATI)
Redi recl l he oul ul of a c omma nd ( > )
Tye a l exl fiIe lo l he scr een ( TYII)
Re na me a fiIe ( RINAMI)
DeI el e a fiIe ( DILITI)
Cr eal e a n e v di recl ory ( MAKIDI R)
Coy fi I es on a duaI - dri ve s ys l em ( COIY)
Coy fiIes on a si ngI e- dri ve s ys l em ( COIY)
Ii nd fiIes on a di skel l e ( DI R OIT A)
Do s omel hi ng aul omal i caI I y al bool l i me ( usi ng Sl ar l u- Sequence)
24 AMIGADO5 U5ER'5 MANUAL
TeI I Ami ga DOS vher e lo I ook for cerl ai n l hi ngs ( ASSI GN)
Oe n a n e v CLI vi ndov ( NIWCLI )
CI ose an exi sl i ng CLI vi ndov ( INDCLI )
AI I of l he c o mma nd s equenc es beI ov as s ume l hal you have sl arl ed your
s ys l em vi l h a CLI di sk ral her l han a Wor kbenc h di sk, or l hal you have l ur ned
on l he CLI us i ng l he r ef er ences l ooI and have enl er ed l he CLI by l hal al h.
The s equenc e f or l ur ni ng on l he CLI i s r ovi ded earI i er i n l hi s manuaI .
R:2 ) S#I 45#2
Ior a n e v user , ve s ugges l l hal you r ead and lry each of l hes e i l ems i n
s equenc e. Iac h c omma nd l hal i s s hovn beI ov I eaves a l esl di sk i n a knovn
sl al e so l hal l he c omma nd l hal i mmedi al eI y f oI I ovs viII vor k exacl I y as
s hovn. Lal er, vh e n you are mor e fami I i ar vi l h l he s ys l em, l he ar agr ah
li lI es s hovn beI ov vi I I serve lo ref resh your me mor y.
@:I 9: W#('.
ef or e you begi n l hi s secl i on, be sure you have l vo bI ank, doubI e- si ded
di skel l es, and ei l her your Wor kbe nc h di sk or your CLI di sk. ef or e you begi n,
vri l e- rol ecl your mas l er di skel l e, and vri l e- enabI e l he bI ank di skel l es. Mos l
of l he c omma nds gi ven beI ov as s ume l hal you have a si ngI e- dri ve s ys l em,
hovever , f or c onveni enc e of l hos e vi l h duaI - dri ve s ys l ems , l he duaI - dri ve
ver si on of l he c omma nd i s occasi onaI I y gi ven.
Co mma nds l hal i nsl rucl Ami ga DOS l o execul e are s hovn i n l he f oI I ovi ng
secl i ons, i ndenl ed f r om l he Iefl mar gi n. Af l er l yi ng each c o mma nd, r ess l he
RITURN key lo r el ur n conl roI lo Ami ga DOS . AI l hough l he c omma nds are aII
s hovn i n cai l aI I el l ers, l hi s is si mI y l o di sl i ngui sh l he m f r om l he resl of
l he lexl . Ami ga DOS viII accel l he c omma nds i n I over case as veI I as uer
case.
I n l he secl i ons l hal f oI I ov, l he nol al i ons " df O: " and " dr i ve 0 " ref er l o l he
di sk dri ve l hal is bui I l i nl o l he Ami ga. The nol al i on " d f I : " ref ers lo l he firsl
exl ernaI "#$-inch di sk dri ve.
You vi I I occasi onaI I y see a semi coI on on a c omma nd I i ne l hal you are l oI d l o
l ye. Wha l f oI I ovs l he semi coI on is l real ed as a c omme nl by Ami ga DOS . Si nce
Ami g a DOS i gnor es l he resl of l he I i ne, you don' l ne e d lo l ye l he c omme nl
aI ong vi l h l he c omma nd. Il is f or your i nf or mal i on onI y.
Ior mos l c omma nds , you can gel a ver y I i mi l ed f or m of heI by l yi ng l he
c o mma nd na me , f oI I oved by a quesl i on mar k (`) and r essi ng RITURN. Il
s hovs you l he " l e mI a l e " of a c omma nd, conl ai ni ng l he s equenc e of ar ame -
l ers il execl s and l he keyvor ds il r ecogni zes.
INTRODUCING AMIGADO5
25
?:<='.( ) *'5M
You can us e l hi s s equence lo back u your s ys l em mas l er di sk or any ol her
di sk.
Ior a 1 di sk s ys l em
DI SKCOIY I ROM dfO: TO dfO:
Ior a 2 di sk s ys l em
DI S KCOIY I ROM dfO: TO df I :
IoI I ov l he i nsl rucl i ons as l hey aear . Ior a si ngI e dri ve s ys l em, you' I I be
i nsl rucl ed l o i nserl l he mas l er ( IROM) di sk. The n, as l he coyi ng r ogr es s es ,
Ami ga DOS asks you lo i nserl l he coy ( TO) di sk, s vai ng mas l er and coy
i n and oul unl i I aII of l he di skel l e has be e n duI i cal ed. Ior a l vo di sk s ys l em,
you' I I be i nsl r ucl ed l o ul l he masl er di skel l e i nl o dri ve dfO: ( l he bui I l - i n
dri ve) and l he c oy di skel l e onl o vhi ch lo coy i nl o df I : ( l he firsl exl ernaI
dri ve) .
Re move your mas l er di skel l e ( ei l her Wor kbe nc h or CLI di sk) and ul your
mas l er di skel l e i n a safe I ace. Leave l he coy vr i l e- enabI ed so l hal you can
sl ore i nf or mal i on on il. I nserl l he coy you have | usl ma de i nl o l he bui I l - i n
dri ve and r ebool your s ys l em f r om l he coy. ( See I nl r oducl i on To Ami ga for
l he r ebool r ocess) .
Af l er l he r ebool , r eenl er l he CLI mode agai n. If you bool vi l h a CLI di sk,
l he r ebool enl er s l he CLI aul omal i caI I y. If you are us i ng a Wor kbe nc h di sk,
you mus l oe n l he CLI i con i n l he s ys l em dr aver of l he Wor kbe nc h.
R:2&)99'.( ) *'5M
To l ry l hi s c omma nd, your Wor kbe nc h or CLI di skel l e coy s houI d be i n dri ve
0, and you s houI d have a bI ank di skel l e avai I abI e.
Somel i mes ral her l han si mI y coy a di sk, you' I I vanl lo r ear e a dal a di sk
f or your s ys l em. The n I aler you can coy seI ecl ed fiIes lo lhi s dal a di sk. Ior mal
your s ec ond bI ank di sk by usi ng l he I ORMAT c omma nd:
IORMAT DRI VI dfO: NAMI " An y Na me "
IoI I ov l he i nsl rucl i ons. You can f ormal di skel l es i n ei l her dri ve 0 (dfO:, bui I l i n
lo your Ami ga) or an exl ernaI dri ve.
Af l er l he f or mal is comI el ed, vai l for l he di sk acli vi ly I i ghl lo go off and
26
AMIGADO5 U5ER'5 MANUAL
r emove l he f reshI y f or mal l ed di skel l e. Rei nserl your Wor kbe nc h or CLI di sk-
el l e. The f or mal l ed di skel l e can nov be us e d lo hoI d dal a fi I es. Il is nol
bool abI e, hove ve r .
-)M'.( ) *'5M W::9)K0#
To l ry l hi s c omma nd, your Wor kbe nc h or CLI di skel l e coy s houI d be i n dri ve
0. a nd you s houI d have your f reshI y f or mal l ed di sk avai I abI e.
Ther e are severaI di f f erenl vays l o creal e a CLI di skel l e. Tvo of l hes e vays
are s hovn beI ov.
A bool abI e di sk is one l hal you can us e lo slarl u your Ami ga f oI I ovi ng l he
Ki cksl arl r ocess . You can c hange a f or mal l ed di sk i nl o a CLI di sk by l yi ng
l he c omma nd:
I NSTALL `
Nnt c: l o us e l hi s c omma nd on a si ngI e dri ve s ys l em, you MUS T us e l he
quesl i on mar k! Ol her vi s e Ami ga DOS viII l ry l o do l he i nslaI I on l he di sk
cur r enl I y i n dri ve 0.
Ami ga DOS r es onds :
DRI VI/ A
Re move your Wor kbe nc h di skel l e coy and i nserl l he f or mal l ed di sk. The n
l ye:
dfO:
and r ess RITURN. Ami ga DOS coi es bool secl ors lo l he di skel l e. No v, if you
vai l unl i I l he di sk acli vi ly I i ghl goes oul , you can l hen er f or m a fuII resel
( CTRL- Ami ga- Ami ga) . Whe n l he s ys l em r ebool s , you vi I I go di recl I y i nl o l he
CLI ral her l han i nl o l he Wor kbe nc h.
Your f ormal l ed di skel l e nov conl ai ns a CLI and nol hi ng eI se. Thi s me ans l hal
aI l hough you see l he i nl errel er, il can' l er f or m any of l he c omma nds s hovn
i n l hi s secl i on. A CLI needs severaI fiIes bef ore ils c omma nds can be er f or med.
AI I of l he c o mma nd fi I es are I ocal ed i n l he C di recl ory of your mas l er di skel l e.
The s ec ond vay lo r oduce a CLI di sk gi ves you a mor e usef uI di sk i n l hal il
I eaves l he CLI c omma nd di recl ori es i nl acl . Her e is a sl e- by- sl e r ocess lo
c hange a vri l abI e coy of a Wor kbe nc h di skel l e i nl o a CLI di skel l e:
1. Coy your Wor kbe nc h di skel l e.
2. Oe n l he CLI as descri bed above.
3. CI i ck l he seI ecl i on bul l on on l he CLI vi ndov and l ye l he c omma nd:
INTRODUCING AMIGADO5
27
RI NAMI IROM s / s l a r l u- s e que nc e TO s / NO- s l ar l u- s e que nc e
No v if you vai l f or l he di sk acli vi ly I i ghl l o go off a nd er f or m a fuI I r es el ,
your Wor kbe nc h di skel l e coy vi I I have be c ome a CLI . To resl ore l he Wor k-
be nc h, er f or m l he r e name agai n, bul vi l h l he na me s equenc e r ever s ed. You
s ee, if Ami ga DOS can' l f i nd a fiIe vi l h l he exacl na me " s l a r l u- s e que nc e " i n
l he " s " di recl ory, il vi I I enl er c omma nd mode and vai l f or you lo l ye a
c omma nd.
G#0)K#0'.( ) *'5M
ef or e you lry l hi s c omma nd, your Wor kbe nc h or CLI di skel l e coy s houI d be
i n dri ve 0.
If, af l er ei l her coyi ng or f ormal l i ng a di skel l e, you are nol sal i sf i ed vi l h l he
voI ume na me you have gi ven il, you can c hange l he na me of l he voI ume by
us i ng l he RILAIL c omma nd:
r e I a be I An y Na me : Di f f e r e nl Na me
I n l hi s examI e, ve have ref erred l o l he di skel l e ve | usl f or mal l ed by ils
voI ume na me . You vi I I be as ked l o i nserl voI ume Any Na me i nl o any di sk
dri ve s o l hal RILAIL c an reI abeI il.
Af l er l hi s c omma nd comI el es , r emove l he di skel l e and rei nserl your
Wor kbe nc h or CLI di skel l e. The di skel l e you r emoved nov has l he n e v na me .
B::M'.( )9 9"# *'2#D9:2=
ef ore you lry l hi s c omma nd, your Wor kbe nc h or CLI di skel l e coy s houI d be
i n dri ve 0.
You I ook al l he conl enl s of a di skel l e vi l h l he c omma nd:
DI R or DI R dfO:
Thi s f or m Iisls l he conl enl s of your cur r enl di recl ory. You can Iisl l he conl enl s
of a di f f erenl di recl ory by seci f yi ng l he al hname for l hal di recl ory. Ior
examI e, l he c omma nd:
DI R dfO:C or DI R c
Iisls l he conl enl s of l he c(dir) on dri ve dfO. Di recl ori es are equi vaI enl lo l he
dr aver s you s ee vh e n l he Wor kbe nc h s cr een i s vi si bI e.
You can I ook al l he di recl ory of a di f f erenl di sk uni l , if you have one , by
seci f yi ng ils name . Ior examI e:
28
AMIGADO5 U5ER'5 MANUAL
DI R df I :
I i sl s l he c onl enl s of a di skel l e i nser l ed i n dri ve 1 ( l he fi rsl exl ernaI dri ve if you
have one al l ached) .
Yo u can e ven I ook al l he di recl ory of a di skel l e l hal i sn' l currenl I y i n l he
dri ve by seci f yi ng ils voI ume na me . Ior examI e, l he conl enl s of l hal f reshI y
f or mal l ed di skel l e vhos e na me ve c hanged can be di sI ayed by l he c omma nd:
DI R Di f f e r e nl Na me :
Ami ga DOS vi I I ask you lo i nserl di skel l e Di f f er enl Name i nl o l he dri ve so l hal
DI R can r ead il and reorl l he conl enl s of l he di recl ory. Don' l do il yel ,
hovever , bec aus e l her e are no fiIes r es enl f or DI R lo r ead. We' I I add s ome
fiIes I al er.
45'.( 9"# BH,! ?:&&).8
To l ry l hi s c omma nd, your Wor kbe nc h or CLI di skel l e coy s houI d be i n dri ve
0.
The DI R c omma nd leI Is you l he na me s of fiIes l hal are i n your di recl ory. The
LI ST c o mma nd r ovi des addi l i onaI i nf or mal i on aboul l hos e fi I es. Tye l he
c omma nd:
LI S T or LI S T dfO:
Ami ga DOS r ovi des i nf ormal i on aboul aII fiIes i n l he cur r enl di recl ory,
i ncI udi ng ho v I arge each fiIe i s, vhel her il ma y or ma y nol be deI el ed,
vhe l he r il is a fiIe or a di recl ory, and l he dal e and l i me of ils creal i on.
If you seci f y l he na me of a di recl ory vi l h LI ST, il Iisls i nf or mal i on aboul
l he fi I es vi l hi n l hal di recl ory:
LI S T c
The " r v e d " are caI I ed rol ecl i on f I ags, for r ead, vr i l e, execul e, and deI el e.
Wh e n each fI ag is sel , usi ng l he IROTICT c omma nd, a fiIe is s uos ed l o be
readabI e, vri l abI e, execul abI e, or deI eleabI e. As of l he currenl reI ease, Ami ga DOS
onI y ays al l enl i on l o l he deI el e- f I ag. If l he " d " does n' l s ho v u i n l he
" r v e d " c oI umn for a f i I ename, Ami ga DOS von' l deI el e l hal fiIe dur i ng a
DILITI c omma nd.
INTRODUCING AMIGADO5
29
45'.( 9"# ;2:9#D9 ?:&&).8
To l ry l hi s c omma nd, your Wor kbe nc h or CLI di skel l e coy s houI d be i n dri ve
0.
Thi s c o mma nd rol ecl s (or unr ol ecl s) a fiIe f r om bei ng deI el ed acci denl aI I y.
Tr y l he c omma nd:
DATI > myf i I e
IROTICT myf i I e
LI S T myf i I e
You vi I I see l hal aII of l he rol ecl - f I ags have be e n sel l o " " . No v if you
l ry:
DILITI myf i I e
Ami ga DOS r es onds :
" Nol DeI el e d - f i I e i s r ol e c l e d f r o m de I e l i on"
To r eenabI e deI el i on of l he fiIe:
IROTICT myf i I e d or IROTICT myf i I e r ve d
7#99'.( H.>:2&)9':. %K:/9 9"# R'0# ,=59#&
Your Wor kbe nc h or CLI di skel l e c oy shouI d sliII be i n dri ve 0. Tye l he
c omma nd:
I NIO
Il leIIs you hov muc h sace is us ed and hov muc h is free on your di skel l es,
vhe l he r l hey are r ead- onI y or read- vri l e, and l he na me of l he voI ume. You
c an make mor e sace on l he di skel l e by deI el i ng fi I es. Yo u can c hange l he
na me of l he voI ume by usi ng l he RILAIL c omma nd.
If you vanl lo gel i nf or mal i on aboul a di sk l hal i sn' l in your si ngI e- dri ve al
l he mome nl , i ssue l he c omma nd as:
I NIO `
Ami ga DOS r es onds :
no ne :
30
AMIGADO5 U5ER'5 MANUAL
Ami ga DOS has I oaded l he I NIO c omma nd f r om your CLI di sk and s hovs
you l he l emI al e for l he c omma nd. The r es ons e " n o n e : " says l hal you don' l
have l o l ye anyl hi ng ol her l han a RITURN key l o have il er f or m l he c om-
ma nd. Re move your CLI di sk and i nserl l he di sk on vhi c h you vanl I NIO l o
oer al e. Wai l f or l he di sk acli vi ly I i ghl lo go on and off. The n r ess RITURN.
Ami ga DOS gi ves you I NIO aboul l hi s ol her di sk. Thi s vor ks f or DI R as veI I
as I NIO.
?").('.( [:/2 ?/22#.9 *'2#D9:2=
Unl i I nov, ve have onI y sl ayed al l he " r o o l " or l omos l hi erarchi caI I eveI of
l he di skel l e di recl ory. You vi I I f i nd mor e i nf or mal i on aboul l he di recl ory l ree
slruclure i n secli on 1.3 of lhi s manuaI . To see l he IeveI al vhi ch you are currenlI y
os i l i oned i n your di recl ory l r ee, you us e l he c omma nd:
CD
To c hange lo a di f f erenl currenl di recl ory, you leII l he s ys l em vhi c h di recl ory
is l o be c ome l he currenl one. Ior examI e, vhe n you di d a " di r " c omma nd on
dfO: l he CLI di skel l e you sav an enl ry c(di r) . If you vanl lo make lhi s di recl ory
l he cur r enl one , you i ssue l he c omma nd:
CD C or CD dfO:c
No v vhe n you i ssue l he c omma nd DI R, il s hovs l he conl enl s of lhi s I eveI
of l he fiIing s ys l em. The c omma nd CD ( aI one) s hovs you l he na me of your
cur r enl di recl ory. You go u lo l he rool di recl ory ( l he l o I eveI ) by seci f yi ng:
CD:
on l he cur r enl voI ume (if you ref er lo your di skel l es by voI ume name) or
CD dfO:
on l he bui I l - i n dri ve.
,#99'.( 9"# *)9# ).8 !'&#
You can sel l he Ami ga DOS cI ock by usi ng l he DATI c omma nd:
DATI 1 2 : 0 0 : 0 0 12-OCt-85
No v l he s ys l em cI ock counl s u f r om lhi s dal e and l i me.
INTRODUCING AMIGADO5
31
G#8'2#D9'.( 9"# +/9</9 :> ) ?:&&).8
ef ore you l ry l hi s c omma nd, your Wor kbe nc h or CLI di skel l e s houI d be i n
dri ve 0.
Nor maI I y l he oul ul of aII c omma nds goes l o l he moni l or scr een. You can
c hange vher e l he s ys l em ul s l he oul ul by usi ng l he redi recl c o mma nd " > " .
The f or var d ar r ov s ymboI me a ns s end l he oul ul l ovar d l hi s oul ul fiIe
na me . Her e' s an examI e:
DATI > dal ef i I e
Ixecul e l he c omma nd so l hal you can us e l he dalefi I e descr i bed beI ov. Thi s
c ommand creales (or overvri les) a fiIe name d " dal ef i I e" in your currenl di reclory.
Or , | usl lo have s omel hi ng on l hal f or mal l ed di skel l e na me d Di f f er enl Name,
l ye l he f oI I ovi ng:
DATI > Di f f e r e nl Name : dal e f i I e
Ami ga DOS r oml s you lo i nserl l he voI ume vi l h l hal na me . Af l er l he di sk
acli vi ly I i ghl goes oul , r emove Di f f er enl Name and rei nserl your CLI or Wor k-
be nc h di skel l e. No v i ssue l he c omma nd:
DI R Di f f e r e nl Na me :
Agai n you are r oml ed l o i nserl Di f f er enl Name i nl o any dri ve. Ami g a DOS
Iisls l he di recl ory of lhi s di skel l e, vhi c h no v conl ai ns a fiIe na me d dal ef i I e.
ReI ace your CLI or Wor kbenc h di skel l e i n l he dri ve.
!=<'.( ) !#X9>'0# 9: 9"# ,D2##.
You can see l he conl enl s of a lexlfi Ie by usi ng l he TYII c omma nd:
TYII dal ef i I e
Thi s c omma nd viII di sI ay vhal ever you have in l he seci f i ed fi I e. If you
vi s h lo sl o l he oul ul momenl ar i I y lo read s omel hi ng on l he scr een, r es s
l he sace bar. To resl arl il ress l he ACKS I key. If you vi s h lo end l he TYII
c omma nd, hoI d dovn l he CTRL key, and ress l he C key.
If you vi s h lo veri f y l hal anol her di skel l e aI so has l he dal ef i I e c onl enl s on il,
you can er f or m l he c omma nd:
TYII Di f f e r e nl Name : dal e f i I e
32
AMIGADO5 U5ER'5 MANUAL
?").('.( 9"# S)&# :> ) R'0#
ef or e you l ry l hi s c omma nd, your Wor kbe nc h or CLI di skel l e c oy s houI d be
i n dri ve 0.
You can c hange l he na me of a fiIe by usi ng l he RINAMI c omma nd:
RI NAMI I ROM dal ef i I e TO n e v n a m e
or
RI NAMI dal ef i I e n e v n a m e
No v us e TYII l o veri f y l hal l he ne v na me ref ers l o l he s ame conl enl s .
TYI I n e v n a m e
Nol i c e l hal l he aI l ernal e f or m of l he c omma nd does n' l requi re l hal you us e
l he I ROM and TO. Mos l of l he Ami ga DOS c omma nds have an aI l ernal e f or m,
abbr evi al ed f r om l hal s hovn i n l hi s ref ace secl i on. The I onger f or m has be e n
us ed ri mari I y lo i nl r oduce you lo vhal l he c omma nd does . e sure lo
exami ne l he s ummar y ages l o fami I i ari ze yourseI f vi l h l he aI l ernal e c om-
ma nd f or ms l hal are avai I abI e.
*#0#9'.( R'0#5
To l ry l hi s c omma nd, your Wor kbe nc h or CLI di skel l e shouI d be i n dri ve 0.
Yo u ma y be vor ki ng on severaI ver si ons of a r ogr am or l exl fi I e, and
evenl uaI I y vi s h l o deI el e ver si ons of l hal fiIe l hal you don' l ne e d anymor e .
The DILITI c omma nd I els you erase fiIes and reI eases l he di sk sace lo
Ami g a DOS f or r eus e.
Nnt c: If you DILITI fi I es, il is nol ossi bI e lo rel ri eve l hem. e cerl ai n l hal
you reaI I y do vi s h l o deI el e l hem.
He r e is a s amI e c omma nd s equenc e, l hal creal es a fiIe us i ng l he redi recl i on
c o mma nd, l yes il lo veri f y l hal il is reaI I y l her e, l hen deI el es il.
DI R > di r e c l or ys l uf f
TYI I di r e c l or ys l uf f
DILITI di r e c l or ys l uf f
TYI I di r e c l or ys l uf f
To l he fi naI c omma nd i n l he above s equence, Ami ga DOS r es onds :
Cant Opcn dircctnry-stuII
i ndi cal i ng l hal l he fiIe can' l be f ound, becaus e you deI el ed il.
INTRODUCING AMIGADO5
33
?:<='.( R'0#5
ef or e you enl er l hi s c omma nd, your Wor kbe nc h or CLI di skel l e s houI d be i n
dri ve 0.
On a duaI - dri ve s ys l em, coyi ng fiIes is easy:
COIY I ROM df O: s our c eal h TO df I : de s l i na l i o na l h
or
COIY df O: s our c eal h df I : de s l I na l i o na l h
On a si ngI e- dri ve s ys l em, coyi ng fiIes is a IillIe mor e comI ex. You mus l
coy cerl ai n s ys l em fiIes f r om your s ys l em di skel l e i nl o l he s ys l em me mor y.
Thi s is aI so caI I ed us i ng l he RAM: devi ce, of l en knovn as a r amdi s k. Coy l he
fi I e(s) l o l he r amdi sk, c hange your di recl ory lo l he r amdi s k, l hen coy f r om l he
r amdi sk onl o l he desl i nal i on di skel l e. Her e is a samI e s equenc e.
e sure your Wor kbe nc h or CLI di skel l e is i n l he i nl ernaI di sk dri ve. I ssue
l he c omma nds :
COIY dfO: c/cd RAM:
COIY of O: c/ coy RAM:
CD RAM:
I nserl l he source dal a di skel l e i nl o l he dri ve. ( Ior lhi s examI e, c oy s ome -
l hi ng f r om l he Wor kbe nc h or CLI di skel l e, vhi c h is aI ready i n l he dri ve) .
Tye:
COIYdf O: c / e xe c ul e r a m: e xe c ul e
or
COIY df O: c/ execul e e x e c ul e
or
COIY df O: c/ execul e r a m:
Re move l he sour ce di skel l e, and i nserl l he desl i nal i on di skel l e i nl o l he
dri ve. Tye:
COIY r am- . exec ul e df O: execul e
or
COIY e x e c ul e df O: execul e (If you di d l he CD RAM: l hi s f or m vor ks . )
Re move l he desl i nal i on di skel l e and i nserl your CLI or Wor kbe nc h di skel l e
agai n. Tye:
34
AMIGADO5 U5ER'5 MANUAL
CD dfO:
and you are bac k vhe r e you sl arl ed. The onI y ol her c omma nd you ma y vanl
l o er f or m i s:
DILITI RAM: c d RAM: c o y RAM: e x e c ul e
vhi c h reI eases l he r amdi sk me mor y l o l he s ys l em for ol her us es .
?2#)9'.( ) S#I *'2#D9:2=
You can creal e a ne v di recl ory ( nevdr aver ) vi l hi n l he cur r enl di recl ory by
us i ng l he MAKIDI R c omma nd:
MAKI DI R n e vd r a ve r
No v if you i ssue l he DI R c omma nd, you vi I I see l hal l her e is an enl r y for:
n e vd r a ve r ( d i r )
Yo u can aI so us e l he RINAMI c omma nd lo move a fiIe f r om one di recl ory
( draver) lo anol her on l he s ame di skel l e:
MAKI DI R n e vd r a ve r
RI NAMI I ROM n e v n a m e TO n e vd r a ve r / n e vn a me
move s l he fiIe f r om l he cur r enl di recl ory i nl o l he nevdr aver you have cr eal ed.
To c hec k l hal il has reaI I y be e n move d, i ssue l he c omma nd:
DI R
The n l ye:
DI R n e vd r a ve r
Ami ga DOS I ooks i n l he nevdr aver , and s hovs you l hal l he fiIe na me d
" n e v n a m e " is l her e.
H5 -= R'0# ,:&#I"#2# :. !"'5 *'5M\
ef or e you enl er l hi s c omma nd, your Wor kbe nc h or CLI di skel l e c oy shouI d
be i n dri ve 0.
Somel i mes you vi s h lo see ever yl hi ng on l he di skel l e, i nsl ead of onI y
INTRODUCING AMIGADO5 35
one di recl ory al a l i me. You can us e l he DI R c omma nd vi l h one of ils
ol i ons:
DI R OIT A
vhi c h Iisls aII di recl ori es and subdi recl ori es on l he di skel l e. Ke e i n mi nd l he
< s a c e > < A C K S I > combi nal i on lo aus e and resl arl l he I i sl i ng.
To gel a cI oser I ook al l he di sk' s conl enl s , you mi ghl redi recl l he oul ul l o a
fiIe:
DI R > mydi s kdi r OIT A
Nol i ce l hal l he redi recl - l he- oul ul c omma nd characl er and f i I ename MUS T
c ome bef or e l he Iisl of ol i ons for l he DI R c omma nd.
No v, if you vi s h, you can TYII l he fiIe mydi skdi r and r ess l he sace bar
lo aus e l he I i sl i ng. Us e l he RITURN key l o r e s ume l he I i sl i ng. Or , you can
us e ID l o vi ev l he fi I e, as f oI I ovs:
ID mydi s kdi r
Us e l he cursor keys l o move u and dovn i n l he fi I e.
Us e l he key combi nal i on IS C l hen T < R I T U R N > l o move l o l he l o of
l he fiIe.
Suc h a combi nal i on can be ref erred l o as " IS C- T" , meani ng IS C f oI I oved
by T.
Us e l he key combi nal i on ISC- < R I T U R N > l o move l o l he bol l om of l he
fiIe.
Us e l he key combi nal i on ISC- M l hen a numbe r < R I T U R N > l o move l o
a seci fi c I i ne numbe r vi l hi n l he fiIe.
Us e l he key combi nal i on ISC- Q < R I T U R N > lo QUI T vi l houl c hangi ng
l he fiIe or
Us e ISC- X < R I T U R N > l o vri l e any c hanges lo your fiIe back i nl o l he
ori gi naI fiIe name .
Chal er 3 of l he %&'()*+, 45#265 -)./)0 has mor e del ai I ed i nf or mal i on on
us i ng ID.
*:'.( ,:&#9"'.( %/9:&)9'D)00= )9 W::9 !'&#
Ther e is a fiIe i n l he " s " subdi recl ory on your Wor kbe nc h or CLI di skel l e caI I ed
Sl ar l u Sequenc e. Thi s is an execul e fi I e. Il conl ai ns a s equenc e of CLI c om-
ma nds l hal Ami ga DOS er f or ms vhe ne ve r you r ebool l he s ys l em. The I asl
l vo c omma nds i n your Wor kbe nc h di skel l e Sl arl u Sequenc e are Loa dWb
36 AMIGADO5 U5ER'5 MANUAL
(I oad l he Wor kbe nc h r ogr am) and INDCLI vhi c h basi caI I y I eaves l he Wor k-
be nc h r ogr am i n conl roI . You can make u your ovn Sl ar l u Se que nc e fiIe
us i ng I D or IDI T lo cr eal e a c us l om ver s i on of an exec ul e c o mma n d
s e que nc e . The IXICUTI c o mma nd s umma r y and l ul ori aI secl i on i n l he
%&'()*+, 45#265 -)./)0 has delai I s aboul vari ous c omma nds l hal you can
have i n l hi s fi I e. Nol e l hal Sl arl u Sequenc e can aI so be us ed l o aul o- r un a
r ogr am.
WARNI NG: Take care lo modi f y onI y a coy of your di skel l e
never modi f y l he mas l er di skel l e if you deci de lo c hange l he
Sl ar l u Sequenc e .
%55'(.'.( 9"# *'5M#99# :. L"'D" %&'()*+, B::M5 >:2 !"'.(5
ef or e you enl er l hi s c omma nd, your Wor kbe nc h or CLI di skel l e c oy s houI d
be i n dri ve 0.
Occasi onaI I y, you mi ghl vi s h lo c hange lo a di f f erenl di skel l e and l hen
conl i nue your vor k. Ior examI e, you ma y have bool ed l he s ys l em us i ng a
Wor kbe nc h di skel l e, l hen vi s h lo c hange lo a CLI di skel l e. If l he CLI di skel l e
has a di recl ory on il l hal conl ai ns l he execul abI e c omma nds you vanl l o
er f or m, (for examI e, a c(di r)), you can c hange lo l hal di skel l e by usi ng l he
AS S I GN c omma nd.
If you don' l us e AS S I GN, you vi I I have lo s va di skel l es l o gel c omma nds
done . Her e is an examI e l hal does n' l us e AS S I GN. The i nl enl is lo c hange
di skel l es and begi n us i ng " mydi s k: " as l he mai n di skel l e. Any unne e de d fiIes
have aI r eady be e n deI el ed so as lo r ovi de vor ks ac e.
CD mydi s k:
Ami g a DOS r es onds " i ns er l mydi s k i nl o any dr i ve" . I nserl il, l hen l ye:
DI R
Ami ga DOS r oml s " i ns er l Wor kbe nc h |or vhal ever l he bool di skel l e na me
vas j i n any dr i ve" . Il knovs , f r om bool l i me, l hal l he DI R c o mma nd is i n l he
bool di skel l e, c di recl ory. Ami ga DOS r eads l he DI R c o mma nd, l hen asks
" i ns er l mydi s k i n any dr i ve" . Any ol her Ami ga DOS c o mma nd aI so resuI l s i n
l he ne e d f or a di skel l e s va. To avoi d l hi s, us e l he AS S I GN c o mma nd as
f oI I ovs:
ASSI GN" c: mydI s k: c
INTRODUCING AMIGADO5 37
Ami ga DOS asks " i ns er l my di sk i nl o any dr i ve" . Ir om nov on, aII c om-
ma nds lo Ami ga DOS vi I I be s oughl f r om l he c omma nd (c) di recl ory of l hi s
ol her di skel l e and Ami ga DOS von' l ask f or l he ori gi naI di skel l e back f or
si mI e c omma nds .
Onc e you' ve done l hi s, you' I I robabI y vanl lo l ye:
CD mydi s k:
Ther e are ol her l hi ngs l hal Ami ga DOS can assi gn. If you i ssue l he c o mma nd
AS S I GN LI S T
you vi I I see l he ol her l hi ngs as veI I . If you r un a r ogr am l hal requi res a seri aI
devi ce ( mode m, ri nl er) or a araI I eI devi ce ( ri nl er) , Ami ga DOS I ooks i n l he
di recl ory currenl I y assi gned lo DIVS: lo I ocal e l he devi ce. If aII of l he s ys l em
di recl ori es are on lhi s ne v mai n di skel l e, you can avoi d havi ng Ami ga DOS ask
you l o rei nserl l he ori gi naI di skel l e by rovi di ng an execul e fiIe on your
di skel l es l hal reassi gns aII devi ces l o l hal di skel l e. The conl enl s of l hi s execul e
fiIe for a di skel l e na me d " my di s k " are as f oI I ovs:
AS S I GN SYS: mydi s k:
AS S I GN S: mydi s k: s
AS S I GN DIVS: mydi s k: de vs
AS S I GN L: mydi s k: I
AS S I GN IONTS: mydI s k: f onl s
AS S I GN LI S : mydi s k: I i bs
To creal e lhi s execul e fi I e, us e l he c omma nd:
COIY I ROM TO r e a s s i g n
The n l ye l he above AS S I GN I i nes. Af l er you' ve l yed l he I asl I i ne, enl er
l he key combi nal i on CTRLA vhi ch ends l he fiIe. The " " s l ands f or l he
keyboar d and cur r enl CLI vi ndov, so l hi s me l hod of creal i ng a fiIe is one
ossi bI e aI l ernal i ve l o us i ng ID or IDI T.
?2#)9'.( ) S#I ?BH
Ami ga DOS is a muI l i - l aski ng s ys l em. You can have muI l i I e vi ndovs oe n al
l he s ame l i me, each vi l h ils ovn cur r enl di recl ory and execul i ng sear al e
c omma nds . You creal e a ne v CLI by usi ng l he c omma nd NIWCLI :
NIWCLI
38 AMIGADO5 U5ER'5 MANUAL
Thi s oe ns a sear al e vi ndov, vi l h a r oml l hal i denl i f i es l he cur r enl
r oces s . Ior examI e, if l he firsl vi ndov has a r oml :
1 >
l hen l he ne v CLI mi ghl have a r oml :
2 >
You can move l he ne v vi ndov ar ound, make il bi gger, ma ke il smaI I er and
so on. To i ssue c omma nds l o l he ne v CLI , cIick vi l hi n ils vi ndov. No v
anyl hi ng you l ye goes i nl o l he vi ndov vher e you cI i cked l he seI ecl i on
bul l on mos l recenl I y. Tr y l he f oI I ovi ng:
1. CI i ck i n vi ndov 1, l hen l ye:
DI R dfO: c
2. Qui ckI y cIick i n vi ndov 2, and l ye:
I NIO
ol h CLI s vi I I vor k al l he s ame l i me lo fuIfiII your r equesl s. Thi s de mon-
sl ral es l he muI l i - l aski ng caabi I i l i es of l he Ami ga. Nol i ce l hal you ar en' l
I i mi l ed l o onI y l vo CLI s , you can, if l here is me mor y avai I abI e, oe n as ma ny
as 20 CLI s .
?0:5'.( ) ?BH
You f i ni sh vi l h a CLI and cI ose ils vi ndov vi l h l he c omma nd INDCLI . CI i ck
l he seI ecl i on bul l on of l he mous e i n l he vi ndov for l he CLI you vi s h l o cI ose,
and l ye:
INDGLI
Thal ' s aII l her e is lo il.
?0:5'.( ?:&&#.95
The above seri es of c omma nd descri l i ons i nl roduces you lo l he ki nds of
l hi ngs you can do vi l h Ami ga DOS c omma nds f r om l he CLI . Ther e are severaI
c omma nds l hal haven' l be e n cover ed i n l he above sessi on al aII. In addi l i on,
INTRODUCING AMIGADO5 39
mos l of l he c omma nds descri bed above have ol her " l e mI a l e s " ( vays you can
enl er l he c ommands ) and ol i ons l hal haven' l be e n demons l r al ed.
Chal er 2 of l he %&'()*+, 45#265 -)./)0 conl ai ns a r ef er ence secl i on l hal
s hovs l he l emI al es for each of l he c omma nds i n Ami ga DOS. You can I ook al
l he descri l i on for each c omma nd lo f i nd mor e i nf or mal i on. Onc e you are
f ami I i ar vi l h l he c omma nds , and l he f or ms i n vhi c h you can us e l he m, l he
qui ck r ef er ence I i sli ng al l he e nd of l he chal er viII be usef uI l o r emi nd you of
l he c omma nds l hal are avai I abI e.
O3U ?:.C#.9':.5 45#8
In Chal er 2 of l hi s manuaI , i n l he " Io r ma l " descri l i on for l he Ami ga DOS
c omma nds , you vi I I f i nd l he f oI I ovi ng nol al i ons us ed:
< n a m e > I ndi cal es a ar amel er na me l hal you shouI d fiII i n for lhi s c om-
ma nd. IxamI e: IXICUTI < c o mma n d f i I e > vhe r e l he na me
of l he c omma nd fiIe is a requi red ar amel er .
| j Squar e brackel s are us ed lo i ndi cal e l hal an i l em is ol i onaI . Il
needn' l be r ovi ded f or l he c omma nd lo f uncl i on bul , if r o-
vi ded, c onveys addi l i onaI i nf ormal i on l o Ami ga DOS aboul ho v
lo er f or m l he c omma nd. IxamI e: QUI T | < c o d e > j
I A verli caI bar leIIs you l hal you can seI ecl one or anol her of l he
aI l ernal i ves l hal are sear al ed by l he verl i caI bar f or a c omma nd.
IxamI e: DI R | OIT A 111 AI j The examI e i ndi cal es l hal you can
choos e A, I or AI for l he seci f i cal i on.
< n a m e > I ndi cal es one- or - mor e occur r ences of a ar amel er na me , if you
suI y mor e l han one such ar amel er , i ndi vi duaI ar amel er s
mus l be searal ed by al I easl one bI ank sace.
Ior Ami ga DOS CLI c omma nds , unI es s s ome f or m of uncl ual i on, such as a
c omma or a I us- si gn is acl uaI I y i ncI uded i n l he c omma nd Ior mal I i ne, you
mus l aI vays searal e l he ar amel er s vi l h bI ank saces. Don' l conf us e l he
Ior mal i nf or mal i on vi l h l he " Te mI a l e " f or l he c omma nd. The c omma nd
l emI al e is exI ai ned i n secl i on 1. 4. 5 of l he %&'()*+, 45#265 -)./)03
?")<9#2 P
AmigaDOS Commands
Thi s chal er is di vi ded i nl o l vo arl s: l he firsl arl descri bes l he user c om-
ma nds avai I abI e on l he Ami ga, l he s econd descri bes l he deveI oer c omma nds .
The user c omma nds faII i nl o severaI cal egori es: fiIe uli I i li es, CLI conl roI ,
c omma nd s equenc e conl roI , and s ys l em and sl orage manage me nl . Iarl I r o-
vi des aI habel i zed c omma nd descri l i ons l hal gi ve l he f ormal , l emI al e, ur -
os e, and seci f i cal i on of each c omma nd as veI I as an examI e of ils us e. Iarl
2 has l he s ame organi zal i on.
The chal er slarls vi l h a Iisl of unfamiIiar lermi noI ogy. Al l he end of l he chal er
l her e is a qui ck Conl enl s ref erence card l hal Iisls aII l he c omma nds by f uncl i on.
2. 1 Ami ga DOS Us er ' s Co mma nds
2. 2 Ami ga DOS DeveI oer ' s Co mma nds
2. 3 Ami ga DOS Comma nds Qui ck Ref er ence Car d
P3O %&'()*+, 45#265 ?:&&).85
4.>)&'0')2 !#2&'.:0:(=
In l hi s manuaI you couI d f i nd s ome l er ms l hal you have nol s een bef or e. The
Iisl beI ov i ncI udes s ome c o mmo n l er ms l hal are conf usi ng if you are unf ami I -
i ar vi l h l he m.
Bnnt sl arl u. Il c omes f r om l he exr essi on " uI I i ng your seI f u by
your bool s l r as . "
DcI au! t iniliaI sel l i ng or, in ol her vor ds , vhal ha e ns if you do
nol hi ng. So l hal , i n lhi s manuaI , " de f a uI l " is us ed l o me a n
" i n abs ence of s omel hi ng eI s e" .
Dcvi cc namc arl of a name l hal r ecedes l he coI on (:), f or examI e, CON: ,
DIO: , IRT: , and so f orl h.
AMIGADO5 COMMAND5 41
Fi ! c hand! c an i nl ernaI Ami ga DOS vaI ue l hal r er es enl s an oen fiIe or
devi ce.
Lngi ca! dcvi cc a na me you can gi ve l o a di recl ory vi l h AS S I GN l hal you can
l hen us e as a devi ce na me .
Ob| cct cndc bi nar y oul ul f r om an assembI er or comi I er , and bi nar y
i nul l o a I i nker.
Rcbnnt resl arl .
5t r cam an oen fiIe or devi ce l hal is associ al ed vi l h a fiIe handI e. Ior
examI e, l he i nul s l r eam couI d be f r om a fiIe and l he oul ul
s l r eam couI d be lo l he consoI e devi ce.
5yst cm di sk a di sk conl ai ni ng l he Wor kbe nc h and c omma nds .
Vn! umc namc a na me you gi ve lo a hysi caI di sk.
Nnt c: Co mma nd f or mal is exI ai ned i n secl i on 1.7, c o mma nd l emI al e is
exI ai ned i n secl i on 1. 4. 5.
R:2&)9N | < c o m m a n d > j , | < c o m m e n l > j
!#&<0)9#N " c o mma n d " , " c o mme n l "
;/2<:5#N To add c omme nl s lo c omma nd I i nes.
,<#D'>'D)9':.N
The CLI i gnor es ever yl hi ng af l er l he semi coI on (,).
JX)&<0#5N
, Thi s I i ne i s onI y a c o m m e n l
i gnor es l he arl of l he I i ne conl ai ni ng " Thi s I i ne is onI y a c o mme n l . "
c oy < f i I e > l o r l : , r i n l l he f i I e
coi es l he fiIe l o l he ri nl er, bul i gnor es l he c omme nl " r i nl l he f i I e . "
,## )05:N IXICUTI
!"
R:2&)9N < c omma nd> | > oul ul f i I e na me j | i nul f i I e na me j | < c omma nda r gs j
!#&<0)9#N " c o m m a n d " > " T O " < " I R O M " " a r g s "
;/2<:5#N To di recl c omma nd i nul and oul ul .
42 AMIGADO5 U5ER'5 MANUAL
,<#D'>'D)9':.N
You us e l he s ymboI s > and < l o di recl l he oul ul and i nul of a c omma nd.
The di recl i on of l he oi nl of l he angI e brackel i ndi cal es l he di recl i on of
i nf or mal i on f I ov. You can us e l hese symboI s l o c hange vhe r e any c o mma nd
r eads i nul or vri l es oul ul . The oul ul f r om a c omma nd usuaI I y goes l o l he
cur r enl vi ndov. Hove ve r , if you l ye a > symboI afler a c omma nd and bef or e
a f i I ename, l he c omma nd vri l es l he oul ul lo l hal fiIe i nsl ead. Si mi I arI y, if you
l ye l he < s ymboI bef or e a f i I ename, l he c omma nd reads f r om l hal fiIe i nsl ead
of f r om l he keyboar d.
You do nol have lo seci f y bol h l he TO and I ROM di recl i ons and fi I es. The
exi sl ence and numbe r of " a r g s " de e nds on l he c omma nd you us ed. Redi rec-
l i on onI y ha e ns f or l he c omma nd you seci f i ed. Ami ga DOS reverl s lo l he
iniliaI or " de f a uI l " i nul and oul ul (l hal i s, l he keyboar d and currenl vi ndov)
af l er var d. Nol i ce l hal redi recl i on mus l <2#D#8# l he ar gumenl s .
JX)&<0#5N
DATI > d I a r y _ d a l e s
vri l es l he oul ul of l he DATI c omma nd (l hal i s, l oday' s dal e and l i me) l o l he
fiIe " di ar y da l e s " .
m y r o g r a m < m y i nul
l eI I s my r ogr a m l o accel i nul f r om my i nul i ns l ead of f r om l he
keyboar d.
LI S T > l e m
SORT l e m TO
r oduc es a sorl ed Iisl of fiIes and di sI ays l he m on l he scr een.
The f oI I ovi ng s equenc e:
ICHO > 2nd. dal e 0 2 - | a n - 7 8
DATI < 2nd. dal e `
DILITI 2nd. dal e
creal es a fiIe caI I ed 2nd. dal e l hal conl ai ns l he lexl " 0 2 - | a n- 7 8 < I i ne f e e d> " . Nexl
il us es l hi s fiIe as i nul lo l he c omma nd DATI. Nol e l hal l he " ` " is neces s ar y
f or DATI l o accel i nul f r om l he sl andar d i nul , ral her l han l he c o mma nd
I i ne. Ii naI I y, as you no I onger ne e d l he fi I e, l he DILITI c omma nd deI el es
2 nd. dal e.
AMIGADO5 COMMAND5
43
A55IGN
R:2&)9N AS S I GN | | < n a me > j < d i r > j | L I S T j
!#&<0)9#N AS S I GN " NAMI, DI R, LI S 1 7 S "
;/2<:5#N To assi gn a I ogi caI devi ce na me lo a fi I i ng s ys l em di recl ory.
,<#D'>'D)9':.N
NAMI i s l he I ogi caI devi ce na me gi ven lo l he di recl ory seci f i ed by DI R.
If you | us l gi ve l he NAMI , Ami g a DOS deI el es l he I ogi caI devi ce na me gi ven
(l hal i s, il r emoves l he as s i gnmenl ) .
AS S I GN vi l houl any ar amel er s or l he svi l ch LI ST di I ays a I i sl i ng of aII
cur r enl as s i gnmenl s .
Whe n you us e AS S I GN, you mus l ens ur e l hal l here is a di sk i nser l ed i n l he
dri ve. Thi s is i mor l anl becaus e AS S I GN makes an as s i gnmenl l o a di sk voI ume
and nol l o a dri ve.
Nol e l hal l he effecl of AS S I GN i s I osl vhe n you resl arl or " r e b o o l " your
c omul er .
JX)&<0#5N
AS S I GN s our c e s : : ne v/ vor k
Sel s u l he I ogi caI devi ce na me " s o ur c e s " lo l he di recl ory " : ne v/ vo r k" . The n
l o gai n access l o fiIes i n " : ne v/ vor k" , you can us e l he I ogi caI devi ce na me
" s o ur c e s " , as i n
TYI I s our c e s : x y z
vhi c h di sI ays l he fiIe " : ne v/ vor k/ xyz" .
AS S I GN LI S T
Iisls l he currenl I ogi caI devi ce name s i n us e.
BREAK
R:2&)9N RIAK <l as k>| ALLj | Cj | Dj | Ij | Ij
!#&<0)9#N RIAK " TASK/ A, ALL/ S, C/ S, D/ S, I/ S, I/ S "
;/2<:5#N To sel al l enl i on fI ags i n l he gi ven r ocess.
,<#D'>'D)9':.N
RIAK sel s l he seci f i ed al l enl i on fI ags i n l he r oces s. C sel s l he CTRL- C fIag,
D sel s l he CTRL- D fI ag, and so on. ALL sels aII l he fI ags f r om CTRL- C l hr ough
44
AMIGADO5 U5ER'5 MANUAL
CTRL- I. y def auI l , Ami ga DOS onI y sel s l he CTRL- C fI ag. The acl i on of
RIAK is i denl i caI lo seI ecl i ng l he reI evanl r ocess by movi ng l he mous e l o
l he vi ndov, cI i cki ng l he SeI ecl i on ul l on, and r essi ng l he requi red conl roI
key combi nal i on.
JX)&<0#5N
R I A K 7
sel s l he CTRL- C al l enl i on fI ag of r oces s 7. Thi s i s i denl i caI l o seI ecl i ng r oc es s
7 and r es s i ng CTRL- C.
R I A K 5 D
sel s l he CTRL- D al l enl i on fIag of r ocess 5.
R I A K 3 D I
sel s bol h CTRL- D and CTRL- I.
CD
R:2&)9N C D | < d i r > j
!#&<0)9#N CD " D I R "
;/2<:5#N To sel or c hange a cur r enl di recl ory or dri ve.
,<#D'>'D)9':.N
CD vi l h no ar amel er s di sI ays l he na me of l he cur r enl di recl ory. In l he
f or mal Iisl above, < d i r > i ndi cal es a ne v currenl di recl ory (lhal i s, one i n
vhi c h unquaI i f i ed f i I enames are I ooked u) . If l he di recl ory you seci f y is nol
on l he cur r enl dri ve, l hen CD aI so c hanges l he currenl dri ve.
To c hange l he cur r enl di recl ory l o l he di recl ory l hal ovns l he cur r enl one (if
one exi sl s) , l ye CD f oI I oved by a si ngI e sI ash (/). Thus CD / move s l he
cur r enl di recl ory one I eveI u i n l he hi er ar chy unI es s l he cur r enl di recl ory i s a
rool di recl ory (lhal i s, l he l o I eveI i n l he fiIing s ys l em) . MuI l i I e sI ashes are
aI I oved, each sI ash ref ers lo an addi l i onaI I eveI above.
JX)&<0#5N
CD d f I : vo r k
sel s l he cur r enl di recl ory lo " vo r k " on di sk " d f I " , and sel s l he cur r enl dri ve
l o " d f I " .
AMIGADO5 COMMAND5
45
CD SYS: COM/ ASI C
CD /
sel s l he cur r enl di recl ory lo " S YS : COM" .
COPY
R:2&)9N COI Y | | I ROMj < n a me > j | T O< n a me > j | AL L j | QUI I Tj
!#&<0)9#N COIY " IROM, TO/ A, ALL/ S , QUI IT/ S "
;/2<:5#N To c oy a fiIe or di recl ory f r om one I ace l o anol her .
,<#D'>'D)9':.N
COIY I aces a c oy of l he fiIe or di recl ory i n l he fiIe or di recl ory seci f i ed as
TO. The r evi ous conl enl s of TO, if any, are I osl .
If you seci f y a di recl ory na me as I ROM, COI Y coi es aII l he fi I es i n l he
I ROM di recl ory lo l he TO di recl ory. If you do nol seci f y l he I ROM di recl ory,
Ami ga DOS uses l he currenl di reclory. The TO di reclory mus l exi sl for COIY lo
vor k, il is nol creal ed by COIY.
If you seci f y ALL, COI Y aI so coi es l he fiIes i n a ny subdi recl ori es. I n l hi s
case, il aul omal i caI I y creal es subdi recl ori es i n l he TO di recl ory, as r equi r ed.
The na me of l he currenl fiIe bei ng coi ed is di sI ayed on l he scr een as il
ha e ns unI ess you gi ve l he QUI IT svi l ch.
You can aI so seci f y l he sour ce di recl ory as a al l ern. I n lhi s cas e, Ami ga DOS
coi es any fiIes l hal mal c h l he al l ern. See l he c omma nd LI ST f or a fuII
descri l i on of al l er ns . You may seci f y di recl ory I eveI s as veI I as al l er ns.
JX)&<0#5N
COIY f Ue I TO : vor k/ f i I e2
coi es ' f i I eI ' i n l he cur r enl di recl ory l o " f i I e 2 " i n l he di recl ory " : vo r k " .
COIY TO df I : b a c k u
coi es aII l he fi I es i n l he cur r enl di recl ory l o " df Lb a c k u " . Il doe s nol coy any
subdi recl ori es, and df I : bac ku mus l aI ready exi sl .
COIY dfO: l o df I : ALL QUI IT
make s a I ogi caI coy of di sk" df O" on di s k " df I " vi l houl any ref I ecl i on of
f i I enames.
COIY l e s l - - ` l o df I : x y z
%
46
AMIGADO5 U5ER'5 MANUAL
coi es aII fiIes i n l he cur r enl di recl ory l hal slarl " l e s l - " lo l he di recl ory xyz on
l he di sk " d f I " , as s umi ng l hal " x y z " aI ready exi sl s. (Ior an exI anal i on of al -
l er ns, such as " - ` " , see l he c omma nd LI ST i n lhi s chal er . )
COIY l e s l _ f i I e l o IRT:
coi es l he fiIe " l e s l f i I e" l o your ri nl er.
COIY TO CON: 1 0 / 1 0 / 2 0 0 / 1 0 0 /
CI i ck l he vi ndov l hal you l yed l he coy c omma nd i nl o. Thi s " r eac l i val es " il
so l hal consoI e i nul is l aken f r om l her e. Iver y l i me you l ye a I i ne il vi I I be
di sI ayed i n l he ne v vi ndov. Iress CTRLA vhe n you are done and l he ne v
vi ndov viII cI ose.
COIY D I 0 : ` / - ` TO DI 1 : ALL
coi es ever y fiIe i n any one characl er subdi recl ory of DIO: l o l he r ool di recl ory
of DI1 : .
,## )05:N } OI N
DATE
R:2&)9N DATI | < d a l e > j | < l i me > j | T O+ VI R< n a me > j
!#&<0)9#N DATI " DATI, TI MI, TO VIR/ K"
;/2<:5#N To di sI ay or sel l he s ys l em dal e or l i me.
,<#D'>'D)9':.N
DATI vi l h no ar amel er di sI ays l he currenl I y sel s ys l em dal e and l i me. Thi s
i ncI udes l he day of l he veek. Ti me is di sI ayed usi ng a 24- hour cI ock.
DATI < d a l e > sel s l he dal e. The f or m of < d a l e > is DD- MMM- YY. If l he
dal e is aI ready sel , you can resel il by seci f yi ng a day na me (lhi s sel s l he dal e
f or var d lo l hal day) or by seci f yi ng ' l omor r ov' or ' yesl er day' .
DAT I < l i m e > sel s l he l i me. The f or m of < l i m e > i s HH: MM (for Hour s
and Mi nul es ) . You s houI d us e I eadi ng zer os vhe n neces s ar y. Nol e l hal ,
if you us e a coI on (:), Ami ga DOS r ecogni zes l hal you have seci f i ed l he l i me
r al her l han l he dal e. Thal i s l o s ay, you c an sel bol h l he dal e and l he l i me, or
ei l her dal e or l i me i n any order bec aus e DATI onI y ref ers lo l he l i me vh e n
you us e l he f or m HH: MM.
If you do nol sel l he dal e, l he resl arl di sk vaI i dal i on r ocess sel s l he s ys l e m
dal e lo l he dal e of l he mos l recenl I y creal ed fiIe. See Chal er 1 for delai I s on l he
resl arl vaI i dal i on r oces s.
AMIGADO5 COMMAND5
47
To seci f y l he desl i nal i on of l he veri f i cal i on, you us e l he equi vaI enl key-
vor ds TO and VIR. The desl i nal i on is l he lermi naI unI ess you seci fy ol hervi se.
Nnt c: If you l ye DATI bef or e l he resl arl vaI i dal i on has c omI el ed, l he l i me
is di sI ayed as uns el . To sel l he l i me, you can ei l her us e DATI or | us l vai l
unl i I l he vaI i dal i on r ocess is f i ni shed.
JX)&<0#5N
DATI
di sI ays l he cur r enl dal e.
DATI 0 6 - S e - 8 2
sel s l he dal e lo l he 6l h of Sel ember 1982. The l i me is nol resel .
DATI l o mo r r o v
r esel s l he dal e l o one day ahead.
DATI TO f r e d
s ends l he cur r enl dal e lo l he fiIe " f r e d" .
DATI 1 0 : 5 0
sel s l he cur r enl l i me lo l en ' liI eI even.
DATI 2 3 : 0 0
sel s l he cur r enl l i me lo 11: 00 P.M.
DATI 0 1 - } A N - 0 2
sel s l he dal e lo } anuar y 1sl, 2002. ( The earI i esl dal e you can sel is 01- } AN- 78. )
DELETE
R:2&)9N DILITI < n a me > | < n a me > j | ALLj | Q+ QUI IT j
!#&<0)9#N DILITI " , , , , , A L L / S , Q QUI IT/ S "
;/2<:5#N To deI el e u lo l en fiIes or di recl ori es.
,<#D'>'D)9':.N
DILITI al l eml s lo deI el e each fiIe you seci f y. If il c annol deI el e a f i I e,
l he scr een di sI ays a mes s age, and Ami ga DOS al l eml s l o deI el e l he nexl
fiIe i n l he Iisl. You may nol deI el e a di recl ory if il conl ai ns any fi I es.
48
AMIGADO5 U5ER'5 MANUAL
You c an aI so us e a al l ern lo seci f y l he f i I ename. See l he descri l i on of l he
c o mma nd LI ST for fuII delai I s of al l er ns. The al l ern may seci f y di recl ory
I eveI s as veI I as f i I enames. In lhi s case, aII fiIes l hal mal c h l he al l ern are
deI el ed.
If you seci f y ALL vi l h a di recl ory na me , DILITI vi I I deI el e l hal di recl ory
and aII subdi recl ori es and fiIes vi l hi n l hal di recl ory and ils subdi recl ori es.
UnI es s you seci f y l he svi l ch QUI IT (or us e l he aI l ernal i ve, Q) , l he na me of
l he fiIe bei ng deI el ed aear s on l he scr een as il hae ns .
JX)&<0#5N
DILITI oI d- f i I e
deI el es l he fiIe " oI d- f i I e" .
DILITI vo r k / r o g 1 vo r k / r o g 2 vo r k
deI el es l he fiIes " r o g I " and " r o g2 " i n l he di recl ory " vo r k" , and l hen deI el es
l he di recl ory " vo r k " .
DILITI l - ` / - ` ( H 2 )
deI el es aII l he fiIes l hal end i n " 1 " or ]P] i n di recl ori es l hal slarl vi l h " l " . ( Ior
an exI anal i on of al l er ns, s uc h as " - ` " , see l he c omma nd LI ST I al er i n l hi s
chal er . )
DILITI D I 1 : - ` ALL
deI el es aII l he fiIes on DI1: .
,## )05:N DI R ( 1- DIL ol i on)
DIR
R:2&)9N DI R| < n a me > j | OI T A+I+AIj
!#&<0)9#N DI R " DI R, OIT/ K"
;/2<:5#N To r ovi de a di sI ay of l he fiIes i n a di recl ory i n sorl ed order. DI R
can aI so i ncI ude l he fiIes i n subdi recl ori es, and you can us e DI R i n
i nl eracl i ve mode .
,<#D'>'D)9':.N
DI R aI one s hovs l he fiIes i n l he currenl di recl ory. DI R f oI I oved by a di recl ory
r ovi des l he fiIes i n l hal di recl ory. The f or m of l he di sI ay is firsl any
AMIGADO5 COMMAND5
49
subdi recl ori es, f oI I oved by a sorl ed Iisl of l he fiIes i n l vo c oI umns . If you vanl
lo knov if a fiIe exi sl s l ye LI ST f i I ename.
Tyi ng DI R f i I ename, vher e f i I ename is a fiIe vhi c h exi sl s resuI l s i n l he
Ami ga r es ondi ng vi l h: " f i I ename is nol a di r ecl or y. "
To as s ol i ons l o DI R, use l he OIT keyvor d. Us e l he A ol i on l o i ncI ude
any subdi recl ori es beI ov l he seci f i ed one i n l he Iisl. Iach subI i sl of fiIes is
i ndenl ed.
To Iisl onI y l he di recl ory name s us e l he D ol i on.
The I ol i on seci f i es l hal DI R is lo r un i n i nl eracl i ve mode . In l hi s case, l he
fiIes and di recl ori es are di sI ayed vi l h a quesl i on mar k f oI I ovi ng each na me .
Ir ess RITURN lo di sI ay l he nexl na me i n l he Iisl. To qui l l he r ogr am, l ye
Q. To go back lo l he r evi ous di recl ory I eveI or l o sl o (if al l he I eveI of l he
iniliaI di recl ory) , l ye .
If l he na me di sI ayed is l hal of a di recl ory, l ye I lo enl er l hal di recl ory and
di sI ay l he fiIes and subdi recl ori es. Us e I and lo seI ecl di f f erenl I eveI s.
Tyi ng l he c omma nd DIL (lhal i s, l yi ng l he l hr ee I el l ers D I L , nol r es s i ng
l he DIL key) can be us ed lo deI el e a di recl ory, bul l hi s onI y vor ks if l he
di recl ory is eml y.
If l he na me is l hal of a fi I e, l yi ng DIL deI el es l he fi I e, or l yi ng T Tyes
(l hal i s, di sI ays) l he fiIe on l he screen. In l he I asl case, r ess CTRL- C lo sl o
il " l yi ng" and rel ur n l o i nl eracl i ve mode .
To f i nd l he ossi bI e r es ons es lo an i nl eracl i ve r equesl , l ye` .
JX)&<0#5N
DI R
r ovi des a Iisl of fiIes i n cur r enl di recl ory.
DI R dfO: OIT a
Iisls l he enl i re di recl ory sl rucl ure of l he di sk " df O" .
DI5KCOPY
R:2&)9N DI S KCOIY | I R O M j < d i s k > T O < d i s k > | N A M I < n a m e > j
!#&<0)9#N DI S KCOIY " IROM/ A, TO/ A/ K, NAMI/ K' '
;/2<:5#N To c oy l he conl enl s of one QAY' i nch f I oy di sk l o anol her .
,<#D'>'D)9':.5N
DI S KCOIY make s a coy of l he enl i re conl enl s of l he di sk you seci f i ed as
I ROM, overvri l i ng l he r evi ous conl enl s of l he enl i re di sk you seci f i ed as
50
AMIGADO5 U5ER'5 MANUAL
TO. DI S KCOIY aI so f ormal s a ne v di sk as il coi es. You nor maI I y us e l he
c omma nd lo r oduce bac ku f I oy di sks.
Onc e you have gi ven l he c omma nd, Ami ga DOS r oml s you lo i nserl l he
correcl di sks. Al l hi s oi nl , you i nserl l he correcl source and desl i nal i on di sks.
You can us e l he c omma nd lo coy any "&'$ i nch Ami ga DOS di sk lo anol her ,
bul l he source and desl i nal i on di sks mus l be i denl i caI i n si ze and sl rucl ure. To
c oy i nf or mal i on bel veen di f f erenl si zed di sks, you us e COIY.
You can aI so us e l he c omma nd lo coy a f I oy di sk us i ng a si ngI e f I oy
dri ve. If you seci f y l he source and desl i nal i on as l he s ame devi ce, l hen l he
r ogr am reads in as muc h of l he source di sk i nl o me mor y as ossi bI e. Il l hen
r oml s you lo I ace l he desl i nal i on di sk i n l he dri ve and l hen coi es l he
i nf or mal i on f r om me mor y onl o l he desl i nal i on di sk. Thi s s equence is r eeal ed
as ma ny l i mes as requi red.
If you do nol seci f y a ne v na me for your di sk, DI S KCOIY creal es a ne v
di sk vi l h l he s ame na me as l he oI d one. Hovever , Ami ga DOS can leII l he
di f f erence be l ve e n l vo di sks vi l h l he same na me becaus e ever y di sk is
associ al ed vi l h l he dal e and l i me of ils creal i on. DI S KCOIY gi ves l he ne v
di sk l he currenl s ys l em dal e as ils creal i on dal e and l i me.
Nnt c: To coy arl of a di sk, you can us e COIY l o RAM: .
JX)&<0#5N
DI S KCOIY I ROM dfO: TO df I :
ma ke s a bac ku coy of l he di sk " df O" onl o di sk " d f I " .
DI S KCOIY IROM dfO: To dfO:
make s a bac ku coy of l he di sk i n dri ve " df O" usi ng onI y a si ngI e dri ve.
,## )05:N COI Y
ECHO
R:2&)9N I CHO < s l r i n g >
!#&<0)9#N I CHO " "
;/2<:5#N To di sI ay l he ar gumenl gi ven.
,<#D'>'D)9':.N
I CHO vri l es l he si ngI e ar gumenl lo l he currenl oul ul s l r eam ( vhi ch can be a
fiIe or a devi ce) . Thi s is normaI I y onI y usef uI vi l hi n a c omma nd s equenc e or as
arl of a RUN c omma nd. If you gi ve l he ar gumenl i ncorrecl I y, an error is
di sI ayed.
AMIGADO5 COMMAND5
51
JX)&<0#5N
RUN" COIY : vor k/ r og l o df I : vo r k ALL QUI IT +
ICHO " Coy f i ni s he d"
creal es a ne v CLI lo coy l he seci f i ed di recl ory as a bac kgr ound r oces s .
Wh e n il has f i ni shed, l he scr een di sI ays
Cnpy Iinishcd
If l he f oI I ovi ng Ixecul e fiIe exi sl s
ICHO " S l a r l i n g ' MYCOIY' Ix e c ul e f i I e"
COIY DI1 : AC TO RAM: AC
COIY D I L X Y Z TO RAM: XYZ
ICHO " Re mo v e l h e di s ke l l e i n DI 1 : "
ICHO " I n s e r l l h e n e v di s ke l l e i n D I 1 : "
WAI T 1 0 SICS
COIY RAM: AC TO DI1: AC
COIY RAM: XYZ TO DI1: AC
ICHO " Do n e "
l hen
IXICUTI MYCOIY
coi es 2 fiIes lo RAM di sk and back.
ED
R:2&)9N I D | I R O M j < n a m e > | S I Z I < n > j
!#&<0)9#N ID " I ROM/ A, S I ZI"
;/2<:5#N To edi l l exl fi I es.
,<#D'>'D)9':.N
ID is a scr een edi l or. You can us e ID as an aI l ernal i ve lo l he I i ne edi l or IDI T.
The fiIe you seci fy as I ROM is read i nlo memor y, l hen ID accel s your edi li ng
i nsl r ucl i ons. If I ROM f i I ename does nol exi sl, Ami ga DOS creal es a ne v fi I e.
ec aus e l he fiIe is r ead i nl o me mor y, l her e is a I i mi l l o l he si ze of fiIe you c an
edi l vi l h ID. UnI es s you seci f y ol her vi se, vor ks ac e si ze is 40, 000 byl es .
Thi s vor ks ac e si ze is usuaI I y suffi ci enl for mos l fi I es. Hove ve r , lo aI ler l he
vor ks ac e, you seci f y a sui l abI e vaI ue afler l he SI ZI keyvor d.
Ther e is a fuII seci f i cal i on of ID i n Chal er 3.
52 AMIGADO5 U5ER'5 MANUAL
JX)&<0#5N
I D vo r k / r o g
edi l s l he fiIe " vor k/ r og" , as s umi ng il exi sl s, ol her vi se, ID creal es l he fi I e.
ID huge- f i I e S I ZI 5 0 0 0 0
edi l s a ver y I arge fiIe " huge - f i I e " , us i ng a vor ks ac e of 50, 000 byl es .
EDIT
R:2&)9N IDI T | I ROMj < n a me > | | T Oj < n a me > j | WI T H< n a me > j | VI R< n a me > j
| OI T < o l i o n > j
!#&<0)9#N IDI T " IROM/ A, TO, WI TH/ K, VIR/ K, OIT/ K"
;/2<:5#N To edi l l exl fiIes.
,<#D'>'D)9':.N
IDI T is a I i ne edi l or (l hal i s, il edi l s a sequenl i aI fiIe I i ne by I i ne) . If you seci f y
TO, IDI T coi es f r om fiIe I ROM lo fiIe TO. Onc e you have comI el ed l he
edi l i ng, l he fiIe TO conl ai ns l he edi l ed resuI l , and l he fiIe I ROM i s unc hange d.
If you do nol seci f y TO, l he n IDI T vri l es l he edi l ed l exl l o a l emor ar y fi I e.
If you gi ve l he IDI T c omma nds Q or W, l hen IDI T r enames lhi s l emor ar y fiIe
I ROM, havi ng firsl saved l he oI d ver si on of I ROM i n l he fiIe " : l / edi l - bac ku" .
If you gi ve l he IDI T c omma nd S TOI, l hen IDI T makes no c hange lo l he fiIe
I ROM.
IDI T r eads c omma nds f r om l he currenl i nul sl r eam, or f r om a WI TH fiIe if
il i s seci f i ed.
IDI T s ends edi l or mes s ages and veri fi cal i on oul ul lo l he fiIe you seci f y
vi l h VIR. If you omi l VIR, l he l ermi naI is us ed i nsl ead.
OIT seci f i es ol i ons: In sel s l he ma x i mum numbe r of r evi ous I i nes lo n,
Wn sel s l he ma x i mum I i ne vi dl h. The iniliaI sel l i ng is I4 OW1 2 0 .
Nnt c: You cannol us e l he < and > symboI s lo redi recl i nul and oul ul
vh e n you caII IDI T.
See Chal er 4 for a fuII seci f i cal i on of IDI T.
JX)&<0#5N
IDI T vo r k / r o g
edi l s l he fiIe " vor k/ r og" . Whe n edi l i ng is comI el e, IDI T saves l he oI d
ver si on of " vor k/ r og" in " : l / edi l - backu" .
AMIGADO5 COMMAND5
53
EDIT wnrk/prng TO wnrk/ncwprng
edi l s l he fiIe " vor k/ r og" , I aci ng l he edi l ed resuI l i n l he fiIe " vor k/ ne vr og" .
EDIT wnrk/prng WITH cdits/O VER ni!:
edi l s l he fiIe " vor k/ r og" vi l h l he edi l c omma nds sl ored i n l he fiIe " e di l s / 0" .
Veri f i cal i on oul ul f r om IDI T is senl lo l he dummy devi ce " ni I : " .
ENDCLI
R:2&)9N INDCLI
!#&<0)9#N INDCLI
;/2<:5#N To end an i nl eracl i ve CLI r oces s .
,<#D'>'D)9':.N
Ami ga DOS onI y aI I ovs INDCLI as an i nl eracl i ve c omma nd. INDCLI r emove s
l he CLI currenl I y seI ecl ed by l he mous e .
You s houI dn' l us e INDCLI excel on a CLI creal ed by l he NIWCLI c om-
ma nd. If l he iniliaI CLI ( rocess 1) is ended, and no ol her has be e n sel u by
l he NIWCLI c omma nd, l hen l he ef f ecl is lo l er mi nal e l he Ami g a DOS sessi on.
Nol e l hal l her e are no ar gumenl s lo l he INDCLI c omma nd, and no c hec k
f or i nvaI i d ar gume nl s .
Nnt c: Do nol exer i menl vi l h INDCLI bef or e you' ve us e d NIWCLI . Us i ng
INDCLI on l he iniliaI CLI aI vays uI I s l he r ug oul f r om under you by
l er mi nal i ng l hal CLI . If you sl arl ed l he CLI f r om l he Wor kbe nc h, l hen l her e is
no r obI em as you are r el ur ned lo l he Wor kbenc h. If you sl arl ed Ami g a DOS
vi l h | us l l he CLI r unni ng, l he n endi ng l he I asl CLI gi ves you no va y of
creal i ng a n e v one.
JX)&<0#5N
The f oI I ovi ng s equence:
NEWCLI
LI5T
ENDCLI
oens a ne v vi ndov, I i sls l he di recl ory, and cI oses l he vi ndov agai n.
54 AMIGADO5 U5ER'5 MANUAL
EXECUTE
R:2&)9N IXICUTI < c o mma n d f i I e > | < a r g > j
!#&<0)9#N IXICUTI " c omma nd- f i I e " , " a r gs "
;/2<:5#N To execul e a fiIe of c omma nds vi l h ar gumenl subsl i l ul i on.
,<#D'>'D)9':.N
Yo u nor maI I y us e IXICUTI l o save l yi ng. The c omma nd fiIe conl ai ns c om-
ma nds execul ed by l he Co mma nd Li ne I nl erf ace. Ami ga DOS execul es l hes e
c omma nds one al a l i me, | usl as l hough you had l yed l he m al l he keyboar d.
If l he execul i on creal es a n e v CLI vi ndov, l he resuI l s ma y nol be i denl i caI l o
l yi ng al l he keyboar d.
Yo u c an aI so us e IXICUTI l o er f or m ar amel er ( l hal i s, vaI ue) s ub-
sl i l ul i on, vhe r e you c an gi ve cer l ai n na me s as ar ame l e r s . ef or e l he
c o mma nd fiI e is execul ed, Ami ga DOS checks l he ar amel er na me s vi l h l hos e
you' ve gi ven af l er l he IXICUTI c omma nd. If any mal ch, Ami ga DOS uses
l he vaI ues you seci f i ed i nsl ead of l he ar amel er na me . Iar amel er s ma y
have vaI ues seci f i ed l hal Ami ga DOS us es if you do nol exI i ci lI y sel l he
ar amel er . If you have nol seci f i ed a ar amel er , and if l here i s no def auI l ,
l hen l he vaI ue of l he ar amel er i s eml y and nol hi ng is subsl i l ul ed for
il.
To us e ar amel er subsl i l ul i on, you gi ve di recl i ves lo l he IXICUTI c om-
ma nd. To i ndi cal e l hese, you slarl a I i ne vi l h a seci aI characl er, vhi c h is
i ni li aI I y a er i od or " d o l " (. ). The di recl i ves are as f oI I ovs:
. KIY Ar gume nl l emI al e, us ed lo seci f y
l he f or mal of l he ar gumenl s , ma y be abbr evi al ed
lo . K
. DOT ch
Change dol characl er ( i ni l i aI I y" . " ) l o ch
. RA ch
Change bra characl er (iniliaIIy " < " ) l o ch
. KIT ch
Change kel characl er (iniliaIIy " > " ) l o ch
. DOLLAR ch
Change def auI l - char (iniliaIIy " $ " ) lo ch, may be
abbrevi al ed l o . DOL
. DII keyvor d vaI ue
Gi ve def auI l lo ar amel er
. < s a c e >
Comme nl I i ne
. < n e v I i n e >
I ank c omme nl I i ne
ef or e execul i on, Ami ga DOS scans l he conl enl s of l he fiIe for any i l ems
encI os ed by RA and KIT characl ers ( " < " and " > " ) . Suc h i l ems ma y consi sl
of a keyvor d or a keyvor d and a defauI l vaI ue for Ami ga DOS lo us e if you have
Iefl l he ke yvor d uns el . (To searal e l he keyvor d and l he def auI l , if l her e is
one , you l ye a doI I ar si gn " $ " ) . Thus , Ami ga DOS reI aces < A N I M A L > vi l h
AMIGADO5 COMMAND5
55
l he vaI ue you associ al ed vi l h l he ke yvor d ANI MAL, vhi I e il r eI aces
< A N I M A L $ W O M A T > vi l h l he vaI ue of ANI MAL if il has one , and ol her -
vi se il def auI l s lo WOM AT.
A fiIe can onI y us e l he dol c omma nds if l he firsl I i ne has a dol c o mma nd
on il. The CLI I ooks al l he firsl I i ne. If il sl arl s vi l h a dol c o mma n d,
f or examI e, a c omme nl ( . < s a c e > l x l ) l hen l he CLI scans l he fiIe I ooki ng
f or ar amel er subsl i l ul i on and bui I ds a l emor ar y fiIe i n l he :T di recl ory.
If l he fiIe does n' l slarl vi l h a dol c omma nd, l hen il is a s s ume d l hal l her e
ar e N O dol c omma nds i n l he fi I e, vhi c h aI so me a ns no ar amel er subsl i -
l ul i on is er f or med. Ior l he no- dol case, l he CLI slarl s execul i ng l he fiIe
di recl I y vi l houl havi ng l o c oy il l o : T. Nol e l hal you can sliII e mb e d
c omme nl s i n a n execul e fiIe by us i ng l he CLI ' s c o mme nl char acl er , l he
semi coI on (,). If you don' l ne e d ar amel er subsl i l ul i on and dol c omma nds ,
don' l us e l he m. The y save you exl ra accesses l o l he di sk f or l he l emor ar y
fi I e.
Ami ga DOS rovi des a numbe r of c omma nds l hal are onI y usef uI i n c om-
ma nd s equence fi I es. The s e i ncI ude I I, SKI I, LA, and QUI T. The s e can be
nes l ed i n a c omma nd fi I e.
Nol e l hal you can aI so nes l IXICUTI fi I es. Thal i s, you can have a c om-
ma nd fiIe l hal conl ai ns IXICUTI c omma nds .
To sl o l he execul i on of a c omma nd fi I e, you r ess CTRL- D. If you are
nes l i ng c o mma nd fi I es, l hal i s, if one c omma nd fiIe caI I s anol her , you c an s l o
l he enl i re sel of IXICUTI c omma nds by r essi ng CTRL- C. CTRL- D onI y sl os
l he cur r enl c omma nd fiIe f r om execul i ng.
JX)&<0#5N
As s ume l he fiIe " I i s l " conl ai ns l he f oI I ovi ng:
. k f i I e na me / a
r u n c oy < f i I e n a m e > l o r l : +
e c ho " Ir i nl i n g of < f i I e n a m e > done "
The n l he f oI I ovi ng c omma nd
IXICUTI I i s l l e s l / r g
acl s as l hough you had l yed l he f oI I ovi ng c omma nds al l he keyboar d.
RUN c oy l e s l / r g l o r l : +
ICHO " Ir i n l i n g of l e s l / r g done "
Anol her examI e, " di s I ay" , us es mor e of l he f eal ures descr i bed above:
56
AMIGADO5 U5ER'5 MANUAL
. key n a me / a
I I I XI S T S < n a m e >
TYI I < n a m e > OIT n (If l he fiIe gi ven is on l he cur r enl di recl ory, l ye il
vi l h I i ne number s )
ILS I
ICHO " < n a m e > i s n o l o n l hi s di r e c l or y"
I NDI I
RUN IXICUTI di s I ay vo r k / r g 2
s houI d di sI ay l he fiIe vork/ rg2 vi l h I i ne number s on l he l ermi naI if il exi sl s
on l he cur r enl di recl ory. If l he fiIe is nol l her e, l he scr een di sI ays l he
f oI I ovi ng mes s age:
wnrk/prg2 is nnt nn this dircctnry.
,## )05:N , , I I, S KI I, IAI LAT, LA, ICHO, RUN, QUI T
%88'9':.)0 JX)&<0#5 >:2 9"# J^J?4!J ?:&&).8N
JX)&<0# - 2
;)2)&#9#2 ,/K59'9/9':. K= _#=I:28 S)&# ).8`:2 ;:5'9':.
The . KIY (or . K) s l al emenl suI i es bol h keyvor d na me s and osi l i ons i n
c o mma nd fi I es. Il leIIs IXICUTI hov ma ny ar amel er s l o execl and ho v l o
i nl errel l he m. I n ol her vor ds , . KIY serves as a " l e mI a l e " f or l he ar amel er
vaI ues you seci f y. OnI y one . KIY s l al emenl is aI I oved er c omma nd fiIe. If
r es enl , il shouI d be l he firsl c omma nd I i ne i n l he fiIe.
Whe n you enl er a c omma nd I i ne, Ami ga DOS resoI ves ar amel er subsl i l u-
l i ons f or l he keyvor ds i n l vo vays : by seci f i cal i on of l he keyvor d i n f ronl of
l he ar amel er , and by l he reI ali ve osi l i ons of l he ar amel er s i n l he I i ne.
Ke yvor d na me subsl i l ul i on l akes r ecedence.
As s ume l hal l he execul e fiIe na me d D I M O I conl ai ns l he f oI I ovi ng . KIY
s l al emenl :
. KIY f I a s h, a n
leIIs Ami ga DOS lo execl l vo ar amel er subsl i l ul i ons, < f I a s h > and < a n > .
( The angI e brackel s i ndi cal e l he keyvor d vaI ue lo be subsl i l ul ed al execul i on
l i me. )
Suos e you enl er l he f oI I ovi ng c omma nd I i ne:
AMIGADO5 COMMAND5
57
EXECUTE DEM01 pan snmcnamc I!ash nthcr-namc
The vaI ue " o l h e r n a me " is assi gned lo < f I a s h > , and l he vaI ue " s o me n a me " is
as s i gned l o < a n > .
You can omi l l he keyvor d na me s if l he ar amel er subsl i l ul i ons are i n l he
or der gi ven i n l he . KIY sl al emenl . Ior examI e, l he f oI I ovi ng s l al emenl is
equi vaI enl l o l he r ecedi ng one:
EXECUTE DEMO! nthcrnamc snmcnamc
Thi s is becaus e l he vaI ues cor r es ond lo l he keyvor d order seci f i ed i n l he
. KIY sl al emenl .
You can aI so mi x l he l vo me l hods of ar amel er subsl i l ul i on. Suos e you
have a . KIY sl al emenl vi l h severaI ar amel er s , as f oI I ovs:
.KEY wnrd!, wnrd2, wnrd3, wnrd4
The execul e fiIe r oces s or r emoves ar amel er na me s f r om l he i nul I i ne
lo fiII l he meani ngs of any keyvor d vaI ues il f i nds. The n, vi l h any r emai ni ng
i nul , il fiIIs l he I ef l over keyvor d osi l i ons accor di ng lo l he osi l i on of l he
i nul vaI ue.
Ior examI e:
EXECUTE DEM02 wnrd3 ccc wnrd! aaa bbb ddd
The r oces s or assi gns ccc l o < v o r d 3 > , aaa l o < v o r d I > , a nd has l vo
ar amel er s Iefl over. Sc anni ng f r om I efl l o ri ghl i n l he . KIY s l al emenl , il f i nds
l hal < v o r d 2 > is sliII unas s i gned. Thus , < v o r d 2 > gel s l he nexl i nul vor d,
bbb. Ii naI I y, < v o r d 4 > has n' l be e n as s i gned ei l her, so il gel s l he I asl i nul
vor d, ddd.
You can i ndi cal e seci aI condi l i ons f or ar amel er subsl i l ul i on, as f oI I ovs:
.KEY namc!/a, namc2/a, namc3, namc4/k
The ]0)3] i ndi cal es l hal a vaI ue mus l be suI i ed lo fiII l he ar amel er s f or
n a me I and na me 2 . VaI ues f or na me 3 and name 4 are ol i onaI , l hough l he ]HM]
i ndi cal es l hal < n a m e 4 > (if suI i ed) mus l be r ec eded by l he exI i ci l ke yvor d
" n a me 4 . " Ior examI e:
EXECUTE DEM03 Icc Iic Inc namc4 Ium
If l he us er does nol suI y a requi red ar amel er ( such as n a me I or na me 2 i n
l he r ecedi ng examI e) , IXICUTI i ssues an error me s s age .
58
AMIGADO5 U5ER'5 MANUAL
As an examI e of l he us e of l he /k ol i on, s uos e you have cr eal ed an
execul e fiIe na me d COMII LI and il I els you ol i onaI I y seci f y a f i I ename lo
vhi c h a ri nl oul of l he comi I al i on is lo be di recl ed. Your . key s l al emenl
mi ghl r ead:
.kcy cnmpi!cwhat/a,printIi!c/k
If a us er enl er s a I i ne s uc h as :
EXECUTE COMPILE myIi!c PRINTFILE myprint
l he execul e fiIe says l he keyvor d IRI NTII LI is ol i onaI and ne e d nol be
suI i ed, bul if us ed, l here mus l be a vaI ue enl er ed aI ong vi l h il. Thus
l he above I i ne is correcl , si nce myr i nl is seci f i ed as l he l argel oul ul
fiIe.
JX)&<0# - 2
%55'(.'.( *#>)/09 ;)2)&#9#25 ).8 *'>>#2#.9 W2)DM#9 ?")2)D9#25
.KEY wnrd!
The . DII di recl i ve esl abI i shes a def auI l vaI ue for a keyvor d if l he user does
nol seci f y a vaI ue on l he c omma nd I i ne. To del ecl an uns uI i ed ar amel er
vaI ue, you c an c omar e il l o " " ( l vo doubI e- quol es i n a r ov) . You mus l
er f or m l hi s c omar i s on bef or e execul i ng any . DII sl al emenl i n l he execul e
fi I e.
Yo u c an assi gn def auI l s i n ei l her of l vo vays . The firsl vay requi res l hal
you seci f y l he def auI l ever y l i me you ref erence a ar amel er , us i ng l he " $ "
oer al or .
Ior examI e, i n l he f oI I ovi ng sl al emenl :
ECHO "<wnrd!$dcIwnrd!> is thc dcIau!t Inr Wnrd!."
" d e f vo r d I " is l he def auI l seci f i ed for vo r dI and is r i nl ed vh e n l he above
s l al emenl execul es . The s ec ond va y i s l o def i ne a def auI l onc e. Ior examI e,
vi l h l he f oI I ovi ng as s i gnmenl :
.DEF wnrd! "dcIwnrd!"
you can execul e l he f oI I ovi ng sl al emenl :
ECHO " <wnr d! > is thc dcIau!t Inr Wnrd!."
AMIGADO5 COMMAND5
59
The oul ul of bol h of l he above I CHO s l al emenl s vi I I be:
dcIwnrd! is thc dcIau!t Inr Wnrd!.
Nol e l hal a s ec ond us e of . DII f or a gi ven ar amel er has no ef f ecl :
.DEF wnrd!
)
Ncw dcIau!t
ECHO " <wnr d! > is 5TILL thc dcIau!t Inr Wnrd!."
( The fi rsl as s i gnmenl , " d e f vo r d I " vi I I be subsl i l ul ed f or vo r d I al execul i on
l i me. )
%55'(.'.( *'>>#2#.9 W2)DM#9 ?")2)D9#25
Whe r e ve r IXICUTI f i nds encI osi ng angI e br ackel s, il I ooks vi l hi n l he m l o see
if il can subsl i l ul e a ar amel er . An uns uI i ed ar amel er vi l h no def auI l
be c ome s a " n uI I " sl ri ng.
Suos e you vanl lo us e a sl ri ng l hal conl ai ns l he angI e br ackel char acl er s,
< and > . You can us e l he di recl i ves . RA and . KIT lo def i ne subsl i l ul es f or
l he br ackel char acl er s. Ior examI e,
ECHO "This !inc dncs WOT print <ang!c> brackcts."
.BRA
.KET
ECHO "This !inc DOE5 print <ang!c> brackcts."
ECHO "Thc dcIau!t Inr wnrd! is wnrd!."
The firsl I CHO s l al emenl causes l he r ocessor lo I ook for l he ar amel er
subsl i l ul i on f or " a n g I e , " si nce l hal ' s l he cur r enl me ani ng of l he angI e br ackel
char acl er s. Si nce " a n g I e " vas n' l i ncI uded i n l he . KIY s l al emenl , l he r oces s or
subsl i l ul es l he nuI I sl ri ng for il. The n, af l er l he . RA and . KIT di recl i ves
redef i ne l he brackel characl ers, l he second ICHO sl al emenl ri nl s l he characl ers:
This !inc DOE5 print <ang!c> brackcts.
The l hi rd I CHO s l al emenl i I I usl ral es l hal l he br aces ( and ) nov f uncl i on
l o encI os e keyvor ds f or l he ur os e of ar amel er subsl i l ul i on.
The I I s l al emenl I el s you er f or m l esl s and cause di f f erenl acl i ons bas e d on
l he resuI l s of l hos e l esl s. Amo n g l he ossi bI e l esl s are l esl i ng sl ri ngs f or
equaI i l y and l esl i ng l o see if a fiIe exi sl s. You can us e an ILSI s l al emenl vi l h
JX)&<0# - 3
,":I'.( ?:&&).8 R'0# ,92/D9/2#5
60
AMIGADO5 U5ER'5 MANUAL
an I I lo seci f y vhal shouI d be done i n case l he I I condi l i on i s nol l rue. The
ILSI s l al emenl , if us ed, i s consi der ed a arl of l he I I s l al emenl bI ock. An
INDI I l er mi nal es an II sl al emenl bI ock.
The examI e r ogr ams be I ov aI so us e a SKI I sl al emenl . The SKI I s l al emenl
I el s you ski I ORWARD ONLY vi l hi n your execul e fiIe lo a I abeI def i ned by a
LA sl al emenl .
The I I . . . INDI I sl rucl ure is i I I usl ral ed by l he f oI I ovi ng shorl examI e. Il is
gener aI I y a good i dea l o l esl f or keyvor ds l hal mi ghl be omi l l ed, or mi ghl be
enl er ed as nuI I ( " " ) i n quol es , as s hovn beI ov:
IF " <wnr d! >" EQ "usagc"
5KIP U5AGE
ENDIF
IF "<wnrd2>" EQ ""
5KIP U5AGE
ENDIF
IncI os i ng your ar amel er subsl i l ul i on vor ds i n doubI e quol es vi l hi n I I
s l al emenl s r evenl s IXICUTI f r om r eor l i ng an error if l he keyvor d is
omi l l ed.
If you omi l l he doubI e quol es and l he vaI ue i s nol s uI i ed, l he resuI l can be
a I i ne l hal r eads:
IF EQ "usagc"
Thi s r oduces an error, bec aus e l he l vo oer al ors I I and IQ are ad| acenl .
Us i ng doubI e quol es ar ound l he keyvor d r eI acemenl i ndi cal ors resuI l s i n a
I i ne l hal r eads :
IF "" EQ "usagc"
vhi c h is I egaI .
You c an us e NOT i n an I I s l al emenl lo r ever se l he me ani ng of l he l esl you
er f or m. Ior examI e:
IF NOT cxists <Irnm>
Ther e c an be nol hi ng on l he I I I i ne ol her l han l he l esl condi l i on. Ior
examI e, l he f oI I ovi ng is i ncorrecl :
IF <snmcthing> EQ truc 5KIP DONE
The correcl f or m of l he above s l al emenl is as f oI I ovs:
AMIGADO5 COMMAND5
61
I I < s o m e l h i n g > IQ " l r u e "
S KI I DONI
I NDI I
As l he examI e above s hovs , l he sl ri ng consl anl l esl ed f or ne e d nol be
enc I os ed i n doubI e quol es , i n l he r ecedi ng examI e, ei l her " T R U I " or TRUI
is accel abI e.
As s hovn i n l he samI e c omma nd fiIe beI ov, II s l al emenl s can be nes l ed so
l hal c omma nds can be execul ed bas ed on muI l i I e l rue s l al emenl s . Nol e l hal
IXICUTI I el s you i ndenl l o make l he nesl i ng of I I s l al emenl s mor e r eadabI e.
The f oI I ovi ng samI e c omma nd fiIe si muI al es a fiIe coyi ng uli I i ly l hal
i I I usl ral es cerl ai n usef uI sl rucl ures i n a c omma nd fi I e: I I . . . | ILSIj . . .
INDI I, LA, and SKI I.
. KIY f r o m, l o
I I " < f r o m > " e q " "
b e i n g s uI i ed.
S KI I us a g e
us e .
I NDI I
I I " < l o > " eq " "
b e i n g s uI i ed.
S K I I u s a g e
I NDI I
, ( Assi gn ar amel er Iisl)
, ( Check f or a I ROM fiIe)
, ( No fi I e, s hov user h o v l o)
, ( Check f or a TO fiIe)
, ( No fi I e, s hov us er hov l o use)
I I NOT e x i s l s < f r o m > , ( Check if I ROM fiIe does n' l exi sl)
ICHO " The f r o m f i I e y o u s e I e c l e d , ( < f r o m > ) couI d nol be f o un d. "
ICHO " II e a s e us e l h e DI R or LI S T c omma nd and lry a ga i n. "
S KI I DONI , ( Nnt c: We c an SKI I oul of an I I. )
I NDI I
I I e x i s l s < l o > , ( Check if TO fiIe exi sl s. )
I I " < o > " IQ " 0" , ( Di d l he us er suI y " O " )
o n l h e I i n e `
c oy f r o m < f r o m > l o < l o >
ICHO " Re I a c e d f i I e n a me d < l o > vi l h a c oy of f i I e n a m e d < f r o m > "
ICHO " Re que s l f uI f i I I ed. "
ILS I
ICHO " Co mma n d vi I I ove r vr i l e a n e x i s l i ng f i I e ONLY i f '
ICHO " l he 0 a r a me l e r i s s eci f i ed. "
ICHO " Re que s l De ni e d"
S KI I us a g e , ( IxI ai n ho v lo us e l hi s fiIe)
I NDI I
62
AMIGADO5 U5ER'5 MANUAL
EL5E
ECHO "cnpy Irnm <Irnm> tn <t n>. "
ENDIF
5KIP DONE
LAB usagc
ECHO "cp: usagc. . . . "
ECHO "Thc In!!nwing cnpy Inrms arc suppnrtcd:"
ECHO " x cp FROM snurccIi!c TO dcst!natinnIi!c"
ECHO " x cp FROM snurccIi!c dcstinatinnIi!c"
ECHO " x cp snurccIi!c TO dcstinatinnII!c"
ECHO " x cp snurccIi!c dcstinatinnIi!c"
ECHO " x cp TO dcstinatinnIi!c FROM snurccIi!c"
ECHO " x cp snurccIi!c dcstinatinnIi!c 0"
ECHO " x cp FROM snurccIi!c TO dcstinatinnIi!c 0"
ECHO " x cp 0 FROM snurccIi!c TO dcstinatinnIi!c"
ECHO "whcrc: x is shnrt Inr EXECUTE, cp is thc namc nI
ECHO "this cnmmand Ii!c, and "0" mcans 'nvcrwritc cxisting Ii!c'."
LAB DONE
JX)&<0# - 4
Thc 5KIP cnmmand a!!nws nn!y Inrward |umps. Tn crcatc a !nnp structurc
within a cnmmand Ii!c, usc EXECUTE itcrativc!y. That is, usc thc EXECUTE
cnmmand within thc Ii!c itsc!I tn scnd cxccutinn backwards tn a !abc!. Thc
In!!nwing cxccutab!c cxamp!c i!!ustratcs !nnping.
This Ii!c disp!ays Iivc mcssagcs:
"This mcssagc prints nncc at thc bcginning, (parm!, parm2)"
"Lnnp numbcr I."
"Lnnp numbcr II."
"Lnnp numbcr III."
"This mcssagc prints nncc at thc cnd. (parm!, parm2)"
.KEY parm!,parm2, !nnpcnt, !nnp!abc!
FAILAT 20
IF NOT "<!nnp!abc!>" EQ "" ,(Ca!!cd with !abc!?)
5KIP <!nnp!abc!> ,(Ycs, thcn !nnp.)
ENDIF
ECHO "This mcssagc prints nncc ,(5tart nI !nnp)
at thc bcginning. ( <par m! >, <par m2>) "
AMIGADO5 COMMAND5
63
LA I s l - I o o
I I " < I o o c n l > " IQ " I I I "
S KI I I o o e n d- < I o o I a b e I >
, ( Are ve done I ooi ng`)
, ( Yes, unvi nd. )
I NDI I
ICHO " Loo n umb e r < I o o c n l > I . " , ( Go " ba c kva r ds " i n lhi s fi I e. )
IXICUTI, I oo. s a mI e " < a r m I > " " < a r m 2 > " < I o o c n l > I I s l - I o o
LA I o o e n d- < I o o I a b e I >
I I NOT " < I o o c n l > " IQ " "
S KI I I X I T
I NDI I
ICHO " Thi s me s s a g e r i n l s onc e a l l h e end. | < a r m I > , < a r m 2 > ) "
LA I X I T
R:2&)9N IAI LAT < n >
!#&<0)9#N IAI LAT " R C L I M "
;/2<:5#N To i nsl rucl a c omma nd s equenc e l o faiI if a r ogr am r el ur ns an error
code greal er l han or equaI l o lhi s numbe r .
,<#D'>'D)9':.N
Co mma nds i ndi cal e l hal l hey have fai I ed i n s ome va y by sel l i ng a r el ur n code.
A nonzer o rel urn code i ndi cal es l hal l he c omma nd has f ound an error of s ome
sorl . A r el ur n code greal er l han or equaI lo a cerl ai n I i mi l ( l he faiI I i mi l)
l er mi nal es a s equenc e of noni nl er acl i ve c omma nds (lhal i s, l he c o mma nds
l hal you seci f y af l er RUN or i n an IXICUTI fi I e). The r el urn c ode i ndi cal es
ho v seri ous l he error vas , and is nor maI I y 5, 10, or 20.
Yo u ma y us e l he IAI LAT c omma nd lo aI l er lhi s faiI I eveI f r om ils i ni li aI
vaI ue of 10. If you i ncrease l he I eveI , you i ndi cal e l hal cerl ai n cI asses of error
shouI d nol be r egar ded as falaI , and l hal execul i on of s ubs equenl c omma nds
ma y r oc eed af l er an error. The ar gumenl shouI d be a osi l i ve numbe r . The
faiI I eveI i s resel l o l he iniliaI vaI ue of 10 on exi l f r om l he c o mma nd s e que nc e .
You mus l us e IAI LAT bef or e c omma nds such as I I l o l esl lo see if a
c omma nd has fai I ed, ol her vi se, l he c omma nd s equence l er mi nal es bef or e
execul i ng l he I I c omma nd.
If you omi l l he ar gumenl , l he cur r enl vaI ue of l he faiI I eveI is di sI ayed.
, ( Ind of I oo)
FAILAT
JX)&<0#5N
IAI LAT 2 5
64
AMIGADO5 U5ER'5 MANUAL
The c omma nd s equence onI y l er mi nal es bef or e l he e nd if a c o mma nd sl os
vi l h a r el ur n c ode greal er l han or equaI lo ( > ) 25.
,## )05:N I I, IXICUTI, RUN, QUI T
FAULT
R:2&)9N I A U L T | < n > j
!#&<0)9#N IAULT " , , , , , "
;/2<:5#N To di sI ay l he mes s ages cor r esondi ng l o l he fauIl codes you suI y.
,<#D'>'D)9':.N
Ami ga DOS I ooks u l he number s and di sI ays l he cor r esondi ng mes s ages . U
l o l en mes s ages ma y be di sI ayed.
JX)&<0#5N
IAULT 2 2 2
di sI ays l he mes s age for fauI l 222.
IAULT 2 2 1 1 0 3 1 2 1 2 1 8
di sI ays l he mes s ages for fauI ls 221, 103, 121, and 218.
FILENOTE
R:2&)9N II LINOTI |IILIj <f i I e > C O M M I N T < s l r i ng>
!#&<0)9#N II LINOTI " I I LI/ A, COMMINT/ K"
;/2<:5#N To al l ach a c omme nl or a nol e lo a fi I e.
,<#D'>'D)9':.N
II LINOTI assi gns a c omme nl lo a seci f i ed fi I e.
The ke yvor d C O M M I N T i nl r oduces an ol i onaI c omme nl of u l o 80
char acl er s. A c omme nl may be mor e l han one vor d (lhal i s, conl ai n saces
be l ve e n char acl er s) . I n l hi s case, you mus l encI ose l he c omme nl vi l hi n doubI e
quol es ( " ) .
A c omme nl is associ al ed vi l h a arl i cuI ar fi I e. Whe n you exami ne l he fiIe
vi l h l he c o mma nd LI ST, l he c omme nl aear s on l he I i ne beI ov:
r o g 3 0 r ve d Today 1 1 : 0 7 : 3 3
: v e r s i o n 3 . 2 - 2 3 - m a r - 8 5
Wh e n you creal e a ne v fi I e, il does nol nor maI I y have a c omme nl . If you
over vr i l e an exi sl i ng fiIe l hal has a c omme nl , l hen l he c omme nl is r el ai ned
AMIGADO5 COMMAND5
65
even l hough l he conl enl s of l he fiIe have c hanged. The c o mma nd COI Y coi es
a fi I e. If a fiIe vi l h a c omme nl is coi ed, l he ne v fiIe does nol have l he
c omme nl f r om l he ori gi naI al l ached l o il aI l hough l he desl i nal i on fiIe ma y have
a c o mme nl vhi c h i s r el ai ned.
JX)&<0#5N
II LINOTI r o g 2 COMMINT " Ve r 3.3 2 6 - m a r - 8 5 "
al l aches l he c omme nl " Ve r 3. 3 26- mar - 85" l o r ogr am 2.
,## )05:N LI ST
FORMAT
R:2&)9N I ORMAT DRI VI < d r i v e n a me > NAMI < s l r i n g >
!#&<0)9#N IORMAT" DRI VI/ A/ K, NAMI/ A/ K"
;/2<:5#N To f or mal and i ni li aI i ze a ne v 3
1
/2-inch f I oy di sk.
,<#D'>'D)9':.N
The r ogr am f or mal s a ne v f I oy di sk i n l he me l hod r equi r ed f or Ami g a DOS .
Onc e l he di sk is f or mal l ed, il is i ni li aI i zed and as s i gned l he na me you seci f y.
Nol i ce l hal you mus l gi ve bol h l he DRI VI and NAMI ke yvor ds . The onI y
vaI i d ol i ons l hal you can gi ve af l er l he DRI VI keyvor d are DIO: , DI1 : ,
DI2: , or DI3: . Yo u c an l ye any sl ri ng af l er NAMI, bul if you us e s aces ,
you mus l encI ose l he vhoI e sl ri ng i n doubI e quol es ( " ) .
WARNI NG: I ORMAT f ormal s and i ni li aI i zes a di sk as an e ml y di sk. If
you us e a di sk l hal is nol eml y, you' I I I ose l he r evi ous c onl enl s of l he
di sk.
The na me as s i gned shouI d be uni que. Il may be one lo l hi rl y characl er s i n
I engl h and c omos e d of one or mor e vor ds sear al ed by saces . If l he
na me is mor e l han one vor d, you shouI d encI ose il i n doubI e quol es .
Nnt c: Il i s nol nec es s ar y l o f or mal a di sk if you are aboul l o DI S KCOIY l o il.
JX)&<0#5N
IORMAT DRI VI dfO: NAMI " Wo r k di s k"
f or mal s and i ni li aI i zes l he di sk i n dri ve " df O" vi l h l he na me " Wo r k di s k" .
,## )05:N DI S KCOIY, I NSTALL, RILAIL
66
AMIGADO5 U5ER'5 MANUAL
IF
R:2&)9N I I| NOTj | WARNj | IRRORj | IAI Lj | < s l r > IQ< s l r > j | IXI S TS < n a m e > j
!#&<0)9#N I I " NOT/ S, WARN/ S, IRROR/ S, IAI L/ S, IQ/ K, IXI STS/ K"
;/2<:5#N To aI I ov condi l i onaI s vi l hi n c omma nd s equences .
,<#D'>'D)9':.N
You can onI y us e l hi s c omma nd i n an IXICUTI c omma nd fiIe. If one or mor e
of l he seci f i ed condi l i ons is sal i sf i ed, II carri es oul aII l he f oI I ovi ng c om-
ma nds unl i I il f i nds a cor r es ondi ng INDI I or ILSI c omma nd, ol her vi s e, if
l he condi l i ons are nol sal i sf i ed, il carri es oul vhal ever f oI I ovs a c or r es ondi ng
ILSI c omma nd. ( INDI I and ILSI are onI y usef uI i n c omma nd s equences
conl ai ni ng I I. ) INDI I l er mi nal es an I I c omma nd, ILSI r ovi des an aI l ernal i ve
i f l he I I condi l i ons fai I . Nol e l hal l he condi l i ons and c omma nds i n I I and
ILSI c omma nds can s an mor e l han one I i ne bef ore l hei r cor r es ondi ng
INDI Is .
The f oI I ovi ng l abI e s hovs s ome of l he vays you can us e l he I I, ILSI, and
INDI I c omma nds :
II < c o n d i l i o n >
< c omma nd >
INDI I
II < c o n di l i o n >
< c o m m a n d >
ILSI
< c o m m a n d >
INDI I
II < c o n d i l i o n >
< c omma nd >
II < c o n d i l i o n >
< c o m m a n d >
INDI I
INDI I
Nol e l hal ILSI is ol i onaI and l hal nes l ed I Is | um lo l he near esl INDI I.
IRROR is onI y avai I abI e if you sel IAI LAT l o greal er l han 10. Si mi I arI y,
IAI L is onI y avai I abI e if you sel IAI LAT l o greal er l han 20.
Kcywnr d
N O T
W A R N
I RROR
IAI L
< a > I Q < b >
IXI STS < f i I e >
Funct i nn
r ever ses l he resuI l .
sal i sf i ed if r evi ous r el urn code > 5.
> 10.
> 20.
!! !! !! !! !! !!
!! !! !! !!
!! !! !! !!
sal i sf i ed if l he l exl of a and b is
i denl i caI ( di sregardi ng case) ,
sal i sf i ed if l he fiIe exi sl s.
You can us e I I IQ lo del ecl an uns el ar amel er i n a c omma nd fiIe by us i ng
l he f or m:
IF < a > EQ " "
AMIGADO5 COMMAND5 67
JX)&<0#5N
IF EXI5T5 wnrk/prng
TYPE wnrk/prng
EL5E
ECHO "Ii!c nnt Inund"
ENDIF
If l he fiIe " vor k/ r og" exi sls, l hen Ami gaDOS di sI ays il. Ol her vi se, Ami ga DOS
di sI ays l he mes s age "f i I e nol f o und" and execul es l he nexl c o mma nd i n l he
c omma nd s equenc e.
IF ERROR
5KIP crr!ab
ENDIF
If l he r evi ous c omma nd s l oed vi l h a rel urn code > 10, l he n Ami g a DOS
ski s l he c o mma nd s equenc e unl i I you def i ne a I abeI " e r r I a b" vi l h l he LA
c omma nd.
IF ERROR
IF EXI5T5 Ircd
ECHO "Thc Ii!c 'Ircd' cxists, but an crrnr nccurrcd anyway."
ENDIF
ENDIF
,## )05:N IAI LAT, S KI I, LA, IXICUTI, QUI T
INFO
R:2&)9N I NIO
!#&<0)9#N I NIO
;/2<:5#N To gi ve i nf or mal i on aboul l he fi I i ng s ys l em.
,<#D'>'D)9':.N
The c o mma nd di sI ays a I i ne of i nf or mal i on aboul eac h di sk uni l . Thi s
i ncI udes l he ma x i mum si ze of l he di sk, l he cur r enl us e d and f ree s ace,
l he numbe r of sof l di sk errors l hal have occur r ed, and l he sl al us of l he
di sk.
JX)&<0#5N
INFO
68
AMIGADO5 U5ER'5 MANUAL
Un i l Si ze Us e d I r e e IuI I I r r s S l a l us Na me
DI 1 : 8 8 0 K P 1 7 5 6 0 % 0 Read/ Wr i l e Te s l - 6
DIO: 8 8 0 K 1 0 8 1 6 7 7 6 1 % 0 Read/ Wr i l e Ami ga DOS CLI
Vo I u me s avai I abI e :
Te s l - 6 | Mo u n l e d j
Ami ga DOS CLI | Mo un l e dj
IN5TALL
R:2&)9N I NS TALL| DRI VIj < dr i ve >
!#&<0)9#N I NSTALL " DRI VI/ A"
;/2<:5#N To ma ke a f or mal l ed di sk bool abI e.
,<#D'>'D)9':.N
The ur os e of l he I NSTALL c omma nd i s lo make a di sk bool abI e (l hal i s, you
can us e I NSTALL l o make a di sk l hal slarl s u your Ami ga) . To do l hi s, you
si mI y l ye l he na me of l he dri ve vhe r e you have i nser l ed l he di sk l hal you
va nl lo be c ome l he bool ( sl arl u) di sk. Ther e are f our ossi bI e dri ve name s :
DI0: , DI1: , DI2: , and DI3: .
JX)&<0#5N
I NS TALL dfO:
ma ke s l he di sk i n dri ve " df O: " a bool abI e di sk.
JOIN
R:2&)9N } OI N < n a m e > < n a m e > | < n a m e > j A S < n a m e >
!#&<0)9#N } OI N " , / , , , , , , A S / A / K "
;/2<:5#N To concal enal e u lo 15 fiIes l o f or m a ne v fi I e.
,<#D'>'D)9':.N
Ami g a DOS coi es l he seci f i ed fiIes i n l he order you gi ve i nl o l he n e v
fi I e. Nol e l hal l he ne v fiIe cannol have l he s ame na me as any of l he i nul
fi I es.
JX)&<0#5N
} O I N a r l i a r l 2 AS l e xl f i I e
AMIGADO5 COMMAND5 69
| oi ns l he l vo fiIes l ogel her , I aci ng l he resuI l i n " l exl f i I e" . The l vo ori gi naI fi I es
r emai n unc ha nge d, vhi I e " l exl f i I e" conl ai ns a coy of " a r l i " and a c oy of
" a r l 2 " .
LAB
R:2&)9N LA < s l r i n g >
!#&<0)9#N LA < l e x l >
;/2<:5#N To i mI emenl I abeI s i n c omma nd s equenc e fi I es.
,<#D'>'D)9':.N
The c omma nd i gnor es any ar amel er s you gi ve. Us e LA l o def i ne a I abeI
" l e x l " l hal is I ooked for by l he c omma nd SKI I.
JX)&<0#5N
LAB crr!ab
def i nes l he I abeI " e r r I a b" lo vhi c h SKI I ma y | um.
,## )05:N SKI I, I I, IXICUTI
LI5T
R:2&)9N LI S T| | DI Rj < di r > j | I+ IAT < a l > j | KI YS j | DAT I S j | NODAT I S j | T O
< n a m e > j | S < s l r > j | S I N C I < d a l e > j | UI T O < d a l e > j | QUI CKj
!#&<0)9#N LI ST " DI R, I IAT/ K, KIYS/ S, DATIS / S , NODATIS / S , TO/ K, S/ K,
SI NCI/ K, UITO/ K, QUI CK/ S"
;/2<:5#N To exami ne and Iisl seci f i ed i nf or mal i on aboul a di recl ory or fi I e.
,<#D'>'D)9':.N
If you do nol seci f y a name ( l he ar amel er DI R) , LI ST di sI ays l he c onl enl s of
l he cur r enl di recl ory. The firsl ar amel er LI ST accel s is DI R. You have l hr ee
ol i ons. DI R ma y be a f i I ename, i n vhi c h case LI ST di sI ays l he fiIe i nf or ma-
l i on f or l hal one fi I e. SecondI y, DI R ma y be a di recl ory na me . In l hi s case LI ST
di sI ays fiIe i nf or mal i on for fiIes ( and ol her di recl ori es) vi l hi n l he seci f i ed
di recl ory. Lasl I y, if you omi l l he DI R ar amel er , LI ST di sI ays i nf or mal i on
aboul fiIes and di recl ori es vi l hi n l he currenl di recl ory (for f url her del ai I s on
l he cur r enl di recl ory, see l he CD c omma nd) .
Nnt c: LI ST, unI i ke DI R, does NOT sorl l he di recl ory bef or e di sI ayi ng il.
If no ol her ol i ons are seci f i ed, LI ST di sI ays:
Ii!c namc sizc prntcctinn datc timc
: cnmmcnt
70 AMIGADO5 U5ER'5 MANUAL
The s e f i eI ds are def i ned as f oI I ovs:
Ii!c namc:
si zc:
prnt cct i nn:
dat c and t i mc:
c nmmcnt :
Na me of fiIe or di recl ory.
The si ze of l he fiIe i n byl es. If l here is nol hi ng i n l he fi I e, l hi s
fieId viII sl al e " e ml y " . Ior di recl ori es l hi s enl r y sl al es " di r " .
Thi s seci f i es l he access avai I abI e for lhi s fiIe, r ved i ndi cal es
Read, Wr i l e, Ixecul e, and DeI el e.
The fiIe creal i on dal e and l i me.
Thi s is l he c omme nl I aced on l he fiIe us i ng l he II LINOTI
c omma nd. Nol e l hal il is r eceded vi l h a coI on (:).
Ol i ons avai I abI e:
TO
KEY5
DATE5
NODATE 5
5I NCE < d a t c >
UPTO < d a t c >
P < p a t >
5 < s t r >
QUI CK
Thi s seci f i es l he fiIe (or devi ce) lo oul ul l he fiIe I i sl i ng l o. If
omi l l ed, l he oul ul goes lo l he cur r enl CLI vi ndov.
Di sI ays l he bI ock numbe r of eac h fiIe header or di recl ory.
Di sI ays dal es i n l he f or m DD- MMM- YY ( l he def auI l unI ess
you us e QUI CK) .
Does nol di sI ay dal e and l i me i nf or mal i on.
Di sI ays onI y fiIes I asl udal ed on or af l er < d a l e > . < d a l e >
can be i n l he f or m DD- MMM- YY or a day na me in l he I asl
ve e k (for examI e, MONDAY) or T ODAY or YIS TIRDAY.
Di sI ays onI y fiIes I asl udal ed on or bef or e < d a l e > .
Sear ches for fiIes vhos e na me s mal c h < a l > .
Sear ches f or f i I enames conl ai ni ng subsl ri ng < s l r > .
} us l di sI ays l he na me s of fiIes and di recl ori es (Iike l he DI R
c omma nd) .
You can seci f y l he r ange of f i I enames di sI ayed i n l vo vays . The si mI esl
va y is lo us e l he S ke yvor d, vhi c h reslri cl s l he I i sli ng lo l hos e fiIes conl ai ni ng
l he seci f i ed subsl ri ng. To seci f y a mor e comI i cal ed sear ch exr essi on, us e
l he I or IAT ke yvor d. Thi s is f oI I oved by a al l ern l hal mal c hes as descr i bed
beI ov.
A al l er n consi sl s of a numbe r of seci aI characl ers vi l h seci aI me ani ngs ,
and any ol her characl er s l hal mal c h l hem.
The seci aI characl ers are: ' ( ) ` %- +
I n order l o r emove l he seci aI effecl of l hes e characl ers, ref ace l he m vi l h ' .
Thus ' ` mal c hes ` and ' ' mal c hes ' .
AMIGADO5 COMMAND5 71
` Mal c hes any si ngI e characl er.
% Mal c hes l he nuI I sl ri ng.
- < > Mal c hes zer o or mor e occur r ences of l he al l er n < > .
< I > < 2 > Mal c hes a s equence of al l ern < I > f oI I oved by < 2 > .
< I > I < 2 > Mal c hes if ei l her al l er n < I > or al l er n < 2 > mal c h.
() Gr ous al l er ns l ogel her .
Thus :
LI ST IAT A - C Mal c hes AC AC AC, and so f orl h.
LI ST IAT A- ( I C) D Mal c hes AD AD ACD, and so f orl h.
LI ST IAT A` Mal c he s AA A AC, and so f orl h.
LI ST IAT A - ` Mal c hes A AXX AZXQ, and so f orl h.
LI ST I A T ' ` - ` ' - Mal c hes ` - ` A - ` ` - - , and so f orl h
LI ST IAT A( I %) - C Mal c hes A AC ACCC, and so f orl h.
LI ST IAT - ( A ) Mal c he s A AA AAA, and s o f orl h.
JX)&<0#5N
LI S T
di sI ays i nf or mal i on aboul aII l he fiIes and di recl ori es conl ai ned i n l he cur r enl
di recl ory. Ior examI e,
I i I e _ I
Ii I e 2
Ii I e. 3
: c o mme n l ( nol i ce l hal Ii I e. 3 has a c ommenl )
I i I e 0 0 4
LI S T v o r k S n e v
di sI ays i nf or mal i on aboul fiIes i n l he di recl ory " vo r k " vhos e na me s conl ai n
l he lexl " n e v " . Nol e l hal LI ST S r oduces l he r es ons e: " Ar gs no good f or
k e y " bec aus e l here is an " S " di recl ory. LI ST " s " vi I I Iisl l hi s di recl ory' s
conl enl s .
LI S T v o r k I n e v - ` ( x + y )
exami nes l he di recl ory " vo r k " , and di sI ays i nf or mal i on aboul aII fiIes l hal
slarl vi l h l he I el l ers " n e v " and l hal end vi l h ei l her " x " or " y " .
LI S T QUI CK TO oul f i I e
72 AMIGADO5 U5ER'5 MANUAL
s ends | us l l he na me s , one on each I i ne, lo l he fiIe " oul f i I e" . You can l hen edi l
l he fiIe and i nserl l he c omma nd TYII al l he begi nni ng of each I i ne. The n l ye:
IXICUTI oul f i I e
l o di sI ay l he fi I es.
,## )05:N DATI, DI R, II LINOTI, IROTICT
MAKEDIR
R:2&)9N M A K I D I R < di r >
!#&<0)9#N MAKIDI R ]H%]
;/2<:5#N To ma ke a n e v di recl ory.
,<#D'>'D)9':.N
MAKIDI R creal es a di recl ory vi l h l he na me you seci f y. The c o mma nd onI y
creal es one di recl ory al a l i me, so any di recl ori es on l he al h mus l aI ready
exi sl . The c omma nd faiIs if l he di recl ory or a fiIe of l he s ame na me aI ready
exi sl s i n l he di recl ory above il i n l he hi er ar chy.
JX)&<0#5N
MAKI DI R l e s l s
creal es a di recl ory " l e s l s " i n l he currenl di recl ory.
MAKI DI R df I : xyz
creal es a di recl ory " x y z " i n l he rool di recl ory of di sk " d f I " .
MAKI DI R df I : xyz/ abc
creal es a di recl ory " a b c " i n l he ar enl di recl ory " x y z " on di sk " d f I " . Hove ve r ,
" x y z " mus l exi sl f or lhi s c omma nd lo vor k.
,## )05:N DILITI
NEWCLI
R:2&)9N NI WCL I | < vi n d o v> j
!#&<0)9#N NIWCLI " W I N D O W "
;/2<:5#N To creal e a vi ndov associ al ed vi l h a ne v i nl eracl i ve CLI r oces s.
AMIGADO5 COMMAND5 73
,<#D'>'D)9':.N
Ami ga DOS creal es a ne v CLI vi ndov. The ne v vi ndov be c ome s l he cur-
renl I y seI ecl ed r ocess . The ne v vi ndov has l he s ame sel di recl ory and
r oml sl ri ng as l he one vher e NIWCLI is execul ed. Iach CLI vi ndov i s
i ndeendenl , aI I ovi ng sear al e i nul , oul ul , and r ogr am execul i on.
To connecl l he keyboar d lo your ne v CLI , move l he mous e lo oi nl l he cursor
al l he n e v vi ndov, and ress l he Iefl mous e bul l on ( l hal i s, l he SeI ecl i on
ul l on) . You can oi nl al any osi li on on l he vi ndov vhe n seI ecli ng a ne v CLI .
Wh e n you gi ve NIWCLI vi l h no ar gumenl , Ami ga DOS creal es a vi ndov of
sl andar d si ze and osi l i on. To c hange l he si ze of l he vi ndov, move l he mous e
lo oi nl l he cursor al l he bol l om ri ghl cor ner (si zi ng Gadgel ) , and r es s l he
SeI ecl i on ul l on. You can l hen c hange l he vi ndov si ze. To c hange l he osi l i on
of l he vi ndov, move l he mous e lo l he Dr ag ar, r ess l he Iefl mo us e bul l on
and move l he mous e lo vhe r e you vanl l he vi ndov.
To cus l omi ze a CLI vi ndov, you can gi ve an exacl osi l i on and si ze or e ven
a ne v lilIe on l he lilIe bar . The " vi n d o v" synl ax lo do l hi s i s as f oI I ovs:
CON: x/ y/ vi dl h/ hei ghl / l i l I e
vhe r e " C O N : " denol es a consoI e vi ndov, " x " and " y " are l he coor di nal es
descr i bi ng l he vi ndov' s osi l i on, " vi dl h " and " he i g hl " are l he si ze of l he
vi ndov, and " l i l I e " is l he sl ri ng you vanl on l he lilIe bar. You ne e d nol seci f y
a lilIe sl ri ng as il is ol i onaI , bul you mus l gi ve l he fi naI sI ash (/). AI I
di mens i ons are i n scr een i xeI s.
JX)&<0#5N
NIWCLI
creal es a n e v CLI r ocess and make s il l he cur r enl CLI .
NIWCLI C0 N: 1 0 / 3 0 / 3 0 0 / 1 0 0 / my CL I
creal es a ne v CLI al l he osi l i on 10, 30, of si ze 300 x 100 i xeI s, vi l h l he lilIe
" my CL I " .
NIWCLI " C0 N: 2 0 / 1 5 / 3 0 0 / 1 0 0 / my o vn CLI "
DoubI e quol es aI I ov l he lilIe l o have saces . Ior f url her i nf or mal i on on l he
cons oI e devi ce, CON: , see Secl i on 1. 3. 6, Under s l andi ng Devi ce Na me s .
Nnt c: UnI i ke a bac kgr ound r oces s creal ed vi l h l he RUN c o mma nd, a
NIWCLI r oces s hangs ar ound afler you have creal ed il.
,## )05:N INDCLI , RUN
74 AMIGADO5 U5ER'5 MANUAL
PROMPT
R:2&)9N I R O M I T < r o m l >
!#&<0)9#N I ROMI T " I R O M I T "
;/2<:5#N To c hange l he r oml i n l he currenl CLI .
,<#D'>'D)9':.N
H9 you do nol gi ve a ar amel er , l hen Ami go DOS resel s l he r oml lo l he
sl andar d sl ri ng ( " > " ) . Ol her vi s e, l he r oml is sel l o l he sl ri ng you s uI y.
Ami g a DOS aI so accel s one seci aI characl er combi nal i on ( %N) . Thi s i s de m-
onsl r al ed i n l he examI e beI ov.
JX)&<0#5N
IROMIT
r esel s l he cur r enl r oml l o " > " .
IROMIT " % N > "
r esel s l he cur r enl r oml l o " n > " , vhe r e n i s l he cur r enl r oces s numbe r .
Ami g a DOS i nl errel s l he seci aI characl er combi nal i on %N as l he r oces s
numbe r .
PROTECT
R:2&)9N IROTICT| II LIj < f i I e na me > | I L AGS < s l a l us > j
!#&<0)9#N IROTICT" I I LI, I LAGS / K"
;/2<:5#N To sel a fi I e' s rol ecl i on sl al us.
,<#D'>'D)9':.N
IROTICT l akes a fiIe and sel s ils rol ecl i on sl al us.
The ke yvor d ILAGS l akes f our ol i ons: r ead (r), vri l e ( v) , deI el e ( d) , and
execul e ( e) . To seci f y l hese ol i ons you l ye an r, v, d, or e af l er l he na me of
l he fi I e. If you omi l an ol i on, IROTICT as s umes l hal you do nol requi re il.
Ior i ns l ance, if you gi ve aII l he ol i ons excel d, IROTICT ens ur es l hal you
c annol deI el e l he fiIe. Read, vri l e, and deI el e can ref er l o any ki nd of fi I e.
Ami g a DOS onI y ays al l enl i on lo l he deI el e (d) fI ag i n l he cur r enl r eI ease.
Us er s and us er r ogr ams , hovever , can sel and l esl l hes e fI ags if l hey vi s h.
JX)&<0#5N
IROTICT r o g I ILAGS r
AMIGADO5 COMMAND5
75
sel s l he r ol ecl i on sl al us of r ogr am 1 as read onI y.
IROTICT r o g 2 r vd
sel s l he rol ecl i on of r ogr am 2 as read/ vri l e/ deI el e.
,## )05:N LI ST
QUIT
R:2&)9N QUI T| < r e l ur n c o de > j
!#&<0)9#N QUI T " R C "
;/2<:5#N To exil f r om a c omma nd s equenc e vi l h a gi ven error code.
,<#D'>'D)9':.N
QUI T r eads l hr ough l he c omma nd fiI e and l hen sl os vi l h a r el ur n c ode. The
def auI l rel ur n code is zer o.
JX)&<0#5N
QUI T
exi ls l he cur r enl c omma nd s equenc e.
IAI LAT 3 0
I I I RROR
QUI T 2 0
INDI I
If l he I asl c omma nd vas i n error, l hi s l er mi nal es l he c o mma nd s e que nc e
vi l h r el ur n code 20.
Ior mor e on c omma nd s equenc es , see l he seci f i cal i on f or l he IXICUTI
c omma nd earI i er in l hi s chal er .
,## )05:N IXICUTI, I I, LA, SKI I
RELABEL
R:2&)9N RIL AIL| DRI VIj < dri ve > | NAMIj < na me >
!#&<0)9#N RILAIL " DRI VI/ A, NAMI / A"
;/2<:5#N To c hange l he voI ume name of a di sk.
76
AMIGADO5 U5ER'5 MANUAL
,<#D'>'D)9':.N
RILAIL c hanges l he voI ume na me of a di sk lo l he < n a m e > you seci f y.
VoI ume na me s are sel iniliaII y vhe n you f or mal a di sk.
JX)&<0#5N
RELABEL dI!: "My nthcr disk"
,## )05:N I ORMAT
RENAME
R:2&)9N RINAMI | IROMj < na me > | TO |ASj < n a m e >
!#&<0)9#N RINAMI " I ROM/ A, TO AS / A"
;/2<:5#N To r e name a fiIe or di recl ory.
,<#D'>'D)9':.N
RI NAMI r e name s l he I ROM fiIe vi l h l he seci f i ed TO na me . I ROM and T O
mus l be f i I enames on l he s ame di sk. The I R O M na me ma y ref er l o a fiIe or l o a
di recl ory. If l he f i I ename ref ers lo a di recl ory, RINAMI I eaves l he conl enl s of
l he di recl ory unc ha nge d (lhal i s, l he di recl ori es and fiIes vi l hi n l hal di recl ory
ke e l he s ame conl enl s and name s ) .
OnI y l he na me of l he di recl ory is c hanged vhe n you us e RINAMI. If you
r e na me a di recl ory, or if you us e RINAMI l o gi ve a fiIe anol her di recl ory
na me (for examI e, r ename : biII/Ieller as : mary/ I el l er) , Ami g a DOS c hanges l he
osi l i on of l he di recl ory, or fi I e, i n l he fi I i ng s ys l em hi er ar chy. Us i ng RINAMI
is I i ke c hangi ng l he lilIe of a fiIe and l hen movi ng il l o anol her secl i on or
dr aver i n l he fi I i ng cabi nel . Some ol her s ys l ems descri be l he acl i on as " mo v -
i n g " a fiIe or di recl ory.
The RI NAMI c omma nd viII nol execul e if l he onI y c hange i s l he " c a s e " of
one or mor e I el l ers. Ior examI e,
RENAME Inx tn Fnx
does nol vor k.
Nnt c: If you aI ready have a fiIe vi l h exacl I y l he s ame na me as l he T O fi I e,
RINAMI von' l vor k. Thi s shouI d sl o you f r om overvri l i ng your fiIes by
acci denl .
JX)&<0#5N
RENAME wnrk/prng! A5 :arthur/cxamp!c
AMIGADO5 COMMAND5
77
r enames l he fiIe " vo r k / r o g I " as l he fiIe " ar l hur / examI e" . The rool di recl ory
mus l conl ai n " a r l hur " f or lhi s c omma nd lo vor k.
RUN !&DT=-< <$
=
T U
R:2&)9N RUN < c o m m a n d >
!#&<0)9#N RUN c omma nd + c omma nd
;/2<:5#N To execul e c omma nds as bac kgr ound r oc es s es .
,<#D'>'D)9':.N
R U N creal es a noni nl eracl i ve Co mma nd Li ne I nl erf ace (CLI) r oces s and gi ves
il l he resl of l he c omma nd I i ne as i nul . The bac kgr ound CLI execul es l he
c omma nds and l hen deI el es ilseIf.
The n e v CLI has l he s ame sel di recl ori es and c omma nd sl ack si ze as l he CLI
vhe r e you caI I ed RUN.
To sear al e c omma nds , l ye a I ug si gn ( + ) and r es s RITURN. R U N
i nl errel s l he nexl I i ne af l er a + ( RITURN) as a conl i nual i on of l he s ame
c omma nd I i ne. Thus , you can make u a si ngI e c omma nd I i ne of severaI
hysi caI I i nes l hal each e nd vi l h a I us si gn.
RUN di sI ays l he r ocess numbe r of l he nevI y creal ed r oces s.
JX)&<0#5N
RUN COIY : l / 0 IRT: +
DI L I TI : l / 0 +
ICHO " Ir i nl i n g f i ni s he d"
ri nl s l he fiIe " : l / 0 " by coyi ng il l o l he I i ne ri nl er devi ce, deI el es il, l he n
di sI ays l he gi ven mes s age.
RUN IXICUTI c o ms e q
execul es i n l he bac kgr ound aII l he c omma nds i n l he fiIe " c o ms e q " .
5EARCH
R:2&)9N S IARCH| IROMj < n a m e > + < a l > | SIARCHj < s l r i ng> | ALLj
!#&<0)9#N S IARCH " I ROM, S IARCH/ A, ALL/ S "
;/2<:5#N To I ook for a l exl sl ri ng you seci f y i n aII l he fiIes i n a di recl ory.
,<#D'>'D)9':.N
S IARCH I ooks l hr ough aII l he fiIes i n l he seci f i ed di recl ory, and any fiIes i n
subdi recl ori es if you seci f y ALL. S IARCH di sI ays any I i ne l hal conl ai ns l he
78
AMIGADO5 U5ER'5 MANUAL
l exl you seci f i ed as S IARCH. Il aI so di sI ays l he na me of l he fiIe currenl I y
bei ng s ear ched.
You can aI so reI ace l he di recl ory I ROM vi l h a al l ern. ( See l he c omma nd
LI ST f or a fuII descri l i on of al l erns. ) If you use a al l er n, S IARCH onI y
I ooks l hr ough fiIes l hal mal ch l he seci f i ed al l ern. The na me ma y aI so
conl ai n di recl ori es seci f i ed as a al l ern.
Ami g a DOS I ooks for ei l her uer or I over case of l he sear ch sl ri ng. Nol e
l hal you mus l I ace quol al i on mar ks ar ound any l exl conl ai ni ng a sace.
As us uaI , l o a ba ndon l he c omma nd, r es s CTRL- C, l he al l enl i on fI ag. To
abandon l he search of l he currenl fiIe and conl i nue on lo l he nexl fi I e, if any,
r es s CTRL- D.
JX)&<0#5N
S IARCH SIARCH vf I ag
sear ches l hr ough l he fiIes i n l he currenl di recl ory I ooki ng f or l he lexl " vf I a g" .
S IARCH dfO: " Ha y day" ALL
I ooks for fi I es conl ai ni ng l he l exl " Ha y da y " on l he enl i re di sk " df O: " .
S IARCH l e s l - - ` vf I ag
I ooks for l he lexl " vf I ag" in aII fiIes in l he currenl di recl ory slarli ng vi l h " l es l - " .
5KIP
R:2&)9N SKI I < I a b e I >
!#&<0)9#N SKI I " L A I L "
;/2<:5#N To er f or m a | um i n a c omma nd s equenc e.
,<#D'>'D)9':.N
You us e SKI I i n con| uncl i on vi l h LA. ( See LA f or del ai I s. ) SKI I r eads
l hr ough l he c o mma nd fiIe I ooki ng f or a I abeI you def i ned vi l h LA, vi l houl
execul i ng any c omma nds .
Yo u c an us e SKI I ei l her vi l h or vi l houl a I abeI , vi l houl one , il f i nds l he
nexl unna me d LA c omma nd. Wi l h one, il al l eml s lo f i nd a LA def i ni ng a
I abeI , as seci f i ed. LA mus l be l he firsl i l em on a I i ne of l he fi I e. If SKI I does
nol f i nd l he I abeI you seci f i ed, l he s equence l er mi nal es and Ami g a DOS
di sI ays l he f oI I ovi ng mes s age:
I abeI " < I a b e I > " n o l f ound b y Ski
AMIGADO5 COMMAND5
79
SKI I onI y | ums f orvar d i n l he c omma nd s equenc e.
JX)&<0#5N
S KI I
ski s lo l he nexl LA c omma nd vi l houl a na me f oI I ovi ng il.
I I I RROR
S KI I e r r I a b
I NDI I
If l he I asl c omma nd s l oed vi l h a rel ur n code > 20, l hi s s ear ches for l he
I abeI " e r r I a b" I al er i n l he c omma nd fiIe.
IAI LAT 1 0 0
AS S I M l e x l
I I I RROR
S KI I I RROR
I NDI I
L I NK
S KI I DONI
LA I RROR
ICHO " I r r o r doi ng A s s e m "
LA DONI
ICHO " Ne x l c o m m a n d I e a s e "
,## )05:N IXICUTI, LA, I I, IAI LAT, QUI T
5ORT
R:2&)9N S O R T | I R O M j < n a m e > | | T O j < n a m e > j | C O L S T A R T < n > j
!#&<0)9#N S ORT " I ROM/ A, TO/ A, COLS TART/ K"
;/2<:5#N To sorl si mI e fi I es.
,<#D'>'D)9':.N
Thi s c omma nd is a ver y si mI e sorl ackage. You can us e S ORT l o sorl fiIes
aI l hough il i sn' l fasl for I arge fi I es, and il cannol sorl fiIes l hal don' l fil i nl o
me mor y.
Yo u seci f y l he source as I ROM, and l he sorl ed resuI l goes l o l he fiIe TO.
S ORT as s umes l hal I ROM is a nor maI l exl fiIe vher e each I i ne is sear al ed
80
AMIGADO5 U5ER'5 MANUAL
vi l h a carri age rel urn. Iach I i ne i n l he fiIe is sorl ed i nl o i ncr easi ng aI habel i c
or der vi l houl di sl i ngui shi ng bel veen uer and I over cases.
To aI ler l hi s i n a very I i mi l ed vay, us e l he COLS TART ke yvor d l o seci f y
l he firsl c oI umn vhe r e l he comar i s on is lo l ake I ace. S ORT l hen c omar es
l he characl ers on l he I i ne f r om l he seci f i ed sl arl i ng osi l i on lo l he end, if l he
I i nes sliII mal c h af l er l hi s, l hen l he r emai ni ng c oI umns f r om l he firsl l o | us l
bef or e l he c oI umn seci f i ed as COLS TART are i ncI uded i n l he comar i s on.
Nnt c: The iniliaI sl ack si ze ( l hal i s, 4000 byl es) is onI y sui l abI e for smaI I fiIes
of I ess l han 200 I i nes or so. If you vanl lo sorl I arger f i I es, you mus l us e l he
S TACK c o mma nd l o i ncrease l he sl ack si ze, ho v muc h you shouI d i ncr ease l he
si ze is arl skiII and arl gues s vor k.
WARNI NG: The Ami ga vi I I crash if S TACK is l oo smaI I . If you are nol
sur e, il is bel l er lo over esl i mal e l he amounl you need.
JX)&<0#5N
5ORT tcxt TO snrtcd-tcxt
sorl s each I i ne of i nf or mal i on in " l e x l " aI habel i caI I y and I aces l he resuI l i n
" s or l ed- l exl " .
5ORT indcx TO snrtcd-indcx COL5TART 4
sorl s l he fiIe " i nde x " , vhe r e each record conl ai ns l he age numbe r i n l he firsl
l hree c oI umns and l he i ndex enl r y on l he resl of l he I i ne, and ul s l he oul ul
i n " s or l e d- i nde x" sorl ed by l he i ndex enl ry, and mal chi ng i ndex enl ri es sorl ed
by age numbe r .
,## )05:N X , S TACK
5TACK
R:2&)9N S T A C K | < n > j
!#&<0)9#N S TACK " S I ZI "
;/2<:5#N To di sI ay or sel l he sl ack si ze for c omma nds .
,<#D'>'D)9':.N
Wh e n you r un a r ogr am, il us es a cerl ai n a mounl of sl ack s ace. In mos l
cases, l he i ni li aI sl ack si ze, 4000 byl es , is suf f i ci enl , bul you can aI ler il us i ng
l he S TACK c omma nd. To do l hi s, you l ye S TACK f oI I oved by l he ne v sl ack
AMIGADO5 COMMAND5 81
vaI ue. You seci f y l he vaI ue of l he sl ack si ze i n byl es . S TACK aI one di sI ays
l he currenl I y sel sl ack si ze.
The onI y c omma nd l hal you vouI d nor maI I y ne e d l o aI ler l he sl ack si ze f or
i s l he S ORT c omma nd. Recur si ve c omma nds such as DI R ne e d an i ncr eased
sl ack if you us e l he m on a di recl ory sl rucl ure mor e l han aboul six I eveI s dee.
W A R N I N G : The onI y i ndi cal i on l hal you have r un oul of sl ack is l hal l he
Ami ga cr ashes! If you are nol sur e, il is bel l er l o over esl i mal e l he amounl
you ne e d.
JX)&<0#5N
STACK
di sI ays l he cur r enl sl ack si ze.
STACK 8 0 0 0
sel s l he sl ack lo 8000 byl es.
,## )05:N RUN, S ORT
5TATU5
R:2&)9N STATUS| <r oc e s s >j | IULLj | TCj | SIGSj | CLI +ALLj
!#&<0)9#N S TATUS " I ROCIS S , IULL/ S, TC/ S, SIGS/ S, CLI ALL/ S "
;/2<:5#N To di sI ay i nf or mal i on aboul l he currenl I y exi sl i ng CLI r oces s es .
,<#D'>'D)9':.N
S TATUS aI one I i sls l he number s of l he CLI r ocesses and l he r ogr am r unni ng
i n each.
IROCIS S seci f i es a r ocess numbe r and onI y gi ves i nf or mal i on aboul l hal
r oces s . Ol her vi s e, i nf or mal i on is di sI ayed aboul aII r oces s es .
IULL S IGS + TC + CLI
S IGS di sI ays l he name s of l he secl i ons on l he s e gme nl Iisl of each r oces s .
TC di sI ays i nf or mal i on aboul l he ri ori l y, sl acksi ze, and gI obaI vecl or si ze
of each r oces s.
Ior f ur l her del ai I s on sl ack and gI obaI vecl or si ze, see l he Ami g a DOS
Techni caI Ref er ence i n l hi s book.
CLI i denl i f i es Co mma nd Li ne I nl erf ace r ocesses and di sI ays l he secl i on
name( s ) of l he currenl I y I oaded c omma nd (if any) .
82
AMIGADO5 U5ER'5 MANUAL
JX)&<0#5N
STATUS
di sI ays bri ef i nf or mal i on aboul aII r oces s es .
STATUS 4 IULL
di sI ays fuII i nf or mal i on aboul rocess 4.
TYPE
R:2&)9N T YI I | I ROMj < n a me > | | T Oj < n a me > j | OI T N+Hj
!#&<0)9#N TYII " I ROM/ A, TO, OIT/ K"
;/2<:5#N To l ye a lexl fiIe or lo l ye a fiIe oul as hexadeci maI numbe r s .
,<#D'>'D)9':.N
TO i ndi cal es l he oul ul fiIe l hal you seci f y, if you omi l l hi s, oul ul is l o l he
cur r enl oul ul sl r eam, vhi c h me ans , i n mos l cases, l hal l he oul ul goes l o l he
cur r enl vi ndov.
Tabs l hal you have gi ven in l he fiIe are exanded. Hove ve r , l abs are nol
l real ed as seci aI by TYII, l he consoI e dri ver r ocesses l hem. To i nl errul
oul ul , r es s CTRL- C. To s us end oul ul , r ess l he sace bar or l ye any
ol her characl er. To r es ume oul ul , ress RITURN or CTRL- X.
OIT seci f i es an ol i on lo TYII. The firsl ol i on lo TYII is " n " , vhi c h
i ncI udes I i ne numbe r s i n l he oul ul .
The s econd ol i on you can gi ve TYII is " h . " Us e l he " h " ol i on lo vri l e oul
each vor d of l he I ROM fiIe as a hex number .
JX)&<0#5N
T YI I vo r k / r o g
di sI ays l he fiIe " vor k/ r og" .
TYI I vo r k / r o g OIT n
di sI ays l he fiIe " vor k/ r og" vi l h I i ne numbe r s .
TYII ob| / r og OIT h
di sI ays l he code sl ored i n " ob| / r og" i n hexadeci maI .
AMIGADO5 COMMAND5 83
WAIT
R:2&)9N WAI T <n>| SIC+SICSj | MI N+MI NSj | UNTI L < l i m e > j
!#&<0)9#N WAI T " , S I C SICS/ S, MI N MI NS/ S, UNTI L/ K"
;/2<:5#N To vai l for l he seci f i ed l i me.
,<#D'>'D)9':.N
You can us e WAI T i n c omma nd s equenc es or af l er RUN l o vai l f or a cerl ai n
er i od, or l o vai l unl i I a cerl ai n l i me of day. UnI es s you seci f y ol her vi s e, l he
vai l i ng l i me is one s ec ond.
The ar amel er shouI d be a numbe r , seci f yi ng l he numbe r of s ec onds (or
mi nul es , if MI NS is gi ven) lo vai l .
Us e l he ke yvor d UNTI L lo vai l unl i I a seci fi c l i me of day, gi ven i n l he
f or mal HH: MM.
JX)&<0#5N
WAI T
vai l s 1 s ec ond.
WAI T 1 0 MI NS
vai l s 10 mi nul es .
WAI T UNTI L 2 1 : 1 5
vai l s unl i I quarl er asl ni ne al ni ghl .
WHY
R:2&)9N W H Y
!#&<0)9#N W H Y
;/2<:5#N To exI ai n vhy l he r evi ous c omma nd fai I ed.
,<#D'>'D)9':.N
UsuaI I y vhe n a c omma nd faiIs l he scr een di sI ays a bri ef mes s age l hal s ome -
l hi ng ve nl vr ong. Thi s lyi caI I y i ncI udes l he na me of l he fiIe (if l hal vas l he
r obI em) , bul does nol go i nl o any mor e delai I . Ior examI e, l he c o mma nd
COPY Ircd TO
mi ghl faiI and di sI ay l he mes s age
84 AMIGADO5 U5ER'5 MANUAL
Cant npcn Ircd
Thi s couI d ha e n for a numbe r of r eas ons f or examI e, " f r e d " mi ghl aI ready
be a di recl ory, or l her e mi ghl nol be e nough sace on l he di sk l o oe n l he fi I e,
or il mi ghl be a r ead- onI y di sk. COI Y make s no di sl i ncl i on be l ve e n l hes e
cases, bec aus e usuaI I y l he us er knovs vhal is vr ong. Hove ve r , i mmedi al eI y
af l er you c ome across a c omma nd l hal has f ai I ed, you can l ye W H Y and r es s
RITURN l o di sI ay a muc h fuI I er me s s age , descri bi ng i n delai I vha l ve nl
vr ong.
JX)&<0#5N
TYII DI O:
cant npcn DFO:
W H Y
Last cnmmand Iai!cd bccausc nb|cct nnt nI rcquircd typc
W H Y gi ves you a hi nl aboul vhy your c omma nd f ai I ed. TYII DI O: fai I ed
bec aus e Ami ga DOS von' l Iel you l ye a devi ce.
,## )05:N IAULT
P3P %&'()*+, *#C#0:<#265 ?:&&).85
ALINK
R:2&)9N ALI NK| | I ROM+ ROOTj < f i I e na me > | , < f i I e na me > + + <f i I e name j j
| TO < n a m e > j | W I T H < na me > j | LI RARY+ LI < n a m e > j | MAI
< m a > j | X R I I < n a m e > j | W I D T H < n > j
!#&<0)9#N ALI NK " I R O M ROOT, TO/ K, WI TH/ K, VIR/ K, LI RARY LI / K,
MAI/ K, XRII/ K, WI DTH/ K"
;/2<:5#N To I i nk l ogel her secl i ons of code i nl o an execul abI e fiIe.
,<#D'>'D)9':.N
ALI NK i nsl r ucl s Ami g a DOS l o I i nk fi I es l ogel her . Il aI so handI e s aul o-
mal i c I i brary r ef er ences and bui I ds overI ay fi I es. The oul ul f r om ALI NK
is a fiIe I oaded by l he I oader and r un unde r l he over I ay s uer vi s or , if
r equi r ed.
Ior del ai I s and a fuII seci f i cal i on of l he ALI NK c omma nd, see Chal er 4 of
l he %&'()*+, *#C#0:<#265 -)./)0 i n lhi s book.
AMIGADO5 COMMAND5 85
JX)&<0#5N
AL I NK a + b + c TO oul ul
I i nks l he fiIes " a " , " b " , and " c " , r oduci ng an oul ul fiIe " o ul ul " .
A55EM
R:2&)9N AS S I M| I ROG+ I ROMj < r o g > | - 0 < c o d e > j | - V < v e r > j | - L < I i s l i n g > j
|-Ij |-C+OIT < o l > j | - I < di r I i s l > j
!#&<0)9#N AS S IM " I ROG IROM/ A, - 0/ K, - V/ K, - L/ K, - H/ K, - I/ K, - C OIT/ K, - I / K"
;/2<:5#N To as s embI e a r ogr am i n MC68000 as s embI y I anguage.
,<#D'>'D)9':.N
AS S IM as s embI es r ogr ams i n MC68000 as s embI y I anguage. See Chal er 3 of
l he %&'()*+, *#C#0:<#265 -)./)0 i n l hi s book f or del ai I s.
I ROG is l he sour ce fiIe.
- O is l he ob| ecl fiIe (l hal i s, bi nar y oul ul f r om l he as s embI er ) .
- V is l he fiIe f or mes s ages . ( UnI ess you seci f y - V, mes s ages go lo l he
l er mi naI . )
- L is l he I i sl i ng fi I e.
- C seci f i es ol i ons lo l he assembI er .
- H is a header fiIe vhi c h can be r ead as if i nserl ed al l he f ronl of l he
sour ce (Iike I NCLUDI i n l he source i lseI f) .
-I sel s u a Iisl of di recl ori es l o be sear ched for i ncI uded fi I es.
-I is l he fiIe l hal recei ves l he " e qua l e s " di recl i ve ( IQU) as s i gnmenl s
f r om your sour ce. You us e - I lo gener al e a header fiIe conl ai ni ng
l hes e di recl i ves.
The ol i ons you can seci f y vi l h OIT or - C are as f oI I ovs:
S r oduc e a s ymboI l abI e dum as arl of l he ob| ecl fi I e.
X r oduce a cross- ref erence fi I e.
W < s i z e > sel vor ks ac e lo < s i z e > .
JX)&<0#5N
A55EM prng.asm TO prng.nb|
as s embI es l he sour ce r ogr am i n " r o g . a s m" , I aci ng l he resuI l i n l he fiIe
" r o g . o b | " . Il vri l es any error mes s ages l o l he l ermi naI , bul does nol r oduc e
any as s embI y I i sli ng.
86 AMIGADO5 U5ER'5 MANUAL
AS S I M r o g . a s m TO r og. ob| - h s I i b - 1 r og- I i s l
as s embI es l he s ame r ogr am lo l he s ame oul ul , bul i ncI udes l he fiIe " s I i b " i n
l he as s embI y, and I aces an as s embI y I i sli ng i n l he fiIe " r og- I i s l " .
AS S I M f oo. a s m -o f oo. ob| ol v 8 0 0 0
as s embI es a C#2= smaI I r ogr am.
DOWNLOAD
!#&<0)9#N D O W N L O A D " I ROM/ A, TO/ A"
;/2<:5#N To dovnI oad r ogr ams lo l he Ami ga.
,<#D'>'D)9':.N
The c omma nd D O W N L O A D dovnI oads r ogr ams vri l l en on anol her c om-
ul er (for examI e, a Sun) lo l he Ami ga.
To us e D O W N L O A D , you mus l have a i I I oard. The n, lo dovnI oad your
I i nked I oad fiIe f r om l he Sun lo l he Ami ga, you l ye on l he Sun:
b i nI o a d - &
(lhi s onI y needs lo be done onc e) , l hen l ye on l he Ami ga:
dovnI oa d < s u n f i I e na me > < a mi g a f i I e na me >
( ef ore you bool your Sun, you mus l make sure l hal bol h l he i I I oard and
Ami ga are aI ready on and ove r e d u, ol her vi s e l hey von' l be r ecogni zed by
l he Sun. ) The < s u n f i I e na me > by convenl i on shouI d e nd vi l h . Id. Onc e
you' ve done l hi s, lo r un l he r ogr am, you l ye l he < a mi g a f i I e na me > .
Nol e l hal l he c omma nd " bi nI oa d" is nol an Ami ga DOS c omma nd. You us e
bi nI oad on a Sun lo I oad fiIes i n bi nar y for dovnI oadi ng lo your Ami ga.
Nol e l hal D O W N L O A D aI vays accesses fiIes on l he Sun reI al i ve lo l he
di recl ory i n vhi c h bi nI oad vas sl arl ed. If you cannol r e me mbe r l he di recl ory
i n vhi c h bi nI oad vas sl arl ed, you mus l seci f y l he fuII na me . To sl o bi nI oad
on l he Sun, you can do a " s " and l hen a " ki I I " on ils II D. Nol e l hal l he sofl
r esel of l he c omul er leI I s bi nI oad lo vri l e a mes s age l o ils sl andar d oul ul
( l he def auI l bei ng l he vi ndov vher e il sl arl ed) . If D O W N L O A D hangs , r ess
CTRL- C l o kiII il.
Chal er 1 of l he %&'()*+, *#C#0:<#265 -)./)0 i n lhi s book descri bes i n delai I
ho v l o dovnI oad r ogr ams f r om an I M IC lo Ami ga, f r om l he Sun l o l he
Ami ga, and even gi ves s ome hi nl s on ho v lo dovnI oad f r om uns uor l ed
c omul er s .
AMIGADO5 COMMAND5 87
JX)&<0#5N
b I nI o a d - &
dovnI oa d l es l . I d l es l .
or
dovnI oa d / usr7f red/ DOS/ l esl . I d l e s l
l hen l ye l he f oI I ovi ng:
l e s l
Th e s e c o mma n d s dovnI oa d l he s ec i f i ed S un f i I e name s l o l he Ami ga
f i I enames.
READ
!#&<0)9#N RIAD " TO/ A, S IRI AL/ S "
;/2<:5#N RIAD r eads dal a f r om l he araI I eI orl or seriaI I i ne and sl ores il i n
a fi I e.
,<#D'>'D)9':.N
The c omma nd RIAD I i sl ens l o l he araI I eI orl and execl s a s l r eam of
hexadeci maI characl ers. If you ress l he SIRI AL svi l ch, RIAD I i sl ens, i ns l ead,
l o l he seri aI I i ne. Iach hex ai r is sl ored as a byl e i n me mor y. RIAD r ecogni zes
Q as l he hex s l r eam l er mi nal or. RIAD aI so r ecogni zes l he ASCI I di gi l s 0 - 9 and
l he cai laI I el l ers A l hr ough I. RIAD i gnor es saces, ne v I i nes, and l abs. You
mus l s e nd an ASCI I hex di gi l f or ever y ni bbI e, and you mus l ha ve an e ve n
numbe r of ni bbI es. Whe n l he sl r eam is comI el e, RIAD vri l es l he byl es f r om
me mor y lo l he di sk fiIe you seci f i ed.
Nol e: You can us e lhi s c omma nd lo l ransf er bi nar y or l exl fi I es.
W A R N I N G 1: e caref uI vhe n RIADi ng lo l he s ame fiIe l vi ce. RIAD
overvri l es l he ori gi naI conl enl s l he s econd l i me.
W A R N I N G 2: You ma y I ose characl ers if you us e hi gh baud ral es vi l h
l he seri aI connecl i on.
JX)&<0#5N
RIAD TO df O: nev
88 AMIGADO5 U5ER'5 MANUAL
RIADs l o l he fiIe " df O: nev" f r om l he araI I eI orl .
RIAD n e v S IRI AL
RIADs l o l he fiIe " n e v " f r om l he seri aI I i ne.
P3Q %&'()*+, ?:&&).85 a/'DM G#>#2#.D# ?)28
45#265 ?:&&).85
R'0# 49'0'9'#5
2
!"
COPY
DELETE
DI R
ED
EDI T
FI LENOTE
J OI N
LI 5T
MAKE DI R
PROTECT
RE NAME
5EARCH
5ORT
TYPE
c omme nl characl er.
di recl c omma nd i nul and oul ul resecl i veI y.
coi es one fiIe l o anol her or coi es aII l he fiIes f r om one
di recl ory l o anol her .
deI el es u lo 10 fiIes or di recl ori es.
s hovs f i I enames i n a di recl ory.
enl er s a scr een edi l or f or lexl fi I es.
enl er s a I i ne by I i ne edi l or.
al l aches a nol e vi l h a ma x i mum of 80 characl ers l o a seci f i ed
fi I e.
concal enal es u lo 15 fiIes l o f or m a ne v fi I e.
exami nes and di sI ays del ai I ed i nf or mal i on aboul a fiIe or
di recl ory.
creal es a di recl ory vi l h a seci f i ed name ,
sel s a fi I e' s rol ecl i on sl al us,
r enames a fiIe or di recl ory.
I ooks for a seci f i ed lexl sl ri ng i n aII l he fiIes of a di recl ory,
sorl s si mI e fi I es.
l yes a fiIe lo l he scr een l hal you can ol i onaI I y seci f y as
l exl or hex.
?BH ?:.92:0
BREAK sel s al l enl i on fI ags i n a gi ven r ocess.
CD sel s a currenl di recl ory and/ or dri ve.
ENDCLI ends an i nl eracl i ve CLI r ocess.
NEWCLI creal es a ne v i nl eracl i ve CLI r oces s .
P ROMP T c hanges l he r oml i n l he currenl CLI .
RUN execul es c omma nds as bac kgr ound r ocesses .
5TACK di sI ays or sel s l he sl ack si ze f or c omma nds .
AMIGADO5 COMMAND5
89
5TATU5 di sI ays i nf or mal i on aboul l he CLI r oces s es currenl I y i n
exi sl ence.
W H Y exI ai ns vhy a r evi ous c omma nd f ai I ed.
?:&&).8 ,#b/#.D# ?:.92:0
E CHO di sI ays l he mes s age seci f i ed i n a c o mma nd ar gumenl .
EXECUTE execul es a fiIe of c omma nds .
FAI LAT faiIs a c o mma nd s equenc e if a r ogr am r el ur ns an error c ode
greal er l han or equaI l o l hi s numbe r .
IF l esl s seci f i ed acl i ons vi l hi n a c omma nd s equenc e.
LAB def i nes a I abeI ( see SKI I) .
QUI T exi l s f r om a c omma nd s equence vi l h a gi ven error code.
5KI P | ums f or var d lo LA i n a c omma nd s equenc e ( see LA) .
WAI T vai l s f or, or unl i I , a seci f i ed l i me.
,=59#& ).8 ,9:2)(# -).)(#&#.9
A55I GN assi gns a I ogi caI devi ce na me lo a fiIing s ys l em di recl ory.
DATE di sI ays or sel s l he s ys l em dal e and lime.
DI 5KCOPY coi es l he conl enl s of one enl i re f I oy di sk l o anol her .
FAULT di sI ays mes s ages cor r es ondi ng lo suI i ed f auI l or error
c odes .
F ORMAT f ormal s and i ni li aI i zes a ne v 3V2-inch f I oy di sk.
I NFO gi ves i nf or mal i on aboul l he fi I i ng s ys l em.
I N5TALL make s a f or mal l ed di sk bool abI e.
RELABEL c hanges l he voI ume na me of a di sk.
*#C#0:<#265 ?:&&).85
*#C#0:<&#.9 ,=59#&
ALI NK I i nks secl i ons of code i nl o a fiIe f or execul i on ( see } OI N) .
A55EM as s embI es MC68000 I anguage.
D O W N L O A D dovnI oads r ogr ams lo l he Ami ga.
READ r eads i nf or mal i on f r om l he araI I eI or l or seri aI I i ne a nd
sl ores il i n a fi I e.
?")<9#2 Q
IDThe Screen Idilor
Thi s chal er descri bes ho v lo us e l he scr een edi l or ID. You can us e l hi s
r ogr am l o aI ler or creal e l exl fi I es.
3. 1 I nl r oduci ng ID
3. 2 I mmedi al e Co mma nds
3. 2. 1 Cur s or Conl r oI
3. 2. 2 I nser l i ng Texl
3. 2. 3 DeI el i ng Texl
3. 2. 4 ScroI I i ng
3. 2. 5 Reeal i ng Co mma nds
3. 3 Ixl ended Co mma nds
3. 3. 1 Ir ogr am Conl r oI
3. 3. 2 I ock Conl r oI
3. 3. 3 Movi ng l he Cur r enl Cur sor Iosi l i on
3. 3. 4 Sear chi ng and Ixchangi ng
3. 3. 5 AI l er i ng Texl
3. 3. 6 Reeal i ng Co mma nds
Qui c k Ref er enc e Car d
Q3O H.92:8/D'.( J*
You can us e l he edi l or ID lo creal e a ne v fiIe or lo aIler an exi sli ng one. You di s-
I ay lexl on l he screen, and you can scroII il verlicaIIy or hori zonlaI I y, as requi red.
ID accel s l he f oI I ovi ng l emI al e:
ID " IROM/ A, SI ZI/ K"
Ior examI e, lo caII ID, you l ye
ID f r e d
EDTHE 5CREEN EDITOR
91
ID make s an al l eml lo oen l he fiIe you have seci f i ed as " f r e d" ( l hal i s, l he
I R O M fi I e), and if lhi s s ucceeds , l hen ID r eads l he fiIe i nl o me mor y a nd
di sI ays l he firsl I i nes on l he scr een. Ol her vi s e, ID r ovi des a bI ank s cr een,
r eady for l he addi l i on of ne v i nf or mal i on. To aI ler l he l exl buf f er l hal ID us es
lo hoI d l he fi I e, you seci f y a sui l abI e vaI ue af l er l he SI ZI ke yvor d, f or
examI e,
ED Ircd 5IZE 45000
The i ni li aI si ze is bas ed on l he si ze of l he fiIe you edi l , vi l h a mi ni mum of
40, 000 byl es .
Nnt c: You c annol edi l ever y ki nd of fiIe vi l h ID. Ior examI e, ID does nol
accel s our ce fi I es conl ai ni ng bi nar y c ode . To edi l fiIes s uc h as l he s e , you
s houI d us e l he edi l or IDI T.
WARNI NG: ID aI vays aends a I i nef eed even if l he fiIe does nol e nd
vi l h one.
Wh e n I D is r unni ng, l he bol l om I i ne of l he scr een is a me s s age area a nd
c omma nd I i ne. Irror mes s ages aear her e and r emai n unl i I you gi ve anol her
ID c omma nd.
ID c omma nds faII i nl o l vo cal egori es:
i mmedi al e c omma nds
exl ended c omma nds
Yo u us e i mme di al e c o mma nds i n i mmcdi at c mn dc , you us e e xl e nde d
c omma nds i n cxt cndcd mndc. ID i s aI ready i n i mmedi al e mode vh e n you
sl arl edi l i ng. To enl er exl ended mode , you r ess l he ISC key. The n, af l er
ID has exec ul ed l he c o mma nd I i ne, il r el ur ns aul omal i caI I y l o i mmedi al e
mode .
In i mmedi al e mode , ID execul es c omma nds ri ghl avay. You seci f y an
i mmedi al e c o mma nd vi l h a si ngI e key or conl roI key combi nal i on. To i ndi cal e
a conl roI key combi nal i on, you r ess and hoI d dovn l he CTRL key vhi I e you
l ye l he gi ven I el l er, so l hal CTRL- M, f or examI e, me a ns hoI d do vn CTRL
vhi I e you l ye M.
I n exl ended mode , anyl hi ng you l ye aear s on l he c o mma nd I i ne. ID
does nol execul e c omma nds unl i I you f i ni sh l he c omma nd I i ne. You ma y l ye
a numbe r of exl ended c omma nds on a si ngI e c omma nd I i ne. You ma y aI so
gr ou any c omma nds l ogel her and even gel ID l o reeal l he m aul omal i caI I y.
Mos l i mmedi al e c omma nds have a mal c hi ng exl ended ver si on.
92
AMIGADO5 U5ER'5 MANUAL
ID al l eml s lo kee l he scr een u l o dal e. Hove ve r , if you enl er a f url her
c o mma nd vhi I e il is al l eml i ng lo r edr av l he di sI ay, ID execul es l he c om-
ma nd al once and udal es l he di sI ay vhe n l here is l i me. The cur r enl I i ne is
aI vays di sI ayed firsl and is aI vays u lo dal e.
!"# H&&#8')9# ?:&&).85
Thi s secl i on descri bes l he l ye of c omma nds l hal ID execul es i mmedi al eI y.
I mmedi al e c omma nds deaI vi l h l he f oI I ovi ng:
cur sor conl roI
l exl i nser l i on
l exl deI el i on
l exl scroI I i ng
reel i l i on of c omma nds
Q3P3O ?/25:2 ?:.92:0
To move l he cursor one osi l i on i n any di recl i on, you r ess l he ar or i al e
cur sor conl roI key. If l he cursor is on l he ri ghl ha nd edge of l he scr een, ID
scroI I s l he l exl l o l he I efl l o ma ke l he resl of l he l exl vi si bI e. ID scroI I s
verl i caI I y a I i ne al a l i me and hori zonl aI I y l en characl ers al a l i me. Yo u c annol
move l he cursor off l he l o or bol l om of l he fi I e, or off l he Iefl ha nd edge of
l he l exl .
CTRL- j , l hal i s, CTRL and l he squar e cI osi ng br ackel " j " l akes l he cursor lo
l he ri ghl ha nd edge of l he currenl I i ne unI es s l he cursor is aI ready l her e. Wh e n
l he cur sor is aI ready al l he ri ghl hand edge, CTRL- j moves il bac k lo l he I efl
ha nd edge of l he I i ne. The l exl is scroI I ed hori zonl aI I y, if r equi r ed. In a si mi I ar
f ashi on, CTRL- I I aces l he cursor al l he slarl of l he firsl I i ne on l he scr een
unI es s l he cur sor is aI ready l her e. If l he cursor is aI ready l her e, CTRL- I I aces
il al l he e nd of l he I asl I i ne on l he scr een.
CTRL- T l akes l he cursor lo l he slarl of l he nexl vor d. CTRL- R l akes l he
cur sor l o l he sace f oI I ovi ng l he r evi ous vor d. In l hes e l vo cases , l he l exl is
scroI I ed verli caI I y or hori zonl aI I y, as r equi r ed.
The TA key move s l he cursor l o l he nexl l ab osi l i on, vhi c h is a muI l i I e
of l he l ab sel l i ng (iniliaIIy 3) . Il does NOT i nserl TA characl ers i nl o l he fi I e.
3. 2. 2 H.5#29'.( !#X9
Whi I e i n i mmedi al e mode , ID is aI so i n I NSIRT mode so any ordi nar y
characl ers you l ye viII be i nserl ed al l he cur r enl cursor osi l i on. I D has no
l ye- over mode . To reI ace a vor d or I i ne, you mus l deI el e l he desi r ed
EDTHE 5CREEN EDITOR
93
conl enl s and i nserl ne v i nf or mal i on i n ils I ace. Any I el l er l hal you l ye i n
i mmedi al e mo de aear s al l he currcnt cursnr pnsi t i nn unI es s l he I i ne i s l oo
I ong ( l here is a ma x i mum of 255 characl ers i n a I i ne) . If you l ry l o ma ke a I i ne
I onger l han l he ma x i mum I i mi l , ID r ef uses l o add anol her char acl er and
di sI ays l he f oI I ovi ng mes s age:
Linc tnn !nng
Hove ve r , on shorl er I i nes, ID move s any characl ers l o l he ri ghl of l he
cur sor l o ma ke r oom f or l he n e v l exl . If l he I i ne exceeds l he si ze of l he s cr een,
l he I efl ha nd e nd of l he I i ne di saear s f r om vi ev. The n ID r edi sI ays l he e nd
of l he I i ne by scroI I i ng l he l exl hori zonl aI I y. If you move l he cur sor be yond l he
e nd of l he I i ne, f or examI e, vi l h l he TA or cur sor conl roI keys , I D i nser l s
saces be l ve e n l he e nd of l he I i ne and any n e v characl er you i nserl .
To sI i l l he cur r enl I i ne al l he cursor and gener al e a ne v I i ne, r ess RI-
TURN. If l he cur sor is al l he end of a I i ne, ID creal es a ne v bI ank I i ne af l er l he
cur r enl one. AI l ernal i veI y, you ress CTRL- A lo gener al e a bI ank I i ne af l er l he
cur r enl one , vi l h no sI i l of l he cur r enl I i ne l aki ng I ace. I n ei l her cas e, l he
cur sor aear s on l he ne v I i ne al l he osi l i on i ndi cal ed by l he I efl mar gi n
(i ni li aI I y, c oI umn one) .
To ens ur e l hal I D gi ves a carri age r el ur n aul omal i caI I y al a cerl ai n osi l i on
on l he s cr een, you can sel u a ri ghl mar gi n. Onc e you have done l hi s,
vhe ne ve r you l ye a I i ne l hal exceeds l hal mar gi n, ID e nds l he I i ne bef or e l he
I asl vor d and move s l he vor d and l he cursor dovn onl o a n e v I i ne. Thi s i s
caI I ed " vo r d vr a . " ( Nol e l hal if you have a I i ne vi l h no s aces , ID von' l
k no v vhe r e l o br eak l he " v o r d " a nd l he aul omal i c mar gi n c annol vor k
r oer I y. ) I n del ai I , if you l ye a characl er and l he cur sor is al l he e nd of l he
I i ne and al l he ri ghl mar gi n osi l i on, l hen ID aul omal i caI I y gener al es a n e v
I i ne. UnI es s l he characl er you l yed vas a s ace, I D move s dovn l he haI f
c omI el ed vor d al l he end of l he I i ne l o l he nevI y gener al ed I i ne. Hove ve r , if
you i nserl s ome l exl vhe n l he cursor is N O T al l he e nd of a I i ne ( l hal i s, vi l h
l exl aI ready l o l he ri ghl of l he cur sor ) , l hen sel l i ng a ri ghl mar gi n does nol
vor k. Ini li aI I y, l he ri ghl mar gi n is sel u al c oI umn 79. You can l ur n off, or
" di s a bI e " , l he ri ghl mar gi n vi l h l he IX c o mma nd. ( Ior f ur l her del ai I s on
sel l i ng mar gi ns , see Secl i on 3 . 3 . 1 , " Ir ogr a m Conl r oI " . )
If you l ye s ome l exl i n l he vr ong case (for examI e, i n I over case i ns l ead of
ue r case) , you c an correcl il vi l h CTRL- I, To do l hi s, you move l he cur sor l o
oi nl al l he I el l er you vanl lo c hange and l hen ress CTRL- I. If l he I el l er i s i n
I over case, CTRL- I fIis l he I el l er i nl o uer case. On l he ol her ha nd, if l he
I el l er is i n uer cas e, CTRL- I fIis il i nl o I over case. Hove ve r , if l he cur sor
oi nl s al s omel hi ng l hal is nol a I el l er (for examI e, a sace or s ymboI ) ,
CTRL- I does nol hi ng lo il.
CTRL- I nol onI y fIis I el l ers' cases bul il aI so move s l he cur sor one I ace l o
94
AMIGADO5 U5ER'5 MANUAL
l he ri ghl ( and il move s l he cursor even if l here is no case l o f I i ). So l hal , af l er
you have c hange d l he case of a I eller vi l h CTRL- I, l he cursor move s ri ghl l o
oi nl al l he nexl characl er. If l he nexl characl er is a I el l er, you can r ess
CTRL- I agai n l o c hange ils case, you can l hen r eeal l he c o mma nd unl i I you
ha ve c hange d aII l he I el l ers on l he I i ne. ( Nol e l hal if you c onl i nue l o r es s
CTRL- I af l er l he I asl I el l er on l he I i ne, l he cursor kees movi ng ri ghl eve n
l hough l her e is nol hi ng Iefl l o c hange. ) Ior examI e, if you had l he I i ne
Th e Wa I r us a n d l h e Ca r e nl e r ve r e va I k i n g h a n d i n h a n d
and you kel CTRL- I r es s ed dovn, l he I i ne vouI d be c ome
l h e va I r u s a n d l h e c a r e n l e r ve r e va I k i n g h a n d i n h a n d
On l he ol her ha nd, l he f oI I ovi ng I i ne:
I I < f i I e > < = x
be c ome s
i f < I I L I > < X
vhe r e l he I el l ers c hange case and l he symboI s r emai n l he s ame.
3. 2. 3 *#0#9'.( !#X9
The ACKS IACI ke y deI el es l he characl er lo l he Iefl of l he cur sor and move s
l he cur sor one osi l i on I efl unI es s il is al l he begi nni ng of a I i ne. ID scroI I s l he
l exl , if r equi r ed. The DIL key deI el es l he characl er al l he cur r enl cur sor
osi l i on vi l houl movi ng l he cursor. As vi l h any deI el i on, characl er s r emai n-
i ng on l he I i ne shi f l back, and l exl l hal vas i nvi si bI e be yond l he ri ghl ha nd
edge of l he scr een be c ome s vi si bI e.
The acl i on of CTRL- O de e nds on l he characl er al l he cursor. If l hi s charac-
l er is a s ace, l he n CTRL- O deI el es aII saces u l o l he nexl nons a c e
char acl er on l he I i ne. Ol her vi s e, il deI el es characl ers f r om l he cur sor , and
move s l exl I efl, unl i I a sace occur s.
CTRL- Y deI el es aII characl er s f r om l he cursor l o l he e nd of l he I i ne.
CTRL- deI el es l he enl i re currenl I i ne. You ma y us e exl ended c omma nds l o
deI el e bI ocks of l exl .
EDTHE 5CREEN EDITOR 95
3. 2. 4 ,D2:00'.(
esi des verli caI I y scroI I i ng one I i ne al a l i me by movi ng l he cur sor l o l he e dge
of l he scr een, you can verl i caI I y scroI I l he l exl 12 I i nes al a l i me vi l h l he conl roI
keys CTRL- U and CTRL- D.
CTRL- D move s l he cursor lo r evi ous I i nes, vhi I e scroI I i ng l he l exl dovn,
CTRL- U scroI I s l he l exl u and move s l he cursor lo I i nes f ur l her on i n l he fi I e.
CTRL- V r ef r eshes l he enl i re scr een, vhi c h is usef uI if anol her r ogr am
bes i des l he edi l or aI lers l he scr een. Hove ve r , i n l yi caI us e , me s s age s f r om
ol her r oces s es aear i n l he vi ndov be hi nd l he edi l or vi ndov.
3. 2. 5 G#<#)9'.( ?:&&).85
The edi l or r e me mbe r s any exl ended c omma nd I i ne you l ye. To execul e l hi s
sel of exl ended c omma nds agai n al any l i me, r ess CTRL- G. I n l hi s vay, you
can sel u a search c omma nd as an exl ended c omma nd. If l he firsl occur r ence
of a sl ri ng i s nol l he one you ne e d, r es s CTRL- G lo r eeal l he sear ch. You can
sel u and execul e comI ex sel s of edi l i ng c omma nds ma ny l i mes.
Nol e: Wh e n you gi ve an exl ended c omma nd as a c o mma nd gr ou vi l h a
reel i l i on counl , ID r eeal s l he c omma nds i n l he gr ou l hal numbe r of l i mes
each l i me you r ess CTRL- G. See l he nexl secl i on f or mor e del ai I s on exl ended
c omma nds .
!"! JX9#.8#8 ?:&&).85
Thi s secl i on descri bes l he c omma nds avai I abI e l o you i n exl ended mode . The s e
c omma nds cover:
r ogr am conl roI
bI ock conl roI
move me nl
sear chi ng l exl
exc hangi ng l exl
aI l eri ng l exl
i nser l i ng l exl
To enl er exl ended c omma nd mode , ress l he ISC key. Subs e que nl i nul
l he n aear s on l he c omma nd I i ne al l he bol l om of l he scr een. You can correcl
mi sl akes vi l h ACKS IACI i n l he nor maI vay. To l er mi nal e l he c o mma nd
I i ne, r ess ei l her ISC or RITURN. If you r ess ISC, l he edi l or r emai ns i n
exl ended mode af l er execul i ng l he c omma nd I i ne. On l he ol her ha nd, if you
r ess RITURN, il reverl s l o i mmedi al e mode . To I eave l he c o mma nd I i ne
96
AMIGADO5 U5ER'5 MANUAL
e ml y, | us l r ess RITURN af l er r essi ng IS C l o go back lo i mmedi al e mode .
I n l hi s c as e, I D r el ur ns l o i mmedi al e c omma nd mo de .
Ixl ended c omma nds consi sl of one or l vo I el l ers, vi l h ue r and I over case
cons i der ed l he s ame. You can gi ve muI l i I e c omma nds on l he s ame c o mma nd
I i ne by s ear al i ng l he m vi l h a semi coI on. Co mma nds are s omel i mes f oI I oved
by an ar gumenl , s uch as a numbe r or a sl ri ng. A sl ri ng i s a s equenc e of I el l ers
i nl r oduced and l er mi nal ed by a deI i mi l er, vhi c h is any characl er excel I el l ers,
numbe r s , s ace, semi coI on, or br ackel s. Thus , vaI i d sl ri ngs mi ghl be:
/happy/
!23 Icct!
.Hc!!n!: " W
Mos l i mmedi al e c omma nds have a cor r es ondi ng exl ended ver si on. Se e
l he TabI e of Ixl ended Co mma nds al l he e nd of lhi s chal er f or a comI el e
Iisl.
Q3Q3O ;2:(2)& ?:.92:0
Thi s secl i on r ovi des a seci f i cal i on of l he r ogr am conl roI c omma nds X
( eXi l ) , Q ( Qui l ) , S A ( SAve) , U ( Undo) , S H ( SHov) , S T ( Sel Tab) , SL a nd SR
( Sel Lef l and Sel Ri ghl ) , and IX ( IXl end) .
To i nsl rucl l he edi l or l o exi l , you us e l he c omma nd X. Af l er you have gi ven
l he exi l c o mma nd, I D vri l es oul l he l exl il i s hoI di ng i n me mo r y l o l he
oul ul , or desl i nal i on fiIe and l hen l er mi nal es . If you I ook al l hi s fi I e, you can
see l hal aII l he c hanges you ma de are l her e.
I D aI so vr i l es a l emor ar y bac ku l o : T/ ID- ACKUI. Thi s bac ku fiIe
r emai ns unl i I you exil f r om ID agai n, al vhi ch l i me, ID over vr i l es l he fiIe
vi l h a n e v bac ku.
To gel oul of l he edi l or vi l houl keei ng any c hanges , you us e l he Q
c o mma nd. Wh e n you us e Q, ID l er mi nal es i mmedi al eI y vi l houl vri l i ng lo l he
buf f er and di scards any c hanges you have made. ecause of l hi s, if you have
aI l ered l he c onl enl s of l he fi I e, ID asks you lo conf i r m l hal you reaI I y vanl lo
qui l .
A f ur l her c o mma nd I els you lo l ake a " s na s ho l " coy of l he fiIe vi l houl
c omi ng oul of ID. Thi s is l he SA c omma nd. SA saves l he l exl l o a na me d fiIe
or, i n l he abs enc e of a na me d fi I e, lo l he cur r enl fi I e. Ior examI e,
5A !:dnc/savcdtcxt!
or
5A
EDTHE 5CREEN EDITOR 97
S A is arl i cuI arI y usef uI i n geograhi caI areas sub| ecl l o ove r f ai I ure or
sur ge.
Hi nt : S A f oI I oved by Q is equi vaI enl lo l he X c omma nd.
If you make any aI l eral i ons be l ve e n l he SA and l he Q c omma nds , l he
f oI I ovi ng mes s age aear s:
Edits wi!! bc !nsttypc Y tn cnnIirm:
If you have ma de no aI l eral i ons, ID qui l s i mmedi al eI y vi l h l he c onl enl s of
your sour ce fiIe unc hange d. SA is aI so usef uI becaus e il aI I ovs you l o seci f y a
f i I ename ol her l han l he cur r enl one. Il is l heref ore ossi bI e l o ma ke coi es al
di f f erenl sl ages and I ace l he m i n di f f erenl fiIes or di recl ori es.
To undo l he I asl c hange, you us e l he U c omma nd. The edi l or ma ke s a c oy
of l he I i ne l he cur sor is on, and l hen il modi f i es l hi s coy vhe ne ve r you add or
deI el e char acl er s. ID ul s l he c hanged c oy back i nl o l he fiIe vh e n you move
l he cur sor of f l he currenl I i ne ( ei l her by cursor conl roI , or by deI el i ng or
i nser l i ng a I i ne) . ID aI so r eI aces l he coy vh e n il er f or ms a ny scroI I i ng
ei l her verli caI I y or hori zonl aI I y. The U c omma nd di scards l he c hange d coy
and us es l he oI d ver si on of l he cur r enl I i ne i nsl ead.
W A R N I N G : ID does nol undo a I i ne deI el i on. Onc e you have mo ve d
f r om l he cur r enl I i ne, l he U c omma nd cannol fix l he me s s you have gol
your seI f i nl o.
To s hov l he cur r enl sl al e of l he edi l or, you us e l he S H c omma nd. The
scr een di sI ays i nf or mal i on such as l he vaI ue of l ab s l os , cur r enl mar gi ns ,
bI ock mar ks , and l he na me of l he fiIe bei ng edi l ed.
Tabs are i ni li aI Iy sel al ever y l hr ee c oI umns . To c hange l he cur r enl sel l i ng of
l abs, you us e l he ST c omma nd f oI I oved by a numbe r " n " , vhi c h sel s l abs al
ever y " n " c oI umn.
To sel l he Iefl mar gi n and ri ghl mar gi n, you us e l he SL and SR c omma nds ,
agai n f oI I oved by a numbe r i ndi cal i ng l he coI umn osi l i on. The I efl mar gi n
s houI d nol be sel be yond l he vi dl h of l he scr een.
To exl end mar gi ns , you us e l he IX c omma nd. Onc e you have gi ven IX, ID
l akes no accounl of l he ri ghl mar gi n on l he cur r enl I i ne. Onc e you move l he
cur sor f r om l he cur r enl I i ne, ID l urns l he mar gi ns on agai n.
3. 3. 2 W0:DM ?:.92:0
To move , i nserl , or deI el e l exl , you us e l he bI ock conl roI c omma nds descr i bed
i n l hi s secl i on.
You c an i denl i f y a bI ock of lexl vi l h l he S (I ock Sl arl ) and I ( I ock Ind)
98
AMIGADO5 U5ER'5 MANUAL
c omma nds . To do l hi s, move l he cursor lo anyvher e on l he firsl I i ne l hal
you vanl i n l he bI ock and gi ve l he S c omma nd. Then, move l he cursor l o l he
I asl I i ne l hal you vanl i n l he bI ock, us i ng l he cursor conl roI c omma nds or a
sear ch c omma nd, and gi ve l he I c omma nd lo mar k l he e nd of l he bI ock.
Nol e: Onc e you have def i ned a bI ock vi l h S and I, if you ma ke ANY
c hange l o l he l exl , l he slarl and end of l he bI ock be c ome undef i ned once mor e.
The onI y excel i on l o lhi s is if you us e I ( Inserl I ock) .
To i denl i f y one I i ne as l he cur r enl bI ock, move lo l he I i ne you vanl , r es s
IS C, a nd l ye:
S , I
The cur r enl I i ne l hen be c ome s l he cur r enl bI ock.
Nol e: You c annol slarl or f i ni sh a bI ock i n l he mi ddI e of a I i ne. To do l hi s,
you mus l firsl sI i l l he I i ne by r essi ng RITURN.
Onc e you have i denl i f i ed a bI ock, you can move a coy of il i nl o anol her arl
of l he fiIe vi l h l he I ( I nserl I ock) c omma nd. Wh e n you gi ve l he I c om-
ma nd, ID i nser l s a c oy of l he bI ock i mmedi al eI y af l er l he cur r enl I i ne. Yo u
c an i nserl mor e l han one c oy of l he bI ock, as il r emai ns def i ned unl i I you
c hange l he l exl , or deI el e l he bI ock.
To deI el e a bI ock, you us e l he D ( DeI el e I ock) c omma nd. D deI el es l he
bI ock of l exl you def i ned vi l h l he S and I c omma nds . Hove ve r , vhe n you
have deI el ed l he bI ock, l he bI ock slarl and e nd vaI ues be c ome undef i ned. Thi s
me a ns l hal you CANNOT deI el e a bI ock and l hen i nserl a coy of il ( D
f oI I oved by I ) , hove ve r , you c an i nserl a c oy of l he bI ock and l hen deI el e
l he bI ock (I f oI I oved by D) .
You can aI so us e bI ock mar ks lo r e me mbe r a I ace i n a fi I e. The S ( Shov
I ock) c o mma nd r esel s l he scr een vi ndov on l he fi Ie s o l hal l he firsl I i ne i n
l he bI ock is al l he l o of l he scr een.
To vri l e a bI ock lo anol her fi I e, you us e l he W c omma nd ( Wri l e I ock) .
Thi s c o mma nd l akes a sl ri ng l hal r er es enl s a f i I ename. Ior examI e,
WB !:dnc/cxamp!c!
vri l es l he conl enl s of l he bI ock l o l he fiIe " e x a mI e " i n l he di recl ory " : do c " .
Re me mbe r : if you us e l he f i I ename- di vi der sI ash (/) l o searal e di recl ori es and
f i I es, you shouI d nol us e sI ash as a deI i mi l er. ID l hen creal es a fiIe vi l h l he
na me l hal you seci f i ed, ossi bI y desl r oyi ng a r evi ous fiIe vi l h l hal na me ,
and fi naI I y vri l es l he buf f er lo il.
To i nserl a fiIe i nl o l he currenl fi I e, you us e l he I I c omma nd ( I nserl Ii I e) . ID
r eads i nl o me mor y l he fiIe vi l h l he na me you gave as l he ar gumenl sl ri ng l o
I I, al l he oi nl i mmedi al eI y f oI I ovi ng l he currenl I i ne. Ior examI e,
EDTHE 5CREEN EDITOR
99
IF !:dnc/cxamp!c!
i nser l s l he fiIe : doc/ examI e i nl o l he currenl fiIe begi nni ng i mmedi al eI y af l er
l he cur r enl I i ne.
3. 3. 3 -:C'.( 9"# ?/22#.9 ?/25:2 ;:5'9':.
The c omma nd T move s l he cursor l o l he l o of l he fi I e, so l hal l he firsl I i ne i n
l he fiIe is l he firsl I i ne on l he scr een. The c omma nd move s l he cur sor l o l he
bol l om of l he fi I e, so l hal l he I asl I i ne i n l he fiIe is l he bol l om I i ne on l he
scr een.
The c omma nds N and I move l he cur sor l o l he slarl of l he nexl I i ne and
r evi ous I i ne, resecl i veI y. The c omma nds CL and CR move l he cur sor one
I ace lo l he I efl or one I ace lo l he ri ghl , vhi I e CI I aces l he cur sor al l he e nd
of l he cur r enl I i ne, and CS I aces il al l he slarl.
The c omma nd M move s l he cursor l o a seci fi c I i ne. To move , you l ye M
f oI I oved by l he I i ne numbe r of l he I i ne you vanl as l he ne v cur r enl I i ne. Ior
examI e,
M 5 0 3
move s l he cursor lo l he five hundr e d and l hi rd I i ne i n l he fi I e. The M
c omma nd is a qui ck va y of reachi ng a knovn osi l i on i n your fiIe. You can, f or
i ns l anc e, move lo l he correcl I i ne i n your fiIe by gi vi ng a r eeal counl l o l he N
c omma nd, bul il is muc h sI over .
3. 3. 4 ,#)2D"'.( ).8 JXD").('.(
AI l ernal i veI y you can move l he scr een vi ndov l o a arl i cuI ar conl exl vi l h l he
c omma nd I ( Ii nd) f oI I oved by a sl ri ng l hal r er esenl s l he l exl lo be I ocal ed.
The sear ch slarls al one I ace be yond l he cur r enl cursor osi l i on and conl i nues
f or var d l hr ough l he fi I e. If l he sl ri ng i s f ound, l he cursor aear s al l he sl arl
of l he I ocal ed sl ri ng. The sl ri ng mus l be i n quol es (or ol her deI i mi l ers " / " ,
" ! " , and so on) . I n or der for a mal c h lo occur l he sl ri ngs mus l be of l he s ame
cas e, unI es s l he UC c omma nd is us ed (see beI ov) .
To sear ch bac kvar d l hr ough l he l exl , you us e l he c omma nd I ( ackvar d
Ii nd) i n l he s ame vay as I. I f i nds l he I asl occur r ence of l he sl ri ng bef or e l he
cur r enl cur sor osi l i on. ( Thal i s, I I ooks f or l he sl ri ng l o l he I efl of l he cur sor
and l hen l hr ough aII l he I i nes back lo l he begi nni ng of l he fi I e. ) To f i nd l he
earI i esl occur r ence, you us e T (To-of-fi I e) f oI I oved by I. To f i nd l he I asl
occur r ence, you us e ( ol l om- of - f i I e) f oI I oved by I.
The I ( Ixchange) c omma nd l akes l vo sl ri ngs s ear al ed vi l h deI i mi l er char -
acl ers and exc hanges l he firsl sl ri ng f or l he I asl . So, f or examI e,
100
AMIGADO5 U5ER'5 MANUAL
E /wnmbat/zcbra/
vouI d c hange l he nexl occur r ence of l he l exl " vo mb a l " lo " z e b r a " . The edi l or
sl arl s sear chi ng f or l he firsl sl ri ng al l he cur r enl cursor osi l i on and conl i nues
l hr ough l he fiIe. Af l er l he exc hange is c omI el ed, l he cursor move s lo l he e nd
of l he exc hanged l exl .
You can seci f y eml y sl ri ngs by l yi ng l vo deI i mi l ers vi l h nol hi ng be l ve e n
l he m. If l he fi rsl, or " s e a r c h" , sl ri ng is eml y, l he edi l or i nserl s l he s ec ond
sl ri ng al l he cur r enl cursor osi l i on. If l he s econd sl ri ng is eml y, l he nexl
occur r ence of l he sear ch sl ri ng i s exc hange d f or nol hi ng ( l hal i s, l he sear ch
sl ri ng i s deI el ed) .
Nol e: ID i gnor es mar gi n sel l i ngs vhi I e you are exchangi ng lexl .
The IQ c omma nd ( Ixchange and Quer y) i s a vari anl on l he I c omma nd.
Wh e n you us e IQ, ID asks you vhe l he r you vanl l he exc hange l o l ake I ace.
Thi s is usef uI vhe n you vanl l he exc hange l o l ake I ace i n s ome ci r cum-
s l ances , bul nol i n ol her s . Ior examI e, af l er l yi ng
EQ /wnmbat/zcbra/
l he f oI I ovi ng mes s age
Exchangc?
aear s on l he c omma nd I i ne. If you r es ond vi l h an N, l hen l he cur sor
move s asl l he sear ch sl ri ng, ol her vi s e, if you l ye Y, l he c hange l akes I ace
as nor maI . You usuaI I y onI y gi ve IQ i n r eeal ed gr ous .
The sear ch and exchange c omma nds usuaI I y make a di sl i ncl i on be l ve e n
ue r and I over case vhi I e maki ng l he search. To leII aII s ubs equenl sear ches
nol lo ma ke any di sl i ncl i on be l ve e n uer and I over case, you us e l he UC
c omma nd. Onc e you have gi ven UC, l he search sl ri ng " vo mb a l " mal c hes
" Wo mb a l " , " W O M A T " , " Wo Mb Al " , and so on. To have ID di sl i ngui sh
be l ve e n uer and I over case agai n, you us e LC.
3. 3. 5 %09#2'.( !#X9
You c annol us e l he I c omma nd l o i nserl a ne v I i ne i nl o l he l exl . You us e l he I
and A c omma nds i nsl ead. IoI I ov l he I c omma nd ( I nserl bef ore) vi l h a sl ri ng
l hal you va nl lo make i nl o a ne v I i ne. I D i nserl s l hi s n e v I i ne bef or e l he
cur r enl I i ne. Ior examI e,
I /Inscrt this BEFORE thc currcnt !inc/
EDTHE 5CREEN EDITOR
101
i nser l s l he sl ri ng " I ns er l l hi s IIORI l he currenl I i ne " as a ne v, sear al e I i ne
ef or e l he I i ne conl ai ni ng l he cursor. You us e l he A c omma nd ( i nserl Af l er) i n
l he s ame va y excel l hal ID i nserl s l he ne v I i ne af l er l he cur r enl I i ne. Thal i s,
A / I n s e r l l h i s AI T I R l h e c u r r e n l I i ne /
i nser l s l he sl ri ng " I ns er l lhi s AITIR l he cur r enl I i ne " as a ne v I i ne Af l er l he
I i ne conl ai ni ng l he cursor.
To sI i l l he cur r enl I i ne al l he cursor osi l i on, you us e l he S c omma nd. S i n
exl ended mo de i s | us l I i ke r es s i ng RITURN i n i mmedi al e mo de ( see Secl i on
3. 2. 2 f or f url her del ai I s on sI i l l i ng I i nes) .
The } c omma nd | oi ns l he nexl I i ne lo l he e nd of l he cur r enl one .
The D c o mma nd deI el es l he currenl I i ne i n l he s ame va y as CTRL- i n
i mmedi al e mode . The DC c omma nd deI el es l he char acl er above l he cur sor i n
l he s ame va y as DIL.
3. 3. 6 G#<#)9'.( ?:&&).85
To reeal any c omma nd a cerl ai n numbe r of l i mes, r ecede il vi l h l he desi r ed
numbe r . Ior examI e,
4 I / s I i l hy/ br i I I i g/
c hanges l he nexl f our occur r ences of " s I i l hy" l o " br i I I i g" . ID veri f i es l he scr een
af l er each c omma nd. You us e l he RI ( Reeal ) c omma nd l o r eeal a c o mma nd
unl i I ID r el ur ns an error, s uc h as r eachi ng l he e nd of l he fi I e. Ior e xamI e ,
T, RI I / s I i l hy/ br i I I i g/
c hange s aII occur r ences of " s I i l hy" l o " br i I I i g" . Nol i ce l hal you ne e d l he T
c o mma nd lo ens ur e l hal ALL occur r ences of " s I i l hy" are c hange d, ol her vi se
onI y l hos e af l er l he currenl osi l i on are c hanged.
To execul e c omma nd gr ous r eeal edI y, you can gr ou l he c omma nds
l ogel her i n ar enl hes es . You can aI so nes l c o mma nd gr ous vi l hi n c o mma n d
gr ous . Ior examI e,
R I ( I / ba nde r s na l c h/ , 3 %cH d
i nserl s l hr ee bI ank I i nes ( coi es of l he nuI I sl ri ng) af l er ever y I i ne conl ai ni ng
" ba nde r s na l c h" . Nol i ce l hal l hi s c omma nd I i ne onI y vor ks f r om l he cur sor l o
l he e nd of l he fi I e. To aI y l he c omma nd l o ever y I i ne i n l he fi I e, you s houI d
fi rsl move l o l he l o of l he fi I e.
Nol e l hal s ome c omma nds are ossi bI e, bul siIIy. Ior examI e,
102
AMIGADO5 U5ER'5 MANUAL
RI S R 6 0
sel s l he ri ghl mar gi n l o 60 )8 '.>'.'9/&3 Hove ve r , l o i nl errul any s equenc e of
exl ended c omma nds , and arl i cuI arI y r eeal ed ones , you l ye any characl er
vhi I e l he c omma nds are l aki ng I ace. If an error occur s, ID abandons l he
c o mma nd s equenc e.
a/'DM G#>#2#.D# ?)28
,<#D')0 _#= -)<<'.(5
Cnmma nd
ACKS IACI
DIL
IS C
RITURN
TA
< u - a r r o v >
< d o vn - a r r o v>
< I e f l - a r r o v>
< r i g hl - a r r o v>
Act i nn
DeI el e characl er lo I efl of cursor
DeI el e characl er al cursor
Inl er exl ended c omma nd mode
SI i l I i ne al cursor and creal e a n e v I i ne
Move cur sor ri ghl l o nexl l ab osi l i on ( does N O T i nserl a
TA characl er)
Move cursor u
Move cursor dovn
Move cursor Iefl
Move cursor ri ghl
H&&#8')9# ?:&&).85
Cnmma nd Act i nn
CTRL- A I nserl I i ne
CTRL- DeI el e I i ne
CTRL- D ScroI I l exl dovn
CTRL- I Move lo l o or bol l om of scr een
CTRL- I II i case
CTRL- G Reeal I asl exl ended c omma nd I i ne
CTRL- H DeI el e characl er Iefl of cursor ( ACKSIACI)
CTRL- I Move cur sor ri ghl l o nexl l ab osi l i on
CTRL- M RITURN
CTRL- O DeI el e vor d or saces
CTRL- R Cur s or l o e nd of r evi ous vor d
CTRL- T Cur sor l o slarl of nexl vor d
CTRL- U ScroI I lexl u
CTRL- V Veri f y scr een
CTRL- Y DeI el e lo end of I i ne
EDTHE 5CREEN EDITOR
103
CTRL- | Iscae ( enl er exl ended mode)
CTRL- j Cur sor l o e nd or slarl of I i ne
JX9#.8#8 ?:&&).85
Thi s is a fuII Iisl of exl ended c omma nds i ncI udi ng l hos e l hal are mer eI y
exl ended ver si ons of i mmedi al e c omma nds . In l he Iisl, H 5' i ndi cal es a sl ri ng,
H5090 i ndi cal es l vo exchange sl ri ngs, and " n " i ndi cal es a numbe r .
Co mma n d Acl i on
A / s /
I nserl I i ne af l er currenl I i ne
Move lo bol l om of fiIe
I I ock e nd al cursor
I H5` ac kvar d f i nd
S I ock slarl al cursor
CI Move cursor lo e nd of I i ne
CL
Move cursor one osi l i on Iefl
CR
Move cursor one osi l i on ri ghl
CS
Move cur sor lo slarl of I i ne
D DeI el e currenl I i ne
D DeI el e bI ock
DC
DeI el e characl er al cur sor
I /s/l/ Ixc hange " s " i nl o " l "
IQ /s/l/
Ixc hange bul quer y firsl
IX
Ixl end ri ghl mar gi n
I / s / Ii nd sl ri ng ]5]
H H5`
I nserl I i ne bef or e cur r enl
I I nserl coy of bI ock
I I H5` I nserl fiIe ]5]
}
} oi n cur r enl I i ne vi l h nexl
LC
Di sl i ngui sh be l ve e n uer and
I over case i n sear ches
M n
Move lo I i ne numbe r " n "
N Move lo slarl of nexl I i ne
I
Move l o slarl of r evi ous I i ne
Q
Qui l vi l houl savi ng l exl
RI Reeal unl i I error
S
SI i l I i ne al cursor
S A Save l exl l o fiIe
S
S ho v bI ock on scr een
S H
Shov i nf or mal i on
SL n Sel Iefl mar gi n
S R n Sel ri ghl mar gi n
104 AMIGADO5 U5ER'5 MANUAL
Co mma n d Acl i on
ST n Sel l ab di sl ance
T Move lo l o of fiIe
U Undo c hange s o n cur r enl I i ne
UC Iqual e U/ C and 1/c i n sear ches
W H 5' Wr i l e bI ock l o fiIe " s "
X Ixi l, vr i l i ng l exl i nl o me mor y
?")<9#2 V
IDITThe Line Idilor
Thi s chal er descri bes i n delai I ho v l o us e l he I i ne edi l or IDI T. The firsl arl
i nl r oduces l he reader l o l he edi l or. The s ec ond arl gi ves a c omI el e seci f i ca-
l i on of IDI T. Ther e i s a qui ck r ef er ence card conl ai ni ng aII l he IDI T c omma nds
al l he end of l he chal er.
4. 1 I nl r oduci ng IDI T
4. 1. 1 CaI I i ng IDI T
4. 1. 2 Usi ng IDI T Co mma nds
4. 1. 2. 1 The Cur r enl Li ne
4. 1. 2. 2 Li ne Numbe r s
4. 1. 2. 3 SeI ecl i ng a Cur r enl Li ne
4. 1. 2. 4 QuaI i f i ers
4. 1. 2. 5 Maki ng Change s lo l he Cur r enl Li ne
4. 1. 2. 6 DeI el i ng WhoI e Li nes
4. 1. 2. 7 I nserl i ng Ne v Li nes
4. 1. 2. 8 Co mma nd Reel i l i on
4. 1. 3 Leavi ng IDI T
4. 1. 4 A Combi ne d IxamI e: IuI I i ng Il AI I Togel her
4. 2 A ComI el e Seci f i cal i on of IDI T
4. 2. 1 Co mma n d Synl ax
4. 2. 1. 1 Co mma nd Na me s
4. 2. 1. 2 Ar gume nl s
4. 2. 1. 3 Sl ri ngs
4. 2. 1. 4 MuI l i I e Sl ri ngs
4. 2. 1. 5 QuaI i f i ed Sl ri ngs
4. 2. 1. 6 Sear ch Ixr essi ons
4. 2. 1. 7 Numbe r s
4. 2. 1. 8 Svi l ch VaI ues
4. 2. 1. 9 Co mma nd Gr ous
4. 2. 1. 10 Co mma nd Reel i l i on
4. 2. 2 Ir ocessi ng IDI T
106 AMIGADO5 U5ER'5 MANUAL
4. 2. 2. 1 Ir oml s
4. 2. 2. 2 The Cur r enl Li ne
4. 2. 2. 3 Li ne Numbe r s
4. 2. 2. 4 QuaI i f i ed Sl ri ngs
4. 2. 2. 5 Oul ul Ir ocessi ng
4. 2. 2. 6 Ind- of - Ii I e HandI i ng
4. 2. 3 Iuncl i onaI Gr oui ngs of IDI T Comma nds
4. 2. 3. 1 SeI ecl i on of a Cur r enl Li ne
4. 2. 3. 2 Li ne I nserl i on and DeI el i on
4. 2. 4 Li ne Wi ndovs
4. 2. 4. 1 The Oer al i onaI Wi ndov
4. 2. 4. 2 Si ngI e Char acl er Oer al i ons on l he Cur r enl Li ne
4. 2. 5 Sl ri ng Oer al i ons on l he Cur r enl Li ne
4. 2. 5. 1 asi c Sl ri ng Oer al i ons
4. 2. 5. 2 The NuI I Sl ri ng
4. 2. 5. 3 Ioi nl i ng Vari anl
4. 2. 5. 4 DeI el i ng Iarl s of l he Cur r enl Li ne
4. 2. 6 Mi s ceI I aneous Cur r enl Li ne Comma nds
4. 2. 6. 1 SI i l l i ng and } oi ni ng Li nes
4. 2. 7 I ns ecl i ng Iarl s of l he Sour ce: The Tye Co mma nds
4. 2. 8 Conl r oI of Co mma nd, I nul , and Oul ul Ii I es
4. 2. 8. 1 Co mma nd Ii I es
4. 2. 8. 2 I nul Ii I es
4. 2. 8. 3 Oul ul Ii I es
4. 2. 9 Loos
4. 2. 10 GI obaI Oer al i ons
4. 2. 10. 1 Sel l i ng GI obaI Change s
4. 2. 10. 2 CanceI I i ng GI obaI Change s
4. 2. 10. 3 Sus endi ng GI obaI Change s
4. 2. 11 Di sI ayi ng l he Ir ogr am Sl al e
4. 2. 12 Ter mi nal i ng an IDI T Run
4. 2. 13 Cur r enl Li ne Veri f i cal i on
4. 2. 14 Mi sceI I aneous Co mma nds
4. 2. 15 Abandoni ng I nl eracl i ve Idi l i ng
V3O H.92:8/D'.( J*H!
IDI T is a l exl edi l or l hal r ocesses sequenl i aI fiIes I i ne by I i ne under l he
conl roI of edi l i ng c ommands . IDI T move s l hr ough l he i nul , or source fi I e,
as s i ng each I i ne (afler any ossi bI e aI l eral i ons) l o a sequenl i aI oul ul fi I e, l he
desl i nal i on fi I e. An IDI T r un, l her ef or e, makes a coy of l he sour ce fiIe l hal
conl ai ns any c hanges l hal you r eques l ed vi l h l he edi l i ng c omma nds .
EDITTHE LINE EDITOR
107
AI l hough IDI T usuaI I y r ocesses l he source fiIe i n a f or var d sequenl i aI
ma nne r , il has l he caabi I i l y l o move bac kvar d a I i mi l ed numbe r of I i nes.
Thi s i s ossi bI e bec aus e IDI T does n' l vri l e l he I i nes l hal have be e n as s ed l o
l he desl i nal i on fiIe i mmedi al eI y, bul hoI ds l he m i nsl ead i n an oul ul queue .
The si ze of l hi s queue deends on l he amounl of me mor y avai I abI e. If you
vanl l o hoI d mor e i nf ormal i on i n me mor y, you can seI ecl l he IDI T ol i on, OIT,
descr i bed i n l he nexl secl i on, lo i ncrease l he amounl .
You can ma ke mor e l han one as s l hr ough l he l exl .
The IDI T c omma nds I el you
a) c hange arl s of l he sour ce,
b) oul ul arl s of l he source l o ol her desl i nal i ons, and
c) i nserl mal eri aI f r om ol her sour ces.
V3O3O ?)00'.( J*H!
Thi s secl i on descri bes l he f or mal of l he ar gumenl s you can gi ve ever y l i me you
caII l he IDI T c omma nd. IDI T execl s l he f oI I ovi ng ar gumenl s :
IROM/ A, TO, WI TH/ K, VIR/ K, OIT/ K
The c o mma nd l emI al e descri bed i n Chal er 1 is a me l hod of def i ni ng l he
synl ax f or each c omma nd. Ami ga DOS accel s c omma nd ar gumenl s accor di ng
l o l he f or mal descri bed i n l he c omma nd l emI al e. Ior examI e, s ome ar gu-
me nl s are ol i onaI , s ome mus l aear vi l h a ke yvor d, and ol her s do nol ne e d
ke yvor ds bec aus e l hey aear onI y i n a seci fi c osi l i on. Ar gume nl s vi l h a
f oI I ovi ng / A (Iike IROM) mus l aear , bul you do nol have lo l ye l he
ke yvor d. Ar gume nl s vi l h | us l a f oI I ovi ng /K ( such as WI TH, VIR, and OIT)
are ol i onaI , bul you mus l l ye l he keyvor d l o seci f y l he m. Ar gume nl s
vi l houl a f oI I ovi ng / ( TO, f or examI e) , are ol i onaI . Ami g a DOS r ecogni zes
ar gumenl s vi l houl a f oI I ovi ng sI ash (/) by l hei r osi l i on aI one. If you f orgel
l he synl ax f or IDI T, l ye:
IDI T `
and Ami ga DOS di sI ays l he fuII l emI al e on l he scr een. ( Ior mor e del ai I s on
us i ng c omma nds , s ee Chal er s 1 and 2 of l hi s manuaI . )
Us i ng anol her me l hod of descri l i on, l he c omma nd synl ax f or IDI T is as
f oI I ovs:
| IROMj < f i I e > | | TOj < f i I e > j | WI TH < f i I e > j | VIR < f i I e > j | OIT In+Wn+In
Wnj
108
AMIGADO5 U5ER'5 MANUAL
The ar gumenl I ROM r er esenl s l he sour ce fiIe l hal you vanl lo edi l . The
ar gumenl mus l aear , bul l he keyvor d i lseI f is ol i onaI . ( Thal i s, Ami g a DOS
accel s l he I ROM fiIe by ils osi l i on. ) Il does nol requi re you lo l ye l he
ke yvor d I ROM as veI I .
The TO fiIe r er es enl s l he desl i nal i on fiIe. Thi s is l he fiIe vher e IDI T s ends
l he oul ul i ncI udi ng l he edi l i ng changes . If you omi l l he TO ar gumenl , IDI T
us es a l emor ar y fiIe l hal il r enames as l he I ROM fiIe vhe n edi l i ng is c om-
I el e. If you gi ve l he IDI T c o mma nd S TOI, l hi s r enami ng doe s nol l ake I ace,
and l he ori gi naI I ROM fiIe is unl ouc hed.
The WI TH ke yvor d r er es enl s l he fiIe conl ai ni ng l he edi l i ng c omma nds . If
you omi l l he WI TH ar gumenl , IDI T reads f r om l he l ermi naI .
The VIR keyvor d r er esenl s l he fiIe vher e IDI T s ends error me s s age s and
I i ne veri f i cal i ons. If you omi l l he VIR ar gumenl , IDI T uses l he l ermi naI .
You can us e l he OIT keyvor d l o seci f y ol i ons lo IDI T. VaI i d ol i ons are
I < n > , vhi c h sel s l he numbe r of r evi ous I i nes avai I abI e l o l he i nl eger < n > ,
and W < n > , vhi c h sel s l he ma x i mum I i ne I engl h handI ed lo < n > char acl er s.
UnI es s you seci f y ol her vi s e, Ami ga DOS sel s l he ol i ons I40W120.
You can us e OIT lo i ncr ease, or decr ease, l he si ze of avai I abI e me mor y.
IDI T us es I W (lhal i s, l he numbe r of r evi ous I i nes muI l i I i ed by l he I i ne
vi dl h) lo del er mi ne l he avai I abI e me mor y. To c hange l he me mor y si ze, ad| usl
l he I and W numbe r s . I50 aI I ocal es mor e me mor y l han usuaI , I30 aI I ocal es
I ess me mo r y l han usuaI .
He r e are s ome examI es of hov you can caII IDI T:
EDIT prngram! TO prngram! ncw WITH cdit cnmmands
EDIT prngram! OPT P50W240
EDIT prngram! VER vcr ^i ! c
Nol e: UnI i ke ID, you c annol use IDI T lo creal e a ne v fiIe. If you al l eml l o
creal e a ne v fi I e, Ami ga DOS rel urns an error because il c annol f i nd l he ne v
fiIe i n l he cur r enl di recl ory.
V3O3P 45'.( J*H! ?:&&).85
Thi s secl i on i nl r oduces s ome of l he basi c IDI T c omma nds omi l l i ng ma ny
of l he advanc ed f eal ures. A comI el e descri l i on of l he c omma nd synl ax
and of aII c omma nds aear s i n Secl i on 4. 2, " A ComI el e Seci f i cal i on of
IDI T. "
EDITTHE LINE EDITOR
109
V3O3P3O !"# ?/22#.9 B'.#
As IDI T r eads I i nes f r om l he sour ce and vri l es l he m l o l he desl i nal i on, l he
I i ne l hal il has " i n ils h a n d " al any l i me is caI I ed l he cur r enl I i ne. IDI T make s
aII l he l exl uaI c hanges lo l he cur r enl I i ne. IDI T aI vays i nserl s ne v I i nes bef or e
l he cur r enl I i ne. Wh e n you firsl enl er IDI T, l he cur r enl I i ne is l he fi rsl I i ne of
l he sour ce.
4. 1. 2. 2 B'.# S/&K#25
IDI T assi gns each Iine i n l he source a uni que I i ne number . Thi s I i ne numbe r is
nol arl of l he i nf or mal i on sl ored i n l he fi I e, bul IDI T c omul es il by counl i ng
l he I i nes as l hey are r ead. Wh e n you' r e usi ng IDI T, you can ref er l o a seci f i c
I i ne by us i ng i ls I i ne numbe r . A I i ne l hal has be e n r ead rel ai ns ils ori gi naI I i ne
numbe r aII l he l i me il is i n mai n me mor y, even vhe n you deI el e I i nes bef or e or
af l er il, or i nserl s ome exl ra I i nes. The I i ne numbe r s r emai n unc ha nge d unl i I
you r evi nd l he fi I e, or unl i I you r enumbe r l he I i nes vi l h l he c o mma nd.
IDI T assi gns l he I i ne numbe r s each l i me you enl er l he fi I e. The I i ne numbe r s ,
l her ef or e, ma y nol be l he s ame vhe n you re- enl er.
V3O3P3Q ,#0#D9'.( ) ?/22#.9 B'.#
To seI ecl a cur r enl I i ne i n IDI T, you can us e one of l hr ee me l hods :
a) counl i ng I i nes,
b) seci f yi ng l he conl exl , or
c) seci f yi ng l he I i ne numbe r .
The s e l hree me l hods are descr i bed beI ov.
W= B'.# ?:/.9'.(
The N and I c omma nds aI I ov you l o move l o l he nexl or r evi ous I i nes. If
you gi ve a numbe r bef or e l he N or I c omma nd, you can move l hal numbe r of
I i nes f or var d or bac kvar d. To move f or var d lo l he nexl I i ne, l ye:
N
Ior any IDI T c omma nd, you can l ye ei l her uer or I over case I el l ers.
To move f our I i nes f or var d, l ye:
4N
l o ma ke l he f our l h I i ne f r om l he cur r enl I i ne your ne v currenl I i ne.
To move back l o a I i ne above l he currenl I i ne, l ye:
I
110 AMIGADO5 U5ER'5 MANUAL
The I c omma nd aI so l akes a numbe r . Ior examI e, l ye:
4 I
Thi s ma ke s l he f ourl h I i ne above l he currenl I i ne your ne v cur r enl I i ne. Il i s
onI y ossi bI e l o go back lo r evi ous I i nes l hal IDI T has nol yel vr i l l en l o l he
oul ul . IDI T usuaI I y I el s you go back 40 I i nes. To be abI e lo move bac k mor e
l han l hi s, you seci f y mor e r evi ous I i nes vi l h l he I ol i on vh e n you enl er
IDI T (see Secl i on 4. 1. 1 earI i er i n lhi s chal er for f url her delai I s on l he I ol i on) .
-:C'.( 9: ) ,<#D'>'D B'.# S/&K#2
The M c omma nd aI I ovs you lo seI ecl a ne v cur r enl I i ne by seci f yi ng ils I i ne
numbe r . You l ye l he M c omma nd and l he desi red I i ne numbe r . Ior examI e,
l he c o mma nd M4 5 leI I s IDI T lo Move l o I i ne 45. If you are be yond I i ne 45, l hi s
c o mma nd move s back lo il r ovi ded il is sliII i n mai n me mor y.
You c an c ombi ne l he seci fi c I i ne numbe r and I i ne counl i ng c omma nds . Ior
examI e,
M 1 2 , 3 N
To sear al e consecul i ve c omma nds on l he s ame I i ne, l ye, (a s emi coI on) .
W= ?:.9#X9
You us e l he I c omma nd (Ii nd) lo seI ecl a currenl I i ne by conl exl . Ior
examI e,
F/Jabbcrwncky/
me a ns l o f i nd l he I i ne conl ai ni ng " } a bbe r voc ky" . The sear ch sl arl s al l he
cur r enl I i ne and move s f or var d l hr ough l he sour ce unl i I l he r equi r ed I i ne is
f ound. If IDI T r eaches l he e nd of l he sour ce vi l houl f i ndi ng a mal c hi ng I i ne, il
di sI ays l he f oI I ovi ng mes s age:
5OURCE EXHAU5TED
Il is aI so ossi bI e lo sear ch bac kvar d by usi ng l he I c o mma nd ( ackvar d
Ii nd) . Ior examI e,
BF/gyrc and gimb!c/
I aI so sl arl s vi l h l he cur r enl I i ne, bul IDI T move s bac kvar d unl i I il f i nds
l he desi red I i ne. If IDI T r eaches l he head of l he oul ul queue vi l houl f i ndi ng
a mal c hi ng I i ne, il di sI ays l he f oI I ovi ng mes s age:
EDITTHE LINE EDITOR
111
NO MOKE PREVIOU5 LINE5
Nol i ce l hal i n l he examI es above, l he desi red lexl ( } abber vocky and gyr e
and gi mbI e) is enc I os ed i n mal c hi ng si ngI e sI ashes (/). Thi s desi r ed l exl
is caI I ed a characl er sl ri ng. The characl ers you us e lo i ndi cal e l he begi n-
ni ng and e nd of l he characl er sl ri ng are caI I ed deI i mi l er char acl er s. In l he
examI es above, / vas us ed as l he deI i mi l er. A numbe r of seci aI characl ers
s uc h as : . , and are avai I abI e f or us e as deI i mi l ers, nal uraI I y, l he sl ri ng
i l seI f mus l nol c onl ai n l he deI i mi l er char acl er . IDI T i gnor e s l he s ac es
be l ve e n l he c omma nd na me and l he firsl deI i mi l er, bul cons i der s saces
vi l hi n l he sl ri ng as si gni f i canl , si nce il mal c he s l he conl exl exacl I y. Ior
examI e,
F /turn turn trcc/
does nol f i nd "l urn- l urn l r e e " or " l urn lurn l r e e " .
If you us e an I c omma nd vi l h no ar gumenl , IDI T r eeal s l he r evi ous
sear ch. Ior examI e,
F/|ub|ub bird/, U, F
f i nds l he s ec ond occur r ence of a I i ne conl ai ni ng " | ub| ub bi r d" . The N c o mma nd
be l ve e n l he l vo I c omma nds is necessar y becaus e an I c o mma nd aI vays
sl arl s by sear chi ng l he currenl I i ne. If you omi l l ed N, l he s ec ond I vouI d f i nd
l he s ame I i ne as l he firsl.
4. 2. 2. 4 a/)0'>'#25
The basi c f or m of l he I c omma nd descr i bed above f i nds a I i ne l hal conl ai ns
l he gi ven sl ri ng anyvher e i n ils I engl h. To reslri cl l he search l o l he begi nni ng or
l he e nd of I i nes, you can I ace one of l he I el l ers or I i n f ronl of l he sl ri ng. I n
l hi s case, you mus l l ye one or mor e saces af l er I. Ior examI e,
F B/s!ithy tnvcs/
me a ns Ii nd l he I i ne egi nni ng vi l h " sI i l hy l ove s " , vhi I e
F E/bandcrsnatch/
me a ns Ii nd l he I i ne Indi ng vi l h " ba nde r s na l c h" . As veI I as ul l i ng f ur l her
condi l i ons on l he conl exl r equi r ed, l he us e of or I s eeds u l he sear ch, as
IDI T onI y ne e ds l o consi der arl of each I i ne.
and I as us ed above are examI es of quaI i f i er s , and l he vhoI e ar gume nl is
112 AMIGADO5 U5ER'5 MANUAL
caI I ed a quaI i f i ed sl r i ng. A numbe r of ol her quaI i fi ers are aI so avai I abI e. Ior
examI e,
I I/ a- s i l l i ng o n a gal e/
me a ns Ii nd l he nexl I i ne conl ai ni ng Ireci seI y l he lexl " a- si l l i ng on a ga l e " . The
r equi r ed I i ne mus l conl ai n no ol her characl ers, ei l her bef or e or af l er l he gi ven
sl ri ng. Thal is lo say, vhe n you gi ve lhi s c omma nd, IDI T f i nds l he nexl I i ne
conl ai ni ng:
a-sitting nn a gatc
Hove ve r , IDI T does nol f i nd l he I i ne:
a-sitting nn a gatc.
To f i nd an e ml y I i ne ( Ireci seI y nol hi ng) , you can us e an eml y sl ri ng vi l h
l he I quaI i f i er, f or examI e,
I I//
You can gi ve mor e l han one quaI i fi er i n any order.
V3O3P3T -)M'.( ?").(#5 9: 9"# ?/22#.9 B'.#
Thi s secl i on descri bes hov lo us e l he I, A, and c omma nds l o aI ler l he l exl
on your cur r enl I i ne.
JXD").('.( 592'.(5
The I c o mma nd Ixc hanges one sl ri ng of characl ers i n l he I i ne f or anol her . Ior
examI e:
I/ Wonde r I a nd/ Looki ng GI as s /
r emoves l he sl ri ng " Wo nde r I a nd" f r om l he currenl I i ne, and r eI aces il vi l h
" Looki ng GI a s s " . Nol e l hal you us e a si ngI e cenl raI deI i mi l er l o sear al e l he
l vo sl ri ngs. To deI el e arl s of l he I i ne ( exchange lexl f or nol hi ng) , you can us e
a nuI I s ec ond sl ri ng, as f oI I ovs:
I/ mo n s l r o us c r ov/ /
To add ne v mal eri aI l o l he I i ne, you can us e l he A or c omma nds . The A
c o mma nd i nserl s i ls s econd sl ri ng Af l er l he firsl occur r ence of l he firsl sl ri ng
EDITTHE LINE EDITOR 113
on l he cur r enl I i ne. Si mi I arI y, l he c omma nd i nserl ils s ec ond sl ri ng ef or e
l he firsl occur r ence of l he firsl slri ng on l he currenl I i ne. Ior examI e, if l he
cur r enl I i ne conl ai ned
II scvcn maids with, scvcn mnps
l hen l he f oI I ovi ng c omma nd s equence:
A/ seven/ l y/ , L/ s even/ s i xl y- /
vouI d l urn il i nl o:
II scvcnty maids with, sixty-scvcn mnps
If you had omi l l ed l he L quaI i fi er f r om l he c o mma nd above, l he resuI l
vouI d have been:
II sixty-scvcnty maids with scvcn mnps
bec aus e l he search f or a sl ri ng usuaI I y r oceeds f r om Iefl l o ri ghl , and IDI T
us es l he firsl occur r ence l hal il f i nds. You us e l he quaI i fi er L lo seci f y l hal l he
sear ch s houI d r oceed Lef l var d. The L quaI i fi er f orces l he c o mma nd l hal il
quaI i f i es lo acl on l he Lasl occur r ence of ils firsl ar gumenl .
If l he firsl sl ri ng i n an A, , or I c omma nd i s eml y, IDI T i nserl s l he s ec ond
sl ri ng al l he begi nni ng or l he e nd of l he I i ne. To f url her quaI i f y l he osi l i on of
l he s ec ond sl ri ng, you us e or omi l l he L or l he I quaI i f i ers.
If you gi ve IDI T an A, , or I c omma nd on a I i ne l hal does nol mal c h l he
quaI i f i ed sl ri ng gi ven as l he firsl ar gumenl , l he f oI I ovi ng me s s age aear s
ei l her on l he scr een or i n a veri f i cal i on fiIe l hal you seci f i ed vhe n you enl er ed
IDI T.
NO MATCH
See Secl i on 4 . 1 . 1 , " CaI I i ng IDI T" for delai I s on l he veri f i cal i on fi I e.
V3O3P3Z *#0#9'.( L":0# B'.#5
Thi s secl i on descri bes ho v lo r emove I i nes of lexl f r om your fi I e. To deI el e a
r ange of I i nes, you can seci f y l hei r I i ne numbe r s i n a D c omma nd. To us e l he
D c omma nd, l ye D and l he I i ne numbe r . If you l ye a sace and a s ec ond
numbe r af l er D, IDI T r emoves aII l he I i nes f r om l he firsl I i ne numbe r l o l he
I asl . Ior examI e,
D 9 7 1 0 4
114 AMIGADO5 U5ER'5 MANUAL
deI el es I i nes 97 l o 104 i ncI usi ve, I eavi ng I i ne 105 as l he ne v cur r enl I i ne.
To deI el e l he cur r enl I i ne, l ye D vi l houl a quaI i f yi ng numbe r . Ior examI e,
F/p!um cakc/, D
deI el es l he I i ne conl ai ni ng " I um c a ke " , and l he I i ne f oI I ovi ng il be c ome s l he
ne v cur r enl I i ne. You can c ombi ne a quaI i f i ed search vi l h a deI el e c omma nd,
as f oI I ovs:
F B/Thc/, 4D
Thi s c omma nd s equenc e deI el es f our I i nes, l he firsl of vhi c h is l he I i ne
begi nni ng vi l h " T h e " .
You can aI so l ye a eri od (.) or an asl eri sk () i nsl ead of I i ne numbe r s . To
ref er l o l he cur r enl I i ne, l ye a er i od. To ref er lo l he end- of - f i I e, l ye an
asl eri sk. Ior examI e,
D.
deI el es l he resl of l he source i ncI udi ng l he currenl I i ne.
V3O3P3U H.5#29'.( S#I B'.#5
Thi s secl i on descri bes hov lo i nserl lexl i nl o your fiIe vi l h IDI T. To i nserl one
or mor e I i nes of ne v mal eri aI IIORI a gi ven I i ne, you us e l he I c omma nd.
You c an gi ve l he I c omma nd aI one or vi l h a I i ne numbe r , a er i od (. ), or an
asl eri sk (). IDI T i nserl s l exl bef or e l he cur r enl I i ne if you gi ve I on ils ovn, or
f oI I ov il vi l h a er i od (. ). If you l ye an asl eri sk () af l er I, your l exl is i nser l ed
al l he end of l he fiIe (l hal i s, bef or e l he end- of - f i I e I i ne) . Any l exl l hal you l ye
is i nser l ed bef or e l he I i ne you seci f i ed.
To i ndi cal e l he e nd of your i nserl i on, ress RITURN, l ye Z, and r es s
RITURN agai n. Ior examI e,
I 468
Thc !itt!c Iishcs nI thc sca,
Thcy scnt an answcr back tn mc.
Z
i nserl s l he l vo I i nes of l exl bef ore I i ne 468.
If you omi l l he I i ne numbe r f r om l he c omma nd, IDI T i nserl s l he ne v
mal eri aI bef or e l he cur r enl I i ne. Ior examI e,
EDITTHE LINE EDITOR 115
F/cnrkscrcw/, I
Hc said, "I'!! gn and wakc thcm, iI . . . "
Z
Thi s muI l i I e c omma nd f i nds l he I i ne conl ai ni ng " c or ks c r e v" ( vhi ch l he n
be c ome s l he cur r enl I i ne) and i nserl s l he seci f i ed n e v I i ne.
Af l er an I c omma nd conl ai ni ng a I i ne numbe r , l he currenl I i ne is l he I i ne of
l hal number , ol her vi s e, l he currenl I i ne is unc hange d.
To i nserl mal eri aI al l he e nd of l he fi I e, l ye I.
To save you l yi ng, IDI T r ovi des l he R ( ReI ace) c o mma nd, l he exacl
equi vaI enl of l yi ng DI (D f or DeI el e f oI I oved by I f or I nser l ) . Ior examI e,
R19 26
In wintcr whcn thc Iic!ds arc whitc
Z
deI el es I i nes 19 lo 26 i ncI usi ve, l hen i nserl s l he ne v mal eri aI bef or e I i ne 27,
vhi c h be c ome s l he cur r enl I i ne.
V3O3P3e ?:&&).8 G#<#9'9':.
You can aI so us e i ndi vi duaI reeal counl s as s hovn i n l he examI es f or N
and D above vi l h ma ny IDI T c omma nds . In addi l i on, you can r eeal a
coI I ecl i on of c omma nds by f or mi ng l he m i nl o a c omma nd gr ou us i ng ar en-
l hes es as f oI I ovs:
6( F YHHf D)
deI el es l he nexl six bI ank I i nes i n l he sour ce. Co mma nd gr ous ma y nol
exl end over mor e l han one I i ne of c o mma nd i nul .
V3O3Q B#)C'.( J*H!
To end an IDI T sessi on, you us e l he c omma nd W (for Wi ndu) . IDI T " vi nds
l hr ough" lo l he e nd of l he sour ce, coyi ng il lo l he desl i nal i on, and exi l s.
UnI es s you seci f y a TO fi I e, IDI T r e name s l he l emor ar y oul ul fiIe as l he
I ROM f i I ename.
IDI T can accel c omma nds f r om a numbe r of c omma nd sour ces. In l he
si mI esl cas e, IDI T accel s c omma nds di reclI y f r om l he l er mi naI ( l hal i s, f r om
l he keyboar d) , l hi s is caI I ed l he pr i mar y c nmma nd ! cvc! . IDI T can, hove ve r ,
accel c omma nds f r om ol her sour ces, for examI e, c nmma nd Ii!cs or WI TH
fi I es.
116
AMIGADO5 U5ER'5 MANUAL
You can caII c o mma nd fiIes f r om vi l hi n IDI T, and f url her c o mma nd fiIes
f r om vi l hi n c omma nd fi I es, vi l h l he C c omma nd, so l hal each nes l ed c om-
ma nd fiIe be c ome s a sear al e c omma nd I eveI . IDI T sl os execul i ng l he c om-
ma nds i n l he c omma nd fiIe vhe n il c omes lo l he e nd of l he c o mma nd fi I e, or
vhe n il f i nds a Q. Wh e n IDI T recei ves a Q c omma nd i n a c o mma nd fi I e, or il
c omes lo l he e nd of l he fi I e, il i mmedi al eI y sl os execul i ng c omma nds f r om
l hal fi I e, and reverl s lo l he r evi ous c omma nd I eveI . If IDI T f i nds a Q
c omma nd i n a nes l ed c omma nd fi I e, il r el ur ns l o execul i ng c omma nds i n l he
c o mma nd fiIe al l he I eveI above. If you sl o edi l i ng al l he r i mar y c o mma nd
I eveI , by l yi ng Q, or if IDI T f i nds a Q i n a WI TH fiIe, l hen IDI T vi nds u and
exi ls i n l he s ame vay as il does vi l h W.
The c omma nd S TOI l er mi nal es IDI T vi l houl any f url her r ocessi ng. I n
arl i cuI ar, IDI T does nol vri l e oul any endi ng I i nes of oul ul sliII i n me mor y
so l hal l he desl i nal i on fiIe is i ncomI el e. If you onI y seci f y l he I ROM
ar gumenl , IDI T does NOT overvri l e l he source fiIe vi l h l he ( i ncomI el e)
edi l ed fi I e. You s houI d onI y us e S TOI if you do nol ne e d l he oul ul f r om l he
IDI T r un.
IDI T vri l es a l emor ar y bac ku lo : T/ ID- ACKUI vhe n you exi l vi l h l he
W or Q c omma nds . Thi s bac ku fiIe r emai ns unli I you exil f r om IDI T vi l h
l hes e c omma nds agai n, vhe r e uon IDI T overvri l es l he fiIe vi l h a ne v bac ku.
If you us e l he S TOI c omma nd, IDI T does nol vri l e lo l hi s fi I e.
V3O3V % ?:&K'.#8 JX)&<0#N ;/00'.( H9 %00 !:(#9"#2
You can meel mos l si mI e edi l i ng r equi r emenl s vi l h l he c omma nds aI ready
descr i bed. Thi s secl i on r esenl s an examI e l hal uses severaI c omma nds . The
l exl i n ilaIics f oI I ovi ng l he edi l i ng c omma nds i n l he examI e is a c omme nl .
You are nol me a nl l o l ye l hese c omme nl s , IDI T does nol aI I ov c omme nl s i n
c o mma nd I i nes.
To make il easi er for you lo f oI I ov vhal is hae ni ng, ve have i ncI uded l hi s
fiIe as " Idi l S a mI e " on your ac c omanyi ng di sk.
Take l he f oI I ovi ng source lexl ( vi l h I i ne number s ) :
1 TveedI ede e and Tve e dI e dum
2 agr eed l o a. bal l I e,
3 Ior Tve e dI e dum sai d TveedI edee
4 ad soi I ed hi s ni ce ne v ral l I e.
5
6 As bI ack as a lar barreI
7 Whi c h f r i ghl ened bol h l he her oes so
8 The y qui l e f orgol l hei r quoreI I
Ixecul e l hes e IDI T c ommands :
EDITTHE LINE EDITOR 117
M!, E/dum/dcc/, E/dcc/dum/
N, E/a/A/, B /a /havc /
F B/ad/, B//H/
F P//, W, I
Just thcn I!cw dnwn a mnnstrnus
crnw,
Z
M6, 2( A 4Hcf N)
F/qunrc/, E/qunrc!!/quarrc!./
< c o m m a s al e nd of I i ne s >
< l h e order of l he I c ommands mal l er s ! >
< n o v al I i ne 2 >
< H al I i ne s l a r l >
< be f o r e I i ne af l er bI ank o n e >
W
< I i s, i n facl , r e dunda nl >
< W i n d u >
The f oI I ovi ng l exl ( vi l h n e v I i ne number s ) is l he resuI l .
1 Tve e dI e dum and TveedI edee
2 Agr eed l o have a bal l I e,
3 Ior Tve e dI e dum sai d TveedI edee
4 Ha d soi I ed hi s ni ce ne v rallI e.
5
6 } us l l he n f I ev dovn a mons l r ous cr ov,
7 As bI ack as a lar barreI ,
8 Whi c h f r i ghl ened bol h l he her oes s o,
9 The y qui l e f orgol l hei r quarreI .
Nol e: If you exer i menl vi l h edi l i ng l hi s sour ce fi I e, you' I I f i nd l hal you
don' l have l o us e l he c omma nds i n l he examI e above. Ior i nsl ance, on l he
s ec ond I i ne, you couI d us e l he f oI I ovi ng c omma nd:
E/a/havc )c
l o r oduce l he s ame resuI l . In ol her vor ds , I Ixc hanges " a " f or " ha v e a" , and
I aces " h a v e " ef ore " a " lo r oduce " ha ve a " .
Af l er r eadi ng l he firsl arl of l hi s chal er on l he basi c f eal ures of IDI T, you
s houI d be abI e l o us e l he edi l or i n a si mI e vay. The resl of l hi s chal er is a
r ef er ence secl i on l hal r ovi des a fuII seci f i cal i on of aII l he f eal ur es of IDI T.
You ma y ne e d lo consuI l lhi s secl i on if you have any r obI ems vh e n edi l i ng or
if you vanl lo us e IDI T i n a mor e sohi sl i cal ed vay.
The f eal ures descri bed i n l hi s secl i on are as f oI I ovs:
V3P % ?:&<0#9# ,<#D'>'D)9':. :> J*H!
118
AMIGADO5 U5ER'5 MANUAL
Co mma n d synl ax
Conl r oI of Co mma nd, I nul , and Oul ul Ii I es
Ir oc es s i ng IDI T
Iuncl i onaI Gr oui ngs of IDI T Co mma nds
Li ne Wi ndovs
Sl ri ng Oer al i ons on l he Cur r enl Li ne
Mi s ceI I aneous Cur r enl Li ne Comma nds
I ns ecl i ng Iarl s of l he Sour ce: The Tye Co mma nds
Conl r oI of Co mma nd, I nul , and Oul ul Ii I es
Loos
GI obaI Oer al i ons
Di sI ayi ng l he Ir ogr am Sl al e
Ter mi nal i ng an IDI T Run
Cur r enl Li ne Veri f i cal i on
Mi s ceI I aneous Co mma nds
Aba ndoni ng I nl eracl i ve Idi l i ng
V3P3O ?:&&).8 ,=.9)X
IDI T c o mma n ds consi sl of a c o mma n d na me f oI I oved by zer o or mor e
ar gumenl s . One or mor e sace characl er s ma y ol i onaI I y aear be l ve e n
a c o mma nd na me and l he firsl ar gumenl , be l ve e n non- sl r i ng ar gumenl s ,
and be l ve e n c omma nds . A sace characl er is onI y neces s ar y i n l hes e I aces
l o s ear al e s ucces s i ve i l ems ol her vi s e l r eal ed as one ( f or e xamI e , l vo
numbe r s ) .
IDI T under s l ands l hal a c omma nd is f i ni shed i n any of l he f oI I ovi ng vays :
vhe n you r es s RITURN, vhe n IDI T r eaches l he e nd of l he c o mma nd
ar gume nl s , or vh e n IDI T r eads a s emi coI on (, ), or cI osi ng ar enl hes es ( ) ), l hal
you have l yed.
You us e ar enl hes es l o deI i mi l c omma nd gr ous .
To sear al e c omma nds l hal aear on l he s ame I i ne of i nul , you l ye a
s emi coI on. Thi s i s onI y slri clI y neces s ar y i n cas es of ambi gui l y vhe r e a c om-
ma nd has a vari abI e numbe r of ar gumenl s . IDI T aI vays lri es l o r ead l he
I ongesl ossi bI e c omma nd.
Ixcel vhe r e l hey aear as arl of a characl er sl ri ng, IDI T l hi nks of ue r
a nd I over case I el l ers as l he s ame .
V3P3O3O ?:&&).8 S)&#5
% c o mma nd na me is ei l her a s equence of I el l ers or a si ngI e seci aI characl er
(for examI e, - ) . An aI habel i c c omma nd na me ends vi l h a ny nonI el l er , onI y
l he firsl f our I el l l ers of l he na me are si gni f i canl . On e or mor e saces ma y
aear be l ve e n c omma nd na me s and l hei r ar gumenl s , IDI T requi res al I easl
EDITTHE LINE EDITOR 119
one sace vhe n an ar gumenl sl arl i ng vi l h a I eller f oI I ovs an aI habel i c
na me .
V3P3O3P %2(/&#.95
The f oI I ovi ng secl i ons descri be l he six di f f erenl l yes of ar gumenl s you can
us e vi l h IDI T c omma nds :
sl ri ngs
quaI i f i ed sl ri ngs
sear ch exr essi ons
numbe r s
svi l ch vaI ues
c omma nd gr ous
V3P3O3Q ,92'.(5
% sl ri ng is a s equenc e of u lo 80 characl ers encI os ed i n deI i mi l ers. You ma y
us e an e ml y (nuI I ) sl ri ng. ( A nuI I sl ri ng i s exacl I y vha l il s ounds I i ke: a
nons l r i ng, l hal i s, deI i mi l ers encI osi ng nol hi ng, f or examI e, //. ) The char acl er
l hal you deci de lo us e lo deI i mi l a arl i cuI ar sl ri ng ma y nol aear i n l he
sl ri ng. The l er mi nal i ng deI i mi l er ma y be omi l l ed if il is i mmedi al eI y f oI I oved
by l he e nd of l he c omma nd I i ne.
The f oI I ovi ng char acl er s are avai I abI e f or us e as deI i mi l ers:
( ) * & + , - .
l hal i s, c o mmo n IngI i sh uncl ual i on characl ers ( exc el , ) and l he f our ar i l hme-
li c oer al or s .
He r e are s ome examI es of sl ri ngs:
H%H
Mcnai Bridgc
??
+ 5tring with Iina! dc!imitcr nmittcd
V3P3O3V -/09'<0# ,92'.(5
Co mma n ds l hal l ake l vo sl ri ng ar gumenl s us e l he s ame deI i mi l er f or
bol h a nd do nol doubI e il be l ve e n l he ar gumenl s . An examI e is l he A
c omma nd:
A /King/Thc Rcd /
Ior aII such c omma nds l he s econd sl ri ng seci f i es r eI acemenl l exl . If you
omi l l he s econd sl ri ng, IDI T us es l he nuI I sl ri ng. If you do l hi s vi l h l he A a nd
120
AMIGADO5 U5ER'5 MANUAL
c o mma nd, l hen nol hi ng hae ns bec aus e you have as ked IDI T l o i nserl
nol hi ng af l er or bef or e l he firsl sl ri ng. Hovever , if you omi l l he s ec ond sl ri ng
af l er an I c o mma nd, IDI T deI el es l he firsl sl ri ng.
V3P3O3T a/)0'>'#8 ,92'.(5
Co mma nds l hal search for conl exl s, ei l her i n l he cur r enl I i ne or s c anni ng
l hr ough l he sour ce, seci f y l he conl exl vi l h quaI i f i ed sl ri ngs. A quaI i f i ed
sl ri ng i s a sl ri ng r ec eded by zer o or mor e quaI i f i ers. The quaI i fi ers are si ngI e
I el l ers. The y ma y aear i n any order. Ior examI e,
/01(234(
Sac es ma y nol aear be l ve e n l he quaI i fi ers. You ma y f i ni sh a Iisl of
quaI i fi ers vi l h any deI i mi l er characl er. The avai I abI e quaI i fi ers are ( egi n-
ni ng) , I ( Ind) , L (Lefl or Lasl ) , I ( Ireci seI y) , and U ( Uer cas e) .
4. 2. 1. 6 ,#)2D" JX<2#55':.5
Co mma nds l hal search for a arl i cuI ar I i ne i n l he sour ce l ake a sear ch
exr es s i on as an ar gumenl . A search exr essi on is a si ngI e quaI i f i ed sl ri ng. Ior
examI e,
F B/Twccd!c/
leI I s IDI T lo I ook f or a I i ne begi nni ng vi l h l he sl ri ng " Tve e dI e " .
V3P3O3U S/&K#25
% numbe r is a s equence of deci maI di gi l s. Li ne numbe r s are a seci aI f or m of
numbe r and mus l aI vays be greal er l han zer o. Whe r e ver a I i ne numbe r
aear s , l he characl ers " . " and " " may aear i nsl ead. A er i od r er es enl s
l he cur r enl I i ne, and an asl eri sk r er esenl s l he I asl I i ne al l he e nd of l he sour ce
fi I e. Ior examI e,
M
i nsl rucl s IDI T l o move lo l he end of l he source fi I e.
V3P3O3e ,I'9D" Y)0/#5
Co mma nds l hal aI ler IDI T svi l ches l ake a si ngI e characl er as an ar gumenl .
The char acl er mus l be ei l her a + or - . Ior examI e, i n
V-
l he mi nus si gn (-) i ndi cal es l hal IDI T shouI d l ur n off l he veri f i cal i on. If you
EDITTHE LINE EDITOR
121
l hen l ye V + , IDI T l urns l he veri fi cal i on on agai n. In lhi s cas e, you can
cons i der + as " o n " and - as " of f " .
V3P3O3g ?:&&).8 72:/<5
To ma ke a numbe r of i ndi vi duaI IDI T c omma nds i nl o a c o mma nd gr ou,
you can encI ose l he m i n ar enl hes es . Ior examI e, l he f oI I ovi ng I i ne:
(I/Wa!ms/,c/Wa!rus/Largc Marinc Mamma!/)
f i nds l he nexl occur r ence of ' WaI r us ' and c hanges il l o ' Lar ge Mar i ne Ma m-
maI ' . Co mma nd gr ous , hovever , ma y nol s an mor e l han one I i ne of i nul .
Ior i ns l ance, if you l ye a c omma nd gr ou l hal i s I onger l han one I i ne, IDI T
onI y accel s l he c omma nds u lo l he e nd of l he firsl I i ne. The n, bec aus e IDI T
does nol f i nd a cI osi ng ar enl hesi s al l he e nd of l hal I i ne, il di sI ays l he
f oI I ovi ng error mes s age:
Unmatchcd parcnthcsis
Nol e l hal il is onI y neces s ar y l o us e ar enl hes es vh e n you i nl end l o r eeal a
c o mma nd gr ou mor e l han once.
V3P3O3Oh ?:&&).8 G#<#9'9':.
IDI T accel s ma ny c omma nds r eceded by an uns i gne d deci maI numbe r l o
i ndi cal e reel i l i on. Ior examI e
24N
If you gi ve a vaI ue of zer o, l hen IDI T execul es l he c omma nd i ndef i ni l eI y (or
unl i I end- of - f i I e is r eached) . Ior examI e, if you l ye
0 ( e / dum/ dee/ , n)
IDI T exc hanges ever y occur r ence of " d u m " f or " d e e " l o l he e nd of l he
fiIe.
You c an seci f y r eeal counl s f or c omma nd gr ous i n l he s ame vay as f or
i ndi vi duaI c omma nds :
12(F/handsnmc/, E/handsnmc/hansnm/, 3N)
122
AMIGADO5 U5ER'5 MANUAL
V3P3P ;2:D#55'.( J*H!
Thi s secl i on descri bes vha l hae ns vhe n you r un IDI T. Il gi ves del ai I s aboul
vhe r e i nul c ome s f r om and vher e l he oul ul goes , vha l s houI d aear on
your s cr een, a nd vha l s houI d evenl uaI I y aear i n your fiI e af l er you ha ve r un
IDI T.
V3P3P3O ;2:&<95
Wh e n IDI T is bei ng r un i nl eracl i veI y, l hal i s, vi l h bol h l he c omma nd fiIe
c onnec l ed lo l he keyboar d and l he veri f i cal i on fiIe c onnec l ed lo a vi ndov, il
di sI ays a r oml vhe n il i s r eady l o r ead a ne v I i ne of c omma nds . AI l hough,
if l he I asl c omma nd of l he r evi ous I i ne caus ed veri f i cal i on oul ul , IDI T does
nol rel ur n a r oml .
If you l ur n l he veri f i cal i on svi l ch V on, IDI T veri fi es l he cur r enl I i ne i n
I ace of a r oml i n l he f oI I ovi ng ci r cumsl ances:
if il has nol aI ready veri f i ed l he currenl I i ne,
if you have ma de any c hanges l o l he I i ne si nce il vas I asl veri f i ed, or
i f you ha ve c hange d l he osi l i on of l he oeral i onaI vi ndov.
Ol her vi s e, vh e n IDI T does nol veri f y l he currenl I i ne, il di sI ays a coI on
char acl er (:) l o i ndi cal e l hal il i s r eady f or a n e v I i ne of c omma nds . Thi s coI on
is l he usuaI IDI T r oml .
IDI T never gi ves r oml s vh e n you are i nserl i ng I i nes.
4. 2. 2. 2 !"# ?/22#.9 B'.#
As IDI T reads I i nes f r om l he source fiIe and vri l es l hem lo l he desl i nal i on
fi I e, l he I i ne l hal IDI T has i n ils ha nd al any l i me is caI I ed l he cur r enl I i ne.
Iver y c omma nd l hal you l ye ref ers l o l he cur r enl I i ne. IDI T i nserl s ne v I i nes
bef or e l he cur r enl I i ne. Wh e n you slarl edi l i ng vi l h IDI T, l he cur r enl I i ne is
l he firsl I i ne of l he sour ce.
V3P3P3Q B'.# S/&K#25
IDI T i denl i f i es each I i ne i n l he source by a uni que I i ne numbe r . Thi s is nol
arl of l he i nf or mal i on sl ored i n l he fiIe. IDI T c omul es l hes e numbe r s by
counl i ng l he I i nes as il reads l he m. IDI T does nol assi gn I i ne numbe r s lo a ny
ne v I i nes l hal you i nserl i nl o l he sour ce.
IDI T di sl i ngui shes be l ve e n ori gi naI and nonori gi naI I i nes. Ori gi naI I i nes
are sour ce I i nes l hal have nol be e n sIil or i nser l ed, nonor i gi naI I i nes are sI i l
I i nes and i nser l ed I i nes. Co mma nds l hal l ake I i ne numbe r s as ar gumenl s ma y
onI y ref er lo ori gi naI I i nes. IDI T move s f or var d, or bac kvar d u l o a sel I i mi l,
accor di ng l o vhe l he r l he I i ne numbe r you l ye is greal er or I ess l han l he
EDITTHE LINE EDITOR 123
cur r enl I i ne numbe r . IDI T as s es over or deI el es (if ar or i al e) nonor i gi naI
I i nes i n sear ches f or a gi ven ori gi naI I i ne.
Wh e n you l ye a eri od (.) i nsl ead of a I i ne numbe r , IDI T aI vays us es l he
cur r enl I i ne vhe l he r ori gi naI or nonor i gi naI . ( Ior a n examI e of ils us e , s ee
Secl i on 4. 1. 2. 6, DeI el i ng WhoI e Li nes. )
You c an r e numbe r I i nes vi l h l he " " c omma nd. Thi s ens ur es l hal aII I i nes
f oI I ovi ng l he cur r enl I i ne are ori gi naI . Tye:
= 15
l o numbe r l he cur r enl I i ne as 15, l he nexl I i ne 16, l he nexl 17, and so on l o l he
e nd of l he fi I e. Thi s i s hov you aI I ocal e I i ne numbe r s l o nonor i gi naI I i nes. If
you do nol quaI i f y l he c omma nd vi l h a numbe r , IDI T di sI ays l he me s s age :
Numbcr cxpcctcd aItcr =
4. 2. 2. 4 a/)0'>'#8 ,92'.(5
To seci f y conl exl s f or IDI T s ear ches , you can us e quaI i f i ed sl r i ngs. IDI T
accel s l he nuI I sl ri ng and aI vays mal c hes il al l he iniliaI sear ch osi l i on,
vhi c h is l he begi nni ng of l he I i ne excel as seci f i ed beI ov. I n l he abs enc e of
any quaI i f i ers, IDI T ma y f i nd l he gi ven sl ri ng anyvhe r e i n a I i ne. QuaI i f i ers
seci f y addi l i onaI condi l i ons f or l he conl exl . IDI T r ecogni zes f i ve quaI i f i ers ,
I, L, I, and U as f oI I ovs:

vhe r e l he sl ri ng mus l be al l he egi nni ng of l he I i ne. Thi s quaI i f i er ma y nol
aear vi l h I, L, or I.
I
vhe r e l he sl ri ng mus l be al l he Ind of l he I i ne. Thi s quaI i f i er ma y nol aear
vi l h , L, or I. If I aear s vi l h l he nuI I sl ri ng, il mal c hes vi l h l he end of l he
I i ne. ( Thal i s, I ook f or nol hi ng al l he e nd of a I i ne. )
L
vher e l he sear ch f or l he sl ri ng is l o l ake I ace Lef l var d f r om l he e nd of l he
I i ne i ns l ead of r i ghl var d f r om l he begi nni ng. If l her e is mor e l han one
occur r ence of l he sl ri ng i n a I i ne, l hi s quaI i fi er make s sure l hal l he Lasl one is
f ound i nsl ead of l he firsl. L ma y nol aear vi l h , I, or I. If L aear s vi l h
l he nuI I sl ri ng, il mal c hes vi l h l he e nd of l he I i ne. ( Thal i s, I ook I ef l vard f r om
l he e nd of l he I i ne f or an occur r ence of nol hi ng. )
124 AMIGADO5 U5ER'5 MANUAL
I
vhe r e l he I i ne mus l mal c h l he sl ri ng Ireci seI y and mus l conl ai n no ol her
char acl er s. I mus l nol aear vi l h , I, or L. If I aear s vi l h a nuI I sl ri ng, il
mal c he s vi l h an eml y I i ne.
U
vhe r e l he sl ri ng mal c h is lo l ake I ace vhel he r or nol uer or I over case is
us e d. ( Thal i s, as l hough you l ransI al ed bol h l he sl ri ng and l he I i ne i nl o
Uer c as e I el l ers bef or e comar i ng l hem. ) Ior examI e, vhe n you seci f y U,
l he f oI I ovi ng sl ri ng
/ TWIIDI e dum/
s houI d ma l c h a I i ne conl ai ni ng
Twccd!cDUM
as veI I as any ol her combi nal i on i n uer or I over case.
V3P3P3T +/9</9 ;2:D#55'.(
IDI T does nol vri l e I i nes r ead i n a f orvar d di recl i on l o l he desl i nal i on fiIe
i mmedi al eI y, bul i nsl ead il adds l he m lo an oul ul queue i n mai n me mor y.
Wh e n IDI T has us e d u l he me mor y avai I abI e for such I i nes, il vr i l es oul l he
I i nes al l he he ad of l he queue as necessar y. Unl i I IDI T has acl uaI I y vr i l l en oul
a I i ne l o l he desl i nal i on fi I e, you can move back and make il l he cur r enl I i ne
agai n.
You can aI so s end or l i ons of l he oul ul l o desl i nal i on fiIes ol her l han TO.
Wh e n you seI ecl an aI l ernal i ve desl i nal i on fi I e, IDI T vri l es oul l he queue of
I i nes for l he cur r enl oul ul fiIe.
V3P3P3Z J.8A:>AR'0# @).80'.(
Wh e n IDI T r eaches l he end of a source f i I e, a dummy end- of - f i I e I i ne
be c ome s cur r enl . Thi s end- of - f i I e I i ne has a I i ne numbe r one greal er l han l he
numbe r of I i nes i n l he fiIe. IDI T veri f i es l he I i ne by di sI ayi ng l he I i ne numbe r
a nd an asl eri sk.
Wh e n l he end- of - f i I e I i ne is currenl , c omma nds lo ma ke c hanges lo l he
cur r enl I i ne, and c omma nds l o move f or var d, r oduc e an error. AI l hough, if
you conl ai n l hes e ki nds of c omma nds vi l hi n an i nf i ni l eI y r eeal i ng gr ou,
IDI T does nol gi ve an error on r eachi ng l he end- of - f i I e I i ne. The I ( Ixchange)
c o mma nd i s an examI e of a c omma nd l o make c hanges l o l he cur r enl I i ne.
The N ( Nexl ) c omma nd is an examI e of a c omma nd lo move f or var d.
EDITTHE LINE EDITOR 125
V3P3Q R/.D9':.)0 72:/<'.(5 :> J*H! ?:&&).85
Thi s secl i on conl ai ns descri l i ons of aII IDI T c omma nds sI i l u by f uncl i on.
A s umma r y and an aI habel i caI Iisl of c omma nds aear I al er.
The f oI I ovi ng descri l i ons us e sI ashes (/) l o i ndi cal e deI i mi l er char acl er s
( l hal i s, characl ers l hal encI ose sl ri ngs) . Co mma nd na me s aear i n ue r
case, ar gumenl l yes aear i n I over case as f oI I ovs:
Nnt at i nn Dcscr i pt i nn
a, b
I i ne numbe r s (or. or)
c
g
c omma nd gr ou
m, n numbe r s
q
quaI i fi er Iisl ( ossi bI y eml y)
se search exr essi on
s, l sl ri ngs of arbi l rary characl ers
s v svi l ch vaI ue ( + or - )
!
sl ri ng deI i mi l er
Tab!c 4. 1: Nntatinn Inr Cnmmand Dcscriptinns
Nnt c: Co mma n d descri l i ons l hal aear i n l he resl of l hi s manuaI vi l h l he
above nol al i on s hov l he S YNTAX of l he c omma nd, l hey are nol examI es of
vhal you acl uaI I y l ye. IxamI es aI vays aear as f oI I ovs i n
this typcIacc.
V3P3Q3O ,#0#D9':. :> ) ?/22#.9 B'.#
The s e c omma nds have no f uncl i on ol her l han l o seI ecl a n e v cur r enl I i ne.
IDI T adds I i nes l hal il has as s ed i n a f or var d di recl i on lo l he desl i nal i on
oul ul que ue (for f url her delai I s on l he oul ul queue, see Secl i on 4 . 1 , " I nl r o-
duc i ng IDI T" ) . IDI T que ue s u I i nes l hal il has as s e d i n a ba c kva r d
di recl i on r eady f or s ubs equenl r er ocessi ng i n a f or vard di recl i on. M l akes a
I i ne numbe r , er i od, or asl eri sk. So, usi ng l he c omma nd nol al i on descr i bed
above, l he correcl synl ax for M is as f oI I ovs:
Ma
vhe r e Ma move s f or var d or bac kvar d lo I i ne " a " i n l he sour ce. OnI y ori gi naI
I i nes can be accessed by I i ne number .
M +
make s l he I asl I i ne acl uaI I y r ead f r om l he fiIe cur r enl I i ne. M + move s l hr ough
aII l he I i nes currenl I y heI d i n me mor y unl i I l he I asl one is r eac hed.
126
AMIGADO5 U5ER'5 MANUAL
M -
make s l he I asl I i ne on l he oul ul queue currenl . Thi s is I i ke sayi ng l o IDI T:
" Mo v e back as far as you c a n. "
N
move s f or var d l o l he nexl I i ne i n l he sour ce. Wh e n l he cur r enl I i ne is l he I asl
I i ne of l he s our ce, execul i ng an N c omma nd does nol creal e an error. IDI T
i ncr eases l he I i ne numbe r by addi ng one lo il and creal es a seci aI end- of - f i I e
I i ne. Hove ve r , if -you lry lo us e an N c omma nd vhe n you are aI ready al l he
e nd of l he sour ce fi I e, IDI T r el ur ns an error.
I
move s bac k lo l he r evi ous I i ne. You can move mor e l han one I i ne back by
ei l her r eeal i ng I, or gi vi ng a numbe r bef or e i l. The numbe r l hal you gi ve
s houI d be equaI l o l he numbe r of I i nes you vanl lo move back.
The synl ax f or l he I ( Ii nd) c omma nd is
I se
So, I f i nds l he I i ne you seci f y vi l h l he sear ch exr essi on " s e " . The sear ch
sl arl s al l he cur r enl I i ne and move s f orvar d l hr ough l he sour ce. The search
sl arl s al l he cur r enl I i ne i n order l o cover l he case vhe r e l he cur r enl I i ne has
be e n r eac hed as a si de ef f ecl of r evi ous c omma nds s uc h as I i ne deI el i on. An
I c ommand vi l h no ar gumenl searches usi ng l he Iasl execul ed search exressi on.
The synl ax f or l he I ( ackvar d Ii nd) c omma nd is
I se
I behaves Iike I excel l hal il slarls al l he currenl I i ne and move s bac kvar d
unl i I il f i nds a I i ne l hal mal c hes ils search exr essi on.
V3P3Q3P B'.# H.5#29':. ).8 *#0#9':.
Co mma nds may seI ecl a ne v currenl I i ne as a si de ef f ecl of l hei r mai n
f uncl i on. Thos e f oI I oved by i n- I i ne i nserl i on mal eri aI mus l be l he I asl c om-
ma nd on a I i ne. The i nserl i on mal eri aI is on successi ve I i nes l er mi nal ed by Z
on a I i ne by i lseI f. You can use l he Z c omma nd l o c hange l he l er mi nal or . IDI T
r ecogni zes l he l ermi nal or you gi ve i n ei l her uer or I over case. Ior examI e,
us i ng l he s ame nol al i on,
EDITTHE LINE EDITOR 127
la
< i ns e r l i on mal eri aI , as ma ny
I i nes as ne c e s s a r y>
i nserl s l he i nserl i on mal eri aI bef or e " a " . Re me mbe r l hal " a " can be a seci f i c
I i ne numbe r , a er i od ( reresenl i ng l he cur r enl I i ne) , or an asl eri sk ( r er esenl -
i ng l he I asl I i ne of l he source fi I e). If you omi l " a " , IDI T i nserl s l he mal eri aI
bef or e l he cur r enl I i ne, ol her vi s e, I i ne " a " be c ome s l he cur r enl I i ne.
I/s/
i nserl s l he conl enl s of l he fiIe " s " ( r emember , " s " me a ns any sl ri ng) bef or e l he
cur r enl I i ne.
R a b
Z
Ra b/ s/
ReI acemenl mal e r i aI >
The R c omma nd is equi vaI enl lo D f oI I oved by I. The s ec ond I i ne numbe r
mus l be greal er l han or equaI l o l he firsl. You ma y omi l l he s ec ond numbe r if
you vanl lo reI ace | us l l he one I i ne (lhal i s, if b a) . You ma y omi l bol h
numbe r s if you vanl l o reI ace l he currenl I i ne. The I i ne f oI I ovi ng I i ne b
be c ome s l he ne v cur r enl I i ne.
The synl ax for l he D ( DeI el e) c omma nd is as f oI I ovs:
D a b
So, D deI el es aII I i nes f r om a l o b i ncI usi ve. You ma y omi l l he s ec ond I i ne
numbe r if you vanl l o deI el e | usl l he one I i ne (l hal i s, if b a) . You ma y omi l
bol h numbe r s if you vanl lo deI el e l he currenl I i ne. The I i ne f oI I ovi ng I i ne b
be c ome s l he n e v cur r enl I i ne.
The synl ax of l he DI ( DeI el e Ii nd) c omma nd is
DI se
The c o mma nd DI ( DeI el e Ii nd) leIIs IDI T lo deI el e successi ve I i nes f r om
l he sour ce unl i I il f i nds a I i ne mal c hi ng l he sear ch exr essi on. Thi s I i ne l he n
be c ome s l he ne v currenl I i ne. A DI c omma nd vi l h no ar gumenl s ear ches
( deI el i ng as il goes) usi ng l he I asl search exr essi on you l yed.
128
AMIGADO5 U5ER'5 MANUAL
V3P3V B'.# L'.8:I5
IDI T usuaI I y acl s on a comI el e currenl I i ne. Hove ve r , you can def i ne arl s of
l he I i ne vhe r e IDI T can execul e your s ubs equenl c omma nds . The s e arl s of
I i nes ar e caI I ed I i ne vi ndovs . Thi s secl i on descri bes l he c omma nds you us e l o
def i ne a vi ndov.
V3P3V3O !"# +<#2)9':.)0 L'.8:I
IDI T usuaI I y scans aII l he characl ers i n a I i ne vhe n I ooki ng f or a gi ven
sl ri ng. Hove ve r il i s ossi bI e l o seci f y a " I i ne vi ndo v" , so l hal l he s can f or a
characl er sl arl s al l he begi nni ng of l he vi ndov, and nol al l he slarl of l he I i ne.
I n aII l he descr i l i ons of IDI T conl exl c omma nds , " l he begi nni ng of l he I i ne "
aI vays me a ns " l he begi nni ng of l he oeral i onaI vi n do v. "
Whe ne ve r IDI T veri fi es a cur r enl I i ne, il i ndi cal es l he osi l i on of l he oer a-
l i onaI vi ndov by di sI ayi ng a " > " characl er di reclI y be ne al h l he I i ne. Ior
examI e i n l he f oI I ovi ng:
26.
This is !inc 86 this is.
>
l he oeral i onaI vi ndov conl ai ns l he characl ers l o l he ri ghl of l he oi nl er : " I i ne
26 l hi s i s . " IDI T omi l s l he i ndi cal or if il is al l he slarl of l he I i ne.
The I efl edge of l he vi ndov is aI so caI I ed l he characl er oi nl er i n l hi s
conl exl , and l he f oI I ovi ng c omma nds are avai I abI e for movi ng il:
>
move s l he oi nl er one characl er lo l he ri ghl .
<
move s l he oi nl er one characl er lo l he I efl .
IR
Ioi nl er Resel sel s l he oi nl er l o l he slarl of l he I i ne.
The synl ax f or l he IA ( Ioi nl Af l er) c omma nd is
IA q/s/
Ioi nl Af l er sel s l he oi nl er so l hal l he firsl characl er i n l he vi ndov is l he firsl
characl er f oI I ovi ng l he sl ri ng s. Ior examI e,
EDITTHE LINE EDITOR 129
IA YH
move s l he oi nl er lo l he end of l he I i ne.
The synl ax f or l he I ( Ioi nl ef ore) c omma nd i s
I q/s/
Ioi nl ef or e is l he s ame as IA, bul i ncI udes l he sl ri ng i lseI f i n l he vi ndov.
V3P3V3P ,'.(0# ?")2)D9#2 +<#2)9':.5 :. 9"# ?/22#.9 B'.#
The f oI I ovi ng l vo c omma nds move l he characl er oi nl er one I ace l o l he
ri ghl af l er f orci ng l he firsl I el l er i nl o ei l her uer or I over case. If l he firsl
characl er is nol a I el l er, or is aI ready i n l he r equi r ed case, l hese c omma nds are
equi vaI enl l o > .
The c o mma nd
$
f orces I over case (DoI I ar for Dovn) .
The c o mma nd
!
f orces uer case ( Iercenl f or uI) .
The " " ( under scor e) c omma nd c hanges l he firsl characl er i n l he vi ndov
i nl o a sace characl er, l hen move s l he characl er oi nl er one I ace l o l he
ri ghl .
The c omma nd
!
deI el es l he firsl characl er i n l he vi ndov. The r emai nder of l he vi ndov move s
one characl er lo l he I efl, I eavi ng l he characl er oi nl er oi nl i ng al l he nexl
characl er i n l he I i ne. The c omma nd is exacl I y equi vaI enl lo
I/s//
vhe r e " s " i s l he firsl characl er i n l he vi ndov. To reeal l he effecl , you seci f y a
numbe r bef or e l he " - " c omma nd. If l he vaI ue is " n " , f or examI e, l hen l he
r eeal ed c o mma nd is equi vaI enl lo l he si ngI e c omma nd
I/s//
130 AMIGADO5 U5ER'5 MANUAL
vhe r e " s " is l he firsl characl er i n l he vi ndov. To r eeal l he ef f ecl , you seci f y
a numbe r bef or e l he " - " c omma nd. If l he vaI ue is " n " , for examI e, l hen l he
r eeal ed c o mma nd is equi vaI enl l o l he si ngI e c omma nd
I/s//
vhe r e " s " i s l he firsl " n " characl er i n l he vi ndov or l he vhoI e of l he conl enl s
of l he vi ndov, vhi c hever is l he shorl er. Cons i der l he f oI I ovi ng examI e:
5 #
deI el es l he nexl f i ve characl ers i n l he vi ndov. If you l ye a numbe r equaI l o
or greal er l han l he numbe r of characl ers i n l he vi ndov, IDI T deI el es l he
conl enl s of l he enl i re vi ndov. IDI T l real s a s equence of " - " c omma nds i n l he
s ame vay as a si ngI e, r eeal ed " - " c omma nd. So, - - - - - is l he s ame as
l yi ng a si ngI e - , r es s i ng RITURN af l er each si ngI e - , f i ve l i mes .
You can us e a combi nal i on of " > " % " $ " " and " - " c omma nds lo edi l a I i ne
characl er by characl er, l he c omma nds aear i ng under l he characl ers l hey
af f ecl . The f oI I ovi ng l exl and c omma nds i I I uslral e l hi s:
n Oystcrs,, Cnmc ANDDWALK with us
%> $ $ $ $ $ $ $ # $ $ $ $ $ $ $ $ _ $ $ $ $ $ $ $ $ $ $ # # #
The c omma nds i n l he examI e above c hange l he I i ne lo
O nystcrs, cnmc and wa!k with us
I eavi ng l he characl er oi nl er i mmedi al eI y bef or e l he vor d " u s " .
V3P3T ,92'.( +<#2)9':.5 :. 9"# ?/22#.9 B'.#
To seci f y vhi c h arl of l he cur r enl I i ne lo quaI i f y, you can ei l her aI l er l he
basi c sl ri ng or oi nl lo a vari anl , as descri bed i n l he nexl l vo secl i ons.
V3P3T3O W)5'D ,92'.( +<#2)9':.5
Thr ee si mi I ar c omma nds are avai I abI e for aI l eri ng arl s of l he cur r enl I i ne.
The A, , and I c omma nds i nserl l hei r s econd (slri ng) ar gumenl Af l er , ef or e,
or i n Ixc hange f or l hei r firsl ar gumenl resecl i veI y. You ma y quaI i f y l he firsl
ar gumenl . If l he cur r enl I i ne ve r e
Thc Carpcntcr bcsccch
l hen l he c omma nds
EDITTHE LINE EDITOR
131
I U/ c a r e nl e r / Wa I r us /
/ bese/ di d /
A L//,/
< I x c h a n g e >
< i ns e r l sl ri ng b e f o r e >
< I ns e r l sl ri ng a f l e r >
vouI d c hange l he I i ne lo
Thc Wa!rus did bcsccch,
4. 2. 5. 2 !"# S/00 ,92'.(
You c an us e l he nuI I , or eml y sl ri ng (//) af l er any sl ri ng c omma nd. If you
us e l he nuI I sl ri ng as l he s econd sl ri ng i n an I c omma nd, IDI T r emoves l he
firsl sl ri ng f r om l he I i ne. Ir ovi ded IDI T f i nds l he firsl sl ri ng, an A or
c omma nd vi l h a nuI I s econd sl ri ng does nol hi ng, ol her vi s e, IDI T r el ur ns an
error. A nuI I firsl sl ri ng i n any of l he l hr ee c omma nds mal c hes al l he i ni li aI
sear ch osi l i on. The iniliaI search osi l i on i s l he cur r enl char acl er osi l i on
(iniliaIIy l he begi nni ng of l he I i ne) unI es s ei l her of l he I or L quaI i f i ers
i s r es enl , i n vhi c h cas e l he i ni l i aI osi l i on i s l he e nd of l he I i ne. Ior
examI e,
A/ / c a r e nl e r /
ul s l he l exl car enl er Af l er nol hi ng, l hal i s, al l he begi nni ng of l he I i ne.
Whe r e as
A L/ / c a r e nl e r
ul s car enl er al l he e nd of l he I i ne Af l er l he Lasl nol hi ng.
V3P3T3Q ;:'.9'.( Y)2').9
The AI ( i nserl Af l er and Ioi nl ) , I ( i nserl ef ore and Ioi nl ) , and II
( Ixchange and Ioi nl ) c omma nds l ake l vo sl ri ngs as ar gumenl s a nd acl exacl I y
I i ke A, , and I. Hovever , AI, I, and II have an addi l i onaI f eal ure: vh e n
l he oer al i on is c omI el e, l he characl er oi nl er is Iefl oi nl i ng l o l he firsl
characl er f oI I ovi ng bol h l exl sl ri ngs. So, us i ng l he s ame c o mma nd synl ax
nol al i on,
AI/s/l/
i s equi vaI enl l o
A/s/l/, IA/sl/
vhi I e
132
AMIGADO5 U5ER'5 MANUAL
I/s/l/
is equi vaI enl lo
/s/l/, IA/ls/
and
2 I I U/ l veadI e/ TveedI e/
vouI d c ha nge
twcad!cdum and TWEADLEdcc
i nl o
Twccd!cdum and Twccd!cdcc
I eavi ng l he characl er oi nl er | usl bef or e dee.
4. 2. 5. 4 *#0#9'.( ;)295 :> 9"# ?/22#.9 B'.#
You us e l he c omma nds DTA ( DeI el e TiII Af l er) and DT ( DeI el e TiII ef ore)
l o deI el e f r om l he begi nni ng of l he I i ne (or characl er oi nl er) lo a seci f i ed
sl ri ng. To deI el e f r om a gi ven conl exl unl i I l he e nd of l he I i ne, you us e l he
c omma nds DIA ( DeI el e Ir om Af l er) and DI ( DeI el e Ir om ef or e) . If l he
cur r enl I i ne ve r e
A!! thc King's hnrscs and a!! thc King's mcn
l hen l he c o mma nd
DT L/ KI ng' s /
vouI d c hange il l o
King's mcn
vhi I e
DTA/ hor s e s /
vouI d c hange il lo
and a!! thc King's mcn
EDITTHE LINE EDITOR
133
V3P3Z -'5D#00).#:/5 ?/22#.9 B'.# ?:&&).85
Thi s secl i on i ncI udes s ome f url her c omma nds l hal exI ai n ho v l o r eeal
c omma nds i nvoI vi ng sl ri ngs, hov l o sI i l l he cur r enl I i ne, and ho v l o | oi n
I i nes l ogel her .
Whe ne ve r IDI T execul es a sl ri ng aI l eral i on c omma nd (for examI e, A, , or
I) , il be c ome s l he currenl sl ri ng aI l eral i on c omma nd. To r eeal l he cur r enl
sl ri ng aI l eral i on c omma nd, you c an l ye a si ngI e quol e (' ). The ' c o mma n d has
no ar gumenl s . Il l akes ils ar gumenl s f r om l he I asl A, , or I c omma nd.
W A R N I N G : Unexec l ed ef f ecl s occur if you us e s equenc es s uc h as
I/ c as l I e/ kni ghl / , 4(' , I/ a vn/ que e n/ )
The s ec ond and s ubs equenl execul i ons of l he ' c o mma nd ref er l o a
di f f erenl c omma nd l han l he firsl. The above examI e vouI d exc hange
casl I e and kni ghl l vi ce and exchange a vn and que e n seven l i mes
i nsl ead of exc hangi ng casl I e and kni ghl once and l hen f our l i mes ex-
c hangi ng casl I e and kni ghl and a vn and queen.
V3P3Z3O ,<0'99'.( ).8 c:'.'.( B'.#5
IDI T is ri mari I y a I i ne edi l or. Mos l IDI T edi l i ng c omma nds do nol oer al e
over I i ne boundar i es , bul l hi s secl i on descri bes c omma nds f or sI i l l i ng a I i ne
i nl o mor e l han one I i ne and f or | oi ni ng l ogel her l vo or mor e successi ve I i nes.
To sI i l a I i ne bef or e a seci f i ed conl exl , you us e l he S c omma nd. The
synl ax f or l he S c omma nd is
S q/s/
S l akes an ol i onaI quaI i fi er r er es enl ed her e by q, and a sl ri ng H503 S
SI i l s l he cur r enl I i ne ef or e l he conl exl you seci f y vi l h l he quaI i f i er a nd
sl ri ng. IDI T s ends l he firsl arl of l he I i ne l o l he oul ul and make s l he
r emai nder i nl o a ne v, nonori gi naI currenl I i ne.
To sI i l a I i ne af l er a seci f i ed conl exl , you us e l he S A c omma nd. The synl ax
f or S A i s
S A q/s/
S A l akes an ol i onaI quaI i fi er and a sl ri ng (q and H50d3 S A SI i l s l he cur r enl
I i ne Af l er l he conl exl you seci f y vi l h l he quaI i fi er and sl ri ng.
To concal enal e a I i ne, you us e l he CL c omma nd. The synl ax f or CL i s
134
AMIGADO5 U5ER'5 MANUAL
CL/ s/
CL l akes an ol i onaI sl ri ng l hal is r er esenl ed her e by H5`3 CL or Conc al enal e
Li ne f or ms a ne v cur r enl I i ne by concal enal i ng l he cur r enl I i ne, l he sl ri ng you
seci f i ed, and l he nexl I i ne f r om l he sour ce, i n l hal order. If l he sl ri ng is a nuI I
sl ri ng, you ma y l ye l he c omma nd CL vi l houl seci f yi ng a sl ri ng.
Ior an examI e of sI i l l i ng and | oi ni ng I i nes, I ook al l he l exl
Humpty Dumpty sat nn a wa!!, Humpty
Dumpty had a
grcat Ia!!.
The oI d ver se aear s di s| oi nl ed, l he I i nes ne e d lo be baI anced. If you ma ke
l he firsl I i ne l he currenl I i ne, l he c omma nds
5A /, /, 2CL/ /
c hange l he I i ne i nl o
Humpty Dumpty sat nn a wa!!,
I eavi ng
Humpty Dumpty had a grcat Ia!!.
as l he n e v currenl I i ne.
4. 2. 7 H.5<#D9'.( ;)295 :> 9"# ,:/2D#N !"# !=<# ?:&&).85
The f oI I ovi ng c omma nds aII leII IDI T lo advance l hr ough l he sour ce, s endi ng
l he I i nes il as s es lo l he veri f i cal i on fiIe as veI I as lo l he nor maI oul ul ( vher e
r eI evanl ) . ec aus e l hese c omma nds are mos l f r equenl I y us ed i nl eracl i veI y ( l hal
i s, vi l h veri f i cal i on lo l he scr een) , l hey are k no vn as l he " l y e " c omma nds .
The y have l hi s na me becaus e you can us e l he m lo " l y e " oul l he I i nes you
seci f y on l he scr een. Thi s does nol hovever me an l hal you c annol us e l he m
lo s end oul ul l o a fiIe. Af l er IDI T has execul ed one of l hes e c omma nds , l he
I asl I i ne il " l y e d " (lhal i s, di sI ayed) be c ome s l he n e v cur r enl I i ne.
The synl ax f or l he T ( Tye) c omma nd is
Tn
Tn l yes " n " I i nes. If you omi l " n " , l yi ng conl i nues unl i I l he e nd of l he
sour ce. Hove ve r , you can aI vays i nl errul l he l yi ng vi l h CTRL- C.
EDITTHE LINE EDITOR 135
Nol e: Thr oughoul l hi s manuaI vhe n you see a hyhe n be l ve e n l vo keys ,
you r ess l he m al l he s ame l i me. So CTRL- C me a ns l o hoI d dovn l he CTRL
key vhi I e you l ye C.
Wh e n you us e l he T c omma nd, l he firsl I i ne IDI T l yes is l he cur r enl I i ne,
so l hal , f or examI e,
F /It's my nwn invcntinn/, T6
l yes si x I i nes sl arl i ng vi l h l he one conl ai ni ng " I l ' s my ovn i nve nl i on" . ( Nol e
l hal lo f i nd l he correcl I i ne, you mus l l ye l he " I " i n " I l ' s " i n ue r case. )
The c omma nd
TI
l yes l he I i nes i n l he oul ul queue. Thus , TI ( Tye Irevi ous) i s equi vaI enl lo
IDI T execul i ng M- f oI I oved by l yi ng unl i I il r eaches l he I asl I i ne il acl uaI I y
r ead f r om l he sour ce.
The c o mma nd
TN
l yes unl i I IDI T has c hanged aII l he I i nes i n l he oul ul queue. ( Ior mor e
i nf or mal i on on l he oul ul queue, see Secl i on 4 . 1 , " I nl r oduc i ng IDI T. " ) So,
a TN ( Tye Nexl ) c omma nd l yes N I i nes, vher e N vas l he numbe r seci -
f i ed as l he I ol i on. ( To f i nd oul mor e aboul l he I ol i on, r ef er l o
Secl i on 4 . 1 . 1 , CaI I i ng IDI T) . The advanl age of l he TN c omma nd is l hal ever y-
l hi ng vi si bI e dur i ng l he l yi ng oeral i on i s avai I abI e i n me mor y l o I and
I c omma nds .
The synl ax f or l he TL ( Tye vi l h Li ne number s ) c omma nd is as f oI I ovs:
TLn
TLn l yes n I i nes as f or T, bul vi l h I i ne numbe r s added. I nser l ed and
sI i l I i nes do nol have I i ne numbe r s , IDI T di sI ays a " + + + + " i nsl ead. Ior
examI e,
20 0 nystcrs, cnmc and wa!k with, us
+ + + + and thcn wc'!! havc snmc tca
The ori gi naI I i ne sl arl i ng vi l h " O oys l e r s " has a I i ne numbe r . The non-
ori gi naI I i ne, i nserl ed af l er I i ne 20, slarls vi l h + + + + . ( Re me mbe r l hal you
can us e l he c omma nd l o r enumber nonor i gi naI I i nes. )
136 AMIGADO5 U5ER'5 MANUAL
V3P3e ?:.92:0 :> ?:&&).8F H.</9F ).8 +/9</9 R'0#5
IDI T us es f our l yes of fi I es:
c o mma nd
i nul
oul ul
veri f i cal i on
Onc e you have enl er ed IDI T, you cannol c hange l he veri f i cal i on fiIe vi l h
a c omma nd. ( To f i nd oul mor e aboul l he veri f i cal i on fi I e, see Secl i on 4 . 1 . 1 ,
" CaI I i ng IDI T. " ) The f oI I ovi ng secl i ons descri be c omma nds l hal can c hange
l he c o mma nd, i nul , and oul ul fi I es l hal you sel u vh e n you enl er
IDI T.
V3P3e3O ?:&&).8 R'0#5
Wh e n you enl er IDI T, il reads c omma nds f r om l he l ermi naI or l he fiIe l hal
you seci f y as WI TH. To read c omma nds f r om anol her fi I e, you c an us e l he C
c omma nd. The synl ax for l he c omma nd is
C .8.
vhe r e l he sl ri ng " s " r er esenl s a f i I ename. As Ami ga DOS us es l he sI ash
s ymboI (/) l o sear al e f i I enames, you shouI d us e er i ods (. ), or s ome ol her
s ymboI , lo deI i mi l l he f i I ename. A s ymboI f ound i n a sl ri ng shouI d nol be us e d
as a deI i mi l er. Wh e n IDI T has f i ni shed aII l he c omma nds i n l he fiIe (or you
gi ve a Q c omma nd) , il cI oses l he fiIe and conl roI reverl s lo l he c omma nd
f oI I ovi ng l he C c omma nd. Ior examI e, l he c omma nd
C . : T/ XYZ.
r eads and execul es c omma nds f r om l he fiIe : T/ XYZ
V3P3e3P H.</9 R'0#5
To i nserl l he enl i re conl enl s of a fiIe al a seci fi c oi nl i n l he sour ce, you us e
l he I and R c omma nds . Thes e c omma nds are descri bed i n Secl i on 4. 1. 2. 7
earI i er i n l hi s chal er .
Secl i on 4. 1. 1 descri bed ho v lo caII IDI T. I n l hal secl i on, l he source fiIe vas
ref erred l o as l he I ROM fi I e. Hove ve r , you can aI so associ al e l he I ROM fiIe
vi l h ol her fi I es, us i ng l he c omma nd I ROM. The I ROM c o mma nd has l he
f oI I ovi ng f or m:
I ROM . s.
EDITTHE LINE EDITOR 137
vhe r e l he sl ri ng " s " is a f i I ename. A I ROM c omma nd vi l h no ar gume nl
reseI ecl s l he ori gi naI sour ce fi I e.
Wh e n IDI T execul es a I ROM c omma nd, l he currenl I i ne r emai ns currenl ,
hove ve r , l he nexl I i ne c omes f r om l he n e v sour ce.
IDI T does nol cI ose a source fiIe vhe n l he fiIe ceases l o be currenl , you can
r ead f ur l her I i nes f r om l he source fiIe by reseI ecl i ng il I aler.
To cI ose an oul ul fiIe l hal you oe ne d i n IDI T, and l hal s ubs equenl I y you
va nl l o oe n f or i nul (or l he ol her va y ar ound) , you mus l us e l he CI ( CI ose
Ii I e) c omma nd. The CI c omma nd has l he f oI I ovi ng f or m:
CI . s.
vhe r e l he sl ri ng " s " r er esenl s a f i I ename. Wh e n you e nd an IDI T s es s i on,
IDI T cI oses aul omal i caI I y aII l he fiIes you oe ne d i n IDI T.
Nol e: Any l i me you oen a fi I e, IDI T slarls al l he begi nni ng of l hal fi I e. If
you cI ose a fiIe vi l h CI, IDI T slarl s on l he firsl I i ne of l hal fiIe if you r eoen
i l, and nol al l he I i ne il vas on vhe n you cI osed l he fiIe.
An examI e of l he us e of l he I ROM c omma nd l o mer ge I i nes f r om l vo fi I es
f oI I ovs:
Co mma n d Ac l i on
M1 0 ;)55 0'.#5 OAg >2:& 9"# RG+- i5:/2D#d >'0#
I ROM . XYZ. ,#0#D9 .#I '.</9F 0'.# Oh 2#&)'.5 D/22#.9
M6 ;)55 0'.# Oh >2:& RG+-F 0'.#5 OAT >2:& ^[j
I ROM G#5#0#D9 RG+-
M1 4 ;)55 0'.# Z >2:& ^[jF 0'.#5 OOAOQ >2:& RG+-
I ROM . XYZ. G#5#0#D9 ^[j
M ;)55 0'.# OV >2:& RG+-F 9"# 2#59 :> ^[j
I ROM G#5#0#D9 RG+-
CI . XYZ. ?0:5# ^[j
M ;)55 9"# 2#59 :> RG+- i0'.#5 OT 9'00 #.8A:>A>'0#d
V3P3e3Q +/9</9 R'0#5
IDI T usuaI I y s ends oul ul l o l he fiIe vi l h f i I ename TO. Hove ve r , IDI T does
nol s e nd l he oul ul i mmedi al eI y. Il kees a cerl ai n numbe r of I i nes i n a que ue
i n mai n me mo r y as I ong as ossi bI e. The s e I i nes are r evi ous cur r enl I i nes or
I i nes l hal IDI T has as s ed bef or e r eachi ng l he r es enl cur r enl I i ne. The num-
ber of I i nes l hal IDI T can kee de e nds on l he ol i ons you seci f i ed vh e n
you caI I ed IDI T. ecaus e IDI T kees l hese I i nes, il has l he caabi I i l y f or
movi ng bac kvar d i n l he sour ce.
To associ al e l he oul ul queue vi l h a fiIe ol her l han l hal vi l h l he f i I ename
TO, you c an aI so us e l he TO c omma nd. The TO c o mma nd has l he f or m
138 AMIGADO5 U5ER'5 MANUAL
TO . s.
vhe r e " s " i s a f i I ename.
Wh e n IDI T execul es a TO c omma nd, il vri l es oul l he exi sl i ng que ue of
oul ul I i nes if l he oul ul fiIe is s vi l ched.
IDI T does nol cI ose an oul ul fiIe vhe n il is no I onger cur r enl . y r e-
seI ecl i ng l he fi I e, you can add f url her I i nes lo il. The f oI I ovi ng examI e s hovs
ho v you can sI i l u l he source be l ve e n l he mai n desl i nal i on T O and an
aI l ernal e desl i nal i on XYZ.
Cnmma nd Act i nn
M i I ;)55 0'.#5 OAOh 9: !+
TO. XYZ. ,I'9D" :/9</9 >'0#
M2 1 ;)55 0'.#5 OOAPh 9: ^[j
T O
M3 1 ;)55 0'.#5 POAQh 9: !+
TO. XYZ.
M41 ;)55 0'.#5 QOAVh 9: ^[j
T O
If you vanl l o r eus e a fi I e, you mus l exI i ci lI y cI ose i l. The c o mma nd
CI . f i I ename.
cI oses l he fiIe vi l h l he f i I ename you seci f y as l he ar gumenl .
The s e i nul / oul ul c omma nds are usef uI vhe n you vanl lo move arl of l he
sour ce fiIe lo a I aler I ace i n l he oul ul . Ior examI e,
Cnmma nd Act i nn
T O . : T/ 1. +/9</9 9: 9#&<:2)2= >'0#
1000N %8C).D# 9"2:/(" 5:/2D#
T O G#C#29 9: !+
CI . : T/ 1. ?0:5# :/9</9 >'0# N!30
12000. : T/ 1. G#/5# )5 '.</9 >'0#
If you us e l he CI c omma nd on fiIes you have f i ni shed vi l h, l he amounl of
me mor y you ne e d is mi ni mi zed.
V3P3g B::<5
You c an l ye an uns i gned deci maI numbe r bef or e ma ny c omma nds l o i ndi cal e
reel i l i on, f or examI e,
EDITTHE LINE EDITOR
139
84N
You can aI so seci f y r eeal counl s for c omma nd gr ous i n l he s ame va y as
for i ndi vi duaI c omma nds , for examI e,
12(F/handsnmc/, E/handsnmc/hansnm/, 3N)
If you gi ve a r eeal counl of zer o ( 0) , l he c omma nd or c o mma nd gr ou is
r eeal ed i ndef i ni l eI y or unl i I IDI T r eaches l he e nd of l he sour ce.
V3P3Oh 70:K)0 +<#2)9':.5
GI obaI oer al i ons are oer al i ons l hal l ake I ace aul omal i caI I y as IDI T scans
l he s our ce i n a f or var d di recl i on. You can slarl and sl o gI obaI oer al i ons vi l h
seci aI c omma nds , descri bed i n l he f oI I ovi ng secl i ons.
W A R N I N G : e caref uI vhe n you move bac kvar d l hr ough l he sour ce
nol l o I eave any acl i ve or " e na b I e d" gI obaI s. Thes e enabI ed gI obaI s couI d
undo a Iol of your vor k!
V3P3Oh3O ,#99'.( 70:K)0 ?").(#5
Thr e e c omma nds , GA, G, and GI ar e r ovi ded f or s i mI e sl ri ng c ha nge s
on each I i ne. Thei r synl ax is as f oI I ovs:
G A q/s/l/
G q/s/l/
GI q/s/l/
The s e c omma nds aI y an A, , or I c omma nd, as ar or i al e, l o any
occur r ence of sl ri ng " s " i n a ne v cur r enl I i ne. The y aI so aI y l o l he I i ne l hal
is cur r enl al l he l i me l he c omma nd is execul ed.
G c omma nds do nol r escan l hei r r eI acemenl lexl, f or examI e, l he f oI I ov-
i ng c omma nd
GE/Tigcr Li!y/Tigcr Li!y/
vouI d nol I oo f orever , bul vouI d have no vi si bI e ef f ecl on any I i ne. Hove ve r ,
as a resuI l of l he " c h a n g e " , IDI T vouI d veri f y cerl ai n I i nes.
IDI T aI i es l he gI obaI c hanges l o each n e v cur r enl I i ne i n l he or der i n
vhi c h you gave l he c omma nds .
140
AMIGADO5 U5ER'5 MANUAL
V3P3Oh3P ?).D#00'.( 70:K)0 ?").(#5
The RIWI ND c omma nd canceI s aII gI obaI oer al i ons aul omal i caI I y. You can
us e l he CG ( CanceI GI obaI ) c omma nd l o canceI i ndi vi duaI c omma nds al any
l i me.
Wh e n a gI obaI oer al i on is sel u by one of l he c omma nds GA, G, or GI,
l he oer al i on is aI I ocal ed an i denl i f i cal i on numbe r vhi c h is oul ul l o l he
veri f i cal i on fiIe (for examI e, GI ) . The ar gumenl f or CG is l he numbe r of l he
gI obaI oer al i on lo be canceI I ed. If CG is execul ed vi l h no ar gumenl , IDI T
canceI s aI I gI obaI s.
V3P3Oh3Q ,/5<#.8'.( 70:K)0 ?").(#5
Yo u can s us e nd i ndi vi duaI gI obaI oer al i ons, and I al er r e s ume us i ng l he m
vi l h DG ( Di sabI e GI obaI ) and IG ( InabI e GI obaI ) c omma nds . The s e l ake l he
gI obaI i denl i f i cal i on numbe r as l hei r ar gumenl . If you omi l l he ar gumenl ,
aII gI obaI s are l ur ned off or on ( di sabI ed or enabI ed) , as ar or i al e.
V3P3OO *'5<0)='.( 9"# ;2:(2)& ,9)9#
Tvo c omma nds begi nni ng vi l h S H (for S Hov) oul ul i nf or mal i on aboul l he
sl al e of IDI T lo l he veri f i cal i on fi I e.
The c o mma nd S HD ( SHov Dal a) l akes l he f or m
S HD
and di sI ays s aved i nf or mal i on vaI ues, s uch as l he I asl sear ch exr essi on.
The c omma nd S HG ( SHov GI obaI s) l akes l he f or m
S HG
and di sI ays l he currenl gI obaI c omma nds , l ogel her vi l h l hei r i denl i f i cal i on
numbe r s . Il aI so gi ves l he numbe r of l i mes each gI obaI search exr essi on
mal c hes .
V3P3OP !#2&'.)9'.( ). J*H! G/.
To " vi n d l hr ough" l he resl of l he sour ce, you us e l he W c omma nd ( Wi ndu) .
Nol e l hal W is i I I egaI if oul ul is nol currenl I y di recl ed l o TO. IDI T exi l s vhe n
il has r eac hed l he end of l he sour ce, cI osed aII l he fi I es, and r eI i nqui shed l he
me mor y. Reachi ng l he e nd of l he hi ghesl I eveI c omma nd fiIe has l he s ame ef f ecl
as W. If you caII IDI T seci f yi ng onI y l he I ROM f i I ename, IDI T r e name s l he
l emor ar y oul ul fiIe il creal ed vi l h l he s ame na me as l he ori gi naI ( l hal i s, l he
I R O M f i I ename) , vhi I e il r enames l he ori gi naI i nf or mal i on as l he fiIe : T/ IDI T-
EDITTHE LINE EDITOR
141
ACKUI. Thi s bac ku fiIe i s, of cour s e, onI y avai I abI e unl i I l he nexl l i me IDI T
i s r un.
The S TOI c omma nd sl os IDI T i mmedi al eI y. No f url her i nul or oul ul i s
al l eml ed. I n arl i cuI ar, l he S TOI c omma nd sl os IDI T f r om over vr i l i ng l he
ori gi naI source fi I e. Tyi ng S TOI ens ur es l hal no c hange i s ma de l o l he i nul
i nf or mal i on.
The Q c o mma n d s l os IDI T f r om exec ul i ng l he c ur r enl c o mma n d fi Ie
( IDI T i ni li aI I y accel s c omma nds f r om l he keyboar d, bul you can seci f y
a c o mma nd fiI e vi l h l he WI TH keyvor d or vi l h l he C c omma nd) a nd ma ke s
il reverl l o l he r evi ous one. A Q al l he oul er mos l I eveI does l he s ame
as a W.
V3P3OQ ?/22#.9 B'.# Y#2'>'D)9':.
The f oI I ovi ng ci r cumsl ances can cause aul omal i c veri f i cal i on l o occur:
Wh e n you l ye a ne v I i ne of c omma nds f or a currenl I i ne l hal IDI T has
nol ver i f i ed s i nce il ma de l he I i ne c ur r enl , or c ha ng e d s i nc e l he I asl
veri f i cal i on.
Wh e n IDI T has move d asl a I i ne l hal il has c hanged, bul nol yel veri f i ed.
Wh e n IDI T di sI ays an error mes s age.
I n l he fi rsl l vo cases, l he veri f i cal i on onI y occurs i f l he V svi l ch is on. The
c o mma nd
V s v
c hanges l he sel l i ng of l he V svi l ch. Il i s sel O N (V + ) if l he i ni li aI sl al e of IDI T
is i nl eracl i ve ( c ommands and veri f i cal i ons bol h c onnec l ed lo a l er mi naI ) , and
l o OII (V-) ol her vi s e.
To exI i ci lI y r equesl veri f i cal i on of l he cur r enl I i ne, you us e l he f oI I ovi ng
c omma nd:
?
Thi s c omma nd veri f i es l he currenl I i ne. Il is er f or med aul omal i caI I y if l he V
svi l ch i s on and l he i nf or mal i on i n l he I i ne has be e n c hanged. The veri f i cal i on
consi sl s of l he I i ne numbe r (or + + + + if l he I i ne is nol ori gi naI ) , vi l h l he
l exl on l he nexl I i ne.
An aI l ernal e f or m of veri f i cal i on, usef uI f or I i nes conl ai ni ng nonr i nl i ng
char acl er s, is r ovi ded by l he c omma nd
142
AMIGADO5 U5ER'5 MANUAL
The ! c o mma nd veri fi es l he currenl I i ne vi l h characl er i ndi cal ors. IDI T
r oduces l vo I i nes of veri f i cal i on. The firsl is l he currenl I i ne i n vhi c h IDI T
r eI aces aII l he nongr ahi c characl ers vi l h l he firsl characl er of l hei r hexadeci -
maI vaI ue. In l he s econd I i ne, IDI T di sI ays a mi nus si gn under aII l he
osi l i ons cor r es ondi ng l o uer c as e I el l ers and l he s ec ond hexadec i maI di gi l
i n l he osi l i ons cor r es ondi ng lo nongr ahi c characl ers. AII ol her osi l i ons
conl ai n sace char acl er s.
The f oI I ovi ng examI e uses l he ` and ! c omma nds . To veri f y l he cur r enl
I i ne, you us e l he ` c omma nd. If, f or i nsl ance, l he f oI I ovi ng aear s vhe n you
us e l he ` c omma nd:
?
1.
Thc Wa!rus and thc ??
l hen you mi ghl lry l o us e l he I c omma nd l o exc hange " ` ` " f or " Ca r e nl e r " .
Hove ve r , IDI T ma y nol r ecogni ze l he l exl il di sI ayed vi l h " ` ` " as l vo
quesl i on mar ks if l he " ` ` " characl ers cor r es ond l o l vo nongr ahi c charac-
l ers. To f i nd oul vhal reaI I y is l her e, you us e l he ! c omma nd as f oI I ovs:
!
1.
Thc Wa!rus and thc 11
- - 44
To correcl l he I i ne, you can us e l he characl er oi nl er and - c omma nd l o
deI el e l he sur i ous characl ers bef or e i nserl i ng l he correcl lexl . ( Ior f url her
del ai I s on us i ng l he characl er oi nl er and - c omma nd, see Secl i on 4. 2. 4, Li ne
Wi ndovs . )
V3P3OV -'5D#00).#:/5 ?:&&).85
Thi s secl i on descri bes aII l hose c omma nds l hal do nol fil neal I y i nl o any of l he
r evi ous cal egori es. Il descri bes hov l o c hange a l er mi nal i on characl er, l ur n
lrai I i ng saces off, r e numbe r I i nes, and r evi nd l he source fiIe.
To c hange l he l er mi nal or for l exl i nserl i on, you us e l he Z c omma nd. The Z
c o mma nd has l he f oI I ovi ng f or m:
Z/s/
vhe r e /s/ r er esenl s a sl ri ng. The sl ri ng may be of any I engl h u l o 16
char acl er s. The sl ri ng is mal c hed i n ei l her case. In ef f ecl , l he sear ch f or l he
l er mi nal or is done usi ng l he quaI i fi ers IU. The iniliaI l er mi nal or sl ri ng is Z.
EDITTHE LINE EDITOR
143
To l urn lrai I i ng saces on or off, you us e l he TR ( TRai I i ng saces) c omma nd.
The TR c omma nd l akes l he f oI I ovi ng f or m:
TR s v
vhe r e s v r er esenl s a svi l ch ( + for ON, - f or OII) . IDI T usuaI I y s ur es s es
aII lrai I i ng s aces . T R + aI I ovs lrai I i ng saces l o r emai n on bol h i nul and
oul ul I i nes.
To r e numbe r l he sour ce I i nes, you us e l he c omma nd. The c o mma nd
l akes l he f or m:
n
vhe r e " n " r er esenl s a number . The c omma nd n sel s l he currenl I i ne
numbe r lo " n " . If you l hen move l o l he I i nes beI ov l he cur r enl I i ne, IDI T
r enumber s aII l he f oI I ovi ng ori gi naI and nonori gi naI I i nes. AI l hough, if you
move bac k lo r evi ous I i nes af l er usi ng l he c omma nd, IDI T mar ks aII l he
r evi ous I i nes i n l he oul ul queue as nonor i gi naI . Wh e n you r evi nd l he
sour ce fi I e, IDI T r enumber s aII l he I i nes i n l he fi I e-ori gi naI , nonor i gi naI , and
l hos e revi ousI y r enumber ed vi l h l he c omma nd.
To r evi nd l he source fi I e, you us e l he RI WI ND c omma nd. Ior examI e,
RIWI ND
Thi s c omma nd r evi nds l he i nul fiIe so l hal I i ne 1 is l he cur r enl I i ne
agai n. Ii rsl IDI T s cans l he resl of l he sour ce (for gI obaI s, and s o f or l h) .
The n il vri l es l he I i nes lo l he desl i nal i on, vhi c h is l hen cI osed and re-
oe ne d as a ne v sour ce. Il cI oses l he ori gi naI source us i ng a l emor ar y
fiIe as a desl i nal i on. Any gI obaI s l hal you seci f y are canceI I ed. IDI T does
nol necessari I y requi re you lo l ye l he comI el e vor d (lhal i s, RIWI ND) . To
move lo l he begi nni ng, you can l ye any of l he f oI I ovi ng: RIWI , RIWI N, or
RIWI ND.
V3P3OT %K).8:.'.( H.9#2)D9'C# J8'9'.(
To abandon mos l c omma nds l hal r ead l exl , you r ess CTRL- C. In arl i cuI ar, if
you reaI i ze l hal a sear ch exr essi on has be e n mi s l yed, l hen CTRL- C sl os l he
sear ch. Si mi I arI y l he T c omma nd l yes lo l he end of l he sour ce, bul CTRL- C
abandons l hi s acl i on.
Af l er you r ess CTRL- C, IDI T r es onds vi l h l he mes s age
BREAK
144 AMIGADO5 U5ER'5 MANUAL
and r el ur ns l o r eadi ng c omma nds . The cur r enl I i ne does , of cour s e, de e nd on
exacl I y vh e n you r es s ed CTRL- C.
a/'DM G#>#2#.D# ?)28
Thi s Iisl us es l he f oI I ovi ng abbrevi al i ons:
Nnt at i nn Dcscr i pt i nn
qs QuaI i f i ed sl ri ng
l Sl ri ng
n Li ne numbe r , or . or( currenl and I asl I i ne)
s v + or - ( on or off)
?")2)D9#2 ;:'.9#2 ?:&&).85 iB'.# L'.8:I ?:&&).85d
Cnmma nd Act i nn
<
Move characl er oi nl er I efl
5
Move characl er oi nl er ri ghl
!
DeI el e characl er al oi nl er
$
Lover case characl er al oi nl er
! Ue r case characl er al oi nl er
!
Tur n characl er al oi nl er lo sace
IA qs Move characl er oi nl er lo af l er qs
I qs Move characl er oi nl er lo bef or e qs
IR Resel characl er oi nl er l o slarl of I i ne
;:5'9':.'.( ?:&&).85
Cnmma nd Act i nn
M n Move lo I i ne n
M + Move l o hi ghes l I i ne i n me mor y
M - Move l o I ovesl I i ne i n me mor y
N Nexl I i ne
I Irevi ous I i ne
RIWI ND Revi nd i nul fiIe
,#)2D" ?:&&).85
Cnmma nd Act i nn
I qs Ii nd sl ri ng qs
I qs Sa me as I, bul move backvar d l hr ough fiIe
DI qs Sa me as I, bul deI el e I i nes as l hey are as s ed
EDITTHE LINE EDITOR 145
!#X9 Y#2'>'D)9':.
Cnmma nd Act i nn
` Veri f y currenl I i ne
! Veri f y vi l h characl er i ndi cal ors
T Tye l o e nd of fiIe
Tn Tye n I i nes
TLn Tye n I i nes vi l h I i ne numbe r s
TN Tye unl i I buf f er c hanged
TI M- , l hen l ye l o I asl I i ne i n buf f er
V s v Sel veri f i cal i on on or off
+<#2)9':.5 :. 9"# ?/22#.9 B'.#
Cnmma nd Act i nn
A qs l II ace sl ri ng l af l er qs
AI qs l Same as A, bul move characl er oi nl er
qs l II ace sl ri ng l bef or e qs
I qs l Sa me as , bul move characl er oi nl er
CL l Concal enal e cur r enl I i ne, sl ri ng l, and nexl I i ne
D DeI el e currenl I i ne
DI A qs DeI el e f r om af l er qs l o e nd of I i ne
DI qs DeI el e f r om bef or e qs lo e nd of I i ne
DTA qs DeI el e f r om slarl of I i ne lo af l er qs
DT qs DeI el e f r om slarl of I i ne lo bef or e qs
I qs l Ixc hange slri ng qs vi l h sl ri ng l
II qs l Same as I, bul move characl er oi nl er
I I nserl mal eri aI f r om l ermi naI bef or e I i ne
I I I nserl f r om fiIe l
R ReI ace mal eri aI f r om l ermi naI
R l ReI ace mal eri aI f r om fiIe l
SA qs SI i l I i ne af l er qs
S qs SI i l I i ne bef or e qs
70:K)05
Cnmma nd Act i nn
GA qs l GI obaI I y I ace l afler qs
G qs l GI obaI I y I ace l bef or e qs
GI qs l GI obaI I y exchange qs for l
CG n CanceI gI obaI n (aII if n omi l l ed)
DG n Di sabI e gI obaI n (aII if n omi l l ed)
IG n InabI e gI obaI n (aII if n omi l l ed)
S HG Di sI ay i nf o on gI obaI s us ed
146 AMIGADO5 U5ER'5 MANUAL
H.</9`+/9</9 -).'</0)9':.
Co mma n d Acl i on
I ROM Take source f r om ori gi naI
I ROM l Take sour ce f r om fiIe l
TO Reverl lo ori gi naI desl i nal i on
TO l II ace oul ul I i nes i n fiIe l
CI l CI ose fiIe l
+9"#2 ?:&&).85
Co mma n d Acl i on
Reeal r evi ous A, , or I c omma nd
n Sel I i ne numbe r l o n
Cl Take c omma nds f r om fiIe l
Hn Sel haI l al I i ne n. If n l hen haI l and uns el h
Q
Ixi l f r om c omma nd I eveI , vi ndu if al I eveI 1
S HD S ho v dal a
S TOI Sl o
TR s v Sel / unsel lrai I i ng sace r emovaI
W Wi ndu
Zl Sel i nul l ermi nal or lo sl ri ng l
%<<#.8'X
Irror Codes and Messages
The error mes s age s l hal aear on l he screen vhe n you us e l he IAULT or
W H Y c omma nd faII i nl o l vo generaI cal egori es:
1. user errors
2. r ogr ammer errors.
Thi s aendi x gi ves l he robabI e cause and a suggesl i on f or r ecover y f or
eac h of l hes e error codes . The codes aear i n numer i caI or der vi l hi n l hei r
cal egor y.
45#2 J22:25
OhQN '.5/>>'D'#.9 >2## 59:2#
;2:K)K0# D)/5#N
You don' l have e nough hysi caI me mor y on l he Ami ga l o carry l hi s oer a-
l i on oul .
G#D:C#2= 5/((#59':.N
Ii rsl, l ry l o sl o s ome of l he aI i cal i ons l hal are r unni ng l hal you don' l
ne e d. Ior examI e, cI ose any unnec es s ar y vi ndovs . Ol her vi s e, buy mor e
me mor y. Sl o s ome of l he l asks l hal are I ess i mor l anl lo you and r ei ssue l he
c omma nd. Il ma y be l hal you have e nough me mor y, bul il has be c ome
" f r a gme nl e d" , r ebool i ng ma y heI .
OhVN 9)5M 9)K0# >/00
;2:K)K0# D)/5#N
Li mi l ed lo 20 CLI l asks, or equi vaI enl .
220: )2(/&#.9 0'.# '.C)0'8 :2 9:: 0:.(
;2:K)K0# D)/5#N
Your ar gumenl for lhi s c omma nd is i ncorrecl or conl ai ns l oo ma ny ol i ons.
G#D:C#2= 5/((#59':.N
Cons uI l l he c omma nd seci f i cal i ons i n Chal er 2 of l hi s manuaI f or l he
correcl ar gumenl l emI al e.
148 AMIGADO5 U5ER'5 MANUAL
221: >'0# '5 .:9 ). :K1#D9 &:8/0#
;2:K)K0# D)/5#N
Ii l her you mi sseI I ed l he c omma nd na me , or lhi s fiIe ma y nol be i n I oadabI e
fiIe f or m.
G#D:C#2= 5/((#59':.N
Ii l her r el ye l he fiIe na me , or make sure l hal l he fiIe is a bi nar y r ogr am
fi I e. Re me mbe r l hal i n or der l o execul e a c omma nd s equenc e l he c omma nd
IXICUTI mus l be us ed bef or e l he fiIe name .
122: '.C)0'8 2#5'8#.9 0'K2)2= 8/2'.( 0:)8
PhPN :K1#D9 '. /5#
;2:K)K0# D)/5#N
The fiIe or di recl ory seci f i ed is aI ready bei ng us e d by anol her aI i cal i on i n
a ma nne r i ncomal i bI e vi l h l he va y you vanl lo us e il.
G#D:C#2= 5/((#59':.N
If anol her aI i cal i on i s vri l i ng lo a fi I e, l hen nobody eI se can r ead f r om il. If
anol her aI i cal i on is r eadi ng f r om a fi I e, l hen nobody eI se can vri l e l o il. If an
aI i cal i on is us i ng a di recl ory or r eadi ng f r om a fi I e, l hen nobody eI se ma y
deI el e or r e name l he fiIe or di recl ory. You mus l sl o l he ol her aI i cal i on
us i ng l he fiIe or di recl ory and l hen lry agai n.
PhQN :K1#D9 )02#)8= #X'595
;2:K)K0# D)/5#N
The ob| ecl na me l hal you seci f i ed is l hal of an ob| ecl l hal aI ready exi sl s.
G#D:C#2= 5/((#59':.N
You mus l fi rsl deI el e l he di recl ory or fiIe if you reaI I y va nl lo r eus e l hal
na me .
PhVN 8'2#D9:2= .:9 >:/.8
PhTN :K1#D9 .:9 >:/.8
;2:K)K0# D)/5#N
Ami g a DOS c annol f i nd l he devi ce or fiIe you seci f i ed. You have r obabI y
ma de a l yogr ahi caI or seI I i ng error.
G#D:C#2= 5/((#59':.N
Che c k devi ce na me s and f i I enames for correcl seI I i ngs. You aI so gel l hi s
error if you al l eml l o creal e a fiIe i n a di recl ory l hal does nol exi sl.
PhZN '.C)0'8 I'.8:I
;2:K)K0# D)/5#N
Yo u have ei l her made l he di mens i ons l oo bi g or l oo smaI I , or you have fai I ed
lo def i ne an enl i re vi ndov. (Ior examI e, you mus l nol f orgel l he fi naI sI ash. )
APPENDIX: ERROR CODE5 AND ME55AGE5 149
Yo u can aI so gel l hi s error f r om NIWCLI if you suI y a devi ce na me l hal i s
nol a vi ndov.
G#D:C#2= 5/((#59':.N
You s houI d reseci f y l he vi ndov.
220: '.C)0'8 592#)& D:&<:.#.9 .)&#
;2:K)K0# D)/5#N
You have i ncI uded an i nvaI i d characl er i n l he f i I ename you have seci f i ed, or
l he f i I ename is l oo I ong. Iac h fiIe or di recl ory mus l be I ess l han 30 characl er s
I ong. A f i I ename c annol conl ai n conl roI characl ers.
222: :K1#D9 .:9 :> 2#b/'2#8 9=<#
;2:K)K0# D)/5#N
Maybe you' ve l ri ed l o do an oer al i on l hal requi res a f i I ename and you gave
il a di recl ory na me or C'D# C#25)3 Ior examI e, you mi ghl have gi ven l he
c o mma nd TYII di r, vhe r e " di r " is a di recl ory. Ami ga DOS does n' l aI I ov you
lo di sI ay a di recl ory, onI y fi I es.
G#D:C#2= 5/((#59':.N
Che c k on l he c omma nd us age i n Chal er 2 of l he %&'()*+, 45#265 -)./)0
i n l hi s book.
223: 8'5M .:9 C)0'8)9#8
;2:K)K0# D)/5#N
Ii l her you | us l i nserl ed a di sk and l he di sk vaI i dal i on r ocess is i n r ogr es s ,
or il ma y be a bad di sk.
G#D:C#2= 5/((#59':.N
Wai l f or l he di sk vaI i dal i on r ocess lo f i ni shi l nor maI I y onI y l akes I ess
l han a mi nul e. If Ami ga DOS c annol vaI i dal e l he di sk becaus e il i s bad, l he n
l he di sk r emai ns unvaI i dal ed. I n l hi s case, you can onI y r ead f r om l he di sk a nd
you mus l coy your i nf or mal i on onl o anol her di sk.
224: 8'5M I2'9#A<2:9#D9#8
;2:K)K0# D)/5#N
Thi s di sk is vr i l e- r ol ecl ed. The Ami ga c annol vri l e over i nf or mal i on l hal i s
aI ready on l he di sk. You can onI y read i nf or mal i on f r om lhi s di sk. You c annol
sl ore any i nf or mal i on of your ovn her e.
G#D:C#2= 5/((#59':.N
Save your i nf or mal i on on a di sk l hal is nol vr i l e- r ol ecl ed, or c hange l he
vri l e- rol ecl l ab on l he di sk.
225: 2#.)&# )D2:55 8#C'D#5 )99#&<9#8
;2:K)K0# D)/5#N
RINAMI onI y c hanges a f i I ename on l he s ame devi ce, aI l hough you can us e
150 AMIGADO5 U5ER'5 MANUAL
il l o r e na me a fiIe f r om one di recl ory i nl o anol her on l he s ame devi ce.
G#D:C#2= 5/((#59':.N
Coy l he fiIe lo l he ob| ecl devi ce and deI el e il f r om l he sour ce devi ce.
POZN 8'2#D9:2= .:9 #&<9=
;2:K)K0# D)/5#N
You c annol deI el e a di recl ory unI ess il is eml y.
G#D:C#2= 5/((#59':.N
DeI el e l he conl enl s of l he di recl ory. Sl udy l he c omma nd seci f i cal i on f or
DILITI i n Chal er 2 of l hi s manuaI .
POeN 8#C'D# .:9 &:/.9#8
;2:K)K0# D)/5#N
The vor d " mo u n l e d " her e me a ns " i ns er l ed i nl o l he dr i ve" , ei l her you' ve
ma de a l yogr ahi caI error, or l he di sk vi l h l he desi red na me i sn' l mounl e d.
G#D:C#2= 5/((#59':.N
Che c k l he seI I i ng of l he devi ces, or i nserl l he correcl di sk.
220: D:&&#.9 9:: K'(
;2:K)K0# D)/5#N
Your f i I enol e has exceeded l he ma xi mum numbe r of characl ers aI I oved
( 80) .
G#D:C#2= 5/((#59':.N
Rel ye l he f i I enol e adher i ng lo l hese I i mi l s.
2 2 1 : 8'5M >/00
;2:K)K0# D)/5#N
Yo u do nol have suffi ci enl r oom on l he di sk lo do lhi s oer al i on.
G#D:C#2= 5/((#59':.N
Us e anol her di sk or deI el e s ome unnec es s ar y fiIes or di recl ori es.
222: >'0# '5 <2:9#D9#8 >2:& 8#0#9':.
;2:K)K0# D)/5#N
The fiIe or di recl ory has be e n r ol ecl ed f r om deI el i on.
G#D:C#2= 5/((#59':.N
You ei l her di d nol me a n lo deI el e l hal fi I e, or you reaI I y di d me a n il. If
you reaI I y di d me a n il, you mus l us e l he IROTICT c omma nd l o aI ler l he
r ol ecl i on sl al us. Ref er l o l he IROTICT c omma nd i n Chal er 2. AI s o us e
l he LI ST c o mma nd lo check on vhal l he rol ecl i ons of l hi s arl i cuI ar fiIe or
di sk are.
223: >'0# '5 <2:9#D9#8 >2:& I2'9'.(
;2:K)K0# D)/5#N
APPENDIX: ERROR CODE5 AND ME55AGE5 151
The fiIe or di recl ory has been r ol ecl ed f r om bei ng over vr i l l en.
G#D:C#2= 5/((#59':.N
Yo u ei l her di d nol me a n l o vri l e l o l hal fi I e, or you reaI I y di d me a n i l. If you
reaI I y di d me a n il, you mus l us e l he IROTICT c omma nd lo aI l er l he r ol ec-
l i on sl al us. Ref er lo l he IROTICT c omma nd i n Chal er 2. AI s o us e l he
LI ST c omma nd lo check on l he rol ecl i ons of l hi s arl i cuI ar fiIe or di sk.
PPVN >'0# '5 <2:9#D9#8 >2:& 2#)8'.(
;2:K)K0# D)/5#N
The fiIe or di recl ory has be e n r ol ecl ed f r om bei ng r ead.
G#D:C#2= 5/((#59':.N
Yo u ei l her di d nol me a n lo r ead f r om l hal fi I e, or you reaI I y di d me a n il. If
you reaI I y di d me a n il, you mus l us e l he IROTICT c omma nd lo aI ler l he
r ol ecl i on sl al us. Ref er l o l he IROTICT c omma nd i n Chal er 2. AI so us e l he
LI ST c omma nd l o check on l he rol ecl i ons of l hi s arl i cuI ar fiIe or di sk.
225: .:9 ) *+, 8'5M
;2:K)K0# D)/5#N
The di sk i n l he dri ve is nol a f or mal l ed DOS di sk.
G#D:C#2= 5/((#59':.N
II ace a sui l abI y f or mal l ed DOS di sk i n l he dri ve i ns l ead, or eI se f or mal l he
di sk us i ng l he I ORMAT c omma nd if you don' l vanl any of l he i nf or mal i on on
il.
226: .: 8'5M '. 82'C#
;2:K)K0# D)/5#N
Yo u have al l eml ed lo r ead or vri l e lo a di sk dri ve vher e l her e is no di sk.
G#D:C#2= 5/((#59':.N
II ace a sui l abI y f or mal l ed DOS di sk i n l he dri ve.
;2:(2)&&#2 J22:25
PhgN <)DM#9 2#b/#59 9=<# /.M.:I.
;2:K)K0# D)/5#N
You have as ked a devi ce handI er lo al l eml an oer al i on il c annol do (for
examI e, l he consoI e handI er cannol r ename anyl hi ng) .
G#D:C#2= 5/((#59':.N
Che c k l he r eques l code as s ed lo devi ce handI er s.
2 1 1 : '.C)0'8 :K1#D9 0:DM
;2:K)K0# D)/5#N
You have us ed s omel hi ng l hal is nol a vaI i d I ock.
152 AMIGADO5 U5ER'5 MANUAL
G#D:C#2= 5/((#59':.N
Che c k your c ode so l hal you onI y ass vaI i d I ocks lo Ami g a DOS caIIs l hal
execl I ocks.
POgN 5##M #22:2
;2:K)K0# D)/5#N
Yo u have al l eml ed lo caII SIIK vi l h i nvaI i d ar gumenl s .
G#D:C#2= 5/((#59':.N
Ma ke sure l hal you onI y SIIK vi l hi n l he fi I e. You c annol SIIK oul si de
l he bounds of l he fi I e.
232: .: &:2# #.92'#5 '. 8'2#D9:2=
;2:K)K0# D)/5#N
Ther e are no mor e enl ri es i n l he di recl ory l hal you are exami ni ng.
G#D:C#2= 5/((#59':.N
Thi s error code i ndi cal es l hal l he Ami ga DOS caII IXNIXT has no mor e
enl ri es i n l he di recl ory you are exami ni ng lo hand back l o you. Sl o caI I i ng
IXNIXT.
70:55)2=
Ar gumcnt s
Addi l i onaI i nf or mal i on suI i ed lo c omma nds .
Char act cr pni nt cr
Ioi nl er l o l he Iefl edge of a I i ne vi ndov i n IDI T. You us e il l o def i ne l he
arl of a I i ne l hal IDI T ma y aI ler.
Char act cr st ri ng
Se que nc e of ri nl abI e characl ers.
Cnmma nd
An i nsl rucl i on you gi ve di reclI y lo l he c omul er .
Cnmma nd Li nc Int crIacc ( CLI)
A pr nccss l hal dec odes us er i nul .
Cnnsn! c hand! cr
See t cr mi na! hand! cr .
Cnmma nd t cmp! at c
The me l hod of def i ni ng l he synl ax f or each c nmmand.
Cnnt rn! cnmbi nat i nn
A combi nal i on of l he CTRL key and a I el l er or symboI . The CTRL key is
r es s ed dovn vhi I e l he I el l er or s ymboI i s l yed. Il aear s i n l he doc u-
menl al i on, f or examI e, i n l he f or m CTRL- A.
Cur r cnt cursnr pnsi t i nn
The osi l i on l he cursor is currenl I y al.
APPENDIX: GLO55ARY
153
Cur r enl di recl or y
Thi s is ei l her l he rool di recl ory or l he I asl di recl ory you sel your seI f i n vi l h
l he c o mma nd CD.
Cur r enl dr i ve
The di sk dri ve l hal is i nser l ed and decI ared lo be currenl . The def auI l is
SYS: .
Cur r enl I i ne
The I i ne l hal IDI T has i n ils ha nd al any lime.
Cur r enl sl r i ng aI l eral i on c omma nd
An i nsl rucl i on l hal c hanges l he cur r enl sl ri ng.
De I i mi l e r characl ers
Char acl er s us ed al l he begi nni ng and end of a characl er sl r i ng.
Des l i nal i on f i I e
Ii I e bei ng vri l l en l o.
De vi c e na me
Uni que na me gi ven lo a devi ce, e. g. DIO: f I oy dri ve 0: .
Di r ecl or y
A coI I ecl i on of f i I es .
Idi l i ng c omma nds
Co mma nds i nul f r om l he keyboar d l hal conl roI an edi l i ng sessi on.
Ixl ended mo de
Co mma nds aear on l he c omma nd I i ne and are nol execul ed unl i I you
fi ni sh l he c omma nd I i ne.
Ii I e
A coI I ecl i on of reI al ed dal a.
Ii I e na me
A na me gi ven lo a fiIe f or i denl i f i cal i on ur os es .
I mme di a l e mode
Co mma nds l hal are execul ed i mmedi al eI y.
Ke yvor d
Ar gume nl s l o c omma nds l hal mus l be sl al ed exI i ci lI y.
Li ne vi ndovs
Iarl s of a I i ne for IDI T lo execul e s ubs equenl c omma nds on.
Me mo r y
Thi s i s s omel i mes knovn as sl ore and is vher e a c omul er sl ores ils dal a
and i nsl rucl i ons.
MuI l i - r oc es s i ng
The execul i on of l vo or mor e r oces s es i n araI I eI , l hal i s, al l he s ame
lime.
Oul ul que ue
uf f er i n me mor y hoI di ng dal a bef or e bei ng vri l l en oul lo f i I e.
Iri ori l y
The reI al i ve i mor l ance of a r oces s .
154
AMIGADO5 U5ER'5 MANUAL
Prnccss
A | ob r eques l ed by l he oer al i ng s ys l em or l he user .
Qua! i I i cr s
Char acl er s l hal seci f y addi l i onaI condi l i ons f or l he conl exl i n sl ri ng.
Qua! i I i cd st ri ng
A sl ri ng r ec eded by one or mor e quaI i f i ers.
Quc uc
See Out put qucuc.
Rnnt di rcct nry
The l o I eveI i n l he fi I i ng s ys l em. Fi ! cs and di rcct nri cs vi l hi n l he rool
di recl ory have l hei r name s r ec eded by a coI on (: ).
5cqucnt i a! Ii!cs
A Ii!c l hal can be accessed al any oi nl by sl arl i ng al l he begi nni ng and
s canni ng sequenl i aI I y unl i I l he oi nl is r eached.
5nur cc Ii!c
Fi ! c bei ng r ead f r om.
5ynt ax
The f or mal or " g r a mma r " you us e for gi vi ng a c omma nd.
Tcr mi na! hand! cr
A pr nccss handI i ng i nul and oul ul f r om l he l ermi naI or cons oI e.
Vn! umc namc
The uni que na me associ al ed vi l h a di sk.
Wi ! d card
SymboI s us e d l o mal c h any al l ern.
%&'()*+, *#C#0:<#26
-)./)0
Cnntcnts
1. Prngramming nn thc Amiga
2. Ca!!ing AmigaDO5
3. Thc Macrn Asscmb!cr
4. Thc Linkcr
Appcndix: Cnnsn!c Input and Output nn thc Amiga
45'.( ;2#>#2#.D#5
The def auI l l exl si ze on l he Ami ga aI I ovs u l o 60 characl ers er I i ne i n a
f uI I - vi dl h CLI vi ndov. Ma ny deveI oer s ref er lo us e 80 characl er s er I i ne.
You can c hange l he l exl slyI e by us i ng l he Ir ef er ences l ooI f r om your Wor k-
be nc h di sk, hove ve r , l he ne v lexl vi dl h vi I I nol necessari I y l ake ef f ecl on any
vi ndovs l hal you currenl I y have oe ne d. Thal i s, any oI d vi ndovs i n l he
s ys l em r emai n vi l h a l exl si ze of 60. To i ncororal e lexl si ze i nl o l he s ys l em,
you ne e d l o creal e a ne v vi ndov, seI ecl l he oI d vi ndov, and f i naI I y deI el e
l he oI d vi ndov.
IoI I ov l hese sl es:
1. Us e l he NIWCLI c omma nd.
2. SeI ecl l he oI d vi ndov.
3. Us e l he INDCLI c omma nd i n l he oI d vi ndov lo deI el e l he oI d vi ndov.
If you aI l er l he CLI seI ecl i on, l he c hange ma y nol l ake ef f ecl i mmedi al eI y. If
you save l he n e v r ef er ences and rebool , l hey l ake ef f ecl .
?")<9#2 O
Irogramming on lhe Amiga
Thi s chal er i nl r oduces l he r eader lo r ogr ammi ng i n C or As s embI er unde r
Ami ga DOS .
1.1 I nl r oducl i on
1. 2 Ir ogr am DeveI omenl for l he Ami ga
1. 2. 1 Gel l i ng Sl ar l ed
1. 2. 2 CaI I i ng Res i denl Li brari es
1. 2. 3 Cr eal i ng an Ixecul abI e Ir ogr am
1.3 Runni ng a Ir ogr am Unde r l he CLI
1. 3. 1 Ini li aI Invi r onmenl i n As s embI er
1. 3. 2 Ini li aI Invi r onmenl i n C
1. 3. 3 Iai I ure of Roul i nes
1. 3. 4 Ter mi nal i ng a Ir ogr am
1. 4 Runni ng a Ir ogr am Under l he Wor kbe nc h
1. 5 Cr oss De ve I ome nl
1. 5. 1 Cr oss DeveI omenl on a Sun Mi c r os ys l em
1. 5. 2 Cr os s De ve I ome nl Under MS - DOS
1. 5. 3 Cr os s De ve I ome nl on Ol her Comul er s
O3O H.92:8/D9':.
The Ami ga DOS r ogr ammi ng envi r onmenl is avai I abI e on l he Ami ga, Sun,
and I M IC.
Thi s manuaI as s umes l hal you have s ome fami I i ari ly vi l h ei l her C or As s e m-
bI er. Il does nol al l eml lo l each ei l her of l hes e I anguages . An i nl r oducl i on lo
C c an be f ound i n l he book !"# ? ;2:(2)&&'.( B).(/)(# by r i an W. Ker ni ghan
and Denni s M. Ri l chi e, ubI i s hed by Irenl i ce HaI I . Ther e are a numbe r of
books on vr i l i ng 68000 as s embI er , i ncI udi ng ;2:(2)&&'.( 9"# -?Zehhh by Ti m
Ki ng and ri an Kni ghl , ubI i shed by Addi s on Wes I ey.
158 AMIGADO5 DEVELOPER'5 MANUAL
O3P ;2:(2)& *#C#0:<&#.9 >:2 9"# %&'()
Thi s secl i on descri bes ho v lo deveI o r ogr ams for l he Ami ga. Il descri bes
vha l you ne e d bef or e you slarl, hov you can caII l he s ys l em r oul i nes, and
ho v l o creal e a fiIe l hal you can execul e on l he Ami ga.
W A R N I N G : ef ore you do ANYTHI NG, you shouI d make a bac ku c oy
of your s ys l em di sk. Ior i nsl rucl i ons, see l he secl i on, " ac ki ng U , " al
l he begi nni ng of l he %&'()*+, 45#265 -)./)0 i n lhi s book.
O3P3O 7#99'.( ,9)29#8
ef ore you slarl vri l i ng r ogr ams for l he Ami ga, you ne e d l he f oI I ovi ng
i l ems:
1. Doc umenl al i on on Ami ga DOS and ol her s ys l em r oul i nes l hal you can caI I .
Ior examI e, you ne e d l he %&'()*+, 45#265 -)./)0F G+- _#2.#0 -)./)0F
and ossi bI y l he %&'()*+, !#D".'D)0 G#>#2#.D# -)./)0 as veI I .
2. Doc umenl al i on on l he I anguage you i nl end lo us e . If you i nl end l o us e
As s embI er or C, l hen lhi s manuaI leI I s you hov lo us e l hes e l ooI s aI l hough
il does nol conl ai n any seci fi c i nf or mal i on nor maI I y f ound i n a I anguage
r ef er ence manuaI .
3. He ade r fiIes conl ai ni ng l he necessar y Ami ga sl rucl ure def i ni l i ons and l he
vaI ues f or caI I i ng l he s yl em r oul i nes l hal you need. Commodor e - Ami ga
rovi des l hese header fiIes as i ncI uded fiIes for ei l her C (usuaI I y endi ng i n . h)
or as s embI er ( endi ng i n . i ). To us e a arl i cuI ar r esi denl I i brary, you mus l
i ncI ude one or mor e header fiIes conl ai ni ng l he reI evanl def i ni l i ons. Ior
examI e, lo us e Ami ga DOS f r om C, you mus l i ncI ude l he fiIe " d o s . h " .
4. An as s embI er or comi I er ei l her r unni ng on l he Ami ga i lseI f or on one of
l he cross deveI omenl envi r onmenl s .
5. The Ami ga I i nker, agai n r unni ng on l he Ami ga or on anol her c omul er , as
veI I as l he sl andar d Ami ga I i brary conl ai ni ng f uncl i ons, i nl erf ace r oul i nes ,
and var i ous absoI ul e vaI ues.
6. TooI s lo dovnI oad rograms if you are usi ng a cross- deveI omenl envi ronmenl .
2. 2. 2 ?)00'.( G#5'8#.9 B'K2)2'#5
You s houI d nol e l hal l her e are l vo vays of caI I i ng s ys l em r oul i nes f r om a us er
as s embI y r ogr am. C r ogr ammer s si mI y caII l he f uncl i on as seci f i ed. You
usuaI I y caII a s ys l em roul i ne i n assembI er by I aci ng l he I i brary bas e oi nl er
PROGRAMMING ON THE AMIGA 159
f or l hal r esi denl I i brary i n regi sl er A6 and l hen | umi ng l o a sui l abI e negal i ve
of f sel f r om l hal oi nl er . The of f sel s are avai I abI e lo you as absoI ul e exl ernaI s i n
l he Ami ga I i brary, vi l h name s of l he f or m LVOna me . So, f or i ns l ance, a caII
couI d be } SR LVOname ( A6) , vher e you have I oaded A6 vi l h a sui labI e I i brary
bas e oi nl er . Thes e bas e oi nl ers are avai I abI e lo you f r om l he Oe nI i br a r y
caII l o Ixec, you can f i nd l he bas e oi nl er f or Ixec al I ocal i on 4 ( l he onI y
absoI ul e I ocal i on us ed i n l he Ami ga) . Thi s I ocal i on is aI so knovn as Abs Ixec as e
vhi c h is def i ned i n Ami ga. I i b. ( See l he G+- _#2.#0 -)./)0 f or f ur l her del ai I s
on Ixec. )
You c an caII cerl ai n RAM- bas e d resi denl I i brari es and l he Ami g a DOS I i brary
i n lhi s vay, if requi red. Nol e l hal l he Ami ga DOS I i brary is caI I ed " dos . I i br ar y" .
Hove ve r , you do nol ne e d lo us e A6 l o hoI d a oi nl er lo l he I i brary bas e, you
ma y us e any ol her regi sl er if you ne e d l o. I n addi l i on, you ma y caII Ami g a DOS
us i ng l he r esi denl I i brary caII f eal ure of l he I i nker. In l hi s cas e, si mI y c ode a
} SR l o l he enl r y oi nl and l he I i nker nol es l he facl l hal you have us ed a
r ef er ence lo a resi denl I i brary. Wh e n your code is I oaded i nl o ' me mo r y, l he
I oader aul omal i caI I y oens l he I i brary and cI oses il f or you vh e n you have
unI oaded. The I oader aul omal i caI I y al ches r ef er ences lo Ami g a DOS enl r y
oi nl s lo ref er l o l he correcl offsel f r om l he I i brary bas e oi nl er .
O3P3Q ?2#)9'.( ). JX#D/9)K0# ;2:(2)&
To r oduce a fiIe l hal you can execul e on l he Ami ga, you shouI d f oI I ov l he f our
sl es beI ov. You can do each sl e ei l her on l he Ami ga i lseI f or on a sui l abI e
c r os s - deveI omenl c omul er .
1. Gel your r ogr am source i nl o l he Ami ga. To do l hi s, you can l ye il di recl I y
i n us i ng an edi l or, or you can l ransf er il f r om anol her c omul er . Nol e l hal
you can us e l he RIAD and D O W N L O A D r ogr ams on l he Ami ga l o
l ransf er characl er or bi nary fi I es.
2. As s embI e or comi I e your r ogr am.
3. Li nk your r ogr am l ogel her , i ncI udi ng any sl arl u c ode you ma y requi re
al l he begi nnni ng, and scan l he Ami ga I i brary and any ol her s you may ne e d
l o sal i sf y any exl ernaI r ef er ences.
4. Load your r ogr am i nl o l he Ami ga and val ch il r un!
O3Q G/..'.( ) ;2:(2)& 4.8#2 9"# ?BH
Ther e are l vo vays you can r un a r ogr am. Ii rsl, you can r un your r ogr am
unde r a CLI ( Comma nd Li ne I nl erf ace) . Se c ond, you can r un your r ogr am
unde r l he Wor kbe nc h. Thi s secl i on descri bes l he firsl of l he l vo vays .
Runni ng a r ogr am under l he CLI is a IillIe Iike us i ng an oI d- f ashi oned
160 AMIGADO5 DEVELOPER'5 MANUAL
I i ne- ori enl ed TTY s ys l em aI l hough you mi ghl f i nd a CLI usef uI , f or examI e, lo
orl your r ogr am over lo your Ami ga as a firsl sl e in deveI omenl . To I oad
and enl er your r ogr am, you si mI y l ye l he na me of l he fiIe l hal conl ai ns l he
bi nar y and ossi bI y f oI I ov l hi s vi l h a numbe r of ar gumenl s .
O3Q3O H.'9')0 J.C'2:.&#.9 '. %55#&K0#2
Wh e n you I oad a r ogr am unde r a CLI , you l ye l he na me of l he r ogr am a nd
a sel of ar gumenl s . You ma y aI so seci f y i nul or oul ul redi recl i on by me a ns
of l he " > " and " < " s ymboI s . The CLI aul omal i caI I y r ovi des aII l hi s i nf or ma-
l i on f or l he r ogr am vhe n il slarls u.
Wh e n l he CLI sl arl s u a r ogr am, il aI I ocal es a sl ack f or l hal r ogr am. Thi s
sl ack is i ni li aI I y 4000 byl es , bul you ma y c hange l he sl ack si ze vi l h l he S TACK
c omma nd. Ami ga DOS obl ai ns lhi s sl ack f rom l he generaI free me mor y hea | usl
bef or e you r un l he r ogr am, il is nol , hovever , l he s ame as l he sl ack l hal l he
CLI us es . Ami ga DOS us hes a sui l abI e rel urn addr ess onl o l he sl ack l hal leI I s
l he CLI l o regai n conl roI and unI oad your r ogr am. eI ov l hi s on l he sl ack al
4( SI) is l he si ze of l he sl ack i n byl es , vhi c h ma y be usef uI if you vi s h l o
er f or m sl ack checki ng.
Your r ogr am slarls vi l h regi sl er AO oi nl i ng lo l he ar gumenl s you, or
anyone eI se r unni ng your r ogr am l yed. Ami ga DOS sl ores l he ar gumenl I i ne
i n me mor y vi l hi n l he CLI sl ack and lhi s oi nl er r emai ns vaI i d l hr oughoul
your r ogr am. Regi sl er DO i ndi cal es l he numbe r of characl ers i n l he ar gumenl
I i ne. You can us e l hese iniliaI vaI ues lo decode l he ar gumenl Iine lo find oul vhal
l he us er requi res. Nol e l hal aII regi sl ers may be cor r ul ed by a user r ogr am.
To ma ke l he i ni li aI i nul and oul ul fiIe handI es avai I abI e, you caII l he
Ami g a DOS r oul i nes I nul ( ) and Oul ul ( ) . Re me mbe r l hal you ma y have lo
oe n l he Ami ga DOS I i brary bef or e you do l hi s. The caIIs rel ur n fiIe handI es
l hal ref er l o l he sl andar d i nul and oul ul l he user requi res. Thi s sl andar d
i nul and oul ul is usuaI I y l he l ermi naI unI ess you redi recl ed l he I/O by
i ncI udi ng " > " or " < " on l he ar gumenl I i ne. You shouI d nol cI ose l hese fiIe
handI es vi l h your r ogr am, l he CLI oe ne d l he m for you and il vi I I cI ose
l he m, if r equi r ed.
O3Q3P H.'9')0 J.C'2:.&#.9 '. ?
Wh e n r ogr ammi ng i n C, you shouI d aI vays i ncI ude l he sl arl u code as l he
firsl eI emenl i n l he I i nker i nul . Thi s me a ns l hal l he I i nker enl er s your
r ogr am al l he sl arl u code enl r y oi nl . Thi s secl i on of c ode scans l he argu-
me nl Iisl and make s l he ar gumenl s avai I abI e i n " a r g v " , vi l h l he numbe r of
ar gumenl s i n " a r g c " as usuaI . Il aI so oens l he Ami ga DOS I i brary and caI I s
I nul ( ) and Oul ul ( ) for you, I aci ng l he resuI l i ng fiIe handI es i nl o " s l di n" and
" s l do ul " . Il l hen caI I s l he C f uncl i on " ma i n " .
PROGRAMMING ON THE AMIGA 161
O3Q3Q R)'0/2# :> G:/9'.#5
Mos l Ami ga DOS roul i nes rel urn a zero if l hey faiI, l he excel i ons are l he Read
a nd Wr i l e caI I s l hal r el ur n -1 on f i ndi ng an error. If you recei ve a n error r el ur n,
you can caII IoIrr() lo obl ai n mor e i nf or mal i on on l he f ai I ure. I oIrr( ) r el ur ns an
i nl eger l hal cor r es onds l o a fuII error code, and you ma y vi s h l o l ake
di f f erenl acl i ons deendi ng on exacl I y vhy l he caII f ai I ed. A comI el e Iisl of
error codes and mes s ages can be f ound al l he e nd of l he %&'()*+, 45#265
-)./)0 i n l hi s book.
O3Q3V !#2&'.)9'.( ) ;2:(2)&
To exil f r om a r ogr am, il i s suf f i ci enl lo gi ve a si mI e RTS us i ng l he i ni li aI
sl ack oi nl er ( SI) . In l hi s case, you s houI d r ovi de a r el ur n code i n regi sl er
DO. Thi s is zer o if your r ogr am s ucceeded, ol her vi s e, il i s a osi l i ve numbe r .
If you rel ur n a nonzer o numbe r , l hen l he CLI nol i ces an error. De e ndi ng on
l he cur r enl faiI vaI ue (sel by l he c omma nd IAI LAT) , a noni nl er acl i ve CLI ,
such as one r unni ng a c omma nd s equence sel u by l he IXICUTI c o mma nd,
l er mi nal es. A r ogr am vri l l en i n C can si mI y rel ur n f r om " ma i n " vhi c h
r el ur ns lo l he sl arl u code, lhi s cI ears DO and er f or ms an RTS.
AI l ernal i veI y a r ogr am ma y caII l he Ami ga DOS f uncl i on Ixi l , vhi c h l akes
l he rel urn code as ar gumenl . Thi s i nsl rucl s your r ogr am lo exi l no mal l er vhal
vaI ue l he sl ack oi nl er has .
Il is i mor l anl al l hi s sl age l o sl ress l hal Ami ga DOS does nol conl roI any
r esour ces, l hi s is Iefl enl i reI y u lo l he r ogr ammer . Any fiIes l hal a us er
r ogr am oens mus l be cI osed bef or e l he r ogr am l er mi nal es . Li kevi s e, any
I ocks il obl ai ns mus l be f reed, any c ode il I oads mus l be unI oaded, and a ny
me mor y il aI I ocal es r el ur ned. Of cour s e, l her e ma y be cases vhe r e you do nol
vi s h lo rel ur n aII r esour ces, f or examI e, vhe n you have vri l l en a r ogr am
l hal I oads a code s egmenl i nl o me mor y for I aler us e . Thi s is erf ecl I y accel -
abI e, bul you mus l have a mec hani s m f or evenl uaI I y r el ur ni ng any me mor y,
fiIe I ocks, and so on.
O3V G/..'.( ) ;2:(2)& 4.8#2 9"# L:2MK#.D"
To r un a r ogr am under l he Wor kbenc h, you ne e d l o areci al e l he di f f erenl
vays i n vhi c h a r ogr am ma y be r un on l he Ami ga. Unde r l he CLI your
r ogr am is r unni ng as arl of l he CLI r ocess. Il can i nheri l I/O s l r eams a nd
ol her i nf or mal i on f r om l he CLI , such as l he ar gumenl s you r ovi ded.
If a r ogr am i s r unni ng under l he Wor kbenc h, l hen Ami ga DOS sl arl s il as a
ne v r oces s r unni ng al l he s ame l i me as Wor kbe nc h. Wor kbe nc h I oads l he
r ogr am and l hen s ends a mes s age lo gel il sl arl ed. You mus l l her ef or e vai l
162 AMIGADO5 DEVELOPER'5 MANUAL
f or l hi s iniliaI mes s age bef or e you slarl lo do anyl hi ng. You mus l rel ai n l he
me s s age and rel urn il l o Wor kbe nc h vhe n your r ogr am has f i ni shed, so l hal
Wor kbe nc h can unI oad l he code of your r ogr am.
Ior C r ogr amme r s , l hi s i s aII done by si mI y us i ng a di f f erenl sl arl u
r oul i ne. Ior as s embI y I anguage r ogr ammer s , l hi s vor k mus l be done yourseI f .
You s houI d aI so nol e l hal a r ogr am r unni ng as a ne v r ocess i ni l i al ed by
Wor kbe nc h has no def auI l i nul and oul ul s l r eams. You mus l ens ur e l hal
your r ogr am oens aII l he I/O channeI s l hal il ne e ds , and l hal il cI oses l he m
aII vh e n il has f i ni shed.
O3T ?2:55 *#C#0:<&#.9
H9 you are us i ng a cr os s - deveI omenl envi r onmenl , l hen you ne e d l o dovnI oad
your c ode onl o l he Ami ga . Thi s s ec l i on des c r i bes l he s eci aI s uor l
Commodor e - Ami ga gi ves l o Sun Mi cr os ys l em and MS DOS envi r onmenl s . I l
aI so descri bes ho v lo cr oss- deveI o i n ol her envi r onmenl s vi l houl l hi s seci aI
suor l .
O3T3O ?2:55 *#C#0:<&#.9 :. ) ,/. -'D2:5=59#&
The l ooI s avai I abI e on l he Sun Mi c r os ys l em f or cross deveI omenl i ncI ude l he
as s embI er , I i nker, and l vo C comi I er s. The ar gumenl f ormal s of l he as s em-
bI er and I i nker on l he Sun Mi c r os ys l em are i denl i caI lo l hos e on l he Ami ga
vh e n r unni ng under l he CLI . The Greenhi I I s C comi I er is onI y avai I abI e on
l he Sun Mi c r os ys l em and is descri bed her e.
The c omi I er i s caI I ed mel acc, and il accel s severaI l yes of f i I es. Il
as s ume s l hal f i I enames e ndi ng i n . c r er es enl C sour ce r ogr ams . The c om-
i I er l hen comi I es l hes e . c fiIes and I aces l he resuI l i ng ob| ecl r ogr am
i n l he cur r enl di recl ory vi l h l he s ame f i I ename, bul endi ng vi l h . ob| . The
suf f i x . ob| denol es an ob| ecl fi I e. The comi I er as s umes l hal fiIes endi ng
i n . a s m ar e a s s e mbI y s our c e r ogr a ms . Yo u c an us e l he a s s e mbI e r l o
as s embI e l hese and r oduc e an ob| ecl fiIe ( endi ng vi l h . ob| ) i n l he cur r enl
di recl ory.
The comi I er mel acc l akes ma ny ol i ons vi l h l he f oI I ovi ng f ormal :
mel ac c | < o l I > | , < o l 2 > | , . . < o l n > j j j | < f i I e > | , . . . < f i I e n > j j
The ol i ons avai I abI e are as f oI I ovs:
-c -g - go - v - - g - 0 | < o l f I a g s > j -fsi ngI e
- S -I - C - X70 - o < o u l u l > - D < n a m e d e f >
- U < n a m e > -I < d i r > - < s l r i n g > - l | 012j
PROGRAMMING ON THE AMIGA
163
The f oI I ovi ng ol i ons i nsl rucl mel acc lo:
-c | usl comi I e l he r ogr am, s ur es s i ng l he I oadi ng has e of
l he comi I al i on, and f orci ng an ob| ecl fiIe l o be r oduc ed
even if il onI y comi I es one r ogr am.
-g r oduce addi l i onaI symboI labI e i nf or mal i on for l he debug-
ger dbx and l o as s l he -Ig fIag lo Id.
- go r oduc e addi l i onaI s ymboI l abI e i nf or mal i on i n a n oI der
f or mal sel by l he adb debugger . AI so, as s l he -Ig f I ag
l o Id.
- v s ur es s aII var ni ng mes s ages .
- r oduce rof i I i ng code lo counl l he numbe r of l i mes each
r oul i ne is caI I ed. If I oadi ng l akes I ace, reI ace l he sl andar d
sl arl u roul i ne by one l hal is aul omal i caI I y caI I ed by l he
moni l or and us es a seci aI rof i I i ng I i brary i nsl ead of l he
sl andard C I i brary.
Us e l he rof r ogr am l o gener al e an execul i on rof i I e.
- g r oduce rof i I i ng code I i ke - , bul i nvoke a r un- l i me re-
cordi ng me c hani s m l hal kees mor e exl ensi ve slali sli cs and
r oduces a gmon. oul fiIe al nor maI l er mi nal i on.
Us e l he gr of r ogr am lo gener al e an execul i on rof i I e.
- 0 | < o l f I a g s > j us e l he ob| ecl code ol i mi zer l o i mr ove l he gener al ed
code.
If " ol f I a gs " aear s , you i ncI ude < o l f I a g s > i n l he c om-
ma nd I i ne l o r un l he ol i mi zer. You can us e - O l o ass
ol i on f I ags.
- f si ngI e us e si ngI e- reci si on ari l hmel i c in c omul al i ons i nvoI vi ng
onI y fIo al number s , l hal i s, do nol conver l ever yl hi ng lo
doubI e (l hal i s, l he def auI l ) .
Nol e: II oal i ng- oi nl ar amel er s are sliII conver l ed l o doubI e-
reci si on, and f uncl i ons l hal rel urn vaI ues sliII rel ur n doubI e-
reci si on vaI ues.
W A R N I N G : Cerl ai n r ogr ams r un muc h f asl er usi ng l he - f si ngI e ol i on,
bul be var e l hal you can I ose si gni f i cance due lo I over reci si on i nl er me-
di al e vaI ues.
164
AMIGADO5 DEVELOPER' 5 MANUAL
-S
- I
- c
- X70
- o < o u l u l >
comi I e l he seci f i ed C r ogr am( s) and I eave l he as s embI er -
I anguage oul ul on cor r es ondi ng fiIes endi ng vi l h . ob| .
r un onI y l he C r er ocessor on l he na me d C r ogr am( s ) and
s end l he resuI l lo l he sl andard oul ul .
r evenl l he C r er oces s or f r om r emovi ng c omme nl s .
gener al e code usi ng Ami ga f I oal i ng oi nl f ormal . Thi s code
is comal i bI e vi l h l he f I oal i ng oi nl mal h R O M I i brary
r ovi ded on l he Ami ga.
na me l he fi naI oul ul fiIe " o ul ul " . If you us e l hi s ol i on,
l he fiIe a. oul is I efl undi s l ur bed.
- D < n a m e d e f > def i ne " n a m e " lo l he r er oces s or , as if by - de f i ne . If no
def i ni l i on is gi ven, def i ne l he na me as ]O]3
- U < n a m e > r emove any iniliaI def i ni l i on of " n a me " .
- I < d i r > aI vays I ook for - i nc I ude fi I es vho s e na me s do nol begi n
vi l h " / " firsl in l he di recl ory of l he < f i I e > ar gumenl , l hen
I ook i n l he < d i r > seci f i ed i n l he -I ol i on, and fi naI I y I ook
i n l he / usr/ i ncI ude di recl ory.
- < s l r i n g > f i nd subsl i l ul e comi I er as s es i n l he fiIes seci f i ed by
< s l r i n g > vi l h l he endi ngs c , c c om, and c2. If " s l r i ng" i s
eml y, us e a bac ku versi on.
- l | 012j f i nd onI y l he desi gnal ed comi I er as s es in l he fiIes vhos e
na me s are consl r ucl ed by a - ol i on. I n l he abs enc e of a -
ol i on, as s ume < s l r i n g > lo be / usr/ nev/ .
The I el l er and numbe r combi nal i ons l hal you can seci f y f or
l he -l ol i on have l he f oI I ovi ng meani ngs :
c l he C r er oces s or
0 me l a c ombol h has es of l he C comi I er , bul nol l he
ol i mi zer.
1 I gnor ed i n lhi s s ys l eml hi s ol i on vouI d be f or l he
s ec ond has e of a l vo- has e comi I er bul i n l he Sun
s ys l em, ccom i ncI udes bol h has es .
2 c 2l he ob| ecl code ol i mi zer.
The comi I er mel acc as s umes l hal ol her ar gumenl s are I oaded ol i on ar gu-
me nl s , ob| ecl r ogr ams , or I i brari es of ob| ecl r ogr ams . UnI es s you seci f y - c,
- S, or - I, mel acc I oads l hes e r ogr ams and I i brari es l ogel her vi l h l he resuI l s of
any comi I al i ons or assembI i es seci f i ed, (in l he order gi ven) lo r oduc e an
PROGRAMMING ON THE AMIGA
165
execul abI e r ogr am na me d a. oul . To overri de l he na me a. oul , you can us e l he
I oader ' s - o < n a m e > ol i on.
If a si ngI e C r ogr am is comi I ed and I oaded aII al onc e, l he i nl er medi al e . o
fiIe is deI el ed.
Ii gure 1-A Iisls l he f i I enames of seci aI mel acc fiIes and l hei r descr i l i ons.
,<#D')0 R'0#5
Ii I e Des c r i l i on Ii I ename
C sour ce code
fi I e. c
As s embI er source fiIe fiIe, a s m
Ob| ec l fiIe f i I e. o
Li brary of ob| ecl fiIes fi I e. I i b
Ixecul abI e oul ul fiIes a. oul
Temor ar y fiIes / l m/ cl m
Ir er ocessor /I i b/c
Comi I er / I i b/ ccom
Ol i onaI ol i mi zer /Iib/c2
Runl i me sl arl of f /Iib/crlO.o
Sl arl of f f or rof i I i ng /Iib/mcrlO. o
Sl arl of f f or grof - rof i I i ng /usr/Iib/gcrlO. o
Sl andar d I i brary /Iib/Iibc. a
Irof i I i ng I i brary /usr/I i b/I i bc . a
Sl andar d di recl ory ( - i nc I ude . / usr/ i ncI ude
Ii I es r oduc ed f or anaI ysi s
by rof mon. oul
Ii I e r oduc ed f or anaI ysi s
by gr of gmon. oul
Figurc ! . A: 5pccia! mctacc Fi!cnamcs
You c an dovnI oad l he fiIes you r oduce f r om l he I i nker on l he Sun l o your
Ami ga i n l hr ee vays : l he firsl, and by far l he easi esl , requi res a i I I oard, l he
s ec ond requi res a araI I eI orl , and l he l hi rd requi res a seriaI I i ne.
If you ha ve l he seci aI ha r dva r e devi c e caI I ed a i I I oar d, you c an
dovnI oad your I i nked I oad fiIe (by convenl i on l hi s shouI d e nd vi l h .Id) as
f oI I ovs:
1. Sl ar l u l he r ogr am " bi nI oa d" on l he Sun
bi nI o a d - &
(lhi s ne e d onI y be done once)
166
AMIGADO5 DEVELOPER'5 MANUAL
2. The n on l he Ami ga, l ye
dovnI oa d < s u n f i I e na me > < a mi g a f i I e na me >
3. To r un l he r ogr am, l ye
< a mi g a f i I e na me >
Ior examI e:
On l he Sun, l ye
b i nI o a d - 6`
On l he Ami ga, l ye
dovnI oa d l e s l I d l e s l
or l ye
dovnI oa d / us r / c ommodor e / a mi ga / V2 4 / e xa mI e s / DOS/ l e s l . I d l e s l
l hen l ye
l e s l
Nol e l hal D O W N L O A D gai ns access lo fiIes on l he Sun reI al i ve l o l he
di recl ory vhe r e bi nI oad sl arl ed. If l he di recl ory on l he Sun vas / usr / commodor e/
ami ga/ V24/ examI es / DOS as above, l he f i I ename l esl . I d is aII l hal is neces s ar y.
If you c annol r e me mbe r l he di recl ory vher e bi nI oad sl arl ed, you mus l seci f y
l he fuII na me . To sl o bi nI oad, do a " s " and l hen a " ki I I " on ils II D. Nol e
l hal l he sof l resel of l he c omul er leI I s bi nI oad l o vri l e a me s s age l o i l s
s l andar d oul ul ( l he def auI l is l he vi ndov vhe r e il sl arl ed) . If l he l ransf er
hangs , r es s CTRL- C al l he Ami ga l o kiII D O W N L O A D . ( See Secl i on 3. 2 i n l he
%&'()*+, 45#265 -)./)0 i n l hi s book for f url her i nf or mal i on on l he Ami g a DOS
conl r oI c onvenl i ons CTRL- C, CTRL- D, CTRL- I, and CTRL- I. )
If you do nol have a i I I oard, you can dovnI oad fiIes l hr ough a araI I eI
orl . To do l hi s, f oI I ov l hese sl es:
1. S e nd l he dovnI oad ASCI I fi I es l o l he Ami ga via l he araI I eI or l by
l yi ng
s e nd d e m o I d
PROGRAMMING ON THE AMIGA
167
If you do nol gi ve " s e n d " any ar gumenl s , l he sl andar d i nul is us ed. The
def auI l oul ul devi ce is /dev/IO, vhi c h is usuaI I y correcl . To c hange l he
def auI l oul ul , us e l he -o ar gumenl .
2. On l he Ami ga, l ye l he f oI I ovi ng:
RIAD de mo
RIAD l hen reads characl ers f r om l he araI I eI orl and I aces l he m i n l he
fiIe na me d " d e m o " .
3. Onc e RIAD has f i ni shed, l ye
de mo
l o r un l he r ogr am de mo.
You can aI so dovnI oad fi I es seri aI I y. To do l hi s, f oI I ov l hes e sl es:
1. Conver l l he i nary Load Ii I e i nl o an ASCI I hex fiIe endi ng vi l h Q by l yi ng
c o nv e r l < de mo . I d > de mo . dI
( vher e . dI , by convenl i on, sl ands for DovnLoa d) . The above ruI e exi sl s i n
l he i ncI uded makef i I e, makeami ga. ( See l he %&'()*+, !#D".'D)0 G#>#2#.D#
-)./)0F Chal er 2, f or f url her delai I s on l he Ami ga i nary Load fi I es. )
2. Tye
l i a mi g a
3. On l he Ami ga, l ye
RIAD de mo s e r i a I
4. Wi l hi n l i , l ye
" > demo. dI
5. Wh e n l he RIAD comI el es on l he Ami ga, l ye l he f i I ename " d e m o " lo r un
il.
W A R N I N G : The Sun seri aI I i nk of l en hangs for no aar enl r eas on.
Rebool l he Sun if l hi s hae ns .
168
AMIGADO5 DEVELOPER' 5 MANUAL
If l he Sun seri aI I i nk shouI d hae n l o hang, r ebool l he Sun, l hen l ye
l i
and vi l hi n l i , l ye
Q
l o gel l he RIAD on l he Ami ga lo comI el e. Onc e lhi s is done , slarl a ne v
RIAD and l ye l he f oI I ovi ng symboI s on l he Sun:
" >
O3T3P ?2:55 *#C#0:<&#.9 4.8#2 -,A*+,
To cr oss- deveI o on a c omul er r unni ng MS - DOS for your Ami ga, you ne e d
vari ous l ooI s l hal are suI i ed i n l he di recl ory V25bin. The s e i ncI ude l he C
comi I er , as s embI er , and I i nker as veI I as c omma nds l o assi sl i n dovnI oadi ng.
You us e l he s ame synl ax for l he l ooI s r unni ng under MS - DOS as under l he CLI
on l he Ami ga.
To dovnI oad vi a an I M IC seri aI orl (caI I ed AUX) , f oI I ov l hes e sl es:
1. Tye on your Ami ga
READ Ii!c 5ERIAL
2. On l he IC, l ye
cnnvcrt <Ii!c.!d >AUX:
3. On your Ami ga, you can nov l ye
Ii!c
lo l he r ogr am.
O3T3Q ?2:55 *#C#0:<&#.9 :. +9"#2 ?:&</9#25
You' I I ne e d lo have a sui l abI e cross comi I er or assembI er , and lo i ncI ude
fi I es def i ni ng aII l he enl r y oi nl s. You' I I aI so ne e d ei l her l he Ami ga I i nker
ALI NK r unni ng on your equi menl or on l he Ami ga. Ii naI I y you' I I ne e d a va y
l o conver l a bi nar y fiIe i nl o a hexadeci maI sl r eam l er mi nal ed vi l h a Q (as l hi s
PROGRAMMING ON THE AMIGA
169
is l he vay l hal RIAD accel s dal a) , and a vay of ul l i ng l hi s dal a oul f r om a
seri aI or araI I eI orl .
Onc e you have creal ed a sui l abI e bi nar y fi I e, you mus l l ransf er l hi s lo l he
Ami ga us i ng l he RIAD c omma nd (as descri bed i n Secl i on 1. 5. 2 of l hi s ma n-
uaI ) . If you have l he Ami ga I i nker r unni ng on your c omul er , l hen you can
l ransf er comI el e bi nar y I oad fi I es, ol her vi s e, you' I I have l o l ransf er bi nar y
ob| ecl fi I es i n l he f or mal accel ed by ALI NK, and l hen er f or m l he I i nk sl e
on l he Ami ga.
?")<9#2 P
CaIIing AmigaDOS
Thi s chal er descri bes l he f uncl i ons r ovi ded by l he Ami g a DOS r esi denl
I i brary. To heI you, il rovi des l he foI I ovi ng: an exI anal i on of l he synl ax, a fuII
descri l i on of each f uncl i on, and a qui ck ref erence card of l he avaiIabIe f uncl i ons.
2. 1 Synl ax
2. 2 Ami g a DOS Iuncl i ons
Qui c k Ref er enc e Car d
P3O ,=.9)X
The synl ax us e d i n l hi s chal er s hovs l he C f uncl i on caII f or each Ami g a DOS
f uncl i on and l he corresondi ng regi sler you use vhe n you r ogr am i n assembI er.
P3O3O G#('59#2 Y)0/#5
The I el l er / number combi nal i on (DO. . . Dn) r er esenl s regi sl ers. The l exl l o l he
Iefl of an equaI s si gn r er es enl s l he resuI l of a f uncl i on. A regi sl er (l hal i s, DO)
aear i ng unde r s uch l exl i ndi cal es l he regi sl er vaI ue of l he resuI l . Texl l o l he
ri ghl of an equaI s si gn r er esenl s a f uncl i on and ils ar gumenl s , vhe r e l he l exl
enc I os ed i n ar enl hes es is a Iisl of l he ar gumenl s . A regi sl er (for examI e, D2)
aear i ng unde r an ar gumenl i ndi cal es l he regi sl er vaI ue of l hal ar gumenl .
Nol e l hal nol aII f uncl i ons r el urn a resuI l .
P3O3P ?)5#
The I el l er case (l hal i s, I over or ue r case) I S si gni f i canl . Ior examI e, you
mus l enl er l he vor d " Ii I eI nf oI oc k" vi l h l he firsl I el l er of each c omone nl
vor d i n ue r case.
CALLING AMIGADO5
171
P3O3Q W::0#). 2#9/2.5
-1 ( TRUI or S UCCIS S ) , 0 ( IALSI or IAI LURI) .
2. 2. 4 Y)0/#5
AII vaI ues are I ong vor ds (l hal i s, 4 byl e vaI ues or 32 bi l s) . VaI ues ref erred lo as
" s l r i ng" ar e 32- bi l oi nl er s l o NULL- l er mi nal ed seri es of char acl er s.
2. 2. 5 R:2&)9F %2(/&#.9F ).8 G#5/09
Look al " Ar g ume nl : " and " Re s uI l : " for f url her del ai I s on l he synl ax us e d
af l er " Ior ma l : " . ResuI l descri bes vha l is r el ur ned by l he f uncl i on (lhal i s,
l he Iefl of l he equaI si gn) . Ar gume nl descri bes vhal l he f uncl i on execl s l o
vor k on ( l hal i s, l he Iisl i n ar enl hes es ) . Ii gure 2- A s houI d heI exI ai n l he
synl ax.
R:2&)9 :> >/.D9':. resuI l Iuncl i on( ar gumenl )
Regi sl er Regi sl er
JX)&<0# I ock Cr eal eDi r ( name)
67 68
Iigure 2-A: Iormal of Iunclions and Regislers
#"# %&'()*+, R/.D9':.5
Thi s r ef er ence secl i on descri bes l he f uncl i ons r ovi ded by l he Ami g a DOS
r esi denl I i brary. Iach f uncl i on is ar r anged aI habel i caI I y unde r l he f oI I ovi ng
headi ngs : Ii I e HandI i ng, Ir ocess HandI i ng, and Loadi ng Code . The s e he ad-
i ngs i ndi cal e l he acl i on of l he f uncl i ons l hey cover. Unde r each f uncl i on na me ,
l her e is a bri ef descri l i on of l he f uncl i on' s ur os e, a seci f i cal i on of l he
f or mal and l he regi sl er vaI ues, a fuI I er descri l i on of l he f uncl i on, and an
exI anal i on of l he synl ax of l he ar gumenl s and resuI l . To us e a ny of l hes e
f uncl i ons , you mus l I i nk vi l h ami ga. I i b.
R'0# @).80'.(
C!nsc
;/2<:5#N To cI ose a fiIe for i nul or oul ul .
R:2&N ?0:5#i >'0# d
D I
172
AMIGADO5 DEVELOPER'5 MANUAL
%2(/&#.9N fi I efi I e handI e
*#5D2'<9':.N
The fiIe handI e " f i I e " i ndi cal es l he fiIe l hal CI ose shouI d cI ose. You obl ai n l hi s
fiIe handI e as a resuI l of a caI I l o Oe n. Yo u mus l r e me mbe r l o cI ose exI i ci lI y
aII l he fiIes you oen i n a r ogr am. Hove ve r , you s houI d nol cI ose i nher i l ed
fiIe handI es oe ne d eI s evher e.
CrcatcDir
;/2<:5#N To creal e a ne v di recl ory.
R:2&N 0:DM k ?2#)9#*'2i .)&#d
DO D I
%2(/&#.9N name- s l r i ng
G#5/09N I ock - oi nl er l o a I ock
*#5D2'<9':.N
Cr eal eDi r creal es a ne v di recl ory vi l h l he name you seci f i ed, if ossi bI e. Il
r el ur ns an error if il fai I s. Re me mbe r l hal Ami ga DOS can onI y creal e di recl o-
ri es on devi ces vhi c h suor l l hem, f or examI e, di sks.
A rel ur n of zer o me a ns l hal Ami ga DOS has f ound an error ( such as: di sk
vri l e r ol ecl ed) , you shouI d l hen caII I oIrr( ) , ol her vi s e, Cr eal eDi r r el ur ns a
s har ed r ead I ock on l he ne v di recl ory.
CurrcntDir
;/2<:5#N To make a di recl ory associ al ed vi l h a I ock l he cur r enl vor ki ng
di recl ory.
R:2&N :08B:DM k ?/22#.9*'2i 0:DM d
DO DI
%2(/&#.9N I ock - oi nl er lo a I ock
G#5/09N oI dLock - oi nl er lo a I ock
*#5D2'<9':.N
Cur r enl Di r make s cur r enl a di recl ory associ al ed vi l h a I ock. ( See aI so LOCK. )
Il r el ur ns l he oI d cur r enl di recl ory I ock.
A vaI ue of zer o i s a vaI i d resuI l her e and i ndi cal es l hal l he cur r enl di recl ory
is l he rool of l he iniliaI sl arl u di sk.
Dc!ctcFi!c
;/2<:5#N To deI el e a fiIe or di recl ory.
R:2&N 5/DD#55 k *#0#9#R'0#' .)&# d
DO DI
CALLING AMIGADO5
173
%2(/&#.9N na me - sl ri ng
G#5/09N success - booI ean
*#5D2'<9':.N
DeI el eIi I e al l eml s lo deI el e l he fiIe or di recl ory " n a me " . Il r el ur ns an error if
l he deI el i on fai I s. Nol e l hal you mus l deI el e aII l he fiIes vi l hi n a di recl ory
bef or e you can deI el e l he di recl ory ilseIf.
DupLnck
;/2<:5#N To duI i cal e a I ock.
R:2&N .#IB:DM k */<B:DMi 0:DMd
DO DI
%2(/&#.9N I ock - oi nl er lo a I ock
G#5/09N ne vLoc k - oi nl er l o a I ock
*#5D2'<9':.N
DuLoc k l akes a s har ed fi I i ng s ys l em r ead I ock a nd r el ur ns anol he r s har ed
r ead I ock l o l he s ame ob| ecl . Il is i mossi bI e lo creal e a coy of a vri l e I ock.
( Ior mor e i nf or mal i on on I ocks, see LOCK. )
Examinc
;/2<:5#N To exami ne a di recl ory or fiIe associ al ed vi l h a I ock.
R:2&N 5/DD#55 k JX)&'.#i 0:DMF R'0#0.>:W0:DM d
DO D I D2
%2(/&#.9N I ock - oi nl er l o a I ock
Ii I eI nf oI ock - oi nl er l o a fiIe i nf o bI ock
G#5/09N success - booI ean
*#5D2'<9':.N
Ixami ne fiIIs i n i nf or mal i on i n l he Ii I eI nf oI ock concer ni ng l he fiIe or di recl ory
associ al ed vi l h l he I ock. Thi s i nf or mal i on i ncI udes l he na me , si ze, creal i on
dal e, and vhe l he r il i s a fiIe or di recl ory.
Nol e: Ii I eI nf oI ock mus l be I ongvor d aI i gned. You can ens ur e l hi s i n l he
C I anguage if you us e AI I oc mem. ( See l he G+- _#2.)0 -)./)0 f or f ur l her
del ai I s on l he exec caII AI I oc mem. )
Ixami ne gi ves a rel ur n code of zero of il fai I s.
ExNcxt
;/2<:5#N To exami ne l he nexl enl ry i n a di recl ory.
R:2&N 5/DD#55 k JXS#X9i 0:DMF R'0#0.>:W0:DM d
DO DI D2
174
AMIGADO5 DEVELOPER'5 MANUAL
%2(/&#.9N I ock - oi nl er lo a I ock
Ii I eI nf oI ock - oi nl er lo a fiIe i nf o bI ock
G#5/09N s uccess - booI ean
*#5D2'<9':.N
Thi s r oul i ne is as s ed a I ock, usuaI I y associ al ed vi l h a di recl ory, and a
Ii I eI nf oI ock fiIIed i n by a r evi ous caII lo Ixami ne. The Ii I eI nf oI ock conl ai ns
i nf or mal i on c onc er ni ng l he firsl fiIe or di recl ory sl or ed i n l he di recl ory associ -
al ed vi l h l he I ock. IxNexl aI so modi f i es l he Ii I eI nf oI ock so l hal s ubs equenl
caIIs rel ur n i nf or mal i on aboul each f oI I ovi ng enl r y i n l he di recl ory.
IxNexl gi ves a rel urn code of zer o if il faiIs f or s ome r eas on. One r eas on f or
fai I ure is r eachi ng l he I asl enl r y i n l he di recl ory. Hove ve r , IoIrrQ hoI ds a code
l hal ma y gi ve mor e i nf or mal i on on l he exacl cause of a f ai I ure. Wh e n IxNexl
f i ni shes af l er l he I asl enl r y, il r el ur ns IRROR N O MORI INTRI IS
So, f oI I ov l hes e sl es lo exami ne a di recl ory:
1) Us e Ixami ne lo gel a Ii I eI nf oI ock aboul l he di recl ory you vi s h l o
exami ne.
2) Ias s IxNexl l he I ock reI al ed l o l he di recl ory and l he Ii I eI nf oI ock fi I I ed i n
by l he r evi ous caII lo Ixami ne.
3) Ke e caI I i ng IxNexl unl i I il faiIs vi l h l he error code heI d i n IoIrr( ) equaI
lo IRROR N O MORI INTRI IS.
4) Nol e l hal if you don' l knov vhal you are exami ni ng, i nsecl l he l ye
fi eI d of l he Ii I eI nf oI ock r el ur ned f r om Ixami ne l o f i nd oul vhe l he r il i s a
fiIe or a di recl ory vhi c h is vor l h caI I i ng IxNexl f or.
The l ye fieId i n l he Ii I eI nf oI ock has l vo vaI ues: if il is negal i ve, l hen
l he fiIe s ys l em ob| ecl is a fiIe, if il is osi l i ve, l hen il is a di recl ory.
InIn
;/2<:5#N Rel ur ns i nf ormal i on aboul l he di sk.
R:2&N 5/DD#55 k H.>:i 0:DMF H.>:3 *)9) d
DO DI D2
%2(/&#.9N I ock - oi nl er lo a I ock
I nf o Dal a - oi nl er l o an I nf o Dal a sl rucl ure
G#5/09N success - booI ean
*#5D2'<9':.N
I nf o f i nds oul i nf or mal i on aboul any di sk i n us e. " I o c k " ref ers l o l he di sk, or
any fiIe on l he di sk. I nf o r el ur ns l he I nf o Dal a sl rucl ure vi l h i nf or mal i on
aboul l he si ze of l he di sk, numbe r of f ree bI ocks, and any sofl errors. Nol e l hal
I nf o Dal a mus l be I ongvor d aI i gned.
CALLING AMIGADO5 175
Input
R:2&N >'0# k H.</9 id
DO
G#5/09N fiIe - fiIe handI e
*#5D2'<9':.N
To i denl i f y l he r ogr am' s iniliaI i nul fiIe handI e, you us e I nul . ( To i denl i f y
l he iniliaI oul ul , see OUTIUT. )
InErr
;/2<:5#N To rel urn exlra i nf or mal i on f r om l he s ys l em.
R:2&N #22:2 k H:J22+
DO
G#5/09N error - i nl eger
*#5D2'<9':.N
I/O roul i nes rel ur n zer o lo i ndi cal e an error. Wh e n an error occur s, caII l hi s
r oul i ne lo f i nd oul mor e i nf or mal i on. Some r oul i nes us e I oIrr( ) , f or examI e,
Devi ceIr oc, lo ass back a s econdar y resuI l .
Is!ntcractivc
;/2<:5#N To di scover vhe l he r a fiIe is c onnec l ed l o a vi rl uaI l er mi naI or nol .
R:2&N K::0 k H50.9#2)D9'C#' >'0# d
DO D I
%2(/&#.9N fiIe - fiIe handI e
G#5/09N booI - booI ean
*#5D2'<9':.N
The f uncl i on I sI nl er acl i ve gi ves a booI ean r el ur n. Thi s i ndi cal es vhe l he r
or nol l he fiIe associ al ed vi l h l he fiIe handI e " f i I e " is c onnec l ed l o a vi rl uaI
l er mi naI .
Lnck
;/2<:5#N To I ock a di recl ory or fiIe.
R:2&N 0:DM k B:DMi .)&#F )DD#55-:8# d
DO DI D2
%2(/&#.9N name- s l r i ng
ac c es s Mode - i nl eger
G#5/09N I ock - oi nl er l o a I ock
176 AMIGADO5 DEVELOPER'5 MANUAL
*#5D2'<9':.N
Lock r el ur ns , if ossi bI e, a fiIing s ys l em I ock on l he fiIe or di recl ory " n a m e " . If
l he ac c es s Mode is ACCIS S RIAD, l he I ock is a s har ed r ead I ock, if l he
ac c es s Mode is ACCISS. WRI TI, l hen il is an excI usi ve vri l e I ock. If L OCK faiIs
( l hal i s, if il c annol obl ai n a fiIing s ys l em I ock on l he fiIe or di recl ory) il r el ur ns
a zer o.
Nol e l hal l he over head for doi ng a Lock is I ess l han l hal for doi ng an
Oe n, so l hal , if you vanl lo l esl lo see if a fiIe exi sl s, you s houI d us e
Lock. Of cour s e, once you' ve f ound l hal il exi sl s, you have l o us e Oe n l o
oe n il.
Opcn
;/2<:5#N To oen a fiIe for i nul or oul ul
R:2&N >'0# k +<#.i .)&#F )DD#55-:8#d
DO DI D2
%2(/&#.9N na me - sl ri ng ac c es s Mode - i nl eger
G#5/09N fiIe - fiIe handI e
*#5D2'<9':.N
O e n oe ns " n a m e " and r el ur ns a fiIe handI e. If l he ac c es s Mode i s M O D I
OLDII LI ( 1005) , OIIN oens an exi sl i ng fiIe f or r eadi ng or vri l i ng. Ho v-
ever , Oe n creal es a ne v fiIe for vri l i ng if l he vaI ue is M O D I NIWII LI
( 1006) . The " n a m e " can be a f i I ename ( ol i onaI I y r ef aced by a devi ce na me ) ,
a si mI e devi ce such as NI L: , a vi ndov seci f i cal i on s uch as CON: or RAW:
f oI I oved by vi ndov ar amel er s , or , r er es enl i ng l he cur r enl vi ndov.
Ior f ur l her del ai I s on l he devi ces NI L: , CON: , and RAW: , see Chal er 1 of
l he %&'()*+, 45#265 -)./)0 in lhi s book. If Oe n c annol oen l he fiIe " n a m e "
f or s ome r eas on, il r el ur ns l he vaI ue zer o (0). In lhi s case, a caII l o l he r oul i ne
I oIrr( ) suI i es a s econdar y error code.
Ior l esl i ng l o see if a fiIe exi sl s, see LOCK.
Output
R:2&N >'0# k +/9</9id
DO
G#5/09N fiIe - fiIe handI e
*#5D2'<9':.N
To i denl i f y l he r ogr am' s iniliaI oul ul fiIe handI e, you us e Oul ul . ( To
i denl i f y l he iniliaI i nul , see I NIUT. )
CALLING AMIGADO5 177
ParcntDir
;/2<:5#N To obl ai n l he ar enl of a di recl ory or fi I e.
R:2&N B:DM k ;)2#.9*'2i 0:DM d
DO DI
%2(/&#.9N I ock - oi nl er lo a I ock
G#5/09N I ock - oi nl er lo a I ock
*#5D2'<9':.N
Thi s f uncl i on r el ur ns a I ock associ al ed vi l h l he ar enl di recl ory of a fiIe or
di recl ory. Thal i s, Iar enl Di r l akes a I ock associ al ed vi l h a fiIe or di recl ory and
r el ur ns l he I ock of ils ar enl di recl ory.
Nol e: The resuI l of Iar enl Di r may be zer o (0) f or l he rool of l he cur r enl fi I i ng
s ys l em.
Rcad
;/2<:5#N To r ead byl es of dal a f r om a fi I e.
R:2&N )D9/)0B#.(9" k G#)8i >'0#F K/>>#2F 0#.(9" d
DO D I D2 D3
%2(/&#.9N fiIe - fiIe handI e
buf f er - oi nl er l o buf f er
I engl h - i nl eger
G#5/09N acl uaI Lengl h - i nl eger
*#5D2'<9':.N
You can c oy dal a vi l h a combi nal i on of Read and Wr i l e. Read r eads byl es of
i nf or mal i on f r om an oe ne d fiIe ( r er esenl ed her e by l he ar gumenl " f i I e " ) i nl o
l he me mo r y buf f er i ndi cal ed. Read al l eml s lo r ead as ma ny byl es as fil i nl o
l he buf f er as i ndi cal ed by l he vaI ue of I engl h. You s houI d aI vays ma ke sure
l hal l he vaI ue you gi ve as l he I engl h reaI I y does r er es enl l he si ze of l he
buf f er . Read ma y rel urn a resuI l i ndi cal i ng l hal il r ead I ess byl es l han you
r eques l ed, f or examI e, vhe n r eadi ng a I i ne of dal a l hal you l yed al l he
l ermi naI .
The vaI ue r el ur ned is l he I engl h of l he i nf or mal i on acl uaI I y r ead. Thal is l o
say, vhe n " a c l ua I Le ngl h" is greal er l han zer o, l he vaI ue of " a c l ua I Le ngl h" is
l he numbe r of characl ers r ead. A vaI ue of zero me a ns l hal end- of - f i I e has be e n
r eac hed. Irrors are i ndi cal ed by a vaI ue of - 1 . Read f r om l he cons oI e r el ur ns a
vaI ue vhe n a r el ur n is f ound or l he buf f er is fuI I .
A caII lo Read aI so modi f i es or c hanges l he vaI ue of I oIrr( ) . I oIrr( ) gi ves
mor e i nf or mal i on aboul an error (for examI e, acl uaI Lengl h equaI s -1) vhe n il
is caI I ed.
178 AMIGADO5 DEVELOPER'5 MANUAL
Rcnamc
;/2<:5#N
R:2&N
To r e name a di recl ory or fi I e.
5/DD#55 k G#.)&#i :08S)&#F .#IS)&#d
DO DI D2
%2(/&#.9F
G#5/09N
oI dName - sl ri ng
ne vNa me - sl ri ng
success - booI ean
*#5D2'<9':.N
Re na me al l eml s lo r e name l he fiIe or di recl ory seci f i ed as " o I d Na me " vi l h
l he na me " n e vNa me " . If l he fiIe or di recl ory " n e vNa me " exi sl s, Re na me fai I s
and Re na me r el ur ns an error.
ol h l he " o I d Na me " and l he " n e vNa me " can be comI ex f i I enames conl ai n-
i ng a di recl ory seci f i cal i on. In lhi s case, l he fiIe vi I I be move d f r om one
di recl ory lo anol her . Hove ve r , l he desl i nal i on di recl ory mus l exi sl bef or e you
do l hi s.
Nol e: Il is i mossi bI e lo r ename a fiIe f r om one voI ume lo anol her .
%2(/&#.9N fiIe - fiIe handI e
osi l i on - i nl eger
mode - i nl eger
G#5/09N oI dIosi l i on - i nl eger
*#5D2'<9':.N
Seek sel s l he read/ vri l e cursor f or l he fiIe " f i I e " lo l he osi l i on " os i l i on" . ol h
Read and Wr i l e us e l hi s osi l i on as a I ace l o slarl r eadi ng or vri l i ng. If aII
goes veI I , l he resuI l is l he r evi ous osi l i on i n l he fiIe. If an error occur s, l he
resuI l i s - 1 . You can l hen use IoIrr() lo f i nd oul mor e i nf or mal i on aboul l he
error.
" M o d e " can be OIISIT IGI NNI NG ( 1) , OI I S ITCURRINT ( 0) or
OIIS IT I ND ( 1) . You us e il l o seci f y l he reI al i ve slarl osi l i on. Ior exam-
I e, 20 f r om cur r enl i s a osi l i on l venl y byl es f or vard f r om cur r enl , -20 f r om
e nd is 20 byl es bef or e l he e nd of l he cur r enl fiIe.
To f i nd oul l he currenl fiIe osi l i on vi l houl aI l eri ng il, you caII l o Seek
seci f yi ng an of f sel of zer o f r om l he currenl osi l i on.
To move lo l he e nd of a fi I e, Seek lo end- of - f i I e of f sel vi l h zer o osi l i on.
Nol e l hal you can ae nd i nf or mal i on lo a fiIe by movi ng l o l he e nd of a fiIe
vi l h Seek and l hen vri l i ng. You cannol Seek be yond l he e nd of a fi I e.
5cck
;/2<:5#N
R:2&N
To move l o a I ogi caI osi l i on i n a fiIe.
:08;:5'9':. k ,##Mi >'0#F <:5'9':.F &:8# d
DO DI D2 D3
CALLING AMIGADO5 179
5ctCnmmcnt
;/2<:5#N To sel a c ommenl .
R:2&N ,/DD#55 k ,#9?:&&#.@ .)&#F D:&&#.9d
DO D I D2
%2(/&#.9N na me - fiIe na me
c omme nl - oi nl er l o a sl ri ng
G#5/09N success - booI ean
*#5D2'<9':.N
S e l Comme nl sel s a c omme nl on a fiIe or di recl ory. The c omme nl is a oi nl er lo
a nuI I - l er mi nal ed sl ri ng of u lo 80 characl ers.
5ctPrntcctinn
;/2<:5#N To sel fi I e, or di recl ory, rol ecl i on.
R:2&N ,/DD#55 k ,#9;2:9#D9':.i .)&#F &)5M d
DO D I D2
%2(/&#.9N na me - fiIe na me
mas k - l he rol ecl i on mas k requi red
G#5/09N success - booI ean
*#5D2'<9':.N
Sel Ir ol ecl i on sel s l he rol ecl i on al l ri bul es on a fiIe or di recl ory. The I over
f our bi ls of l he mas k are as f oI I ovs:
bi l 3: if 1 l hen r eads nol aI I oved, eI se r eads aI I oved.
bi l 2: if 1 l hen vri l es nol aI I oved, eI se vri l es aI I oved.
bi l 1: if 1 l hen execul i on nol aI I oved, eI se execul i on aI I oved.
bi l 0: if 1 l hen deI el i on nol aI I oved, eI se deI el i on aI I oved.
i ls 31- 4 Res er ved.
OnI y deI el e is checked f or in l he currenl reI ease of Ami ga DOS . Ral her l han
ref erri ng lo bi ls by numbe r you shouI d us e l he def i ni l i ons i n " i ncI ude/ I i brari es/
do s . h" .
UnLnck
;/2<:5#N To unI ock a di recl ory or fi I e.
R:2&N 4.0:DMi 0:DMd
D I
%2(/&#.9N I ock - oi nl er lo a I ock
180 AMIGADO5 DEVELOPER'5 MANUAL
*#5D2'<9':.N
UnLo c k r e move s a f i I i ng s ys l e m I ock obl ai ned f r om Loc k, DuLoc k, or
Cr eal eDi r .
WaitFnrChar
;/2<:5#N To i ndi cal e vhel her characl ers arri ve vi l hi n a l i me I i mi l or nol .
R:2&N K::0 k L)'9R:2?")2> >'0#F 9'&#:/9d
DO D I D2
%2(/&#.9N fiIe - fiIe handI e
l i meoul - i nl eger
G#5/09N booI - booI ean
*#5D2'<9':.N
If a characl er is avai I abI e l o be r ead f r om l he fiIe associ al ed vi l h l he handI e
" f i I e " vi l hi n a cerl ai n l i me, i ndi cal ed by " l i me oul " , Wai l Ior Char r el ur ns -1
( TRUI) , ol her vi s e, il r el ur ns 0 ( IALSI) . If a characl er i s avai I abI e, you can
us e Re a d l o r ead i l . Nol e l hal Wai l Ior Char is onI y vaI i d vh e n l he I / O
s l r eams are c onnec l ed l o a vi rluaI l ermi naI devi ce. " Ti me o ul " is seci f i ed i n
mi c r os ec onds .
Writc
;/2<:5#N To vri l e byl es of dal a l o a fiIe.
R:2&N 2#9/2.#8B#.(9" k L2'9#i >'0#F K/>>#2F 0#.(9" d
DO D I D2 D3
%2(/&#.9N fiIe - fiIe handI e
buf f er - oi nl er l o buf f er
I engl h - i nl eger
G#5/09N r el ur nedLengl h - i nl eger
*#5D2'<9':.N
You can c oy dal a vi l h a combi nal i on of Read and Wr i l e. Wr i l e vri l es byl es of
dal a lo l he oe ne d fiIe " f i I e " , " I e ng l h" ref ers l o l he acl uaI I engl h of dal a lo be
l r ansf er r ed, " buf f e r " ref ers lo l he buf f er si ze.
Wr i l e r el ur ns a vaI ue l hal i ndi cal es l he I engl h of i nf or mal i on acl uaI I y vri l -
l en. Thal i s lo say, vhe n " I e ngl h" is greal er l han zer o, l he vaI ue of " I e ng l h" is
l he numbe r of characl ers vri l l en. A vaI ue of -1 i ndi cal es an error. The us er of
l hi s caII mus l aI vays check f or an error rel urn vhi c h may, for examI e,
i ndi cal e l hal l he di sk is fuII .
CALLING AMIGADO5
181
;2:D#55 @).80'.(
CrcatcPrnc
;/2<:5#N To creal e a ne v r oces s .
R:2&N <2:D#55 k ?2#)9#;2:Di .)&#F <2'F 5#(&#.9F 59)DM,'E# d
DO DI D2 D3 D4
%2(/&#.9N na me - sl ri ng
ri - i nl eger
s e gme nl - oi nl er lo a s egmenl
sl ackSi ze - i nl eger
G#5/09N r ocess - r ocess i denl i f i er
*#5D2'<9':.N
Cr eal eIr oc creal es a r ocess vi l h l he na me " n a m e " . Thal i s l o say, Cr eal eIr oc
aI I ocal es a r oces s conl roI sl rucl ure f r om l he f ree me mor y area and l hen
i ni li aI i zes il.
Cr eal eIr oc l akes a s e gme nl Iisl as l he ar gumenl " s e g me n l " . ( See aI so unde r
L OADS I G and UNLOADS IG. ) Thi s s e gme nl I i sl r er es enl s l he secl i on of
code l hal you i nl end lo r un as a ne v r ocess. Cr eal eIr oc enl er s l he code al l he
firsl s e gme nl i n l he s egmenl Iisl, vhi c h s houI d conl ai n sui l abI e i ni l i aI i zal i on
c ode or a | um lo such.
" S l a c kS i z e " r er esenl s l he si ze of l he rool sl ack i n byl es vh e n Cr eal eIr oc
acl i val es l he r oces s. " Ir i " seci f i es l he requi red ri ori ly of l he n e v r oc es s .
The resuI l i s l he r ocess i denl i f i er of l he n e v r ocess , or zer o if l he r oul i ne
f ai I ed.
The ar gumenl " n a m e " seci f i es l he r oces s na me .
A zer o r el ur n code i mI i es an error of s ome ki nd.
Datc5tamp
;/2<:5#N To obl ai n l he dal e and l i me i n i nl ernaI f ormal .
R:2&N CN k *)9#,9)&<' C d
%2(/&#.9N v - oi nl er
*#5D2'<9':.N
Dal e Sl am l akes a vecl or of l hr ee I ong vor ds l hal is sel l o l he cur r enl l i me.
The firsl eI emenl i n l he vecl or is a counl of l he numbe r of days . The s ec ond
eI emenl is l he numbe r of mi nul es eI ased i n l he day. The l hi rd is l he numbe r
of ticks eI ased i n l he cur r enl mi nul e. A li ck hae ns 50 l i mes a s ec ond.
Dal e Sl am ens ur es l hal l he day and mi nul e are consi sl enl . AII l hree eI emenl s
are zer o if l he dal e is uns el . Dal eSl am currenl I y onI y r el ur ns even muI l i I es
of 50 l i cks. Ther ef or e l he l i me you gel i s aI vays an i nl egraI numbe r of s ec onds .
182 AMIGADO5 DEVELOPER'5 MANUAL
Dc!ay
;/2<:5#N To deI ay a r oces s for a seci f i ed l i me.
R:2&N *#0)=i 9'&#:/9d
D I
%2(/&#.9N l i meoul - i nl eger
*#5D2'<9':.N
The f uncl i on DeI ay l akes an ar gumenl " l i me oul " , " l i me o ul " aI I ovs you lo
seci f y h o v I ong l he r oces s s houI d vai l i n l i cks (50 er s ec ond) .
DcviccPrnc
;/2<:5#N To rel urn l he r ocess i denl i f i er of l he r ocess handI i ng l hal I / O.
R:2&N <2:D#55 k *#C'D#;2:D' .)&# d
DO D I
%2(/&#.9N na me - sl ri ng
G#5/09N r oces s - r ocess i denl i f i er
*#5D2'<9':.N
Devi c eIr oc r el ur ns l he r oces s i denl i f i er of l he r oc es s l hal handI es l he
devi ce associ al ed vi l h l he seci f i ed name . If Devi ceIr oc cannol f i nd a r ocess
handI er , l he resuI l is zer o. If " n a m e " ref ers l o a fiIe on a mounl e d devi ce, l hen
IoIrr() r el ur ns a oi nl er lo a di recl ory I ock.
You can us e l hi s f uncl i on l o del er mi ne l he r ocess i denl i f i cal i on of l he
handI er r oces s vher e l he s ys l em shouI d s end ils mes s ages .
Exit
;/2<:5#N To exi l f r om a r ogr am.
R:2&N JX'9i 2#9/2.?:8# d
D I
%2(/&#.9N r el ur nCode - i nl eger
*#5D2'<9':.N
Ixi l acl s di f f erenl I y deendi ng on vhe l he r you are r unni ng a r ogr am unde r a
CLI or nol . If you r un, as a c omma nd under a CLI , a r ogr am l hal caI I s Ixi l,
l he c o mma nd f i ni shes and conl roI reverl s lo l he CLI . Ixi l l hen i nl errel s l he
a r gume nl " r e l ur nCo de " as l he r el ur n c ode f r om l he r ogr am.
If you r un l he r ogr am as a di sl i ncl r oc es s , Ixi l deI el es l he r oc es s
and reI eases l he sace associ al ed vi l h l he sl ack, s egmenl Iisl, and r ocess
sl rucl ure.
CALLING AMIGADO5
183
B:)8'.( ?:8#
Exccutc
;/2<:5#N To execul e a CLI c omma nd.
R:2&N ,/DD#55 k JX#D/9#i D:&&).8,92'.(F '.</9F :/9</9d
DO DI D2 D3
%2(/&#.9N c ommandSl r i ng - sl ri ng
i nul - fiIe handI e
oul ul - fiIe handI e
G#5/09N Success - booI ean
*#5D2'<9':.N
Thi s f uncl i on l akes a sl ri ng ( commandSl r i ng) l hal seci f i es a CLI c o mma nd
and ar gumenl s , and al l eml s lo execul e il. The CLI sl ri ng can conl ai n any
vaI i d i nul l hal you couI d l ye di reclI y al a CLI , i ncI udi ng i nul a nd oul ul
i ndi recl i on usi ng > and < .
The i nul fiIe handI e viII nor maI I y be zer o, and i n l hi s case l he IXICUTI
c omma nd viII er f or m vhal ever vas r eques l ed i n l he c ommandSl r i ng and
l he n rel urn. If l he i nul fiIe handI e i s nonzer o l hen afler l he ( ossi bI y nuI I )
c ommandSl r i ng is er f or med s ubs equenl i nul is r ead f r om l he seci f i ed i nul
fiIe handI e unl i I e nd of fiIe is r eached.
I n mos l cases l he oul ul fiIe handI e mus l be r ovi ded, and viII be us ed by
l he CLI c omma nds as l hei r oul ul sl ream unI ess redi recl i on va s seci f i ed. If
l he oul ul fiIe handI e is sel lo zer o l hen l he cur r enl vi ndov, nor maI I y
seci f i ed as , is us ed. Nol e l hal r ogr ams r unni ng under l he Wor kbe nc h do
nol nor maI I y have a cur r enl vi ndov.
The Ixecul e f uncl i on ma y aI so be us ed lo creal e a ne v i nl eracl i ve CLI
r oces s | us l Iike l hose creal ed vi l h l he NIWCLI f uncl i on. In order lo do l hi s
you s houI d caII Ixecul e vi l h an eml y c ommandSl r i ng, and as s a fiIe handI e
reI al i ng l o a n e v vi ndov as l he i nul fiIe handI e. The oul ul fiIe handI e
shouI d be sel lo zer o. The CLI viII r ead c omma nds f r om l he ne v vi ndov, and
vi I I us e l he s ame vi ndov for oul ul . Thi s ne v CLI vi ndov can onI y be
l er mi nal ed by us i ng l he INDCLI c omma nd. Ior l hi s c omma nd l o vor k l he
r ogr am C: RUN mus l be r esenl in C: .
Lnad5cg
;/2<:5#N To I oad a I oad moduI e i nl o me mor y.
R:2&N 5#(&#.9 k B:)8,#(i .)&# d
DO DI
%2(/&#.9N na me - sl ri ng
184 AMIGADO5 DEVELOPER'5 MANUAL
G#5/09N s egmenl - oi nl er lo a s egmenl
*#5D2'<9':.N
The fiIe " n a m e " is a I oad moduI e r oduced by l he I i nker. LoadSeg l akes l hi s
and scal l er- I oads l he code s egmenl s i nl o me mor y, chai ni ng l he s egmenl s
l ogel her on l hei r firsl vor ds . Il r ecogni zes a zer o as i ndi cal i ng l he end of l he
chai n.
If an error occur s, LoadSeg unI oads any I oaded bI ocks and r el ur ns a f aI se
(zero) resuI l .
If aII goes veI I ( l hal i s, LoadSeg has I oaded l he moduI e correcl I y) , l hen
Loads eg r el ur ns a oi nl er lo l he begi nni ng of l he Iisl or bI ocks. Onc e you have
f i ni shed vi l h l he I oaded code, you can unI oad il vi l h a caII l o UnLoadSe g. ( Ior
us i ng l he I oaded c ode, see CRIATIIROC. )
UnLnad5cg
;/2<:5#N To unI oad a s egmenl revi ousI y I oaded by L OADS I G.
R:2&N 4.B:)8,#(i 5#(&#.9d
D!
%2(/&#.9N s egmenl - oi nl er lo a s egmenl
*#5D2'<9':.N
UnLoa dSe g unI oads l he s egmenl i denl i f i er l hal vas r el ur ned by LoadSeg.
" s e g me n l " ma y be zer o.
a/'DM G#>#2#.D# ?)28
R'0# @).80'.(
CI os e l o cI ose a fiIe f or i nul or oul ul .
Cr eal eDi r l o creal e a ne v di recl ory.
Cur r enl Di r lo make a di recl ory associ al ed vi l h a I ock l he cur r enl vor ki ng
di recl ory.
DeI el eIi I e lo deI el e a fiIe or di recl ory.
DuLoc k lo duI i cal e a I ock.
Ixami ne lo exami ne a di recl ory or fiIe associ al ed vi l h a I ock.
IxNexl lo exami ne l he nexl enl r y i n a di recl ory.
I nf o lo rel ur n i nf or mal i on aboul l he di sk.
I nul lo i denl i f y l he iniliaI i nul fiIe handI e.
I oIrr l o rel urn exlra i nf or mal i on f r om l he s ys l em.
I sI nl eracl i ve l o di scover vhel her a fiIe is c onnec l ed l o a vi rluaI l er mi naI
or nol .
Lock lo I ock a fiIe or di recl ory.
CALLING AMIGADO5
185
Oe n lo oen a fiIe for i nul or oul ul .
Oul ul lo i denl i f y l he iniliaI oul ul fiIe handI e.
Iar enl Di r lo obl ai n l he ar enl of a di recl ory or fi I e.
Re a d l o r ead byl es of dal a f r om a fiIe.
Re na me lo r e name a fiIe or di recl ory.
Se e k l o move lo a I ogi caI osi l i on i n a fiIe.
S e l Comme nl l o sel a c ommenl .
Sel Ir ol ecl i on l o sel fi I e, or di recl ory, rol ecl i on.
UnI oc k l o unI ock a fiIe or di recl ory.
Wai l Ior Char lo i ndi cal e vhe l he r characl ers arri ve vi l hi n a l i me I i mi l or
nol .
Wr i l e l o vri l e byl es of dal a lo a fiIe.
;2:D#55 @).80'.(
Cr eal eIr oc l o creal e a ne v r oces s.
Dal e Sl am lo obl ai n l he dal e and l i me i n i nl ernaI f or mal .
DeI ay lo deI ay a r ocess for a seci f i ed lime.
Devi ceIr oc lo rel ur n l he r ocess i denl i f i er of l he r ocess handI i ng l hal I / O.
Ixi l lo exi l f r om a r ogr am.
B:)8'.( ?:8#
Ixecul e lo execul e a CLI c omma nd.
LoadSe g lo I oad a I oad moduI e i nl o me mor y.
UnI oadSe g lo unI oad a s egmenl revi ousI y I oaded by LOADS IG.
?")<9#2 Q
The Macro AssembIer
Thi s chal er descri bes l he Ami ga DOS Macr o As s embI er . Il gi ves a bri ef i nl ro-
ducl i on l o l he 68000 mi cr ochi . Thi s chal er is i nl ended f or l he r eader vho is
acquai nl ed vi l h an as s embI y I anguage on anol her c omul er .
3. 1
I nl roducl i on lo l he 68000 Mi cr ochi
3. 2
CaI I i ng l he As s embI er
3. 3
Ir ogr am Inc odi ng
3. 3. 1 Comme nl s
3. 3. 2
Ixecul abI e I nsl rucl i ons
3. 3. 2. 1 LabeI Ii eI d
3. 3. 2. 2 LocaI LabeI s
3. 3. 2. 3 Oc ode Ii eI d
3. 3. 2. 4 Oe r a nd Ii eI d
3. 3. 2. 5 Co mme nl Ii eI d
3. 4 Ixr essi ons
3. 4. 1 Oer al or s
3. 4. 2 Oe r a nd Tyes f or Oer al or s
3. 4. 3 SymboI s
3. 4. 4 Numbe r s
3. 5
Addr es s i ng Mode s
3. 6
Vari anl s on I nsl rucl i on Tyes
3. 7 Di recl i ves
Q3O H.92:8/D9':. 9: 9"# Zehhh -'D2:D"'<
Thi s secl i on gi ves a bri ef i nl roducl i on lo l he 68000 mi cr ochi . Il s houI d heI
you lo under s l and l he concel s i nl r oduced I al er i n l he chal er . Il as s ume s l hal
you have aI ready ha d exer i ence vi l h as s embI y I anguage on anol her c omul er .
The me mor y avai I abI e lo l he 68000 consi sl s of
THE MACRO A55EMBLER 187
l he i nl ernaI regi sl ers ( on l he chi ) , and
l he exl ernaI mai n me mor y.
Ther e are 17 regi sl ers, bul onI y 16 are avai I abI e al any gi ven mome nl . Ii ghl
of l he m are dal a regi sl ers na me d DO l o D7, and l he ol hers are addr es s regi sl ers
caI I ed AO lo A7. Iach regi sl er conl ai ns 32 bi l s. I n ma ny conl exl s, you ma y us e
ei l her ki nd of regi sl er, bul ol her s de ma nd a seci fi c ki nd. Ior i ns l ance, you
ma y us e any regi sl er for oer al i ons on vor d (16-bi l) and I ong vor d (32-bi l)
quanl i l i es or f or i ndexed addr essi ng of mai n me mor y. AI l hough, f or oer al i ons
on byl e (8-bil) oer ands , you ma y onI y us e dal a regi sl ers, and f or addr es s i ng
mai n me mor y, you ma y onI y us e addr ess regi sl ers as sl ack oi nl er s or bas e
regi sl ers. Regi sl er A7 is l he sl ack oi nl er, and l hi s is i n facl l vo di sl i ncl
regi sl ers: l he s ys l em sl ack oi nl er avai I abI e i n suervi sor mode and l he us er
sl ack oi nl er avai I abI e i n us er mode .
The mai n me mor y consi sl s of a numbe r of byl es of me mor y. Iac h byl e has
an i denl i f yi ng numbe r caI I ed ils addr es s . Me mor y is usuaI I y ( bul nol aI vays)
ar r anged so l hal ils byl es have addr es s es 0, 1, 2, . . . , N- 2, N- I vhe r e l her e are
N byl es of me mor y i n lolaI . The si ze of me mor y l hal you can di recl I y access is
ver y I ar geu lo 16 mi I I i on byl es. The 68000 can er f or m oer al i ons on byl es ,
vor ds , or I ong vor ds of me mor y. A vor d is l vo consecul i ve byl es . I n a vor d,
l he firsl byl e has an even addr ess. A I ong vor d is f our consecul i ve byl es aI so
sl arl i ng al an even addr ess . The addr ess of a I ong vor d i s l he eve n addr es s of
ils I ovesl numbe r e d firsl byl e.
As veI I as hoI di ng i l ems of dal a bei ng mani uI al ed by l he c omul er , l he
mai n me mor y aI so hoI ds l he i nsl r ucl i ons l hal leII l he c omul er vhal lo do.
Iach i nsl rucl i on occui es f r om one l o 5 vor ds , consi sl i ng of an oer al i on vor d
be l ve e n zer o and f our oer and vor ds . The oer al i on vor d seci f i es vha l
acl i on is lo be er f or med ( and i mI i ci lI y ho v ma ny vor ds l her e are i n l he
vhoI e i nsl rucl i on) . The oer and vor ds i ndi cal e vher e i n l he regi sl ers or mai n
me mor y are l he i l ems lo be mani uI al ed, and vher e l he resuI l s houI d be
I aced.
The as s embI er usuaI I y execul es i nsl rucl i ons one al a l i me i n l he or der l hal
l hey occur i n me mor y, Iike l he vay you f oI I ov l he sl es i n a reci e or I ay l he
nol es i n a i ece of vri l l en mus i c. Ther e is a seci aI regi sl er caI I ed l he r ogr am
counl er ( IC) vhi c h you us e lo hoI d l he addr ess of l he i nsl rucl i on you vanl l he
as s embI er lo execul e nexl . Some i nsl rucl i ons, caI I ed | ums or br anc he s , us el
l he usuaI order, and f orce l he as s embI er l o conl i nue execul i ng l he i nsl rucl i on
al a seci fi c addr ess. Thi s I els l he c omul er er f or m an acl i on r eeal edI y, or
do di f f erenl l hi ngs deendi ng on l he vaI ues of dal a i l ems.
To r e me mbe r arl i cuI ar l hi ngs aboul l he sl al e of l he c omul er , you can us e
one ol her seci aI regi sl er caI I ed l he sl al us regi sl er ( SR) .
188
AMIGADO5 DEVELOPER'5 MANUAL
!"# ?)00'.( 9"# %55#&K0#2
The c o mma nd l emI al e f or as s em is
" I R O G IROM/ A, - 0/ K, - V/ K, - L/ K, - H/ K, - C/ K, - I / K"
AI l ernal i veI y, l he f or mal of l he c omma nd I i ne can be descr i bed as
a s s e m < s o ur c e f i I e > |-o < o b | e c l f i I e > j
|-1 <I i s l i ng f i I e > j
|-v <ver i f i cal i on f i I e > j
|-h < h e a de r f i I e >j
|-c < o l i o n s > j
|-i < i nc I ude di r I i s l >j
The as s embI er does nol r oduce an ob| ecl fiIe or a I i sli ng fiIe unI es s you
r equesl l he m exI i ci lI y.
As l he as s embI er i s r unni ng, il gener al es di agnosl i c mes s ages ( errors, var n-
i ngs , and as s embI y slali sli cs) and s ends l he m lo l he scr een unI es s you seci f y
a veri f i cal i on fi I e.
To f or ce l he i ncI usi on of l he na me d fi Ie i n l he as s embI y al l he he a d of l he
sour ce fi I e, you us e - h < f i I e n a me > on l he c omma nd I i ne. Thi s has l he s ame
ef f ecl as us i ng
I NCLUDI " < f f I e n a r n e > "
on I i ne 1 of l he s our ce fi I e.
To sel u l he Iisl of di recl ori es l hal l he assembI er shouI d sear ch for any
I NCLUDId fi I es, you us e l he -i keyvor d. You shouI d seci f y as ma ny di recl o-
ri es as you requi re af l er l he -i , searal i ng l he di recl ory na me s by a c omma (, ), a
I us si gn ( + ) , or a s ace. Nol e l hal if you us e a s ace, you mus l encI ose l he
enl i re di recl ory Iisl i n doubI e quol es ( " ) . Uni x us er s, hovever , mus l es cae any
doubI e quol es vi l h a backsI as h (").
The or der of l he Iisl del er mi nes l he order of l he di recl ori es vhe r e l he
as s embI er s houI d sear ch for I NCLUDId fi I es. The as s embI er iniliaIIy s ear ches
l he cur r enl di recl ory bef or e any ol her s. Thus any fiIe l hal you I NCLUDI i n a
r ogr am mus l be i n l he cur r enl di recl ory, or i n one of l he di recl ori es I i sl ed i n
l he -i Iisl. Ior i ns l ance, if l he r ogr am " f r e d" I NCLUDIS, aarl f r om fiIes i n l he
cur r enl di recl ory, a fiIe f r om l he di recl ory " i nl r nI / i ncI " , a fiIe f r om l he di recl ory
" i nc I ude / a s m" , and a fiIe f r om l he di recl ory " exl r nI / i ncI " , you can gi ve l he -i
di recl ory Iisl i n l hes e l hree vays :
THE MACRO A55EMBLER 189
a s s e m f r e d -i i nl r nI / i nc I , i nc I ude / a s m, e x l r nI / i nc I
a s s e m f r e d -i ml r n I / i n c I + I nc I ude / a s m + e x l r nI / I nc I
a s s e m f r e d -i " i nl r nI / i nc I i nc I ude / a s m e x l r nI / i nc I "
or, by us i ng l he sace searal or on l he Sun under Uni x, I i ke lhi s
a s s e m f r e d -i V' i nl r nI / i nc I i nc I ude / a s m e x l r nI / i nc I V
The -c ke yvor d aI I ovs you lo ass cerl ai n ol i ons l o l he assembI er . Iach
ol i on consi sl s of a si ngI e characl er (in ei l her uer or I over cas e) , ossi bI y
f oI I oved i mmedi al eI y by a number . VaI i d ol i ons f oI I ov her e:
S r oduces a s ymboI dum as a arl of l he ob| ecl fi I e.
D i nhi bi l s l he dumi ng of I ocaI I abeI s as arl of a s ymboI dum. ( Ior C
r ogr ammer s , any I abeI begi nni ng vi l h a eri od is cons i der ed a I ocaI
I abeI . )
C i gnor es l he di sl i ncl i on be l ve e n uer and I over case i n I abeI s.
X r oduces a cross- ref erence l abI e al l he e nd of l he I i sl i ng fi I e.
JX)&<0#5
a s s e m f r e d. a s m - o f r ed. o
as s e mbI e s l he fi Ie " f r e d . a s m" a nd r oduc es a n ob| ecl moduI e i n l he fi I e
f r ed. o.
a s s e m f r e d. a s m -o f r ed. o -1 f r ed. 1st
as s embI es l he fiIe f r ed. as m, r oduces an ob| ecl moduI e i n l he fiIe f r ed. o, and
r oduces a I i sli ng fiIe i n " f r e d. 1s l " .
!"! ;2:(2)& J.D:8'.(
% r ogr am accel abI e lo l he assembI er l akes l he f or m of a seri es of i nul I i nes
l hal can i ncI ude any of l he f oI I ovi ng:
Co mme nl or I ank I i nes
Ixecul abI e I nsl rucl i ons
As s embI e r Di recl i ves
190 AMIGADO5 DEVELOPER' 5 MANUAL
Q3Q3O ?:&&#.95
To i nl r oduce c omme nl s i nl o l he r ogr am, you can us e l hree di f f erenl me l hods :
1. Tye a semi coI on (,) anyvher e on a I i ne and f oI I ov il vi l h l he lexl of l he
c omme nl . Ior examI e,
CMIA. L A I , A2 , Ar e l h e o i nl e r s e qua I `
2. Tye an asl eri sk () i n c oI umn one of a I i ne and f oI I ov il vi l h l he l exl of l he
c omme nl . Ior examI e,
Th i s e nl i r e I i ne i s a c o m m e n l
3. IoI I ov a ny comI el e i nsl rucl i on or di recl i ve vi l h al I easl one sace and
s ome l exl. Ior examI e,
MOVIQ -I O, DO I a c e i ni l i a I va I ue i n DO
I n addi l i on, nol e l hal aII bI ank I i nes are l real ed by l he as s embI er as
c omme nl I i nes.
Q3Q3P JX#D/9)K0# H.592/D9':.5
The source s l al emenl s have l he generaI overaI I f ormal :
| < I a b e I > j < o c o d e > | < o e r a n d > | , < o e r a n d > j . . . | < c o m m e n l > j
To searal e each fi eI d f r om l he nexl , ress l he S IACIAR or TA key. Thi s
r oduc es a sear al or characl er. You ma y us e mor e l han one sace l o sear al e
f i eI ds.
Q3Q3P3O B)K#0 R'#08
% I abeI is a user s ymboI , or r ogr ammer - def i ned na me , l hal ei l her
a) Sl arl s i n l he firsl c oI umn and is sear al ed f r om l he nexl fi eI d by al I easl one
s ace, or
b) Sl arl s i n any c oI umn, and is f oI I oved i mmedi al eI y vi l h a coI on (:).
If a I abeI is r esenl , l hen il mus l be l he firsl nonbI ank i l em on l he I i ne. The
as s embI er assi gns l he vaI ue and l ye of l he r ogr am counl er , l hal i s, l he
me mor y addr ess of l he firsl byl e of l he i nsl rucl i on or dal a bei ng r ef er enced, lo
l he I abeI . LabeI s are aI I oved on aII i nsl rucl i ons, and on s ome di recl i ves, or
THE MACRO A55EMBLER 191
l hey ma y sl and aI one on a I i ne. See l he seci f i cal i ons of i ndi vi duaI di recl i ves i n
Secl i on 3. 7 f or vhe l he r a I abeI fieId is aI I oved.
Nol e: You mus l nol gi ve muI l i I e def i ni l i ons l o I abeI s. AI s o, you mus l nol
us e i nsl rucl i on na me s , macr o na me s , di recl i ves, or regi sl er na me s as I abeI s.
Q3Q3P3P B:D)0 B)K#05
LocaI I abeI s are r ovi ded as an exl ensi on l o l he Mol or oI a seci f i cal i on.
The y l ake l he f or m nnn$ and are onI y vaI i d bel veen any r oer ( named) I abeI s.
Thus , i n l hi s examI e code s egmenl
Labe I s Oc ode s Oer ands
I OO: MOVI. L D6, D0
1$: MOVI . ( A0) + , ( A1) +
DRA D0, 1$
M O V I Q - 2 0 , D0
AA: TRAI - 4
l he I abeI 1$ is onI y avai I abI e f r om l he I i ne f oI I ovi ng l he one I abeI I ed I O O l o l he
I i ne bef or e l he one I abeI I ed AA. In lhi s case, you couI d l hen us e l he I abeI 1$
i n a di f f erenl s coe eI s evher e i n l he r ogr am.
3. 3. 2. 3 +<D:8# R'#08
The Oc ode fieId f oI I ovs l he LabeI fieI d and is sear al ed f r om il by al I easl
one sace. Inl ri es i n lhi s fieId are of l hree l yes.
1. The MC6800 0 oeral i on codes , as def i ned i n l he -?Zehhh 45#2 -)./)03
P3 As s embI er Di recl i ves.
3. Mac r o i nvocal i ons.
To enl er i nsl rucl i ons and di recl i ves l hal can oer al e on mor e l han one dal a
si ze, you us e an ol i onaI Si ze- Seci f i er subf i eI d, vhi c h i s sear al ed f r om l he
oc ode by l he er i od (.) characl er. Iossi bI e si ze seci f i ers are as f oI I ovs:
- yl e- si zed dal a (8 bi l s)
W - Wor d- s i zed dal a (16 bi ls)
L - Long Wor d- s i zed dal a (32 bi l s)
or Long r anch seci f i er
S - Shor l r anch seci f i er
The si ze seci f i er mus l mal c h vi l h l he i nsl rucl i on or di recl i ve l ye l hal you
us e.
Q3Q3P3V +<#2).8 R'#08
If r es enl , l he oer and fieId conl ai ns one or mor e oer ands lo l he i nsl r uc-
192
AMIGADO5 DEVELOPER'5 MANUAL
l i on or di recl i ve, and mus l be sear al ed f r om il by al I easl one sace. Wh e n
you have l vo or mor e oer ands i n l he f i eI d, you mus l sear al e l he m vi l h a
c omma (, ). The oer and fi eI d l er mi nal es vi l h a sace or nevI i ne characl er (a
nevI i ne characl er is vhal l he as s embI er recei ves vhe n you r ess RITURN) , so
you mus l nol us e saces be l ve e n oer ands .
3. 3. 2. 5 ?:&&#.9 R'#08
Anyl hi ng af l er l he l er mi nal i ng s ace of l he oer and fi eI d i s i gnor ed. So l he
as s embI er l real s any characl ers you i nserl af l er a sace as a c omme nl .
Q3V JX<2#55':.5
An exr essi on is a combi nal i on of s ymboI s , cons l anl s , aI gebrai c oer al or s, and
ar enl hes es l hal you can us e l o seci f y l he oer and fi eI d l o i nsl rucl i ons or
di recl i ves. You ma y i ncI ude reI ali ve symboI s i n exr essi ons, bul l hey can onI y
be oer al ed on by a subsel of l he oer al or s.
Q3V3O +<#2)9:25
The avai I abI e oer al or s are I i sled beI ov i n or der of r ec edenc e.
1. Unar y Mi nus , Logi caI N O T ( - and" )
2. Lshi f l , Rshi f l ( a n d )
3. Logi caI AND, Logi caI OR ( & and !)
4. MuI l i I y, Di vi de ( and/ )
5. Add, Subl r acl ( + and - )
To overri de l he r ec edenc e of l he oer al or s, encI ose sub- exr essi ons i n
ar enl hes es . The as s embI er evaI ual es oer al or s of equaI r ec edenc e f r om I ef l
l o ri ghl . Nol e l hal , nor maI I y, you shouI d nol have any saces i n an exr es s i on,
as a sace is r egar ded as a deI i mi l er be l ve e n one fi eI d and anol her .
Q3V3P +<#2).8 !=<#5 >:2 +<#2)9:25
I n l he f oI I ovi ng l abI e, " A " r er es enl s absoI ul e s ymboI s , a nd " R " r er es enl s
reI al i ve s ymboI s . The l abI e s hovs aII l he ossi bI e oer al or / oer and combi na-
l i ons , vi l h l he l ye of l he r esuI l i ng vaI ue, ]X] i ndi cal es an error. The
Una r y mi nus a nd l he Logi caI oer al or s ar e onI y vaI i d vi l h an abs oI ul e
oer and.
THE MACRO A55EMBLER
193
Oer al or s
Oer ands
Oer al or s
A o A R o R A o R R o A
!
A X R R
$ A A X R

A X X X
# A X X X
! A X X X
#
A X X X

A X X X

A X X X
Tab!c 3-A: Opcrand Typcs Inr Opcratnrs
Q3V3Q ,=&K:05
% s ymboI is a sl ri ng of u lo 30 characl ers. The firsl characl er of a s ymboI mus l
be one of l he f oI I ovi ng:
An aI habel i c characl er, l hal i s, a l hr ough z, or A l hr ough Z.
An under s c or e ( ).
A er i od (. ).
The resl of l he characl ers i n l he sl ri ng can be any of l hese characl ers or aI so
numer i c (0 l hr ough 9) . I n aII s ymboI s , l he I over case characl ers ( a- z) are .:9
l real ed as s ynonyms vi l h l hei r uer case equi vaI enl s ( unI ess you us e l he
ol i on C vh e n you i nvoke l he as s embI er ) . So " f r e d" i s di f f erenl f r om " I R I D "
and " I Re d " . Hove ve r , l he assembI er r ecogni zes i nsl rucl i on oc odes , di rec-
l i ves, and regi sl er na me s i n ei l her ue r or I over case. A I abeI equal ed l o a
regi sl er na me vi l h IQUR is aI so r ecogni zed by l he as s embI er i n ei l her ue r
or I over case. SymboI s c an be u l o 30 characl ers i n I engl h, aII of vhi c h
are si gni f i canl . The as s embI er l akes s ymboI s I onger l han l hi s and l r uncal es
l he m lo 30 char acl er s, gi vi ng a var ni ng l hal il has done so. The I nsl r ucl i on
na me s , Di r ecl i ve na me s , Regi s l er na me s , a nd seci aI s ymboI s CCR, SR,
SI, a nd US I c annol be us e d as us er symboI s. A s ymboI can be one of l hr ee
l yes:
Abs oI ul e
a) The symboI vas SIT or IQUal e d l o an AbsoI ul e vaI ue.
194
AMIGADO5 DEVELOPER'5 MANUAL
Rc! at i vc
a) The s ymboI va s SIT or IQUal e d lo a ReI al i ve vaI ue.
b) The s ymboI va s us ed as a I abeI .
Rcgi st cr
a) The s ymboI vas sel l o a regi sl er na me us i ng I QUR ( Thi s i s a n exl ens i on
f r om l he Mol or oI a seci f i cal i on) .
Ther e is a seci aI s ymboI " " , vhi c h has l he vaI ue and l ye of l he cur r enl
r ogr am counl er , l hal i s, l he addr ess of l he currenl i nsl rucl i on or di recl i ve l hal
l he as s embI er is acl i ng on.
Q3V3V S/&K#25
You ma y us e a numbe r as a l er m of an exressi on, or as a si ngI e vaI ue. Numbe r s
ALWAYS have absoI ul e vaI ues and can l ake one of l he f oI I ovi ng f or mal s :
Dcci ma!
(a sl ri ng of deci maI di gi ls)
IxamI e: 1234
Hcxadcci ma!
($ f oI I oved by a sl ri ng of hex di gi ls)
IxamI e: $89A
Oct a!
( f oI I oved by a sl ri ng of ocl aI di gi ls)
IxamI e: 7 4 3
Bi nar y
(% f oI I oved by zer os and ones )
IxamI e: %10110111
A5CI I Li t cra!
( U l o 4 ASCI I characl ers vi l hi n quol es)
IxamI es : ' ACD' ' '
Sl r i ngs of I ess l han 4 characl ers are | usl i f i ed lo l he ri ghl , us i ng nuI as l he
acki ng characl er.
To obl ai n a quol e characl er i n l he sl ri ng, you mus l us e l vo quol es . An
examI e of l hi s is
'It' 's'
THE MACRO A55EMBLER
195
!"% %882#55'.( -:8#5
The ef f ecl i ve addr es s mode s def i ne l he oer ands l o i nsl r ucl i ons a nd di recl i ves,
and you can f i nd a del ai I ed descri l i on of l he m i n any good r ef er ence book on
l he 68000. Addr es s es ref er lo i ndi vi duaI byl es , bul i nsl r ucl i ons, vor d and
I ong vor d r ef er ences , access mor e l han one byl e, and l he addr es s f or l hes e
mus l be vor d aI i gned.
In l he f oI I ovi ng l abI e, Dn r er esenl s one of l he dal a regi sl ers ( D0 - D7 ) , " A n "
r er esenl s one of l he addr ess regi sl ers ( A0 - A7 , SI and IC) , " a " r er es enl s an
absoI ul e exr essi on, " r " r er es enl s a reI ali ve exr essi on, and " X n " r er es enl s
An or Dn, vi l h an ol i onaI " . W " or " . L " si ze seci fi er. The synl ax f or each of
l he mode s is as f oI I ovs:
Tab!c 3-B: Macrn Asscmb!cr Addrcss Mndcs and Rcgistcrs
Addr es s Mo de Des c r i l i on and IxamI es
Dn Dal a Regi sl er Di recl
IxamI e: MOVI DO, D I
An Addr es s Regi sl er Di recl
IxamI e: MOVI A A0 , A1
( An) Addr es s Regi sl er I ndi recl
IxamI e: MOVI D0, ( A1)
( An) + Addr es s Regi sl er I ndi recl Ios l I nc r emenl
IxamI e: MOVI (A7) + , D0
- ( An) Addr es s Regi sl er I ndi recl Ir e Dec r emenl
IxamI e: MOVI D0, - ( A7)
a( An)
Addr es s Regi sl er I ndi recl vi l h Di s I acemenl
IxamI e: MOVI 20( A0) , D1
a( An, Xn) Addr es s Regi sl er I ndi recl vi l h I ndex
IxamI e: MOVI 0( A0, D0) , D1
M O V I 12( A1, A0. L) , D2
MOVI 120( A0, D6. W) , D4
a Shor l absoI ul e (16 bi ls)
IxamI e: MOVI $1000, D0
a Long absoI ul e (32 bi ls)
IxamI e: MOVI $10000, D0
r
Ir ogr am Counl er ReI al i ve vi l h Di s I acemenl
IxamI e: MOVI AQDO
( AC is reI ali ve)
r( Xn) Ir ogr am Counl er ReI al i ve vi l h I ndex
IxamI e: MOVI AC( D0. L) , D1
( AC i s reI ali ve)
196 AMIGADO5 DEVELOPER'5 MANUAL
- a I mmedi al e dal a
IxamI e: MOVI - 1 2 3 4 , D0
US I
CCR
SR
Seci aI addr essi ng mode s
IxamI e: MOVI A0 , US I
MOVI D0 , CCR
MOVI D1 , S R
!"& Y)2').95 :. H.592/D9':. !=<#5
Cerl ai n i nsl rucl i ons (for examI e, ADD, CMI) have an addr css vari ant (l hal
ref ers l o addr es s regi sl ers as desl i nal i ons) , i mmcdi at c and qui ck f or ms ( vhe n
i mmedi al e dal a ossi bI y vi l hi n a resl ri cl ed si ze r ange aear s as an oer and) ,
and a mc mnr y vari ant ( vher e bol h oer ands mus l be a os l i nc r emenl addr es s ) .
To f orce a arl i cuI ar vari anl lo be us ed, you may ae nd A, Q, I, or M l o l he
i nsl rucl i on mne moni c . In l hi s cas e, l he as s embI er us es l he seci f i ed f or m of
l he i nsl rucl i on, if il exi sl s, or gi ves an error mes s age.
If, hove ve r , you seci f y no arl i cuI ar vari anl , l he as s embI er aul omal i caI I y
conver l s lo l he " I " , " A " , or " M " f or ms vher e ar or i al e. Hove ve r , il does
nol converl l o l he " Q " f or m. Ior examI e, l he assembI er converl s l he f oI I ovi ng:
ADD. L A2 , A I
ADDA. L A2 , A I
!"' *'2#D9'C#5
AI I as s embI er di recl i ves ( vi l h l he excel i on of DC and DC) are i nsl rucl i ons lo
l he as s embI er , ral her l han i nsl rucl i ons l o be l ransI al ed i nl o ob| ecl code. Al l he
begi nni ng of l hi s secl i on, l here is a Iisl of aII l he di recl i ves ( TabI e 3- C) ,
ar r anged by f uncl i on, al l he e nd l here is an i ndi vi duaI descri l i on f or each
di recl i ve, ar r anged by f uncl i on.
Nol e l hal l he assembI er onI y aI I ovs I abeI s on di recl i ves vhe r e seci f i ed. Ior
examI e, I QU is aI I oved a I abeI . Il is ol i onaI f or RORG, bul nol aI I oved f or
LLIN or TTL.
The f oI I ovi ng l abI e Iisls l he di recl i ves by f uncl i on:
l o
THE MACRO A55EMBLER 197
Tab!c 3-C: Dircctivcs
%55#&K0= ?:.92:0
Di rcct i vc
S ICTI ON
RORG
OIISIT
IND
,=&K:0 *#>'.'9':.
Di rcct i vc
IQU
IQUR
RIG
SIT
*)9) *#>'.'9':.
Di rcct i vc
DC
DC
DS
B'59'.( ?:.92:0
Di rcct i vc
IAGI
LI ST
NOLI S T ( NOL)
SIC n
NOI AGI
LLIN n
ILIN n
TTL
NOO}
IAI L
I ORMAT
NOI ORMAT
Dcscri pt i nn
Ir ogr am secl i on
ReI ocal abI e ori gi n
Def i ne of f sel s
Ir ogr am e nd
Dcscri pt i nn
As s i gn e r mane nl vaI ue
As s i gn e r mane nl regi sl er vaI ue
As s i gn er manenl vaI ue
As s i gn l emor ar y vaI ue
Dcscri pt i nn
Def i ne consl anl s
Def i ne Cons l anl I ock
Def i ne sl orage
Dcscri pt i nn
Iage- l hr ov l o I i sli ng
Tur n on I i sl i ng
Tur n off I i sli ng
Ski n bI ank I i nes
Tur n off agi ng
Sel I i ne I engl h (60 < n < 132)
Sel age I engl h (24 < n < 100)
Sel r ogr am lilIe ( max 40 char s. )
Di sabI e ob| ecl code oul ul
Gener al e an as s embI y error
No acl i on
No acl i on
?:.8'9':.)0 %55#&K0=
Di rcct i vc
CNOI
I IIQ
I INI
I IGT
Dcscri pt i nn
Condi l i onaI NOI for aI i gnmenl
As s embI e if exr essi on is 0
As s embI e if exr essi on i s nol 0
As s embI e if exr essi on > 0
198
AMIGADO5 DEVELOPER'5 MANUAL
Di r ecl i ve Des c r i l i on
I IGI As s embI e if exr essi on > 0
I ILT As s embI e if exr essi on < 0
I ILI As s embI e if exr essi on < 0
I IC As s embI e if sl ri ngs are i denl i caI
I INC As s embI e if sl ri ngs are nol i denl i caI
I ID As s embI e if symboI is def i ned
I IND As s embI e if s ymboI is nol def i ned
INDC Ind of condi l i onaI as s embI y
-)D2: *'2#D9'C#5
Di r ecl i ve Des c r i l i on
MACRO Def i ne a macr o na me
NARG Seci aI symboI
I NDM Ind of macr o def i ni l i on
MIXI T Ixil l he macr o exans i on
JX9#2.)0 ,=&K:05
Di r ecl i ve Des c r i l i on
XDII Def i ne exl ernaI na me
XRII Ref er ence exl ernaI na me
7#.#2)0 *'2#D9'C#5
Di r ecl i ve Des c r i l i on
I NCLUDI I nserl fiIe i n l he sour ce
MAS K2 No acl i on
I DNT Na me r ogr am uni l
%55#&K0= ?:.92:0 *'2#D9'C#5
,J?!H+S Ir ogr am Secl i on
R:2&)9N | < I a b e I > j S ICTI ON < n a m e > | , < l y e > j
Thi s di recl i ve leI I s l he as s embI er lo resl ore l he counl er l o l he I asl I ocal i on
aI I ocal ed i n l he na me d secl i on (or l o zero if us ed f or l he firsl l i me) .
< n a m e > i s a characl er sl ri ng ol i onaI I y encI osed i n doubI e quol es .
< l y e > if i ncI uded, mus l be one of l he f oI I ovi ng keyvor ds :
C O D I i ndi cal es l hal l he secl i on c onl ai ns r eI ocal abI e c ode . Thi s is l he
def auI l .
DATA I ndi cal es l hal l he secl i on conl ai ns i ni li aI i zed dal a ( onI y) .
SS i ndi cal es l hal l he secl i on conl ai ns uni ni l i aI i zed dal a.
THE MACRO A55EMBLER 199
The as s embI er can mai nl ai n u lo 255 secl i ons. Ini li aI I y, l he as s embI er
begi ns vi l h an unna me d CODI secl i on. The assembI er assi gns l he ol i onaI
s ymboI < I a b e I s > l o l he vaI ue of l he r ogr am counl er af l er il has execul ed l he
S ICTI ON di recl i ve. In addi l i on, vhe r e a secl i on i s unna me d, l he s hor l hand
f or l hal secl i on is l he keyvor d CODI.
G+G7 Sel ReI al i ve Ori gi n
R:2&)9N | < I a b e I > j RORG < a b s e x >
The RORG di recl i ve c hanges l he r ogr am counl er lo be < a b s e x > byl es
f r om l he slarl of l he currenl reI ocal abI e secl i on. The assembI er assi gns reI ocal abI e
me mor y I ocal i ons lo s ubs equenl s l al emenl s, sl arl i ng vi l h l he vaI ue as s i gned
lo l he r ogr am counl er . To do addr essi ng i n reI ocal abI e secl i ons, you us e l he
" r ogr a m counl er reI al i ve vi l h di s I ac emenl " addr essi ng mode . The I abeI vaI ue
as s i gnmenl is l he s ame as for SICTI ON.
+RR,J! Def i ne of f sel s
R:2&)9N OIISIT < a b s e x >
To def i ne a l abI e of of f sel s vi a l he DS di recl i ve begi nni ng al l he addr es s
< a b s e x > , you us e l he OIISIT di recl i ve. SymboI s def i ned i n an OIIS IT l abI e
are kel i nl ernaI I y, bul no c ode- r oduc i ng i nsl r ucl i ons or di recl i ves ma y
aear . To l er mi nal e an OIISIT secl i on, you us e a RORG, OIIS IT, SIC-
TI ON, or IND di recl i ve.
JS* Ind of r ogr am
R:2&)9N | < I a b e I > j IND
The I ND di recl i ve leI I s l he as s embI er l hal l he source is f i ni s hed, and l he
as s embI er i gnor es s ubs equenl source s l al emenl s . Wh e n l he as s embI er en-
counl er s l he IND di recl i ve dur i ng l he firsl as s , il begi ns l he s ec ond as s . If,
hovever , il del ecl s an end- of - f i I e bef ore an IND di recl i ve, il gi ves a var ni ng
me s s age . If l he I abeI fi eI d is r esenl , l hen l he assembI er assi gns l he vaI ue
of l he cur r enl r ogr am c ounl er lo l he I abeI bef or e il exec ul es l he I ND
di recl i ve.
,=&K:0 *#>'.'9':. *'2#D9'C#5
Ja4 Iqual e s ymboI vaI ue
R:2&)9N < I a b e I > IQU < e x >
The I QU di recl i ve assi gns l he vaI ue of l he exr essi on i n l he oer and fi eI d l o
l he s ymboI i n l he I abeI fi eI d. The vaI ue assi gned is er manenl , so you ma y nol
def i ne l he I abeI anyvher e eI se i n l he r ogr am.
Nol e: Do nol i nserl f or var d r ef er ences vi l hi n l he exr essi on.
200 AMIGADO5 DEVELOPER'5 MANUAL
Ja4G Iqual e regi sl er vaI ue
R:2&)9N < I a b e I > IQUR < r e g i s l e r >
Thi s di recl i ve I el s you equal e one of l he r ocessor regi sl ers vi l h a us er
s ymboI . OnI y l he Addr es s and Dal a regi sl ers are vaI i d, so seci aI symboI s I i ke
SR, CCR, and US I are iIIegaI her e. The regi sl er i s er manenl , so you cannol
def i ne l he I abeI anyvher e eI se i n l he r ogr am. The regi sl er mus l nol be a
f or var d r ef er ence lo anol her IQUR sl al emenl . The as s embI er mal c hes I abeI s
def i ned i n lhi s va y vi l houl di sl i ngui shi ng be l ve e n uer and I over case.
GJ7 Def i ne regi sl er Iisl
R:2&)9N < I a b e I > RIG< r e g i s l e r I i s l >
The RIG di recl i ve assi gns a vaI ue lo I abeI l hal l he as s embI er c an l ransI al e
i nl o l he regi sl er Iisl mas k f or mal us ed i n l he M O V I M i nsl rucl i on. < r e gi s l e r
I i s l > is of l he f or m
RI |-R2j|/ R3|-R4jj. . .
,J! Sel s ymboI vaI ue
R:2&)9N < I a b e I > SIT < e x >
The SIT di recl i ve assi gns l he vaI ue of l he exr essi on i n l he oer and fi eI d lo
l he s ymboI i n l he I abeI fi eI d. SIT is i denl i caI l o IQU, aarl f r om l he facl l hal
l he as s i gnmenl i s l emor ar y. You can aI vays c hange SIT I aler on i n l he
r ogr am.
Nol e: You shouI d nol i nserl f or var d ref erences vi l hi n l he exr essi on or
ref er f or var d lo s ymboI s l hal you def i ned vi l h SIT.
*)9) *#>'.'9':. *'2#D9'C#5
*? Def i ne Cons l anl
R:2&)9N | < I a b e I > j DC| . < s i z e > j < I i s l >
The DC di recl i ve def i nes a consl anl vaI ue i n me mor y. Il ma y have any
numbe r of oer ands , searal ed by c omma s (, ). The vaI ues i n l he Iisl mus l be
caabI e of bei ng heI d i n l he dal a I ocal i on vhos e si ze is gi ven by l he si ze
seci f i er on l he di recl i ve. If you do nol gi ve a si ze seci f i er, DC as s umes il is
. W. If l he si ze is . , l hen l her e is one ol her dal a l ye l hal can be us ed: l hal of
l he ASCI I sl ri ng. Thi s is an arbi lrari I y I ong seri es of ASCI I characl ers, con-
l ai ned vi l hi n quol al i on mar ks. As vi l h ASCI I IileraIs, if you requi re a quol al i on
mar k i n l he sl ri ng, l hen you mus l enl er l vo. If l he si ze is . W or . L, l hen l he
as s embI er aI i gns l he dal a onl o a vor d boundar y.
*?W Def i ne Cons l anl I ock
R:2&)9N | < I a b e I > j DC | . < s i z e > j < a b s e x > , < e x >
You us e l he DC di recl i ve lo sel a numbe r ( gi ven by < a b s e x > ) of byl es ,
THE MACRO A55EMBLER 201
vor ds , or I ong vor ds lo l he vaI ue of l he exressi on < e x > . D C . < s i z e > n, ex
is equi vaI enl l o r eeal i ng n l i mes l he s l al emenl D C . < s i z e > ex.
*, Def i ne Sl orage
R:2&)9N | < I a b e I > j DS | . < s i z e > j < a b s e x >
To r eser ve me mor y I ocal i ons, you us e l he DS di recl i ve. DS, hove ve r , does
no i ni l i aI i zal i on. The amounl of sace l he as s embI er aI I ocal es de e nds on l he
dal a si ze (l hal you gi ve vi l h l he si ze seci f i er on l he di recl i ve) , and l he vaI ue
of l he exr es s i on i n l he oer and fi eI d. The as s embI er i nl er r el s l hi s as l he
numbe r of dal a i l ems of l hal si ze lo aI I ocal e. As vi l h DC, if l he si ze seci f i er is
. W or . L, DS aI i gns l he sace onl o a vor d boundar y. So, DS . W 0 has l he ef f ecl
of aI i gni ng l o a vor d boundar y onI y. If you do nol gi ve a si ze seci f i er, DS
as s ume s a def auI l of . W. See CNOI f or a mor e gener aI vay of handI i ng
aI i gnmenl .
B'59'.( ?:.92:0 *'2#D9'C#5
;%7J Iage Thr ov
R:2&)9N IAGI
UnI es s agi ng has be e n i nhi bi l ed, IAGI advances l he as s embI y I i sl i ng l o
l he l o of l he nexl age. The IAGI di recl i ve does nol aear on l he oul ul
I i sl i ng.
BH,! Tur n on Li sl i ng
R:2&)9N LI ST
The LI ST di recl i ve leI I s l he as s embI er lo r oduce l he as s embI y I i sl i ng fi I e.
Li sl i ng conl i nues unl i I il encounl er s ei l her an IND or a NOLI S T di recl i ve. Thi s
di recl i ve is onI y acl i ve vhe n l he assembI er is r oduci ng a I i sl i ng fi I e. The LI ST
di recl i ve does nol aear on l he oul ul I i sli ng.
S+BH,! Tur n off Li sl i ng
R:2&)9N NOLI S T
N O L
The NOLI S T or NOL di recl i ve l ur ns off l he r oducl i on of l he as s embI y
I i sl i ng fi I e. Li sl i ng ceases unl i I l he as s embI er encounl er s ei l her an I ND or a
LI ST di recl i ve. The NOLI S T di recl i ve does nol aear on l he r ogr am I i sl i ng.
,;? Sace I ank Li nes
R:2&)9N SIC < n u m b e r >
The S IC di recl i ve oul ul s l he numbe r of bI ank I i nes gi ven by l he oer and
f i eI d, l o l he as s embI y I i sl i ng. The SIC di recl i ve does nol aear on l he
r ogr am I i sl i ng.
202 AMIGADO5 DEVELOPER'5 MANUAL
S+;%7J Tur n off Iagi ng
R:2&)9N NOI AGI
The NOI AGI di recl i ve l urns off l he ri nl i ng of age l hr ovs and lilIe
header s on l he as s embI y I i sl i ng.
BBJS Sel Li ne Lengl h
R:2&)9N LLIN < n u m b e r >
The LLIN di recl i ve sel s l he I i ne I engl h of l he as s embI y I i sl i ng fiIe l o l he
vaI ue you seci f i ed i n l he oer and fi eI d. The vaI ue mus l Iie be l ve e n 60 and
132, and can onI y be sel once i n l he r ogr am. The LLIN di recl i ve does nol
aear on l he as s embI y I i sli ng. The def auI l i s 132 characl ers.
ILIAT Sel Iage Lengl h
R:2&)9N ILIN < n u m b e r >
The ILIN di recl i ve sel s l he age I engl h of l he as s embI y I i sli ng fiIe lo
l he vaI ue you seci f i ed i n l he oer and fi eI d. The vaI ue mus l Iie be l ve e n
24 and 100, and you can onI y sel il once i n l he r ogr am. The def auI l is 60
I i nes.
!!B Sel Ir ogr am Ti lI e
R:2&)9N TTL <l i l I e s l r i ng>
The TTL di recl i ve sel s l he lilIe of l he r ogr am lo l he sl ri ng you gave i n l he
oer and fi eI d. Thi s sl ri ng aear s as l he age headi ng i n l he as s embI y I i sl i ng.
The sl ri ng sl arl s al l he firsl nonbI ank characl er af l er l he TTL, and conl i nues
unl i I l he e nd of I i ne. Il mus l nol be I onger l han 40 characl ers i n I engl h. The
TTL di recl i ve does nol aear on l he r ogr am I i sl i ng.
S++Wc Di sabI e Ob| ecl Code Gener al i on
R:2&)9N NOO}
The NOO } di recl i ve di sabI es l he r oducl i on of l he ob| ecl code fiIe al l he
e nd of as s embI y. Thi s di recl i ve di sabI es l he r oducl i on of l he code fi I e, eve n if
you seci f i ed a f i I ename vhe n you caI I ed l he assembI er .
R%HB Gener al e a us er error
R:2&)9N IAI L
The IAI L di r ecl i ve l eI I s l he as s embI e r lo f I ag an er r or f or l hi s i nul
I i ne.
R+G-%! No acl i on
R:2&)9N I ORMAT
The as s embI er accel s lhi s di recl i ve bul l akes no acl i on on recei vi ng il.
I ORMAT is i ncI uded f or comal i bi I i l y vi l h ol her assembI er s.
THE MACRO A55EMBLER
203
S+R+G-%! No acl i on
R:2&)9N NOI ORMAT
The as s embI er accel s lhi s di recl i ve bul l akes no acl i on on recei vi ng il.
N O I O R M A T i s i ncI uded for comal i bi I i l y vi l h ol her as s embI er s.
?:.8'9':.)0 %55#&K0= *'2#D9'C#5
?S+; Condi l i onaI NOI
R:2&)9N | < I a b e I > j CNOI < n u m b e r > , < n u m b e r >
Thi s di recl i ve is an exl ensi on f r om l he Mol or oI a sl andar d and aI I ovs a
secl i on of c ode lo be aI i gned on any boundar y. In arl i cuI ar, il aI I ovs any dal a
sl rucl ure or enl r y oi nl lo be aI i gned lo a I ong vor d boundar y.
The firsl exr essi on r er esenl s an of f sel , vhi I e l he second exr essi on r er e-
senl s l he aI i gnmenl requi red for l he bas e. The code is aI i gned lo l he seci f i ed
of f sel f r om l he near esl requi red aI i gnmenl boundar y. Thus
CNOI 0, 4
aI i gns code l o l he nexl I ong vor d boundar y vhi I e
CNOI 2, 4
aI i gns code lo l he vor d boundar y 2 byl es be yond l he near esl I ong vor d
aI i gned boundar y.
HRJa As s embI e if exr essi on 0
HRSJ As s embI e if exr essi on < > 0
HR7! As s embI e if exr essi on > 0
HR7J As s embI e if exr essi on > 0
HRB! As s e mbI e if exr essi on < 0
HRBJ As s e mbI e i f exr essi on < 0
R:2&)9N I Ixx < a b s e x >
Yo u us e l he I Ixx r ange of di recl i ves lo enabI e or di sabI e as s embI y, de e nd-
i ng on l he vaI ue of l he exr essi on i n l he oer and fi eI d. If l he condi l i on is nol
TRUI (for examI e, I IIQ 2 + 1) , as s embI y ceases (lhal i s, il is di sabI ed) . The
condi l i onaI as s embI y svi l ch r emai ns acl i ve unl i I l he assembI er f i nds a mal ch-
i ng I NDC sl al emenl . You can nesl condi l i onaI as s embI y svi l ches arbi l rari I y,
l er mi nal i ng each I eveI of nesl i ng vi l h a mal chi ng INDC.
HR? As s e mbI e if sl ri ngs are i denl i caI
HRS? As s embI e if sl ri ngs are nol i denl i caI
R:2&)9N I IC < s l r i n g > , < s l r i n g >
I INC < s l r i n g > , < s l r i n g >
The sl ri ngs mus l be a seri es of ASCI I characl ers encI osed i n si ngI e quol es ,
204
AMIGADO5 DEVELOPER'5 MANUAL
f or examI e , ' I OO' or ( l he e ml y sl ri ng) . If l he condi l i on is nol TRUI,
as s embI y ceas es ( l hal i s, il i s di sabI ed) . Agai n l he condi l i onaI as s embI y s vi l ch
r emai ns acl i ve unl i I l he as s embI er f i nds a mal chi ng INDC sl al emenl .
HR* As s embI e if s ymboI def i ned
HRS* As s embI e if symboI nol def i ned
R:2&)9N I ID < symboI n a m e >
I IND < symboI n a m e >
De e ndi ng on vhe l he r or nol you have aI ready def i ned l he s ymboI , l he
as s embI er enabI es or di sabI es assembI y unl i I il f i nds a mal c hi ng INDC.
JS*? Ind condi l i onaI as s embI y
R:2&)9N INDC
To l er mi nal e a condi l i onaI as s embI y, you us e l he INDC di recl i ve, sel u
vi l h any of l he 8 I Ixx di recl i ves above. INDC mal c hes l he mos l recenl I y
enc ounl er ed condi l i on di recl i ve.
-)D2: *'2#D9'C#5
-%?G+ Sl arl a macr o def i ni l i on
R:2&)9N < I a b e I > MACR O
MACRO i nl r oduces a macr o def i ni l i on. INDM l er mi nal es a mac r o def i ni -
l i on. You mus l r ovi de a I abeI , vhi c h l he as s embI er uses as l he na me of l he
macr o, s ubs equenl us es of l hal I abeI as an oer and exand l he conl enl s of l he
mac r o and i nserl l he m i nl o l he sour ce code. A macr o can conl ai n any oc ode,
mos l as s embI er di recl i ves, or any revi ousI y def i ned macr o. A I us si gn ( + ) i n
l he I i sli ng mar ks any code gener al ed by macr o exans i on. Wh e n you us e a
mac r o na me , you ma y a e nd a numbe r of ar gumenl s , s ear al ed by c omma s .
If l he ar gumenl conl ai ns a sace (for examI e, a sl ri ng conl ai ni ng a sace) l hen
you mus l encI os e l he enl i re ar gumenl vi l hi n < (I ess l han) and > ( greal er l han)
s ymboI s .
The as s embI er sl ores u and saves l he sour ce code l hal you enl er (afler a
M A C R O di recl i ve and bef or e an I NDM di recli ve) as l he c onl enl s of l he mac r o.
The code can conl ai n any nor maI sour ce code. In addi l i on, l he symboI
( backsI ash) has a seci aI meani ng. acksI ash f oI I oved by a numbe r " n " i ndi cal es
l hal l he vaI ue of l he nl h ar gumenl is lo be i nserl ed i nl o l he code. If l he nl h
ar gumenl is omi l l ed l hen nol hi ng is i nser l ed. acksI ash f oI I oved by l he s ym-
boI ]i) ] l eI I s l he as s embI er l o gener al e l he l exl " . n n n " , vhe r e nnn i s l he numbe r
of l i mes l he li) combi nal i on il has enc ounl er ed. Thi s is nor maI I y us ed l o
gener al e uni que I abeI s vi l hi n a mac r o.
Yo u ma y nol nes l macr o def i nl i ons, l hal i s, you c annol def i ne a mac r o
vi l hi n a mac r o, aI l hough you can caII a macr o you revi ousI y def i ned. Ther e
THE MACRO A55EMBLER 205
is a I i mi l l o l he I eveI of nesl i ng of macr o caI I s. Thi s I i mi l is currenl I y sel
al l en.
Mac r o exans i on sl os vhe n l he as s embI er encounl er s l he e nd of l he sl ored
mac r o l exl , or vhe n il f i nds a MIXI T di recl i ve.
S%G7 Seci aI symboI
R:2&)9N NARG
The s ymboI NARG is a seci aI r eser ved symboI and l he as s embI er assi gns il
l he i ndex of l he I asl ar gumenl as s ed l o l he macr o i n l he ar amel er Iisl ( even
nuI I s) . Oul s i de of a macr o exans i on, NARG has l he vaI ue 0.
JS*- Ter mi nal e a macr o def i ni l i on
R:2&)9N I NDM
Thi s l er mi nal es a macr o def i ni l i on i nl r oduced by a MACR O di recl i ve.
-J^H! Ixil f r om macr o exans i on
R:2&)9N MIXI T
You use lhi s direclive lo exil f rom macro exansi on mode, usuaI I y i n conduclion
vi l h l he I IIQ and I INI di recl i ves. Il aI I ovs condi l i onaI exans i on of mac r os .
Onc e il has execul ed l he di recl i ve, l he as s embI er sl os exandi ng l he cur r enl
mac r o as l hough l her e ver e no mor e sl ored l exl l o i ncI ude.
JX9#2.)0 ,=&K:05
^*JR Def i ne an i nl ernaI I abeI as an exl ernaI enl r y
oi nl
R:2&)9N XDII < I a b e I > | , < I a b e I > . . . j
On e or mor e absoI ul e or reI ocal abI e I abeI s ma y f oI I ov l he XDII di recl i ve.
Iach I abeI def i ned her e gener al es an exl ernaI s ymboI def i ni l i on. You c an
ma k e r ef er enc es l o l he s ymboI i n ol her moduI e s ( ossi bI y f r om a hi gh-
I eveI I anguage) and sal i sf y l he r ef er ences vi l h a I i nker. If you us e l hi s
di recl i ve or XRII, l hen you cannol di recl I y execul e l he code r oduc ed by l he
assembI er .
^GJR Def i ne an exl ernaI na me
R:2&)9N XRII < I a b e I > | , < I a b e I > . . . j
On e or mor e I abeI s l hal mus l nol have be e n def i ned eI s evher e i n l he
r ogr am f oI I ov l he XRII di recl i ve. Subs equenl uses of l he I abeI leII l he
as s embI er l o gener al e an exl ernaI r ef er ence for l hal I abeI . You us e l he I abeI as
if il ref erred lo an absoI ul e or reI ocal abI e vaI ue deendi ng on vhe l he r l he
mal c hi ng XDII ref erred l o an absoI ul e or reI ocal abI e symboI .
The acl uaI vaI ue us ed is fiIIed i n f r om anol her moduI e by l he I i nker. The
206
AMIGADO5 DEVELOPER'5 MANUAL
I i nker aI so gener al es any reI ocal i on i nf or mal i on l hal ma y be r equi r ed i n or der
f or l he resuI l i ng code l o be reI ocal abI e.
Ixl ernaI s ymboI s are nor maI I y us ed as f oI I ovs. To seci f y a r oul i ne i n one
r ogr am s egmenl as an exl ernaI def i ni l i on, you I ace a I abeI al l he slarl of l he
r oul i ne and quol e l he I abeI afler an XDII di recl i ve. Anol her r ogr am may caII
l hal r oul i ne if il decI ares a I abeI via l he XRII di recl i ve and l hen | ums lo l he
I abeI so decI ared.
7#.#2)0 *'2#D9'C#5
HS?B4*J I nserl an exl ernaI fiIe
R:2&)9N I NCLUDI " < f i I e n a m e > "
The I NCLUDI di recl i ve aI I ovs l he i ncI usi on of exl ernaI fiIes i nl o l he r o-
gr am sour ce. You sel u l he fiIe l hal I NCLUDI i nserl s vi l h l he sl ri ng descri -
l or i n l he oer and fi eI d. You can nesl I NCLUDI di recl i ves u l o a del h of
l hr ee, encI osi ng l he f i I enames i n quol es as s hovn. I NCLUDI i s eseci aI I y
usef uI vhe n you requi re a sl andar d sel of macr o def i ni l i ons or IQUs i n severaI
r ogr ams .
You can I ace l he def i ni l i ons in a si ngI e fiIe and l hen ref er lo l he m f r om
ol her r ogr ams vi l h a sui l abI e I NCLUDI. Il is of l en c onveni enl l o I ace
NOLI S T and LI ST di recl i ves al l he head and laiI of fiIes you i nl end l o i ncI ude
via I NCLUDI. Ami ga DOS sear ches f or l he fiIe seci f i cal i on firsl i n l he cur r enl
di recl ory, l hen i n each s ubs equenl di recl ory i n l he Iisl you gave i n l he -i
ol i on.
-%,_P No acl i on
R:2&)9N MAS K2
The as s embI er accel s l he MAS K2 di recl i ve, bul il l akes no acl i on on recei v-
i ng il.
H*S! Na me r ogr am uni l
R:2&)9N I DNT < s l r i n g >
A r ogr am uni l , vhi c h consi sl s of one or mor e secl i ons, mus l have a na me .
Us i ng l he I DNT di recl i ve, you can def i ne a na me consi sl i ng of a sl ri ng ol i on-
aI I y encI os ed i n doubI e quol es . If l he assembI er does nol f i nd an I DNT di recl i ve,
il oul ul s a r ogr am uni l na me l hal is a nuI I sl ri ng.
?")<9#2 V
The Linker
Thi s chal er descri bes l he Ami ga DOS Li nker. The Ami ga DOS Li nker r oduces
a si ngI e bi nar y I oad fiIe f r om one or mor e i nul fi I es. Il can aI so r oduc e
overI ai d r ogr ams .
4. 1 I nl r oducl i on
4. 2 Us i ng l he Li nker
4. 2. 1 Co mma nd Li ne Synl ax
4. 2. 2 WI TH Ii I es
4. 2. 3 Irrors and Ol her Ixcel i ons
4. 2. 4 MAI and XRII Oul ul
4. 3 Over I ayi ng
4. 3. 1 OVIRLAY Di recl i ve
4. 3. 2 Ref er ences lo SymboI s
4. 3. 3 Caul i onar y Ioi nl s
4. 4 Irror Code s and Mes s ages
V3O H.92:8/D9':.
ALI NK r oduces a si ngI e bi nar y oul ul fiIe f r om one or mor e i nul fi I es.
The s e i nul fi I es, knovn as ob| ec l f i I es , ma y conl ai n exl ernaI s ymboI i nf or-
mal i on. To r oduce ob| ecl fi I es, you us e your assembI er or I anguage l ransI al or.
ef or e r oduci ng l he oul ul , or I oad f i I e, l he I i nker r esoI ves aII r ef er ences
l o s ymboI s .
The I i nker can aI so r oduce a I i nk ma and s ymboI cr oss- r ef er ence l abI e.
Associ al ed vi l h l he I i nker is an overI ay suer vi sor . You can us e l he overI ay
suer vi sor lo overI ay r ogr ams vri l l en i n a vari el y of I anguages . The I i nker
r oduces I oad fiIes sui l abI e f or overI ayi ng i n lhi s vay.
You can dri ve l he I i nker in l vo vays :
208 AMIGADO5 DEVELOPER'5 MANUAL
1. As a Cnmma nd ! i nc. You can seci f y mos l of l he i nf or mal i on necessar y f or
r unni ng l he I i nker i n l he c omma nd ar amel er s .
2. As a Par amct cr Ii!c. As an aI l ernal i ve, if a r ogr am is bei ng I i nked reel i -
l i veI y, you can us e a ar amel er fiIe lo seci f y aII l he dal a f or l he I i nker.
The s e l vo me l hods can l ake l hr ee l yes of i nul fi I es:
1. Pr i mar y bi nar y i nput . Thi s ref ers lo one or mor e ob| ecl fiIes l hal f or m l he
i ni li aI bi nar y i nul l o l he I i nker. The s e fi I es are aI vays oul ul l o l he I oad
fi I e, and l he r i mary i nul mus l nol be eml y.
2. Ovcr ! ay Ii ! cs. If overI ayi ng, l he r i mar y i nul f or ms l he rool of l he overI ay
l r ee, and l he overI ay fiIes f or m l he resl of l he sl rucl ure.
3. Li brari cs. Thi s ref ers l o seci f i ed code l hal l he I i nker i ncor or al es aul omal i -
caI I y. Li brari es ma y be resi denl or s c anned. A rcsi dcnt ! i brary i s a I oad fiIe
vhi c h ma y be r esi denl i n me mor y, or I oaded as arl of l he " I i br ar y o e n "
caI I i n l he oer al i ng s ys l em. A scanncd ! i brary i s an ob| ecl fiIe vi l hi n an
archi ve f or mal fi I e. The I i nker onI y I oads l he fiIe if l her e are any oul sl andi ng
exl ernaI r ef er ences lo l he I i brary.
The I i nker vor ks i n l vo as s es .
1. I n l he firsl ass , l he I i nker reads aII l he r i mar y, I i brary, and overI ay f i I es,
and r ecor ds l he c ode s e gme nl s and exl ernaI s ymboI i nf or mal i on. Al l he e nd
of l he firsl as s , l he I i nker oul ul s l he ma and cross- ref erence l abI e, if
r equi r ed.
2. If you seci f y an oul ul fiIe, l hen l he I i nker makes a second ass l hr ough l he
i nul . Ii rsl il coi es l he r i mar y i nul fiIes l o l he oul ul , r esoI vi ng s ymboI
r ef er ences i n l he r oces s , and l hen il coi es oul l he requi red I i brary c ode
s e gme nl s i n l he s ame vay. Nol e l hal l he I i brary code s egmenl s f or m arl of
l he r ool of l he overI ay l ree. Nexl , l he I i nker r oduces dal a f or l he overI ay
suer vi sor , and fi naI I y oul ul s l he overI ay fi I es.
I n l he firsl as s , af l er r eadi ng l he r i mar y and overI ay i nul fi I es, l he I i nker
i nsecl s ils l abI e of s ymboI s, and if l her e are any r emai ni ng unr es oI ved ref er-
enc es , il reads l he fi I es, if any, l hal you seci f i ed as l he I i brary i nul . The
I i nker l hen mar ks any code s egmenl s conl ai ni ng exl ernaI def i ni l i ons for l hes e
unr es oI ved r ef er ences f or s ubs equenl i ncI usi on i n l he I oad fi I e. The I i nker onI y
i ncI udes l hos e I i brary code s egmenl s l hal you have r ef er enced.
THE LINKER 209
V3P 45'.( 9"# B'.M#2
To us e l he I i nker, you mus l knov l he c omma nd synl ax, l he l ye of i nul and
oul ul l hal l he I i nker us es , and l he ossi bI e errors l hal ma y occur. Thi s secl i on
al l eml s l o exI ai n l hes e l hi ngs.
V3P3O ?:&&).8 B'.# ,=.9)X
The ALI NK c omma nd has l he f oI I ovi ng ar amel er s :
ALI NK | IROM + ROOTj fiIes | TO fiIej | WI TH fiIej
| VIR fiIej | LI RARY + LI fiIesj | MAI fiIej
| XRII fiIej | WI DTH nj
The ke yvor d l emI al e is
" I R O M ROOT, TO/ K, WI TH/ K, VIR/ K, LI RARY LI / K,
MAI/ K, XRII/ K, WI DTH/ K"
I n l he above, " f i I e " me ans a si ngI e fiIe na me , " f i I e s " me a ns zer o or mor e fiIe
na me s , sear al ed by a c omma or I us si gn, and " n " is an i nl eger.
The f oI I ovi ng are examI es of vaI i d us es of l he ALI NK c omma nd:
ALINK a
ALLKTK ROOT a + b + c + d MAP map-Ii!c WIDTH 120
ALU5TK a,b,c TO nutput LIBRARY :I!ib/!ib,nb|/ncw!ib
Wh e n you gi ve a Iisl of fi I es, l he I i nker r eads l he m i n l he or der you seci f y.
The ar amel er s have l he f oI I ovi ng meani ngs :
I ROM: Seci f i es l he ob| ecl fiIes l hal you vanl as l he r i mar y bi nar y i nul .
The I i nker aI vays coi es l he conl enl s of l hes e fiIes l o l he I oad fiIe
lo f or m arl of l he overI ay rool . Al I easl one r i mar y bi nar y i nul
fiIe mus l be seci f i ed. ROOT is a s ynonym f or I ROM.
TO: Seci f i es l he desl i nal i on for l he I oad fiIe. If l hi s ar amel er is nol
gi ven, l he I i nker omi l s l he s ec ond ass.
WI TH: Seci f i es fiIes conl ai ni ng l he I i nker ar amel er s , for examI e, nor -
maI c omma nd I i nes. UsuaI I y you onI y us e one fiIe her e, bul , f or
c omI el enes s , you can gi ve a Iisl of fi I es. Nol e l hal ar amel er s on
l he c omma nd I i ne overri de l hose i n WI TH fi I es. You c an f i nd a fuII
descri l i on of l he synl ax of l hese fiIes in Secl i on 4. 2. 2 of lhi s manuaI .
210 AMIGADO5 DEVELOPER'5 MANUAL
VIR: seci f i es l he desl i nal i on of mes s ages f r om l he I i nker. If you do nol
seci f y VIR, l he I i nker sends aII mes s ages lo l he sl andar d oul ul
( usuaI I y l he l ermi naI ) .
LI RARY: seci f i es l he fiIes l hal you vanl lo be s canned as l he I i brary. The
I i nker i ncI udes onI y r ef er ence code s egmenl s . LI is a vaI i d aI l erna-
li ve for LI RARY.
MAI: seci f i es l he desl i nal i on of l he I i nk ma .
XRII: seci f i es l he desl i nal i on of l he cross- ref erence oul ul .
WI DTH: seci f i es l he oul ul vi dl h l hal l he I i nker can us e vhe n r oduci ng
l he I i nk ma and cross- ref erence l abI e. Ior examI e, if you s e nd
oul ul lo a ri nl er, you may need lhi s ar amel er .
4. 2. 2 LH!@ R'0#5
WI TH fiIes conl ai n ar amel er s for l he I i nker. You us e l hem l o save l yi ng a
I ong and c omI ex ALI NK c omma nd I i ne ma ny l i mes.
A WI TH fiIe consi sl s of a seri es of ar amel er s , one er I i ne, each consi sl i ng
of a ke yvor d f oI I oved by dal a. You can l ermi nal e I i nes vi l h a semi coI on (, ),
vhe r e l he I i nker i gnor es l he resl of l he I i ne. You can l hen us e l he resl of l he
I i ne af l er l he semi coI on lo i ncI ude a c ommenl . The I i nker i gnor es bI ank I i nes.
The ke yvor ds avai I abI e are as f oI I ovs:
I ROM (or ROOT) fiIes
TO fiIe
LI RARY fiIes
MAI |fiIej
XRII |fiIej
OVIRLAY
l ree seci f i cal i on
-
WI DTH n
vhe r e " f i I e " is a si ngI e f i I ename, " f i I e s " i s one or mor e f i I enames, " | f i I e j " is an
ol i onaI f i I ename, and " n " is an i nl eger. You may us e an asl eri sk s ymboI () lo
sI i l I ong I i nes, I aci ng one al l he e nd of a I i ne leI I s l he ri nl er l o r ead l he nexl
I i ne as a conl i nual i on I i ne. If l he f i I ename afler MAI or XRII is omi l l ed, l he
oul ul goes l o l he VIR fiIe ( l he l ermi naI by def auI l ) .
Iar amel er s on l he c omma nd I i ne overri de l hos e i n a WI TH fi I e, so l hal you
can make smaI I vari al i ons on sl andar d I i nks by combi ni ng c omma nd I i ne
ar amel er s and WI TH fi I es. Si mi I arI y, if you seci f y a ar amel er mor e l han
once i n WI TH fi I es, l he I i nker us es l he firsl occur r ence.
THE LINKER 211
Nol e: I n l he s econd examI e beI ov, lhi s is l rue even if l he firsl vaI ue gi ven
l o a ar amel er is nuI I .
IxamI es of WI TH fiIes and l he cor r es ondi ng ALI NK caI I s:
AL I NK WI TH I i nk- f i I e
vhe r e " I i nk- f i I e" conl ai ns
I ROM ob| / mai n, ob| / s
TO bi n/ l e s l
L I R A R Y ob| / I i b
MAI
X R I I x o
is l he s ame as seci f yi ng
AL I NK I ROM ob| / mai n, ob| / s TO bi n/ l e s l L I R A R Y ob| / I i b X R I I x o
The c omma nd
AL I NK WI TH I k i n L I RARY " "
vhe r e ' I ki n' conl ai ns
I ROM bi n/ r og, bi n/ s ubs
L I R A R Y nag/ f or l I i b
TO I i nkI i b/ r og
is l he s ame as l he c omma nd I i ne
AL I NK I ROM bi n/ r og, bi n/ s ubs TO I i nkI i b. r og
Nol e: I n l he examI e above, l he nuI I ar amel er f or LI RARY on l he c om-
ma nd I i ne overri des l he vaI ue " nag/ f or l I i b" i n l he WI TH fi I e, and so l he I i nker
does nol r ead any I i brari es.
4. 2. 3 J22:25 ).8 +9"#2 JXD#<9':.5
Var i ous errors can occur vhi I e l he I i nker is r unni ng. Mos l of l he me s s age s
ar e s eI f - exI anal or y and r ef er l o l he f ai I ure l o oe n f i I es, or l o er r or s
i n c omma nd or bi nary fiIe f ormal . Af l er an error, l he I i nker l er mi na. es al
onc e.
Ther e are a f ev mes s ages l hal are var ni ngs onI y. The mos l i mor l anl
212 AMIGADO5 DEVELOPER'5 MANUAL
ones ref er l o undef i ned or muI l i I y- def i ned s ymboI s . The I i nker s houI d nol
l er mi nal e af l er recei vi ng a var ni ng.
If any undef i ned symboI s r emai n al l he e nd of l he firsl as s , l he I i nker
r oduces a var ni ng, and oul ul s a l abI e of such s ymboI s . Dur i ng l he s ec ond
as s , r ef er ences l o l hes e symboI s be c ome r ef er ences lo I ocal i on zer o.
If l he I i nker f i nds mor e l han one def i ni l i on of a symboI dur i ng l he firsl as s ,
il ul s oul a var ni ng, and i gnor es l he I aler def i ni l i on. The I i nker does nol
r oduc e l hi s mes s age if l he s econd def i ni l i on occurs i n a I i brary fi I e, so l hal
you can reI ace I i brary roul i nes vi l houl il r oduci ng suri ous mes s ages . A
seri ous error f oI I ovs if l he I i nker f i nds i nconsi sl enl s ymboI r ef er ences, and
I i nki ng l hen l er mi nal es al once.
Si nce l he I i nker onI y us es l he firsl def i ni l i on of any s ymboI , il is i mor l anl
l hal you under s l and l he f oI I ovi ng order i n vhi c h fiIes are r ead.
1. Ir i mar y ( IROM or ROOT) i nul .
2. Over I ay fi I es.
3. LI RARY fi I es.
Wi l hi n each gr ou, l he I i nker r eads l he fiIes i n l he or der l hal you seci f y i n
l he fiIe Iisl. Thus def i ni l i ons i n l he r i mar y i nul overri de l hos e i n l he overI ay
f i I es, and l hos e i n l he I i brari es have I ovesl ri ori ly.
4. 2. 4 -%; ).8 ^GJR +/9</9
The I i nk ma , vhi c h l he I i nker r oduces af l er l he firsl as s , Iisls aII l he code
s e gme nl s l hal l he I i nker oul ul lo l he I oad fiIe i n l he s econd as s , i n l he order
l hal l hey mus l be vri l l en.
Ior each code s egmenl , l he I i nker oul ul s a header , sl arl i ng vi l h l he na me
of l he fiIe ( l runcal ed lo ei ghl I el l ers) , l he code s egmenl r ef er ence numbe r , l he
l ye (lhal i s, dal a, code, bs s , or COMMON) , and si ze. If l he c ode s e gme nl vas
i n an overI ay fi I e, l he I i nker aI so gi ves l he overI ay I eveI and overI ay or di nal e.
Af l er l he header , l he I i nker ri nl s each s ymboI def i ned i n l he code s egmenl ,
l ogel her vi l h ils vaI ue. Il ri nl s l he symboI s i n as cendi ng or der of l hei r vaI ues,
ae ndi ng an asl eri sk () lo absoI ul e vaI ues.
The vaI ue of l he WI DTH aramel er del ermi nes l he number of symboI s ri nl ed
er I i ne. If l hi s is l oo smaI I , l hen l he I i nker ri nl s one s ymboI on each I i ne.
The cr oss- r ef er ence oul ul aI so Iisls each code s egmenl , vi l h l he s ame
header as i n l he ma .
The header is f oI I oved by a Iisl of l he symboI s vi l h l hei r r ef er ences . Iach
r ef er ence consi sl s of a ai r of i nl eger s, gi vi ng l he of f sel of l he r ef er ence and
l he numbe r of l he code s egmenl i n vhi c h il occur s. The code s e gme nl numbe r
ref ers l o l he numbe r gi ven i n each header .
THE LINKER 213
V3Q +C#20)='.(
The aul omal i c overI ay s ys l em r ovi ded by l he I i nker and l he overI ay suervi -
sor aI I ovs r ogr ams l o oc c uy I ess me mor y vh e n r unni ng, vi l houl any
aI l eral i ons l o l he r ogr am sl rucl ure.
Wh e n us i ng overI ayi ng, you shouI d consi der l he r ogr am as a l ree sl rucl ure.
Thal i s, vi l h l he rool of l he lree as l he r i mary bi nar y i nul , l ogel her vi l h
I i brary code s egmenl s and C O M M O N bI ocks. Thi s rool is aI vays r esi denl i n
me mor y. The overI ay fiIes l hen f or m l he ol her nodes of l he l ree, accor di ng lo
seci f i cal i ons i n l he OVIRLAY di recl i ve.
The oul ul f r om l he I i nker vhe n overI ayi ng, as i n l he usuaI case, i s a si ngI e
bi nar y fi I e, vhi c h consi sl s of aII l he code s egmenl s , l ogel her vi l h i nf or mal i on
gi vi ng l he I ocal i on vi l hi n l he fiIe of each node of l he overI ay l ree. Wh e n you
I oad l he r ogr am onI y l he rool is br oughl i nl o me mor y. An overI ay suer vi sor
l akes care of I oadi ng and unI oadi ng l he overI ay s egmenl s aul omal i caI I y. The
I i nker i ncI udes l hi s over I ay suer vi sor i n l he oul ul fiIe r oduc e d f r om
a I i nk us i ng overI ays. The overI ay suervi sor is i nvi si bI e lo l he r ogr am
r unni ng.
V3Q3O +YJGB%[ *'2#D9'C#
To seci f y l he l ree sl rucl ure of a r ogr am l o l he I i nker, you us e l he OVIRLAY
di recl i ve. Thi s di recl i ve is excel i onaI i n l hal you can onI y us e il i n WI TH fi I es.
As vi l h ol her ar amel er s , l he I i nker us es l he firsl OVIRLAY di recl i ve you
gi ve il.
The f or mal of l he di recl i ve is
OVIRLAY
Xf i I es
#
Nol e : The overI ay di recl i ve can s an ma ny I i nes. The I i nker r ecogni zes a
has h si gn ( - ) or l he end- of - f i I e as a l ermi nal or for l he di recl i ve.
Iach I i ne af l er OVIRLAY seci f i es one node of l he l r ee, and consi sl s of a
counl " X " and a fiIe Iisl.
The I eveI of a node seci f i es ils " de l h " i n l he l ree, sl arl i ng al zer o, vhi c h is
l he I eveI of l he rool . The counl " X " , gi ven i n l he di recl i ve, consi sl s of zer o or
mor e asl eri sks, and l he overI ay I eveI of l he node is gi ven by X + 1.
As veI I as l he I eveI , each node ol her l han l he rool has an or di nal e vaI ue.
214 AMIGADO5 DEVELOPER'5 MANUAL
Thi s ref ers lo l he order i n vhi c h l he I i nker shouI d r ead l he des c endenl s of each
node , and slarls al 1, for l he firsl " of f s r i ng" of a ar enl node.
Nol e : Ther e ma y be nodes vi l h l he same I eveI and or di nal e, bul vi l h
di f f erenl ar enl s .
Whi I e readi ng l he OVIRLAY di recli ve, l he I i nker r emember s l he currenl I eveI ,
and, for each ne v node, comar es l he I eveI seci fi ed vi l h lhis vaI ue. If I ess, l hen
l he ne v node is a des c endenl of a r evi ous one. If equaI , l he ne v node has l he
s ame ar enl as l he currenl one. If greal er, l he ne v node is a di recl des cendanl of
l he currenl one, and so l he ne v I eveI mus l be one greal er l han l he currenl vaI ue.
A numbe r of examI es ma y heI lo cI ari fy l hi s:
Di r ecl i ve LeveI
OVIRLAY
a 1
b 1
c 1
-
Or di nal e Tr ee
ROOT
OVIRLAY
a
b
c
d
#
OVIRLAY
a
b
c
d
e
f
g
h
i
|
k
1
#
1
1
2
2
1
1
2
2
1
1
2
2
3
3
2
1
1
2
1
2
3
4
1
2
1
2
3
5
a b c
ROOT
a b
c d
ROOT
a b e f 1
c d g h k
!
Figurc 4-A
The I eveI and ordi nal e vaI ues gi ven above ref er lo l he node seci f i ed on l he
s ame I i ne. Nol e l hal aII l he fiIes gi ven i n l he examI es above couI d have be e n
fiIe I i sls. Si ngI e I el l ers are for cI ari ly. Ior examI e, Ii gure 4- :
THE LINKER
215
ROOT bin/mainaaa
OVERLAY
bin/mambbb,bin/mamccc,bm^
bin/makcrca!
bin/trbb!nck,b!n/transtnt,bin/transr
bin/transri
bin/nutcndc
#
Iigure 4-B
seci f i es l he l ree i n l he f oI I ovi ng f i gure:
bi n/ mai naaa
bi n/ mai nbbb bi n/ oul code
bi n/ mai nccc
bi n/ mai nddd
bi n/ maker eaI bi n/ l rbbI ock
bi n/ l ransi nl
bi n/ l ransr
bi n/ l ransri
Iigure 4-C
Dur i ng I i nki ng, l he I i nker r eads l he overI ay fiIes i n l he or der you seci f i ed i n
l he di recl i ve, I i ne by I i ne. The I i nker r eser ves lhi s or der i n l he ma and cross
r ef er ence oul ul , and so you can deduce l he exacl l ree sl rucl ure f r om l he
overI ay I eveI and ordi nal e l he I i nker ri nl s vi l h each code s egmenl .
4. 3. 2 G#>#2#.D#5 9: ,=&K:05
Whi I e I i nki ng an overI ai d r ogr am, l he I i nker checks each s ymboI r ef er ence
f or vaI i di l y.
216
AMIGADO5 DEVELOPER'5 MANUAL
Suos e l hal l he ref erence is i n a lree node " R" , and l he symboI i n a node " S " .
The n l he r ef er ence is I egaI if one of l he f oI I ovi ng is l rue.
(a) R and S are l he s ame node.
(b) R is a des c endenl of S.
(c) R is l he ar enl of S.
Ref er enc es of l he l hi rd l ye above are knovn as nvcr ! ay r cI cr cnccs. I n l hi s
cas e, l he I i nker enl er s l he overI ay suervi sor vhe n l he r ogr am is r un. The
overI ay suer vi sor l hen checks l o see if l he code s egmenl conl ai ni ng l he
s ymboI is aI ready i n me mor y. If nol , firsl l he code s egmenl , if any, al l hi s
I eveI , and aII ils des c endenl s are unI oaded, and l hen l he node conl ai ni ng l he
symboI i s br oughl i nl o me mor y. An overI ai d code s egmenl r el ur ns di recl I y l o
ils caI I er, and so is nol unI oaded f r om me mor y unl i I anol her node is I oaded on
l o of i l.
Ior examI e, s uos e l hal l he l ree i s:
A
!
C
!"#
D I I
Wh e n l he I i nker firsl I oads l he r ogr am, onI y A is i n me mor y. Wh e n l he
I i nker f i nds a r ef er ence i n A l o a s ymboI i n , il I oads and enl er s . If i n l ur n
caI I s D l hen agai n a ne v node i s I oaded. Wh e n r el ur ns l o A, bol h and D
are Iefl i n me mor y, and l he I i nker does nol reI oad l hem if l he r ogr am requi res
l he m I al er. No v s uos e l hal A caIIs C. Ii rsl l he I i nker unI oads l he code
s egmenl s l hal il does nol requi re, and vhi c h il ma y over vr i l e. In l hi s cas e,
l hes e are and D. Onc e il has r ecI ai med l he me mor y f or l hes e, l he I i nker can
I oad C.
Thus , vhe n l he I i nker execul es a gi ven node , aII l he node ' s " a nc e s l or s " , u
l o l he rool are i n me mor y, and ossi bI y s ome of ils des c endenl s .
V3Q3Q ?)/9':.)2= ;:'.95
The I i nker as s ume s l hal aII overI ay r ef er ences are | ums or subr oul i ne caI I s,
and r oul es l he m l hr ough l he overI ay suervi sor. Thus , you shouI d nol us e
overI ay symboI s as dal a I abeI s.
Tr y l o avoi d i mur e code vhe n overI ayi ng becaus e l he I i nker does nol
aI vays I oad a node l hal is f resh f r om l he I oad fiIe.
THE LINKER
217
The I i nker gi ves eac h s ymboI l hal has an overI ay r ef er ence an over I ay
numbe r . Il us es l hi s vaI ue, vhi c h is zero or mor e , lo consl r ucl l he overI ay
suer vi sor enl r y I abeI associ al ed vi l h l hal symboI . Thi s I abeI is of l he f or m
" OVL Yn n n n " , vhe r e nnnn is l he overI ay number . You shouI d nol us e s ymboI s
vi l h l hi s f or mal eI s evher e.
The I i nker gal her s l ogel her aII r ogr am secl i ons vi l h l he s ame secl i on na me .
Il does lhi s so l hal il can l hen I oad l he m conl i nuousI y i n me mor y.
("( J22:2 ?:8#5 ).8 -#55)(#5
The s e errors s houI d be rare. If l hey do occur, l he error is r obabI y i n l he
comi I er a nd nol i n your r ogr am. Hove ve r , you s houI d firsl c hec k lo s ee
l hal you s enl l he I i nker a r oer r ogr am (for examI e, an i nul r ogr am
mus l have an i nl r oducl or y r ogr am uni l l hal leI I s l he I i nker l o execl a
r ogr am) .
I nvaI i d Ob| e c l ModuI e s
2 I nvaI i d us e of overI ay s ymboI
3 I nvaI i d us e of s ymboI
4 I nvaI i d us e of c o mmo n
5 I nvaI i d us e of overI ay ref erence
6 Nonze r o overI ay r ef er ence
7 I nvaI i d exl ernaI bI ock reI ocal i on
8 I nvaI i d bs s reI ocal i on
9 I nvaI i d r ogr am uni l reI ocal i on
10 ad of f sel dur i ng 32 bi l reI ocal i on
11 ad of f sel dur i ng 6/8 bi l reI ocal i on
12 ad of f sel vi l h 32 bi l ref erence
13 ad of f sel vi l h 6/8 bi l r ef er ence
14 Unexec l e d end of fiIe
15 Hunk. e nd mi ssi ng
16 I nvaI i d l er mi nal i on of fiIe
17 Ir emal ur e l er mi nal i on of fiIe
18 Ir emal ur e l er mi nal i on of fiIe
I nl er naI Ir r or s
19 I nvaI i d l ye i n hunk Iisl
20 I nl ernaI error duri ng I i brary scan
21 I nvaI i d ar gumenl f reevecl or
22 SymboI nol def i ned i n s ec ond as s
%<<#.8'X
ConsoIe Inul and Oulul
on lhe Amiga
Nol e: Thr oughoul lhi s aendi x, l he characl ers " < C S I > " r er esenl l he Con-
lroI Se que nc e I nl r oducer . Ior oul ul , you may ei l her us e l he l vo characl er
s equenc e Isc- | or l he one byl e vaI ue $9 ( hex) . Ior i nul , you recei ve $9s .
H.92:8/D9':.
Thi s aendi x descri bes severaI vays lo do consoI e ( keyboar d and screen)
i nul and oul ul on l he Ami ga. You can oen l he consoI e as you vouI d any
ol her Ami g a DOS fiIe (vi lh " " , " C O N : " , " RAW: " ) or do di recl caIIs lo
consoI e. I i br ar y. The advanl ages of us i ng each are I i sled beI ov:
" As l e r i s k" does nol oen any vi ndovs , il | usl us es l he exi sl i ng
CLI vi ndov. You do nol recei ve any c omI ex characl er se-
que nc e s . You do r ecei ve I over cas e I el l ers a - z , ue r c a s e
I el l ers A- Z, numbe r s , ASCI I seci aI s ymboI s , a nd conl roI char-
acl ers. asi caI I y, if a l eI el ye can gener al e l he characl er vi l h a
si ngI e keysl r oke, you can recei ve il. In addi l i on l o l hes e char-
acl ers, you can recei ve each of l he m vi l h l he hi gh- or der bi l sel
( $80- $II) . Li ne edi l i ng is aI so er f or med for you. Thi s me a ns
Ami ga DOS accel s < A C K S I A C I > and CTRL- X f or characl er
and I i ne deI el i ons. You do nol have lo deaI vi l h l hes e. Any
< C S I > s equenc e is s vaI I oved for you as veI I as conl roI char-
acl ers: C, D, I, I, H, and X. Any < C R > or CTRL- M characl ers
are conver l ed lo CTRL- } ( nev- I i ne) .
CON: Is | usl Iike " " excel l hal you aI so gel lo def i ne a ne v vi ndov.
RAW: The si mI e case: Wi l h RAW: (as c omar e d lo CON: ) you I ose
l he I i ne edi l i ng f uncl i ons and you gai n access l o l he f uncl i on
and arrov keys. Thes e are senl as s equences of characl er s
vhi c h you mus l ar se i n an i nl eI I i genl manne r .
The " c o mI e x " cases: y i ssui ng addi l i onaI c omma nds lo l he
consoI e r ocessor (by doi ng vri l es lo RAW: ) , you can gel even
mor e del ai I ed i nf ormal i on. Ior examI e, you can r equesl key
APPENDIX: CON5OLE INPUT AND OUTPUT ON THE AMIGA 219
r ess and reI ease i nf ormal i on or dal a on mous e evenl s . Se e
" SeI ecl i on of R A W I nul Ive nl s " on age 224 f or del ai I s on
r equesl i ng l hi s i nf ormal i on.
cons oI e. devi ce: Wi l h lhi s me l hod, you have fuI I conl roI over l he cons oI e
devi ce. You ma y c hange l he Ke yMa l o one of your o vn
desi gn and comI el eI y " r e de s i gn" your keyboar d.
@#0<>/0 %&'()*+, ?:&&).85
Tvo ver y heI f uI Ami ga DOS c omma nds I el you I ay vi l h l hes e f uncl i ons. The
firsl:
TYPE RAW: 10/10/100/30/ npt h
accel s i nul f r om a RAW: vi ndov and di sI ays l he resuI l s i n he x and ASCI I .
If you va nl lo knov f or sure vhal characl ers l he keyboar d is s endi ng, l hi s
c o mma nd r ovi des a ver y si mI e vay.
The s ec ond:
COPY "RAW: 10/10/100/30/RAW Input" "RAW: 100/I0/200/100/RAW Output"
I el s you l ye s equenc es i nl o l he i nul vi ndov and val c h l he cur sor move -
me nl s i n l he oul ul vi ndov. COI Y c annol del ecl end- of - f i I e on RAW: i nul ,
s o you have l o r ebool vh e n you are f i ni shed vi l h l hi s c o mma nd.
?+S _#=K:)28 H.</9
If you r ead f rom l he CON: devi ce, l he keyboard i nul s are rerocessed for you.
You gel l he ASCI I characl er s Iike " " . Mos l nor maI l exl gal her i ng r ogr ams
r ead f r om l he CON: devi ce. Seci aI r ogr ams I i ke vor d r ocessor s a nd mus i c
keyboar d r ogr ams us e RAW: .
To gener al e l he i nl ernal i onaI and seci aI characl ers al l he keyboar d, you can
r ess ei l her ALT key. Thi s sel s l he hi gh bi l of l he ASCI I code r el ur ned f or l he
ke y r es s ed.
Gener al i ng $II ( umI aul y) is a seci aI case. If il f oI I oved l he s l andar d
convenl i on, il vouI d be gener al ed by ALT- DIL. ul si nce l he ASCI I code
< D e I > ( hex 7I) is nol generaI I y a ri nl abI e characl er and il is our hi I os ohy
l hal AI l - nonr i nl i ng characl er shouI d nol gener al e a ri nl i ng char acl er , ve
have subsl i l ul ed ALT- numer i c a d" - " .
TabI e A- I Iisls l he characl ers you can di sI ay on l he Ami ga. The characl er s
NS I ( nonbr eak sace) a nd S HY ( sof l hyhe n) are us e d l o r ender a s ac e a nd
hyhe n i n l exl r ocessi ng vi l h addi l i onaI meani ng aboul l he r oer l i es of l he
characl er.
220 AMIGADO5 DEVELOPER'5 MANUAL
tiK
$ $ $
)
*
$ % % & & & & & & & &
b?
$
$
9
$ &
$
& & $ $ $ $ & & & &
b(, $ $ & & $ $ & & $ $ & & $ $ & &
, $
& $
& $ & $ & $ &
-
& $ & $ &
b!
% % % & % ' % ( % ) % * % + % , % - % . & % & & & ' & ( & ) &/ *
$ $ $ $
% %
'( % 0 1
+
1
)*'(
+
2
f>
0 K
$ $ $ &
% &
&
& 2
3 0
4
5
6
2
7
!
0
8
$ $ & $
% '
II
' 9 : ; <
,
2
%
0
=
%
% % & &
% (
#
( > ? > @

(
2
t
%
0
%
% & % % % ) ! ) A B C $
D
r
2E
%
0
%
$ & $ & % * F * G H I J ?
&
# +
% & & %
% +
$ + K L M L M ; N
GG
+
% & & &
% ,
1
, O P
Q
P
#
R
#
.
?
- .
& % % %
% -
(
- S T U T
t
G
%
& % % &
% .
R/VV/W
$
. X Y 5
Z
[
&
G
%
/
H
& % & %
& %
*
R
\ ]
\
^
R

G
!
/
#
J
& % & &
& &
$ _ ` a {
! #
G
0
I
J
& & % %
& '
! b \
X
& X
J
J
& & % &
& (
#
% c
&
d
'
'/0
!
X
Y
!
e
!
=
& & & %
& )
R # 7 8
mm

V
X
f 5
& & & &
& *
!
'
%
#
% '
c
X
c
&
Z
Tab!c A-!: Intcrnatinna! Charactcr Cndc
Nol e: Ami g a DOS uses CON: i nul for l he CLI and mos l ol her c omma nds .
Wh e n il does l hi s, il fi I lers oul ALL of l he f uncl i on key and cur sor key i nul s .
Ir ogr ams l hal r un unde r Ami ga DOS can ( and s ome do) sliII oe n l he RAW:
cons oI e handI er and r ocess f uncl i on key i nul .
Nol e: " N S I " is a nonbr eak s equenc e.
" S H Y " is a s of l - hyhen.
APPENDIX: CON5OLE INPUT AND OUTPUT ON THE AMIGA 221
?+S ,D2##. +/9</9
CON: scr een oul ul is | usl I i ke RAW: scr een oul ul excel l hal < L I > ( hex OA)
is l ransI al ed i nl o a nevI i ne characl er. The nel ef f ecl i s l hal l he cursor move s l o
l he firsl c oI umn of l he nexl I i ne vhe ne ve r a < L I > is di sI ayed.
G%L ,D2##. +/9</9
ANS I X3 . 6 4 CODIS S UIIORTID Ior vri l i ng l exl lo l he di sI ay:
I ndeendenl Conl roI Iuncl i ons ( no i nl roducer) :
Ctr! Hcx Na mc DcIi ni t i nn
H 08 S ACKS IACI
Move l he cursor I efl
1 c oI umn
I 09 TA TA
Move ri ghl 1 c oI umn
}
OA LI LI NI IIID
Move ri ghl 1 c oI umn
K O VT VIRTI CAL TA Move cur sor u 1,
scroII
if neces s ar y
L OC II I ORM IIID CI ear l he scr een
M 0D CR CARRI AGI RITURN Move lo fi rsl c oI umn
N 0I S O SHI IT OUT
Sel MS of each
characl er bef or e
O
di sI ayi ng
O
OI SI SHI IT I N Undo SHI IT OUT

I ISC ISCAII
See beI ov
Irecede l he f oI I ovi ng characlers vi l h < I S C > lo erf orm l he i ndi cal ed acl i ons.
Chr Na mc DcIi ni t i nn
c RI S RISIT TO I NI TI AL STATI
Ir ecede l he f oI I ovi ng characl ers vi l h < I s c > or ress CTRL- ALT and l he
I el l er lo er f or m l he i ndi cal ed acl i ons.
Hcx Chr Na mc DcIi ni t i nn
845l D I ND I NDIX:
move l he acl i ve osi l i on dovn one I i ne
85 I NIL NIXT LI NI:
8 D M RI RIVIRSI I NDIX:
9

CSI
CONT ROL S IQUINCI I NTRODUCIR:
see nexl Iisl
Conl r oI s equences ( i nl roduced by < C S I > ) vi l h ar amel er s . The firsl char ac-
l er i n l he f oI I ovi ng labI e ( under l he < C S I > coI umn) r er esenl s l he numbe r of
aI I ovabI e ar amel er s , as f oI I ovs:
222
AMIGADO5 DEVELOPER' 5 MANUAL
" 0 " i ndi cal es no ar amel er s aI I oved.
]O] i ndi cal es 0 or 1 numer i c ar amel er s.
]P] i ndi cal es 2 numer i c ar amel er s ( " 14, 94" ) .
" 3 " i ndi cal es any numbe r of numer i c ar amel er s , sear al ed by s emi coI ons .
" 4 " i ndi cal es exacl I y 4 numer i c ar amel er s .
" 8 " i ndi cal es exacl I y 8 numer i c ar amel er s .
< C S I > Na me De f i ni l i on
1
I CH I NSIRT CHARACTIR Inserl s 1 or mor e saces, shi fli ng
l he r emai nder of l he I i ne l o l he
ri ghl .
1 A
c u u
CURS OR UI
1 CUD CURS OR D O W N
1 C CUI CURS OR I ORWARD
1 D CU CURS OR ACKWARD
1 I CNL CURS OR NIXT LI NI Do vn n I i nes l o c oI umn 1
1 I CIL CURS OR IRICIDI NG LI NI U n I i nes lo c oI umn 1
2 H CUI CURS OR IOS I TI ON " < C S I > r o v , c o I u m n H "
1 }
ID IRAS I I N DI SILAY
( onI y l o e nd of di sI ay)
1 K IL IRASI I N LI NI ( onI y lo eoI )
1 L IL I NSIRT LI NI I nserl s a bI ank I i ne
IIORI l he I i ne
conl ai ni ng l he cursor.
1 M DL DILITI LI NI Re move s l he cur r enl
I i ne. Move s aII
I i nes beI ov u by
one. I anks l he
bol l om I i ne.
1 I DCH DILITI CHARACTIR
2 R CIR CURS OR IOS I TI ON RIIORT (in Read s l r eam onI y)
Ior mal of reorl :
" < C S I > r o v , c o I u m n R "
1 S S U S CROLL UI
Removes Iine f rom l o of screen.
Move s aII ol her I i nes u one.
I anks I asl I i ne.
1 T S D S CROLL D O W N
Re move s I i ne f r om bol l om of
scr een.
Moves aII ol her I i nes dovn one.
I anks l o I i ne.
3 h S M SIT MODI < C S I > 2 0 h causes RAW:
l o conver l < L I > lo
< n e v I i n e > on oul ul .
3 1 RM RISIT M O D I < CS I > 2 0 1 undoes SIT MODI 20
3 m S GR SILICT GRAIHI C RINDI TI ON
1 n DS R DIVI CI STATUS RIIORT
APPENDIX: CON5OLE INPUT AND OUTPUT ON THE AMIGA 223
The f oI I ovi ng are nol ANSI sl andar d s equenc es , r al her , l hey are ri val e
Ami ga s equenc es .
1 l aSLII SIT IAGI LINGTH
1 u aSLL SIT LI NI LINGTH
1 X a S LO SIT LIIT OIISIT
i y
a S TO SIT TOI OIIS IT
3
aSRI SIT R A W IVINTS
8 I
aI IR I NIUT IVINT RIIORT (read)
3
aRRI RISIT RAW IVINTS
1 ' a SKR SIICI AL KIY RIIORT (read)
I I
a S CR SIT CURS OR RINDI TI ON
< I s c > l ur ns l he cursor off
Oq a WS R W I N D O W S TATUS RIQUIS T
4 r a WR W I N D O W OUNDS RIIORT ( read)
JX)&<0#5N
Move cur sor ri ghl by 1:
< C S I > C o r < T a b > o r < C S I > 1 C
Move cur sor ri ghl by 20:
< C S I > 2 0 C
Move cur sor lo ue r Iefl cor ner ( home) :
< C S I > H o r < C S I > 1 , 1 H o r < C S I > , 1 H or < C S I > 1 , H
Move cur sor lo l he f ourl h c oI umn of l he firsl I i ne of l he vi ndov:
< C S I > 1 , 4 H o r < C S I > , 4 H
CI ear l he scr een:
< I I > or CTRL- L cI ear scr een characl er or
< C S I > H < C S I > } home and cI ear l o e nd of scr een or
< C S I > H < C S I > 2 3 M home and deI el e 23 I i nes or
< C S I > 1 , 1 H < C S I > 2 3 L home and i nserl 23 I i nes
224 AMIGADO5 DEVELOPER' 5 MANUAL
G%L _#=K:)28 H.</9
Re a di ng i nul f r om l he RAW: c ons oI e devi c e r e l ur ns a n ANS I X3 . 6 4
sl andar d byl e sl r eam. Thi s s l r eam may conl ai n nor maI characl ers and/ or RAW
i nul evenl i nf or mal i on. You ma y aI so r eques l ol her R A W i nul evenl s
us i ng l he SIT R A W IVINTS ( aSRI) and RISIT RAW IVINTS ( aRRI) c on-
lroI s equenc es di scussed beI ov. See " SeI ecl i on of RAW I nul Ive nl s " beI ov
f or del ai I s.
If you i ssue a RAW i nul r equesl and l her e is no endi ng i nul , l he r ead
c omma nd vai l s unl i I s ome i nul is recei ved. You can l esl f or characl ers
endi ng by doi ng " Wa i l f or Cha r " r equesl s.
I n l he def auI l sl al e, l he f uncl i on and arrov keys cause l he f oI I ovi ng se-
quenc es lo be senl lo your r ocess:
Kcy Unshi I t cd 5cnds 5hi It cd 5cnds
I I < C S I > 0 ' CS I > 1 0 "
I2
< c s i > r < c s i > i r
I3 < C S I > 2 < C S I > 1 2 '
I4 < C S I > 3
_
< C S I > 1 3 "
I5 < C S I > 4 ' < C S I > 1 4
_
I6 < C S I > 5 " < C S I > 1 5 "
I7 < C S I > 6 " < C S I > 1 6 "
I8 < C S I > 7 ' < C S I > 1 7 '
I9 < C S I > 8 < C S I > 1 8
I10 < C S I > 9 ' < C S I > 1 9 '
HILI < C S I > ` ' < C S I > ` ' ( same)
Ar r ov keys :
U < C S I > A
Do vn < C S I >
Lef l < C S I > C
Ri ghl < C S I > D
< C S I > T '
< C S I > S '
< C S I > A" ( nol e sace)
< C S I > " ( nol e sace)
,#0#D9':. :> G%L H.</9 JC#.95N
If you ar e us i ng R A W by def auI l , you gel l he ANS I dal a a nd c onl r oI
s equenc es me nl i oned above. If l hi s does nol gi ve you e nough i nf or mal i on
aboul i nul evenl s , you can r equesl addi l i onaI i nf or mal i on f r om l he cons oI e
dri ver.
If, for examI e, you ne e d lo knov vhe n each key is r es s ed and r eI eased,
you vouI d requesl " R A W keyboar d i nul . " Thi s is done by vri l i ng " < C S I > 1 "
l o l he cons oI e. The f oI I ovi ng is a Iisl of vaI i d RAW i nul r equesl s:
APPENDIX: CON5OLE INPUT AND OUTPUT ON THE AMIGA 225
G%L H.</9 JC#.9 !=<#5
Re que s l
Numb e r Des c r i l i on
0 no
1 R A W keyboar d i nul
2 RAW mous e i nul
3 Ivenl Senl vhe ne ve r your vi ndov is
made acl i ve.
Us ed i nl ernaI I y.
4
5
6
7
8
9
10
11
12
13
14
15
16
Ioi nl er osi l i on
( unused)
Ti mer
Gadgel r es s ed
Gadgel reI eased
Reques l er acli vi ly
Me nu number s
CI ose Gadgel
Wi ndov resi zed
Wi ndov r ef r es hed
Ir ef er ences c hanged
Di sk r e move d
Di sk i nser l ed
If you seI ecl any of l hese evenl s , you slarl lo gel i nf or mal i on aboul l he
evenl s i n l he f oI I ovi ng f or m:
<C5I Xc ! as s >
< subc!ass >
<kcycndc>
<qua!iIicrs>
< x >
<sccnnds>
<micrnsccnnds >
< C S I > is a one byl e fi eI d. Il is l he Conl r oI Sequenc e I nl r oducer , 9 hex.
< c I a s s > is l he RAW i nul evenl l ye, f r om l he above l abI e.
< s u b c I a s s > is nol currenl I y us ed and is aI vays zer o (0).
< k e y c o d e > i ndi cal es vhi c h key numbe r vas r essed ( see Ii gur e A- I and
TabI e A- 2) . Thi s fi eI d can aI so be us ed f or mous e i nf or mal i on.
The < qua I i f i e r s > fi eI d i ndi cal es l he sl al e of l he keyboar d and s ys l em. The
quaI i fi ers are def i ned as f oI I ovs:
< y >
226 AMIGADO5 DEVELOPER' 5 MANUAL
i l Ma s k Ke y
0 0001 Iefl shi fl
1 0002 ri ghl shi fl
2 0004 cas I ock seci aI , see beI ov
3 0008 conl roI
4 0010 I efl aIl
5 0020 ri ghl aIl
6 0040 Iefl Ami ga key r es s ed
7 0080 ri ghl Ami ga ke y r es s ed
8 0100 numer i c ad
9 0200 r eeal
10 0400 i nl errul Nol currenl I y us e d
11 0800 muI l i br oadcasl Thi s (acli ve) or aII vi ndovs
12 1000 I efl mous e bul l on
13 2000 ri ghl mous e bul l on
14 4000 mi ddI e mous e bul l on
( nol avai I abI e on sl d mous e)
15 8000 reI al i ve mous e I ndi cal es mous e coor di nal es are
reI al i ve, nol absoI ul e
The CAIS L OCK ke y is handI ed i n a seci aI manne r . Il onI y gener al es a
keyc ode vh e n il i s r es s ed, nol vh e n il is r eI eased. Hove ve r , l he u and
dovn bi l (80 hex) is sliII us ed and r eor l ed. If r essi ng l he CAIS L OCK key
l ur ns on l he LID, l hen key code 62 ( CAIS LOCK r essed) is senl . If r es s i ng
l he CAIS L OCK key exl i ngui shes l he LID, l hen key c ode 190 ( CAIS L OCK
r eI eased) i s senl . I n ef f ecl , l he keyboar d reorl s l hi s key bei ng heI d dovn unl i I
il is sl ruck agai n.
The < s e c o n d s > and < mi c r o s e c o n ds > fi eI ds are s ys l em lime s l am l aken al
l he l i me l he evenl occur r ed. The s e vaI ues are sl ored as I ong vor ds by l he
s ys l em and as s uc h couI d ( l heorel i caI I y) reach 4 bi I I i on.
Wi l h RAW: keyboar d i nul , seI ecl ed keys no I onger r el ur n a si mI e 1
characl er ]%] lo " Z " bul ral her r el urn r av keycode reorl s vi l h l he f oI I ovi ng
f or m:
< C S I > I , 0 , < k e y c o d e > , < q u a I i f i e r s > , 0 , 0 , < s e c s > , < m i c r o s e c s > +
Ior examI e, if l he us er r es s ed and reI eased l he " " ke y vi l h l he I efl
SHI IT and ri ghl Ami ga keys aI so r es s ed, you mi ghl recei ve l he f oI I ovi ng
dal a:
< C S I > 1 , 0 , 3 5 , 1 2 9 , 0 , 0 , 2 3 9 8 7 , 9 9 +
< C S I > 1 , 0, 1 6 3 , 1 2 9 , 0 , 0 , 2 4 0 0 3 , 18+
APPENDIX: CON5OLE INPUT AND OUTPUT ON THE AMIGA 227
The " 0 , 0 , " fi eI ds are nol us ed f or keyboar d i nul bul are, r al her , us e d if
you seI ecl mous e i nul . Ior mous e i nul , l hes e fi eI ds vouI d i ndi cal e l he X and
Y coor di nal es of l he mous e .
The < k e y c o d e > fi eI d is an ASCI I deci maI vaI ue r er es enl i ng l he key r es s ed
or r eI eased. Addi ng 128 l o l he r es s ed key code resuI l s i n l he r eI eased keyc ode.
Ii gur e A- I I els you conver l qui ckI y f r om a key lo ils keyc ode. TabI e A- 2 I el s
you conver l qui ckI y f r om a keycode l o a key.
123
)*
#$
*%
#%
*&
#%
*'
# &
*(
#'
*) **
#(
*+ *, *-
#$)
*.
* + ,
)+
bo %&
#
%'
%(
5
%)
K
- $
%*
%+
i
%,
N % -
i
#
%.
g 2 %9 g` %A
' . / 0
'1./+
)&
(
(% (G
2
( K
3 4 5 )
)' & %
6
& &
+
& '
78
& (
3 9 l
& ) & *
&+
& ,
)
&-
$
& .
!
&/1
i
& 9
))
:+ , 1
* K
;
' A
'
' G ' K
/ 3 : ,
+(
/ . 8 8
,</0
+'
. '
'% '&
<
''
#
'(
3
')
:
'*
=
'+
0 ,
', '- '.
7#> 7 3 ?
' 2 h 'G
. @
(
%
) `
$
& A
4
X G
%
& K
':7 # 3
+% (%
5
(&
('
/
((
9
()
ft
(* (+
A
(, (- (. ( 2 +& ) K ) G
)
gK (`
. , 3
+)
!
++
)%
A.
+, +*
i
) A
) 2
7 @ 3 B # C
)(
Figurc A-!: Rcduccd cnpy nI kcybnard tcmp!atc
228
AMIGADO5 DEVELOPER'5 MANUAL
The def auI l vaI ues gi ven i n l he f oI I ovi ng cor r es ond l o:
1) The vaI ues l he CON: devi ce rel urns vhe n l hese keys are r es s ed, and
2) The keyc as as s hi ed vi l h l he sl andar d Amer i can keyboar d.
TabI e Aj 'D Converling from Keycodes lo Keys
Ra w Unshi I t cd 5hi It cd
Kcy DcIau! t DcIau! t
Numbc r Va! uc Va! uc
00 ' < Ac c e n l g r a ve > " < l i I d e >
01 1 !
02 2
03 3 -
04 4 $
05 5 %
06 6
07 7 &
08 8
09 9 (
OA 0 )
0 - < H y h e n > < Un d e r s c o r e >
0C +
0D +
0I undef i ned
OI 0 0 < Nume r i c a d >
10 Q q
11 W v
12 I e
13 R r
14 T l
15 Y y
16 U u
17 I i
18 O o
19 I
1A |
I j
1C undef i ned
I D 1 1 < Nume r i c a d >
I I 2 2 < Nume r i c a d >
I I 3 3 < Nume r i c a d >
APPENDIX: CON5OLE INPUT AND OUTPUT ON THE AMIGA 229
Ra w Unshi I t cd 5hi It cd
Kcy DcIau! t DcIau! t
Numbc r Va! uc Va! uc
20 A a
21 S s
22 D d
23 I f
24 G
g
25 H h
26
} |
27 K k
28 L 1
29
2 A
' < si ngI e quol e >
2 < R I S I R V I D > ( RISIRVID)
2C undef i ned
2 D 4 4 < Nume r i c a d >
2I 5 5 < Nume r i c a d >
2I 6 6 < Nume r i c a d >
30 < R I S I R V I D > ( RISIRVID)
31 Z z
32 X x
33
c
c
34 V V
35 b
36 N n
37 M m
38
&
, < c o m m a >
39 > . < eri od >
3 A
?
#
3 undef i ned
3 C . < Nume r i c a d >
3D 7 7 < Nume r i c a d >
3I 8 8 < Nume r i c a d >
3I 9 9 < Nume r i c a d >
40 Sace
41 ACKS IACI
42 TA
43 INTIR INTIR < Nume r i c a d >
44 RITURN
INTIR < Nume r i c a d >
45 Iscae < I s c >
46 DIL
230 AMIGADO5 DEVELOPER' 5 MANUAL
Ra w Unshi I t cd 5hi It cd
Kcy DcIau! t DcIau! t
Numbc r Va! uc Va! uc
47 undef i ned
48 undef i ned
49 undef i ned
4 A - - < Nume r i c a d >
4 undef i ned
4 C Cur sor U ScroI I dovn
4 D Cur sor Do vn ScroI I u
4I Cur sor Ior var d ScroI I Iefl
4I Cur sor ackvar d ScroI I ri ghl
50 I I < C S I > 1 0
51 I2
< c s i > i r
52 I3 < C S I > 1 2 '
53 I4 < C S I > 1 3
54 I5 < C S I > 1 4 '
55 I6 < C S I > 1 5 '
56 I7 < C S I > 1 6 "
57 I8 < C S I > 1 7
58 I9 < C S I > 1 8 "
59 I10 < C S I > 1 9 "
5 A undef i ned
5 undef i ned
5 C undef i ned
5 D undef i ned
5I undef i ned
5I HeI
60 SHI IT < I e f l of sace b a r >
61 SHI IT < r i ghl of sace b a r >
62 Cas Lock
63 Conl r oI
64 Lef l AI l
65 Ri ghl AI l
66 " Ami ga " <I ef l of sace b a r >
67 " Ami g a " < r i ghl of sace b a r >
68 Lef l Mous e ul l on
< n o l c onve r l e d> I nul s are onI y
f or l he
69 Ri ghl Mous e ul l on
< n o l c onve r l e d> mous e c onnec l ed
l o I nl ui l i on,
APPENDIX: CON5OLE INPUT AND OUTPUT ON THE AMIGA
231
Ra w Unshi I t cd 5hi It cd
Kcy DcIau! t DcIau! t
Numbc r Va! uc Va! uc
6A Mi ddI e Mous e ul l on
< n o l c onve r l e d> currenl I y
" ga me o r l " one.
6 undef i ned
6C undef i ned
6 D undef i ned
6I undef i ned
6I undef i ned
70- 7I undef i ned
80- I8 U l ransi l i on < r e I e a s e or unr e s s k e y > of one of l he
above keys . 80 f or 00, I8 f or 7I.
I9 Lasl keycode vas bad ( vas senl i n or der l o r es ync)
I A Keyboar d buf f er overf I ov.
I undef i ned, r eser ved f or keyboar d r ocessor cal asl r ohe
IC Keyboar d seI f-lesl fai I ed.
I D Iover - u key sl r eam slarl. Ke ys r es s ed or sl uck al
over - u are senl be l ve e n I D and II.
II Iover - u key s l r eam e nd.
II ( undef i ned, r eser ved)
II Mous e evenl , move me nl onI y, No bul l on c hange. < n o l
c onve r l e d>
Nol es aboul l he r ecedi ng l abI e:
1) " unde f i ne d" i ndi cal es l hal l he currenl keyboar d desi gn s houI d nol gener -
al e l hi s numbe r . If you are us i ng " S e l Ke y Ma " l o c hange l he key ma , l he
enl ri es f or l hese numbe r s mus l sliII be i ncI uded.
2) The " < n o l c o n v e r l e d> " ref ers l o mous e bul l on evenl s . You mus l us e l he
s equenc e " < C S I > 2 " l o i nf or m l he consoI e dri ver l hal you vi s h l o recei ve
mous e evenl s , ol her vi se, l hes e are nol l r ansmi l l ed.
3) " ( RIS IRVID) " i ndi cal es l hal l hese keycodes have been r eser ved f or non- U. S.
keyboar ds . The " 2 " c ode key is be l ve e n l he doubI e quol e and r el ur n keys .
The " 3 0 " code key is be l ve e n l he SHI IT and " Z " keys .
%&'()*+, !#D".'D)0
G#>#2#.D# -)./)0
Cnntcnts
1. Fi!ing 5ystcm
2. Amiga Binary Fi!c 5tructurc
3. AmigaDO5 Data 5tructurcs
?")<9#2 O
The IiIing Syslem
Thi s chal er descri bes l he Ami ga DOS fiIing s ys l em. Il i ncI udes i nf or mal i on on
h o v l o al ch a di sk cor r ul ed by har dvar e errors.
1. 1 Ami ga DOS Ii I e Sl rucl ure
1. 1. 1 Rool I ock
1. 1. 2 Us er Di recl ory I ocks
1. 1. 3 Ii I e He ade r I ock
1. 1. 4 Ii I e Li sl I ock
1. 1. 5 Dal a I ock
1. 2 DI S KIDThe Di sk Idi l or
O3O %&'()*+, R'0# ,92/D9/2#
The Ami g a DOS fiIe handI er us es a di sk l hal i s f ormal l ed vi l h bI ocks of equaI
si ze. Il r ovi des an i ndef i ni l eI y dee hi er ar chy of di recl ori es, vhe r e each
di recl ory ma y conl ai n ol her di recl ori es and fi I es, or | usl fi I es. The sl rucl ure is a
ur e l r eel hal i s, I oos are nol aI I oved.
The r e is suf f i ci enl r edundanc y i n l he me c hani s m lo aI I ov you l o al c h
l ogel her mos l , if nol aI I , of l he conl enl s of a di sk af l er a ser i ous har dvar e
error, for examI e. To al ch l he conl enl s of a di sk, you us e l he DI S KID
c omma nd. Ior f url her del ai I s on l he synl ax of DI SKID, see Secl i on 1. 2,
" DI S KIDTh e Di s k Idi l or , " I aler i n l hi s chal er . ef ore you can al ch l o-
gel her l he conl enl s of a di sk, you mus l under s l and l he I ayoul . The s ubs ecl i ons
beI ov descri be l he I ayoul of di sk ages .
O3O3O G::9 W0:DM
The r ool of l he l ree is l he Rool I ock, vhi c h is al a f i xed I ace on l he di sk. The
rool is I i ke any ol her di recl ory, excel l hal il has no ar enl , and i ls s econdar y
l ye i s di f f erenl . Ami g a DOS sl ores l he na me of l he di sk voI ume i n l he na me
fi eI d of l he rool bI ock.
FILING 5Y5TEM
235
Iach fi I i ng s ys l em bI ock conl ai ns a c hec ks um, vhe r e l he s um ( i gnori ng
overf I ov) of aII l he vor ds i n l he bI ock is zero.
The f i gure beI ov descri bes l he I ayoul of l he rool bI ock.
0 I T. S HORT I Tye
I 1
1 +_ 0 _| Header key ( aI vays zero)
2 + _0_ _ } Hi ghes l seq numbe r ( aI vays zero)
3 I H T S I Z I I Hashl abI e si ze ( bI ocksi ze- 56)
I 1
4 # _ _ _ _ o _ _ _ _ J
%
1 C H } C K S } } } M }
6 I I
I has h I
I l abI e I
SI ZI- 51 I I
SI ZI- 50 | j _ MI LAG 234
SI ZI- 49 + i l ma +
I I
a
8
e s
I
SI ZI- 24 + +
SI ZI- 23 I DAYS I
) 5
SI ZI- 22 I NfI NS I
SI ZI- 21 TI CKS
SI ZI- 20 + DI SK +
+ NAMI +
SI ZI- 7 I CRIATIDAYS I
) 5
SI ZI- 6 I C} RIATIMI NS I
SI ZI- 5 C M A T I T I C K S
SI ZI- 4 | 0 +
SI ZI- 3 I 0 I
SI ZI- 2 0 $%
SI ZI- 1 } S T. ROOT +
TRUI if i l ma on di sk is vaI i d
Us e d l o i ndi cal e l he bI ocks
conl ai ni ng l he bi l ma
VoI ume I asl aI l ered
dal e and l i me
VoI ume na me as a CIL sl ri ng
of < 30 characl ers
VoI ume creal i on dal e
and lime
Nexl enl ry on l hi s has h chai n ( aI vays zero)
Iar enl di recl ory ( aI vays zero)
Ixl ensi on ( aI vays zero)
Sec ondar y l ye i ndi cal es rool bI ock
Iigure 1-A: Rnnt B!nck
236 AMIGADO5 TECHNICAL REFERENCE MANUAL
O3O3P 45#2 *'2#D9:2= W0:DM5
The f oI I ovi ng f i gure descri bes l he I ayoul of l he conl enl s of a us er di recl ory
bI ock.
0 I _ T | 5 H O R T _ I Tye
5
6 $ $ 7 8 H e a d e r key ( oi nl er l o seIf)
2 |_ 0 } Hi ghes l seq numbe r ( aI vays zero)
3 I 0 I
!
# c9:;
s
_y_M $
6 I I
I has h I
I l abI e I
& &
( (
SI ZI- 51 I I
SI ZI- 50 a r e _
SI ZI- 48 } IROTICT + Irol ecl i on bi l s
SI ZI- 47 I 0 I Unus e d ( aI vays zero)
SI ZI- 46 ! 5
COMMI NT Sl or ed as a CIL sl ri ng
SI ZI- 24 |_ +
SI ZI- 23 + DAYS + Cr eal i on dal e and l i me
SI ZI- 22 I MI NS I
SI ZI- 21 TI CKS
SI ZI- 20 + DI RICTORY i Sl or ed as a CIL sl ri ng
+ NAMI + of < 30 characl ers
SI ZI- 4 + H A S H C H A T N } Nexl enl r y vi l h s ame has h vaI ue
SI ZI- 3 ) _ } IARINT_ _ I ack oi nl er lo ar enl di recl ory
SI ZI- 2 _ 0 Ixl ensi on ( aI vays zero)
SI ZI- 1 L 1 P l S I R D } R } secondar y l ye
Iigure 1-: User Direclory Iocks
FILING 5Y5TEM
237
Us er di recl ory bI ocks have l ye T. S HORT and s econdar y l ye ST. USIR-
DI RICTORY. The six i nf ormal i on vor ds al l he slarl of l he bI ock aI so i ndi cal e l he
bI ock' s ovn key (l hal i s, l he bI ock number ) as a consi sl ency check and l he si ze
of l he has h l abI e. The 50 i nf ormal i on vor ds al l he end of l he bI ock conl ai n l he
dal e and lime of creal i on, l he na me of l he di recl ory, a oi nl er lo l he nexl fiIe or
di recl ory on l he has h chai n, and a oi nl er l o l he di recl ory above.
To f i nd a fiIe or subdi recl ory, you mus l firsl aI y a has h f uncl i on l o i ls
na me . Thi s has h f uncl i on yi eI ds an offsel i n l he has h l abI e, vhi c h is l he ke y of
l he firsl bI ock on a chai n I i nki ng l hose vi l h l he s ame has h vaI ue (or zer o, if
l her e are none ) . Ami ga DOS reads l he bI ock vi l h l hi s key and c omar es l he
na me of l he bI ock vi l h l he requi red na me . If l he name s do nol mal c h, il r eads
l he nexl bI ock on l he chai n, and so on.
238
AMIGADO5 TECHNICAL REFERENCE MANUAL
O3O3Q R'0# @#)8#2 W0:DM
The f oI I ovi ng f i gure descri bes l he I ayoul of l he fiIe header bI ock.
0 I _ T H O R T _ I Tye
1 j j _ O W N _ K I Y _ 1 Header key
2
L G H I S I Q }
T o l a I n u m b e r o f d a l a
bI ocks i n fiIe
3 I DATA SI ZI_ I Numbe r of dal a bI ock sI ols us ed
4 II RST DATA 1 Ii rsl dal a bI ock
%
1 < K S U M =
I DATA LK 3 I
I DATA LK 2 I Iisl of dal a bI ock keys
SI ZI- 51 I DATA LK 1_ I
SI ZI- 50 a r e _
SI ZI- 48 + I R O T } C T + Irol ecl i on bi l s
SI ZI- 47 I __YTI S I ZI _ I Tol aI si ze of fiIe i n byl es
SI ZI- 46 > 5
COMMI NT Co mme nl as CIL sl ri ng
SI ZI- 24 j j
SI ZI- 23 + DAYS + Creal i on dal e and l i me
SI ZI- 22 I MI NS +
SI ZI- 21 > TI CKS
SI ZI- 20 + II LI + Sl or ed as a CIL sl ri ng
+_ NAMI _+ of < 30 characl ers
SIZI-4 Ly
A
.
I
i
(
`i
A
i }
N e x l e n l r
y
v i l h s a m e h a s h v a I u e
SI ZI- 3 I _ } ' A R I N T _ _ I ack oi nl er lo ar enl di recl ory
SI ZI- 2 } XTINSI ON_ 1 Zer o or oi nl er lo firsl exl ens i on bI ock
SI ZI- 1 L _ _ ? T i l
L
l
;
_ I Sec ondar y l ye
Figurc 1-C: Fi!c Hcadcr B!nck
FILING 5Y5TEM
239
Iach l ermi naI fiIe slarls vi l h a fiIe header bI ock, vhi c h has l ye T. S HORT
and s econdar y l ye ST. II LI. The slarl and e nd of l he bI ock conl ai n na me ,
l i me, and r edundanc y i nf or mal i on si mi I ar l o l hal i n a di recl ory bI ock. The
body of l he fiIe consi sl s of Dal a bI ocks vi l h s equenc e numbe r s f r om 1 u-
var d. Ami ga DOS sl ores l he addr esses of l hese bI ocks i n consecul i ve vor ds
dovnva r d f r om of f sel si ze-51 i n l he bI ock. In gener aI , Ami ga DOS does nol
us e aII l he sace for lhi s Iisl and l he I asl dal a bI ock is nol fuI I .
O3O3V R'0# B'59 W0:DM
If l here are mor e bI ocks i n l he fiIe l han can be seci f i ed i n l he bI ock Iisl, l hen
l he IXTINS I ON fieId is nonzer o and oi nl s lo anol her di sk bI ock vhi c h
conl ai ns a f url her dal a bI ock Iisl. The f oI I ovi ng f i gure exI ai ns l he sl rucl ure of
l he fiIe Iisl bI ock.
0 I T. LI ST I Tye
I 1
1
1
O W N K I Y j Header key
2 | LOCK COUNTj numbe r of dal a bI ocks i n bI ock Iisl
3 I } ATA_Sr ZI_ I Same as above
4 II RST DATA 1 Ii rsl dal a bI ock
5
L i C K S } } M }
6 I I
I L OCK N + 3 I
I LOCK N + 2 I Ixl ended Iisl of dal a bI ock keys
SI ZI- 51 I LOCK_N + I I
SI ZI- 50 + 5
k i nf o \ ( unused)
[ 1
SI ZI- 4 + 0 + Nexl i n has h Iisl ( aI vays zero)
SI ZI- 3 I _ } ' A R I N T _ _ I IiIe header bI ock of lhi s fiIe
SI ZI- 2 = I X T I I O n = Nexl exl ensi on bI ock
SI ZI- 1 +_ ST. II LI } secondar y l ye
Iigure 1-D: IiIe Lisl Iock
240
AMIGADO5 TECHNICAL REFERENCE MANUAL
Ther e are as ma ny fiIe exl ensi on bI ocks as requi red lo Iisl l he dal a bI ocks l hal
make u l he fi I e. The I ayoul of l he bI ock is ver y si mi I ar l o l hal of a fiIe header
bI ock, excel l hal l he l ye is di f f erenl and l he dal e and f i I ename fi eI ds are nol
us ed.
O3O3T *)9) W0:DM
The f oI I ovi ng f i gure exI ai ns l he I ayoul of a dal a bI ock.
0 I _ } } D A T A _ _ I
1 j ] _ HIADIR _ 1
2 + SI_Q_NUM +
3 I } DATA_SI ZI_ I
4 NIXT DATA 1
!
# $
6 I I
l ye
header key
s equence numbe r
nexl dal a bI ock
I DATA I
X X
Iigure 1-I: Dala I ock
Dal a bI ocks conl ai n onI y six vor ds of fiIing s ys l em i nf or mal i on. The s e si x
vor ds ref er l o l he f oI I ovi ng:
l ye ( T. DATA)
oi nl er lo l he fiIe header bI ock
s equenc e numbe r of l he dal a bI ock
numbe r of vor ds of dal a
oi nl er l o l he nexl dal a bI ock
c he c ks um
Nor maI I y, aII dal a bI ocks excel l he I asl are fuII (lhal i s, l hey have a si ze
bI ocksi ze- 6) . The I asl dal a bI ock has a f or var d oi nl er of zer o.
FILING 5Y5TEM
241
O3P *H,_J*m!"# *'5M J8'9:2
To i nsecl or al ch di sk bI ocks, you ma y us e l he Ami ga DOS di sk edi l or,
DI S KID. ec aus e DI SKID vri l es lo l he di sk di recl I y, you s houI d us e il vi l h
care. Never l heI es s , you can us e il lo good effecl i n r ecover i ng i nf or mal i on f r om
a corrul f I oy di sk, f or examI e. A di sk does nol have l o b e i nser l ed l o b e
exami ned by DI SKID.
You shouI d onI y us e DI SKID vi l h ref erence lo l he I ayoul of an Ami g a DOS
di sk. ( Ior a descri l i on of l he I ayoul , see Subs ecl i ons 1. 1. 1 l hr ough 1. 1. 5 i n l he
firsl arl of l hi s chal er . ) DI SKID knovs aboul l hi s sl r ucl ur ef or examI e, l he
R ( Rool I ock) c o mma nd ri nl s l he key of l he r ool bI ock. The G ( Gel bI ock)
c omma nd f oI I oved by l hi s key numbe r r eads l he bI ock i nl o me mor y, vhe r e -
uo n l he I ( I nf ormal i on) c o mma nd ri nl s oul l he i nf or mal i on c onl ai ned i n l he
firsl and I asl I ocal i ons, vhi c h i ndi cal e l he l ye of bI ock, l he na me , l he has h
I i nks, and so on. If you seci f y a na me af l er an H ( Hash) c o mma nd, DI S KID
gi ves you l he of f sel on a di recl ory age l hal sl ores as l he fi rsl ke y header s vi l h
na me s l hal has h lo l he na me you suI i ed. If you l hen l ye l he numbe r l hal
DI S KID r el ur ns f oI I oved by a sI ash (/), DI S KID di sI ays l he key of l hal
header age. You can l hen r ead l hi s vi l h f url her G c omma nds , and so on.
Cons i der deI el i ng a fiIe l hal , due lo har dvar e errors, make s l he fi I i ng s ys l em
resl arl r oces s faiI. Ii rsl, you mus l I ocal e l he di recl ory age l hal hoI ds l he
r ef er ence l o l he fiIe. You do l hi s by searchi ng l he di recl ory sl rucl ure f r om l he
r ool bI ock, us i ng l he ha s h codes. The n, you mus l I ocal e l he sI ol l hal r ef er ences
l he f i I el hi s is ei l her l he di recl ory bI ock or a header bI ock on l he s ame ha s h
chai n. Thi s sI ol s houI d conl ai n l he key of l he fi I e' s header bI ock. To sel l he sI ol
l o zer o, you l ye l he sI ol of f sel , f oI I oved by a sI ash (/) f oI I oved by zer o ( l hal
i s, < o f f s e l > / 0 ) . The n correcl l he c he c ks um vi l h l he K ( checKs um) c omma nd.
You s houI d di sabI e l he vri l e rol ecl i on vi l h X a nd vri l e bac k l he udal e d
bI ock vi l h I (for Iul bI ock) or W (for Wi ndu) . Ther e is no ne e d l o do
anyl hi ng eI s e, as l he bI ocks l hal l he fiIe us e d i n error be c ome avai I abI e onc e
mor e af l er l he RIS TART r ocess has successf uI I y s c anned l he di sk.
DI S KID c omma nds are aII si ngI e characl ers, s omel i mes vi l h ar gumenl s .
The f oI I ovi ng is a comI el e Iisl of l he avai I abI e c omma nds .
242
AMIGADO5 TECHNICAL REFERENCE MANUAL
The f oI I ovi ng is a comI el e Iisl of l he avai I abI e c omma nds .
Co mma n d
n
C n
G | n j
H na me
I
K
L| I vb ubj
M n
N| I vb ubj
I n
R
Q
S char
T I vb ub
V n
W
X
Y n
Z
numbe r
/|nj
' char s'
" c h a r s "
Iunc l i on
Sel I ogi caI bI ock numbe r bas e l o n
Di sI ay n characl ers f r om currenl of f sel
Gel bI ock n f r om di sk (defauI l i s l he currenl bI ock number )
CaI cuI al e Ha s h vaI ue of na me
Di sI ay bI ock I nf or mal i on
Che c k bI ock c he c Ks um ( and correcl if vr ong)
Local e vor ds l hal mal c h VaI ue under Mas k ( I vb and ub reslri cl
search)
Sel Ma s k (for L and N c ommands ) l o n
Local e vor ds l hal do nol mal c h VaI ue under Ma s k
Iul bI ock i n me mor y l o bI ock n on di sk
( def auI l i s l he cur r enl bI ock number )
Di sI ay bI ock numbe r of rool bI ock
Qui l (do nol vri l e lo di sk)
Sel di sI ay Sl yI e
char C
S
O
X
D
- > characl ers
- > sl ri ng
- > oclaI
- > hex
- > deci maI
Tye r ange of of f sel s i n bI ock
Sel VaI ue f or L and N c omma nds
Wi ndu ( IQ)
I nver l vri l e rol ecl sl al e
Sel cYI i nder bas e l o n
Zer o aII vor ds of buf f er
Sel cur r enl vor d of f sel i n bI ock Di sI ay vaI ues sel i n r ogr am
Di sI ay vor d al cur r enl of f sel or udal e vaI ue lo n
Iul char s al currenl of f sel
Iul sl ri ng al cur r enl of f sel
Tab!c 1-A: DI5KED Cnmmands
To i ndi cal e ocl aI or hex, you can slarl numbe r s vi l h - or - X ( l hal i s, - for
ocl aI , - X for hex) . You can aI so i ncI ude CIL sl ri ng escaes (N and so f orl h)
i n sl ri ngs.
?")<9#2 P
Amiga inary IiIe Slruclure
Thi s chal er descri bes:
2. 1 I nl r oducl i on
2. 1. 1 Ter mi noI ogy
2. 2 Ob| ec l Ii I e Sl rucl ure
2. 2. 1 hunk uni l
2. 2. 2 hunk na me
2. 2. 3 hunk code
2. 2. 4 hunk dal a
2. 2. 5 hunk bss
2. 2. 6 hunk reI oc32
2. 2. 7 hunk r eI oc I 6
2. 2. 8 hunk reI oc8
2. 2. 9 hunk exl
2. 2. 10 hunk s ymboI
2. 2. 11 hunk debug
2. 2. 12 hunk end
2. 3 Load Ii I es
2. 3. 1 hunk header
2. 3. 2 hunk overI ay
2. 3. 3 h u n k _ b r e a k
2. 4 IxamI es
P3O H.92:8/D9':.
Chal e r 2 del ai I s l he sl rucl ur e of i nar y Ob| ec l fi I es f or l he Ami ga , as
r oduc ed by assembI er s and comi I ers. Il aI so descri bes l he f or mal of i nar y
Load f i I es, vhi c h are r oduc ed by l he I i nker and r ead i nl o me mo r y by l he
I oader. The f or mal of I oad fiIes suor l s overI ayi ng. Aar l f r om descri bi ng l he
244
AMIGADO5 TECHNICAL REFERENCE MANUAL
f or mal of I oad fi I es, l hi s chal er exI ai ns l he us e of c ommon s ymboI s , absoI ul e
exl ernaI r ef er ences, and r ogr am uni l s.
P3O3O !#2&'.:0:(=
S o me of l he l echni caI l er ms us ed i n l hi s chal er are exI ai ned beI ov.
JX9#2.)0 G#>#2#.D#5
You can us e a na me lo seci f y a r ef er ence be l ve e n sear al e r ogr am uni l s.
The dal a sl rucl ure I el s you have a na me I onger l han 16M byl es , aI l hough l he
I i nker resl ri cls na me s lo 255 characl ers. Whe n you I i nk l he ob| ecl fiIes i nl o a
si ngI e I oad fi I e, you mus l ens ur e l hal aII exl ernaI r ef er ences mal c h c or r es ond-
i ng exl ernaI def i ni l i ons. The exl ernaI ref erence may be of byl e si ze, vor d, or
I ong vor d, exl ernaI def i ni l i ons ref er l o reI ocal abI e vaI ues, absoI ul e vaI ues , or
r esi denl I i brari es. ReI ocal abI e byl e and vor d r ef er ences ref er l o IC reI al i ve
addr es s mode s and l hese are enl i reI y handI ed by l he I i nker. Hove ve r , if you
have a r ogr am conl ai ni ng I ong vor d reI ocal abI e r ef er ences, reI ocal i on ma y
l ake I ace vhe n you I oad l he r ogr am.
Nol e l hal l hes e si zes onI y ref er l o l he I engl h of l he reI ocal i on fi eI d, il i s
ossi bI e l o I oad a vor d f r om a I ong exl ernaI addr ess, f or examI e, and l he
I i nker ma ke s no al l eml lo check l hal you are consi sl enl i n your us e of
exl ernaI s.
+K1#D9 R'0#
An as s embI er or comi I er r oduces a bi nary i mage, caI I ed an ob| ecl fi I e.
An ob| ecl fiIe conl ai ns one or mor e r ogr am uni l s. Il ma y aI so conl ai n
exl ernaI r ef er ences l o ol her ob| ecl fi I es.
B:)8 R'0#
The I i nker r oduces a bi nary i mage f r om a numbe r of ob| ecl fi I es. Thi s
bi nar y i mage is caI I ed a I oad fiIe. A I oad fiIe does nol conl ai n any
unr es oI ved exl ernaI r ef er ences.
;2:(2)& 4.'9
A r ogr am uni l i s l he smaI I esl eI emenl l he I i nker c an handI e. A r o-
gr am uni l can conl ai n one or mor e hunks , ob| ecl fiIes can conl ai n one or
mor e r ogr am uni l s. If l he I i nker f i nds a sui l abI e exl ernaI r ef er ence
vi l hi n a r ogr am uni l vhe n il i nsecl s l he s c anned I i brari es, il i ncI udes
l he enl i re r ogr am uni l i n l he I oad fi I e. An as s embI er usuaI I y r oduc es a
si ngI e r ogr am uni l f r om one as s embI y ( conl ai ni ng one or mor e hunks ) , a
comi I er s uch as I ORTRAN r oduces a r ogr am uni l f or each s ubr oul i ne,
mai n r ogr am, or I ock Dal a. Hunk numbe r i ng sl arl s f r om zer o vi l hi n
AMIGA BINARY FILE 5TRUCTURE 245
each r ogr am uni l , l he onI y vay you can ref erence ol her r ogr am uni l s is
l hr ough exl ernaI r ef er ences.
@/.M5
% hunk consi sl s of a bI ock of code or dal a, reI ocal i on i nf or mal i on, and a I i sl
of def i ned or r ef er enced exl ernaI symboI s. Dal a hunks ma y seci f y i ni l i aI i zed
dal a or uni ni l i aI i zed dal a ( bss) . bss hunks ma y conl ai n exl ernaI def i ni l i ons
bul no exl ernaI r ef er ences nor any vaI ues requi ri ng reI ocal i on. If you I ace
i ni li aI i zed dal a bI ocks i n overI ays, l he I i nker shouI d nol nor maI I y aI l er l hes e
dal a bI ocks , si nce il reI oads l he m f r om di sk dur i ng l he overI ay r oces s . Hunks
ma y be na me d or unna me d, and l hey ma y conl ai n a s ymboI l abI e i n or der lo
r ovi de s ymboI i c debuggi ng i nf or mal i on. The y ma y aI so conl ai n f ur l her
debuggi ng i nf or mal i on for l he us e of hi gh I eveI I anguage debuggi ng l ooI s.
Iac h hunk vi l hi n a r ogr am uni l has a numbe r , sl arl i ng f r om zer o.
G#5'8#.9 B'K2)2=
Load fiIes are aI so knovn as " I i br ar i es " . Load fiIes ma y be r esi denl i n me m-
ory, aI l ernal i veI y, l he oeral i ng s ys l em may I oad l he m as arl of l he " I i br ar y
o e n " caII. You can ref erence r esi denl I i brari es l hr ough exl ernaI r ef er ences, l he
def i ni l i ons are i n a hunk conl ai ni ng no code, | us l a Iisl of r esi denl I i brary
def i ni l i ons. UsuaI I y, l o r oduc e l hese hunks , you as s embI e a fiIe conl ai ni ng
nol hi ng bul absoI ul e exl ernaI def i ni l i ons and l hen as s il l hr ough a seci aI
sof l vare l ooI l o conver l l he absoI ul e def i ni l i ons l o r esi denl I i brary def i ni l i ons.
The I i nker us es l he hunk na me as l he na me of l he r esi denl I i brary, and il
as s es l hi s l hr ough i nl o l he I oad fiIe so l hal l he I oader can oe n l he r esi denl
I i brary bef or e us e.
,D)..#8 B'K2)2=
% s c anned I i brary consi sl s of ob| ecl fiIes l hal conl ai n r ogr am uni l s vhi c h
are onI y I oaded if l her e are any oul sl andi ng exl ernaI r ef er ences lo l he m. Yo u
ma y us e ob| ecl fiIes as I i brari es and r ovi de l he m as r i mar y i nul l o l he
I i nker, i n vhi c h case l he i nul i ncI udes aII l he r ogr am uni l s l he ob| ecl fiIes
conl ai n. Nol e l hal you ma y concal enal e ob| ecl fi I es.
S:8#
% node consi sl s of al I easl one hunk. An overI ai d I oad fiIe conl ai ns a r ool
node , vhi c h is r esi denl i n me mor y aII l he l i me l hal l he r ogr am is r unni ng,
and a numbe r of overI ay node s vhi c h are br oughl i nl o me mor y as r equi r ed.
246 AMIGADO5 TECHNICAL REFERENCE MANUAL
#"# +K1#D9 R'0# ,92/D9/2#
An ob| ecl fiIe is l he oul ul of l he as s embI er or a I anguage l ransI al or. To us e an
ob| ecl fi I e, you mus l firsl resoI ve aII l he exl ernaI r ef er ences. To do l hi s, you
as s l he ob| ecl fiIe l hr ough l he I i nker. An ob| ecl fiIe consi sl s of one or mor e
r ogr am uni l s. Iach r ogr am uni l slarls vi l h a header and is f oI I oved by a
seri es of hunks | oi ned e nd l o e nd, each of vhi c h conl ai ns a numbe r of " bI o c ks "
of vari ous l yes . Iach bI ock slarls vi l h a I ong vor d vhi c h def i nes ils l ye, and
l hi s is f oI I oved by zero or mor e addi l i onaI I ong vor ds . Nol e l hal each bI ock is
aI vays r ounde d u lo l he near esl I ong vor d boundar y. The r ogr am uni l
header is aI so a bI ock vi l h l hi s f or mal .
The f or mal of a r ogr am uni l is as f oI I ovs:
Ir ogr am uni l header bI ock
hunks
The basi c f or mal of a hunk is as f oI I ovs:
hunk na me bI ock
ReI ocal abI e bI ock
ReI ocal i on i nf or mal i on bI ock
Ixl ernaI s ymboI i nf or mal i on bI ock
SymboI l abI e bI ock
De bug bI ock
Ind bI ock
You ma y omi l aII l hese bI ock l yes, excel l he e nd bI ock.
The f oI I ovi ng subsecl i ons descri be l he f or mal of each of l hes e bI ocks. The
vaI ue of l he l ye vor d aear s i n deci maI and hex af l er l he l ye na me , for
examI e, h u n k _ u n i l has l he vaI ue 999 i n deci maI and 3I7 i n hex.
2. 2. 2 "/.Mn/.'9 iggg`QJUd
Thi s seci f i es l he slarl of a r ogr am uni l . Il consi sl s of a l ye vor d, f oI I oved
by l he I engl h of l he uni l na me i n I ong vor ds , f oI I oved by l he na me i lseI f
added l o a I ong vor d boundar y vi l h zer os, if requi red. I n di agramal i c f or m,
l he f or mal is as f oI I ovs:
AMIGA BINARY FILE 5TRUCTURE 247
hunk uni l
_ _ N _ _
N
I ong vor ds
of
na me
Figurc 2-A: hunk_unit (999/3E7)
2. 2. 2 "/.Mo.)&# iOhhh`QJed
Thi s def i nes l he na me of a hunk. Na me s are ol i onaI , if l he I i nker f i nds
l vo or mor e na me d hunks vi l h l he s ame na me , il c ombi nes l he hunks i nl o a
si ngI e hunk. Nol e l hal 8- or 16-bi l r ogr am counl er reI al i ve exl ernaI ref er-
enc es can onI y be r esoI ved be l ve e n hunks vi l h l he s ame na me . Any exl er naI
r ef er ences i n a I oad f ormal fiIe are be l ve e n di f f erenl hunks and requi re 32-
bi l r eI ocal abI e r ef er ences , aI l hough, as l he I oader scal l er I oads l he hunks
i nl o me mor y, you c annol as s ume l hal l hey are vi l hi n 32K of each ol her .
Nol e l hal l he I engl h is i n I ong vor ds and l he na me bI ock, I i ke aII bI ocks ,
i s r ounde d u l o a I ong vor d boundar y by addi ng vi l h zer os. The f or mal i s
as f oI I ovs:
hunk na me
N
N
I ong vor ds
of
na me
Figurc 2-B: hunk_namc (1000/3E8)
2. 2. 3 "/.MmD:8# iOhhO`QJgd
Thi s def i nes a bI ock of code l hal is lo be I oaded i nl o me mor y and ossi bI y
r eI ocal ed. Ils f or mal is as f oI I ovs:
248 AMIGADO5 TECHNICAL REFERENCE MANUAL
hunk code
N
N
I ong vor ds
of
code
Figurc 1-C: hunk_cndc (1001/3E9)
2. 2. 4 "/.Mo8)9) iOhhP`QJ%d
Thi s def i nes a bI ock of i ni li aI i zed dal a vhi c h is l o be I oaded i nl o me mor y and
ossi bI y r eI ocal ed. The I i nker shouI d nol aI ler l hese bI ocks if l hey are arl of
an overI ay node , as il ma y ne e d lo reread l he m f r om di sk dur i ng overI ay
handI i ng. The f or mal is as f oI I ovs:
hunk dal a
N
N
I ong vor ds
of
dal a
Figurc 1-D: hunk_data (1002/3EA)
2. 2. 5 "/.MmK55 iOhhQ`QJWd
Thi s seci f i es a bI ock of uni ni l i aI i zed vor ks ac e vhi c h is aI I ocal ed by l he
I oader, bs s bI ocks are us ed for such l hi ngs as sl acks and f or I ORT RAN
C O M M O N bI ocks. Il is nol ossi bI e l o reI ocal e i nsi de a bss bI ock, bul s ymboI s
can be def i ned vi l hi n one. Ils f or mal is as f oI I ovs:
hunk bs s
N
Figurc 1-E: hunk_bss (1003/3EB)
AMIGA BINARY FILE 5TRUCTURE 249
vhe r e N is l he si ze of bI ock you requi re i n I ong vor ds . The me mor y us ed f or
bs s bI ocks is zer oed by l he I oader vhe n il is aI I ocal ed.
The reI ocal abI e bI ock vi l hi n a hunk mus l be one of hunk c ode, hunk
dal a, or hunk bs s .
2. 2. 6 "/.Mo2#0:DQP iOhhV`QJ?d
% hunk reI oc32 bI ock seci f i es 32-bi l reI ocal i on l hal l he I i nker is l o er f or m
vi l hi n l he currenl reI ocal abI e bI ock. The reI ocal i on i nf ormal i on is a r ef er ence lo
a I ocal i on vi l hi n l he currenl hunk or any ol her vi l hi n l he r ogr am uni l . Iac h
hunk vi l hi n l he uni l is number ed, slarling f rom zero. The I i nker adds l he address
of l he base of l he seci fi ed hunk lo each of l he I ong vor ds i n l he recedi ng reI o-
calabIe bI ock lhal l he Iisl of offsels i ndi cales. The offsel Iisl onI y i ncI udes ref erenced
hunks and a counl of zer o i ndi cal es l he e nd of l he I i sl. Ils f or mal is as f oI I ovs:
hunk reI oc32
N!
Hunk Numbe r 1
N I
of f sel s
_ N2 _
Hunk Numbe r 2
N2
of f sel s
_Nn_
Hunk Numbe r n
Nn
of f sel s
Figurc 2-F: hunk_rcInc32 (1004/3EC)
250 AMIGADO5 TECHNICAL REFERENCE MANUAL
2. 2. 7 "/.Mm2#0:D0Z iOhhT`QJ*d
A hunk reI oc 16 bI ock seci fi es 16-bil reI ocal i on l hal l he I i nker shouI d er f or m
vi l hi n l he cur r enl reI ocal abI e bI ock. The reI ocal i on i nf or mal i on ref ers l o 16 bi l
r ogr am counl er reI al i ve r ef er ences lo ol her hunks i n l he r ogr am uni l . The
f or mal i s l he s ame as hunk reI oc32 bI ocks. The s e r ef er ences mus l be l o hunks
vi l h l he s ame na me , so l hal l he I i nker can er f or m l he reI ocal i on vhi I e il
coaguI al es (lhal i s, gal her s l ogel her) si mi I arI y na me d hunks .
P3P3e "/.Mo2#0:De iOhhZ`QJJd
% hunk reI oc8 bI ock seci f i es 8-bil reI ocal i on l hal l he I i nker s houI d er f or m
vi l hi n l he cur r enl reI ocal abI e bI ock. The reI ocal i on i nf or mal i on ref ers lo 8-bil
r ogr am counl er reI ali ve r ef er ences l o ol her hunks i n l he r ogr am uni l . The
f or mal is l he s ame as hunk reI oc32 bI ocks. Thes e r ef er ences mus l be l o hunks
vi l h l he s ame na me , so l hal l he I i nker can er f or m l he reI ocal i on vhi I e il
coaguI al es si mi I arI y na me d hunks .
P3P3g "/.Mm#X9 iOhhU`QJRd
Thi s bI ock conl ai ns exl ernaI s ymboI i nf ormal i on. Il conl ai ns enl ri es bol h def i n-
i ng s ymboI s and I i sl i ng r ef er ences l o l hem. Ils f or mal is as f oI I ovs:
I hunk exl I
I SymboI I
I dal a I
I uni l I
I SymboI I
I dal a I
I uni l I
0
Figurc 2-G: hunk_cxt (1007/3EF)
vhe r e l her e is one " s ymboI dal a uni l " f or each symboI us ed, and l he bI ock e nds
vi l h a zer o vor d.
Iac h s ymboI dal a uni l consi sl s of a l ye byl e, l he s ymboI na me I engl h ( l hree
byl es ) , l he s ymboI na me i lseI f, and f url her dal a. You seci f y l he s ymboI na me
I engl h i n I ong vor ds , and ad l he na me fi eI d lo l he nexl I ong vor d boundar y
vi l h zer os.
AMIGA BINARY FILE 5TRUCTURE 251
The l ye byl e seci f i es vhe l he r l he symboI is a def i ni l i on or a r ef er ence, and
so f orl h. Ami ga DOS us es vaI ues 0- 127 for symboI def i ni l i ons, and 128- 255 f or
r ef er ences.
Al l he mome nl , l he vaI ues are as f oI I ovs:
Na me Va I ue Me a ni ng
exl s ymb 0 SymboI l abI esee s ymboI bI ock beI ov
exl def 1 ReI ocal abI e def i ni l i on
exl abs 2 AbsoI ul e def i ni l i on
exl res 3 Resi denl I i brary def i ni l i on
e x l _ r e f 3 2 129 32-bi l r ef er ence l o s ymboI
exl c o mmo n 130 32-bi l r ef er ence l o C O M M O N
exl r e f I 6 131 16-bi l ref erence lo symboI
exl: ref 8 132 8-bil r ef er ence lo symboI
Tab!c 2-A: Extcrna! 5ymbn!s
The I i nker fauI ls aII ol her vaI ues. Ior exl def l here is one dal a vor d, l he
vaI ue of l he symboI . Thi s is mer eI y l he of f sel of l he s ymboI f r om l he sl arl of
l he hunk. Ior exl abs l her e is aI so one dal a vaI ue, vhi c h i s l he absoI ul e vaI ue
l o be added i nl o l he code. The I i nker l real s l he vaI ue for exl res i n l he s ame
vay as exl def , excel l hal il as s umes l he hunk name is l he Iibrary na me and il
coi es lhi s na me l hr ough lo l he I oad fi I e. The l ye byl es exl r ef 32, e xl r e f I 6 ,
and exl ref 8 are f oI I oved by a counl and a Iisl of r ef er ences, agai n seci f i ed as
of f sel s f r om l he slarl of l he hunk.
The l ye exl c ommon has l he same sl rucl ure excel l hal il has a C O M M O N
bI ock si ze bef or e l he counl . The I i nker l real s symboI s seci f i ed as c o mmo n i n
l he f oI I ovi ng vay: if il encounl er s a def i ni l i on f or a s ymboI r ef er enced as
c ommon, l hen il us es lhi s vaI ue ( l he onI y lime a def i ni l i on s houI d ari se is i n
l he I ORTRAN I ock Dal a case) . Ol her vi s e, il aI I ocal es sui l abI e bs s sace us i ng
l he ma x i mum si ze you seci f i ed f or each c ommon s ymboI r ef er ence.
The I i nker handI es exl ernaI r ef er ences di f f erenl I y accordi ng lo l he l ye of l he
cor r es ondi ng def i ni l i on. Il adds absoI ul e vaI ues lo l he I ong vor d, or byl e
fi eI d and gi ves an error if l he si gned vaI ue does nol fil. ReI ocal abI e 32-bi l
r ef er ences have l he symboI vaI ue added l o l he fi eI d and a reI ocal i on r ecor d is
r oduc ed f or l he I oader. 16- and 8-bil ref erences are handI ed as IC reI al i ve
r ef er ences and ma y onI y be ma de lo hunks vi l h l he s ame na me so l hal l he
hunks are coaguI al ed by l he I i nker bef or e l hey are I oaded. Il is aI so ossi bI e f or
IC reI ali ve r ef er ences l o faiI if l he ref erence and l he def i ni l i on are l oo far aarl .
The I i nker ma y onI y access r esi denl I i brary def i ni l i ons vi l h 32-bi l r ef er ences ,
vhi c h il l hen handI es as reI ocal abI e 32-bi l r ef er ences. The s ymboI dal a uni l
f or mal s are as f oI I ovs:
252
AMIGADO5 TECHNICAL REFERENCE MANUAL
exl def / abs/ res
Figurc 2-H: 5ymbn! Data Unit
I_ _ _ly_ I Na me Lengl h NL
NL I ong vor ds
of symboI na me
I SymboI vaI ue
exl __ref 32/ 16/ 8
l y } N a m e Lengl h NL
NL I ong vor ds
of symboI na me
Counl of r ef er ences NR
NL I ong vor ds
of symboI r ef er ences
exl c o mmo n
130 }_N_ame_Lenglh NL
NL I ong vor ds
of symboI na me
_Si ze_of c ommon bI ock
Counl of r ef er ences NR
NR I ong vor ds
of symboI r ef er ences
AMIGA BINARY FILE 5TRUCTURE 253
P3P3Oh "/.M5=&K:0 iOhhe`QRhd
You us e l hi s bI ock l o al l ach a s ymboI l abI e l o a hunk so l hal you can us e a
symboI i c debugger on l he code. The I i nker as s es symboI l abI e bI ocks l hr ough
al l ached l o l he hunk and, if l he hunks are coaguI al ed, coaguI al es l he s ymboI
l abI es. The I oader does nol I oad s ymboI l abI e bI ocks i nl o me mor y, vh e n l hi s i s
r equi r ed, l he debugger i s execl ed l o r ead l he I oad fi I e. The f or mal of l he
s ymboI l abI e bI ock is l he s ame as l he exl ernaI s ymboI i nf or mal i on bI ock vi l h
s ymboI l abI e uni l s for each na me you us e. The l ye code of zer o is us ed
vi l hi n l he s ymboI dal a uni l s. The vaI ue of l he symboI is l he offsel of l he symboI
f r om l he sl arl of l he hunk. Thus l he f or mal is as f oI I ovs:
hunk symboI
SymboI
dal a
uni l
I 0 I
Figurc 2-1: hunk_symbn! (1008/3F0)
vhe r e each s ymboI dal a uni l has l he f oI I ovi ng f ormal :
b l g3 b ^ L
2
" ? ^ l
e
i % _ \
I NL I ong vor ds I
I of symboI na me I
SymboI vaI ue
Figurc 2-J: 5ymbn! Data Unit
254
AMIGADO5 TECHNICAL REFERENCE MANUAL
P3P3OO "/.Moc#K/( iOhhg`QROd
Ami g a DOS r ovi des l he debug bI ock so l hal an ob| ecl fiIe can carry f ur l her
debuggi ng i nf or mal i on. Ior examI e, hi gh I eveI I anguage comi I er s ma y ne e d
l o mai nl ai n descri l i ons of dal a sl rucl ures for use by hi gh I eveI debugger s . The
debug bI ock ma y hoI d lhi s i nf ormal i on. Ami ga DOS does nol i mos e a f or mal
on l he de bug bI ock excel l hal il musl slarl vi l h l he hunk de bug I ong vor d
and be f oI I oved by a I ong vor d l hal i ndi cal es l he size of l he bI ock i n I ong vor ds .
Thus l he f or mal is as f oI I ovs:
hunk debug
N
N
I ong vor ds
of
debug dal a
Figurc 2-K: hunk_dcbug (1009/3F1)
P3P3OP "/.Moo#.8 iOhOh`QRPd
Thi s seci f i es l he e nd of a hunk. Il consi sl s of a si ngI e I ong vor d, hunk end.
P3Q B:)8 R'0#5
The f or mal of a I oad fiIe ( l hal i s, l he oul ul f r om l he I i nker) is si mi I ar l o l hal of
an ob| ecl fiIe. I n arl i cuI ar, il consi sl s of a numbe r of hunks vi l h a si mi I ar
f or mal l o l hos e i n an ob| ecl fiIe. The mai n di f f erence is l hal l he hunks never
conl ai n an exl ernaI symboI i nf or mal i on bI ock, as aII exl ernaI s ymboI s have
be e n r esoI ved, and l he r ogr am uni l i nf or mal i on is nol i ncI uded. I n a si mI e
I oad fiIe l hal is nol overI ai d, l he fiIe conl ai ns a header bI ock vhi c h i ndi cal es
l he lolaI numbe r of hunks i n l he I oad fiIe and any r esi denl I i brari es l he
r ogr am r ef er enced. Thi s bI ock i s f oI I oved by l he hunks , vhi c h ma y be l he
resuI l of coaguI al i ng a numbe r of i nul hunks if l hey had l he s ame name . Thi s
comI el e sl rucl ure is ref erred lo as a node . Load fiIes ma y aI so conl ai n overI ay
i nf or mal i on. I n l hi s case, an overI ay l abI e f oI I ovs l he r i mar y node , and a
seci aI br eak bI ock searal es l he overI ay nodes . Thus l he I oad fiIe sl rucl ure can
be s ummar i zed as f oI I ovs, vhe r e l he i l ems mar ke d vi l h an asl eri sk () are
ol i onaI .
AMIGA BINARY FILE 5TRUCTURE 255
Ir i mar y node
Over I ay l abI e bI ock ()
Over I ay node s sear al ed by br eak bI ocks ()
The reI ocal i on bI ocks vi l hi n l he hunks are aI vays of l ye hunk reI oc32, and
i ndi cal e l he reI ocal i on lo be er f or med al I oad l i me. Thi s i ncI udes bol h l he 32-
bi l reI ocal i on seci f i ed vi l h hunk reI oc32 bI ocks i n l he ob| ecl fiIe and exl ra
reI ocal i on requi red f or l he resoI ul i on of exl ernaI s ymboI s .
Iach exl ernaI r ef er ence i n l he ob| ecl fiIes is handI ed as f oI I ovs. The I i nker
sear ches l he r i mar y i nul f or a mal chi ng exl ernaI def i ni l i on. If il does nol f i nd
one , il sear ches l he s c anned I i brary and i ncI udes i n l he I oad fiIe l he enl i re
r ogr am uni l vher e l he def i ni l i on vas def i ned. Thi s ma y make f ur l her exl er-
naI r ef er ences be c ome oul sl andi ng. Al l he e nd of l he firsl as s , l he I i nker
knovs aII l he exl ernaI def i ni l i ons and l he lolaI numbe r of hunks l hal il is goi ng
l o us e . The s e i ncI ude l he hunks vi l hi n l he I oad fiIe and l he hunks associ al ed
vi l h l he r esi denl I i brari es. On l he s econd ass, l he I i nker al ches l he I ong vor d
exl ernaI r ef er ences so l hal l hey ref er lo l he requi red of f sel vi l hi n l he hunk
vhi c h def i nes l he symboI . Il r oduces an exl ra enl r y i n l he reI ocal i on bI ock so
l hal , vhe n l he hunks are I oaded, il adds lo each exl ernaI r ef er ence l he bas e
addr ess of l he hunk def i ni ng l he symboI . Thi s me c hani s m aI so vor ks f or
r esi denl I i brari es.
ef or e l he I oader can make l hese cr os s - hunk r ef er ences, il ne e ds lo kno v l he
numbe r and si ze of l he hunks i n l he nodes . The header bI ock r ovi des l hi s
i nf or mal i on, as descr i bed beI ov. The I oad fiIe may aI so conl ai n overI ay i nf or-
mal i on i n an overI ay l abI e bI ock. r eak bI ocks searal e l he overI ay nodes .
P3Q3O "/.Mm"#)8#2 iOhOO`QRQd
Thi s bI ock gi ves i nf or mal i on aboul l he numbe r of hunks l hal are lo be I oaded,
and l he si ze of each one. Il aI so conl ai ns l he na me s of any r esi denl I i brari es
vhi c h mus l be oe ne d vhe n l he node is I oaded.
The f or mal of l he hunk header is descri bed i n Ii gure 2- L. The firsl arl of
l he header bI ock conl ai ns l he na me s of r esi denl I i brari es l hal l he I oader mus l
oen vhe n lhi s node is I oaded. Iach name consi sl s of a I ong vor d i ndi cal i ng
l he I engl h of l he na me i n I ong vor ds and l he l exl na me added l o a I ong vor d
boundar y vi l h zer os . The na me Iisl ends vi l h a I ong vor d of zer o. The na me s
are i n l he order i n vhi c h l he I oader is l o oen l hem.
Wh e n il I oads a r i mary node, l he I oader aI I ocal es a l abI e i n me mor y vhi c h
il us es l o kee l rack of aII l he hunks il has I oaded. Thi s l abI e mus l be I arge
e nough for aII l he hunks i n l he I oad fi I e, i ncI udi ng l he hunks i n overI ays. The
I oader aI so us es l hi s l abI e l o kee a coy of l he hunk l abI es associ al ed vi l h a ny
r esi denl I i brari es. The nexl I ong vor d i n l he header bI ock is l her ef or e l hi s l abI e
si ze, vhi c h is equaI lo l he maxi mum hunk numbe r r ef er enced I us one.
256 AMIGADO5 TECHNICAL REFERENCE MANUAL
The nexl I ong vor d I ref ers lo l he firsl sI ol i n l he hunk l abI e l he I oader
shouI d us e vhe n I oadi ng. Ior a r i mar y node l hal does nol r ef er ence a
r esi denl I i brary, l hi s vaI ue is zero, ol her vi s e, il is l he numbe r of hunks i n l he
r esi denl I i brari es. The I oader coi es l hese enl ri es f r om l he hunk l abI e associ -
al ed vi l h l he I i brary f oI I ovi ng a I i brary oe n caII. Ior an overI ay node , l hi s
vaI ue is l he numbe r of hunks i n any r esi denl I i brari es I us l he numbe r of
hunks aI ready I oaded i n ancesl or nodes .
The nexl I ong vor d L ref ers lo l he I asl hunk sI ol l he I oader is l o I oad as arl
of l hi s I oader caI I . The l ol aI numbe r of hunks I oaded is l heref or e L - I + 1.
hunk header
_ N 1 _
N I I ong vor ds
of na me
_ N2 _
N2 I ong vor ds
of na me
0
TabI e si ze
Ii rsl Hunk I
Lasl Hunk L
L - I + 1
si zes
Iigure 2-L: hunk__header (1011/3I3)
The header bI ock conl i nues vi l h L - I + 1 I ong vor ds vhi c h i ndi cal e l he
si ze of each hunk vhi c h is lo be I oaded as arl of l hi s caII. Thi s enabI es l he
I oader l o reaI I ocal e l he sace f or l he hunks and henc e er f or m l he reI ocal i on
be l ve e n hunks vhi c h is requi red as l hey are I oaded. One hunk ma y be l he bss
hunk vi l h a si ze gi ven as zer o, i n l hi s case l he I oader us e s a n oer al i ng s ys l e m
vari abI e l o gi ve l he si ze as descri bed i n hunk bs s on age 248.
AMIGA BINARY FILE 5TRUCTURE 257
2. 3. 2 "/.M :C#20)= iOhOQ`QRTd
The overI ay l abI e bI ock i ndi cal es lo l he I oader l hal il is I oadi ng an overI ai d
r ogr am, and conl ai ns aII l he dal a f or l he overI ay l abI e. On enc ounl er i ng i l,
l he I oader sel s u l he l abI e, and r el ur ns, I eavi ng l he i nul c hanneI l o l he I oad
fiIe sliII oen. Ils f or mal is as f oI I ovs:
hunk overI ay
TabI e si ze
_ _ M + _ 2 _ _
M + 1
zeros
Over I ay
dal a
l abI e
Figurc 2-M: hunk_nvcrIay (1013/3F5)
The firsl I ong vor d is l he uer bound of l he comI el e over I ay l abI e (in
I ong vor ds ) .
M is l he ma xi mum I eveI of l he overI ay l ree us es vi l h l he rool I eveI bei ng
zer o. The nexl M + 1 vor ds f or m l he ordi nal e l abI e secl i on of l he overI ay
l abI e.
The resl of l he bI ock is l he overI ay dal a l abI e, a seri es of ei ghl - vor d enl r i es,
one f or each overI ay symboI . If 0 is l he ma xi mum overI ay numbe r us e d, l hen
l he si ze of l he overI ay dal a labI e is (0 + 1) 8, si nce l he firsl over I ay numbe r i s
zer o. So, l he overI ay l abI e si ze i s equaI lo (0 + 1)8 + M + 1.
P3Q3Q "/.MoK2#)M iOhOV`QRZd
% br eak bI ock i ndi cal es l he e nd of an overI ay node . Il consi sl s of a si ngI e
I ong vor d, hunk br eak.
#"( JX)&<0#5
The f oI I ovi ng si mI e secl i ons of code s hov hov l he I i nker and I oader handI e
exl ernaI s ymboI s . Ior examI e,
258 AMIGADO5 TECHNICAL REFERENCE MANUAL
I DNT A
X R I I I LLY, } O H N
X D I I MARY
The n e x l I ong vo r d r e qui r e s r e I o c a l i on
0 0 0 0 ' 0 0 0 0 0 0 0 8 DC. L I RI D
0 0 0 4 ' 1 2 3 C OOII MOVI. - $ I I , D 1
0 0 0 8 ' 7 0 0 1 I RI D MOVIQ - 1 , D 0
I x l e r n a I e n l r y o i nl
0 0 0 A ' 4 I 7 1 M A R Y NOI
0 0 0 C 4 I 9 0 0 0 0 0 0 0 0 } S R I L L Y CaI I e x l e r n a I
0 0 1 2 ' 2 2 3 9 0 0 0 0 0 0 0 0 M0 VI . L } OHN. D1 Re f e r e nc e e x l e r n a I
IND
r oduces l he f oI I ovi ng ob| ecl fiIe:
h u n k u n i l
0 0 0 0 0 0 0 1 Si ze i n I ong vo r ds
4 1 0 0 0 0 0 0 Na me , added l o I ong vo r d
h u n k code
0 0 0 0 0 0 0 6 Si ze i n I ong vo r ds
0 0 0 0 0 0 0 8 1 2 3 C 0 0 I I 7 0 0 1 4 I 7 1 4 I 9 0 0 0 0 0 0 0 0 2 2 3 9 0 0 0 0 0 0 0 0
h u n k - r e I o c 3 2
0 0 0 0 0 0 0 1 Numb e r i n h u n k 0
0 0 0 0 0 0 0 0 h u n k 0
0 0 0 0 0 0 0 0 Of f sel l o be r e I oc a l e d
0 0 0 0 0 0 0 0 Zer o l o m a r k e nd
h u n k e x l
0 1 0 0 0 0 0 1 XDI I , Si ze 1 I ong vo r d
4 D 4 1 5 2 5 9 M A R Y
0 0 0 0 0 0 0 A Of f sel of de f i ni l i on
8 1 0 0 0 0 0 1 X R I I , Si ze 1 I ong vo r d
4 A 4 I 4 8 4 I } O H N
0 0 0 0 0 0 0 1 Numb e r of r e f e r e nc e s
0 0 0 0 0 0 1 4 Of f sel of r e f e r e nc e
8 1 0 0 0 0 0 2 X R I I , Si ze 2 I ong vo r ds
4 2 4 9 4 C 4 C I L L Y
5 9 0 0 0 0 0 0 ( z e r o s l o a d)
0 0 0 0 0 0 0 1 Numb e r of r e f e r e nc e s
0 0 0 0 0 0 0 I Of f sel of r e f e r e nc e
0 0 0 0 0 0 0 0 I n d of e x l e r n a I b I o c k
h u n k e nd
The mal c hi ng r ogr am lo l hi s is as f oI I ovs:
AMIGA BINARY FILE 5TRUCTURE
259
I DNT
X D I I
X R I I

I L L Y , } 0 H N
M A R Y
0 0 0 0 ' 2 A3 C AAAA AAAA
I x l e r n a I e n l r y o i nl
0 0 0 6 ' 4 I 7 1
I x l e r n a I e n l r y o i nl
0 0 0 8 ' 7 2 0 1
CaI I e x l e r n a I r e f e r e nc e
0 0 0 A ' 4 I I 9 0 0 0 0 0 0 0 0
M0 VI . L - $ AAAAAAAA} D5
I L L Y NOI
} OHN" MOVIQ - 1 , D 1
} M I M A R Y
IND
and l he cor r es ondi ng oul ul code vouI d be:
Si ze i n I ong vo r ds
Uni l n a m e
h u n k u n i l
0 0 0 0 0 0 0 1
4 2 0 0 0 0 0 0
h u n k code
0 0 0 0 0 0 0 4 Si ze i n I ong vo r ds
2 A3 CAAAA AAAA4 I 7 1 7 2 0 1 4 I I 9 0 0 0 0 0 0 0 0
h u n k e x l
XDI I , Si ze 1 I ong vo r d
} O H N
Of f sel of def i ni l i on
X D I I , Si ze 2 I ong vo r ds
I L L Y
( z e r o s l o a d)
Of f sel of def i ni l i on
X R I I , Si ze 1 I ong vo r d
M A R Y
Numb e r of r e f e r e nc e s
Of f sel of r e f e r e nc e
I n d of e x l e r n a I b I o c k
0 1 0 0 0 0 0 1
4 A 4 I 4 8 4 I
0 0 0 0 0 0 0 8
0 1 0 0 0 0 0 2
4 2 4 9 4 C 4 C
5 9 0 0 0 0 0 0
0 0 0 0 0 0 0 6
8 1 0 0 0 0 0 1
4 D 4 1 5 2 5 9
0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 C
0 0 0 0 0 0 0 0
h u n k e nd
Onc e you as s ed l hi s l hr ough l he I i nker, l he I oad fiIe vouI d have l he
f oI I ovi ng f or mal :
h u n k h e a de r
0 0 0 0 0 0 0 0 No h u n k n a m e
0 0 0 0 0 0 0 2 Si ze of h u n k l abI e
0 0 0 0 0 0 0 0 I i r s l h u n k
0 0 0 0 0 0 0 1 La s l h u n k
260 AMIGADO5 TECHNICAL REFERENCE MANUAL
5izc nI hunk 0
5izc nI hunk 1
00000006
00000004
hunk cndc
00000006 5izc nI cndc in !nng wnrds
00000008 123C00FF 70014E71 4EB90000 00062239 00000008
hunk rc!nc32
00000001
00000000
00000000
00000002
00000001
00000014
0000000E
00000000
hunk cnd
hunk cndc
00000004 5izc nI cndc in !nng wnrds
2A3CAAAA AAAA4E71 72014EF9 0000000A
hunk rc!nc32
Numbcr in hunk 0
hunk 0
OIIsct tn bc rc!ncatcd
Numbcr in hunk 1
hunk 1
OIIsct tn bc rc!ncatcd
OIIsct tn bc rc!ncatcd
Zcrn tn mark cnd
00000001
00000000
0000000C
00000000
hunk cnd
Numbcr in hunk 0
hunk 0
OIIsct tn bc rc!ncatcd
Zcrn tn mark cnd
Wh e n l he I oader I oads l hi s code i nl o me mor y, il r eads l he header bI ock and
aI I ocal es a hunk l abI e of l vo I ong vor ds . Il l hen aI I ocal es sace by caI I i ng an
oer al i ng s ys l em r oul i ne a nd r equesl i ng l vo ar eas of si zes 6 and 4 I ong vor ds
resecl i veI y. As s umi ng l he l vo areas il r el ur ned ver e al I ocal i ons 3000 and
7000, l he hunk l abI e vouI d conl ai n 3000 and 7000.
The I oader r eads l he firsl hunk and I aces l he code al 3000, il l hen handI es
reI ocal i on. The firsl i l em seci f i es reI ocal i on vi l h resecl l o hunk 0, so il adds
3000 lo l he I ong vor d al offsel 0 converl i ng l he vaI ue sl ored l here f r om 00000008
l o 00003008. The s ec ond i l em seci f i es reI ocal i on vi l h r es ecl l o hunk 1.
AI l hough l hi s is nol I oaded, ve knov l hal il vi I I be I oaded al I ocal i on 7000, so
l hi s is added lo l he vaI ues sl ored al 300I and 3014. Nol e l hal l he I i nker has
aI ready i nser l ed l he of f sel s 00000006 and 00000008 i nl o l he r ef er ences i n hunk
0 so l hal l hey ref er l o l he correcl of f sel i n hunk 1 for l he def i ni l i on. Thus l he
I ong vor ds seci f yi ng l he exl ernaI r ef er ences e nd u conl ai ni ng l he vaI ues
00007006 and 00007008, vhi c h i s l he correcl I ace onc e l he s ec ond hunk i s
I oaded.
I n l he s ame vay, l he I oader I oads l he s econd hunk i nl o me mor y al I ocal i on
AMIGA BINARY FILE 5TRUCTURE
261
7000 and l he reI ocal i on i nf or mal i on seci f i ed aI lers l he I ongvor d al 700C f r om
0000000A ( l he of f sel of MARY i n l he firsl hunk) lo 0000300A ( l he addr es s of
MARY i n me mor y) .
The I oader handI es r ef er ences l o r esi denl I i brari es i n l he s ame vay, excel
l hal , af l er il has oened l he I i brary, il coi es l he I ocal i ons of l he hunks
comr i s i ng l he I i brary i nl o l he slarl of l he hunk l abI e. Il l hen al c hes ref er-
enc es lo l he r esi denl I i brary lo refer l o l he correcl I ace b y addi ng l he bas e of
l he I i brary hunks .
?")<9#2 Q
AmigaDOS Dala Slruclures
Thi s chal er descri bes Ami ga DOS dal a sl rucl ures i n me mor y and i n fi I es. Il
does nol descri be l he I ayoul of a di sk, vhi c h is descri bed i n Chal er 1.
3. 1 I nl r oducl i on
3. 2 Ir ocess Dal a Sl rucl ures
3. 3 GI obaI Dal a Sl rucl ure
3. 3. 1 I nf o Subsl r ucl ur e
3. 4 Me mor y AI I ocal i on
3. 5 Se gme nl Li sl s
3. 6 Ii I e HandI es
3. 7 Locks
3. 8 Iackel s
3. 8. 1 Iackel Tyes
Q3O H.92:8/D9':.
Ami g DOS r ovi des devi ce i ndeendenl i nul and oul ul . Il achi eves l hi s by
creal i ng a handI er r ocess f or each devi ce you us e. The handI er r oces s
accel s a sl andar d sel of I/O r equesl s and conver l s l hes e lo devi ce seci fi c
r equesl s vhe r e r equi r ed. AI I Ami ga DOS cI i enl s ref er lo l he handI er r ocess
r al her l han l he devi ce di recl I y, aI l hough il is ossi bI e lo us e a devi ce vi l houl
l he handI er if lhi s is requi red. Thi s chal er descri bes l he dal a sl rucl ures vi l hi n
Ami ga DOS , i ncI udi ng l he f or mal of a r ocess, cenl raI shar ed dal a sl r ucl ur es,
and l he sl rucl ure of handI er r equesl s.
I n addi l i on l o nor maI Ami ga vaI ues s uc h as L ONG and AITR, Ami ga DOS
us es ITR. ITR is a CIL oi nl er, vhi c h is a oi nl er lo a I ong vor d- aI i gned
me mor y bI ock di vi ded by 4. So, lo r ead a ITR i n C, you si mI y shi fl Iefl by 2.
To creal e a ITR, you mus l ei l her us e me mor y obl ai ned vi a a caII lo AI I oc Me m
or a sl rucl ure on your slack vhe n you knov you have onI y aI I ocal ed I ong vor ds
AMIGADO5 DATA 5TRUCTURE5
263
on l he sl ack so far ( l he iniliaI sl ack is I ong vor d aI i gned) . You shouI d l hen shi fl
l hi s oi nl er ri ghl by 2 lo creal e l he ITR.
Ami g a DOS aI so has a STR, vhi c h is a CIL sl ri ng. STR consi sl s of a
ITR l o me mor y l hal conl ai ns l he I engl h of l he sl ri ng i n l he firsl byl e, and l he
byl es vi l hi n l he sl ri ng f oI I ovi ng.
A numbe r of r ef er ences lo l he GI obaI Vecl or aear vi l hi n lhi s chal er . The
GI obaI Vecl or is a | um l abI e us ed by CIL and is a oi nl er l o a sl andar d
s har ed GI obaI Vecl or . S ome r oces s es, such as l he fiIe handI er , us e a ri val e
gI obaI vecl or .
The i ncI ude fiIes dos . h and dos exl ens . h conl ai n C I anguage def i ni l i ons f or
l he f oI I ovi ng sl rucl ures. The .i fiIes f or as s embI y I anguage.
Q3P ;2:D#55 *)9) ,92/D9/2#5
The s e vaI ues are creal ed as arl of an Ami ga DOS r ocess, l her e i s a c omI el e
sel f or each r oces s .
A r oces s i s a n Ixec l as k vi l h a numbe r of exl ra dal a sl r ucl ur es a e nde d.
The r oces s sl rucl ure consi sl s of:
Ixec l ask sl rucl ure
Ixec mes s age orl
Ami g a DOS r ocess vaI ues
The r ocess i denl i f i er Ami ga DOS uses i nl ernaI I y i s a oi nl er lo l he Ixec
me s s age or l ( f rom vhi c h l he Ixec l ask ma y be obl ai ned) .
Ami ga DOS r ocess vaI ues are as f oI I ovs:
Des c r i l i on
Ar r ay of SegLi sl s us ed by lhi s r oces s
Si ze of r ocess sl ack i n byl es
GI obaI Vecl or f or lhi s r ocess
CLI Task numbe r or zer o if nol a CLI
Ioi nl er lo hi gh me mor y end of r oces s sl ack
VaI ue of s econdar y resuI l f r om I asl caII
Lock associ al ed vi l h cur r enl di recl ory
Cur r enl CLI i nul sl r eam
Cur r enl CLI oul ul s l r eam
Cons oI e handI er r ocess for cur r enl vi ndov
IiIe handI er r ocess f or cur r enl dri ve
Ioi nl er lo addi l i onaI CLI i nf or mal i on
Ioi nl er l o r evi ous sl ackf r ame
Iuncl i on l o be caI I ed vhe n avai l i ng me s s age
Ioi nl er l o vi ndov
Va I ue Iunc l i on
ITR SegAr r ay
L ONG Sl ackSi ze
AITR GI obVec
L ONG Ta s kNum
ITR Sl ackase
L ONG I oIrr
ITR Cur r enl Di r
ITR CI S
ITR COS
AITR CoHa nd
AITR Ii Hand
ITR CLI Sl r ucl
AITR Rel ur nAddr
AITR Ikl Wai l
AITR Wi ndovIl r
264
AMIGADO5 TECHNICAL REFERENCE MANUAL
To i denl i f y l he s egmenl s l hal a arli cuI ar r ocess us es , you us e SegAr r ay.
SegAr r ay is an array of I ong vor ds vi l h i ls si ze i n SegAr r ay| 0j . Ol he r eI emenl s
are ei l her zer o or a ITR l o a SegLi sl . Cr eal eIr oc creal es l hi s array vi l h l he
firsl l vo eI emenl s of l he array oi nl i ng l o r esi denl code and l he l hi rd eI emenl
bei ng l he SegLi sl as s ed as ar gumenl . Whe n a r ocess l er mi nal es , Ir e e Me m is
us e d lo rel ur n l he sace f or l he SegAr r ay.
Sl ackSi ze i ndi cal es l he si ze of l he r ocess sl ack, as suI i ed by l he us er
vhe n caI I i ng Cr eal eIr oc. Nol e l hal l he r ocess sl ack is nol l he s ame as l he
c o mma nd sl ack a CLI uses vhe n il caIIs a r ogr am. The CLI obl ai ns ils
c omma nd sl ack | usl bef or e il r uns a r ogr am and you may aI ler l he si ze of l hi s
sl ack vi l h l he S TACK c omma nd. Wh e n you creal e a r oces s , Ami ga DOS
obl ai ns l he r oces s sl ack and sl ores l he si ze i n Sl ackSi ze. The oi nl er l o l he
s ace for l he r ocess conl roI bI ock and l he sl ack is aI so sl ored i n l he Me mInl r y
fi eI d of l he l ask sl rucl ure. Whe n l he r oces s l er mi nal es l hi s sace i s r el ur ned
vi a a caII l o Ir e e Me m. You can aI so chai n any me mor y you obl ai n i nl o l hi s Iisl
sl rucl ure so l hal il, l oo, gel s ul back vhe n l he l ask l er mi nal es.
If a caII lo Cr eal eIr oc creal es l he r ocess, GI obVec is a oi nl er lo l he Shar ed
GI obaI Vecl or. Hovever , s ome i nl ernaI handI er rocesses us e a ri vale GI obVec.
The vaI ue of Ta s kNum i s nor maI I y zero, a CLI r ocess sl ores l he smaI I
i nl eger l hal i denl i f i es l he i nvocal i on of l he CLI her e.
The oi nl er Sl ackas e oi nl s l o l he hi gh- me mor y end of l he r oces s sl ack.
Thi s is l he end of l he sl ack vhe n usi ng I anguages such as C or As s embI er , il is
l he base of l he sl ack for I anguages such as CIL.
The vaI ues of I oIrr and Cur r enl Di r are l hose handI ed by l he si mi I arI y na me d
Ami g a DOS caI I s. CI S and COS are l he vaI ues I nul and Oul ul rel urn and
ref er lo l he fiIe handI es you shouI d us e vhe n r unni ng a r ogr am under l he
CLI . I n ol her cases CI S and COS are zer o.
Co Ha nd and Ii Hand ref er l o l he consoI e handI er f or l he cur r enl vi ndov and
l he fiIe handI er f or l he cur r enl devi ce. You us e l hes e vaI ues vhe n al l eml i ng
l o oe n l he devi ce or a fiI e by a reI al i ve al h na me .
The CLI Sl r ucl oi nl er is nonzer o onI y for CLI r oces s es. I n l hi s case il ref ers
lo a f url her sl rucl ure l he CLI us es vi l h l he f oI I ovi ng f ormal :
Va I ue Iunc l i on Des c r i l i on
L ONG ResuI l 2 VaI ue of I oIrr f r om I asl c omma nd
S TR Se l Na me Na me of cur r enl di recl ory
ITR Comma ndDi r Lock associ al ed vi l h c omma nd di recl ory
L ONG Re l ur nCode Rel ur n code f r om I asl c omma nd
STR Co mma ndNa me Na me of cur r enl c omma nd
L ONG Iai I LeveI
IaiI I eveI (sel by IAI LAT)
STR Ir oml Cur r enl r oml (sel by IROMIT)
ITR Sl andar dI n Def auI l ( l ermi naI ) CLI i nul
ITR Cur r enl I n Cur r enl CLI i nul
AMIGADO5 DATA 5TRUCTURE5
265
Va I ue Iunc l i on
STR
CommandIi I e
L ONG I nl eracl i ve
L ONG ac kgr ound
ITR Cur r enl Oul
L ONG Def auI l Sl ack
ITR
Sl andar dOul
ITR
ModuI e
Des c r i l i on
Na me of IXICUTI c omma nd fiIe
ooI ean, Tr ue if r oml s r equi r ed
ooI ean, Tr ue if CLI creal ed by RUN
Cur r enl CLI oul ul
Sl ack si ze lo be obl ai ned (in I ong vor ds )
Def auI l ( l ermi naI ) CLI oul ul
SegLi sl of currenl I y I oaded c omma nd
The Ixi l f uncl i on uses l he vaI ue of Re l umAddr vhi c h oi nl s l o | us l above
l he r el urn addr ess on l he currenl I y acli ve sl ack. If a r ogr am exi ls by er f or m-
i ng an RTS on an eml y sl ack, l hen conl roI as s es lo l he code addr ess us he d
onl o l he sl ack by Cr eal eIr oc or by l he CLI . If a r ogr am l er mi nal es vi l h a caII
l o Ixi l, l hen Ami ga DOS us es l hi s oi nl er l o exl racl l he s ame r el ur n addr es s .
The vaI ue of Ikl Wai l is nor maI I y zero. If il is nonzer o, l hen Ami g a DOS caI I s
Ikl Wai l vhe ne ve r a r ocess is aboul lo go lo sI ee lo avai l a si gnaI i ndi cal i ng
l hal a me s s a ge has arri ved. I n l he s ame vay as Ge l Ms g, l he f uncl i on s houI d
rel urn a mes s age vhe n one is avai I abI e. UsuaI I y, you us e l hi s f uncl i on l o fiIler
oul any ri val e mes s ages arri vi ng al l he sl andar d r oces s mes s age or l l hal
are nol i nl ended f or Ami ga DOS .
The vaI ue of Wi ndovIl r is us ed vhe n Ami ga DOS del ecl s an error l hal
nor maI I y r equi r es l he us er l o l ake s ome acl i on. IxamI es of l hes e errors are
al l eml i ng lo vri l e lo a vri l e- rol ecl ed di sk, or vhe n l he di sk is fuI I . If l he
vaI ue of Wi ndovIl r is - 1 , l hen l he error is r el ur ned lo l he caI I i ng r ogr am as
an error code f r om l he Ami ga DOS caII of Oe n, Wr i l e, or vhal ever . If l he
vaI ue is zer o, l hen Ami ga DOS I aces a r equesl box on l he Wor kbe nc h s cr een
i nf or mi ng l he us er of l he error and rovi di ng l he oor l uni l y lo rel ry l he
oer al i on or lo canceI il. If l he us er seI ecl s canceI , l hen Ami g a DOS r el ur ns l he
error code lo l he caI I i ng r ogr am. If l he user seI ecl s rel ry, or i nser l s a di sk,
l hen Ami ga DOS al l eml s l he oeral i on onc e mor e.
If you I ace a osi l i ve vaI ue i nl o l he Wi ndovIl r f i eI d, l hen Ami g a DOS l akes
l hi s lo be a oi nl er lo a Wi ndov sl rucl ure. Nor maI I y you vouI d I ace l he
Wi ndo v sl rucl ure of l he vi ndov you are currenl I y us i ng her e. In lhi s cas e,
Ami ga DOS di sI ays l he error mes s age vi l hi n l he vi ndov you have seci f i ed,
ral her l han usi ng l he Wor kbe nc h screen. You can aI vays I eave l he Wi ndovIl r
fi eI d as zer o, bul if you are us i ng anol her scr een, l hen l he mes s ages Ami g a DOS
di sI ays aear on l he Wor kbenc h screen, ossi bI y obscured by your ovn screen.
The iniliaI vaI ue of Wi ndovIl r is i nheri l ed f r om l he r ocess l hal creal ed l he
cur r enl one . If you deci de l o aI ler Wi ndovIl r f r om vi l hi n a r ogr am l hal r uns
unde r l he CLI , l hen you shouI d save l he ori gi naI vaI ue and resl ore il vhe n you
f i ni sh, ol her vi s e, l he CLI r ocess conl ai ns a Wi ndovIl r l hal ref ers l o a
vi ndov l hal is no I onger r esenl .
266
AMIGADO5 TECHNICAL REFERENCE MANUAL
!"! 70:K)0 *)9) ,92/D9/2#
Thi s dal a sl rucl ure onI y exi sl s once, hovever , aII Ami ga DOS r oces s es us e il.
If you ma ke a caII l o OenLi br ar y, you can obl ai n l he I i brary bas e oi nl er . The
bas e of l he dal a sl rucl ure i s a osi l i ve offsel f r om l he I i brary bas e oi nl er . The
I i brary bas e oi nl er oi nl s l o l he f oI I ovi ng sl rucl ure:
Li brary No de sl rucl ure
AITR lo DOS Rool Node
AITR l o DOS Shar ed GI obaI Vecl or
DOS ri val e regi sl er dum
AI I i nl ernaI Ami ga DOS caIIs us e l he Shar ed GI obaI Vecl or , vhi c h is a | um
l abI e. You s houI d nol nor maI I y us e il, excel l hr ough l he suI i ed i nl erf ace
caI I s, as il i s I i abI e l o c hange vi l houl var ni ng.
The Rool Node sl rucl ure is as f oI I ovs:
Va I ue Iunc l i on
ITR TaskTabI e
ITR CLI SegLi sl
L ONG Days
L ONG Mi ns
L ONG Ti cks
ITR Res l ar l Seg
ITR I nf o
Des c r i l i on
Array of CLI r ocesses currenl I y r unni ng
SegLi sl for l he CLI
Numbe r of days i n cur r enl l i me
Numbe r of mi nul es i n cur r enl l i me
Numbe r of li cks i n currenl l i me
SegLi sl f or l he di sk vaI i dal or r oces s
Ioi nl er l o l he I nf o subsl rucl ure
The Tas kTabI e i s an array vi l h l he si ze of l he array sl ored i n TaskTabI e| 0j .
The r ocessi d (i n ol her vor ds , l he Ms gIor l associ al ed vi l h l he r oces s ) f or
each CLI is sl ored i n l he array. The rocess i d for l he CLI vi l h Ta s kNum " n " is
sl or ed i n Tas kTabI e| nj . An eml y sI ol is fi I I ed vi l h a zero. The c omma nds
R U N and NIWCLI scan l he Tas kTabI e lo i denl i f y l he nexl f ree sI ol , and us e
l hi s as l he Ta s kNum for l he CLI creal ed.
The CLI SegLi sl is l he SegLi sl for l he c ode of l he CLI . RUN and NIWCLI us e
l hi s vaI ue l o creal e a ne v i nsl ance of a CLI .
The r ool node sl ores l he currenl dal e and l i me, nor maI I y you s houI d us e l he
Ami g a DOS f uncl i on Dal eSl am l o r el ur n a consi sl enl sel of vaI ues. The vaI ues
Days , Mi ns , and Ti cks seci f y l he dal e and l i me. The vaI ue of Days i s l he
numbe r of days si nce } anuar y 1sl, 1978. The vaI ue of Mi ns i s l he numbe r of
mi nul es si nce mi dni ghl . A lick is one fi fli elh of a s ec ond, bul l he l i me is onI y
udal ed onc e er s ec ond.
The Res l ar l Seg i s l he SegLi sl f or l he c ode of l he di sk vaI i dal or, vhi c h i s a
r oces s l hal Ami ga DOS creal es vhe ne ve r you i nserl a ne v di sk i nl o a dri ve.
AMIGADO5 DATA 5TRUCTURE5
267
Q3Q3O H.>: ,/K592/D9/2#
To access a f url her subsl rucl ur e vi l h l he f oI I ovi ng f ormal , you us e l he I nf o
oi nl er .
Va I ue Iunc l i on
Des c r i l i on
ITR Mc Na me
Nel vor k na me of l hi s mac hi ne, currenl I y zer o
ITR
DevI nf o Devi ce Iisl
ITR Devi ces
Cur r enl I y zer o
ITR HandI er s Cur r enl I y zero
AITR Ne l Ha nd
Nel vor k handI er r oces s i d, currenl I y zer o
Mos l of l he fi eI ds i n l he I nf o subsl rucl ur e are eml y al l he mome nl , bul
Commodor e - Ami ga i nl end lo us e l he m f or exandi ng l he s ys l em.
The DevI nf o sl rucl ure is a I i nked Iisl. You us e il l o i denl i f y aII l he devi ce
na me s l hal Ami g a DOS knovs aboul , l hi s i ncI udes AS S I GNe d na me s and di sk
voI ume na me s . Ther e are l vo ossi bI e f or mal s f or l he Iisl enl ri es deendi ng on
vhe l he r l he enl r y ref ers lo a di sk voI ume or nol . Ior an enl r y descri bi ng a
devi ce or a di recl ory (via ASSI GN) l he enl ry is as f oI I ovs:
Va I ue Iunc l i on
Des cr i l i on
ITR Nexl
Ioi nl er lo nexl Iisl enl r y or zer o
L ONG Tye
Li sl enl r y l ye ( devi ce or dir)
AITR Tas k
HandI er r oces s or zer o
ITR Lock
IiIe s ys l em I ock or zer o
STR HandI er
Ii I e na me of handI er or zer o
L ONG Sl ackSi ze
Sl ack si ze f or handI er r ocess
L ONG Iri ori l y
Iri ori l y f or handI er r ocess
L ONG Sl ar l u
Sl arl u vaI ue lo be as s ed lo handI er r ocess
ITR SegLi sl
SegLi sl for handI er r ocess or zer o
ITR GI obVec
GI obaI Vecl or f or handI er r oces s or zer o
STR Na me
Na me of devi ce or AS S I GNe d na me
The Nexl fieId I i nks aII l he Iisl enl ri es l ogel her , and l he na me of l he I ogi caI
devi ce na me i s heI d i n l he Na me fi eI d.
The Tye fieId is 0 (dl devi ce) or 1 (dl di r). You can make a di recl ory enl ry
vi l h l he AS S I GN c omma nd. Thi s c omma nd aI I ocal es a na me lo a di recl ory l hal
you can l hen us e as a devi ce na me . If l he Iisl enl r y ref ers l o a di recl ory, l hen
l he TAS K ref ers l o l he fiIe s ys l em r ocess handI i ng l hal di sk, and l he Lock
fi eI d conl ai ns a oi nl er l o a I ock on l hal di recl ory.
If l he Iisl enl ry ref ers lo a devi ce, l hen l he devi ce ma y or ma y nol be
r esi denl . If il i s r esi denl , l he Tas k i denl i f i es l he handI er r ocess , a nd l he Loc k
268
AMIGADO5 TECHNICAL REFERENCE MANUAL
is nor maI I y zer o. If l he devi ce is nol resi denl , l hen l he TAS K is zer o and
Ami g a DOS us es l he r esl of l he I i sl sl rucl ure.
If l he SegLi sl is zer o, l hen l he code f or l he devi ce is nol i n me mor y. The
HandI er fi eI d is a sl ri ng seci f yi ng l he fiIe conl ai ni ng l he code (for examI e,
S YS : L/ RAM- HANDLIR) . A caII l o LoadSe g I oads l he c ode f r om l he fiIe a nd
i nser l s l he resuI l i nl o l he SegLi sl f i eI d.
AMi g a DOS nov creal es a ne v handI er r ocess vi l h l he SegLi sl , Sl ackSi ze,
and Iri vaI ues. The ne v r ocess i s a CIL r ocess and requi res a GI obaI
Vecl or , l hi s is ei l her l he vaI ue you seci f i ed i n GI obVec or a n e v ri val e gI obaI
vecl or if GI obVec is zer o.
The n e v r oc es s i s as s e d a me s s a ge c onl ai ni ng l he na me or i gi naI I y
seci f i ed, l he vaI ue sl ored i n Sl ar l u and l he base of l he Iisl enl r y. The
n e v handI er r ocess ma y l hen deci de l o al ch i nl o l he Tas k sI ol l he r oces s
i d or nol as r equi r ed. If l he Task sI ol is al c hed, l hen s ubs equenl ref er-
e nc e s l o l he devi ce na me us e l he s ame handI e r l ask, l hi s i s vha l l he
RAM: devi ce does . I f l he Tas k sI ol i s nol al c hed, l hen f ur l her r ef er ences
l o l he devi ce resuI l i n ne v r oces s i nvocal i ons, l hi s is vha l l he CON: devi ce
does .
If l he Tye fieId vi l hi n l he Iisl enl ry is equaI l o 2 (dl voI ume) , l hen l he f ormal
of l he Iisl sl rucl ure is sI i ghlI y di f f erenl .
Va I ue Iunc l i on Des c r i l i on
ITR Nexl
Ioi nl er l o nexl Iisl enl r y or zero
L ONG Tye
Li sl enl r y l ye ( voI ume)
AITR Tas k
HandI er r ocess or zer o
ITR Lock
Ii I e s ys l em I ock
L ONG VoI Days
VoI ume creal i on dal e
L ONG VoI Mi ns
L O N G VoI Ti cks
ITR LockLi sl
Li sl of acli ve I ocks for lhi s voI ume
L O N G Di s kTye Tye of di sk
L O N G Sar e Nol us ed
STR Na me VoI ume na me
I n l hi s cas e, l he Na me fi eI d is l he na me of l he voI ume, and l he Tas k fi eI d
ref ers l o l he handI er r ocess i f l he voI ume i s currenl I y i nser l ed, or l o zer o if l he
voI ume is nol i nser l ed. To di sl i ngui sh di sks vi l h l he s ame na me , Ami g a DOS
l i mes l ams l he voI ume on creal i on and l hen saves l he l i mes l am i n l he Iisl
sl rucl ure. Ami g DOS can l heref ore comar e l he l i mes l ams of di f f erenl voI -
ume s vhe ne ve r neces s ar y.
If a voI ume i s nol currenl I y i nser l ed, l hen Ami g a DOS s aves l he I i sl of cur-
renl I y acl i ve I ocks i n l he LockLi sl fi eI d. Il us es l he Di s kTye fi eI d lo i denl i f y
AMIGADO5 DATA 5TRUCTURE5
269
l he l ye of di sk. Cur r enl I y, l hi s is aI vays an Ami ga DOS di sk. The di sk l ye
is u l o f our characl ers acked i nl o a I ong vor d and adde d on l he ri ghl
vi l h nuI I s.
!"( -#&:2= %00:D)9':.
Ami ga DOS obl ai ns aII l he me mor y il aI I ocal es by caI I i ng l he AI I oc Me m f unc-
l i on r ovi ded by Ixec. I n l hi s va y, Ami ga DOS obl ai ns sl rucl ures s uc h as I ocks
and fiIe handI es , il usuaI I y I aces l hem bac k i n l he f ree ooI by caI I i ng
Ir e e Me m. Iac h me mor y s egmenl aI I ocal ed by Ami ga DOS is i denl i f i ed by a
ITR l o l he s ec ond I ong vor d i n l he sl rucl ure. The firsl I ong vor d aI vays
conl ai ns l he I engl h of l he enl i re s egmenl i n byl es. Thus l he sl rucl ure of
aI I ocal ed me mor y i s as f oI I ovs:
Va! uc Funct i nn Dcscri pt i nn
L O N G I ockSi ze Si ze of me mor y bI ock
L ONG Ii rsl Dal a Ii rsl dal a s egmenl , ITR lo bI ock oi nl s her e
!"% ,#(&#.9 B'595
To obl ai n a s e gme nl Iisl, you caII LoadSeg. The resuI l is a ITR l o aI I ocal ed
me mor y, s o l hal l he I engl h of l he me mor y bI ock conl ai ni ng eac h Iisl enl r y i s
sl ored al -4 f r om l he ITR. Thi s I engl h is 8 mor e l han l he si ze of l he s e gme nl
Iisl enl r y, aI I ovi ng f or l he I i nk fi eI d and l he si ze fi eI d i lseI f.
The SegLi s l is a Iisl I i nked l ogel her by ITRs and l er mi nal ed by zer o. The
r emai nder of each s e gme nl Iisl enl r y conl ai ns l he code I oaded. Thus l he f or mal
i s
Va! uc Funct i nn Dcscri pt i nn
L ONG Nexl Seg ITR lo nexl s egmenl or zer o
L ONG Ii r sl Code Ii rsl vaI ue f r om bi nary fiIe
!"& R'0# @).80#5
Ii I e handI es are creal ed by l he Ami ga DOS f uncl i on Oe n, and you us e l he m
as ar gumenl s l o ol her f uncl i ons s uc h as Re ad and Wr i l e. Ami g a DOS r el ur ns
l he m as a ITR lo l he f oI I ovi ng sl rucl ure:
270
AMIGADO5 TECHNICAL REFERENCE MANUAL
Va! uc
L O N G
L ONG
L ONG
ITR
L ONG
L ONG
AITR
AITR
AITR
L ONG
L O N G
Iunc l i on
Li nk
I nl eracl
Ir oces s I D
uf f er
Char Ios
uf Ind
Re adIunc
Wr i l eIunc
CI os eIunc
Ar g I
Ar g2
Des c r i l i on
Nol us ed
ooI ean, TRUI if i nl eracl i ve
Ir ocess i d of handI er r oces s
uf f er f or i nl ernaI us e
Char acl er osi l i on f or i nl ernaI us e
Ind osi l i on for i nl ernaI us e
Iuncl i on caI I ed vhe n buf f er exhaus l ed
Iuncl i on caI I ed vhe n buf f er fuII
Iuncl i on caI I ed vhe n handI e cI osed
Ar gumenl , de e nds on fiIe handI e l ye
Ar gumenl , deends on fiIe handI e l ye
Mos l of l he fi eI ds are onI y us ed by Ami ga DOS i nl ernaI I y, nor maI I y Read or
Wr i l e us es l he fi Ie handI e l o i ndi cal e l he handI er r ocess and any ar gumenl s l o
be as s ed. VaI ues shouI d nol be aI l ered vi l hi n l he fiIe handI e by us er r o-
gr ams , excel l hal l he firsl fieId may be us ed l o I i nk fiIe handI es i nl o a si ngI y
I i nked I i sl.
Thi s descri l i on does NOT mal c h dos exl ens . h or . i. Us e l he i ncI ude fiIe
i nf or mal i on i nsl ead.
!"' B:DM5
The fi I i ng s ys l em exl ensi veI y us es a dal a sl rucl ure caI I ed a I ock. Thi s sl rucl ure
ser ves l vo ur os es . Ii rsl , il serves as l he me c hani s m lo oen fiIes f or muI l i -
I e reads or a si ngI e vri l e. Nol e l hal obl ai ni ng a s har ed r ead I ock on a
di recl ory does nol sl o l hal di recl ory bei ng udal ed.
Se c ond, l he I ock r ovi des a uni que i denl i f i cal i on f or a fi I e. AI l hough a
arl i cuI ar fiIe ma y be seci f i ed i n ma ny vays , l he I ock is a si mI e handI e on
l hal fi I e. The I ock conl ai ns l he acl uaI di sk bI ock I ocal i on of l he di recl ory or fiIe
header and i s l hus a s hor l hand vay of seci f yi ng a arl i cuI ar fiIe s ys l em
ob| ecl . The sl rucl ure of a I ock is as f oI I ovs:
Va I ue Iunc l i on
Des c r i l i on
ITR Nexl Loc k
ITR l o nexl i n chai n, eI se zer o
L ONG Di skI ock
I ock numbe r of di recl ory or fiIe header
L O N G Ac c es s Tye
Shar ed or excI usi ve access
AITR Ir oces s I D
Ir ocess i d of handI er l ask
ITR VoI Node
VoI ume enl ry for lhi s I ock
ec aus e Ami ga DOS us es l he Nexl Loc k fi eI d lo chai n I ocks l ogel her , you
s houI d nol aI ler il. The fiIing s ys l em fiIIs i n Di skI ock fi eI d lo r er es enl l he
AMIGADO5 DATA 5TRUCTURE5
271
I ocal i on on di sk of l he di recl ory bI ock or l he fiIe header bI ock. The Ac c es s Tye
ser ves lo i ndi cal e vhe l he r l hi s i s a s har ed read I ock, vh e n il has l he vaI ue - 2,
or an excI usi ve vri l e I ock vhe n il has l he vaI ue - 1 . The Ir ocess I D fi eI d
conl ai ns a oi nl er l o l he handI er r ocess for l he devi ce conl ai ni ng l he fiIe l o
vhi c h l hi s I ock ref ers. Ii naI I y l he VoI Node fieId oi nl s lo l he node i n l he
DevI nf o sl rucl ure l hal i denl i f i es l he voI ume l o vhi c h l hi s I ock r ef er s. VoI ume
enl ri es i n l he DevI nf o sl rucl ure r emai n l here if a di sk is i nser l ed or if l her e are
any I ocks oe n on l hal voI ume.
Nol e l hal a I ock can aI so be a zero. The seci aI case of I ock zer o i ndi cal es
l hal l he I ock ref ers lo l he r ool of l he iniliaI fiIing s ys l em, and l he Ii Hand fi eI d
vi l hi n l he r oces s dal a sl rucl ure gi ves l he handI er r oces s.
Q3e ;)DM#95
Iackel as s i ng handI es aII c ommuni c al i on er f or med by Ami g a DOS be l ve e n
r oces s es . A ackel is a sl rucl ure bui I l on l o of l he mes s age- as s i ng me c ha -
ni s m r ovi ded by l he Ixec ker neI .
An Ixec me s s age is a sl rucl ure, descri bed eI s evher e, l hal i ncI udes a Na me
f i eI d. Ami ga DOS us es l he fieId as an AITR lo anol her secl i on of me mo r y
caI I ed a ackel . A ackel mus l be I ong vor d aI i gned, and has l he f oI I ovi ng
gener aI sl rucl ure.
Va I ue Iunc l i on
Des c r i l i on
AITR Ms gIl r
Ioi nl er bac k l o mes s age sl rucl ure
AITR Ms gIor l
Mes s age or l vhe r e l he r eI y s houI d be senl
L ONG Ikl Tye Iackel l ye
L ONG Re s I
Ii rsl resuI l fi eI d
L ONG Res 2
Sec ond resuI l fi eI d
L ONG Ar gI
Ar gumenl , de e nds on ackel l ye
L ONG Ar g2 Ar gumenl , deends on ackel l ye
L ONG Ar gN
Ar gumenl , de e nds on ackel l ye
The f or mal of a seci fi c ackel de e nds on ils l ye, bul i n aII cas es, il
conl ai ns a bac k oi nl er l o l he Me s s age sl rucl ure, l he Mgs Ior l f or l he r eI y,
and l vo resuI l f i eI ds. Wh e n Ami ga DOS s ends a ackel , l he r eI y orl is
over vr i l l en vi l h l he r ocess i denl i f i er of l he s ender so l hal l he ackel c an be
r el ur ned. Thus , vh e n s endi ng a ackel l o an Ami g a DOS handI er r oc es s , you
mus l fiII i n l he reI y Ms gIor l each l i me, ol her vi s e, vhe n l he ackel r el ur ns ,
Ami ga DOS has overvri l l en l he ori gi naI orl . Ami ga DOS mai nl ai ns aII ol her
f i eI ds excel l he resuI l f i eI ds.
AI I Ami ga DOS ackel s are senl lo l he mes s age orl cr eal ed as arl of a
272
AMIGADO5 TECHNICAL REFERENCE MANUAL
r ocess, l hi s mes s age orl is i ni li aI i zed so l hal arri vi ng mes s ages cause si gnaI 8
l o be sel . An Ami g a DOS r oces s vhi c h i s vai l i ng f or a me s s age vai l s f or
si gnaI 8 l o be sel . Wh e n l he r ocess vake s u bec aus e lhi s evenl has occur r ed,
Ge l Ms g l akes l he mes s age f r om l he mes s age orl and exl racl s l he ackel
addr es s . If l he r oces s is an Ami ga DOS handI er r oces s , l hen l he ackel
conl ai ns a vaI ue i n l he Ikl Tye fi eI d vhi c h i ndi cal es a n acl i on l o be er -
f or med, such as r eadi ng s ome dal a. The ar gumenl fi eI ds conl ai n seci fi c
i nf or mal i on such as l he addr es s and si ze of l he buf f er vhe r e l he characl ers
go-
Wh e n l he handI er r oces s has c omI el ed l he vor k r equi r ed l o sal i sf y l hi s
r eques l , l he ackel r el ur ns l o l he sender , us i ng l he s ame me s s age sl rucl ure.
ol h l he mes s age sl rucl ure and l he ackel sl rucl ure mus l be aI I ocal ed by l he
cI i enl and mus l nol be deaI I ocal ed bef or e l he reI y has be e n r ecei ved. Nor -
maI I y Ami g a DOS i s caI I ed by l he cI i enl l o s e nd l he ackel , s uc h as vh e n a caI I
l o Read is made . Hove ve r , l her e are cases vhe n as ync hr onous I O is r equi r ed,
and i n l hi s case l he cI i enl ma y s end ackel s l o l he handI er r oces s es as
r equi r ed. The ac kel a nd me s s a ge s l r ucl ur es mus l be aI I ocal ed, and l he
r ocessi d f i eI d fi I I ed i n vi l h l he me s s age or l vhe r e l hi s ackel mus l r el ur n.
A caII l o Iul Ms g l hen s e nds l he mes s age lo l he desl i nal i on. Nol e l hal ma ny
ackel s ma y be s enl oul r el ur ni ng l o ei l her l he s ame or di f f erenl me s s age
or l s.
Q3e3O ;)DM#9 !=<#5
Ami g a DOS s uor l s l he f oI I ovi ng ackel l yes . Nol aII l yes are vaI i d l o aII
handI er s , f or examI e a r e na me r eques l is onI y vaI i d l o handI er s s uor l i ng a
fi I i ng s ys l em. Ior each ackel l ye l he ar gumenl s and resuI l s are descr i bed.
The acl uaI deci maI code f or each l ye aear s nexl l o l he symboI i c na me . I n aII
cases, l he Res 2 fi eI d conl ai ns addi l i onaI i nf or mal i on concer ni ng an error (i ndi -
cal ed by a zer o vaI ue f or Re s I i n mos l cases) . To obl ai n l hi s addi l i onaI
i nf or mal i on, you can caII I oIrr vhe n maki ng a sl andar d Ami g a DOS caII.
Opcn O!d Fi!c
Typc LONG Actinn.PindInput ( 1005)
Arg! BPTR Fi!cHand!c
Arg2 BPTR Lnck
Arg3 B5TR Namc
Rcs! LONG Bnn!can
Al l eml s lo oen an exi sl i ng fiIe f or i nul or oul ul ( see l he f uncl i on Oe n
i n Chal er 2, " CaI I i ng Ami g a DOS , " of l he %&'()*+, *#C#0:<#265 -)./)0 i n l hi s
book f or f url her delai I s on oeni ng fi I es f or I / O) . To obl ai n l he vaI ue of I ock,
AMIGADO5 DATA 5TRUCTURE5
273
ynu ca!! DcviccPrnc tn nbtain thc hand!cr Prnccss!d and thcn InErr which
rcturns thc !nck. A!tcrnativc!y thc !nck and Prnccss!d can bc nbtaincd dircct!y
Irnm thc Dcv!nIn structurc. Nntc that thc !nck rcIcrs tn thc dircctnry nwning
thc Ii!c, nnt tn thc Ii!c itsc!I.
Thc ca!!cr must a!!ncatc and initia!izc Fi!cHand!c. This is dnnc by c!caring a!!
Iic!ds tn zcrn cxccpt Inr thc CharPns and BuIEnd Iic!ds which shnu!d bc sct tn
-1. Thc PrnccssID Iic!d within thc Fi!cHand!c must bc sct tn thc prnccss id nI
thc hand!cr prnccss.
Thc rcsu!t is zcrn iI thc ca!! Iai!cd, in which casc thc Rcs2 Iic!d prnvidcs mnrc
inInrmatinn nn thc Iai!urc and thc Fi!cHand!c shnu!d bc rc!cascd.
Opcn Ncw Fi!c
Typc LONG Actinn. FindOutput ( 1006)
Arg! BPTR Fi!cHand!c
Arg2 BPTR Lnck
Arg3 B5TR Namc
Rcs! LONG Bnn!can
Argumcnts as Inr prcvinus cntry.
Rcad
Typc LONG Actinn.Rcad ( 82)
Arg! BPTR Fi!cHand!c Arg!
Arg2 APTR BuIIcr
Arg3 LONG Lcngth
Rcs! LONG Actua! Lcngth
Tn rcad Irnm a Ii!c hand!c, thc prnccss id is cxtractcd Irnm thc PrnccssID
Iic!d nI thc Ii!c hand!c, and thc Arg! Iic!d Irnm thc hand!c is p!accd in thc Arg!
Iic!d nI thc packct. Thc buIIcr addrcss and !cngth arc thcn p!accd in thc nthcr
twn argumcnt Iic!ds. Thc rcsu!t indicatcs thc numbcr nI charactcrs rcadscc
thc Iunctinn Rcad Inr mnrc dctai!s. An crrnr is indicatcd by rcturning -1
whcrcupnn thc Rcs2 Iic!d cnntains mnrc inInrmatinn.
Writc
Typc LONG Actinn.Writc ( 87)
Arg! BPTR
Fi!cHand!c Arg!
Arg2 APTR BuIIcr
Arg3 LONG Lcngth
Rcs! LONG Actua! Lcngth
274
AMIGADO5 TECHNICAL REFERENCE MANUAL
Thc argumcnts arc thc samc as thnsc Inr Rcad. 5cc thc Writc Iunctinn Inr
dctai!s nI thc rcsu!t Iic!d.
C!nsc
Typc LONG Actinn.End ( 1007)
Arg! BPTR Fi!cHand!c Arg!
Rcs! LONG TRUE
Ynu usc this packct typc tn c!nsc an npcn Ii!c hand!c. Thc prnccss id nI thc
hand!cr is nbtaincd Irnm thc Ii!c hand!c. Thc Iunctinn nnrma!!y rcturns TRUE.
AItcr a Ii!c hand!c has bccn c!nscd, thc spacc assnciatcd with it shnu!d bc
rcturncd tn thc Ircc pnn!.
5cck
Typc LONG Act!nn.5cck ( 1008)
Arg! BPTR F!!cHand!c Arg!
Arg2 LONG Pnsitinn
Arg3 LONG Mndc
Rcs! LONG O!dPnsitinn
This packct typc cnrrcspnnds tn thc 5EEK ca!!. It rcturns tn thc n!d pnsitinn,
nr -1 iI an crrnr nccurs. Thc prnccss id is nbtaincd Irnm thc Ii!c hand!c.
WaitChar
Typc LONG Actinn.WaitChar ( 20)
Arg! LONG Timcnut
Rcs! LONG Bnn!can
This packct typc imp!cmcnts thc WaitFnrChar Iunctinn. Ynu must scnd thc
packct tn a cnnsn!c hand!cr prnccss, with thc timcnut rcquircd in Arg!. Thc
packct rcturns whcn cithcr a charactcr is waiting tn bc rcad, nr whcn thc
timcnut cxpircs. II thc rcsu!t is TRUE, thcn at !cast nnc charactcr may bc
nbtaincd by a subscqucnt READ.
ExamincOb| cct
Typc LONG Actinn.ExamincOb|cct ( 23)
Arg! BPTR Lnck
Arg2 BPTR Fi!c!nInB!nck
Rcs! LONG Bnn!can
AMIGADO5 DATA 5TRUCTURE5 275
This packct typc imp!cmcnts thc Examinc Iunctinn. It cxtracts thc prnccss id
nI thc hand!cr Irnm thc PrnccssID Iic!d nI thc !nck. II thc !nck is zcrn, thcn it
uscs thc dcIau!t Ii!c hand!cr, which is kcpt in thc FiHand Iic!d nI thc prnccss.
Thc rcsu!t is zcrn iI it Iai!s, with mnrc inInrmatinn in Rcs2. Thc Fi!c!nInB!nck
rcturns with thc namc and cnmmcnt Iic!ds as B5TRs.
ExamincNcxt
Typc LONG Actinn.ExamincNcxt ( 24)
Arg! BPTR Lnck
Arg2 BPTR Fi!c!nInB!nck
Rcs! LONG Bnn!can
This ca!! imp!cmcnts thc ExNcxt Iunctinn, and thc argumcnts arc simi!ar tn
thnsc Inr Examinc abnvc. Nntc that thc B5TR rcprcscnting thc Ii!cnamc must
nnt bc disturbcd bctwccn ca!!s nI ExamincOb|cct and diIIcrcnt ca!!s tn
ExamincNcxt, as it uscs thc namc as a p!acc savcr within thc dircctnry bcing
cxamincd.
Disk!nIn
Typc LONG Actinn.DiskInIn ( 25)
Arg! BPTR InInData
Rcs! LONG TRUE
This imp!cmcnts thc InIn Iunctinn. A suitab!c !nck nn thc dcvicc wnu!d
nnrma!!y nbtain thc prnccss id Inr thc hand!cr. This packct can a!sn bc scnt tn a
cnnsn!c hand!cr prnccss, in which casc thc Vn!umc Iic!d in thc InInData
cnntains thc windnw pnintcr Inr thc windnw npcncd nn ynur bcha!I by thc
cnnsn!c hand!cr.
Parcnt
Typc LONG Actinn.Parcnt ( 29)
Arg! BPTR Lnck
Rcs! LONG ParcntLnck
This packct rcturns a !nck rcprcscnting thc parcnt nI thc spcciIicd !nck, as
prnvidcd by thc ParcntDir Iunctinn ca!!. Again it must nbtain thc prnccss id nI
thc hand!cr Irnm thc !nck, nr Irnm thc FiHand Iic!d nI thc currcnt prnccss iI thc
!nck is zcrn.
276 AMIGADO5 TECHNICAL REFERENCE MANUAL
Dc!ctcOb|cct
Typc LONG Actinn.Dc!ctcOb|cct ( 16)
Arg! BPTR Lnck
Arg2 B5TR Namc
Rcs! LONG Bnn!can
This packct typc imp!cmcnts thc Dc!ctc Iunctinn. It must nbtain thc
!nck Irnm a ca!! tn InErr() immcdiatc!y In!!nwing a succcssIu! ca!! tn Dcvicc-
Prnc which rcturns thc prnccss id. Thc !nck actua!!y rcIcrs tn thc dircctnry
nwning thc nb|cct tn bc dc!ctcd, as in thc Opcn Ncw and Opcn O!d
rcqucsts.
CrcatcDir
Typc LONG Actinn.CrcatcDir ( 22)
Arg! BPTR Lnck
Arg2 B5TR Namc
Rcs! BPTR Lnck
This packct typc imp!cmcnts thc CrcatcDir Iunctinn. Argumcnts arc thc
samc as Inr Dc!ctcOb|cct. Thc rcsu!t is zcrn nr a !nck rcprcscnting thc ncw
dircctnry.
LncatcOb|cct
Typc LONG Actinn.LncatcOb|cct ( 8)
Arg! BPTR Lnck
Arg2 B5TR Namc
Arg3 LONG Mndc
Rcs! BPTR Lnck
This imp!cmcnts thc !nck Iunctinn and rcturns thc !nck nr zcrn. Argumcnts
as Inr CrcatcDir with thc additinn nI thc Mndc as Arg3. Mndc rcIcrs tn thc typc
nI !nck, sharcd nr cxc!usivc.
CnpyDir
Typc LONG Actinn.CnpyDir ( 19)
Arg! BPTR Lnck
Rcs! BPTR Lnck
AMIGADO5 DATA 5TRUCTURE5 277
This imp!cmcnts thc DupLnck Iunctinn. II thc !nck rcquiring dup!icatinn is
zcrn, thcn thc dup!icatc is zcrn. Othcrwisc, thc prnccss id is cxtractcd Irnm thc
!nck and this packct typc scnt. Thc rcsu!t is thc ncw !nck nr zcrn iI an crrnr was
dctcctcd.
FrccLnck
Typc LONG Actinn.FrccLnck ( 15)
Arg! BPTR Lnck
Rcs! LONG Bnn!can
This ca!! imp!cmcnts thc UnLnck Iunctinn. It nbtains thc prnccss id Irnm thc
!nck. Nntc that Irccing thc zcrn !nck takcs nn actinn.
5ctPrntcct
Typc LONG Actinn.5ctPrntcct ( 21)
Arg! Nnt uscd
Arg2 BPTR Lnck
Arg3 B5TR Namc
Arg4 LONG Mask
Rcs! LONG Bnn!can
This imp!cmcnts thc 5ctPrntcctinn Iunctinn. Thc !nck is a !nck nn thc nwning
dircctnry nbtaincd Irnm DcviccPrnc as dcscribcd Inr Dc!ctcOb|cct abnvc. Thc
!cast signiIicant Inur bits nI "Mask" rcprcscnt Rcad, Writc, Exccutc, and Dc!ctc
in that nrdcr. Dc!ctc is bit zcrn.
5ctCnmxncnt
Typc LONG Actinn.5ctCnmmcnt ( 28)
Arg! Nnt uscd
Arg2 BPTR Lnck
Arg3 B5TR Namc
Arg4 B5TR Cnmmcnt
Rcs! LONG Bnn!can
This imp!cmcnts thc 5ctCnmmcnt Iunctinn. Argumcnts as Inr 5ctPrntcct
abnvc, cxccpt that Arg4 is a B5TR rcprcscnting thc cnmmcnt.
278 AMIGADO5 TECHNICAL REFERENCE MANUAL
RcnamcOb|cct
Typc LONG Actinn.RcnamcOb|cct ( 17)
Arg! BPTR FrnmLnck
Arg2 BPTR FrnmNamc
Arg3 BPTR TnLnck
Arg4 BPTR TnNamc
Rcs! LONG Bnn!can
This imp!cmcnts thc Rcnamc Iunctinn. It must cnntain an nwning dircctnry
!nck and a namc Inr bnth thc snurcc and thc dcstinatinn. Thc nwning dircctnrics
arc nbtaincd Irnm DcviccPrnc as mcntinncd undcr thc cntry Inr thc Dc!ctcOb|cct.
Inhibit
Typc LONG Actinn.Inhibit ( 31)
Arg! LONG Bnn!can
Rcs! LONG Bnn!can
This packct typc imp!cmcnts a Ii!ing systcm npcratinn that is nnt avai!ab!c as
an AmigaDO5 ca!!. Thc packct cnntains a Bnn!can va!uc indicating whcthcr
thc Ii!ing systcm is tn bc stnppcd Irnm attcmpting tn vcriIy any ncw disks
p!accd intn thc drivc hand!cd by that hand!cr prnccss. II thc Bnn!can is
truc, thcn ynu may swap disks withnut thc Ii!csystcm prnccss attcmpting tn
vcriIy thc disk. Whi!c disk changc cvcnts arc inhibitcd, thc disk typc is
markcd as "Nnt a DO5 disk" sn that nthcr prnccsscs arc prcvcntcd Irnm
!nnking at thc disk.
II thc Bnn!can is Ia!sc, thcn thc Ii!c systcm rcvcrts tn nnrma! aItcr having
vcriIicd thc currcnt disk in thc drivc.
This rcqucst is uscIu! iI ynu wish tn writc a prngram such as DI5KCOPY
whcrc thcrc is much swapping nI disks that may havc a ha!I cnmp!ctcd
structurc. II ynu usc this packct rcqucst thcn ynu can avnid having crrnr mcssagcs
Irnm thc disk va!idatnr whi!c it attcmpts tn scan a ha!I cnmp!ctcd disk.
RcnamcDisk
Typc LONG Actinn.RcnamcDisk ( 9)
Arg! BFTR NcwNamc
Rcs! BPTR Bnn!can
Again, this imp!cmcnts an npcratinn nnt nnrma!!y avai!ab!c thrnugh a Iunc-
tinn ca!!. Thc sing!c argumcnt indicatcs thc ncw namc rcquircd Inr thc disk
currcnt!y mnuntcd in thc drivc hand!cd by thc Ii!csystcm prnccss whcrc thc
packct is scnt. Thc vn!umc namc is a!tcrcd bnth in mcmnry and nn thc disk.
?")<9#2 V
AmigaDOS AddilionaI
Informalion for lhe Advanced
DeveIoer
This chaptcr dcscribcs ccrtain tnpics which arc !ikc!y tn bc nI intcrcst tn thc
advanccd dcvc!npcr whn may wish tn crcatc ncw dcviccs tn bc addcd tn thc
Amiga nr whn wish thcir cndc tn run with Amiga cnmputcrs which havc bccn
cxpandcd bcynnd a 512K mcmnry sizc.
Thc In!!nwing tnpics arc cnvcrcd hcrc:
Ovcr!ay Hunk Dcscriptinn
Inr dcvc!npcrs putting tngcthcr !argc prngrams
ATOM uti!ity
wnrks nn a ncw binary Ii!c Inrmat tn changc a!!nw dcvc!npcr tn sct thc
apprnpriatc !nad bits. Assurcs that prngram cndc and data that must bc
rcsidcnt in CHIP mcmnry (thc !nwcst 512K nI thc systcm) Inr thc prngram
tn Iunctinn wi!! indccd bc p!accd thcrc by AmigaDO5 whcn it is !nadcd.
Othcrwisc thc prngram cndc may nnt wnrk nn an cxtcndcd mcmnry
machinc.
Linking in a ncw DI5K-dcvicc tn AmigaDO5
!cts a dcvc!npcr add a hard disk nr disk-!ikc dcvicc as a namc-addrcssab!c
part nI thc Ii!ing systcm.
Linking in a ncw nnn-disk-dcvicc tn AmigaDO5
!cts a dcvc!npcr add such things as additinna! scria! pnrts, para!!c! pnrts,
graphics tab!cts, RAM-disks nr what-havc-ynu tn AmigaDO5 (nnn Ii!ing
systcm rc!atcd).
Using AmigaDO5 withnut using Intuitinn
Inr dcvc!npcrs whn may prcIcr tn insta!! and usc thcir nwn scrccn han-
d!ing in p!acc nI that prnvidcd by Intuitinn.
280 AMIGADO5 TECHNICAL REFERENCE MANUAL
@/.M +C#20)= !)K0#m+C#2C'#I
Whcn nvcr!ays arc uscd, thc !inkcr basica!!y prnduccs nnc vcry !argc Ii!c
cnntaining a!! nI thc nb|cct mndu!cs as hunks nI rc!ncatab!c cndc. Thc hunk
nvcr!ay tab!c cnntains a data structurc that dcscribcs thc hunks and thcir
rc!atinnship tn cach nthcr.
Whcn ynu arc dcsigning a prngram tn usc nvcr!ays, ynu must kccp in mind
hnw thc nvcr!ay managcr (a!sn ca!!cd thc nvcr!ay supcrvisnr) hand!cs thc
intcractinn bctwccn thc varinus scgmcnts nI thc Ii!c. What ynu must dn,
basica!!y, is bui!d a trcc that rcI!ccts thc rc!atinnships bctwccn thc varinus cndc
mndu!cs that arc a part nI thc nvcra!! prngram and tc!! thc !inkcr hnw this trcc
shnu!d bc cnnstructcd.
Thc hunk nvcr!ay tab!c is gcncratcd as a sct nI 8 !nng wnrds, cach dcscrib-
ing a particu!ar nvcr!ay nndc that is part nI thc nvcra!! Ii!c. Each 8 !nng wnrd
cntry is cnmpriscd nI thc In!!nwing data:
HUNK OVERLAY 5YMBOL TABLE-ENTRY DATA 5TRUCTURE:
!nng scckOIIsct, / whcrc in thc Ii!c tn Iind this nndc /
!nng dummy!, / a va!uc nI 0 . . . cnmpatibi!ity itcm /
!nng dummy2, / a va!uc nI 0 . . . cnmpatibi!ity itcm /
!nng !cvc!, / !cvc! in thc trcc /
!nng nrdinatc, / itcm numbcr at that !cvc! /
!nng IirstHunk, / hunk numbcr nI thc Iirst hunk cnntaining
this nndc. /
!nng symbn!Hunk, / thc hunk numbcr in which this symbn! is
!ncatcd /
!nng symbn!OIIsctX, / (nIIsct + 4) , whcrc nIIsct is thc nIIsct
within thc symbn! hunk at which this
symbn!'s cntry is !ncatcd. /
Each nI thcsc itcms is cxp!aincd Iurthcr in thc scctinns that In!!nw.
*#5'(.'.( ). +C#20)= !2##
Lct's say that ynu havc, Inr cxamp!c, thc Ii!cs main, a, b, c, d, c, I, g, h, i, and |,
and that main can ca!! a,b,c, and d and that cach nI thcsc Ii!cs can ca!! main.
Additinna!!y !ct's say that rnutinc c can bc ca!!cd Irnm a,b,c,d, nr main, but has
nn rc!atinnship tn rnutinc I. Thus, iI a rnutinc in c is tn bc run, thcn a,b,c, and
d nccd tn bc mcmnry-rcsidcnt as wc!!. Rnutinc I is !ikc c, that is, it nccds
nnthing in c tn bc prcscnt, but can bc ca!!cd Irnm a, b, c, nr d. This mcans that
thc nvcr!ay managcr can sharc thc mcmnry spacc bctwccn rnutincs c and I,
sincc ncithcr nccd cvcr bc mcmnry-cnrcsidcnt with thc nthcr in nrdcr tn run.
II ynu cnnsidcr rnutinc g tn sharc thc samc spacc as thc cnmbinatinn nI a,b,c,
and d and rnutincs h,i, and | sharing thc samc spacc, ynu havc thc basis Inr
cnnstructing thc nvcr!ay trcc Inr this prngram structurc:
AMIGADO5 ADDITIONAL INFORMATION
281
main (rnnt !cvc! nI thc trcc)
a,b,c,d (1,1) g (1,2).
c (2,1) I(2,2) h(2,!) i(2,2) )(2,3)
Nnt nn!y havc wc drawn thc trcc, but wc havc !abc!cd its branchcs tn match
thc hunk nvcr!ay (!cvc!, nrdinatc) numbcrs that arc Inund in thc hunk nvcr!ay
tab!c that matchcs thc nndcs tn which thcy arc assigncd.
Frnm thc dcscriptinn abnvc, ynu can scc that iI main is tn ca!! any rnutinc in
prngram scgmcnt a-d, thcn a!! nI thnsc scgmcnts shnu!d bc rcsidcnt in mcm-
nry at thc samc timc. Thus thcy havc a!! bccn assigncd tn a sing!c nndc by thc
!inkcr. Whi!c a-d arc rcsidcnt, iI ynu ca!! rnutincs in c, thc !inkcr wi!! autnmati-
ca!!y !nad rnutinc c Irnm disk, and rcinitia!izc thc mndu!c (cach timc it is again
brnught in), sn that its subrnutincs wi!! bc avai!ab!c tn bc run. II any scgmcnt
a-d ca!!s a rnutinc in I, thc !inkcr rcp!accs c with thc cnntcnts nI I and
initia!izcs it. Thus a-d arc at !cvc! 1 in thc nvcr!ay trcc, and rnutincs c and I arc
at !cvc! 2, rcquiring that a-d bc !nadcd bcInrc c nr I can bc acccsscd and !nadcd
Inr cxccutinn.
Nntc: A rnutinc can nn!y pcrInrm ca!!s tn rnutincs in nthcr nndcs which
cithcr arc currcnt!y mcmnry rcsidcnt (thc anccstnrs nI thc nndc in which thc
rnutinc nnw in usc is !ncatcd), nr a rnutinc in a dircct chi!d nndc. That is, main
cannnt ca!! c dircct!y, but c can ca!! rnutincs in main sincc main is an anccstnr.
Nntc a!sn that within cach branch nI cach subnndc, thc nrdinatc numbcrs
bcgin again withi numbcr 1 Inr a givcn !cvc!.
*#5D2'K'.( 9"# !2##
Ynu crcatc thc trcc by tc!!ing thc nvcr!ay !inkcr abnut its structurc. Thc
numcrica! va!ucs, simi!ar tn thnsc nntcd in thc Iigurc abnvc, arc assigncd
scqucntia!!y by thc !inkcr itsc!I and appcar in thc hunk nndc tab!c. Hcrc is thc
scqucncc nI nvcr!ay !ink statcmcnts that causc thc Iigurc abnvc tn bc bui!t:
OVERLAY
a,b,c,d
This dcscriptinn tc!!s thc !inkcr that a,b,c,d arc part nI a sing!c nndc at a
givcn !cvc! (in this casc !cvc! 1), and thc astcrisk in Irnnt nI c and I cach say
that thcsc arc nnc cach nn thc ncxt !cvc! dnwn Irnm a-d, and acccssib!c nn!y
thrnugh a-d nr anything c!nscr tnward thc rnnt nI thc trcc. Thc namc g has nn
astcrisk, sn it is cnnsidcrcd nn thc samc !cvc! as a-d, tc!!ing thc !inkcr that
g
h
282
AMIGADO5 TECHNICAL REFERENCE MANUAL
cithcr a-d nr g wi!! bc mcmnry-rcsidcnt, but nnt bnth simu!tancnus!y. Namcs
h,i, and | arc shnwn tn bc rc!atcd tn g, nnc !cvc! dnwn.
Thc abnvc paragraphs havc cxp!aincd thc nrigin nI thc hunk nndc !cvc! and
thc hunk nrdinatc in thc hunk nvcr!ay symbn! tab!c.
,##M +>>5#9 %&:/.9
Thc Iirst va!uc Inr cach nndc in thc nvcr!ay tab!c is thc scck nIIsct. As
spcciIicd car!icr, thc nvcr!ay !inkcr bui!ds a !argc sing!c Ii!c cnntaining a!! nI thc
nvcr!ay nndcs. Thc scck nIIsct numbcr is that va!uc that can bc givcn tn thc
scck(Ii!c, bytc nIIsct) rnutinc tn pnint tn thc Iirst bytc nI thc hunk hcadcr nI a
nndc.
'.'9')0@/.M
Thc initia!Hunk va!uc in thc nvcr!ay symbn! tab!c is uscd by thc nvcr!ay
managcr whcn un!nading a nndc. It spcciIics thc initia! hunk that must havc
bccn !nadcd in nrdcr tn havc !nadcd thc nndc that cnntains this symbn!. Whcn
a rnutinc is ca!!cd at a diIIcrcnt !cvc! and nrdinatc (un!css it is a dircct, ncxt
!cvc!, chi!d nI thc currcnt nndc), it wi!! bccnmc ncccssary tn Ircc thc mcmnry
uti!izcd by inva!id hunks, sn as tn makc rnnm tn nvcr!ay with thc hunk(s)
cnntaining thc dcsircd symbn!.
,=&K:0@/.M ).8 ,=&K:0+>>5#9^
Thcsc tab!c cntrics Inr thc symbn!s arc uscd by thc nvcr!ay managcr tn
actua!!y !ncatc thc cntry pnint nncc it has cithcr dctcrmincd it is a!rcady !nadcd
nr has !nadcd it. Thc symbn!Hunk shnws in which hunk tn !ncatc thc symbn!.
5ymbn!OIIsctX-4 shnws thc nIIsct Irnm thc start nI that hunk at which thc
cntry pnint is actua!!y !ncatcd.
%!+-N i%0'.M !#&<:2)2= +K1#D9 -:8'>'#2d
This dncumcnt dcscribcs thc ATOM uti!ity, inc!uding its dcvc!npmcnt histnry,
thc manncr in which it has bccn imp!cmcntcd, and a!tcrnativcs tn its usc.
!"# ]<2:K0#&]N
Prngrammcrs nccd/want tn bc ab!c tn spcciIy that parts nI thcir prngram gn
intn "chip" mcmnry (thc Iirst 512K) sn that thc custnm chips can acccss it.
Thcy a!sn nccd/want tn trcat this data |ust !ikc any nthcr data in thcir prngram
and thcrcInrc havc it !ink and !nad nnrma!!y.
;2#C':/5 ,:0/9':.5
Thc rccnmmcndcd way nI dca!ing with this was tn dn an A!!ncMcm with thc
chip mcmnry bit sct and cnpy data Irnm whcrc it was !nadcd ("Iast" mcmnry)
tn whcrc it bc!nngcd (chip mcmnry), thcn usc pnintcrs tn gct tn it. This
invn!vcd having twn cnpics nI ynur data in mcmnry, thc Iirst !nadcd with ynur
prngram, thc sccnnd cnpicd intn thc Iirst 512K nI mcmnry.
Thc nthcr "sn!utinn" is tn havc thc prngram nnt run in machincs with mnrc
than 512K. This shnu!d quick!y bccnmc an unacccptab!c sn!utinn.
AMIGADO5 ADDITIONAL INFORMATION 283
!"# %!+- ,:0/9':.
1. Cnmpi!c nr asscmb!c nnrma!!y.
2. Pass thc nb|cct cndc thrnugh a pnst- (nr prc-) prnccssnr ca!!cd "ATOM".
ATOM wi!! intcract with thc uscr and thc nb|cct Ii!c(s). It wi!! I!ag thc
dcsircd hunks (nr a!! hunks) as "Inr chip mcmnry" by changing thc hunk
typc.
3. Thc !inkcr wi!! nnw takc ninc (9) hunk typcs instcad nI 3. Thc n!d typcs
wcrc hunk cndc, hunk data, and hunk_bss. Thc ncw nncs wi!! bc:
hunk cndc chip = hunk cndc + bit 30 sct
hunk cndc Iast = hunk cndc + bit 31 sct
hunk data chip = hunk data + bit 30 sct
hunk data Iast = hunk data + bit 31 sct
hunk bss chip = hunk bss 4- bit 30 sct
hunk bss Iast = hunk bss + bit 31 sct
Thc !inkcr wi!! pass a!! hunk typcs thrnugh tn thc LOADER (cnagu!ating iI
ncccssary). Thc LOADER uscs thc hunk hcadcr inInrmatinn whcn !nading.
Ynu wi!! rcca!! Irnm thc inInrmatinn prnvidcd in thc !inkcr dncumcntatinn
that CODE hunks cnntain cxccutab!c (68000) machinc !anguagc, DATA
hunks cnntain initia!izcd data (cnnstants, . . .) and B55 hunks cnntain
unintia!izcd data (arrays, variab!c dcc!aratinns, . . .).
4. Thc LOADER wi!! !nad accnrding tn inInrmatinn Irnm stcp 3 abnvc. Hunks
wi!! gn intn thc dcsignatcd mcmnry typc.
5. O!d vcrsinns nI thc LOADER wi!! intcrprct thc ncw hunk typcs as VERY
!argc hunk and nnt !nad (crrnr 103, nnt cnnugh mcmnry).
R/9/2# ,:0/9':.5
Thc asscmb!cr and Latticc "C" may bc changcd tn gcncratc thc ncw hunk
typcs undcr prngrammcr cnntrn!.
@:I 9"# W'95 L:2M
Thc hunk sizc is a wnrd cnntaining thc numbcr nI wnrds in thc hunk. Thcrc-
Inrc, Inr thc Inrcsccab!c Iuturc, inc!uding 32-bit addrcss spacc machincs, thc
uppcr 2 bits arc unuscd. Thc bits havc bccn rcdcIincd as In!!nws:
! Bit31 MEMF FA5T
9 : Bit30 MEMFCHIP
0 0 II ncithcr bit is sct, thcn gct whatcvcr mcmnry is avai!ab!c, this is
"backward" cnmpatib!c. PrcIcrcncc is givcn tn "Fast" mcmnry.
1 0 Lnadcr must gct FA5T mcmnry, nr Iai!.
0 1 Lnadcr must gct CHIP mcmnry, nr Iai!.
1 1 II Bit31 and Bit30 arc bnth sct, thcn thcrc is cxtra inInrmatinn
avai!ab!c In!!nwing this !nng wnrd. This is rcscrvcd Inr Iuturc cx-
pansinn, as nccdcd. It is nnt currcnt!y uscd.
284
AMIGADO5 TECHNICAL REFERENCE MANUAL
;#2D#'C#8 H&<)D9
O!d prngrams, prngrams that havc nnt bccn cnmpi!cd nr asscmb!cd with thc
ncw nptinns, and prngrams that havc nnt bccn run thrnugh ATOM wi!! run (nr
nnt run) as wc!! as cvcr. This inc!udcs crashing in cxtcndcd mcmnry, iI pnnr!y
prngrammcd. Thc "prcvinus sn!utinns" mcntinncd at thc bcginning nI this
chaptcr sti!! hn!d.
Prngram dcvc!npmcnt and tcst nn a 512K machinc cnu!d In!!nw EXACTLY
thc samc !nnp ynu havc nnwcdit, cnmpi!c, !ink, cxccutc, tcst, cdit, . . .
UNTIL ynu arc abnut tn rc!casc. Thcn ynu cdit, cnmpi!c, ATOM, A!ink, add
cxtcrna! mcmnry (>512K) and tcst. This wnrks wc!! Inr a!! thrcc cnvirnnmcnts
(Amiga, IBM, and 5un).
Fnr nativc (Amiga) dcvc!npmcnt nn a >512K machinc ynu may want tn
ATOM thc Icw rcquircd nb|cct Ii!cs sn ynu can bnth run ynur !inkcd prngram
in an cxtcndcd mcmnry machinc and takc advantagc nI a !argc RAM: disk. Thc
dcvc!npmcnt cyc!c thcn bccnmcs: cdit, cnmpi!c, nptinna!!y ATOM (iI this cndc
nr data cnntains itcms nccdcd by thc b!ittcr), !ink, cxtcutc, tcst, cdit. . . .
"Ncw prngrams" wi!! nnt !nad in a VI.0 Kickstart cnvirnnmcnt. Thc rcsu!t
wi!! bc crrnr 103 (nnt cnnugh mcmnry).
O!d (VI.0 and bcInrc) vcrsinns nI dumpnb| and OMD wi!! nnt wnrk nn Ii!cs
aItcr ATOM has bccn run nn thcm.
L:2M'.( J.C'2:.&#.9
Tn gct a!! nI this tn wnrk tngcthcr ynu nccd Rc!casc 1.1 cnmpatib!c cnpics nI:
ATOM (Vcrsinn 1.0 nr !atcr)
A!ink (Vcrsinn 3.30 nr !atcr)
Kickstart (Rc!casc 1.1 nr !atcr) Inr DO5 LOADER.
DumpOb| (Vcrsinn 2.1) Nccdcd iI ynu wish tn cxaminc prngrams mndiIicd by
ATOM.
%!+- ?:&&).8 B'.# ,=.9)X
Thc cnmmand !inc syntax is:
ATOM <inIi!c> <nutIi!c> |-1
nr
ATOM <inII!c> <nutIi!c> '()|CtD!B |-F|CtDB |-*')+ ,+ -..
Whcrc:
<inIi!c> Rcprcscnts an nb|cct Ii!c, |ust cnmpi!cd, asscmb!cd nr ATOMcd
(Ycs, ynu can rc-ATOM an nb|cct Ii!c).
<nutIi!c> Thc dcstinatinn Inr thc cnnvcrtcd Ii!c.
() Changc mcmnry tn CHIP
-F Changc mcmnry tn FA5T
(* Changc mcmnry tn "Pub!ic". (Any typc nI mcmnry avai!ab!c.)
AMIGADO5 ADDITIONAL INFORMATION
285
C
D
B
Changc CODE hunks
Changc DATA hunks
Changc B55 hunks
?:&&).8 B'.# JX)&<0#5
JX)&<0# pO
In mnst cascs thcrc is nn nccd tn p!acc CODE hunks in chip mcmnry. 5nmc-
timcs DATA and B55 hunks dn nccd tn bc p!accd in chip mcmnry, thcrcInrc
thc In!!nwing is a Iair!y cnmmnn usagc nI ATOM. Tn causc a!! Cndc hunks tn
gn intn Pub!ic RAM, Data and B55 hunks tn gn intn chip RAM typc:
ATOM inIi!c.nb| nutIi!c.nb| -pc -cdb
JX)&<0# # 2
Tn causc a!! thc hunks in nb|cct Ii!c tn bc !nadcd intn chip mcmnry typc:
ATOM inIi!c.nb| nutIi!c.nb| -c
JX)&<0# - 3
Tn sct a!! data hunks tn !nad intn chip mcmnry typc:
atnm myIi!c.n myIi!c.sct.n -cd
JX)&<0# - 4
This is an intcractivc cxamp!c. Uscr input is in !nwcr casc, cnmputcr nutput is
in uppcr casc. In this cxamp!c thc cndc hunk is sct tn "Fast", thc data hunk is
sct tn "Chip". Thcrc wcrc nn B55 hunks. Nntc that hc!p was rcqucstcd in thc
bcginning.
2 > atnm Irnm.n Irnm.sct -i
AMIGA OBJECT MODIFIER VI.0
UNIT NAME FROM
HUNK NAME NONE
HUNK TYPE CODE Nntc: cndc hunk
MEMORY ALLOCATION PUBLIC
DI5PLAY 5YMBOL5 |Y/N y
basc..
xcnvI.
_CXD22. .
printI.
main...
MEMORY TYPE? "#$ %$ &' ( Nntc: rcqucst Inr hc!p
P!casc cntcr F Inr Iast I
C Inr Chip
P Inr Pub!ic
286 AMIGADO5 TECHNICAL REFERENCE MANUAL
Q tn quit
W tn windup
N Inr Ncxt hunk
MEMORY TYPE? |FIc!P I
UNIT NAME 0000
HUNKNAME NONE
HUNK TYPE DATA
MEMORY ALLOCATION PUBLIC
DI5PLAY 5YMBOL5? |Y/N n
MEMORY TYPE? |FIn!P c
UNIT NAME 0000
HUNKNAME NONE
HUNK TYPE B55
MEMORY ALLOCATION PUBLIC
DI5PLAY 5YMBOL5? |Y/N y
MEMORY TYPE? |FiC!P p
2 > _
J22:2 -#55)(#5
Errnr Bad Args:
a) An nptinn dncs nnt start with a "-"
b) wrnng numbcr nI paramctcrs
c) "-" nnt In!!nwcd by I, C, F, nr P.
d) -x supp!icd in additinn tn -I, ctc.
Errnr Bad inIi!c:
Fi!c nnt Inund.
Errnr Bad OutIi!c:
Fi!c cannnt bc crcatcd.
Errnr Bad Typc # # :
ATOM has dctcctcd a hunk typc that it dncs nnt rccngnizc. Thc nb|cct Ii!c
may bc cnrrupt.
Errnr cmpty input:
Input Ii!c dncs nnt cnntain any data.
Errnr RcadExtcrna!s:
Extcrna! rcIcrcncc nr dcIinitinn iI nI an undcIincd typc. Ob|cct Ii!c may bc
cnrrupt.
Errnr prcmaturc cnd nI Ii!c:
An cnd nI Ii!c cnnditinn (nut nI data) was dctcctcd whi!c ATOM was sti!!
cxpccting input. Ob|cct Ii!c may bc cnrrupt.
cancc!s thc npcratinn, nn nutput Ii!c is
crcatcd
dncs nnt changc thc rcst nI thc Ii!c,
|ust passcs it thrnugh
skip this hunk, shnw ncxt
Nntc: data hunk
AMIGADO5 ADDITIONAL INFORMATION 287
Errnr This uti!ity can nn!y bc uscd nn Ii!cs that havc NOT bccn passcd thrnugh
ALINK:
Thc input Ii!c ynu spcciIicd has a!rcady bccn prnccsscd by thc !inkcr.
Extcrna! symbn!s havc bccn rcmnvcd and hunks cnagu!atcd. Ynu nccd tn
run ATOM nn thc nb|cct Ii!cs prnduccd by thc C cnmpi!cr nr Macrn
Asscmb!cr BEFORE thcy arc !inkcd.
?2#)9'.( ) S#I *#C'D# 9: G/. 4.8#2 %&'()*+,
This scctinn prnvidcs inInrmatinn abnut adding dcviccs that arc NOT part nI
thc DO5 Ii!ing systcm. Thc ncxt scctinn prnvidcs inInrmatinn abnut adding
Ii!c-systcm-rc!atcd dcviccs (hard disks, I!nppy disks)that is, dcviccs that DO5
can usc tn rcad and writc Ii!cs with thcir assnciatcd dircctnrics.
Ynu wnu!d want tn usc this inInrmatinn tn add a ncw dcvicc such as a ncw
scria! pnrt nr a ncw para!!c! pnrt. In this casc ynu may bc crcating a dcvicc
namcd "5ER2:" which is tn act |ust !ikc "5ER:" as Iar as DO5 is cnnccrncd.
Thcrc arc twn stcps invn!vcd hcrc. First, ynu must crcatc a suitab!c dcvicc, a
prnccss that is nnt addrcsscd hcrc.
Nntc: Thc cndc Inr crcating a skc!ctnn disk-rcsidcnt dcvicc is cnntaincd in
thc %&'() G+- _#2.#0 -)./)03
5ccnnd, ynu must makc this ncw dcvicc avai!ab!c as an AmigaDO5 dcvicc.
This prnccss invn!vcs writing a suitab!c dcvicc hand!cr (scc G+- _#2.#0 -).A
/)0d and insta!!ing it intn thc AmigaDO5 structurcs.
This insta!!atinn is hand!cd by crcating a suitab!c dcvicc-nndc structurc Inr
ynur ncw dcvicc. This is simi!ar tn crcating a Dcv!nIn s!nt Inr a ncw disk
dcvicc, cxccpt that thc startup argumcnt can bc anything ynu want. Thc
5cgmcnt !ist s!nt is zcrn, and thc Ii!c namc nI ynur disk-rcsidcnt dcvicc hand!cr
is p!accd in thc Fi!cnamc s!nt.
0 Ncxt
0 dt dcvicc
0 Task (nr prnccss idscc bc!nw)
0 Lnck
B5TR Fi!cnamc nI hand!cr cndc
NNN 5tacksizc rcquircd
NN Prinrity rcquircd
XXX 5tartup inInrmatinn
0 5cgList (nnnzcrn iI ynu !nad thc cndc)
0 G!nba! vcctnr rcquircd
B5TR Dcvicc Namc
Thc dcvicc hand!cr is thc intcrIacc bctwccn ynur dcvicc and an app!icatinn
prngram. This is nnrma!!y writtcn in BCPL, and thc AmigaDO5 kcrnc! wi!!
attcmpt tn !nad thc cndc nI thc hand!cr and crcatc a ncw prnccss Inr it whcn it
is Iirst rcIcrcnccd. This is hand!cd autnmatica!!y whcn thc kcrnc! nnticcs that
thc Task Iic!d in thc Dcv!nIn structurc is zcrn. II thc cndc is a!rcady !nadcd, thc
cndc scgmcnt pnintcr is p!accd in thc 5cgList Iic!d. II this Iic!d is zcrn, thc
288 AMIGADO5 TECHNICAL REFERENCE MANUAL
kcrnc! !nads thc cndc Irnm thc Ii!cnamc givcn in thc Fi!cnamc Iic!d and
updatcs thc 5cgList Iic!d.
II ynu want this autnmatic !nading and prnccss initia!izatinn tn wnrk, ynu
must crcatc a cndc mndu!c, which is writtcn in BCPL nr is writtcn in asscmb!cr
tn !nnk !ikc a BCPL mndu!c. This cnsurcs that thc dynamic !inking uscd by thc
kcrnc! wi!! wnrk cnrrcct!y.
II ynu arc writing in asscmb!cr, thc Inrmat nI thc cndc scctinn must bc as
shnwn bc!nw. Nntc that ynu may usc DATA and B55 scctinns, but cach scctinn
must havc thc samc Inrmat as dcscribcd hcrc.
5tartMndu!c DC.L (EndMndu!c-5tartMndu!c)/4 5izc nI mndu!c in 1 wnrds
EntryPnint
(ynur cndc)
CNOP 0,4 A!ign tn !wnrd bnundary
DC.L 0 End markcr
DC.L 1 DcIinc G!nba! 1
DC.L EntryPnint-5tartMndu!c OIIsct nI cntry pnint
DC.L 1 Highcst g!nba! uscd
END
In asscmb!cr, ynu wi!! bc startcd with rcgistcr D! hn!ding a BCPL pnintcr tn
thc initia! packct passcd Irnm thc kcrnc!.
II ynu arc writing in BCPL, a skc!ctnn rnutinc wi!! appcar as In!!nws. Thc
main |nb nI thc dcvicc hand!cr is tn cnnvcrt Opcn, Rcad, Writc, and C!nsc
rcqucsts intn thc dcvicc rcad and writc rcqucsts. Othcr packct typcs arc
markcd as an crrnr.
"Inc!udc Ii!cs cnntaining uscIu! cnnstants"
GET "LIBHDR"
GET "IOHDR"
GET "MANHDR"
GET "EXECHDR"
This is a hand!cr Inr a skc!ctnn Task.
Whcn thc task is crcatcd, thc paramctcr packct cnntains thc In!!nwing:
parm.pkt!pkt.arg! = BPTR tn BCPL string nI dcvicc namc, (i.c., "5KEL:")
parm.pkt!pkt.arg2 = cxtra inIn (iI nccdcd)
parm.pkt!pkt.arg3 = BPTR tn dcvicc inIn nndc
MANIFE5T
$(
IO.b!ncksizc = 30 (sizc nI dcviccs IO b!ncks)
)
LET start (parm.pkt) BE
$(
LET cxtratnIn = parm.pkt!pkt.arg2
AMIGADO5 ADDITIONAL INFORMATION
289
LET rcad.pkt
LET writc.pkt
LET npcnstring
0
0
parm.pkt!pkt.arg!
VEC pkt.rcs!
VEC pkt.rcs!
VEC IO.b!ncksizc
VEC IO.b!ncksizc
FAL5E
"scria!.dcviccXOO"
FAL5E (I!ag tn shnw whcthcr dcvicc has bccn "npcncd"
with act.Iindinput nr act.Iindnutput).
parm.pkt!pkt.arg3
LET inpkt
LET nutpkt
LETIOB
LETIOBO
LET crrnr
LET dcvnamc
LET npcn
LET nndc
(Zcrn thc b!nck Iirst sn that wc can scc what gncs intn it whcn wc ca!!
Opcndcvicc.)
FOR i = 0 TO IO.b!ncksizc DO IOBIi : = 0
IF OpcnDcvicc ( IOB, dcvnamc, 0, 0 ) = 0 THEN crrnr : = TRUE
IF crrnr THEN
$( rcturnpkt (parm.pkt,FAL5E,crrnr,nb|cctinusc)
rcturn
%$
(Cnpy a!! thc ncccssary inIn tn thc Output buIIcr tnn.)
FOR i = 0 TO IO.b!ncksizc DO IOBO!i : = I0B!i
nutpkt!pkt.typc : = act.writc
inpkt!pkt.typc : = act.rcad
nndc!dcv.task : = taskid() (Inscrt prnccss id intn dcvicc nndc.)
(Finishcd with paramctcr packct . . . scnd back. . . .)
rcturnpkt (parm.pkt, TRUE )
(This is thc main rcpcat !nnp waiting Inr an cvcnt.)
$( LET p = taskwait ( )
5WITCHON p!pkt.typc INTO
%&
CA5E act.Imdinput:
CA5E act.Iindnutput:
$( LET scb = p!pkt.arg!
(Opcn.)
npcn : = TRUE
scb!scb!d : = TRUE
rcturnpkt (p,TRUE)
(Intcractivc.)
LOOP
; <
290
AMIGADO5 TECHNICAL REFERENCE MANUAL
CA5E act.cnd: (C!
nndc!dcv.task : = 0 (Ri
npcn : = FAL5E
rcturnpkt (p,TRTJE)
LOOP
(C!nsc.)
(Rcmnvc prnccss id Irnm dcvicc nndc.)
CA5E act.rcad:
inpkt: = p
hand!c.rcturn (IOBO,rcad.pkt)
LOOP
(Rcad rcqucst rcturning.)
CA5E act.writc:
nutpkt: = p
hand!c.rcturn(IOBO,writc.pkt)
LOOP
(Writc rcqucst rcturning.)
CA5E 'R': (A r
rcad.pkt: = p
hand!c.rcqucst(IOB,IOC.rcad,p,inpkt)
inpkt : = 0
LOOP
(A rcad rcqucst.)
CA5E 'W:
(A writc rcqucst.)
writc.pkt : = p
hand!c.rcqucst(IOBO,IOC.writc,p,nutpkt)
nutpkt : = 0
LOOP
DEFAULT:
UNLE55 npcn DO nndc!dcv.task : = 0 (Rcmnvc prnccss id un!css npcn.)
$) REPEAT/WHILE npcn I nutpkt = 0 I Inpkt = 0
Tcrminatinn
C!nscDcvicc( IOB )
(Hand!c an IO rcqucst. Passcd cnmmand, transmissinn packct (tp) and
rcqucst packct (rp). rp cnntains buIIcr and !cngth in arg2/3.) AND hand!c,
rcqucst (IOB, cnmmand rp, tp ) BE
LET buII = rp!pkt.arg2
LET !cn = rp!pkt.arg3
5ctIO( IOB, cnmmand, ?, rp!pkt.arg3, 0 )
put!nng ( IOB, IO.data, buII )
5cndIO(IOB, tp )
Hand!c a rcturning IO rcqucst. Thc uscr rcqucst packct is passcd as p, and must
bc rcturncd with succcss/Iai!urc mcssagc. AND hand!c.rcturn (IOB, p ) BE
%&
LET crrcndc = IOB O.crrnr
LET !cn = gct!nng( IOB, IO.actua! )
%$
AMIGADO5 ADDITIONAL INFORMATION
291
TE5T crrcndc = 0 THEN (Nn crrnr.)
rcturnpkt(p, !cn )
EL5E
rcturnpkt(p, 1, crrcndc )
II ynu wish tn writc ynur dcvicc hand!cr in C, ynu cannnt usc thc autnmatic
!nad and prnccss crcatinn prnvidcd by thc kcrnc!. In this casc, ynu must !nad
thc cndc ynursc!I and usc a ca!! tn CrcatcPrnc tn crcatc a prnccss. Thc rcsu!t
Irnm this ca!! shnu!d bc stnrcd in thc Task Iic!d nI thc Dcv!nIn structurc. Ynu
must thcn scnd a mcssagc tn thc ncw prnccss tn gct it startcd. This mcssagc
might cnntain such things as thc unit numbcr nI thc dcvicc invn!vcd. Thc
hand!cr prnccss shnu!d thcn wait Inr Opcn, Rcad, Writc, and C!nsc ca!!s and
hand!c thcm as dcscribcd in thc cxamp!c abnvc. C cndc dncs nnt nccd tn inscrt
thc prnccss id intn thc dcvicc nndc bccausc this is dnnc whcn cndc is !nadcd,
as dcscribcd abnvc.
-)M'.( S#I *'5M *#C'D#5
Tn crcatc a ncw disk dcvicc, ynu must cnnstruct a ncw dcvicc nndc as
dcscribcd in 5cctinn 3. 3. 1 nI thc %&'()*+, !#D".'D)0 G#>#2#.D# -)./)03 Ynu
must a!sn writc a dcvicc drivcr Inr thc ncw disk dcvicc.
A dcvicc drivcr Inr a ncw disk dcvicc must mimic thc ca!!s that arc pcr-
Inrmcd by thc trackdisk dcvicc (dcscribcd in thc Amiga ROM Kcrnc! Manua!). It
must inc!udc thc abi!ity tn rcspnnd tn cnmmands such as Rcad, Writc, 5cck, and
rcturn status inInrmatinn in thc samc way as dcscribcd Inr thc trackdisk drivcr.
Fnr thc In!!nwing dcscriptinn, nntc that mnst pnintcrs arc nI thc typc BPTR (as
dcscribcd car!icr in thc %&'()*+, !#D".'D)0 G#>#2#.D# -)./)0dF a machinc pnintcr
tn snmc !nng wnrd-a!igncd mcmnry !ncatinn (such as rcturncd by A!!ncMcm)
shiItcd right by twn.
Cnnstruct thc ncw nndc with thc In!!nwing Iic!ds:
0 Ncxt
0 dt dcvicc
0 Task
0 Lnck
0 Hand!cr
210 5tacksizc
10 Prinrity
BPTR tn startup inIn
5cg!ist
0 G!nba! vcctnr
B5TR tn namc
Thc B5TR tn a namc is a BCPL pnintcr tn thc namc nI ynur ncw dcvicc (such
as HDO:) rcprcscntcd as thc !cngth nI thc string in thc Iirst bytc, and thc
charactcrs In!!nwing.
Thc 5cg!ist must bc thc scgmcnt !ist nI thc Ii!ing systcm task. Tn nbtain
292
AMIGADO5 TECHNICAL REFERENCE MANUAL
this, ynu must acccss a Iic!d in thc prnccss basc nI nnc nI thc Ii!ing systcm
tasks.
Thc cndc as In!!nws can bc uscd Inr this purpnsc:
TTBYTE pnrt,
pnrt = DcviccPrnc( "DFO:"), / Rcturns msg pnrt nI
Ii!csystcm task /
task = (struct Task ) (pnrt-sizcnI(struct Task), / Task structurc is
bc!nw pnrt /
!ist = ( task.pr 5cg!ist ) / makc machinc ptr
Irnm 5cgArray /
scg! = !ist|3, / Third c!cmcnt in
5cgArray is Ii!csystcm
scg!ist /
Ncxt, ynu must sct up thc startup inIn (again, rcmcmbcr tn usc BPTRs
whcrc nccdcd). This inIn cnnsists nI a BPTR tn thrcc !nng wnrds which
cnntain:
Unit numbcr (dn nnt usc unit zcrn)
Dcvicc drivcr namc, stnrcd as a BPTR tn thc dcvicc drivcr namc which
must bc tcrminatcd by a nu!! bytc which is inc!udcd in thc cnunt (c.g.,
4/' H7' D7' 070) BPTR tn disk inInrmatinn
Thc disk sizc inInrmatinn cnntains thc In!!nwing !nng wnrd Iic!ds:
11 5izc nI tab!c
128 Disk b!nck sizc in !nng wnrds (assuming 512-bytc
b!ncksizc)
0 5cctnr nrigin (i.c., Iirst scctnr is scctnr zcrn)
Numbcr nI surIaccs (c.g., 2 Inr I!nppy disk)
1 Numbcr nI scctnrs pcr b!ack
Numbcr nI b!ncks (c.g. 11 Inr I!nppy disk)
pcr track
2 (nr mnrc, indicating numbcr nI b!ncks tn bc rcscrvcd
at start)
0 Prca!!ncatinn Iactnr
0 Intcr!cavc Iactnr
Lnwcst cy!indcr (cnmmnn!y 0)
numbcr
Highcst cy!indcr (c.g., 79 Inr I!nppy disk)
numbcr
5 (nr mnrc, indicating numbcr nI cachc b!ncks)
Fina!!y, thc dcvicc nndc must bc attachcd tn thc cnd nI thc !ist (nntc thc
Ncxt Iic!ds arc a!! BPTRs) nI dcvicc nndcs within thc InIn substructurc.
AMIGADO5 ADDITIONAL INFORMATION
293
WARNING: Thc !ist tn which this rcIcrs is NOT thc samc kind nI !ist
that is rcIcrcnccd in thc Excc pnrtinn nI thc %&'() G+- _#2.#0 -)./)0F
but is instcad thc kind nI !ist dcscribcd in this bnnk.
Tn partitinn a hard disk ynu makc twn nr mnrc dcvicc nndcs and sct thc
!nwcst and highcst cy!indcr numbcrs tn partitinn thc disk as dcsircd.
45'.( %&'()*+, L'9":/9 L:2MK#.D"`H.9/'9':.
This inInrmatinn is prnvidcd tn givc dcvc!npcrs snmc inInrmatinn abnut hnw
AmigaDO5 and Intuitinn intcract with cach nthcr. As nI this writing, it is nnt
pnssib!c tn Iu!!y c!nsc dnwn Intuitinn nr thc input dcvicc. It is pnssib!c tn insta!!
nnc's nwn input hand!cr within thc input strcam (as is dcmnnstratcd in thc
%&'() G+- _#2.#0 -)./)0F Input Dcvicc dcscriptinn) and thcrcby hand!c input
cvcnts ynursc!I, aItcr ynur prngram has bccn !nadcd and startcd by AmigaDO5.
II, aItcr that pnint, ynu takc nvcr thc machinc in snmc manncr, ynu can
prcvcnt AmigaDO5 Irnm trying tn put up systcm rcqucstcrs nr nthcrwisc
intcracting with thc scrccn by mndiIying DO5 as shnwn bc!nw. Basica!!y, ynur
nwn prngram must prnvidc a!tcrnatc ways tn hand!c crrnrs that wnu!d nnr-
ma!!y causc DO5 tn put up a rcqucstcr.
Annthcr a!tcrnativc Inr taking nvcr thc machinc is tn ignnrc thc AmigaDO5
Ii!ing systcm a!tngcthcr, and usc thc trackdisk. dcvicc tn bnnt ynur cndc and
data nn ynur nwn. Ynu wi!! Iind dctai!s abnut thc disk bnnt b!nck and thc track
Inrmatting in thc %&'() G+- _#2.#0 -)./)0F a!!nwing this a!tcrnatc mcans iI
ynu sn chnnsc.
Hcrc arc thc dctai!s abnut AmigaDO5 and Intuitinn:
AmigaDO5 initia!izcs itsc!I and npcns Intuitinn. It thcn attcmpts tn npcn thc
cnnIiguratinn Ii!c (crcatcd by PrcIcrcnccs) and passcs this tn Intuitinn. It thcn
npcns thc initia! CLI windnw via Intuitinn and attcmpts tn run thc Iirst CLI
cnmmand. This is cnmmnn!y a !nadwb (!nad Wnrkbcnch), In!!nwcd by an
cndc!i nn thc initia! CLI.
An app!icatinn prngram can bc madc tn bchavc !ikc Wnrkbcnch, in that it
spawns a ncw prnccss. Thc ncxt CLI cnmmand is thcn cndc!i, which c!nscs
cvcrything dnwn, !caving nn!y thc ncw prnccss running (a!nng with thc
Ii!csystcm prnccsscs). This prnccss wnu!d sct thc pr WindnwPtr Iic!d tn - 1,
which indicatcs that thc DO5 shnu!d rcpnrt crrnrs quict!y. Nntc that thc
app!icatinn MU5T hand!c a!! crrnrs. Thcrc arc Iurthcr dctai!s nn this in Chaptcr
3. DO5 wi!! a!sn havc initia!izcd thc TrapHand!cr Iic!d nI thc uscr task tn pnint
tn cndc that wi!! disp!ay a rcqucstcr aItcr an crrnr, this shnu!d bc rcp!accd by a
uscr-prnvidcd rnutinc. This wi!! stnp a!! uscs nI Intuitinn Irnm thc uscr task,
prnvidcd thcrc arc nn scrinus mcmnry cnrruptinn prnb!cms Inund, in which
casc DO5 wi!! ca!! Excc A!crt dircct!y.
Thcrc is sti!! thc prnb!cm that thc Ii!csystcm prnccsscs may ask Inr a rc-
qucstcr, in thc cvcnt nI a disk crrnr nr iI thc Ii!csystcm task crashcs duc tn
294
AMIGADO5 TECHNICAL REFERENCE MANUAL
mcmnry cnrruptinn. Tn stnp this, thc pr WindnwPtr and tc TrapHand!cr
Iic!ds nI thc Ii!csystcm tasks must bc sct tn -1 and a privatc Trap hand!cr must
bc prnvidcd in thc samc way as was dnnc Inr thc uscr task. This is casi!y dnnc
as shnwn bc!nw.
Find thc mcssagc pnrt Inr cach Ii!csystcm task by ca!!ing DcviccPrnc(),
passing DFO, DF1, ctc. An crrnr indicatcs that thc dcvicc is nnt prcscnt. Frnm
thc mcssagc pnrt ynu can Iind thc task basc Inr cach Ii!csystcm task, and hcncc
patch thcsc twn s!nts. This shnu!d bc rcpcatcd Inr cach disk unit.
Thc app!icatinn prngram can nnw c!nsc Intuitinn. Wnrkbcnch has, nI cnursc,
ncvcr bccn invnkcd. Nntc that as nI this writing, it is nnt pnssib!c tn stnp DO5
Irnm npcning Intuitinn.
Nntc that iI thc app!icatinns want tn usc any nthcr dcvicc such as 5ER:, thc
hand!cr prnccss must bc patchcd in cxact!y thc samc way as thc Ii!csystcm
prnccsscs. Thc app!icatinn shnu!d nbvinus!y nnt attcmpt tn npcn thc CON: nr
RAW: nncc Intuitinn has bccnmc inactivc.
H.8#X
Absn!utc (symbn!), 193
Addrcss, 187
Addrcss mndcs, 195-196
Addrcss rcgistcrs, 187
Addrcss variant, 196
ALINK (dcvc!npcr's cnmmand), 84- 85,
168-169, 207, 209-211
Argumcnts, 6, 50, 119, 152, 153
A5CII !itcra! numbcrs, 194
A55EM (dcvc!npcr's cnmmand), 85-86
Asscmb!cr, 160, 188-189
Asscmb!y cnntrn! dircctivcs, 198-199
Asscmb!y !anguagc, 85- 86
A55IGN (uscr's cnmmand), 36-37, 43
ATOM (A!ink Tcmpnrary Ob|cct MndiIicr),
282-287
Binary Ii!c structurc, 243-261
Binary numbcrs, 194
B!nck cnntrn!, 97- 99
Bnn!can rcturns, 171, 175
Bnnt, 40
Bnntab!c disk. 5cc Disk, bnntab!c
Brackct charactcrs, 59
Branchcs, 187
BREAK (uscr's cnmmand), 43- 44
Brcak b!nck, 257
C, initia! cnvirnnmcnt in, 160
Ca!!ing (AmigaDO5), 170-185
CD (uscr's cnmmand), 44-45
Charactcr pnintcr, 152
Charactcr string, 152
CLI. 5cc Cnmmand Linc IntcrIacc
C!nsc (ca!! packct), 274
C!nsc Iunctinn, 171-172
Cnmmand dcIinitinn, 152
Cnmmand Ii!c structurcs, 59- 62
Cnmmand Ii!cs, 17-18, 136
Cnmmand Inrmats, 18-21
Cnmmand grnups, 121
Cnmmand input and nutput, 18, 31
Cnmmand !inc, 208
Cnmmand Linc IntcrIacc (CLI), 5, 22, 37- 38,
53, 72-74, 81, 88-89, 152, 159-161, 264-266
Cnmmand namcs, 118-119
Cnmmand scqucncc, 78- 79, 89
Cnmmand syntax, 118-121, 209
Cnmmand tcmp!atc, 152
Cnmmands, backgrnund, 17, 77
Cnmmands, cnmmnn!y uscd, 21-22, 23- 24
Cnmmands, dcvc!npcr's, 84-88, 89
Cnmmands, cxccutinn nI, 5, 17-18, 54-63, 77, 183
Cnmmands, cxtcndcd, 95-96, 103-104
Cnmmands, immcdiatc, 92, 102-103
Cnmmands, rccngnitinn nI, 6
Cnmmands, rcpctitinn nI, 95, 101-102, 115
Cnmmands, usc nI, 16-17
Cnmmands, uscr' s, 40- 84, 88- 89
Cnmmcnts, 190, 192
Cnnditinna! asscmb!y dircctivcs, 203-204
Cnnditinna!s, 66
Cnnsn!c hand!cr. 5cc Tcrmina! hand!cr
Cnntrn! cnmbinatinn, 152
COPY (uscr's cnmmand), 45- 46
CnpyDir (ca!! packct), 276-277
CrcatcDir (ca!! packct), 276
CrcatcDir (Iunctinn), 172, 276
CrcatcPrnc (Iunctinn), 181, 264, 265
Crnss dcvc!npmcnt, 162-169
CTRL-X (cnntrn! cnmbinatinn), 5- 6, 152
Currcnt dcvicc, 9-11
Currcnt dircctnry, 8-10, 27, 39, 153, 172
Currcnt drivc, 10, 153
Currcnt !inc, 109-111, 112-113, 122, 125-126,
130-134, 141-142, 153
Currcnt string, 153
CurrcntDir (Iunctinn), 172
Cursnr cnntrn!, 92
Cursnr pnsitinn, 99, 152
Data b!nck, 240, 248
Data dcIinitinn dircctivcs, 200-201
296
INDEX
Data rcgistcrs, 187
Data structurcs, 262-278
DATA (uscr's cnmmand), 30, 46-47
Datcs, 30, 46-47, 181
Datc5tamp (Iunctinn), 181
Dcbug b!nck, 254
Dccima! numbcrs, 194
DcIau!t, 40
DcIau!t paramctcrs, 58-59
Dc!ay (Iunctinn), 182
DELETE (uscr's cnmmand), 47- 48
Dc!ctcFi!c (Iunctinn), 172-173
Dc!ctcOb|cct (ca!! packct), 276
Dc!imitcr charactcrs, 153
Dcstinatinn Ii!c, 153
Dcvicc namcs, 11-13, 40, 43, 153, 267
DcviccPrnc (Iunctinn), 182
Dcviccs, !ngica!. H++ Lngica! dcviccs
DIR (uscr's cnmmand), 48- 49
Dircctivcs, 196-206
Dircctnrics, 7-10, 27- 28, 43- 45, 47- 48, 69-72,
153
Dircctnry b!ncks, 236-237
Dircctnry cnnvcntinns, 14-16
Dircctnry crcatinn, 34, 172
Dircctnry dc!ctinn, 172-173
Dircctnry cxaminatinn, 173-174
Dircctnry !ncking, 175-176, 179-180
Dircctnry namcs, 76, 178
Dircctnry parcnt, 177
Dircctnry prntcctinn, 179
Disk, bnntab!c, 26, 28
Disk cnpying, 25
Disk, I!nppy, 65
Disk Inrmatting, 25- 26
Disk inInrmatinn, 174
Disk rc!abc!ing, 27
DI5KCOPY (uscr's cnmmand), 49- 50
DI5KED (disk cditnr), 241-242
Diskcttc assignatinn, 36- 37
Disk!nIn (ca!! packct), 275
DOWNLOAD (dcvc!npcr's cnmmand), 86- 87
Dnwn!nading prngrams, 86-87
DupLnck (Iunctinn), 173, 277
Exchanging, 99-100
Exccutc (Iunctinn), 183
EXECUTE (uscr's cnmmand), 54-63
Exit, 182, 265
ExNcxt (Iunctinn), 173-174
Exprcssinns, 192-194
Extcndcd mndc, 91, 153
Extcrna! rcIcrcnccs, 244
Extcrna! symbn!s, 205-206, 251, 258
FAILAT (uscr's cnmmand), 63- 64
Fai!urcs. H++ Errnrs
FAULT (uscr's cnmmand), 64
Fi!c cnpy simu!atinn, 59- 62
Fi!c cnpying, 33-34
Fi!c data, 177, 180
Fi!c dcIinitinn, 153
Fi!c dc!ctinn, 32, 172-173
Fi!c cxaminatinn, 173
Fi!c Inrmatinn, 68
Fi!c hand!cs, 41, 175, 176, 269-270, 273-274
Fi!c hand!ing, 171-180
Fi!c hcadcr b!nck, 238-239
Fi!c !inking, 84-85
Fi!c !ist b!nck, 239- 240
Fi!c !ncatinn, 34-35
Fi!c !ncking, 175-176, 179-180
Fi!c npcning, 176
Fi!c parcnt, 177
Fi!c prntcctinn, 179
Fi!c structurc, 234, 243-261
Fi!c systcm, 6-16, 29- 30, 67, 234-241
Fi!c uti!itics, 88
Fi!cnamc, 6-7, 32, 76, 153, 178
FILENOTE (uscr's cnmmand), 11, 64-65
F!nppy disk. H++ Disk, I!nppy
FORMAT (uscr's cnmmand), 65
FrccLnck (ca!! packct), 277
Functinns, 171-184
G!nba! data structurc, 266-269
G!nba! npcratinns, 139-140
Hand!cr prnccss, 262
Hcxadccima! numbcrs, 194
Hunks, 245, 246-261
Hunk Ovcr!ay Tab!c, 280-282
ECHO (uscr's cnmmand), 50-51
ED (uscr's cnmmand), 51- 52, 90-104
EDIT (uscr's cnmmand), 52-53
Editing. H++ Linc cditnr, 5crccn cditnr
ENDCLI (uscr's cnmmand), 53
End-nI-Ii!c hand!ing, 124
Errnrs, 63, 75, 83-84, 147-152, 161, 175,
211-212, 217
Examinc (Iunctinn), 173, 275
ExamincNcxt (ca!! packct), 275
ExamincOb|cct (ca!! packct), 274- 275
IF (uscr's cnmmand), 66-67
Immcdiatc mndc, 91, 153
InIn (Iunctinn), 174, 275
INFO (uscr's cnmmand), 67-68
InIn substructurc, 267-269
Inhibit (ca!! packct), 278
INDEX
297
Input (Iunctinn), 175
Input, cnnsn!c, 218-231
Input Ii!cs, 136-137, 175
IN5TALL (uscr's cnmmand), 68-69
Instructinns, 187, 190-192, 196
Intcrruptinn, 18
InErr, 175
Is!ntcractivc (Iunctinn), 175
Jumps, 187
Kcybnard input, 219-220, 224
Kcywnrds, 18-20, 153
LAB (uscr's cnmmand), 69
Labc!s, 69, 190-191
Lcttcr casc, 170
Librarics, 158, 170-185, 208, 245, 256, 266
Library basc pnintcr, 266
Linc dc!ctinns, 113, 114, 126-127
Linc cditnr, 52- 53, 105-154
Linc inscrtinns, 114-115, 126-127
Linc numbcrs, 109-110, 120, 122-123, 143
Linc sp!itting and |nining, 133-134
Linc windnws, 128-130, 153
Linkcr, 84- 85, 168-169, 207-231, 257
Linking, ncw disk dcvicc, 291-293
Linking, ncw nnn-disk dcvicc, 293-294
LI5T (uscr's cnmmand nr dircctivc), 28, 69- 72
Listing cnntrn! dircctivcs, 201-203
Lnad Ii!c, 207, 244, 255-257
Lnadcr, 257, 261
Lnading cndc, 183-184, 185
Lnad5cg (Iunctinn), 183-184
LncatcOb|cct (ca!! packct), 276
Lncatinn zcrn, 212
Lnck (Iunctinn), 175-176
Lnck dup!icatinn, 173
Lncks, 270-271
Lngica! dcviccs, 14-16, 41, 43, 267
Lngica! pnsitinn, 178
Lnng wnrd, 187
Lnnps, 138-139
Macrn asscmb!cr, 186-206
Macrn dircctivcs, 204-205
MAKEDIR (uscr's cnmmand), 72
MAP nutput, 212
MC68000 asscmb!y !anguagc, 85
Mcmnry, 153, 183-184, 247-248, 269
Mcmnry variant, 196
M5-DO5, 168
Mu!tip!c strings, 119-120
Mu!ti-prnccssing, 4- 5, 153
NEWCLI (uscr's cnmmand), 72-73
Nndc, 245, 257
Nu!! string, 131
Numbcrs, 194
Ob|cct cndc, 41
Ob|cct Ii!cs, 207, 208, 244, 246-254
Octa! numbcrs, 194
Opcndc Iic!d, 191
Opcn (Iunctinn), 176
Opcn Ncw Fi!c (ca!! packct), 273
Opcn O!d Fi!c (ca!! packct), 272-273
Opcrand Iic!d, 191-192
Opcrand typcs, 192
Opcrand wnrd, 187
Opcratinn wnrd, 187
Opcratnrs, 192
Output (Iunctinn), 176
Output, cnnsn!c, 218-231
Output Ii!cs, 137-138
Output prnccssing, 124
Output qucuc, 153
OVERLAY (dircctivc), 213-215
Ovcr!ay Ii!cs, 208
Ovcr!ay nndcs, 245, 257
Ovcr!ay numbcr, 217
Ovcr!ay rcIcrcnccs, 216
Ovcr!ay supcrvisnr, 207
Ovcr tab!c b!nck, 257
Ovcr!aying, 213
Packcts, 271-278
Para!!c! pnrt, 87
Paramctcr Ii!c, 208
Paramctcr substitutinn, 56- 58
Parcnt (ca!! packct), 275
ParcntDir (Iunctinn), 177, 275
Pninting variant, 131-132
Primary binary input, 208
Prinrity, 5, 153
Prnccsscs, 5, 154, 181-182, 263-266
Prngram cnntrn!, 96- 97
Prngram cnuntcr, 187
Prngram dcvc!npmcnt, 158-159
Prngram cncnding, 189-192
Prngram tcrminatinn, 161
Prngram unit, 244-245, 246
Prngramming, 157-169
PROMPT (uscr's cnmmand), 74
Prnmpts, 74, 122
PROTECT (uscr's cnmmand), 29, 74-75
Qua!iIicd strings, 120, 123-124, 154
Qua!iIicrs, 111-112, 154
298
INDEX
QUIT (uscr's cnmmand), 75
RAM (dcvicc), 11-12
READ (dcvc!npcr's cnmmand), 2WTXX
Rcad (Iunctinn), 177
Rcad ca!!, 273
Rcbnnting, 35, 41
Rcgistcr (symbn!), 194
Rcgistcr va!ucs, 170
RELABEL (uscr's cnmmand), 75-76
Rc!ativc (symbn!), 194
Rc!ncatinn, 249- 250
Rcnamc (Iunctinn), 178
RENAME (uscr's cnmmand), 76-77
RcnamcDisk (ca!! packct), 278
RcnamcOb|cct (ca!! packct), 278
Rcsidcnt !ibrarics, 158, 170-185, 208, 245, 255
Rcstart va!idatinn prnccss, 21
Rnnt b!nck, 234-235
Rnnt dircctnry, 7, 154
RUN (uscr's cnmmand), 77
5amp!c !nnping batch Ii!c, 62- 63
5canncd !ibrary, 208, 245
5crccn cditnr, 51-52, 90-104
5crccn nutput, 221-223
5crn!!ing, 95
5EARCH (uscr's cnmmand), 77-78
5carching, 77-78, 99-100, 120
5cck (ca!! packct), 274
5cck (Iunctinn), 178
5cgmcnt !ists, 269
5cqucntia! Ii!cs, 154
5cria! !inc, 87
5ctCnmmcnt (ca!! packct), 277
5ctCnmmcnt (Iunctinn), 179, 277
5ctPrntcct (ca!! packct), 277
5ctPrntcctinn (Iunctinn), 179, 277
68000 micrnchip, 186-187
5KIP (uscr's cnmmand), 78-79
5ORT (uscr's cnmmand), 79-80
5nurcc Ii!c, 154
5TACK (uscr's cnmmand), 80-81
5TATU5 (uscr's cnmmand), 81- 82
5tatus rcgistcr, 187
5tartup-5cqucncc (cxccutc Ii!c), 35
5tnragc, 89
5trcam, 41
5trings, 119-120, 123, 130-132
5un (cnmputcr), 162-168
5witch va!ucs, 120
5ymbn! dcIinitinn dircctivcs, 199-200
5ymbn!s, 193-194, 205-206, 215-216, 253,
257
5yntax, 118-121, 154, 170-171
5ystcm disk, 41
5ystcm managcmcnt, 89
Tcrmina! hand!cr, 5- 6, 154
Tcxt a!tcratinn, 100-101
Tcxt dc!ctinn, 94
Tcxt inscrtinn, 92-94, 142
Tcxt string, 77
TcxtIi!cs, 31, 51-52
Timc, 30, 46-47, 180, 181-182
Trai!ing spaccs, 143
TYPE (uscr's cnmmand), 31, 82
Typc cnmmands, 134, 135
UnLnad5cg (nptinn), 184
UnLnck (nptinn), 179-180, 277
Va!ucs, 171
Virtua! tcrmina!, 175
Vn!umc namc, 10, 41, 75, 154
WAIT (uscr's cnmmand), 83
WaitChar (ca!! packct), 274
WaitFnrChar (Iunctinn), 180, 274
WHY (uscr's cnmmand), 83- 84
Wi!d card, 7, 154
WITH Ii!cs, 210-211
Wnrd, 187
Wnrkbcnch, 22- 23, 161-162
Wnrkspacc, uninitia!izcd, 248
Writc (Iunctinn), 180
Writc ca!!, 273-274
XREF nutput, 212

Das könnte Ihnen auch gefallen