Size: px
Start display at page:

Download ""

Transcription

1 SYLLABUS P A RT A UN I T 1 6 Hour s Machine Archite c ture: Introduc t ion, Sys tem Stware an d Machine Architecture, S implified Instructional C omputer ( SIC) - SIC M achine A rchitecture, SI C/XE Machine Architecture, SIC Programming E xamples. UN I T 2 6 Hour s A ssemblers -1: B asic A ssembler F unction - A S imple S IC A ssembler, Ass embler Algorithm Data Structur e s, Ma chine ende nt Assembler Feature s - Instruc tion Forma ts & Addressing Modes, Program Relocat ion. UN I T 3 6 Hour s A ssemblers - 2 : M achine Indepe ndent Assembl er Features Literals, Symbol- D efinition S tatements, E xpression, P rogram Blo c ks, Control S ections Prog ramming Linking, Assembler De sign Operat ions - One- Pas s Assemble r, Multi-Pa ss Assemble r, Implementatio n Examples MASM Assembler. UN I T 4 8 Hour s L oaders Lin ke rs: B asic L oader F unctions - Desig n a n Absolute Lo a der, A S imple B ootstrap L oader, Machine-D ependent Loa der F eatures R elocation, P rogram L inking, A lgorithm D ata S tructures f or a Linking L oader; Machine-Independe nt L oader F eatures - A utomatic Library S earch, L oader O ptions, Loader Desig n Options - Linkag e E ditor, Dynamic L inkage, Bootstrap Loaders, Implementation Examples - MS- DOS Li nker. P A RT B UN I T 5 6 Hour s E ditors Debug ging Sy stems: T ext E ditors - O verview E diting Proc e ss, U ser I nterface, E ditor Struct u re, I nteractive D ebugging Sy stems - Debuggin g F unctions Capabilities, Relationship With Other Parts Of The System, User- I nterface Criteria UN I T 6 8 Hour s M acro P rocessor: Basic M acro P rocessor F unctions - M acro D efinitions Ex p ansion, M acro P rocessor Algorit hm D ata S tructures, Machine- Independent M acro Processor F eatures - Concatenation M acro Parame ters, G eneration U nique Lab e ls, C onditio nal Macro Expansion, Keyword Macro Param e ters, Macro Processor D esign O ptions - R ecursive Mac r o E xpansion, General-P urpose Macro Processor s, Macr o Processing Within Language Translators, I mplementation Examples - MASM Macro Processor, ANSI C Macro Proc essor. CSE, SJBIT

2 UN I T 7 6 Hour s L ex Y acc 1 : L ex Y acc - The S implest Lex P rogram, Recognizing Wo rds Wit h L EX, Sy mbol T ables, Gr a mmars, Parser-Lexe r Commun i cation, P arts S peech Lex e r, A Y ACC P ars er, R ules S ection, Running L EX YACC, L EX an d Hand- W r itten L exers, Using L EX R egular E xpression, E xamples Regula r Ex p ressions, A W ord C ounting Program, Parsing a Command L i ne. UN I T 8 6 Hour s L ex Y acc - 2 : Using Y ACC Grammars, Re cursive Rules, Shift/Reduce Parsin g, What Y ACC C annot P arse, A Y ACC P arser - Definition S ection, R ules S ection, S y mbol V alues A ctions, The LEX ER, C ompiling R unning a S imple P arser, Arithmeti c Expressions and Ambiguity, Variables and Type d Tokens. Text B ooks: 1. Le land.l.beck: System Stware, 3rd Edition, Pearson Education, ( Chapters 1.1 to 1.3, 2 (except and 2.5.3), 3 ( e xcept and 3.5.3), 4 ( e x cept 4.4.3) ) 2. J ohn.r.levine, Tony Mason and Doug Brown: Lex and Yacc, O 'Reilly, SPD, ( Chapters 1, 2 (Page 2-42), 3 (Page 51-65)) Re f erence Books: 1. D.M.Dhamdhere: System Programming and Operating Systems, 2 - H ill, nd E dition, Tata McGraw CSE, SJBIT

3 1. Machine Architect ure TABLE OF CONTEN TS 1. 1 Introduct ion System Stware and Machine Architecture Simplified Instructional Computer ( SI C ) SIC Mach ine Architecture SIC Programming Examples SIC /XE Machine Arch itecture Recommended Questions Assembler s Basic Assembler Funct ion A Simple SIC Assembler Assembler Algo rithm and Data Structures Machine endent Assembler Features I nstruction Formats & Addressing M odes Progr am Relocation Recommended Questions Assembler s Machine Independent Assembler Features Li terals Symbol-D efinition Statements Expression, Program Blocks Control Sections and Programming Li nking Assembler Design Operat ions One-Pass Assembler Multi-Pass Assembler Implement a tion Examples MASM Assembler Recommended Questions Loaders and Li n kers 4.1 Basic L oader Fu nctions Design an Absolute Lo ader A Simple Bootstrap Loader Machine- endent L oader Features Relocat ion Program Li nking Algorithm and Data Structures for a Linking Lo ader Machine-In dependent Lo ader Features Automatic Li brary Search 92 CSE, SJBIT

4 4.3.2 Loader Options Loader Design Options Linkage Editor Dy namic Li nkage Bootstrap Lo aders Implementatio n Examples MS- DOS Li nker Recommended Questions Editors and Debugging Systems 5. 1 Text Editors Overview Editing Process User In terface Editor Structure Interactive Debugging Sys tems Debugging F unctions and Capabilities Relationship with Other Parts the Sys tem User-Interface Criteria Recommended Questions 6. Macro Proces sor 6. 1 B asic Macro Processor Functions Macro Definitions and Exp ansion Macro Processor Algorithm and Data Structures Machines-Independent Macro Processor Features Concatenation Macr o Parameters Generation Unique Labels Conditional Macr o Expansion Keyw ord Macro Parameters Macro Processor Design Options Recursive Macro Expan sion General-P urpose Macro Processors Macro Processing Within La nguage Translators Implementation Examples Recommended Que stions Lex and Yac c Lex and Yacc A YACC Parser Using LE X Recommended Ques tions 157 CSE, SJBIT

5 S YSTEM SOFTWARE 8. Lex and Yac c Using Y ACC A YACC Parser The LEXE R Compiling and Running a Simple Parser Arithmetic Expressions and Ambiguity Variables and Typ ed Tokens Recommended Questions 201 CSE, SJBIT

6 S YSTEM SOFTWARE U NIT I n troduction: S tware d igital c omputers. I t s tware c onsists a M ACHINE ARCHITECTURE s et f o in structions o r p rograms w ritten t o carry o ut certa in t ask o n c lassified i nto sy stem stware a pplication s tware. S ystem variety pro A pplication s tware foc uses o n a n g rams tha t a pplication o r s upport o peration a p roblem t o b e consists a variety programs that support the operat ion a computer. compute r. solved. S ystem s tware E xamples f or syst em stwa re are Ope rating syst e m, c ompiler, a ssembler, ma cro p rocessor, l oader o r l inker, d ebugger, t ext e ditor, d atabase m anagement sy stems ( some m) o n a n and, stware engineering tools. These stware s make it possible for the user t ocus a pplication or th the machine works internally. 1.2 o er pr oblem to b e s olved, without needing to know deta ils System Stware and Machine Architecture: h ow O ne c haracteristic i n machine dependency. w hich m ost s ystem s tware d iffers f rom applic ation s tware Sy stem s tware suppor ts o peration and u se c omputer. Application stwa p rovides s olution t o a p r oblem. A ssembler transl ates m nemonic instructio ns into code. i nstruction fo r mats, addressing modes e tc., are desig n. Similarly, C ompilers m ust generate machine lan guage cod e, h ardware c haracteristics a s the n umber type d irect con c ern n i asse re m achine mbler taking in to a ccount suc h registers the ma chine ins tructio availa b le. O perating syste ms a re directly c oncerned w ith m anagement nearly al l resources a computing sys tem. ns t. CSE, SJBIT 1

7 re a re aspe cts syst em stware t hat do not directly depe nd upon ty pe c omputing s y stem, g eneral d esign logic a n a ssembler, gene ral design log ic a c ompiler and code optim ization techniqu e s, w h ich are nde i pe ndent targ et machin e s. LikewC SE, p rocess l inking tog ether independently a ssembled subp rograms d oes n ot usually depend on the computer being u sed. 1.3 The Simplified Ins tructional Computer (SIC): S implified I nstructional Compu ter ( SIC) a hypo thetical c omputer tha t i ncludes h ardware f eatures m ost ten f ound o n r eal m achines. re a re t wo vers ions S IC, they a re, stard m odel (S I C),, ext ension v ersion (SIC/ XE) (ext ra equ ipment o r ext ra expen sive) SIC Machine Architecture : W e d iscuss h ere SI C ma chine a rchitecture w ith r espect t o i ts M emory R egisters, D ata F ormats, I nstruction Form a ts, A ddressing Mod e s, Instructi on S et, I nput O utput Memory: re a re 2 15 b ytes i n E ndian format t o memory contains 8-bit by t es. Registe r s: c omputer memor y, store n umbers, 3 consecut t hat s i 32,768 b y tes. I t u ses L ittle iv e by tes f orm a word, eac h loca tion i n re are f ive r egisters, each 24 b its i n leng th. ir mnemon ic, n umber use are given in the following t able. CSE, SJBIT 2

8 Mnemonic Number U se A 0 Accumulator; used for arithmetic operat ions X 1 I ndex register; used for addressin g L 2 L inkage register; JSUB PC 8 Program counter S W 9 S tatus word, including CC Da ta F o rmats: I ntegers a re s tored a s 24-b it b inary n umbers. 2 s c omplement r epresentation f or n egative v alues, c haracters a re s tored u sing ir 8-b it hardware on the standard version SI C. Instruc tion For m ats: Opcode ( 8) x Addre s s (15) ASCII code s. N o u sed floating- p oint A ll shown ab ove m achine instructions o n Addressing M odes: s tandard v ersion SIC have 24-bit f ormat a s Mode Indicati on Target address calcu lation Direct x = 0 T A = addres s In dexed x = 1 T A = address + (x) CSE, SJBIT 3

9 SY STEM SOFTWARE re a re t wo addressing m odes a vailable, which a re a s s hown i n Parentheses are used to indicate the contents a register or a memory l ocation. Instruction Se t : 1. SI C p rovides, l oad and a bove t able. s tore i nstructions (LD A, L DX, S TA, S T X, e t c. ). Intege arithmetic operations: (ADD, SUB, MUL, DI V, etc. ). 2. A ll a rithmetic o perations i nvolve r egister A a ord w i n memor y, r w ith r esult being left in the register. Two instructions are provided for subroutine linkage. 3. C OMP c ompares valu e i n a c ondition code C C t o indi ate regi ter s A w ith a w ord i n memor y, this instr ct u io n s ets c the resul re a re c onditional jump instructi o ns: ( JLT, JEQ, JGT), these instructions test the setting CC and jump accordingly. 4. JS UB j umps t o ubroutine s p lacing r eturn a ddress i n register L, RSU B re by jumping to the address contained in reg ister L. turns I n put and Output: I nput O utput a re p erformed by transferring 1 byte a t a t ime t o o r f rom r ightmost 8 b its r egister A ( accumulator). The T est Devi ce ( TD) instr uction t ests w hether a ddressed d evice ready to s end or re ceive a byte dat a. R ead Data ( RD), Wr ite D ata ( WD) are used for reading or writing data. Data movement and Storage Def inition L DA, S TA, L DL, ST L, LD X, S TX ( A- Accumu l ator, L L inkage R egister, X I ndex R egister), a ll uses3-b yte wo r d. L DCH, S TCH a ssociated w ith c haracters u ses 1-b y te. There are no memory-memory m ove instructions. Storage de finitions ar e WORD - ONE-WORD CO N STANT RESW - ONE-W ORD VARIABL E BYTE - ONE- BYTE CONSTANT RESB - ONE-B YTE VARIABLE CSE, SJBIT 4

10 1.3.2Example Programs (SIC): E xample 1: Simple data and character movement operatio n L DA F IVE S TA A LPHA LDCH CHA R Z STCH C1 ALPHA RESW 1 F IVE WORD 5 C HARZ B YTE C Z C 1 R ESB 1 E xample 2 : Arithmetic operat i ons L DA A LPHA A DD I NCR S UB O NE ST A BETA ONE WORD 1 ALPHA RESW 1 BEETA RESW 1 INCR RESW 1 CSE, SJBIT 5

11 E xample 3 : Looping and Indexin g operation LDX ZERO ; X = 0 MOVECH L DCH S TR1, X ; L OAD A FROM STR1... ST CH STR2, X ; STORE A TO S TR2 TIX ELE VEN ; ADD 1 T O X, TEST JLT MOV ECH STR 1 BYT E C HELLO WORLD STR 2 RE SB 11 ZERO ELEVE N WORD 0 WORD 11 E xample 4 : Input and Output operat ion INLOOP TD INDE V : TEST INPUT DEVIC E JE Q RD INLOO P INDE V : LOOP UNTIL DEVI CE IS READY : READ ONE BYTE IN TO A STCH DATA : S TORE A TO DATA.. OUTL P TD OUTDE V : TEST OUTPUT DEVI C E CSE, SJBIT 6

12 JE Q OUTLP : LOOP UNTIL DEVICE IS READ Y LDCH WD. DAT A OUTDE V : LOAD DATA INTO A : WRITE A TO OUTPUT DEVI C E. INDE V B YTE X F5 : IN PUT DEVICE NUMBER OUTDEV B YTE X 08 : OUTPUT DEVICE NUMBER D ATA RE SB 1: ONE-BYTE VARIABLE E xample 5: To transfer two hundred bytes data from input device to memory LDX Z E RO CLOOP T D JE Q RD IN DE V CLOO P INDE V S TCH R ECORD, X TIX B 200 J LT CLOO P.. INDE V B YTE X F 5 RECORD RESB 200 ZERO WORD 0 B 200 WORD 200 CSE, SJBIT 7

13 1.3.3SIC/XE Machine Memory Architecture: 0 Maximum memory available on a SIC/XE system is 1 Megabyte ( 2 2 by t es ). Register s A dditional B, S, T, and F re gisters are provid ed by S I C/XE, i n addi tion t o registers SIC. Mnemonic Number Speci al use B 3 Base register S 4 General working regi ster T 5 General working register F 6 Floating-point accumula t or ( 48 bits) Floating-point data ty p e: There is a 48-bit floating-point data type, F * (e-1024) s exponen t frac tion Instruc tion For m ats: The new set instruction formats fro SIC/XE machine architecture are a s follows. Format 1 ( 1 by t e) : contains only operation code (straight from table). CSE, SJBIT 8

