Professional Documents
Culture Documents
System Software-1 - Merged
System Software-1 - Merged
Lex tuetns
Rrst eoial amaler cveates a pvervam lex. e
Lexo lajuaqe uew lex cenpiler suns the Lex. pvorarm aud
vedue e & c
peram lec a .
Fally C eonpilev suus the
& C pranm mo pdluces
a
ebjeet Pam a.ou
out i lecicaL anazer that trautfoomi am iupul &taom
Lource 1aa pu
coe &tfrec
LexlaQ Avalyzev &equehce /Sream ef
Tokeus Tekeus
Le ilefomat | truetuve f Les fle
A lex pveqvomm ealecd iwo three. Aections hy oo0l
0deartions oR Declasatin
Cectir
Sectim
% delimila
Rules Tvas latin mules
)o o
Auciiay functims
eg +iuclude 4stdlo.h> )
include <tonio.uy Defuiti on oAL
Decaiim
int a-
Sectisn
Pelimile
Ruules
cubc -
mateh abc
bttheneise
u oue o
ame reluw 1 i upul
waeo Caledl ECHO t h o t is equi vede
BCHOC) - lex pvovides a
ncude <sidio.h
h e t l o ] j{inffe"Holowoid"),
Trauslatra
Lhantf C Tavalid o RD ") ,
in maint)
3
mttwnapl),
Ex Lex wds
pgam to
ecoange amcl display he4aosdi, ueAdu
awd umber. iu Apnaet phabell
a
ziven pul Antemeu
Hin-keyuo0ads it, etle, int, cast, Jots, fo ,chal,aut6,conitiue,
=
Number [o to
=
I+
woidl=
Atphabetb
[a-3A-2]+
ey pvoam
Defiitium
#nclude <stdlio.h
Sectin
Used tade
Used to define
t h e keywnds) if | etke | int | case.l aots 1fot | ebar| auts |
Tvanlatu
Continue 1default|Static oile 1 Jloat |soitelh
eum
Rule Secton
pntt"/os i a
kewoRd", vzet t
sed bdetia
t h e numbep
-1J+ { PaitfC°/%s is a
Number", 8let)
(Used to detia la-2A-z]+ {patfe"o/os ica Alphalet"aest),?
tphabeht"
in EcHo fo skipping
int maint)
int tywaap)
Tetuu
elasSMAte
Date
Page
Le
A woid Couttq Poro
WAlE a lex PEam to Count the number Unes,wodds,
Chaxcle, numbev and Specie clavacte a ativen gbomes
n {ünes+ + wOKcA++{
CiE WORdi +4_
La-3A-2 chaacler t++ Rule Sectun
LO-9 um ++
2pl-e hat +
/°/o
in maind)
PAintf Ene the input element 3)
AHlexC
t o a : Uaes + ehovaefer +WoRds + num+9pl-clas
pintfen/od line",Unes)_
pRintacn/od chavaafe chavaed)
pantfe m o/oc wORdA" woKek)
priatf n /od digilnum)
prtfe" n/d spe cial ehaeela spl-eau)
pnne mo/odLTota) olod. charaelei,tota&)_
setu 0
1n ttwka pc)
elma
H Hello. 2 Unes Tdto 11.clavaulee
2.34 3wORds 3 dii
chavae lad Speedal clOreelq
e p s e l
Ageböcfaghbn.
Cestam
elasSMAte
c s e d1
Date
( Page
e0 z ) L s-al
,,22
K 0 +A 27
¬,ab
RE abs
e abb,,b, Lb)
RE 1T
DotjOm
oeto s i t Redue
Pvec eceeee
R Parting).
AvnsiguouS
C A o ) R I ) )
LR
C L A L R C I L R )
Masl
p nulLuffa t held e
Tamc mbols and o
s w to be
passed
The t i a corbiguTtioL op subeduLe Pases S
W
inpud- dfe
Staek
InRe(Pusl Kecduee -Deleterep
Posa ble Achm
is sited onto +hetobthe shek
Sat
The rest mbol
the toP t h e skaek Yeplaacd
Hand'e tkal- abear
o
( Reduce e
mon- famina
ih appopiate
a n n o umces Sueeempul
a n Achm Stale . ue p ase
Aceepl
Copedin oPasir 0A
m i c k paMeL euwnol ei ShabtE
Situatim peltorm tHe
even
Secuee dhe Symao nd also cannd-
Rules Ie wlom
opeRalss ha more þrion+than
oeitu, thn peor e
the
sLilyl
opeetuy ak Som oleu po
l miomin Oea tLem hesserm reduce
$E
ecce Eid
E dsid Shibl
$E-
E E skipt
E-E Reduee E Sia
$E-Eid|
stitl
E-E Recbuce Eid
Reduce E JEE
Reduce E E-Ë
E
Accet
riety a>C>s
LLSS a >
W (,C 4))
Tuhrnducthim to YAcc
YAcc Atauds for K«Fanetter Conpilev. orapilev.
Acc is a tool 8kich is sed to
aenerale paer(LALKLY ANAer
I t loakes the
inpu fom the previous flase C leci cal Aalye)
asa tokew aud generale the Pade Kee:
A e
kae, Syula Analyzer is 4he Aecoud fhase the tempiler
Lhch takes
Inpu as tokeng auel aenevale he pause tre
t h the help
o aamna)
Struchuve XACC
YACC
Apetifiatian
le AcLTool| tab. c
Compilevr
tuetion kectibn.
#incluee <tdib-hy
int mainC)
tval=atoi (a7at)
chayenr (SD
I tConvevtg a int a
characke. striyto aw Sulerei value efs Cyaar)
azatoi(ear)
eUC)
-
PaE
ol headet file
IMclude "a ab.h"-
wHthe etp pf hig
oil t e able
tool
t eatl tefile-
Ac
exlw alva
relu o,}
sekw ylExt[®];}
YAcc part
lo
nclude <iohy
legt'+
P f C m Bxpvession it vadid)
3
ntop
T temr(chal *S)
is uvalia")
d Cn Exprestjon
SaSbe
L { e ,a b , aabb, aaabbb, -- --
S n g = aabb
bot
Hint: We Need tdevelop leiaAnalyzev avo ynlays Analy zev
So, e uoill use lex and ACL Too
Lex le.
nclude " takb.h u -faciitaled bT le
T h s Commuuccein
tom
tstaius e declsatid
aton oich
olo al th totens he YACC m
Ca relu A,
relun b,
relu o
%
YACe Part
olol nchde 7
nchde <SAdlo h
tincludle Aadub.k
lo tokeu A B
Tokeus cekned YAC
bidtez shi)
n t accepled tven
dHerrpr ) - Tf Stnog
i n c t Oill alled
yyPane)
Sourte
act tab:c
bal. exe
(tab.h) CC
- ebj
otj Lior exe
LAdd&tiova
iles
eTes Linkare Eul
Druamicfnkev
It is
speckN pe rom talokes fupu cf executabste
E a
h e eyeeutiom
'Lesad it natn memoy
iles from Linko
lo avom
Leedey allocale mennok Apace
&clherne
Loadi
olloomaA ane vaiiok
Loaces onby Loading
O Abiolule Loading+selocin
R e l o a t i n a loacdeis +LiaKa
elocatit
cacfeus-Loading
iec-üki fotteiO
is au
GemeveY
w mema id
Maclule Qve Leaefe
Loadin
he pram i e main meot
AUocctien: 1t
aloaeS meMot D
poyernd ox madde
Liakin It Combines
Tuwo o more separale okee
upphe necenay mfoTmelion
md
o e d ea
1L madps objel p a9 So Aaa0-
the
elotaten
Q a n addeu ufev
Ce leat
Loading: 1E bos he obiet pveTom mto MM fr*
( Absclule Lcadev - The abcolule Locev Loads t e obiecl
object coe
is chaeacle o m ,
t
vepreseutalonf
inlo leznal
memoiy
Meve ebject co-le Apeeiie Lecation
te
retoid
next ebjeek Peem
encL
ENO YeLord
t Addrew åpeifec lu
Tump
End
l o s k i f Absoue Loaces.
cbect pream Colaini retwsd ) End vecoRel
eco
(Text
O Head
> StaitAded
EDOLo0o
executrble Tstoucton
statinAddreu ef the
Stucture Mee 3)
stati A y
yte Adreuesoo 2
1oIs 48
2o3|ooio36oo
oo o 14 33|u8
|030o |1o b1o|3 DO 10 2.DC 1O
1olo 61 3c1o oo|usuF46|coloo3
36 48 o 61 D8 10 33 4c
O0
O0
|l030
lo40
2020
Absolule Lpaaes
AdvaularS aw pisadvonlaqes of
Ad vanlarS Use
simple la desim
I t is
I t s effcienl
Addveu
estaicts the
s advaaqes the
actu-
to specify
pvoqYamar
for
pvram t e
e e d
iutependent
mdependent
preram
flebil cannot
Un
éeseveval
veal
resut[we
AsAs a a
beludeew ther)
ahsolule
Shaim
memcy
ibvaiies ohile s ing an
&ubmitine
uie
Eutifficult ts
afte, the i l
ef
pverraan
KAMythe boitstrap odsives
Atutg-the cleviee
Then operating ylem
the
RoM BovtshraP Ren oS
Pveram
ea
L v a do 5 / P e
yslom
Opeatin
Sytem
RAM
device Devices
daves
8o
Dperatirg OS
SsTam CHd osk
LOADER DESIGN OPTIoNS
Linka1e Elilo
I E is alio Kuoud w as Bider
OA+he execuution a c pvoram, eachtime -the allocativm
Seallocotion Ainkioz andl Loading needs lo be dene.
m e CompleoiS
space Cornple xi ol ineVeale sile perfod
teactanties i.e alloatirn, reallo caliun,
each t e inkingaud Loadna)
oThe deas iu to
&epavate these tuuc-hinslactivitiet u debarae
Toup
Libsay nkae
dvau e oinkae Edifon
Ei tor
Menc&y
2 mking Loader
be
pvoy)
thelibrotuetionS Memo
leeded by-He Pogm
oodev calluhe Libraty fune ts-thew Loadi inlo
e v e y timthe unE
e memo
Stahcini - Compiletme
8 ynamie Lirking. momic Und-Rud timne
E> i a Abeuialpast of opeaig len
Pnamic Uaking loads exletual Akavred ibvasies mt6 a
auwnana Pceu andl then binds thoie 3hared ubvaiel
denamic
to theunning PYoceu
IE povles he abuly to Loadl the Zubroutine enly ohen -they
are neeeedl. l the run tine
E UokS
all the ibvaty les ntö eeculabte file at sunttme
E aldo Known as
dunamic Leodiy o Load ow cal
O
Dynamic inkng it dhlew uled o allo several exec uu J
Slava one copy of a &ubroiue
ol übrat
Usev Fi
USev
PYogram
ERRHANDL
ERRHANDL
oheu-the catlecl subbrvütiue Complelett pvocessir ît eluius Oe
ya covutrot to h e
tststek allev (ì.e, DS).OS-snretuiuc
issued-te request
pPam hect
a Aend cal to it may not
a
subyotine is stu ,
ruued,
a another Load opeettie cowtyol a mpa be
equive souttne
the danamic
loader tö he callecd
wm
namic
Voader
Load audA
cal
ERRHANDL
Usev
eRRHANDL
P a n k a t euable
sehtudare
fext e d i o s
are
Editos or
teot jiles.
Inte field af
*Editars: edit
cveale aud souvce
Aoute ce
cde
to
t
-he uses o u s a u refes
usallt efe
e i eedler
r
he eaw e que
&peeiel fetuves foa wrttira
edto3
edites hat i c l u d e wmamy a v e bome o
4 h e Cemmevm
wordpadl
editior cdes lotepa, emocs,Jed, pLeo
owe the edtes on
m windo0 OS amodvi,
wsed
ONIX Obs.
wttw lest editos are
Fealure A M o c i e l
deletn achog
Savi et
P e oEujovs ine at
Can ouly e d i t ot uPe oue a
boinle
eqVi emac,nlokefpac
Wovd pYoceuor. ovovcomig the imitathons ocveen edrtosit
allods oue to use some foknat fuset imapes, filesvideos, uRe
to
fowt, Sige , style features. it najory Jocupes ow ralual tavque
Eitiamponu
Edit
Bulfes
Tavel
Ceeneut
Cemman Main
Lalae iewin
Yoceuo Yr Conponet Memen
viei
pispby
Compnet viedina
B-ffe
ectputDevices
le sysa/
Ceutrot---
Da
(9
Foitint PYocess \wle alYeody Kuod tLou eitos ave the a
peaast tohic ît utd lo cvegle, edit anu roodiby aC
decumeut. A documeut w includle 1.ome faM, files,text
equatios ane aiqvams as well. But we wiL beirmitpd. t
Fevmatting -
ViSu en Display screew
subket
RIecing-findig eut the nain1impostant
aveling Locatng the avea ef Tmere st
-
h e input
o pveCeL (ommanclS
used. display the edutea foim o
ave
Ca dafie a
Sigle " s t u c t i v "(o
amaco, porammu
a
exleusen H e basie aneo
itructans afe
Maeo a d p a modijaio.
a
Ampudy delgg
d i n g strausliTou pve-pree
avnender e s
tusucten ,
most
macm
o oce
MACRO
HAPPX
A 1,DA-1A
Ha l Define Macvo A DATA
A 3,DATA
Stnt f Defittn ACRo
MEND
p e ro Name
See wenee 1 6
be alrevjaled
HAPPK
MEND
End f Dfiution
+ Macvo tepveseuuls
a ouP of Commowdy uled
8demen h e Acurce pmeyam 3APPy
plac eael M a c o iuuehop
MacvD Pvocenr
a ource layquand
wh e eomespdivg o u p
epaus gn f
8temets. T s hodn a
HAPPY t
aroS
molves whon, invoction
o pvocem
M a c(dalin),and expansion
MALRO
HAPPY LARG
A , 8AR
DummY
A2, AE¢ Valables.
A 3, ARe
MEND
A 1, DArA
HAPPY DATA A, 2, DATAL
A,3,DATA
HAPPH DAT2
,,PATAL-
A2, DATA 2
, DATA3
Juacties pacw pvore.
Rconise maerokefind
Save e deiutien
te
Recarrise
calls o d Substitle agumeals
erxpard
pkceuws Name Talle )
wed by a C
(macvo
Sutuves MNT
Del Pau 1 Pau
PRSTARTO MNT
MACROD PRG STRO
A.DAIA
HO
A ,0PTA
AI,DATA 3, D/ HELO
A 3 ,DATH HDLAO
HELLO
MEND
A,1, DATA DAA
A 2DATA
HeLLo 3
HELLO
A 3, D A T A DeID
MUND
HELLO NO
Expas
yfet faomeev macvo
O los tioual amelet keywoAd paamelers
MACRO MAcRO
INCR f, 2 3 INCR P: P2, P3 =
A LDA1A A L, DATA
A 2, DA TA A 2, DATA
A 3, DATA A 3, DATA
MEND MEND
ketdozd,
MACRO
Combinationsf Positun,
and letuut Palamelev
TNCR P =A &P2= 6
AL, DATA
A 2, DATA
A 3,DATA
MEND
Advauae ac
OSinplfy audeduce the
amout of epettie caling
Caued Ly repetative cadiyt
KeduLe the posibil er
move eaqable
cKe an SembM pYDgsam
au - MARo
KMEM-VAL,
AINC. VAL, AREG
eocde TNCR
MovER RE %MEM-VAL
%TNC-VAL
ecd
ADD ARES Maco
MOVEM REC %MEM-VAL
Moc MENDI
end
> McrD Call
INCR AS,ARE
Actu Palameled
Pan
MOTC
MNTCE
Reond Nest
Source Yecala
No
seulo wike coP
p sourc
END No
Kea Nept Pseudo
Souvte caHe
|MNTCMNTC+|
repayaqumed
E e Une
inte MDT
MOTC k-MOIt1 No
Red lept
Soavce Codo
PASS1
Substilue indee
notliwnf«
oqument
Pau
Peu 2
Read dext
Source cede
CCopled fom
Search MNTfo
match i t opeteto
Cole
MACR
hme-feune Newde'Talo epanded
Souree code fle
yes
ED No
MOTP MDTinde Pseueloop
om NT etoy
Spypldee
g upagrument Souwee fle
aMansle
Procestin
MDTP<MOTP+I
Subsilaarrune-ls
wm MAAo tall