100% found this document useful (1 vote)
547 views30 pages

SPCC Notes

Fhh

Uploaded by

smittttt69
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
100% found this document useful (1 vote)
547 views30 pages

SPCC Notes

Fhh

Uploaded by

smittttt69
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 30
Fi SPec \\ (mr | S¥stem software > SoFk eee Ra a corer jostruchien er data ts onyt- or can be stored electsicaly Hardwar Hi © - Storage device & oisPplay Device We Types of software A system software Application software "Need of sy oEDOTS computer Understands o's &V'S meen appliceion, SoHare aig * Semantic gap etc @xecotion domain Semantic gap is made manageable by \atwad uct on of Dew domain called SyStem Software ~System Software aystem software is a set oF Progr computer Pardaare arm that contoals & manage the operation of bry also helps application program +o execdtS correct ¥ ay S* rt makes the operation of computer more. Fast, effective and secure fe for the Users to Focus OP OP b- x4 makes i+ possi bl application problem +° be soWed , withoot needing 19 4h details of how machine emorks internally + Exarple: — operahng System ‘ programming language - Communication sofmar® - oflty Programs is +he System Softcare pe Of Sofimare which is +he interface between pplication software ystem and Low Level tanguage T+ is osed for operating Computer band ware Enstalied on +he computer When Operating System ‘Ss '9Stalled — SY¥Stem Soficaare can run indepen dently Se less oser foteracton, Available in case of System software | + Examples: SyStem softwara’s are Compiler, assember, de- bugger . driver ete “the Purpose is +0 execo+e + the purpase is +O SolV the Applicaton program aS per OSers reques+ ey TUS on +he Platform wih Provide by SyStem Sortwake + High level Language +Z+ is OSed by user +a perform specific task “Installed According to OSser’s requicements ApPli Cation SOF+WAre Cetin ron _independenHy- * user fan ioreracts with i+ Oser ioterFace \p case oF is Available Applicetion software _ Exam ps + Application software’ S are ward processor ,web browser, media player € SPEciHc problem ee ae & evil, what fighting 4 ~ S| ant en SO eee sctier | xoterpreter a+ trans lets +ne hig les the Whole pro- yy | hign level langooge into 0 exch yo + E+ compi form line by gram at one Hme direct! ono ! pe inte machine language intermediate line |_B program DECKS | —— ; ? 4 or “ ing evil, what @- re us) he situations in ae @ nants0PTy yore A “war 10 good use: woeyous 3 Linker Rael tower te o Pregmam fo a system which heipga -” wS+o fink a object modoles of program into a Single ef a a youe Object File wren ye BHP EE spuor can take! oblectfrom sa coliecton cated _ seat a Nibrary J youe * Et performs complex foncHon of Wnking use ed nur object Program) * | Grked |—_____ Linkage Edito" ' | | = iDke. + Program | | gee acti Fea f program HV r Reloading - | toader on Flow di § oF Linker Editors Mac, re Processol > Ling, ers i compiler Editor> ™, IACrO Proceggor—> Assam ler > Linker co s Loader > Execution » = E obj ¥ Ac < Compi a= orms cotce aan >™PUbEr pro lage 3, de Write, dram thay ae +O ano. Pa ECE tra AS obt Other ¢ Progra st Jeet coge Computer tay, ng Jeage 2 lant 2. Ot 5 Interpreter “An interpre+ers +e. rPreters teanslates high level instucy i 4 : ions tO an fotermediate form rE Ubres the source code directiy Eq- LisP, BASIC etc S Macro processor “A Macro 1s a Single line abbreviation for grooP oF Statement *A Macro processor is @ program thet subs+tutes And Specialized macro definitions far macro Calls [ macro <— pseudo oF F | ° | Cmacco - name). grant oF mact e | : | assembly Langues) | instock On eenae ch ook = qe y W V\ (wn (0) (E7 ° erating System An oper perating system is an interface bexoeen o a y computer puter user and computer hardware which perlcrmm memory MaD- ypur 8. CORPOM * An Opererting syotem 1s o Sot wave fre manageme handling 4 All basic tasks like manage ment agement, process controling peripheral devices ScD AS device delves & printers [user 2| Hardware [ere] operating system RAM software 0 RAM ceo cPpo tina system “Plain pass 2 of 2 Pass macro processo © Algo: rar - this Algorithm ceads O7e Itne of i7p FOS at atime s+ checks iF cp-code of that line > For Each Line Pobehes any ofthe MNT SOTFY BEER Erith ie sound tre tine! iS obtained foom mpT index feld oF LA consiSHOF, - the macro expander prepares® the A eg % Corres~ of a +able of dommy argument in dic Ponding argument= +o +he call + Reading proceeds from the MDT. as eae line ie read, the values form +he argoment Sopsttuted for dummy in Mor termine inves from + Reading MEND line es expans) of macro & scanning input 1 coo * when END Psevdo- oP encountered - +he expand +o assem bier Source program is given . sfaeed nant 270") | i ard . L ANT for Match rahon code ; cone wits expanded ame found |source care fae} file j ff Sorry Spee sooree file +O Assemble preproc frorr argomen} Macro 1 { \ Write expanded Source ca { Per, votem Atin, c 3 SV¥Stem, msec eH EN Withinekoe en ronerene ‘eference 40 assembier min i Por Explain the -Fo1 Howoing -Tanie } Psevdo~ opcode " Table ied Length table defined by Program, Doring a J translation, the assembler searcher # we. Cher the Psevdoopcode in poT and +ake maces Action : ie: associated with t+ 9 Structure of Pot te seude opcode Number of operands cB ' | ow | DD ' | Conist ! | START | ' LToRE \ \ Eo | ar ENDP ° | He a | 2. MoT Mnemonic opcode Table + is Fixed, its content does not change doring the lifetime of assembler searches for T+, eictb eas DUTINg translaton , the assembler the mnemone in MoT and replaces AsSocietred binary epcode given 10 MoT $+ructure raat af mnemonic Number of Binary ve 60 x oF of 2 Cr o ¥ Mic Pe? |raneno S ve code} oa ADD | om soB . < | ° 2 MvLT | ad [eres LoaD a ae 4 e STORE | 06 Mev oT MP o8 + Yo STOP | cee bie(sT) eu £3 Symbol TA 4° st is osed to keeP yrack of SyMbols' assigned +0 variable being used tn program Whe When a symbol gets defined, Assembler makes ite entry into the symbol Table along with its definition addres “When a symbol is used in an instsuchHon , he Assembler first verifies Validity of +he symbol Sing ST and if yalidaHon 7s SUccegsfol, defini Hai Address of Symbol ig written into outpEt File * Strocture. Oden SY me) Address ; ES VSeT Ta Pe i terface be PERSE Gomnher’ to eoeen » 4: Base Table car) + is oced by +he assembler +0 generate tho Proper base register reference 9 machine Im stsuc_ tions & +S correct offsets pesignated relative - address | Contents OF bose reqiste, | Availabirty indicator nN! | a ny? i E Sort \+ ad = a a my cD eo O° cai is Ss Availabilit¥ — y reqister Specified in USING Psetdo- opcode. Fr sendo - d N register Never specified in USING P W rot eo, yon ed por 6. Liscral Table +rac gh oa curds Ks the US Literal tTabpie 6 fret encountered 10 A program into LT along with its Osage a” address, but the definition addres 1s pot OPdated | with each different Osage of Same literay, axf assembler inserts +he usage address inte the Et Bcoording ly" BOL thes= N+erals d& Not get EOF is reached Sgeeuer age of tHerals in Program +hrou + when a Kterat t we entry is made - vow « defined ont! +the literals in LT ge - once EOF is reached, oI! d of Program. Beet in he orec fren, theresa this 6 area at the end of program Where litera ge+ defined is called Literal Pool: Literal NOtation| value usage Add reso Ose, Ds Fem Ang an ;, Device Orivers FET R ss 7 [Application Layer Percting System Layer Hardware Layer | Mevea arc. x particular form G partice of oe naam APPlication that is designed +¢ enable interacis Bee With hardwore devices A device driver commonicates With the com puter hardware by computer subsystem eve S are very essential for a computer Work properly because Withoct Device partcUlar hardware fails +o Work acco- ans it falls in doing a parteolar fon 9 Device Dciver Hardware devices +hat are Onknewn wy the thot have featore Heck al reopives operating system operat ne Syst om are Unknown by the privers dware device that raquires ict of Dar folowing Privers - card reader - controter ~ Modem - Network card Ee aaa fon ae * roc! sysve™ Cena cate = Peperanns SY cyst? ee wore “peso “AN ars cory Lise coy ADH comp! ExPlain Direct Linking Loader in detail + An The direct linking loader is mos+ common +ype OF au! loader. the loader cannot have tre direct acc ess e ag te +e source code « 1 ~The assembler shou. oc | ld give the followi oct " ¢| 40 the loader 4 oa e - i The length ef the object code segmert ii The ligt oF ail +ne symbols Which are not def - Beat ed fm +he corren+ segment bo+ can be Used in _ +he ~corren+ seqment — Wi. the list oF al tne symbols Which ore defined in +he corrent seqment but can be referred by the ether segments - Types ~ ESD (External symbol Dictionary) = bxricard ~ RLD CRelocetion and Linking dictionary) - ~ ENP-Card 2: Define left recursion - lef+ recursive if it basa - A grammar is Said +o be pere is a derivati 00 non-+erminal, say A, Such thar + eiNG A ARP AR left recursion creates diffcorries While + recursion may be +wo TyI A=>Aa, for some thing S 7 * presence of —1 designing +re parsers: Le® 4. Immediate 1efr Tecorsicn 2. General left Cecursion- 3 pefine Lepr Factoring _ [Be predicrive Parser insists +hot +ne@ gramma must be lett factored - The basic idee behil left Factoring ig that Whe we are not clear which producton role is tO b used for the expansion of any non-+termi nal ® erence between top down & bottom OF pa ny" & oiFF use [nse down parser aa, # [se +ree 7 parse +r be bolle er ee can be built eee — So - One aoe root +o leaves: From leave: oot - simple +o implement + Complex +0 Impieme, ~ More eFfFficiemM parsi Less efficient Parsing - +echniques . techniques |‘ APplicable +0 broad ~ class of language. “Applicable +0 Small clacs oF languages | “Eg: | Recursive pesent Parsen*E- 9:1. Shey pedo > Predictive parser a 5 List Phases OF compiler - 7 - Lexical Analyzer ~ Syntrax Analyzer ~ S€mantic Anaiyzer ~ Lptermediate code Generator ~ Code optimizer 7 cede Generaror . — v * “ Stem | Soto "9 syctem is a so eno, Pace pifference be+ linker and loader Linker Lodder Wheraw main SuiScHvet Linker is +o generate exe-|OF loader ie +o toad eS PS execotabis files 24, Memory “The main functon of er ie a part of a - Linker is a & Loader is a part of AN © Pereting sy Stem Linking performs +he lin-|- Loader iibrary file loads +nhe pr- king eperodion oe for execotion Linker are 2+ypes: Oad SS aia - Linkage editor -Absolcte | > Dynamic Linker ~ Be tocecting | = Direct lipking | - Bootstrap T DEFINE tcader and list FUNcHONS oF loader A loader iS a System program, Which +aKeg the obj- ec+ Code oF program as Input & prepares i+ for execution > Loader Func-Hon ard - Allocation - Linking - Relocation - Loading 8) Define CF & With example: Vy Vr PS v Pj - A context Free Grammar has + tuple where -Vyw: set OF Pon +erminal symbols tor grammar v set of terminal Symicol T- osed - *T +he language [ooRESe: SL ASR Mame pecified locatons in +re MEemMary - Tris type of loader is Called absolote 0 relocation information is needed because - This Scheme MAkB MOTE Memory oNailable to usen an assembler is not in memory at load me - Simple +o implement DIisAd VaANtag & » | Een oS specify +© +he agsembler. the address of memory location Where program is +o loaded - programmer Must be careful Not to assiqn \leca~ Hons +o Two SUbrOUH Ne ar & ea es oF compiler with exanmP J source program _| phas Jiexical Anaivzer—.anaiys'é Syprox Analyzer J a 4 Semantic Anayzer! rotermediccte aode Generator A feode optimizer’ » syntpes?S * Code Gienerator | ed arg e+ Prog row, | Lexical AnaysiS -Lexical analysis is the Analysis Phase OF compiler eo -Lexical analysis ‘s also Knocon ag \ine@aur GLnaUys! S and werkS ag interface berkween Soorce Program and Syntax analyzer -A token is a sequence Of characters having a collective meaning ~ €9' |Lexeme —roken Symbol able void Void main majo: ¢ Leh Parninsss Left parn+nesis . Right Parnthes - RIQHt._ Parnrhes'S | | | | | | ») z Left Brace Let Brace a Comma = ms re 8 Seer coe likes gcc Nee: “= max Aa lysic 5 TS a ane Per : 6 is aX parsiog NSi al precece of tokens a iNTORAER tS eiet-g) S Sequence strectere With respect to give, we STammaticay : Wen TOP Domen pay for sing Mal granmer > Bottom op Parsing - [ Semantic anaiysis fs used 45 describe +he meaning of +he gource code Semantic analysis performs the +ype checking and objects binding + EG! a=x+yt+z2*75- a aa Float ce) 3h apo Wwe FO AN shea og Fleatce) i i. : rmediate code eiener ae analysis, Some compilers ics x and semant re presentation + After Synta After Sy wmter mediate generate 9° explici+ opasco ice Program ene represent ed code’ intermediare adress code” in term cally The ed " +hree wae ah ae ae nee Betriees. oswavad vere - TELRIet iy oe ach TAC O/goch statement, hos spe genercu form[z=x OPYIR x =10 y = 25 40 yrx% then gotos a. 4. gore next 5. temp! = Float cx) e. +temp2=fioa Cy) 7 +emps=+emp2+ temp! x1'S sine : ef s +emp4 = Float cx? A. temps= temps+temP4 lo: AF eMPS code opti mizaton a+ 4eieS +o Improve the intenmediat’ code +O fasier running machine code nieve code optimization uses various +ech avoid tfedundancy, ess cod niques Re est haighh renovation, line code Generation yerco WOO eg Generation is the process in whieh clear Qenerator Converts Som 2 internal _representetion of source code inte’ > machine Code +har can executed by & machine - Code generator Would bea ode for an be re tdclily - The ovtput oF machine code, assembly code and ¢ Abstract machire oy Eg: RO=X R1= 25 RI=y R2=40 g R2=2 Beale v p3=a RE =R2ZERS R4ab R1= Rot RItRE RO =10 ime R12 withing aig 9 S are An Object 1 POblia owed +45 a : fe 1eFIDI Hon SPY OF, ne. aS onde sS¥Mb9o!: these are aise known wheres SYM bol. They CaN tne other R Peasy iba are defines 3° Locay SYM50) 7 E+ is Useg Imternaly withia the obj- be NS ays ASR ai, felecak on "EN addition +5 Combining module a linker also replaces, Symbolic addresses with real addresces s &, 4 ¢ Source \, object ROMAmE vee Prag ram, 7 program or % rcs Object Lin ken pro gran apres source ec oan Program Bios ae eas * Lining is of aoe 4 static linking ie Vinking > Dynami Ome “Be eee >a sh Lane, lioking? copies. al es ai ibrar! 1 y routines nes used int be p se yer ote 1 re ‘ he executable image im . é T+ reqoires more Seer pein SigGs ne a . nd memory - = a+ resoives +h " ea ned_sy mbt S e undefined v y ols Wprile program rgntset 5 rongina ng hack the & x ecutable code Shit Be. + Thar mea ps under 02) d symbols, plos a list of objects co your’ nds bit ow Wot seep yo saber ee gs that oodle ,Readcard READL search sedo-op tal [Which on 2 |Pseudo-op table}—?| which one pe QU | USING Pot Gera be pRoP __—__ + Adjust Le +0. | Eyaluat] search Proper A\iqrmert) operand eid machi no-P table cb Bus L< length i Mot GET oF dan fels| [Assign vave [DLENGH L< length | labar Field process any lterals enter into jitera) table: | LTSTO {6 +here Syrmbo) in table field 2 to«-Lc tt write COPY of card L on File for Use by PAsS> | _—— WRITE | + ass oF TWO Pass assembler R Re egister an 4 Storage operat ons - operation code register used as operand Ef Ri - contents of general L x, tigantehta upfi qenerdh| cee sven! (Sebi aysn EB bi -_combenis of general register used cs Base E -_pisplacemept a - immediate data E L_> operand _Leng+» Dicer 7 State and explain the tye: aeaene c types of assembly language sta. 4° Imperative Starements Thdicates an 0 ses an_ochon_+0_be _parformed dlring tee + Meals with what action is +o be taken Ypically one imperative St xtemant translates in +0 bine —Instuchen ADD. MULT x_, AREG for variables eclare Storag& constant pirechves er +o perform corain ac during —execuHon + _ START <.constont7 & END

You might also like