14 S YSTEM S OFTWARE F ormat 2 ( 2 bytes ): first e ight its b f or operation c ode, next f our f or regis ter 1 f ollowing f our f or re gister 2. n umbers f or r egisters g o n umbers i ndicated a t the replaced by h ex 6). r egisters s ection ( ie, r egister T r F ormat 3 ( 3 b y tes) : F irst 6 b its c ontain o peration c ode, next 6 accor ding t o eplaced by hex 5, F b its ontain c f l ags, l ast 12 b its c ontain displacem ent f or address th e oper. O peration cod e u ses only 6 b its, t hus sec ond hex d igit ill w b e aff ected by the values the i ). f lags, i n o rder, a re: n, i, x, b, p, e. I ts functionality f irst tw o f lags ( n e xplained i n next sect ion. The last flag e indicates the instruc tion format (0 for 3 and 1 for 4 ). F ormat 4 ( 4 byt e s) : same a s that f ormat 3 ith require more than 12 bits to be represente d. w a n ext ra 2 hex d igits 8 ( b its) f or a ddresses Format 1 (1 byte) 8 o p F ormat 2 (2 bytes ) op r 1 r 2 Formats 1 and 2 are instructions do not reference memory a t all F ormat 3 (3 bytes ) op n i x b p e disp CSE, SJBIT 9

15 F ormat 4 (4 bytes ) op n i x b p e a ddress Addressing m odes & Flag Bi ts Five possible addressing modes plus the combinations are a s follows. 1. Direct x, ( b, p all set o t 0 ): o perand address goe s a s i t. n and i ar e b oth s et t o s ame v a lue, eith er 0 o r 1. W hile i n general t hat v alue is 1, i f se t t o 0 fo r format 3 w e c an a ssume that the r est the flags (x, b, p, e) are used as a p art address the operand, to make the format compatible to the SI C forma 2. Relative ( either b r o p e qual t o 1 he s hould b e a dded t o c urrent v alue s tored a t stored at the PC reg ter (if p = 1) t o ther o ne t o 0 ): a ddress ope rand B egister r ( if b = 1 ) o r t o v alue 3. Immediate( i = 1, n = 0): o perand v alue already enc losed o n ( ie. lies on the last 12/20 bits the instruction) i nstruction 4. Indirect( i = 0, n = 1 ): Th e o perand value p oints t o a n addre ss t hat h olds th e addre ss for the operand va l ue. 5. Indexed ( x = 1 ): v alue t o b e a dded t o va lue s tored a t a ddress the immedia t e. oper nd. re is g te r x t o o btain r eal a T his c an b e combi ned wit h any pr evious mo des exc ept The various flag bits used in the above formats have the following meanings e - > e = 0 means format 3, e = 1 mea ns format 4 CSE, SJBIT 10

16 B its x, b, p : U sed t o c alculate t arget a ddress u sing r e lative, direc t, M odes. Bits i and n: Says, how to use the target addres s indexe d a ddressing b p - b oth s et t o 0, d isp f ield f rom f ormat 3 instructio n t aken t o b e t arget addr e ss. F or a format 4 bits b and p are normally s et to 0, 20 bit address is the target address x - x is set to 1, X register value is added for targe t address calculation i=1, n=0 Immediate addressing, TA: TA is used as the operand value, no memory r eference i = 0, n = 1 I ndirect address i ng, (( T A) ): w ord at T A f etched. Value T A t aken a s the addres s the operand value i=0, n=0 or i=1, n=1 Simple addressing, ( TA) : TA is taken as the address the operand va lue T wo new rela tive address ing modes a re a vailable f or use w ith instructio ns a ssembled using for m at 3. Mo de Indicati on Base rel ative b =1,p= 0 Target address calcu lation T A=(B)+ d isp ( 0 disp 4 095) Program-c o unter r elative b =0,p=1 T A= ( PC) + d isp (-2048 disp 2 047) Instruction Se t : SI C/XE provide s a ll th e instructions t hat ar e availa ble o n the a ddition w e h ave, Instruc tions t o l oad nd standar d v ersion. In a s tore n ew r egisters L DB, S TB, e tc, Floating- p oint a rithmetic oper a tions, A DDF, S UBF, MU L F, DIVF, Reg ister m ove instruction : R MO, CSE, SJBIT 11

17 SYS TEM SOFTWARE Register-to-register arithmetic operations, ADDR, SUBR, MULR, DI V R and, instruct ion : SVC. I n put and Output: Supervisor call re a re I / O cha nnels th at c an be u sed t o perform input output w hile CPU e xecuting othe r i nstructions. Allows o verlap c omputing I /O, r esulting i n mor e e fficient sy stem operatio n. i nstructions S IO, T IO, HI O ar e u sed to s tart, t est h alt the opera tion I / O channels. Example Program s (SIC/XE) E xample 1: Simple data and character movement operati o n LDA # 5 STA ALP HA LDA # 90 S TCH C 1.. ALPH A RESW 1 C1 RESB 1 E xample 2 : Arithmetic operat i ons LDS INCR LDA ALPHA CSE, SJBIT 12

18 S YSTEM SOFTWARE ADD S, A SUB # 1 ST A BETA... A LPHA R ESW 1 BETA RESW 1 INCR RESW 1 E xample 3: L ooping and Indexing operatio n LDT #11 LDX #0 : X = 0 MOVE CH LDCH STR1, X : LOAD A FR OM STR 1 STCH S T R2, X : ST ORE A TO S TR2 TIX R T : ADD 1 TO X, TEST ( T ) J LT MOVEC H.. STR 1 STR 2 BYT E C HELLO WOR L D RESB 11 CSE, SJBIT 13

19 S YSTEM SOFTWARE R ECOMMENDED QUESTIONS: 1. Bring out the differences b/w Sy s tem stware and Application stware.( 5) 2. G ive SIC machine architecture with all o ptions? (10) 3. Suppose alpha is an array 100 word s. Write a sequence instructions for SIC\ X E t o set all 100 elem ents to 0. ( 6 ) 4. Write a sequence instructions for SIC to clear a 20 by t e string to all blanks.(6) 5. Give the machine architecture SI C /XE? (10) 6. With an example, explain simple I/ O operation SI C /XE? (5) CSE, SJBIT 14

20 CHAP TER Basic Assembler Functions: basic assemble r functions are: ASSEMBLERS- 1 Translating mnemonic language code to its equivalent object code. Assigning machine addresses to sym bolic labels. SOURCE ASSEMBLER OBJECT COD E P R OGRAM design assembler can be to perform the following: Scanning (tokenizing) Parsing ( validating instructions) Creating the symbol table Resolving forward references Converting into the machine languag e SI C Assembler Directive: S TART: Specify n ame & starting addres s. E ND: End the program, specify first execution instruction. B YTE, WORD, RESB, RESW E nd record: a null char( 00) End file: a zero leng t h record design assembler in other words: Convert mnemonic operation codes to their machine language equivalents CSE, SJBIT 15

21 S YSTEM SOFTWARE Convert symbolic operan ds to their equivalent machine addresses D ecide prope r represen tations i nstruction f ormat C onvert d ata c onstants t o Write the object program and the assembly l isting i nternal m achine S o f or d esign ssembler a w e n eed o t con centrate o n machine a rchitecture S IC/XE m achine. W e ne ed t o identify alg orithms v arious d ata s tructures t o b e used. A ccording t o the a bove require d steps f or as sembling a ssembler a lso h as t o h andle a ssembler d irectives, the se d o n ot g enerate the perform certain operat ion. These directives are: The assembler desig n can be done: S ingle pass assembler Multi- p ass assembler o bject c ode b ut directs a ssembler t o Single-pass Assem b ler: d one i n I n t his case single ass. w hole pr ocess s canning, pars i ng, o bject code co n version p only proble m w ith t his m ethod r esolving f orward referenc e. is shown with an example bel o w: T his FIR ST STL RETADR RETADR RESW 1 CSE, SJBIT 16

22 I n a bove exa mple i n l ine n umber 10 i nstruction STL w ill s tore lin kage r egister with c ontents RE TADR. But d uring the processing t his instructio n v alue t his sy mbol n ot kn own a s i t a ssembler scanning, parsing and i nstruction f et ched; i t s canned or d efined at lin e o bject code v alid n i t has t o b e co nverted to its equivalen t generate d f or opcode STL which is not availa b le. D ue t o t his eason r usua lly desig n n umber 95. S ince I single- p c onversion happe ns simultaneousl y. ass f tok e ns, par sed f or syntax sema ntic validit y. I f i t o bject cod e. F or t his o bject cod e v alue f or sy mbol R ETADR n eed t o b e add e d, d one i n tw o p asses. S o a multi-pas s a ssembler r esolves f orward r eferences n converts i nto o bject c ode. H ence proc ess the multi-pass assembler can be a s follows: Pass-1 Assign addresses to all the statem ents Save the addresses assi gned to all labels to be used in Pass-2 P erform s ome p rocessing a ssembler irectives length data areas for assigning address values. Defines d s uch a s R ESW, R ESB t o the symbols in the symbol table(generate the sy m bol table) f ind Pass-2 Assemble the instructions (translating operation codes and looking up addres ses). Generate data values defined by B YTE, WORD e t c. Perform the processing the assembler directives not done during pass-1. Write the object program and assembler listing. Assembler D esign: m ost i mportant t hings whic h n eed t o be concentrated g eneration Symbol table and resolving forward references. CSE, SJBIT 17

23 SYSTEM SOF TWARE Sy m bol Table: This is created during p ass 1 A ll the labels the instructions are symbols Table has entry for sy m bol name, address value. Forward reference: Symbols t hat a re d fined referencing. e i n lat r e pa rt the program are called forw re w ill n ot b e any add ress v alue f or suc h sy mbols i n p ass 1. s mbol ard y t able i n Example Program : The example prog ram considered here has a main module, two subroutines Purpose example program - R eads records from inpu t device (code F1) - Copies them to output device (code 05) - At the end the file, writes EOF on the output device, then RSUB t o the operating sys tem Data transfe r ( R D, WD) - A buffer is used to store rec o rd -Buffering is necessary for different I/O rates -The end each record is marke d with a null character ( 00)16 -The end the file is indicated by a zero- l ength record Subroutines (JSUB, RSUB) -RDREC, WRREC -Save link register first befor e nested jump CSE, SJBIT 18

24 S YSTEM SOFTWARE f irst c olumn s hows l ine n umber f or t hat i nstruction, s econd column s hows a ddresses a llocated t o s tatement, e ach i nstruction. t hird c olumn i ndicates l abels g iven t o followe d by column gives the equivalent object code. o bject c ode late r wi ll b e i nstruction con sisting program we use contains three ty p es records: Header r e cord - C ol. 1 H - C ol. 2 ~7 Program name - C ol. 8~13 Starting a ddress object program (hex) - C ol. 14~19 Length object program in b y tes (hex) Text record - C ol. 1 T opcode and o perand. l ast l oaded i nto m emory for executi o n. s imple o bject - C ol. 2~7 Starting address for object code in this record ( he x ) CSE, SJBIT 19

25 - C ol. 8~9 Length object code in this record in by t es (hex) - C ol. 10~69 Object code, represented in hex (2 co l. per by t e) End record - C ol.1 E - C ol. 2~7 A ddress separation only f irst ex cutable e i nstruction in o bject prog ram ( hex) ^ only f or Simple SIC Assemb ler prog ram b elow sho wn w ith o bject c ode generated. c olumn n amed L OC g ives m achine a ddresses s tarting a t e ach pa rt locatio n 1000). t ranslation requires us to accomplish the following func t ions: a ssembled p rogram ( assumin g s ource p rogram t o pro g ram o bject p rogram 1. Convert the mnemonic operation codes to their machine languag e equivalen 2. Convert symbolic operan ds to their equivalent machine a ddresses. 3. Build the machine instructions in the prope r forma 4. C onvert d ata consta nts s pecified i n machine representations in the proper for m a 5. Write the object program and assembly listing. so urce prog ram into ir int e rnal A ll thes e s teps exc ept the s econd c an be performe d by progra m, one line at a time. Consider the instruct ion sequ ntial e p rocessing sou rc e LD A ALP HA T his i nstruction c ontains f orward referenc e, i. e. s ymbol ALPH A u sed y et de fined. I f the prog ram processed ( scanning p arsing object c ode c onversion) d one line-by-lin e, w e w ill b e u nable t o resolv e a ddress t his y s m b ol. D ue t o problem most the assemblers are designed to process the program in two passe s. n ot t his CSE, SJBIT 20

26 I n a ddition t o t ranslation t o h andling a ssembler d irective. se d irectives d o d irection t o a ssembler t o o bject p rogram, a ssembler h as t o n ot h ave o bject con p erform s ome functi o n. E xamples t ake c are v ersion ut b g ives d irectives a re s tatements l ike B YTE and W ORD, w hich d irects a ssembler t o re serve memory locatio ns w ithout gene rating d ata v alues. The othe r dire ctives a re S TART whi ch indicates beginning the prog ram and END indicating end the program. a ssembled prog ram w ill b e l oaded i nto m emory f or ex e cution. s imple o bject p rogram c ontains t hree ty pes r ecords: Heade r r ecord, Text h eader r ecord c ontains th e starting addr ess and lengt h. i nstructions d ata th e pro g ram, tog ether with a n a re to b e load e d. The en d recor d address where the execution is to beg i n. The format each record is as given bel ow. He ader rec o rd: Col 1 H Col. 2-7 Prog r am name m arks end r ecord and e nd r ecord. T ext record contai ns t ranslated i ndication obj Col 8-13 Starting address object program (hexadecima l ) Col L ength object program in bytes (hexadecimal) Text recor d : Col. 1 T ad resses d whe re these e ct program spec ifies Col 2-7. Starting address for object code in this record (hexadecima l ) Col 8-9 Length f object code in this record in by t es (hexadecimal) Col Object code, represented in hexadecimal (2 columns per byt e object code) CSE, SJBIT 21

27 End recor d : Col. 1 E Col 2-7 Address first executable instruction in object progra m ( hexadecima l ) asse mbler c an be designed e ither as a single pass assembler or a s a assembler. general description both passes as given below: t wo pa ss P ass 1 (define symbols) Assign addresses to all statements in the program S ave the addresses assigned to all labels for use in Pass 2 P erform a ssembler d irectives, i ncluding t hose f or a ddress assi g nment, s uch as BY TE and RESW P ass 2 (assemble instructions and generate object program) A ssemble instructions (generate opcode and look up addresses) Generate data values defined by BY TE, WORD Perform processing assembler directives not done d uring Pass 1 Write the object program and the assemblyl isting A lgorithms and Data structure s imple a ssembler us es t wo m ajor i nternal d ata s tructures: opera tion C ode Table (OPTAB) and the Sy m bol Table (SYMTAB). OP T AB: It used t o l ookup mnemo nic operatio n codes an d translates m t o thei r language equivale n ts. In more c omplex assemblers table also c information about instruction format and leng t h. m achine o ntains CSE, SJBIT 22

28 I n p ass 1 O PTAB progra m. In p ass 2, i t u sed t o u sed t o l ook u p translate he alidate s imple S IC machine t his p rocess c an b e performe d i n B ut f or machine l ike SI C/XE tha t s earch O PTAB i n th e LO CCTR. f irst p ass t o v o peration c ode i n s ource t operatio n c odes to m achine langua g e. In h as i nstructions e ither i n p ass 1 o r i n different len g ths, w e p ass 2. m ust f ind in struction l ength f or incrementi ng In p ass 2 w e take use inf rmation rom OPTAB to t ell u s w hich instruction f ormat t o in assembling the instruction, and any peculiarities the object code i nstruction. O PTAB key. retrieva l usually o ga r ni zed a s a hash t able, with m nemonic operatio n co de a s ha sh t able org anization w ith a m inimum s earching. M ost particularly a ppropriate, s ince i t pro c ases O PTAB a v ides f ast s tatic table- t hat, e ntries a re n ot normally added t o or d eleted f rom i I n suc h c ases i t p ossible t o d esign a pecial s h ashing f unction o r o ther d ata structur e t o give optim um performance for the particular set keys being stored. SYM T AB: T his t able includes na me and val ue for each l abel i n the sourc e progra m, together w ith f lags t o indicate error c onditions ( e. g., i f a sy mbol defined i n two differe nt place s ). Durin g P ass : 1 l abels a re e ntered i nto symb ol t able a long w ith ir a ssigned a ddress v alue a s they ar e encountered. A ll resolved at the pa s s 1. sy mbols a ddress value s hould g et During Pass 2: Symbols used as operands are looked up the symbol table to obtain the address value to be inserted in the assembled instruc t ions. SYMTAB is usually organized as a hash table for efficiency insertion and retrieval. S ince entries a re rarely d eleted, efficiency de letion optimizati o n. i mportant cr iteria f or CSE, SJBIT 23

29 B oth p ass 1 pa ss 2 r equire reading so urce pro g ram. A part f rom t his a n i ntermediate f ile c reated by p ass 1 t hat contain s e ach s ource s tatement t ogether with its assigned address, e rror indicators, e tc. T his f ile is o ne i nputs to p ass 2. A cop y the source program is also an input to th e pass 2, which is us ed to retain the o perations t hat may be performed during p ass 1 ( such a s sca nning operatio n f ield f or symbo ls addressin g f lags), s o tha t se ne ed n ot be perf ormed dur ing pa ss 2. Similarl y, pointer s i nto O PTAB and S YMTAB r etained f or ea ch operat and sym bol used. This avoids need to repeat many the table-s earching operations. io n c ode L OCCTR: Apar t f rom S YMTAB O PTAB, t his a nother i mportant v ariable w hich h elps i n a ssignment addres s es. L OCCTR S TART s tatement a ssembled i nstruction i nitialized t o the p rogram. A fter ea ch s tatement a dded t o L OCCTR t o m ake i t beginning dd a re ss mentioned i n processed, he p oint t o t l ength the e n xt i nstruction. W henever a la bel encou ntered i n a n instruc tion L OCCTR v alue gives a ddress t o b e associated with that labe l. Begi n Algorithm for Pass 1: read firs t input line if OPCODE = START then begi n save #[Operand] as starting a ddr initialize LOCCTR to starting addres s write line to intermediate fi le read ne x t line e nd( i f S TART) CSE, SJBIT 24

30 e lse initialize LO CCTR to 0 W hile OPCODE!= E ND d o begi n if this is not a commen t line then begi n i f there is a symbol in the LABEL field then begi n search SYMTAB for LAB E L i f f ound n set error flag (duplicate sy m bol) e lse ( if sy m bol) search OPTAB for OPCODE i f else else f ound n add 3 (instr length) to L O CCTR if OPCOD E = WORD n add 3 to LO CCTR if OPCODE = RESW then add 3 * #[OPERAND] to LO CCTR e lse if OPCODE = RESB then CSE, SJBIT 25

31 a dd #[OPERAND] to LO CCTR begi n e nd e lse if OPCODE = BYTE n e lse find length constant in byt es add length to LO CCTR set error flag ( invalid opera tion end (if not a comme n t) write line to intermedia te fi le read nex t input line e nd { whi le n ot E ND} write last line to intermedia te fi le code) Save ( L O CCTR starting address) as program leng t h E nd { pass 1 } a lgorithm s cans f irst s tatement S TART s aves operand f ield ( the a ddress) a s star ting a ddress the progr a m. Initiali zes L OCCTR v alue t o thi s addres s. This line is written to the intermediate line. I f I f n o o perand e ncountered, symbol h as t o associa ted address value. menti oned L OCCTR b e e ntered i n sy mbol already e xists t hat i ndicates a n So an error flag is set indicating a duplication the sym bol. initialize d t o z e ro. I f a l abel sy mbol t able along w ith i ts entry s ame sy mbol already ex ts. CSE, SJBIT 26

32 It next c hecks f or m nemonic c ode f ound n l ength the next instruction., i t i nstruction s earches for this code i n the a dded t o O PTAB. I f L OCCTR t o m ake it p oint t o I f the opcode d irective W ORD i t a dds a v alue 3 t o LOCC T R. If it RESW, i t n eeds t o a dd number d ata ord w t o LOCC T R. I f it one to the LOCCTR, if RESB it adds number byt es. I f i t p rogram b y E ND d irective n i t e nd e valuating c urrent L OCCTR he prog o perand f ield END directi v e. Ea ch processed ine f ile. ra m i t B YTE i t a dds a v alue f inds l ength t start ing a ddress m entioned i n l w ritten t o int e rmediate The Alg o rithm for Pass 2: Begi n r ead 1st input l ine i f OPCODE = START then begi n write listing l ine read next input line e nd write Header record to object program initialize 1st Text record w hile OPCODE!= E ND d o begi n if this is not comme n t line then begi n CSE, SJBIT 27

33 s tore e lse search i f OPTAB for f ound n begi n if O PCODE there is a sym bol in OPERAND field then begi n search i f SYMTAB for OPERAN D fi eld then f ound n begi n symbol value as operand address begi n store convert 0 as operand addres s e nd end (if sy m bol) set error flag ( undefined sy m bol) else store 0 as operand addres s else assemble the object code instruct ion if OPCODE = BY TE o r W ORD n constant to object code if object code doesn t fit into current Text record then begi n CSE, SJBIT 28

34 Write text record to obje ct code initialize new Text record e nd e nd add object code to Text rec o rd {if not comment} write listing l ine read nex t input line e nd write listing l ine read nex t input line write last listing l ine End {Pa s s 2} H ere f irst i nput l ine is read fr om intermedi ate f ile. I f opcode S T ART, n t his l ine directly w itten r t o list f ile. A h eader r ecord w ritten i n bject o prog ram w hich g ives star ting address leng th pr ogram ( wh ich c alculated d uring pa ss 1 ). n f irst t ext r ecord initializ e d. C omment l ines a re i gnored. I n i n struction, f or opcode the OPTAB is searched tind the objec t code. I f a sy mbol re in o perand f ield, sy mbol t able searched t o a ddress v alue f or t his w hich g ets adde d t o ob ject c ode opcode. I f addre ss n ot f ound n ze ro v alue is s tored a s und o perands ad d ress. A n e rror f lag se t g et indica ting i t a s efine d. I f sy mbol i tself n ot f ound n store 0 a s o perand a ddress and o bject code instruc tion is as sembled. CSE, SJBIT 29

35 I f the o pcode BYTE r e quivalent o bject c ode( f or ex a mple, f or characte r 454f46 is stored ). I f o bject code c annot f it int o c reated r est nstructions o bject p r ogram. O nce w hole prog ram encountered, the End record is written. Design and Implementation I s sues S ome f eatures in pro p rogram f or SI C mach n a ddressing m odes. W e i e, o W ORD, n c onstant v alue E O, F i ts urrent e quivalent hex convert ed t o i ts a decimal v alue c t ext r ecord, a n ew text record i o bject c ode l ted. t ext r ecords a re w ritten t o n w e h ave only g ram d pend a ssemble and when E ND directiv e is e on architec ture m achine. I f h ave only s ingle opera l imited nstruction i f ormats h ence l imited n d i nstructions. o perand m emory r eference. Any thing t o b e fe tched from memory require s alway s a m ore t ime. H ence i mproved v ersion SIC/ XE m achine p rovides m ore i nstruction f ormats h ence m ore a ddressing m odes. m oment w e n umber change the i nstruction f ormats address usually requires considering two independent features. thing s : in g m achine a rchitecture th e av ailability m odes chan g es. refore des Machine-dependen t features an d ign Machine Machine-endent Assem b ler Features: I nstruction formats and addressing modes Program rel ocation I nstruction formats and Addressing M odes i nstruction for mats d epend on memory or ganization size memor y. I n SI C m achine m emory byte addressabl e. m emory 2 12 by t es. According r egisters: r egister A and ly i t s upports only W ord s ize 3 b o ne nstruction y tes. S o i form a I t size h as only t wo Index r egister. refore addressing m odes s upported by thi s a rchitecture a re di r ect, i n direct, and i ndexed. W hereas memory a SI C/XE mac hine 2 20 byte s (1 MB). This supports four different types instruction types, they are: CSE, SJBIT 30

36 1 byte instruct ion 2 byt e instruction 3 byt e instruction 4 byt e instruction I nstructions can be: Instructions involving register to register I nstructions w ith o ne ope rand i n operand instruc t ion) Extended instruction form at A ddressing Modes are: Index Addressing( SIC): Opco de m, x Indirect Addressing: m PC-relative: Opcode m B ase relative: Opcode m Immediate addressing: Opcode # c memory, oth er i n A ccumulator ( Sing le 1. Translations for the Instruction involving Register-R egister addressing mode: D uring p ass 1 r egisters c an b e e ntered a s p art s mbol y t able i tself. v alue f or se r egisters ir equ ivalent n umeric c odes. D uring p ass2, se v alues a re a ssembled a long w ith m nemonics o bject c ode. I f r equired a separa te t able c an be c reated w ith register names and their equivalent numeric va l ues. 2. Translation involving Register-Memory instructio n s: In S IC/ XE machine there are four i nstruction formats five a ddressing m o des. For format s and addressing m odes A mong i nstruction f ormats, f ormat -3 format-4 i nstructions a re Register-Memor y t ype i nstruction. O ne o perand alway s i n a r egister other o perand i n CSE, SJBIT 31

37 memory. The addressing m ode t ells u s be fetche d. way in hich w oper and from the memory t o re a re t wo wa y s: Program-counter r elative and Base-rela tive. T his add ressing m ode c an b e r epresented by ei her t u sing format-3 ty pe o r format-4 ty pe i nstruction f orma In format- 3, instruction h as o pcode f ollowed by a 12-b it d isplacement v alue i n a ddress f ield. W here a s in format-4 the i nstruction c ontains mnemonic c ode f ollowed by a 20-bit displacement value in the address fiel d. Program- C ounter Relative: I n t his usually format-3 i nstruction f ormat us e d. followed by a 12-bit displacement va l ue. nstruction i contai ns o pcode r ange displaceme nt v alues a re f rom T his d isplacement ( should b e s mall e nough tit in a 12-bit field) value is added to the current contents the progr a m counter to get the target address the operand required by the instruc t ion. T his r elative way calculating addre ss counter. Hen ce d isplacement ope r and operan r elative t o val ue. following example shows how the address is calculated: d rela tive to prog current progra m coun ram te r CSE, SJBIT 32

38 S YSTEM SOFTWARE Base-Relative Addressing M ode: In this mode the base register is used to mention the displacement value. Therefore the targe t TA = (base) addres s is + displacement value T his a ddressing m ode Hence u sed hen w rang e d isplacement v alue n ot s ufficien the operan d n ot r elative t o i nstruction a s i n PC-r elative addressin g m ode. Whenever this mode is used it is indicated by using a directive B A SE. m oment the assembl er encounters t his directi ve next instructio n u ses base- relative addressing mode to calculate the targ e t address the operand. Wh en N OBASE directive u sed n i t i ndicates b ase r egister n o m ore u sed t o c alculate tar when g et a ddress p o e r and. A ssembler f irst choose s PC- r elative, the displacement field is not enough it uses Base-rel ative. L DB # LENGTH ( instructio n) B ASE L ENGTH ( directive) : NOBA SE CSE, SJBIT 33

39 For example: LD B #LE NGTH 69202D 13 BA SE LE NGTH : : LE NGTH RESW BUFFE R RESB 4096 I n : : E STCH BUFF E R, X 57C TIX R T B8 50 a bove exa mple u se dir e ctive AS m ode t o b e u sed t o c alculate targ et a ddress. PC-r elative n o LENGTH calcula t ed is: stored i n b ase registe r. f B E i ndicates t hat Base-relati ve addressin g I PC-r elative LDB instruc tion l oads value leng th in base l onger sed. u sed then tar u v alue g et addr ess register which BASE directive explicitly t ells the assembler that it has the value LEN GTH. BUFFER is at loca t ion (0036) ( B) = 0033) ( 16 d isp = = 0003) ( A LDA LENGTH CSE, SJBIT 34

40 S YSTEM SOFTWARE : : EXIT STX LENGTH Consider L i ne 175. If we use PC-rel ative D isp = T A ( PC) = = EFD A PC relative is no longer applicable, so we try to use BASE relative addressing m ode. Immediate Addressing M ode I n is t his m ode n o the operand itsel f. m emory efe r re nce i nvolved. I f i mmediate m ode u sed t arget address If the sy mbol r eferred in i nstruction a s i mmediate o perand n i t i mmediate w ith PC- relative mode as shown in the e x ample below: CSE, SJBIT 35

41 Indirect and PC- relative m o de: I n t his ty pe instruction he w hich c ontains addre ss addressing m ode. F or example: t sy mbol use d i n the i nstruction o perand. a ddress t his ad dre ss f ound u sing PC- r locatio n elative i nstruction j umps c ontrol t o a ddress calcula ted above. o perand. I f 2.2.2Program R elocation a ddress address l ocation R ETADR w hich i n R ETADR s S ometimes i t r equired t o l oad r un s everal pr ograms a t b e a ble t o l oad hese t p rograms whereve r starting not known until the load time. Absolute Program re t urn h as i 0030, t arget addre ss n 0003 a s p lace i n ame s time. s ystem m ust emo m r y. refore exa ct I n t his a ddress Consider the instruc t ion: m entioned uring d assemblin g i tself. T his c alled bsolute A A ssembly B LD A THREE 00102D T his s tatement s ays t hat r egister A 102D. S uppose i t deci ded t o instead loc at ion n a t a ddress 02D l oad n loade d w ith v alue s tored a t locatio n a d exe cute program a t locatio n the r equired va lue w hich ne eds t o b e l oaded i n re is g te r A is no m ore a vailable. The address also gets chang ed relative to the displacement CSE, SJBIT 36

42 p rogram. H ence w e nee d t o m ake s ome c hanges i n a ddress p ortion the instruction so that we can load and execute the program at locat ion A part f rom instruction w hich w ill undergo a change i n their pe o r a ddress v alue a s the program load a ddress chan g es. There exi st s ome p arts i n pr ogram which will remain same regardless where the program is being loade d. S ince a ssembler w ill n ot k now a ctual loca tion w here prog ram w ill g et l oaded, i t c annot m ake necessary chang es i n ad dresses u sed i n pro gram. H owever, a ssembler i dentifies f or l oader t hose p arts p rogram w hich need modific at ion. A n o bject p rogram t hat h as i nformation necessary t o modification is called the relocatable progra m. perfor m t his k ind a bove diagram shows conce pt relocati o n. I nitially program locat ion The instruction JSUB is loaded at loca t ion a ddress fie ld t his i nstruction c ontains 01036, w hich i nstruction l abeled R D REC. s econd figur e loade d at new location s hows t hat i f add l oaded a t r ess p rogram t o b e CSE, SJBIT 37

43 addr ess the i nstruction JS UB g ets modifie d t o new locatio n LikewCS E t hird f igure s hows th at i f i nstruction w ould n eed t o addre s s RDREC. o nly pa rt b e prog ra m r elocated a t locatio n 7420, JSU B chang ed t o 4B t hat c orrespond to n ew p rogram t hat r equire m odification a t l oad t ime a re th o se t hat specify d irect a ddresses. r est instructio ns n eed n ot b e mo d ified. i nstructions w hich d oesn t r equire m odification a re o nes t hat address (immediate addressing) and PC-relative, Base-relative instruc t ions. n ot a memo From the object program, it is not possible to distinguish the address c onstant The a ssembler m ust k eep s ome i nformation t o contains the modification record is called a relocatable progra m. F or a n a ddress a l b e l, it s a ddress assigne d r y t ell loader. The o bject p rogram t hat r elative t o ( START 0 ). The assem bler p roduces a Modif ication recordt o l ocation l ength a ddress f ield t o be s tart the progra m s tore start ing modi f ied. c ommand f or l oader m ust a lso b e a p art objec t p rogram. M odification h as f ollowing for m at: Modification record Col. 1 M Col. 2-7 Starting location the address field to be modified, rel ative to the beginning the prog r am (Hex) Col. 8-9 Length the address field to be modified, in half-by t es (Hex) O ne m odification r ecord c reated f or e ach a ddress t o b e m odified length s tored i n half-by tes ( 4 b its) The sta rting loc ation l ocation byte containing leftmost bits a ddress f ield t o b e m odified. I f fi eld c ontains a n starting location begins in the middle the first by t e. o dd n umber half-b y tes, CSE, SJBIT 38

44 S YSTEM SOFTWARE I n a bove o bject code r ed boxe s o bject c ode l ines a t i ndicate he e nd a re descripti i nstructions w hich n eed chang e if s uggested f or he t a ddresses t hat n eed m odificati ons. on s m odification r ecords f or t hose reloc ation o ccurs. M is th e modificatio n t s tatement a t l ocation 0007 and re quires m odification 5-hal f bytes. Similarly the remaining instructions indica t e. R ECOMMENDED QUESTIONS: 1. W hat are the fundamental functions assembler? With an example, g ive the list a ssembler directives? ( 6) 2. Explain the data structures used in Assemble r s ( 8 ). 3. w hat is program relocation? Explain the problem associated with it and solutions? (6) 4. Give the format the following ( 8) a. Header r e cord b. Text record c. End record d. Modification record 5. Explain the function each pass an 2 pass assembler.( 5 ) 6. Explain the follo wing ( 8) a. SYMTAB b. LOCCTR c. OPTA B 7. Give the alg orithm for pass1 an 2 pass assem bler. ( 8) 8. Give the alg o rithm for pass2 an 2 pass assembler ( 8 ) CSE, SJBIT 39

45 S YSTEM SOFTWARE CHAP TER -3 Assembler Machine-Independent features: These are the features which do not depend on the architecture the machine. These are: Literal s Expressions Program block s C ontrol sections Liter a ls: E xample: A literal is defined with a prefix = followed by a specification the literal value A ENDF IL LD A = C E O F LT ORG 002D * = C E O F 454F46 e xample a bove show s a 3-byte oper who se v alue a c haracter s tring EO F. o bject code v alue f or the i nstruction a lso m entioned. I t s hows rela tive d isplacement the location where this value is stored. I n the example the value is at location (002 D ) h ence displaceme nt v alue ( 010). A s a nother exa mple given s tatement b elow shows a 1-byt e literal with the hexadecimal value WLOOP TD =X 05 E32011 CSE, SJBIT 40

46 I t i mportant t o u nderstand differenc e betw e en a onstant c d efined a s a l iteral a c onstant de fined a s an i mmediate oper. I n c ase l iterals the a ssembler g enerates the s pecified va lue as a const ant a t some other memory loc ation In immediate m ode ope rand value is assembled as part the instruction itsel f. Exa m ple LD A # A ll l iteral pools. T his l iteral operands u sed i n a prog ram a re gathered together into one o r mor e usually p laced a t e nd r p rogram containing l iterals usually i ncludes a l isting p ogr a m. assembly l isting a t his l iteral p ool, w hich s hows a ssigned a ddresses and gener ated da ta values. I n s ome c ases i t plac ed a t some o ther l ocation i n o bject p rogram. A n LTORG enc ountered, i t s ince b eginning a ssembler directive L TORG u sed. W henever c reates a literal p ool t hat c ontains a ll p rogram. l iteral p ool d efinition encountere d. It is better to place the literals close to the instruc t ions. A l iteral t able c reated f or l iterals w hich a re u sed i n lit e ral op rand e s u sed d one a fter L TORG p rogram. l iteral t able c ontains the l iteral n ame, o perand v alue l ength. l iteral ta ble usually c reated as a hash table on the literal name. Im plementation L i terals: During Pass- 1 : l iteral encountered searche d i n l iteral t a ble. I f l iteral already ex ts, n o a ction t aken; i f i t no t p resent, the v alue i t w aits t ill i t l iteral a dded t o the LITTAB an d f or the addre ss encount ers LTO RG f or l iteral d efinition. W hen P ass 1 e ncounters a L TORG s tatement o r e nd p rogram, a ssembler m akes a s can l iteral t able. A t t his t ime each l iteral currently i n the a ssigned, l ocation c ounter litera l. u pdated t o t able assigned a n ad dress. A s r eflect n umber b ytes a ddresses a r e o ccupied by e ach CSE, SJBIT 41

47 During Pass- 2 : a ssembler s earches LITTAB f or each l iteral enc ountered i n i nstruction r eplaces it w ith i ts e quivalent v alue a s i f se v alues a re generate d by B YTE o r W O RD. I f a l iteral r epresents a n r elocation f or, if i t a ll it a ddress i n r g ets affecte d due t o r difference between the SYMTAB and LIT TAB p o g ram, th e a ssembler m ust g enerate a m odification elocati n. o following figure sh ows Symbol-Defining Statem e nts: EQU Stateme n t: M ost a ssemblers provide a n a ssembler directive t hat a llows programme r t o de fine s ymbols specify thei r v alues. dire ctive u sed f or this form the statemen t is EQU ( Equate). g eneral Sym bol EQU v alue T his s tatement d efines th e give n sy mbol ( i. e., ent ering i n S YMTAB) assigning t o i t the value spec ified. The v alue c an b e a c onstant or an exp ression involv ing c onstants any o ther sy mbol w hich already d efined. O ne c ommon u sage t o d efine symb olic name s t hat can be used to improve readability in place numeric values. For exam ple +LD T # 4096 CSE, SJBIT 42

48 T his lo ads r egister T w ith i mmediate v alue 4096, t his d oes n ot clearly wha t exactly this value indica tes. If a statement is include d a s : MAXLE N EQU 4096 n +LD T # MAXL E N n i t clearly ndicates i t hat v alue M AXLEN s ome aximum m l ength v alue. W hen a ssembler e ncounters E QU s tatement, i t e nters sy mbol MAXLEN a long w ith i ts v alue i n s mbol y t able. D uring L DT asse mbler s earches S YMTAB f or i ts entry i ts equivale nt value a s operand i n the instructi o n. obje ct code gene rated s ame f or b oth options d iscussed, b ut easier t o underst and. I f maxi mum l ength chang ed f rom 4096 t o 1024, i t d ifficult t o w herever required i n i nstructions. W e c hange i f i t h ave t o s can the m entioned s w hole pro a an imm ediate v alue g ram nd a m ake chang es wherever 4096 is use d. If we mention this value in the instruction through the sym bol defined b y E QU, w e may n ot h ave t o MAXLENGTH in the EQU statement (only o nce). Anor c ommon u sage s earch w hole p rogram b ut chang e only E QU s tatement v alue f or d efining v alues f or th e gen eral- p urpose r egisters. ass embler c an u se mne monics f or r egister usage lik e a-registe r A, X index n ames i n register and so o n. B ut there are some instructions which requires numbers in nstruct place i i o ns. F or exa mple i n i nstruction R MO 0,1 i nstead R MO A, X. The programmer can assign the numerical values to these registers using EQU directive. A X EQU 0 EQU 1 s o on se s tatements w ill c ause sy mbols A, X, L t o be t able w ith ir r espective v alues. A n instruction R MO A, X enter ed into symbol w ould the n b e l a l o wed. A s a nother usag e i f i n a mac hine t hat h as many gene ral pur pose r egisters nam ed a s R 1, R 2,, s ome m ay b e u sed a s c hange f rom o ne pr ogram t o EQU state m ents. BA SE EQU b ase r egister, s ome may b e anothe r. I n R1 t his cas e u sed a s w e a ccumulator. ir u sage may c an de fine these r equirement using CSE, SJBIT 43

49 S YSTEM SOFTWARE IN DEX EQU R2 COUN T EQU R3 O ne restriction w ith u sage EQU whateve r sy mbol oc curs i n the r ight h and side the A s EQU should be predefined. For example, the follo wing statement is not valid: BE TA EQU ALP HA ALP HA R ESW 1 sy mbol AL PHA is a ssigned t o k nown. ORG Stat e ment: B ETA b efore i t d efined. v alue A LPHA T his d irective c an be u sed t o indirectly assig n valu es t o s y mbols. d irective usually called ORG (for orig in). I t s general format is: n ot ORG v alue W here v alue a c onstant o r a n sy m bols. W hen t his s tatement e xpression involving c onstants previously d efined encount re e d dur ing assembly a progr a m, a ssembler r esets i ts loca tion counte r ( L OCCTR) t o the spe cified va lue. S ince v alues sy mbols u sed as labels are taken from LOCCTR, the ORG s tatement will affect the v alues a ll labels d efined u ntil next O RG e ncountered. RG O u sed t o c ontrol ssig a nment object program. Sometimes altering the values may result in incorrect assembly. s torage i n O RG can be u seful i n labe l definitio n. Suppose w e n eed t o d efine a sy mbol t able w ith the following structure: SYMBO L VALU E FLA G 6 By t es 3 By t es 2 By t es The table looks like the one give b n e l ow. CSE, SJBIT 44

50 S YSTEM SOFTWARE sym bol fie ld contain s a 6-by te r epresentation va lue assigned t o s m user-d efined s y mbol; V ALUE a one- y b o l; F LAG s i a 2-by te w ord f ield s pecifies sy mbol typ e and other information. The space for the ttable can be reserved by statement: STAB RESB 1100 I f w e wa nt t o re fer t o th e entries the table us ing indexe d addressing, place fset value the desired entry f rom the be ginning the t able i n the index registe r. To r efer t o f ields SYMBO L, V ALUE, and L as shown be l ow: F AG S individuall y, w e need t o ass ign va lues f irst SYMBO L VALU E FLAGS EQU EQU EQU S TAB STAB + 6 STAB + 9 T o r etrieve the VALUE f ield f rom t able i ndicated by r egister X, state m ent: w e c an w rite a LD A VAL U E, X The same thing can also be done using ORG statement in the following way: CSE, SJBIT 45

51 STAB RESB 1100 ORG S TAB SYMBO L VALU E FLA G RESB 6 RESW 1 RESB 2 ORG STAB f irst s tatement a llocates 1100 by tes memory assig ned t o l abel S TAB. I n s econd s tatement the OR G s tatement i nitializes locatio n counte r t o th e value STA B. N ow L OCCTR p oints t o S T AB. next t hree l ines assig n a ppropriate memory storag e t o e ach f o S YMBOL, V ALUE F LAG symb o ls. l ast O RG s tatement reinitialize s L OCCTR t o a new value a fter skipping the require d n umber memory for ta ble STAB ( i. e., STAB+ 1100). W hile u sing O RG, symb ol o ccurring i n st atement s hould b e prede fined as required in EQU statemen F or example for the sequence state ments below: ORG ALP HA BYTE1 BYTE2 BYTE3 RESB 1 RESB 1 RESB 1 ORG ALP HA RESB 1 seque nce c ould not b e processed a s the symb ol u sed t o assign new l ocation c ounter value n ot defi n ed. I n f irst p ass, a s a ssembler w ould n ot kno w w hat v alue t o a ssign t o ALP H A, the o ther s mbol table. This is a kind problem the forward reference. y i n next l ines a lso c ould no t b e de fined i n th e sy mbol CSE, SJBIT 46

52 3.1.3.Expressions: A ssemblers also allow use expressions in plac e operands in the instructio n. Each s uch exp ression m ust b e e valuated t o g enerate a sin gle ope rand value o r addres s. Assembler s generally a rithmetic e xpressions formed acc ording t o the o perators +, - *, /. D ivision usually d fined e t o m ay b e c onstants, user-d efined s y mbols, o r c urrent v alue memory l ocation. Thus the state m ent p roduce a n n ormal r ules u sing a rithmetic i nteger esul r I ndividual t erms specia l t erms. o nly spec ial t erm u sed * ( l ocation c ounter) w hich in dicates v alue next BUFFE ND EQU * A ssigns a va lue t o BU F FEND, w hich add r ess next b te u nassigned y foll owing b uffer a rea. S ome value s i n o bject prog ram a re r elative t o beginnin g progra m s ome are a bsolute ( independe nt pr ogram locati o n, lik e const a nts). Hen exp ressions a re c lassified a s e ither a bsolute exp ression o r r elative expressions depending o n the type value they p roduce. A bsolute Exp r essions: exp ression t hat u ses only ab solute te rms c e, a bsolute expres sion. Absolute expression m ay c ontain rela tive t erm provided the re lative t erms occur in pairs with opposite signs for each pai r. Example: MAXLE N EQU BUFEND-BUFF E R I n d epend o n relocation a bove i nstruction d ifference i n l ocation p rogram he nce g ives a n exp ression give s a v alue that d oes n ot absolute i mmaterial o the program. The expression can have only a bsolute terms. E xample: MAXLE N EQU 1000 R elative E xpressions: A ll elative r term s e xcept o ne c an b e p aired a s d escribed i n ab solute. The remaining unpaired relative term must have a positive sign. E xample: STAB EQU OPTAB + ( BUF E ND BUF FE R) CSE, SJBIT 47

53 H andling t ype expression s : type sy mbols u sed. T his c an b e to find the ty pe expression, we must keep track achi ved table against each the symbol as shown in the table be l ow: e by de fining ty pe i n th e sy mbol Program B locks: P rogram b locks all ow genera ted mac hine i nstructions d ata t o app ear i n obj p rogram i n a diff erent or der by Separa ting b locks f or storing c ode, data, s tack, larg er data bloc k. A ssembler Directive USE: ec t USE [ blockna m e] A t be g inning, statem e nts re a ass umed t o b e p art nn u am ed ( default) b lock. I f n o U SE s tatements a re incl u ded, e ntire program b elongs t o t his s ingle b lock. E ach p rogram b lock may actually conta in severa l separate seg ments r earrange se segments t o gather tog ether the p ieces sou rc e prog ram. Assembler s e ach b lock a ssign a ddress. S eparate prog ram i nto b locks i n a p articular order.larg e b uffer a rea m oved t o e nd o bject pro g ram. P rogram r eadability program close to the statements that reference m. In the example below three blocks are used : Default: executable instruct ions C DATA: CBLKS: betteri f all data areas that are less in length d ata ar eas a re pl aced i n all data areas that consists larger blocks memor y source CSE, SJBIT 48

54 S YSTEM SOFTWARE Exam ple Co de CSE, SJBIT 49

55 S YSTEM SOFTWARE Arranging code into program b locks: P ass 1 A separate location counter for each program block is maintai ned. Save and restore LOCCTR when switching b etween blocks. At the beginning a block, L O CCTR is set to 0. Assign each label an address relative to the start the b lock. CSE, SJBIT 50

56 S tore b lock n ame or n umber i n address the label S YMTAB along w ith ass igne d r elative Indica te b lock length a s l atest v alue L OCCTR f or e ach b lock at e nd Pa s s1 A ssign t o each blo c k a program blocks in a particular order s tarting a ddress i n the o b ject prog ram by concate nating P ass 2 Calculate the address for each symbol relative to the start the object program by a dding The location the symbol relative to the start its block The starting address this block Control Se ct ions: A c ontrol section a pa rt the prog ram t hat m aintains i ts c ontrol s ection c an b e lo aded and reloca ted ind identity af ter ass embl ; y each ependently the o thers. D ifferent c ontrol s ections a re m ost te n u sed f or s ubroutines or o ther logic al subdivisi o ns. p rogrammer can assemble, load, and manipulate each these control sections separately. Because this, re sho uld b e s ome m eans f or li nking c ontrol sectio ns togeth e r. F or ex a mple, i nstructions i n o ne contr ol s ection ma y refe r to data or instr uctions othe r control sect ions. Since control sections are independentl y loaded and re located, the a ssembler u nable t o p rocess thes e control sections are c alled referenc es i n external references. usua l wa y. a ssembler generates i nformation a bout e ach S uch referenc es b etween diff erent w ill a llow l oader to perfor m required li n king. W hen a program m ultiple contr ol s ections, beginning assembler direct ive assembler directive : C SECT each ext ernal r eferences t hat c ontrol s ection w ritten using i ndicated by a n CSE, SJBIT 51

57 syntax secnam e CSECT separate location counter for each control sect ion C ontrol sections differ f rom p rogram b locks i n tha t they a re h andled separately by assembler. S ymbols t hat a re d efined i n o ne control section may n ot b e used directly a nother c ontrol s ection; they mus t b e i dentified s a ext ernal referenc e external references are indicated by t wo assembler directives: EXTDEF ( external Definition) : I t stat e ment n f or loa d er t o h andle. i a c ontrol s e ction, n ames sy mbols t hat a re def ined in t his s ection b ut m ay b e use d by o ther c ontrol s ectio ns. C ontrol s ection n ames d o the EXTREF as they are automatically considered as external sy m bols. EXTREF ( external Referenc e) : n ot nee d t o b e n amed i n se ct ion. I t na mes sy mbols t hat are u sed i n t his ection s but a re de fined i n s ome ot er h c ontrol or der i n w hich se s ymbols a re l isted n ot s ignifican assem bler must i nclude p roper informa tion about ext ernal references i n loader to insert the proper value where they are required. o bject pro g ram th at will c ause CSE, SJBIT 52

58 S YSTEM SOFTWARE CSE, SJBIT 53

59 S YSTEM SOFTWARE Handling External Reference C ase CLO OP + JSUB RDREC 4B The operand RDREC is an external referenc e. o o o The assembler has no idea where R DREC is i nserts an address zero can only u se extended formatto provide enough room (that is, relative addressing for external refere n ce is invalid) The assembler generates information for each external reference that will allow the loaderto perform the required linking. C ase MAXLE N WORD BUFEND-BUFFE R There are two external references in the expression, BUFEND and BUFF E R. The assembler inserts a value zer o passes information to the loader CSE, SJBIT 54

60 Add to this data area the address BUFE ND Subtract from this data area the addre ss BUFFE R C ase 3 On line expression 107, BUFEND and BUFFER are d efined in the same control section and the can be calculated immediately MAXLE N EQU BUFEND-BUFF E R Object Code for the example program: CSE, SJBIT 55

61 S YSTEM SOFTWARE a ssembler m ust a lso i nclude i nformation i n o bject prog ram t hat will c ause l oader t o i nsert pro pe r va lue w here they are require d. ass in the object code and a changed version modification re co rd. e mbler aint m ai ns t wo n ew record De f ine record (E X TDEF) CSE, SJBIT 56

62 S YSTEM SOFTWARE Col. 1 D Col. 2-7 Name external s y mbol defined in this control section Col Relative address within this control section (hexadecima l ) Col Repeat inform ation in Col for other external sym bols Refer record (E X TREF) Col. 1 R Col. 2-7 Name external sym bol referred to in this control section Col Name other external reference sym bols Modifi cation record Col. 1 M Col. 2-7 S tarting address the field to be modified (hexadecimal) Col. 8-9 Length the field to be modified, in half-by t es (hexadecimal) Col External sym bol whose value is to be added to or subtracted from the indica ted fi eld A define record g ives info rmation a bout the ext ernal sy mbols tha t ar e defin ed i n this contr ol s ection, i.e., s ymbols n amed by EXTDEF. A r efer r ecord l ists symbols t hat a re u sed a s external references by control section, i.e., symbols named by E XTREF. a dding o r may n ew i tems i n m odification recor d s pecify m odification t o b e p erformed: s ubtracting he t v alue s ome ext ernal s y mbol. sy mbol used f or m odification be defined either in this control section or in another secti on. o bject progra m s hown b elow. re a separate o bject prog ram f or eac h c ontrol s ections. I n D efine R ecord re fer record sy mbols n amed i n E XTDEF and EXTREF are i ncluded. CSE, SJBIT 57

63 In ca se D efine, r ecord a lso i ndicates th e r elative a ddress e ach ext ernal sy mbol w ithin control s ection.for EXTREF s y mbols, n o a ddress informa tion availab le. These symbols are simply named in the R efer record. Handling Expressions i n Multiple Control Sections: extence m ultiple c ontrol s ections t hat c an b e relo c ated nde i pendently o ne a nother m akes the handli ng exp ressions c omplicated. It requir ed that i n a n expressio n t hat a ll r elative t erms b e p aired ( for a bsolute ex p ression), o r t hat a ll ex cept o ne b e p aired (for relative expre s sions). CSE, SJBIT 58

64 W hen i t extended re s triction that: c omes in a progr m a having mult iple c ontrol sectio ns the n we Both terms in each pair a n expression must be within the same control sect ion o have a n If two terms represent relative locat ions within the same control section, their difference is an absolute value (reg ardless where the control section is loca t ed. Le g al: BUFEND-BUFFER (both are in the same control sec t ion) o I f the t erms a re located i n value that is unpredictable. diff e rent ontrol I llegal: RDREC-C OPY ( both a re differenc e i n oad c sect i ons, ir differenc e ha s a diff e rent co trol n s ection) it l add resses the t wo control s ections. T his v alue d epends o n way run-t ime storage a llocated; i t any u se. unlikely t o be How to enforc e this restricti on o o o When an expression involves external referen ces, the assembler c an not determine whether or not the expression is legal. The assembler evaluates all the terms it can, combines these to for m an initial expression value, and generates Modification recor d s. The loader checks the expression for err o rs and finishes the eva l uation. 3.2 ASSEMBLER DESIGN OPTIONS Here we are d iscussing o o The structure and logic one-pass assembler. se assemblers are used when it is necessary or desirable to avoid a second pass over the source progra m. Notion a multi- pass assembler, an extension two-pass assembler tha t allows an a ssembler to handle forward references during symbol definition. CSE, SJBIT 59

65 One-Pass Assemb ler main problem in designing the a ssembler using single pass was to resolve f orward references. We can avoid to some extent the forward references by: Eliminating forward reference to data items, by defining all the storage reserva t ion statements at the beginning the program rather at the e n d. Unfortunately, forward reference to labels on the instructions cannot be avoided. (forwa r d jumping) To provide some provision for handling forward references by prohibiting forw ard references to data ite m s. There are two types one- p ass assemblers: One that produces object code directly in memory for immediate execution ( Load- and-g o as semblers). The other ty pe produces the usual kind object code for later ex ecution. Load-and- G o Assembler Load-and-go assembler generates their object code in memory f or immediate exec u tion. No object program is written out, no loader is ne e ded. It is useful in a sys tem with frequent program development and testing o The efficiency the assembly p rocess is an important consideration. Programs are re-assembled nearly every time they are run; efficiency the assembly process is an important considera t ion. CSE, SJBIT 60

66 S YSTEM SOFTWARE Forward Reference in One-P ass Assemblers: In load-and-go assemblers whe n a forwar d reference is encountere d : Omits the operand address if the sy mbol has not yet been defined Enters this undefined symbol into SYMTAB and indicates that it is undefined Adds the address this operand address to a list forward references associated with the SYMTAB e ntry When the definition for the symbol is encountered, scans the reference list and insert s the addre s s. At the end the program, reports the error if there are still SYMTA B en trie s indicated undefined sy m bols. For Load-and- Go a s sembler o Search SYMTAB for the sy m bol named in the END statement and jumps to this location to begin execution if there is no error CSE, SJBIT 61

67 S YSTEM SOFTWARE A fter Scanning line 40 the progr a m: J` CLOOP The status is that upto this point the symbol RREC is referre d once at location 2013, ENDFIL a t 201F and WRREC at location 201C. None these symbols are defined. The f igure shows that how the pending definitions along w ith their addresses are included in the sy m bol table. The status after scanning line 160, which has enc o untered the definition RDREC and ENDFIL is as g i ven below: CSE, SJBIT 62

68 S YSTEM SOFTWARE If One-P ass needs to generate object code: If the operand contains an undefined sy m bol, use 0 as the address and write the Text record to the object progra m. Forward references are entered into lists as in the load-and-g o assembler. When the definition a sy m bol is encountered, the assembler generates another Text record with the correct operand address each entry i n the reference lis When loaded, the incorrect address 0 will be updated by latter Text record containing the sym bol definition. Object Code Generated by One-Pass Assem b ler: CSE, SJBIT 63

69 S YSTEM SOFTWARE Multi_ P a ss Assembler: For a two pass assembler, forward references in symbol de finition are not allowe d : ALP HA EQU B E TA BETA EQU DEL T A DELT A RESW 1 o Sy m bol definition must be completed in pass 1. Prohibiting forward references in symbol definition is not a serious inconvenienc e. o Forward references tend to create difficulty for a person reading the prog r am. Implementation Issues for Modified Two-Pass Assembler: I mplementation Isuues when forward referencing is encountered in Symbol Def ining statemen ts : For a forward reference in symbol definition, we store in the SYMTAB: o o o The sym bol name The defining expres sion number undefined symbols in the defining expression CSE, SJBIT 64

70 S YSTEM SOFTWARE undefined symbol (marked with a flag *) a sso ciated with a list symbols depend on this undefined sy m bol. When a symbol is defined, we can recursively evaluate the sy m bol expressions depending on the newly defined sy m bol. Multi-Pass Assembler Exam ple Pr ogram Multi-Pass Assembler : Example for forward reference in Symbol Defini ng Statemen t s: CSE, SJBIT 65

71 S YSTEM SOFTWARE 3.3 MASM Assemb ler M icrost M acro A ssembler a n X 86 architectur e assembler f or MS-DOS M icrost W indows. W hile n ame M ASM h as e arlier usag e a s the Unisys O S 1100 Meta- A ssembler, i t commonly u nderstood i n m ore ecent r y ears t o r efer t o icrost M M acro Assemble r. I t a n archety pal MAC RO assembler f or x8 6 P C mar ket t hat o wned m aintained b y a m ajor operati ng syste m v endor s ince i ntroduction M ASM v ersion 6.0 i n 1991 h as h ad a p owerful prepr ocessor t hat s upports p seudo h igh l evel e mulation variety hig h l evel con a utomated sy stem s tructions ncluding i l oop c ode, c onditional t esting ha s a semi- p rocedure c reation m anagement ava ilable i f r equired. Ver sion 6.11d was 32 b it o bject m odule capable using a specialcsed linker available i n Wi nnt 3.5 S DK b ut w ith i ntroduction binary patche s t hat upgraded version 6.11d, all l ater v ersions w ere 32 b it Porta ble Exe cutable c onsole m ode applicatio n t hat pro duced b oth OMF and COFF object modules for 32 bit code. CSE, SJBIT 66

72 R ECOMMENDED QU ESTIONS 1) Explain the following: Literals, Sy m bol defining statements, Expressions (8) 2) Explain program blocks with an example. ( 10) 3) Explain control section and program linking. ( 8) 4) Explain the following ( 8 ) a ) Define r ecord b) Refer recor d c ) Modification rec ord(revc SEd ) 5) Explain one pass assem bler. ( 6 ) 6) Explain multipass assembler. ( 8) 7) W rite shortnotes on ( 8) a ) MASM assembler b) SPARC a s sembler CSE, SJBIT 67

73 UNIT- 4 Intro duction c onverted t o S ource P rogram w ritten i n o bject r LOADERS AND LINK ERS p o g ram, w hich i n assembly l anguage o r hig h m achine langu ag e l evel a l ng uage w ill b e f orm f or ex e cution. T his c onversion e ither f rom a ssembler o r f rom c omp iler, c ontains tra nslated instructio ns d ata v alues a re from sourc e progr a m, o r specifie s addr esses in primary memory w here se ite ms to be loaded for execution. This contains the following three processes, and they are, Loading - w hich alloca tes m emory l ocation b rings o bject progra m i nto memory for execution - (L o ader) Linking- w hich combine s t wo or more e s parate o bject programs supp lies i nformation needed to allow references between them - ( Linker) R elocation - w hich mod ifies o bject progr m a s o t hat i t c an b e different from the location originally specified - ( Linking L o ader) 4.1 Basic Loader Fu n ctions: A l oader a sy stem pro gram t hat p erforms the int o memory star ts T ranslator may b e t o i ts ex e cution. r ole assem ler/complier, l oading f unction. I t loader as l oaded a t a n b rings bject a ddress o p rogram s hown in f igure 4.1. b w hich g enerates o bject prog ram l ater l oaded m emory by the l oader f or ex e cution. I n f igure 4. 2 t ranslator specifically a n a ssembler, whic h gene rates objec t l oaded, w hich bec omes input to loade r. fig ure4.3 shows the role both loader a n d linker. CSE, SJBIT 68

74 S YSTEM SOFTWARE S ource Program T ranslator O bject P rogram Load er Object p rogram r eady for e xecution Me mory F igure 4.1 : Th e Role Loade r S ource O bject Program A ssembler P rogram L oader Objec t p rogram r eady f or e xecution M emory C SE, 69

75 Figure 4.2: The Role Loader with Assembler S ource P rogram A ssembler O bject P rogram L inker E xecutable Code Objec t p rogram r eady f or e xecution Loader M emory Figure 4.3: The Role both L oader and Li nker Type Loaders d ifferent ty pes loa ders a re, a bsolute l oader, b ootstrap l oader, r elocating l oader ( relative l oader),, dire ct l inking l oader. f ollowing s ections discuss functio ns design all these ty p es loaders Design Absolute Loader: o peration l ocations i n e xecution absolut e m emory. A t loa l oader very simple. o bject c ode e nd l oader jumps t o l oaded t o s pecified s pecified a ddress t o be de d p rogram. r ole abs olute l oader a s shown i n fi u g in g re 4.4. CSE, SJBIT 70

76 S YSTEM SOFTWARE a dvantage a bsolute l oader s imple e fficien B ut d isadvantages a re, nee d for programmer to specify the actual addre s s, and, difficult to use subroutine libraries. O bject Absolute 1000 P rogram Loader Objec t p rogram r eady f or e xecution 2000 M emory F igure 4.4: The Role Absolute Lo ader The algorithm for this type loader is give n here. The object progr am and, the object p rogram loade d i nto me mory by the a bsolute loader a re a lso s hown. E ach by te a ssembled code give n u sing i ts hexa decimal r epresentation i n cha racter f orm. Easy t o r ead b y h uman b eings. E ach b yte o bject prog rams i n a binary orm, o bject ode c s tored a s a i s ng le b y te. Mo st m achine s tore f we m ust b e s ure t hat o ur f ile de vice conv e ntions do not cause some the program byt es to be interpreted as con trol characters. B egin r ead H eader record v erify p rogram name and length CSE, SJBIT 71

77 read first Text record whil e record ty pe is <> E beg in d o { if object code is in character form, convert into internal repre s entation} move object code to specified loca t ion in memory read next object program record e nd jump to address specified in End record en d CSE, SJBIT 72

78 S YSTEM SOFTWARE A Simple Bootstrap Loader When a computer is first turned on or restarted, a special type absolute loader, calle d bootstrap loader is execu ted. This bootstrap loads the first program to be run by computer -- usually an operating s ystem. The bootstrap itself begins at addre s s 0. It loads the O S starting addres s 0x80. No header record or control information, the object code consecutive bytes memory. The algorithm for the bootstrap loader is as follows B egin X=0x80 (the address the next memory l ocation to be loaded L oop CSE, SJBIT 73

79 End A GETC (and convert it from the ASCII character code to the value the hexadecimal dig i t) save the value in the high-order 4 bits S A GETC combine the value torm one byte A ( A+S) store the value (in A) to the address in register X X X+1 It uses a subroutine GETC, which is GETC A read one charact er if A=0x04 then jump to 0x80 i f A< 48 then GE TC A A- 48 (0x30) i f A< 10 then ret urn A A- 7 r eturn Machine-endent Loader Feature s Absolute loader is simple and efficient, but the scheme has potential disadvantages One the most disadvantage is the programmer has to specify the actual starting address, fro m where the program to be loaded. This does not create difficulty, if one prog r am to run, but not for several progr ams. Further it is difficult to use subroutine libraries efficiently. CSE, SJBIT 74

80 This need s the design and implementation a more complex loader. The l oader must provide program relocation and linking, as well as simple loading f unctions Relocati on conc ept prog ram r elocation, execut a vailable sufficie nt m emory. object progra m re r oom or io n the o bject program u sing any par t l oaded i nto m emory whereve r f i a ctual s tarting addr ess o bject progra m n ot k nown u ntil l oad time. R elocation p rovides e fficient s haring m achine w ith l arger memory w hen s everal i ndependent p rograms a re t o b e r un t ogether. I t a lso s upports u se s ubroutine libraries efficiently. Loade rs that allow for progra m relocation are called relocating loaders o r relative loa d ers. Methods for specifying U se r elocation m odification r cord e, u se r elocation b it, a re m ethods av ailable f or s pecifying r elocation. I n c ase m odification r ecord, a m odification r ecord M u sed i n o bject prog ram t o i nstruction associated ith gathere d into bit masks. specify any r elocation. I n c ase u se relocat io n bit, e ach w o ne r elocation b it, se r elocation bits i n a Text rec ord M odification r ecords a re u sed i n complex m achines a lso c alled Relocatio n L inkage Directory ( RLD) s p ecification. f ormat m odification r ecord ( M) a s follows. The object program with relocation by Modification re c ords is also shown here. Modification record c ol 1 : M col 2-7 : relocation addres s col 8-9 : length (halfby t e) c ol 10: flag ( + /-) col 11-17: segment nam e CSE, SJBIT 75

81 S YSTEM SOFTWARE H Λ C OPY Λ T Λ Λ 1DΛ17202DΛ69202D Λ Λ Λ 4B105D Λ 3F2FEC Λ T Λ 00001D Λ 13 Λ 0F2016 Λ Λ0F200D Λ 4B10105D Λ 3E2003 Λ 454F46 T Λ Λ 1D Λ B410 Λ B400 Λ B440 Λ Λ Λ Λ 57C003 Λ B 850 T Λ Λ 1D Λ 3B2FEA Λ Λ 4F0000 Λ F1 Λ.. Λ 53C003 Λ DF2008ΛB 850 T Λ Λ 07 Λ 3B2FEF Λ 4F0000 Λ 05 M Λ Λ 05+ C OPY M Λ Λ 05+ C OPY M Λ Λ 05+ C OPY E Λ r elocation b it m odification n ecessary, nd m ethod u sed f or s imple m achines. R elocation b it 0 : n o a 1: modification need e d. T his s pecifi ed in column s text record (T), the format text record, along with relocation bits is as follows. Text recor d : c ol 1 : T col 2-7: starting addres s col 8-9: length ( by t e) col 10-12: relocation bits col 13-72: object code Twelve-b it m ask is use d i n e ach Text record ( col: reloc ation b its), s ince eac h t ext record c ontains l ess t han 12 w ords, u nused w ords a re s et t o 0,, any v alue that t o b e CSE, SJBIT 76

82 m odified d uring relocatio n l oader, ther e a re n o mus t r elocation its c oincide w ith on e these 3-byte segment s. F or a bsolute b c olumn c ontains object c ode. o bject prog ram w ith r elocation b y b it mas k a s s hown b elow. O bserve F FC - m eans a ll m odified and, E00 - means first three records are to be modifie d. H Λ COPY Λ A T Λ Λ1E Λ FFC Λ Λ Λ000036Λ Λ Λ Λ 3C0003 Λ T Λ 00001EΛ15 Λ E00 Λ 0C0036 Λ Λ080033Λ4C0000 Λ Λ Λ T Λ Λ1E Λ FFC Λ Λ Λ Λ 30103FΛD8105DΛ280030Λ... T Λ Λ0A Λ 800Λ Λ 4C0000ΛF1 Λ T Λ Λ 19 Λ FE0 Λ Λ E01079Λ Λ ΛDC1079Λ2C0036 Λ... E Λ Pr ogram Linking Goal program l inking t o t en ords w a re t o b e resolve p roblems w ith ext ernal referen ( EXTREF) external definitions (EXTDEF) from different control sections. EXTDEF ( externa l d efinition) - E XTDEF s tatement i n a con trol s ection names s ymbols, called external symbols, that are defined in t his (present) c ontrol section and may be used by o ther sections. ex: EXTDEF BUFF ER, BUFFEND, E XTDEF LISTA, E N DA EXTREF ( external referenc e) - t his (present) c ontrol section and are defined elsewhere. e x: EXTREF RDREC, WRR EC E XTREF LISTB, How to implem e nt EXTDEF and EXTREF LENGT H The EXTREF s tatement names sy mbols used in ENDB, LISTC, ENDC CSE, SJBIT 77 ce s

83 The assembler must include information in the object program that will cause the loade r to insert proper values where they a re required i n the form Define record (D) and, Refe r re co rd(r). Define recor d The format the Define record ( D) along with examples is as shown here. Col. 1 D Col. 2-7 Name external sy m bol defined in this control section Col Relative address within this control section ( hexadecima l ) Col Repeat inform ation in Col for other external sym bols Example record s D LISTA ENDA D LISTB END B Refe r reco rd The format the Refer record (R) along with examples is as shown her e. Col. 1 R Col. 2-7 N ame external symbol referred to in this control section Col N ame other external reference sym bols Example record s R LIS TB ENDB LIS TC ENDC R LIS TA E NDA LIS TC ENDC R LIS TA ENDA L ISTB ENDB CSE, SJBIT 78

84 H ere a re t hree prog rams n amed a s PROGA, P ROGB PRO GC, w hich ar separately a ssembled and e ach which c onsists a sing le c ontrol se c tion. L ISTA, E NDA i n P ROGA, LIST B, EN DB in P ROGB L ISTC, E NDC i n d efinitions i n e ach th e P ROGC are ext ernal c ontrol s ections. S imilarly L ISTB, E NDB, L ISTC, E NDC i n P RO GA, L ISTA, E NDA, L ISTC, E NDC i n P ROGB, L ISTA, E NDA, L ISTB, E NDB i n P ROGC, a re e xternal r eferences. se s ample p rograms given here a re u sed t o il e lustrate l inking r elocation. f ollowing fig ures g ive sa mple progra ms ir corresponding ob ject programs. O bserve object p rograms, w hich conta in D R recor ds along with other recor d s PROGA START 0 EXTDEF LI S TA, ENDA E XTREF LISTB, ENDB, LIS TC, ENDC REF1 LD A LIS TA 03201D 0023 REF REF3 +LD T LD X LIS TB # ENDA-LIS TA LIS TA EQU * 0054 ENDA 0054 REF REF5 EQU * WORD ENDA-LISTA+ LIS TC WORD ENDC-LISTC-1 0 FFFFF 6 CSE, SJBIT 79

85 S YSTEM SOFTWARE 005A REF6 WORD ENDC-LISTC+ LISTA F 005D REF7 WORD ENDA-LISTA-( ENDB- L ISTB) REF8 WORD LISTB-LIS TA FFFFC 0 END REF PROGB START 0 EXTDEF LI S TB, ENDB E XTREF LISTA, ENDA, LI S TC, ENDC REF1 +LD A LIS TA A REF2 003D REF3 LD T +LD X LIS TB # ENDA-LIS TA LIS TB EQU * 0070 ENDB EQU * 0070 REF REF REF6 WORD ENDA-LISTA+ LIS TC WORD ENDC-LISTC-1 0 FFFFF 6 WORD ENDC-LISTC+ LISTA-1 F F FFFF CSE, SJBIT 80

86 S YSTEM SOFTWARE 0079 REF7 WORD ENDA-LISTA-( ENDB-LISTB) FFFFF0 007C REF8 WORD LISTB-LIS TA E ND 0000 PROGC START 0 EXTDEF LISTC, ENDC E XTREF LISTA, ENDA, LI S TB, ENDB REF1 +LD A LIS TA C REF REF3 +LD T +LD X LIS TB # ENDA-LIS TA LIS TC EQU * 0042 ENDC EQU * 0042 REF REF REF6 004B REF7 WORD ENDA-LISTA+ LIS TC WORD ENDC-LISTC WORD ENDC-LISTC+ LISTA WORD ENDA-LISTA-( ENDB-LISTB) CSE, SJBIT 81

87 S YSTEM SOFTWARE 004E REF8 WORD LISTB-LIS TA E ND H PROGA D LISTA END A R LISTB E NDB L ISTC END C.. T A 03201D T F FFFF F FFFFC 0 M LIS TB M LIS TC M ENDC M LIS TC M 00005A06+ ENDC M00005A06 -LIS TC M 00005A06+ PROGA M00005D06-E NDB M00005D06+LI S TB CSE, SJBIT 82

88 M LIS TB M PROG A E H PROGB F D LISTB END B R LISTA ENDA LIST C E NDC. T B T F FFFFF6 FFFFFF FFFFF M LIS TA M 00003E 06+ ENDA M00003E 06 -LIS TA M ENDA M LIS TA M LIS TC M ENDC M LIS TC M ENDC M LIS TC CSE, SJBIT 83

89 M LIS TA M ENDA M LIS TA M 00007C 06+ PROGB M00007C 06 E -LIS TA H PROGC D LISTC END C R LISTA ENDA LIST B E NDB. T C T F M LIS TA M00001D 06+LI S TB M ENDA M LIS TA M ENDA M LIS TA M PROGC M LIS TA CSE, SJBIT 84

90 M00004B 06+ E NDA M00004B 006-LIS TA M00004B 06- E NDB M00004B 06+LIS TB M00004E 06+LI S TB M00004E 06-LIS TA E The following figure shows these three programs as they migh t appear in memory after loading and linking. PROGA has been loaded starting at address 4000, with PROGB and PROGC immediately following. CSE, SJBIT 85

91 SYSTE M SOFTWARE a ddress F or example, value for R EF4 in P ROGA is l ocated a t addre ss 4054 ( the beginning P ROGA lus p 0054, r elative a ddress R EF4 w ithin PR O GA). following figure shows the details how this value is compute d. The initial value from the Text recor d T F000014FFFFF600003F000014FFFFC T o this a dded a ddress assig ned t o LIS T C, w hich 4112 ( the beginning addr ess P ROGC p lus 30). re s ult is That is REF4 in PROGA is ENDA-LISTA+LISTC= =4126. S imilarly l oad a ddress f or sy mbols L ISTA: P ROGA+0040=4040, L ISTB: P ROGB+0060=40C3 LISTC: PROGC+0030=4112 Keeping these de tails w ork throug h the deta ils o ther reference s value s se references are the same in each the three progra m s. CSE, SJBIT 86

92 Algorithm and Data structures for a Linking Loader alg orithm f or a l inking l oader considerably m ore c omplicated t han th e a bsolute loade r p rogram, w hich a lready g iven. c oncept g iven i n p rogram lin king sectio n u sed f or d eveloping algor ithm f or l inking l oader. m odification r ecords a re u sed f or r elocation s o mecha n ism. t hat l inking r elocation f unctions a re performed u sing s ame L inking L oader use s two-p asses lo g ic. E STAB ( ext ernal sy mbol tabl e ) is data structure for a linking loader. m ain Pass 1: Assi gn addresses to all external s y mbols Pass 2: Perfo rm the actual loading, relocation, and linking ESTAB - ESTAB for the example ( refer three programs PROGA PROGB an d PROGC) given is as shown be l ow. The ESTAB has four entries in it; they a re name the control section, the symbol appearing in the control section, its address and leng t h the control sec t ion. Control sectio n Symbol Address Leng th PROGA LISTA 4040 ENDA 4054 PROGB F LISTB 40C3 ENDB 40D3 PROGC 40E2 51 LISTC 4112 ENDC 4124 Program Log ic for Pass 1 CSE, SJBIT 87

93 P ass 1 a ssign a ddresses t o a ll e xternal s mbols. y v ariables & D ata s tructures u sed during p ass 1 a re, P ROGADDR ( program l oad a ddress) f rom O S, C SADDR ( control s ection a ddress), CSL TH ( contr ol s ection l ength) E STAB. p ass 1 pro cesses De fine Record. The algorithm for Pass 1 Linking Loader is g i ven below. Program L ogic for Pass 2 P ass 2 l inking l oader perfor m a ctual l oading, relocati o n, l inking. I t m odification recor d l ookup sy mbol i n ES TAB t o o btain i ts addr e ss. Finally i t u ses e nd record a ma in progra m t o obtain transfe r a ddress, which a starting addre ss nee ded f or exe cution p rogram. p ass 2 proce ss Text r ecord Mod ification r ecord the object program s. The algorithm for Pass 2 Linking Loader is g i ven below. u ses CSE, SJBIT 88

94 S YSTEM SOFTWARE How to improve Efficie n cy? q uestion here can w e i mprove the efficie ncy linking load e r. A lso o bserve th a t, even thoug h we h ave defi ned R efer r ecord ( R), we haven t m ade use i efficiency can b e i mproved b y the u se l ocal searching i nstead m ultiple s earches E STAB f or t h s ame s y mbol. F or i mplementing t his w e assig n a referenc e n umber to eac h ext ernal sy mbol i n R efer r e cord. n this r eference n umber e xternal s ymbols.01 reference sy m bols. a ssigned t o u sed i n M odification ecords e r instea d c ontrol secti on n ame, and o ther num bers f or ext ernal object programs f or P ROGA, P ROGB P ROGC a re s hown b elow, w ith a bove modification to Refer record (Observe R rec o rds). CSE, SJBIT 89

95 S YSTEM SOFTWARE CSE, SJBIT 90

96 S YSTEM SOFTWARE Sy mbol A ddresses i n P ROGA, P ROGB P ROGC a re a s s hown b elow. se a re the entrie s ESTA B. The a voids m ultiple s earches sect ion m ain advant ag e E STAB f or same s Ref N o. Symb ol Address 1 PROGA LISTB 40C3 3 ENDB 40D3 4 LISTC ENDC 4124 refere nce n umber mechanis y mbol uring m d l oading a t hat i t c ontrol Ref No. Symb ol Ad dress 1 PROGB LISTA ENDA LISTC END C 4124 CSE, SJBIT 91

97 S YSTEM SOFTWARE Ref N o. Symb ol Address 1 PROGC LISTA ENDA LISTB 40C3 5 ENDB 40D Machine- independent Loader Featur es Here we discuss some loader features that are not directly related to machine architecture design. Automatic Library Search and Loader Options are such Machine- i ndependent Loader Feature s Automatic Library Search T his f eature a llows a p rogrammer to u se standar d s ubroutines w ithout explicitly including m i n p rogram t o b e l oaded. r outines a re automatically retrieved f rom a l ibrary a s y a re needed during lin king. This a llows prog rammer to use subroutines f rom one o r m ore librarie s. s ubroutines c alled by p rogram b eing l oaded ar e automatically f etched f rom l ibrary, l inked w ith m ain p rogram l oaded. l oader s earches l ibrary o r l ibraries s pecified f or rout ines t hat c ontain d efinitions progra m Loader Option s se sy mbols i n L oader o ptions a llow th e u ser t o specify options t hat m odify standard rocessi o ptions m ay b e s pecified i n l anguage, specifie d a s a p art m ain p n g. t hree d ifferent ways. They a re, s pecified u sing a c ommand j ob c ontrol l anguage t hat p rocessed by the operati system, and an be specified using loader control statements in the source progr am. Here are the some examples how option can be spec i fied. INCLU DE program-name ( library- n ame) - r ead designa ted o bject prog ram f rom a library CSE, SJBIT 92 ng

98 D ELETE csect-n ame d elete n amed control s ection f rom s et p f being loaded C HANGE n ame1, name 2 - e xternal s ymbol n ame1 t o wherever it appears in the object progr ams LIBRARY MYLI B search MYLIB library before standard libraries b e p rograms changed t o n ame2 routines NOCALL S TDDEV, P L OT, C ORREL n o l oading l inking u nneeded H ere o ne more exam p le g iving, h ow c ommands c an be spe file, and the respective changes are carried out by loader. LIBRARY UTLIB INCLUDE READ (UTLIB) INCLUDE WRITE (UTLI B ) DELE TE RDREC, WRREC CHANGE RDREC, READ CHANGE WRREC, WRIT E N OCALL SQRT, PLOT c ified s a a part o bject c ommands a re, u se U TLIB ( say utility librar y ), inc lude R EAD W RITE c ontrol s ections f rom the librar y, de lete the l oad, c hange comm c auses a ll external r eferences t o c hanged t o symbol R EAD, similarly r eferences t o contro l s ections RDREC WRREC f rom W RREC symb ol R DREC t o be c hanged o finally, no call to the functions SQRT, PLOT, if they are used in the prog r am. 4.4 Loader Design Optio ns re a re s ome commo n t W RITE, a lternatives f or org anizing loading functi o ns, i ncluding reloca tion and linking. Linking L o aders Perform a ll linking and relocation at load time. CSE, SJBIT 93

99 S YSTEM SOFTWARE O ther A lternatives a re Linkag e e ditors, which p erform l inking p rior t o dynamic linking, in which linking function is performed at execution time l oad t ime, Linking Lo aders Object Program( s ) Library Linking loader M e mory a bove d iagram show s p rocessing a n obj ect prog ram u sing Linkin g Lo a der. s ource prog ram f irst a ssembled or c ompiled, producing an o bject p r ogram. A lin king l oader perfor ms a ll linkin g loa ding o perations, loads the program into memory for exec u tion Linkage Editors f igure b elow show s p rocessing an objec t prog ram using Linka ge e ditor. A linkag e e ditor produces a linked version the p r ogram ten called a load module or a n exe cutable i mage w hich written t o a f ile o r library f or late r executi o n. l inked p rogram p roduced is generally in a form that is suitable for processing by a relocating l oader. CSE, SJBIT 94

100 c reated, i f S ome u seful f unctions s tarting add res s L inkage e ditor a re, a n already k nown. New v ersions a bsolute o bject p rogram c an b e librar y ca n b e i ncluded w ithout c hanging sour ce pro g ram. L inkage edi tors c an a lso b e use d t o b uild packag es s ubroutines o r o ther ontrol c s ections t hat a re generally u sed togeth e r. L inkage e ditors ten a llow u ser t o specify t hat ext ernal reference s ar e n ot t o be r esolved by automa tic library s earch l inking w ill b e savings in space d one l ater by linking lo ader link ag e e ditor + lin king l oader O bject P rogram( s ) Library Linkage Editor L inked progra m Relocating loader Memory 4.4.2Dynami c Linking s cheme t hat p ostpones l inking f unctions u ntil executi o n. A s ubroutine l oaded l inked t o r est the d ynamic loading o r p rogram whe n it load o n c al l. first calle d advantag es d usually c alled dyna mic l inking, y namic inking l a re, i t a llow s everal executing programs to share one copy a subroutine or library. In an object oriented sy s tem, CSE, SJBIT 95

101 d ynamic l inking m akes it p ossible f or o ne objec t to b e shared by s everal progr a ms. Dyn amic l inking p rovides ability t o l oad r outines only w hen ( and i f) they a re need e d. actual loading and linking can be accomplished using operating sy s tem service reques Bootstrap Loaders I f q uesti on, h ow w hen computer oader l i tself loade d i nto m emory? a sked, n answer, started w ith n o pro g ram in emo a bsolute a ddress) c an b e m ade exe cuted may b e m r y, a prog ram p resent i n O S i tself o r A B ootstrap oader, R OM ( l w hich i n tu rn loads O S p repares i t f or exe cution. The first record ( or records) is generall y referr ed t o a s a b ootstrap oader l m akes O S t o b e l oaded. S uch a l oader all object programs that are to be loaded into an empty and idle sy s tem. 4.5 Implementation Examp les a dded t o b eginning T his s ection c ontains b rief d escription loaders l inkers f or a ctual co m puters. y a re, MS-D OS L inker - Pentiu m architectu r e, MPP L i nkers T3E architecture MS-DOS Linker T his e xplains s ome featu re s SunOS Link er s - S PARC a rchitecture,, Cra M icrost MS-D OS li n ker, w hich a li y n ker for P entium o ther x8 6 sys t ems. M ost MS-D OS c ompilers a ssemblers ( MAS M ) produce o bject m odules, and they a re stored i n.obj f iles. MS-D OS L INK a li nkage editor t hat c ombines one or m ore o bject m odules t o p roduce a c omplete exe cutable program -. EXE f ile; this file is later exe cuted for re s ults. The following table illustrates the typical MS- D OS object module Record Types De s cription THEADR Translator Header TYPDEF,PUBDEF, EXTDEF External sym bols and references LN AMES, SEGDEF, GRPDEF Seg ment definition and gr ouping CSE, SJBIT 96

102 S YSTEM SOFTWARE LEDATA, LID ATA Translated instruc tions and dat a FIXUP P Relocation and linking information MODEND End object m o dule T HEADR s pecifies n ame o bject mod u le. M ODEND specifies e nd m odule. P UBDEF c ontains l ist ext ernal sy mbols ( called p ublic n ames). EXTD EF c ontains list ext ernal symb ols referr ed i n th is mo dule, but d efined elsew h ere. T YPDEF the d ata t ypes are d efined h e re. SEGDEF desc ribes s egments i n obj ec t m odule ( i ncludes n ame, l ength, align m ent). G RPDEF i ncludes h ow segments are combin ed into g roups. L NAMES c ontains a ll segme nt and class n ames. L EDATA contains trans lated i nstructions d ata. L IDATA h as a bove i n external referenc es. RECOMMENDED QUESTI O NS: r epeating a 1) W rite an algorithm for an absolute loader ( 7) 2) Explain bootstrap loader s. ( 6 ) 3) Write an algorithm for Bootstrap loader. ( 7) 4) E xplain relocation w.r. loader. ( 8) 5) Explain bitmask with an exa m ple.(5) 6) Explain program linking w ith an example. ( 7) p t t ern. Finall y, 7) Write the algorithm for pass 1 an linking loader. ( 8 ) 8) Write the algorithm for pass 2 an linking loader. ( 8 ) 9) Explain CSADDR, PROGADDR, ESTAB.(6) 10) Explain linkag e editors. ( 8) 11) Explain dy n amic linking. ( 8 ) 12) Write shortnote s on (10) a. MS- DOS L i nker b. S un O S l inker F IXUPP u sed t o r esolve CSE, SJBIT 97

103 C hapter 5 A n EDITORS AND DEBUGGING SYST EMS I nteractive t ext e ditor h as b ecome a n environmen t. Text edito r knowledge w orkers a s i nformation. A n i mportant p art a lmost any c omputing a cts a s a primary in terface to c omputer for a ll type y c ompose, organiz e, stud y, manipul at e computer-based i nteractive d ebugging syste m p rovides p rogrammers w ith f acilities t hat a id i n t esting d ebugging p rograms. M any s uch s ystems a re a vailable d uring se da y s. O ur discussion b road n c ope, giving ove rview specific to any particular existing sys tem. 5.1 Text Editor s : A n I nteractive t ext e ditor h as b ecome a n intera ctive debu i mportant p art g ging s stems y n ot a lmost any c omputing environmen T ext e ditor a cts a s a primary i nterface t o c omputer f or a ll ty pe knowledge w orkers as they c ompose, organiz e, b ased i nformation. A t ext e ditor a llows yo u t o e dit a ext I nteractive t ext e ditors o n W indows O S - t ext editors on UNIX OS - v i, e macs, j ed, p ico. stud y, m anipulate computer- t f ile ( creat e, modify e tc ). F or exa mple Notep a d, W ordpad, Microst W o rd, Normally, c ommon e diting feature s associate d w ith text e ditors a re, M oving c ursor, D eleting, R eplacing, P asting, S earching, Searching replacin g, S aving loading, and, Miscellaneous(e. g. quitting) Overview the editing proces s A n i nteractive e ditor a targ et c omputer r doc u men D ocument i ncludes o bjects s uch a s p og ram that a llows a user t o c reate revc SE a computer d iagrams, tex t, e quations t ables, d iagrams, line art, and photographs. I n text editors, character string s a re p rimary ele ments the target te x CSE, SJBIT 98

104 Document-editing process in an interactive user-computer dialog u e has four tasks: - Select the part the target document to be viewe d and manipulated - Determine how tormat this view on-line and how to display i t - Specify and execute operations that modify the targe t document - Upda te the view appr o priately a bove t ask i nvolves t raveling, filtering f ormatting. E diting p hase involv es i nsert, delete, replace, move, copy, cut, pa ste, editor s. o o e t c Traveling locate the area interest Filtering - e xtracting the relevant subset o Formatting visible representation on a display s creen re a re t wo ty pes e ditors. Manuscript-orie nted e ditor program Manuscript-o riented e ditor a ssociated ith o riented w c haracters, w ords, li n es, s entences paragra p hs. Program-orie nted e ditors a re associa ted w ith i dentifiers, ke y words, s tatements. Use r w h what he want s f ormatted User Interfac e: C onceptual m odel e diting s ystem provi de s a n easily understood a bstraction t arget d ocument i ts e lements. F or e xample, Line e ditors s imulated the w orld the ke y p unch 80 characte r s, single l ine o r a n integra l nu mber lin es, Scree n ed itors D ocument is represented as a quarter-plane text lines, unb ounded both down and to the rig h u ser i nterface concerned w ith, i nput d evices, o utput devices, i nteraction l anguage. The i nput d evices a re u sed t o e nter e lements text e nter c ommands. ou tput d evices, l ets the us er view e lements be ing edite d r esults the e d itor. dit b eing edite d, t o e ing o perations, interactio n langua ge pr ovides communicatio n w ith I nput Devices are divided into three categories: CSE, SJBIT 99

105 o o text devices button devices o Locator devices. 1. T ext Device s s ymbols o n a re keyb o ard. B utton D evices ar e s pecial f unction ke y s, s creen. L ocator De vices a re mo u se, d ata t able re ar e v oice i nput devic es w hich t ranslates spoken w ords t o e quivalents. ir text ual 2. O utput D evices a re T eletypewriters(first o utput d evices), G lass teletype s ( Cathode ray t ube ( CRT) technolo gy ), Monitors and Printers (Hard-copy). Advanc ed C RT t erminals, T FT 3. The interaction language could be, ty ping oriented or text command o riented and menu-o riented user i nterface. Typing oriente d o r text c ommand oriented i nteraction w as w ith olde st e ditors, i n the for m use comm s, use function keys, control key s etc. 4. Menu-o riented u ser i nterface h as m enu w ith a m ultiple c hoice set text s trings o r i cons. D isplay a rea f or text limi t ed. M enus can be f. turned o n o r Editor Structure: M ost t ext e ditors h ave a s tructure s imilar t o t hat s hown i n f ollowing figur e. text e ditors h ave a s tructure s imilar t o sh computer s o wn in he T hat t figure r egardless feature s m ost the C ommand langua ge P rocessor a ccepts command, u ses s emantic r outines p erforms f unctions s uch a s v iewing and e diting viewin g. display functions. se mantic r outines i nvolve t raveling, editin g, CSE, SJBIT 100

106 E diting component Editing buffe r E diting fi lter Traveling component Main memory inp ut Comma nd l anguage processor View i ng component V iewing buffe r View ing f ilter O utput dev i ces Contro l Da t a Display component T ypical Editor Structure Paging Routines Fil e syste m E diting o perations a re s pecified explicitly by the u ser d isplay o perations a re I n s pecified imp licitly by th e e ditor. T raveling v iewing o perations m ay b e i nvoked either explicitly b y the user or implicitly by the editing operations. editing a ocument, d s tart a rea t o b e e dited d etermined by he t c urrent e diting p ointer m aintained by e diting co m ponen E diting c omponent a c ollection reset m odules ealing d w ith editing t asks. C urrent e diting p ointer c an b e due to next paragraph, next screen, cut paragraph, paste paragraph et c..,. s et o r Wh en e diting c ommand sued, editin g comp onent i nvokes editi ng filter generate s a ne w editing b uffer c ontains pa rt d ocument t o be edite d f rom c urrent e diting p ointer. F iltering editing m ay b e i nterleaved, w ith n o exp licit editor buffer being c reated. I n v iewing a d ocumen t, th e s tart a rea o t be v iewed d etermined by he t c urrent v iewing p ointer maintain ed by viewing co m ponen V iewing c omponent a c ollection m odules r esponsible f or d etermining next v iew. C urrent v iewing pointer can be set or reset as a result previous editing opera t ion. CSE, SJBIT 101

107 W hen d isplay n eeds t o b e u pdated, v iewing comp onent i nvokes v iewing f ilter generate s a n ew iewi c urrent v iewing p ointer. I n v ng b uffer c ontains p art d ocument t o b e v iewed f rom c ase l ine e ditors v iewing b uffer may c ontain c urrent l ine, Screen e ditors - viewing b uffer con tains a rectang ular cutout quarter plane the t ex V iewing b uffer a n p ssed d isplay by m apping b uffer t o a a t o display c omponent e ditor, whic h produce s rectang ular s ubset window. I dentical u ser e dits t ext directly o n s creen. Disj R eplace ( F or ex a mple, re ar e 150 l ines t ext, u ser in change all occurrences text editor with editor ). editing and viewing buf fers ca n c ompletely contained in othe r. s creen c alled a oint ind F 100th l ine, d ecides t o a lso be partially overlapp e d, or on e may be W indows typically c over e ntire screen o r a r ectangular port ion i M ay s how d ifferent p ortions s ame f ile o r p ortions differe nt file. Inter-file editing operat ions are possible. c omponents the e ditor d eal w ith a u ser documen t o n t wo l evels : I n m ain m emory i n d isk f ile s y stem. Loading a n e ntire d ocument i nto mai n memory m ay b e infe asible n r outines. o ly D ocuments may n ot b e p art l oaded eman s tored sequential d d paging u sed u ses e ditor pagin g ly a s a s tring f o c haracters. U ses separate e ditor data s tructure t hat allo ws a dditi on, d eletion, modificatio n w ith a minimu m I/ O and character m ovemen T ypes editors based on computing environmen t Editors function in three basic types computing environment s : 1. Time sha r ing 2. Stand-al one 3. Distribute d. Each typ e environment imposes some constraints on the desig n an e d itor. CSE, SJBIT 102

108 I n I n t ime sharing e nvironment, e ditor m ust funct l oad o n the computer s processor, memory and I / O de v ices. stand-a lone environ m ent, e ditors o n f unctions t o carry ut io n swiftly w ithin context stand-a lone sy stem a re b uilt w ith all o edi ting viewing operatio ns h elp be taken to carry out some tasks like demand paging. In d istributed environme nt, independently o n shared resources such as files. e ditor has b oth u f nc tions each u ser s mac hine l ike a t ime sharing O S m ay a lso stand-alone edito r; t o r un e ditor, c ontend f or 5.2 Interactive Debugging System s : A n i nteractive debugging sy stem p rovides progr a mmers ith w f acilities t hat a id i n t esting d ebugging p rograms. M any s uch sy stems a re a vailable d uring se d ays. O ur d iscussion b road n cope, g iving o verview i nteractive debugging syste ms n ot s pecific t o an y particular existing sys t em. Here we d iscuss - Introducing important functions and capabilities - R elationship IDS to other parts the system - The nature the user interface for ID S Debugging Functions and Capa b ilities: ID S O ne i mportant r equirement an y I DS o bservation c ontrol low f p rogram exec u tion. S etting break p oints exe cution s uspended, u se debug ging c ommands to analy ze the p rogress pro g ram, r ésumé execution pro g ram. S etting s ome c onditional e xpressions, eval uated d uring debugging s ession, progra m exe cution suspended, when conditions are met, analy s is is made, later execution is resumed. A Debugging sy s tem should also provide functions such as tracing and trace back. CSE, SJBIT 103

109 SYSTE M SOFTWARE Tracing can b e use d t o tr ack the f low exe cution logic and data modificati o ns. c ontrol f low c an b e t raced a t d ifferent l evels det ail p rocedure, b ranch, i ndividual instruc tion, a n d so on T race b ack can reache d. It s how the p ath by which c an a lso sho w cur rent s tatement i n progr m a w as which s tatements ha ve modified a g iven variable o r param eter. The statements are displaye d rather than as hexadecimal displacements Program-D isplay capabilities A debugger should have good program- d isplay capabilities. Program being debugged should be displayed completely w ith statement numbers. The program may be displayed as originally w ritten or with macro expansion. K eeping t rack any cha nges made t o the progra ms during debuggin g s e ssion. S upport f or symbolically displaying o r modifying c ontents any v ariables and constants in the program. R esume execution after these changes. T o p rovide se functi o ns, a debug ger s hould c onsider language in wh ich p rogram b eing debug ged w ritten. A s ingle debugger m any prog ramming l anguages language independe n The debugger- a speci fic programming language language dependen The debugge r must be sensitive to the specific language being debugged. context being u sed h as many diff erent e ffects o n debug ging inter a ction. statements are different depending on the langu age Cobol - M OVE 6. 5 T O X Fortran - X = 6. 5 C - X = 6. 5 Examples assign ment statements CSE, SJBIT 104

110 Similarly, the condition that X be unequal to Z may b e expressed as COBOL- IF X NOT EQUAL TO Z FORTRAN- I F(X.NE. Z) C - IF (X<> Z) Similar differences exist with respect to the form statement labels, keyw ords and so on l anguage n otation u sed t o specify pro g ram eing c ertain debugging f unctions v aries accor ding t o b debu g ged. S ometimes languag e t ranslator i tself h as d ebugger i nterface m odules t hat c an r espond t o r equest f or debug ging by u ser. sour ce c ode may b e displayed by debug ger i n s tandard f orm o r a s s pecified by user or tr an slator. I t M any optimizations a lso i mportant t hat a debugging s ystem be a ble t o like d eal w ith o ptimized c ode. create - Invariant expressions can be removed fro m loops - Separate loops can be combined into a singl e loop - Redundant expression may b e eliminated - Elimination unnecessary b ranch instructions Lea ds t o rearrang ement seg ments c ode i n progr a m. A ll problems for the debugger, and should be handled carefully Relationship with Other P a rts the System: i mportant re quirement f or an i nteractive deb u gger se optimiz t hat i t alway s be a tions available. Must appear as part the run- time environment and an integral part the sy s tem. W hen a n e rror discov red, e i mmediate debuggin g m ust b e possi le. b debug ger m ust c ommunicate cooperate w ith o ther operating sy stem c omponents s uch a s interactive subsys tems. CSE, SJBIT 105

111 D ebugging time. W hen a n applic at ion stops. m ore i mportant a t produ tion c t ime th an i t a t application-developm e nt a pplication f ails d uring a p roduction r un, w ork d ependent o n d ebugger m ust also ext i n a integrity components the sys tem. debug ger m ust c oordinate i ts languag e compilers and interpreters. w ay t hat c onsistent w ith the t hat security a ctivities w ith t hose exting f uture User-Interface Criter i a: D ebugging sy stems hould s b e closely re f lect common user tasks. s imple n i i ts organizat ion f amiliar i n i ts l anguage, The simple organization contribute greatly to ease training ease use. u ser i nteraction shou ld m ake u se as much as possible. full- creen s displays windowing-sy Wi th m enus full-s creen e ditors, u ser h as f ar l ess i nformation t o stems e nter remember. re should b e complete f unctional equivalence betwee n c ommands m enus user where unable to use full- screen IDSs may u se commands. command language should have a c lear, logical and simple syntax. command formats should be as flexible as possib le. A ny good I DSs s hould h ave an on-l ine H ELP facilit y. from any state the debugging s ession. H ELP s hould b e acc essib le R ECOMMENDED QUESTIONS: 1. List out the four tasks to be accomplished by a n interactive editor process. (4) 2. Explain user interfa ce. ( 6 ) 3. With a diag ram explain the structure a n editor. ( 10) 4. Explain user interface criter i a. ( 6) 5. Explain debugging functions and its cap abi lities. ( 8 ) CSE, SJBIT 106

112 C hapter 6 MACRO PROCES S OR A Macr o language. r epresents a commonly u sed g roup s tatements i n s ource progr a mming A macro instruction (macro) is a notational convenience for the programmer o I t a llows programme r t o p rogramming) w rite s horthand ve rsion a pro g ram m ( od ule The macro proc essor repla ces e ach m acro instructio n w ith the corresponding g roup source o o languag e statements ( ex panding) Normally, it performs no analy s is the text it handles. I t doe s expa n sion. n ot c oncern m eaning invol ve d The design a macro processor generally is machine independe n t! Two new a s sembler directives are used in macro definition o M ACRO: ide n tify the beginning a macro definition o M END: identify end a macro definition Prototype for the macro o Each parameter beg i ns with & name MACRO param eters M END : body : s tatements during ma cro o Body : the statements that will be generat ed as the expansion the macro. CSE, SJBIT 107

113 6.1. Basic Macro Processor Funct i ons: Macro Definition and Expans ion Macro Processor Algorithms and Data structures 6.1.1Macro Definition and Expansion: F igure s hows M ACRO ex p ansion. l eft b lock s hows M ACRO definitio n rig ht b lock shows exp anded mac ro r eplacing MACRO call w ith its b lock executable instruc t ion. M 1 a r egister A i n D 1 m acro ith w t wo parameter s D 1 D 2. M ACRO s tores c ontents th e c ontents r egister B n p arameters DA TA1 and D ATA2, Second tim e MACRO is expended wit h the executable s tatements. i D 2. L ater M 1 w ith D ATA4 DAT A 3. i nvoked w ith Every c all s tatement M 1 Fig 6.1: macro call DAT A 1, D ATA2 a m acro i nvocation s tatements t hat g ives name m acro instruc tion b eing invoke d the a rguments ( M1 M 2 ) t o be expanding. A macro invocation is referred as a Macro Call or In vocation. used i n CSE, SJBIT 108

114 Macro Ex p ansion: prog ram with m acros s upplied t o the macro proc e ssor. Each macro invocatio n s tatement w ill b e exp anded i nto s tatement s t hat f orm body th e m acro, w ith a rguments fr om mac ro i nvocation s ubstituted f or the parameter s i n the macr o protot y pe. D uring ex p ansion, m acro d efinition s tatements a re d eleted since they ar e n o neede d. l onger argume nts pa rameters a re a ssociated w ith o ne a nother accordin g t o their p ositions. f irst argum ent i n prototy p e and so on. macro m atches w ith f irst p arameter i n m acro A fter m acro processing exp anded f ile c an b ecome input f or Assembler. M acro I nvocation st atement f rom e xpansion tre ated exactly programmer. h e d ifference betw M acro ex p anded he e en M cros c onsidered a s a s though they ha d c omments stat ement genera ted been written directly by a Subrou tines t hat s tatement s f rom bod y t n umber t imes m acro invocatio n e ncountered, wherea s s tatement subro utine a ppears only onc e n o m atter h ow many tim es s ubroutine is called. Macro instructions will be written so that the body the macro contains no labels. Problem the label in the body macro: o o I f S olutions: o o sa me mac ro exp anded multi ple t imes a t progra m d ifferent places i n re w ill be d uplicate labels, w hich w ill be t reated a s error s by assembler. Do not use labels in the body macro. Explicitly use PC-r elative addressing instead. Ex, in RDBUF F and WRBUF F macros, o J EQ * + 11 o JL T *- 14 I t is inconvenient and error-prone. CSE, SJBIT 109

115 SYSTE M SOFTWARE E xpansion. f ollowing program s hows c oncept M acro Invocation M acro Fi g 6. 2: c oncept Macro I nvocation and Macro Expansion. CSE, SJBIT 110

116 SYSTEM SOFTWARE Macro Processor Algorithm and Data Structure: Design can be done as two-pass or a one-pa ss macro. In case two-pass assemble r. Two-pass macro proces sor You may design a two-p ass macro processor o Pa s s 1: o Pa s s 2: Process all macro def initions Expand all macro invocation statemen ts However, one-pass ma y be enough o B ecause a ll m acros ould w h ave t o b e macro invocations were expande d. d efinition a invoke that mac r o. d efined dur i ng he t f irst p ass b efore any macro m ust a ppear b efore any sta tements t hat Moreover, the body one macro can contain definitions the other macro Consider the example a Macro defining another Mac r o. In the example below, the bod y the first M acro (MACROS) conta ins statement that define RDBUFF, WRBUFF and other macro instructions for SIC machine. b ody mac h ine. econd s M acro ( MACROX) defin es s e s ame m acros f or SI C/XE A p roper i nvocation wou ld m ake the run on either SIC or SIC/XEma c hine. s ame pro ram g t o per form macro invocation t o CSE, SJBIT 111

117 MACROS for SIC machine F ig 4. 3( a) MACROX for SIC/ XE Machin e F ig 4. 3(b) CSE, SJBIT 112

118 A progra m t hat t o b e r un o n SI C s y stem c uld progra m to be run on SIC/XE can invoke MACROX. o i nvoke M ACROS w hereas a However, defining MACROS or MACROX does not define RDBUFF and WRBUFF. se d efinitions a re p rocessed n is expande d. o ly w hen a n inv o cation M ACROS o r M ACROX One-Pass Macro Processor: A one-p ass macro processor that alternate between mac ro definition a n e xpansion in a recursive way is able to handle rec ursive macro definition. Res triction o o d efinition a m acro m ust appe ar i n the statements that invoke that macr o. This restriction does not create any real inconvenienc e. d macr o source progra m before any The design considered is for one-pass assembler. The data structures require d are: DEFTAB ( Definition Table) o o o S tores the macro definition including macro prototype and macro body Comment lines are omitte d. R eferences t o acr m o i nstruction p arameters ar e converte d t o a notation for efficiency in substituting arg u ments. p ositional NAMTAB ( Name Ta b le) o o Stores macro nam es Serves as an index to DEFT AB Pointers to the be ginning and the e nd the macro definition ( DEFT AB) CSE, SJBIT 113

119 ARGTAB ( Arg u ment o o o Table) Stores the arguments according to their positions in the arg u ment lis A s m acro exp anded arg uments from substituted for the corresponding parameters in the macro body. f igure b elow shows d ifferent data r elationship. Arg ument t able are s tructures d escribed th eir F ig 6.4: data structures their relationship. Th e a bove f igure s hows p ortion ontents p rogram in p age n o. 3. I n f ig 4.4(a) d efinition e ntry i n N AMTAB aving arg uments r eferred b y exam p le, Th e T D = X? 1 a bove i nstruction t o c t able d uring p rocessing th e R DBUFF h pointers to th e beginnin g i nstructions a re d enoted b y t est he th e s tored i n e nd th e DEFT B, A with a n defi it n i o n. The ir p ositional notati o ns. For t availability th e device w hose number is giv en b y th e p arameter & IN DEV. In the instruction this is replaced by its positional v alue? 1. CSE, SJBIT 114

120 S YSTEM SOFTWARE F igure 4.4(b) s hows A RTAB a s i t s tatement as given below: w ould a ppear d uring e xpansion th e R DBUFF CLO OP RDBUF F F 1, BUFFER, LENGTH F or i nvocation s econd B UFFER indicating L ENGTH ( which in dicates total e ncountered i n from ARGTA B. Th e mak e a lgorithm c alled t o e ntry s et u p m acro R DBUFF, first parame ter F 1 (input device c ode), ( address w here the characters read ar e store d), and th e a line ro t hird length th e re cord to b e r ead). W hen th e? n notatio n f DEFTA B, a simple in dexing operati on suppli es th e proper arg ument acro M processo r is giv en bel o w. T his h as procedure DEFI NE t o m acro n me argumen a i n NAMT A B, M acro Prototype i n DEFT A B. E XPAND t valu es in ARGTA B expan d a M acro Invocatio n stateme n Procedure GET LINE is called to get the next line to be processed either from the DEFTA B or from the file itself. W hen a macro d efinition is encountered it is e ntered i n t o c ontinue e ntering t ill M END is encount red. within another Macr o. W hile d efining i n definitio n. T h is c ompletes d efinition c ounter D EFTAB e e I f v ry fir st DEF re a M END d oes n ot c omplete d efinition a s variable LEVEL. M acro s there TA B. The n ormal approach p rogram aving t aken as th e h a M acro d efined e nd another oute r M acro Macro whic h a a w hole. Th erefore D EFINE p rocedure k eeps a Every t ime a Ma cro dir ective enc ountered th is c ounter increment ed by 1. m oment i nnermost M acro e nds indicated by d irective M END i t s tarts decreasing v alue ze r o. directive. a ppear i n a ounter c varia ble by o ne. l ast M END s hould m ake c ounter v alue s et t o S o wh en L EVEL b ecomes z ero, MEN D cor responds t o M ost m acro p rocessors a llow t hr d efinitions stand rd origina l MACRO commonly u sed instructio ns t o a syste m librar y, r ather t han in s ource progr a m. T his m akes use macros convenient; definitions are retrieved from the library a s they a re ne eded during m acro processing. CSE, SJBIT 115

121 S YSTEM SOFTWARE Fig 6.5: Algorith m s Macro librar y CSE, SJBIT 116

lar e g r 1 MB Wi o n ws P X protected m d o e s gment s v r a a i ble s z i e 64 KB system c n o trol in t s ructions 4 y b e t s se e l ctor

lar e g r 1 MB Wi o n ws P X protected m d o e s gment s v r a a i ble s z i e 64 KB system c n o trol in t s ructions 4 y b e t s se e l ctor I n protected-, m emory larger t han 1 MB b e accessed Windows X P prote cted I n a ddion, segments b e variable size (b e low o r a bove 64 KB) So me s ystem c ontrol instructions are o nly va lid protecte

More information

A L A BA M A L A W R E V IE W

A L A BA M A L A W R E V IE W A L A BA M A L A W R E V IE W Volume 52 Fall 2000 Number 1 B E F O R E D I S A B I L I T Y C I V I L R I G HT S : C I V I L W A R P E N S I O N S A N D TH E P O L I T I C S O F D I S A B I L I T Y I N

More information

P a g e 5 1 of R e p o r t P B 4 / 0 9

P a g e 5 1 of R e p o r t P B 4 / 0 9 P a g e 5 1 of R e p o r t P B 4 / 0 9 J A R T a l s o c o n c l u d e d t h a t a l t h o u g h t h e i n t e n t o f N e l s o n s r e h a b i l i t a t i o n p l a n i s t o e n h a n c e c o n n e

More information

M M 3. F orc e th e insid e netw ork or p rivate netw ork traffic th rough th e G RE tunnel using i p r ou t e c ommand, fol l ow ed b y th e internal

M M 3. F orc e th e insid e netw ork or p rivate netw ork traffic th rough th e G RE tunnel using i p r ou t e c ommand, fol l ow ed b y th e internal C i s c o P r o f i l e C o n t a c t s & F e e d b a c k H e l p C isc o S M B S up p ort A ssistant Pass Routing Information over IPsec VPN Tunnel between two ASA/PIX H ome > W ork W ith M y S ec urity

More information

T ypical Memor y Hierar chy Configurations L ocality i n P rograms T he con ventional wisdom i s p rograms spend 90% o f ir t ime executi ng 10% o f t

T ypical Memor y Hierar chy Configurations L ocality i n P rograms T he con ventional wisdom i s p rograms spend 90% o f ir t ime executi ng 10% o f t 4. explain in detail different dynamic storage allocati o n june july 2014. S tatic vs. D ynamic A llocation S tatic: C ompile t ime, D ynamic: R untime a llocation Many c ompilers u se some c ombination

More information

4.2.2 B X_BE ( BX i s B elow o r E qual) is a symbolic location JNBE / JA instruction if Not (Below or Equal) or if Above No Ex. Cy = 0 AND Z= 0

4.2.2 B X_BE ( BX i s B elow o r E qual) is a symbolic location JNBE / JA instruction if Not (Below or Equal) or if Above No Ex. Cy = 0 AND Z= 0 4.2 Terms used in comparison Above and Below used for comparing Unsig ned numbers. Greater than and less than used when c omparing signed numbers. All Intel microprocessors use this conventio n. Accordingly,

More information

T h e C S E T I P r o j e c t

T h e C S E T I P r o j e c t T h e P r o j e c t T H E P R O J E C T T A B L E O F C O N T E N T S A r t i c l e P a g e C o m p r e h e n s i v e A s s es s m e n t o f t h e U F O / E T I P h e n o m e n o n M a y 1 9 9 1 1 E T

More information

Bellman-F o r d s A lg o r i t h m The id ea: There is a shortest p ath f rom s to any other verte that d oes not contain a non-negative cy cle ( can

Bellman-F o r d s A lg o r i t h m The id ea: There is a shortest p ath f rom s to any other verte that d oes not contain a non-negative cy cle ( can W Bellman Ford Algorithm This is an algorithm that solves the single source shortest p ath p rob lem ( sssp ( f ind s the d istances and shortest p aths f rom a source to all other nod es f or the case

More information

What are S M U s? SMU = Software Maintenance Upgrade Software patch del iv ery u nit wh ich once ins tal l ed and activ ated prov ides a point-fix for

What are S M U s? SMU = Software Maintenance Upgrade Software patch del iv ery u nit wh ich once ins tal l ed and activ ated prov ides a point-fix for SMU 101 2 0 0 7 C i s c o S y s t e m s, I n c. A l l r i g h t s r e s e r v e d. 1 What are S M U s? SMU = Software Maintenance Upgrade Software patch del iv ery u nit wh ich once ins tal l ed and activ

More information

CPU. 60%/yr. Moore s Law. Processor-Memory Performance Gap: (grows 50% / year) DRAM. 7%/yr. DRAM

CPU. 60%/yr. Moore s Law. Processor-Memory Performance Gap: (grows 50% / year) DRAM. 7%/yr. DRAM ecture 1 3 C a ch e B a s i cs a n d C a ch e P erf o rm a n ce Computer Engineering 585 F a l l 2 0 0 2 What Is emory ierarchy typical memory hierarchy today "! '& % ere we focus on 1/2/3 caches and main

More information

P a g e 3 6 of R e p o r t P B 4 / 0 9

P a g e 3 6 of R e p o r t P B 4 / 0 9 P a g e 3 6 of R e p o r t P B 4 / 0 9 p r o t e c t h um a n h e a l t h a n d p r o p e r t y fr om t h e d a n g e rs i n h e r e n t i n m i n i n g o p e r a t i o n s s u c h a s a q u a r r y. J

More information

OH BOY! Story. N a r r a t iv e a n d o bj e c t s th ea t e r Fo r a l l a g e s, fr o m th e a ge of 9

OH BOY! Story. N a r r a t iv e a n d o bj e c t s th ea t e r Fo r a l l a g e s, fr o m th e a ge of 9 OH BOY! O h Boy!, was or igin a lly cr eat ed in F r en ch an d was a m a jor s u cc ess on t h e Fr en ch st a ge f or young au di enc es. It h a s b een s een by ap pr ox i ma t ely 175,000 sp ect at

More information

I zm ir I nstiute of Technology CS Lecture Notes are based on the CS 101 notes at the University of I llinois at Urbana-Cham paign

I zm ir I nstiute of Technology CS Lecture Notes are based on the CS 101 notes at the University of I llinois at Urbana-Cham paign I zm ir I nstiute of Technology CS - 1 0 2 Lecture 1 Lecture Notes are based on the CS 101 notes at the University of I llinois at Urbana-Cham paign I zm ir I nstiute of Technology W hat w ill I learn

More information

2

2 Computer System AA rc hh ii tec ture( 55 ) 2 INTRODUCTION ( d i f f e r e n t r e g i s t e r s, b u s e s, m i c r o o p e r a t i o n s, m a c h i n e i n s t r u c t i o n s, e t c P i p e l i n e E

More information

Software Process Models there are many process model s in th e li t e ra t u re, s om e a r e prescriptions and some are descriptions you need to mode

Software Process Models there are many process model s in th e li t e ra t u re, s om e a r e prescriptions and some are descriptions you need to mode Unit 2 : Software Process O b j ec t i ve This unit introduces software systems engineering through a discussion of software processes and their principal characteristics. In order to achieve the desireable

More information

CA Compiler Construction

CA Compiler Construction CA4003 - Compiler Construction Code Generation to MIPS David Sinclair Code Generation The generation o machine code depends heavily on: the intermediate representation;and the target processor. We are

More information

Geometric Predicates P r og r a m s need t o t es t r ela t ive p os it ions of p oint s b a s ed on t heir coor d ina t es. S im p le exa m p les ( i

Geometric Predicates P r og r a m s need t o t es t r ela t ive p os it ions of p oint s b a s ed on t heir coor d ina t es. S im p le exa m p les ( i Automatic Generation of SS tag ed Geometric PP red icates Aleksandar Nanevski, G u y B lello c h and R o b ert H arp er PSCICO project h ttp: / / w w w. cs. cm u. ed u / ~ ps ci co Geometric Predicates

More information

Table of C on t en t s Global Campus 21 in N umbe r s R e g ional Capac it y D e v e lopme nt in E-L e ar ning Structure a n d C o m p o n en ts R ea

Table of C on t en t s Global Campus 21 in N umbe r s R e g ional Capac it y D e v e lopme nt in E-L e ar ning Structure a n d C o m p o n en ts R ea G Blended L ea r ni ng P r o g r a m R eg i o na l C a p a c i t y D ev elo p m ent i n E -L ea r ni ng H R K C r o s s o r d e r u c a t i o n a n d v e l o p m e n t C o p e r a t i o n 3 0 6 0 7 0 5

More information

User Manual. 1000BASE-T1 SFP Module

User Manual. 1000BASE-T1 SFP Module User anual 1000-1 odule Version 0.3 05. June 2017 echnica ngineering Gmb eopoldstraße 236 80807 ünchen Germany ax: +49-89-200-072430 mail: nfo@technica-engineering.de www.technica-engineering.de ndex 1

More information

Agenda Rationale for ETG S eek ing I d eas ETG fram ew ork and res u lts 2

Agenda Rationale for ETG S eek ing I d eas ETG fram ew ork and res u lts 2 Internal Innovation @ C is c o 2 0 0 6 C i s c o S y s t e m s, I n c. A l l r i g h t s r e s e r v e d. C i s c o C o n f i d e n t i a l 1 Agenda Rationale for ETG S eek ing I d eas ETG fram ew ork

More information

Instruction Sheet COOL SERIES DUCT COOL LISTED H NK O. PR D C FE - Re ove r fro e c sed rea. I Page 1 Rev A

Instruction Sheet COOL SERIES DUCT COOL LISTED H NK O. PR D C FE - Re ove r fro e c sed rea. I Page 1 Rev A Instruction Sheet COOL SERIES DUCT COOL C UL R US LISTED H NK O you or urc s g t e D C t oroug y e ore s g / as e OL P ea e rea g product PR D C FE RES - Re ove r fro e c sed rea t m a o se e x o duct

More information

176 5 t h Fl oo r. 337 P o ly me r Ma te ri al s

176 5 t h Fl oo r. 337 P o ly me r Ma te ri al s A g la di ou s F. L. 462 E l ec tr on ic D ev el op me nt A i ng er A.W.S. 371 C. A. M. A l ex an de r 236 A d mi ni st ra ti on R. H. (M rs ) A n dr ew s P. V. 326 O p ti ca l Tr an sm is si on A p ps

More information

shhgs@wgqqh.com chinapub 2002 7 Bruc Eckl 1000 7 Bruc Eckl 1000 Th gnsis of th computr rvolution was in a machin. Th gnsis of our programming languags thus tnds to look lik that Bruc machin. 10 7 www.wgqqh.com/shhgs/tij.html

More information

Building Validation Suites with Eclipse for M odel-based G eneration Tools

Building Validation Suites with Eclipse for M odel-based G eneration Tools Building Validation Suites with Eclipse for M odel-based G eneration Tools 24.6.2010 D r. O scar Slotosch Validas A G C ontent M o d el-b ased D evelo p m en t (o f Em b ed d ed Syst em s) ISO 26262 Valid

More information

H STO RY OF TH E SA NT

H STO RY OF TH E SA NT O RY OF E N G L R R VER ritten for the entennial of th e Foundin g of t lair oun t y on ay 8 82 Y EEL N E JEN K RP O N! R ENJ F ] jun E 3 1 92! Ph in t ed b y h e t l a i r R ep u b l i c a n O 4 1922

More information

Lesson Ten. What role does energy play in chemical reactions? Grade 8. Science. 90 minutes ENGLISH LANGUAGE ARTS

Lesson Ten. What role does energy play in chemical reactions? Grade 8. Science. 90 minutes ENGLISH LANGUAGE ARTS Lesson Ten What role does energy play in chemical reactions? Science Asking Questions, Developing Models, Investigating, Analyzing Data and Obtaining, Evaluating, and Communicating Information ENGLISH

More information

THIS PAGE DECLASSIFIED IAW EO IRIS u blic Record. Key I fo mation. Ma n: AIR MATERIEL COMM ND. Adm ni trative Mar ings.

THIS PAGE DECLASSIFIED IAW EO IRIS u blic Record. Key I fo mation. Ma n: AIR MATERIEL COMM ND. Adm ni trative Mar ings. T H S PA G E D E CLA SSFED AW E O 2958 RS u blc Recod Key fo maon Ma n AR MATEREL COMM ND D cumen Type Call N u b e 03 V 7 Rcvd Rel 98 / 0 ndexe D 38 Eneed Dae RS l umbe 0 0 4 2 3 5 6 C D QC d Dac A cesson

More information

Building Harmony and Success

Building Harmony and Success Belmont High School Quantum Building Harmony and Success October 2016 We acknowledge the traditional custodians of this land and pay our respects to elders past and present Phone: (02) 49450600 Fax: (02)

More information

Alles Taylor & Duke, LLC Bob Wright, PE RECORD DRAWINGS. CPOW Mini-Ed Conf er ence Mar ch 27, 2015

Alles Taylor & Duke, LLC Bob Wright, PE RECORD DRAWINGS. CPOW Mini-Ed Conf er ence Mar ch 27, 2015 RECORD DRAWINGS CPOW Mini-Ed Conf er ence Mar ch 27, 2015 NOMENCLATURE: Record Draw ings?????? What Hap p ened t o As- Built s?? PURPOSE: Fur n ish a Reco r d o f Co m p o n en t s Allo w Locat io n o

More information

Dangote Flour Mills Plc

Dangote Flour Mills Plc SUMMARY OF OFFER Opening Date 6 th September 27 Closing Date 27 th September 27 Shares on Offer 1.25bn Ord. Shares of 5k each Offer Price Offer Size Market Cap (Post Offer) Minimum Offer N15. per share

More information

APPLICATION INSTRUC TIONS FOR THE

APPLICATION INSTRUC TIONS FOR THE APPLICATION INSTRUC TIONS FOR THE CHESS/ CHECKERBOARD Using the Che ss, Che c ke rs a nd Bo rd e rs: (SMALL), Pro duc t Numb e r: 11-1W-009 SIZE: a p p ro xima te ly 10 fe e t e a c h sid e ESTIMATED PAINT

More information

5 4 MI L P C V : E T s t e n s o h l m e a t o: C SOR T I T III /I O I ACI G N T I M V I N MI E O S D MES: A t e h e t e h c s, e t s t e

5 4 MI L P C V : E T s t e n s o h l m e a t o: C SOR T I T III /I O I ACI G N T I M V I N MI E O S D MES: A t e h e t e h c s, e t s t e C OURSE MATERIAL S ubject C ode : E C6504 Subject : Microprocesso r and Class : III Y ear E CE Microcontro ller D ept. of ECE EC6504 MICROPROCESSOR AND MIC S S.NO CONTENT S PAGE.NO UNI T 1 THE 8086 MICROPROCES

More information

Fr anchi s ee appl i cat i on for m

Fr anchi s ee appl i cat i on for m Other Fr anchi s ee appl i cat i on for m Kindly fill in all the applicable information in the spaces provided and submit to us before the stipulated deadline. The information you provide will be held

More information

Use precise language and domain-specific vocabulary to inform about or explain the topic. CCSS.ELA-LITERACY.WHST D

Use precise language and domain-specific vocabulary to inform about or explain the topic. CCSS.ELA-LITERACY.WHST D Lesson eight What are characteristics of chemical reactions? Science Constructing Explanations, Engaging in Argument and Obtaining, Evaluating, and Communicating Information ENGLISH LANGUAGE ARTS Reading

More information

APPLICATION INSTRUCTIONS FOR THE

APPLICATION INSTRUCTIONS FOR THE APPLICATION INSTRUCTIONS FOR THE USA MA P WITH C A PITA LS & O C EA NS (LA RG E) Pro duc t Numbe r: 16-13W-051 SIZE: a ppro xima te ly 24 fe e t wide x 15 fe e t lo ng (ma inla nd o nly) ESTIMA TED PA

More information

I/O7 I/O6 GND I/O5 I/O4. Pin Con fig u ra tion Pin Con fig u ra tion

I/O7 I/O6 GND I/O5 I/O4. Pin Con fig u ra tion Pin Con fig u ra tion 2M x 8 HIGH SPEED LOW POWER ASYRONOUS CMOS STATIC RAM Ex tended Tem per a ture TTS2MWV8 FEATURES High Speed access times 25, 35ns High-perfromace, low power CMOS process Multiple center power and ground

More information

Form and content. Iowa Research Online. University of Iowa. Ann A Rahim Khan University of Iowa. Theses and Dissertations

Form and content. Iowa Research Online. University of Iowa. Ann A Rahim Khan University of Iowa. Theses and Dissertations University of Iowa Iowa Research Online Theses and Dissertations 1979 Form and content Ann A Rahim Khan University of Iowa Posted with permission of the author. This thesis is available at Iowa Research

More information

Description LB I/O15 I/O14 I/O13 I/O12 GND I/O11 I/O10 I/O9 I/O8

Description LB I/O15 I/O14 I/O13 I/O12 GND I/O11 I/O10 I/O9 I/O8 18k x 16 HIGH SPEED ASYN CHRON OUS CMOS STATIC RAM Ex tended Tem per a ture TTS18WV16 FEATURES -High-speed access time: 0,5,35,45ns -Low Active Power: 55mW (typical) -Low stand-by power: 1 W (typical)

More information

Executive Committee and Officers ( )

Executive Committee and Officers ( ) Gifted and Talented International V o l u m e 2 4, N u m b e r 2, D e c e m b e r, 2 0 0 9. G i f t e d a n d T a l e n t e d I n t e r n a t i o n a2 l 4 ( 2), D e c e m b e r, 2 0 0 9. 1 T h e W o r

More information

Use precise language and domain-specific vocabulary to inform about or explain the topic. CCSS.ELA-LITERACY.WHST D

Use precise language and domain-specific vocabulary to inform about or explain the topic. CCSS.ELA-LITERACY.WHST D Lesson seven What is a chemical reaction? Science Constructing Explanations, Engaging in Argument and Obtaining, Evaluating, and Communicating Information ENGLISH LANGUAGE ARTS Reading Informational Text,

More information

W Table of Contents h at is Joint Marketing Fund (JMF) Joint Marketing Fund (JMF) G uidel ines Usage of Joint Marketing Fund (JMF) N ot P erm itted JM

W Table of Contents h at is Joint Marketing Fund (JMF) Joint Marketing Fund (JMF) G uidel ines Usage of Joint Marketing Fund (JMF) N ot P erm itted JM Joint Marketing Fund ( JMF) Soar to Greater Heights with Added Marketing Power P r e s e n t a t i o n _ I D 2 0 0 6 C i s c o S y s t e m s, I n c. A l l r i g h t s r e s e r v e d. C i s c o C o n f

More information

APPLICATION INSTRUCTIONS FOR THE

APPLICATION INSTRUCTIONS FOR THE APPLICATION INSTRUCTIONS FOR THE SNA KES A ND LA DDERS A DD O N FO R USE WITH THE C HESS, C HEC KERS & BO RDERS LARG E AND NUMBER SET Pro duc t Numb e r: 17-2W-062 SIZE: a ppro xima te ly 19 fe e t e a

More information

K owi g yourself is the begi i g of all wisdo.

K owi g yourself is the begi i g of all wisdo. I t odu tio K owi g yourself is the begi i g of all wisdo. A istotle Why You Need Insight Whe is the last ti e ou a e e e taki g ti e to thi k a out ou life, ou alues, ou d ea s o ou pu pose i ei g o this

More information

INTERIM MANAGEMENT REPORT FIRST HALF OF 2018

INTERIM MANAGEMENT REPORT FIRST HALF OF 2018 INTERIM MANAGEMENT REPORT FIRST HALF OF 2018 F r e e t r a n s l a t ion f r o m t h e o r ig ina l in S p a n is h. I n t h e e v e n t o f d i s c r e p a n c y, t h e Sp a n i s h - la n g u a g e v

More information

Chapter 7: Digital Components. Oregon State University School of Electrical Engineering and Computer Science. Review basic digital design concepts:

Chapter 7: Digital Components. Oregon State University School of Electrical Engineering and Computer Science. Review basic digital design concepts: hapter 7: igital omponents Prof. en Lee Oregon tate University chool of Electrical Engineering and omputer cience hapter Goals Review basic digital design concepts: esigning basic digital components using

More information

Q s e iton B ank U IT

Q s e iton B ank U IT Question Bank UNIT 1 1. Define Computer Architecture. Illustr a te seven dimensions of an ISA?(10 marks (M a/ June 2010 (June 2012 (Dec 2012 ( June 2011 ( June 2013 2. What is dependabilit? Explain two

More information

The Ind ian Mynah b ird is no t fro m Vanuat u. It w as b ro ug ht here fro m overseas and is now causing lo t s o f p ro b lem s.

The Ind ian Mynah b ird is no t fro m Vanuat u. It w as b ro ug ht here fro m overseas and is now causing lo t s o f p ro b lem s. The Ind ian Mynah b ird is no t fro m Vanuat u. It w as b ro ug ht here fro m overseas and is now causing lo t s o f p ro b lem s. Mynah b ird s p ush out nat ive b ird s, com p et ing for food and p laces

More information

Gen ova/ Pavi a/ Ro ma Ti m i ng Count er st at Sep t. 2004

Gen ova/ Pavi a/ Ro ma Ti m i ng Count er st at Sep t. 2004 Ti m i ng Count er st at us @ Sep t. 2004 1 Ti m i n g Cou n t er act i vi t i es Ti m i n g r esol u t i on : 100 p s FWHM h ave b een ach i eved. PM s ch ar act er ised i n t h e COBRA m ag n et f or

More information

APPLICATION INSTRUC TIONS FOR THE

APPLICATION INSTRUC TIONS FOR THE APPLICATION INSTRUC TIONS FOR THE DAISY HOPSCOTCH Pro duc t Numb e r: 12-2W-03 SIZE: a p p ro xima te ly 14 fe e t hig h x 4 fe e t wid e. ESTIMATED PAINT TIME: a p p ro xima te ly 1 2 p e o p le fo r

More information

Criteria Supporting Features Remarks and explanations

Criteria Supporting Features Remarks and explanations Date: May 7, 2010 Voluntary Product Accessibility Template Name of Product: WebCase, version 1.9 Contact for more Information: Vere Software 4790 Caughlin Pkwy #323 Reno, Nevada 89519 888-432-4445 info@veresoftware.com

More information

d 1941. ncies ation thereors as ence, is, which r he the of are anvass ve ining, ies a study ely, fully ta special e rested gencies that are affiliated mably, these agenand at least somewhat l, they are

More information

Per cent Wor d Pr oblems

Per cent Wor d Pr oblems Per cent Wor d Pr oblems Ratio and proportion method Her e ar e sever al aids t hat will help you solve wor d pr oblems: 1. Make sur e you under st and t he quest ion t hat is asked 2. Sor t out t he inf

More information

S ca le M o d e l o f th e S o la r Sy ste m

S ca le M o d e l o f th e S o la r Sy ste m N a m e ' D a t e ' S ca le M o d e l o f th e S o la r Sy ste m 6.1 I n t r o d u c t i o n T h e S olar System is large, at least w hen com pared to distances we are fam iliar w ith on a day-to-day basis.

More information

M Line Card Redundancy with Y-Cab l es Seamless Line Card Failover Solu t ion f or Line Card H ardw or Sof t w are Failu res are Leverages hardware Y-

M Line Card Redundancy with Y-Cab l es Seamless Line Card Failover Solu t ion f or Line Card H ardw or Sof t w are Failu res are Leverages hardware Y- Line Card Redundancy with Y-Cab l es Technical Overview 1 M Line Card Redundancy with Y-Cab l es Seamless Line Card Failover Solu t ion f or Line Card H ardw or Sof t w are Failu res are Leverages hardware

More information

o Alphabet Recitation

o Alphabet Recitation Letter-Sound Inventory (Record Sheet #1) 5-11 o Alphabet Recitation o Alphabet Recitation a b c d e f 9 h a b c d e f 9 h j k m n 0 p q k m n 0 p q r s t u v w x y z r s t u v w x y z 0 Upper Case Letter

More information

COMPILATION OF AUTOMATA FROM MORPHOLOGICAL TWO-LEVEL RULES

COMPILATION OF AUTOMATA FROM MORPHOLOGICAL TWO-LEVEL RULES Kimmo Koskenniemi Re se ar ch Unit for Co mp ut at io na l Li ng ui st ic s University of Helsinki, Hallituskatu 11 SF-00100 Helsinki, Finland COMPILATION OF AUTOMATA FROM MORPHOLOGICAL TWO-LEVEL RULES

More information

e-hm REPAIR PARTS REPAIR PARTS ReHM R3

e-hm REPAIR PARTS REPAIR PARTS ReHM R3 e-hm REPAIR PARTS REPAIR PARTS ReHM R3 TABLE OF CONTENTS Rating Plate..........................................................................................2 A li ati n ene t an n t......................................................................3

More information

M1 a. So there are 4 cases from the total 16.

M1 a. So there are 4 cases from the total 16. M1 a. Remember that overflow is defined as the result of the operation making no sense, which in 2's complement representa tion is equivalent to the mathematical result not fitting in the format. if any

More information

Logic Design. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Logic Design. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson Logic Deign CS 270: Mathematical Foundation of Computer Science Jeremy Johnon Logic Deign Objective: To provide an important application of propoitional logic to the deign and implification of logic circuit.

More information

Results as of 30 September 2018

Results as of 30 September 2018 rt Results as of 30 September 2018 F r e e t r a n s l a t ion f r o m t h e o r ig ina l in S p a n is h. I n t h e e v e n t o f d i s c r e p a n c y, t h e Sp a n i s h - la n g u a g e v e r s ion

More information

I M P O R T A N T S A F E T Y I N S T R U C T I O N S W h e n u s i n g t h i s e l e c t r o n i c d e v i c e, b a s i c p r e c a u t i o n s s h o

I M P O R T A N T S A F E T Y I N S T R U C T I O N S W h e n u s i n g t h i s e l e c t r o n i c d e v i c e, b a s i c p r e c a u t i o n s s h o I M P O R T A N T S A F E T Y I N S T R U C T I O N S W h e n u s i n g t h i s e l e c t r o n i c d e v i c e, b a s i c p r e c a u t i o n s s h o u l d a l w a y s b e t a k e n, i n c l u d f o l

More information

c. What is the average rate of change of f on the interval [, ]? Answer: d. What is a local minimum value of f? Answer: 5 e. On what interval(s) is f

c. What is the average rate of change of f on the interval [, ]? Answer: d. What is a local minimum value of f? Answer: 5 e. On what interval(s) is f Essential Skills Chapter f ( x + h) f ( x ). Simplifying the difference quotient Section. h f ( x + h) f ( x ) Example: For f ( x) = 4x 4 x, find and simplify completely. h Answer: 4 8x 4 h. Finding the

More information

EECS150. Arithmetic Circuits

EECS150. Arithmetic Circuits EE5 ection 8 Arithmetic ircuits Fall 2 Arithmetic ircuits Excellent Examples of ombinational Logic Design Time vs. pace Trade-offs Doing things fast may require more logic and thus more space Example:

More information

Provider Satisfaction

Provider Satisfaction Prider Satisfaction Prider Satisfaction [1] NOTE: if you nd to navigate away from this page, please click the "Save Draft" page at the bottom (visible to ONLY logged in users). Otherwise, your rpons will

More information

THIS PAGE DECLASSIFIED IAW E

THIS PAGE DECLASSIFIED IAW E THS PAGE DECLASSFED AW E0 2958 BL K THS PAGE DECLASSFED AW E0 2958 THS PAGE DECLASSFED AW E0 2958 B L K THS PAGE DECLASSFED AW E0 2958 THS PAGE DECLASSFED AW EO 2958 THS PAGE DECLASSFED AW EO 2958 THS

More information

Beechwood Music Department Staff

Beechwood Music Department Staff Beechwood Music Department Staff MRS SARAH KERSHAW - HEAD OF MUSIC S a ra h K e rs h a w t r a i n e d a t t h e R oy a l We ls h C o l le g e of M u s i c a n d D ra m a w h e re s h e ob t a i n e d

More information

Yamaha Virago V-twin. Instruction manual with visual guide for Yamaha XV

Yamaha Virago V-twin. Instruction manual with visual guide for Yamaha XV Yamaha Virago V-twin Instruction manual with visual guide for Yamaha XV700-1100 PHOTO HOWN FOR ILLU TRATION PURPO E ONLY We o use a o e pie e housi g a d s all si gle to e oils fo i p o ed ope aio. If

More information

Grain Reserves, Volatility and the WTO

Grain Reserves, Volatility and the WTO Grain Reserves, Volatility and the WTO Sophia Murphy Institute for Agriculture and Trade Policy www.iatp.org Is v o la tility a b a d th in g? De pe n d s o n w h e re yo u s it (pro d uc e r, tra d e

More information

FOR SALE T H S T E., P R I N C E AL BER T SK

FOR SALE T H S T E., P R I N C E AL BER T SK FOR SALE 1 50 1 1 5 T H S T E., P R I N C E AL BER T SK CHECK OUT THIS PROPERTY ON YOUTUBE: LIVINGSKY CONDOS TOUR W W W. LIV IN G S K YC O N D O S. C A Th e re is ou tstan d in g val ue in these 52 re

More information

TG-0 Mira Act ivities: Using the mira* S6 E F

TG-0 Mira Act ivities: Using the mira* S6 E F TG-0 Mira Act ivities: Using the mira* S6 The mira is a mirror through w hich y ou can see (to the other side of the mirror). This allows you to perceive the reflected image in the mira as actually being

More information

Chapter #7: Sequential Logic Case Studies Contemporary Logic Design

Chapter #7: Sequential Logic Case Studies Contemporary Logic Design hapter #7: Sequential Logic ase Studies ontemporary Logic Design No. 7- Storage egister Group of storage elements read/written as a unit 4-bit register constructed from 4 D FFs Shared clock and clear lines

More information

The distribution of characters, bi- and trigrams in the Uppsala 70 million words Swedish newspaper corpus

The distribution of characters, bi- and trigrams in the Uppsala 70 million words Swedish newspaper corpus Uppsala University Department of Linguistics The distribution of characters, bi- and trigrams in the Uppsala 70 million words Swedish newspaper corpus Bengt Dahlqvist Abstract The paper describes some

More information

WELCOME. O ne Vi si on Photography i s a award wi nni ng wed d i ng photographer & wed d i ng vi d eography i n S outh Wal e s

WELCOME. O ne Vi si on Photography i s a award wi nni ng wed d i ng photographer & wed d i ng vi d eography i n S outh Wal e s WELCOME HELLO O ne Vi si on Photography i s a award wi nni ng wed d i ng photographer & wed d i ng vi d eography i n S outh Wal e s I t і ѕ а k nоwn f ac t thаt i mages speak а thousand word аnd thаt і

More information

NCU EE -- DSP VLSI Design. Tsung-Han Tsai 1

NCU EE -- DSP VLSI Design. Tsung-Han Tsai 1 NCU EE -- DSP VLSI Design. Tsung-Han Tsai 1 Multi-processor vs. Multi-computer architecture µp vs. DSP RISC vs. DSP RISC Reduced-instruction-set Register-to-register operation Higher throughput by using

More information

This Specification is subject to change without notice

This Specification is subject to change without notice ProductS p e ci f i ca ti on BE31597E-0 1 a l p e f i n F T C D e M l a m e : E 3 1 5 9 7 E 1 l i m i n a p e f i i n a l p e f i ProductF un cti on S ci ca ti on 31.5 i ch C ol ort -L M odul ode N B -0

More information

78/3 EISCAT TECHNICAL NOTES. THE EFFECT OF ICE ON AN ANTENNA REFLECTOR T. Hagfors. KIRUNA Sweden

78/3 EISCAT TECHNICAL NOTES. THE EFFECT OF ICE ON AN ANTENNA REFLECTOR T. Hagfors. KIRUNA Sweden 78/3 EISCAT TECHNICAL NOTES THE EFFECT OF ICE ON AN ANTENNA REFLECTOR T. Hagfors KIRUNA Sweden EISCAT TECHNICAL Na TE No. 3 JANUARY 1978 THE EFFECT OF ICE ON AN ANTENNA REFLECTOR T. Hagfors Summary. The

More information

PC Based Thermal + Magnetic Trip Characterisitcs Test System for MCB

PC Based Thermal + Magnetic Trip Characterisitcs Test System for MCB PC Based Thermal + Magnetic Trip Characterisitcs Test System for MCB PC BASED THERMAL + MAGNETIC TRIP CHARACTERISTIC S TEST SYSTEM FOR MCB The system essentially comprises of a single power source able

More information

ECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University

ECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University ECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University Prof. Mi Lu TA: Ehsan Rohani Laboratory Exercise #4 MIPS Assembly and Simulation

More information

USER MANUAL V1.3 CHRYSLER VEHICLES VEHICLE FLASHER

USER MANUAL V1.3 CHRYSLER VEHICLES VEHICLE FLASHER USER MANUAL V1.3 O B D - I I S TA L K CHRYSLER VEHICLES VEHICLE FLASHER WARRANT Y: This war r ant y pr ot ects the pr oduct(s) s pecified t o be fr ee fr om defects in mat erial and wor kmanship for 1(one)

More information

Get Started on CreateSpace

Get Started on CreateSpace {paperback self publishing process} Account Set Up Go to CreateSpace.com Click Sign up Fill out Create Account info fields * Under What type of media you are considering punlishing?, you may want to choose

More information

Enrico Nardelli Logic Circuits and Computer Architecture

Enrico Nardelli Logic Circuits and Computer Architecture Enrico Nardelli Logic Circuits and Computer Architecture Appendix B The design of VS0: a very simple CPU Rev. 1.4 (2009-10) by Enrico Nardelli B - 1 Instruction set Just 4 instructions LOAD M - Copy into

More information

System Data Bus (8-bit) Data Buffer. Internal Data Bus (8-bit) 8-bit register (R) 3-bit address 16-bit register pair (P) 2-bit address

System Data Bus (8-bit) Data Buffer. Internal Data Bus (8-bit) 8-bit register (R) 3-bit address 16-bit register pair (P) 2-bit address Intel 8080 CPU block diagram 8 System Data Bus (8-bit) Data Buffer Registry Array B 8 C Internal Data Bus (8-bit) F D E H L ALU SP A PC Address Buffer 16 System Address Bus (16-bit) Internal register addressing:

More information

Administrivia. Course Objectives. Overview. Lecture Notes Week markem/cs333/ 2. Staff. 3. Prerequisites. 4. Grading. 1. Theory and application

Administrivia. Course Objectives. Overview. Lecture Notes Week markem/cs333/ 2. Staff. 3. Prerequisites. 4. Grading. 1. Theory and application Administrivia 1. markem/cs333/ 2. Staff 3. Prerequisites 4. Grading Course Objectives 1. Theory and application 2. Benefits 3. Labs TAs Overview 1. What is a computer system? CPU PC ALU System bus Memory

More information

Lan Performance LAB Ethernet : CSMA/CD TOKEN RING: TOKEN

Lan Performance LAB Ethernet : CSMA/CD TOKEN RING: TOKEN Lan Performance LAB Ethernet : CSMA/CD TOKEN RING: TOKEN Ethernet Frame Format 7 b y te s 1 b y te 2 o r 6 b y te s 2 o r 6 b y te s 2 b y te s 4-1 5 0 0 b y te s 4 b y te s P r e a m b le S ta r t F r

More information

REGISTRATION DOCUMENTATION ENROLLMENT RENEWAL SCHOOL YEAR STUDENT

REGISTRATION DOCUMENTATION ENROLLMENT RENEWAL SCHOOL YEAR STUDENT REGISTRATION DOCUMENTATION ENROLLMENT RENEWAL SCHOOL YEAR STUDENT SCHOOL YEAR NECESSARY DOCUMENTAION OR REGISTRATION ENROLLMENT RENEWAL ACT 01 P IL I I I A I A, I AL A IAL I 02 P A A I I I A I A, I AL

More information

CUSTOM MODULES (Commercial / Moisture Resistant / Hermetic)

CUSTOM MODULES (Commercial / Moisture Resistant / Hermetic) TO O (ommercial / oisture esistant / ermetic) apabilities: ustomers looking for application specific custom power modules benefit from owerex s years of experience in chip manufacturing and design / engineering.

More information

Chapter 5 UMERICAL METHODS IN HEAT CONDUCTION

Chapter 5 UMERICAL METHODS IN HEAT CONDUCTION Heat Transfer Chapter 5 UMERICAL METHODS IN HEAT CONDUCTION Universitry of Technology Materials Engineering Department MaE216: Heat Transfer and Fluid bjectives Understand the limitations of analytical

More information

CSE Computer Architecture I

CSE Computer Architecture I Execution Sequence Summary CSE 30321 Computer Architecture I Lecture 17 - Multi Cycle Control Michael Niemier Department of Computer Science and Engineering Step name Instruction fetch Instruction decode/register

More information

Use r m an ual 東京 工 業 大 学. Co pyright(c) Tokyo Inst it u te of Te c h n o l o g y. A ll r i g hts re s e r ve d.

Use r m an ual 東京 工 業 大 学. Co pyright(c) Tokyo Inst it u te of Te c h n o l o g y. A ll r i g hts re s e r ve d. Use r m an ual 東京 工 業 大 学 Co pyright(c) Tokyo Inst it u te of Te c h n o l o g y. A ll r i g hts re s e r ve d. .E mail a ddre ss i n p u t co mp lete d p a ge V i s i t T2 B OX em a il a ddress inpu t

More information

A crash course in Digital Logic

A crash course in Digital Logic crash course in Digital Logic Computer rchitecture 1DT016 distance Fall 2017 http://xyx.se/1dt016/index.php Per Foyer Mail: per.foyer@it.uu.se Per.Foyer@it.uu.se 2017 1 We start from here Gates Flip-flops

More information

Senility Degree. Our machine derives APG waveform after 2 nd differential of arterial pulse wave in order to measure

Senility Degree. Our machine derives APG waveform after 2 nd differential of arterial pulse wave in order to measure Senility Degree Our machine derives APG waveform after 2 nd differential of arterial pulse wave in order to measure 1. Cardiac Eccentric Constriction Power 2. Arterial Elasticity 3. Remaining blood volume

More information

ECE 3401 Lecture 23. Pipeline Design. State Table for 2-Cycle Instructions. Control Unit. ISA: Instruction Specifications (for reference)

ECE 3401 Lecture 23. Pipeline Design. State Table for 2-Cycle Instructions. Control Unit. ISA: Instruction Specifications (for reference) ECE 3401 Lecture 23 Pipeline Design Control State Register Combinational Control Logic New/ Modified Control Word ISA: Instruction Specifications (for reference) P C P C + 1 I N F I R M [ P C ] E X 0 PC

More information

SM6-36. adaptation instructions. fuse blowing electrical. English. distribution HTA

SM6-36. adaptation instructions. fuse blowing electrical. English. distribution HTA SM6-36 English distribution HTA adaptation instructions fuse blowing electrical signalling SCHNEIDER ELECTRIC foreword symbols and conven ons you w ll f d all the symbols below throughout the document,

More information

L07-L09 recap: Fundamental lesson(s)!

L07-L09 recap: Fundamental lesson(s)! L7-L9 recap: Fundamental lesson(s)! Over the next 3 lectures (using the IPS ISA as context) I ll explain:! How functions are treated and processed in assembly! How system calls are enabled in assembly!

More information

Introduction to Differential Equations

Introduction to Differential Equations CHAPTER 1 Introduction to Differential Equations Differential equations arise from real-world proble ms and problems in applied mathematics. One of the fi rst things you are taught in calculus is that

More information

Project Two RISC Processor Implementation ECE 485

Project Two RISC Processor Implementation ECE 485 Project Two RISC Processor Implementation ECE 485 Chenqi Bao Peter Chinetti November 6, 2013 Instructor: Professor Borkar 1 Statement of Problem This project requires the design and test of a RISC processor

More information

Tie Bar Extension Measuring Chain

Tie Bar Extension Measuring Chain Force Tie Bar Extension Measuring Chain Type 9827A... for Clamped or Screwed Installation in Injection Molding Machines Tie bar ex ten sion meas ur ing chain con sist ing of a quartz longi tu di nal meas

More information

LABORATORY MANUAL MICROPROCESSOR AND MICROCONTROLLER

LABORATORY MANUAL MICROPROCESSOR AND MICROCONTROLLER LABORATORY MANUAL S u b j e c t : MICROPROCESSOR AND MICROCONTROLLER TE (E lectr onics) ( S e m V ) 1 I n d e x Serial No T i tl e P a g e N o M i c r o p r o c e s s o r 8 0 8 5 1 8 Bit Addition by Direct

More information

Chapter 5 Workshop on Fitting of Linear Data

Chapter 5 Workshop on Fitting of Linear Data Chapter 5 Workshop on Fitting of Linear Data (Contributed by E.L. Allen, SJSU) 5.0 Learning Objectives After successfully com pleting this laboratory workshop, including the assigned reading, the lab repot

More information

A Hallelujah for My Father

A Hallelujah for My Father Univeity o New Mexico UNM Digital Repoitoy New Mexico Compoe' chive Reeach Collection and Data 1312011 Hallelujah o My Fathe lan Stinge Robet Fanci Follow thi and additional wok at: http://digitalepoitoyunmedu/nm_compoe_achive

More information