Cs2304 Ss 2marks

29
www.nskinfo.com  –College Student and faculty website Department of nskinfo-i education CS2304 SYSTEM SOFTWARE 3 1 0 4  UNIT I INTRODUCTION 8 Sys tem sof twa re and mac hine arc hit ect ure - The Simpli fied Instructi onal Comput er( SIC) - Machine architecture - Data and instruction formats - addressing modes -instruction sets - I/O and programming  UNIT II ASSEMBLERS 10 !asic assem"ler functions - # simple SIC assem"ler - #ssem"ler algorithm and data structures - Machin e depende nt assem"ler features - Instruction formats and addressing modes - $rogram relocation - Machine independent assem"ler features - %iterals - Sym"ol-defining statements - &'pr ess ions - One pas s assem" ler s and Mul ti pas s ass em"ler s - Imp lementa tion e'ample - M#SM assem"ler  UNIT III LOADERS AND LINKERS 9 !asic loader function s - Design of an #"solute %oader - # Simple !ootstrap %oader - Machine dependent loader features - elocation - $rogram %ining - #lgorithm and Data Structures for %ini ng %oader - Machine-i ndepende nt loader features - #utomatic %i"rary Search - %oader Options - %oader design options - %inage &ditors - Dynamic %ining - !ootstrap %oaders - Implementation e'ample - MSDOS liner  UNIT IV MACRO PROCESSORS 9 !asic macro processor functions - Macro Definition and &'pansion - Macro $rocessor #lgorithm and data structures - Machine-independent macro processor features - Concatenation of Macro $arameters - *eneration of +ni,ue %a"els - Conditional Macro &'pansion - eyword Macro $arameters-Macro within Macro-Implementation e'ample - M#SM Macro $rocessor - #.SI C Macro language  UNIT V SYSTEM SOFTWARE TOOLS 9 Te't editors - Oeriew of the &diting $rocess - +ser Interface - &ditor Structure - Interactie de"ugging systems - De"ugging functions and capa"ilities - elationship with other parts of the system - +ser-Interface Criteria  TEXT BOOK: 0 %eland % !ec1 2System Software - #n Introduction to Systems $rogramming31 4rd &dition1 $earson &ducation #sia1 5667  REFERENCES: 0 D M Dhamdhere1 2 Systems $rogramming and Operating Systems31 Second eised &dition1 Tata Mc*raw-8ill1 5666 5 9ohn 9 Donoan 2Systems $rogramming31 Tata Mc*raw-8ill &dition1 5666 4 9ohn %eine1 %iners : %oaders - 8arcourt India $t %td1 Morgan aufmann $u"lishers1 5666 - 1 -

Transcript of Cs2304 Ss 2marks

Page 1: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 1/29

www.nskinfo.com –College Student and faculty website

Department of nskinfo-i education

CS2304 SYSTEM SOFTWARE 3 1 0 4

 

UNIT I INTRODUCTION 8System software and machine architecture - The Simplified Instructional Computer(SIC) -Machine architecture - Data and instruction formats - addressing modes -instruction sets - I/Oand programming UNIT II ASSEMBLERS 10

!asic assem"ler functions - # simple SIC assem"ler - #ssem"ler algorithm and data structures -Machine dependent assem"ler features - Instruction formats and addressing modes - $rogramrelocation - Machine independent assem"ler features - %iterals - Sym"ol-defining statements -&'pressions - One pass assem"lers and Multi pass assem"lers - Implementation e'ample -M#SM assem"ler

 UNIT III LOADERS AND LINKERS 9

!asic loader functions - Design of an #"solute %oader - # Simple !ootstrap %oader - Machinedependent loader features - elocation - $rogram %ining - #lgorithm and Data Structures for %ining %oader - Machine-independent loader features - #utomatic %i"rary Search - %oader Options - %oader design options - %inage &ditors - Dynamic %ining - !ootstrap %oaders -Implementation e'ample - MSDOS liner UNIT IV MACRO PROCESSORS 9

!asic macro processor functions - Macro Definition and &'pansion - Macro $rocessor #lgorithmand data structures - Machine-independent macro processor features - Concatenation of Macro

$arameters - *eneration of +ni,ue %a"els - Conditional Macro &'pansion - eyword Macro$arameters-Macro within Macro-Implementation e'ample - M#SM Macro $rocessor - #.SI CMacro language UNIT V SYSTEM SOFTWARE TOOLS 9

Te't editors - Oeriew of the &diting $rocess - +ser Interface - &ditor Structure - Interactiede"ugging systems - De"ugging functions and capa"ilities - elationship with other parts of thesystem - +ser-Interface Criteria TEXT BOOK:

0 %eland % !ec1 2System Software - #n Introduction to Systems $rogramming31 4rd

&dition1 $earson &ducation #sia1 5667 REFERENCES:

0 D M Dhamdhere1 2Systems $rogramming and Operating Systems31 Secondeised &dition1 Tata Mc*raw-8ill1 56665 9ohn 9 Donoan 2Systems $rogramming31 Tata Mc*raw-8ill &dition1 56664 9ohn %eine1 %iners : %oaders - 8arcourt India $t %td1 Morgan aufmann$u"lishers1 5666

- 1 -

Page 2: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 2/29

 

UNIT I INTRODUCTION

1 D!"#$! %&%'!( %)"'*+,!A.,#/M+&-2003 N)D! 2005 A.,M+& 2008

It consists of ariety of programs that supports the operation of the computer This softwaremaes it possi"le for the user to focus on the other pro"lems to "e soled with out needing to

now how the machine wors internally &g; operating system1 assem"ler1 loader

2 6#! %)(! +../#+'#)$% )" ).!,+'#$7 %&%'!(

Operating system acts as an interface "etween the user and the systemo To mae the computer easier to use

o To manage the resources in computer

o $rocess management

o Data and memory management

o To proide security to the user

3 D!"#$! )(.#/!, +$ #$'!,.,!'!,

Compiler is a set of program which conerts the whole high leel language program to machinelanguage programInterpreter is a set of programs which conerts high leel language program to machine language program line "y line

4 D!"#$! /)+!,

%oader is a set of program that loads the machine language translated "y the translator into themain memory and maes it ready for e'ecution

W+' #% '! $!! )" MAR ,!7#%'!,;

M# (memory address register) is used to store the address of the memory from which the data

is to "e read or to which the data is to "e written

< D,+* SS #$%',='#)$ "),(+'

6 < = 0> 07 0? 56 40 45 4>47 @<It is a 7 "yte instruction used to moe %AI "ytes data fro the storage location0 to the storagelocation5Storage location0 B D0 A !0Storage location5 B D5 A !5&g; MOE 761@66(4)1 >66(@)

5 6#! +$& '*) #""!,!$!% >!'*!!$ >+%! ,!/+'#! +,!%%#$7 +$ .,)7,+( )=$'!, ,!/+'#!

+,!%%#$7 =%! #$ SICXE N)D! 200<

!ase relatie addressingThe Target address is calculated using the formulaTarget address B Displacement A !!-"ase register Displacement lies "etween 6 to @6?>

- 2 -

Page 3: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 3/29

$C relatie addressing8ere the target address is calculated using the formulaTarget address B Displacement A $C$C-program counter Displacement lies "etween -56@= to 56@<

8 D!"#$! #$#,!' +,!%%#$7

In the case of immediate addressing the operand field gies the memory location The word from

the gien address is fetched and it gies the address of the operand &g; #DD >1 7668ere the second operand is gien in indirect addressing mode First the word in memory location766 is fetched and which will gie the address of the operand

9 D!"#$! #((!#+'! +,!%%#$7

In this addressing mode the operand alue is gien directly There is no need to refer memoryThe immediate addressing is indicated "y the prefi' GHG&g; #DD H> in this instruction one operand is in accumulator and the second operand is aimmediate alue the alue > is directly added with the accumulator content and the result isstored in accumulator

10 L#%' )=' +$& '*) CISC +$ RISC (+#$!CISC -$ower $C1 Cray T4&ISC - E#1 $entium $ro architecture

11 F)//)*#$7 #% + (!(),& )$"#7=,+'#)$:

A,!%% V+/=! R!7#%'!, R 

  1

  5

  <

W+' #% '! ,!%=/' )" '! ")//)*#$7 %'+'!(!$';

#DD 7(immediate) to (indirect)

8ere 7 is the immediate data and the ne't alue is indirect data ie the register contains theaddress of the operand 8ere the address of the operand is > and its corresponding alue is <7 A B 7A > B 7A < B04

12 F)//)*#$7 #% + (!(),& )$"#7=,+'#)$:

A,!%% V+/=! R!7#%'!, R 

  4 9 <

  5

  < 2

W+' #% '! ,!%=/' )" '! ")//)*#$7 %'+'!(!$';

S+! @(direct) to (direct)

8ere one operand is in the address location @(direct addressing) and the ne't operand is in theregister (register direct)The resultant alue is ? -7 B4

13 W+' #% '! $+(! )" A X +$ L ,!7#%'!, #$ SIC (+#$! +$ +/%) %.!#"& #'% =%!

N)D! 200<

- 3 -

Page 4: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 4/29

A-#ccumulator +sed for arithmetic operation ie in the case of arithmetic operations one operandis in the accumulator1 and other operand may "e a immediate alue1 register operand or memorycontent The operation gien in the instruction is performed and the result is stored in theaccumulator registerX- Inde' egister used for addressing

L-linage egister It is used to store the return address in the case of Jump to su"routine (9S+!)

instructions

14 W+' +,! '! #$%',='#)$ "),(+'% =%! #$ SICXE +,#'!'=,!; 6#! +$& )$! "),(+'

Format 0 (0 "yte)1 Format 5 (5 "ytes)1 Format 4 (4 "ytes) : Format @(@ "ytes)

 

1 C)$%#!, '! #$%',='#)$% #$ SIC XE .,)7,+((#$7

10 1000 LEN6T? RESW 4

20 ----- NEW WORD 3

  W+' #% '! +/=! +%%#7$ ') '! %&(>)/ NEW;In the line 06 the address is 0666 and the instruction is &SK @It reseres @ word (4 ' @B05)area for the sym"ol %&.*T8 8ence 05 is added to the %OCCTThus the alue of the sym"ol .&K is 0666A05 B066C

1< W+' #% '! #""!,!$! >!'*!!$ '! #$%',='#)$% LDA @ 3 +$ LDA T?REE;

In the first instruction immediate addressing is used 8ere the alue 4 is directly loaded into theaccumulator register In the second instruction the memory reference is used 8ere the address(address assigned for the sym"ol T8&&) is loaded into the accumulator register

15 D#""!,!$'#+'! ',+#/#$7 $=(!,# +$ /!+#$7 %!.+,+'! $=(!,#

The numeric format is used to represent numeric alues with one digit per "yte In the numericformat if the sign appears in the last "yte it is nown as the trailing numeric If the sign appearsin a separate "yte preceding the first digit then it is called as leading separate numeric

18 W+' +,! '! +,!%%#$7 ()!% =%! #$ VAX +,#'!'=,!;

egister direct1 register deferred1 auto increment and decrement1 program counter relatie1 "aserelatie1 inde' register mode and indirect addressing are the arious addressing modes in E#architecture

19 W+' #% I$! +,!%%#$7 ()!; ?)* ) &)= +/=/+'! '! +'=+/ +,!%% #$ '! +%! )" ,!7#%'!, #$#,!' *#' #((!#+'! #$! ()!; N)D! 2005

In Inde' addressing mode target address is calculated using the formulaT# B (register) A displacement

20 W,#'! '! %!=!$! )" #$%',='#)$% ') .!,"),( '! ).!,+'#)$ BETA ALP?A 1 =%#$7

SIC #$%',='#)$%

%D# #%$8#

- 4 -

Page 5: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 5/29

Page 6: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 6/29

memory1 regardless of the amount of memory actually present on the system For &g E#architecture supports irtual address space

29 E./+#$ +>)=' ',+#/#$7 +$ /!+#$7 $=(!,#;

T,#+/#$7 N=(!,#: .umeric format is used to represent numeric alues with one digit per "yteIn this format if sign appears in the last "yte then it is called Trialing numericL!+#$7 N=(!,#: If sign appears as a separate "yte preceding the first digit called leadingseparate numeric.

30. What is little Endian Byte ordering? The least signicant part of a numeric value is stored at the lower numberedaddress. This is called little endian byte ordering because the little end! of thevalue comes rst in memory.

UNIT II ASSEMBLERS

 1 D!"#$! '! >+%# "=$'#)$% )" +%%!(>/!,

Ptranslating mnemonic operation codes to their machine language e,uialentsP#ssigning machine addresses to sym"olic la"els used "y the programmer

2 W+' #% (!+$' >& +%%!(>/!, #,!'#!%; 6#! !+(./!

These are the statements that are not translated into machine instructions1 "ut they proideinstructions to assem"ler itself&'ample ST#T1 &.D1 !QT&1 KOD1 &SK and &S!

3 W+' #% + "),*+, ,!"!,!$!;

It is a reference to a la"el that is defined later in a programConsider the statement06 0666 ST% &T#D  =6 0647 &T#D &SK 0The first instruction contains a forward reference &T#D If we attempt to translate the program line "y line1 we will una"le to process the statement in line06 "ecause we do not nowthe address that will "e assigned to &T#D The address is assigned later(in line =6) in the program

4 W+' +,! '! ',!! #""!,!$' ,!),% =%! #$ )>!' .,)7,+(;

The header record1 te't record and the end record are the three different records used in o"Ject program The header record contains the program name1 starting address and length of the program Te't record contains the translated instructions and data of the program &nd recordmars the end of the o"Ject program and specifies the address in the program where e'ecution isto "egin

W+' #% '! $!! )" SYMTAB %&(>)/ '+>/! #$ +%%!(>/!,;

The sym"ol ta"le includes the name and alue for each sym"ol in the source program1 together with flags to indicate error conditions Some times it may contain details a"out the data areaSQMT#! is usually organiRed as a hash ta"le for efficiency of insertion and retrieal

- 6 -

Page 7: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 7/29

< W+' #% '! $!! )" OPTAB ).!,+'#)$ )! '+>/! #$ +%%!(>/!,;

The operation code ta"le contains the mnemonic operation code and its machine languagee,uialent Some assem"lers it may also contain information a"out instruction format and lengthO$T#! is usually organiRed as a hash ta"le1 with mnemonic operation code as the ey

5 W+' +,! '! %&(>)/ !"#$#$7 %'+'!(!$'% 7!$!,+//& =%! #$ +%%!(>/!,%;

P G&+G-it allows the programmer to define sym"ols and specify their alues directly The

general format is sym"ol EGU alueP GO*G-it is used to indirectly assign alues to sym"ols Khen this statement is encountered theassem"ler resets its location counter to the specified alueThe general format is OR6 alue in the a"oe two statements alue is a constant or ane'pression inoling constants and preiously defined sym"ols8 D!"#$! ,!/)+'+>/! .,)7,+(

#n o"Ject program that contains the information necessary to perform re,uired modification inthe o"Ject code depends on the starting location of the program during load time is nown asrelocata"le program

9 D#""!,!$'#+'! +>%)/='! !.,!%%#)$ +$ ,!/+'#! !.,!%%#)$

If the result of the e'pression is an a"solute alue (constant) then it is nown as a"solutee'pression&g ; !+F&.D - !+FF& If the result of the e'pression is relatie to the "eginning of the program then it is nown asrelatie e'pression1 la"el on instructions and data areas and references to the location counter alues are relatie terms&g; !+F&.D A !+FF& 

10 W,#'! '! %'!.% ,!=#,! ') ',+$%/+'! '! %)=,! .,)7,+( ') )>!' .,)7,+(

• Conert mnemonic operation codes to their machine language e,uialents

• Conert sym"olic operands to their e,uialent machine addresses

• !uild the machine instruction in the proper format• Conert the data constants specified in the source program into their internal machine

representation• Krite the o"Ject program and assem"ly listing

11 W+' #% '! =%! )" '! +,#+>/! LOCCTR /)+'#)$ )=$'!, #$ +%%!(>/!,; M+&=$!

-200<

This aria"le is used to assign addresses to the sym"ols %OCCT is initialiRed to the "eginningaddress specified in the ST#T statement #fter each source statement is processed the length of the assem"led instruction or data area to "e generated is added to %OCCT and hence wheneer we reach a la"el in the source program the current alue of %OCCT gies the address

associated with the la"el

12 D!"#$! /)+ +$ 7) +%%!(>/!,

One pass assem"ler that generates their o"Ject code in memory for immediate e'ecution isnown as load and go assem"ler 8ere no o"Ject programmer is written out and hence no needfor loader

13 W+' +,! '! '*) #""!,!$' '&.!% )" =(. %'+'!(!$'% =%! #$ MASM +%%!(>/!,;

- 7 -

Page 8: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 8/29

N!+, =(.; # near Jump is a Jump to a target in the same segment and it is assem"led "y usinga current code segment CS F+, =(.: # far Jump is a Jump to a target in a different code segment and it is assem"led "yusing different segment registers

14 W+' +,! '! =%!% )" >+%! ,!7#%'!, '+>/! #$ AIX +%%!(>/!,;

# "ase register ta"le is used to remem"er which of the general purpose registers are currentlyaaila"le as "ase registers and also the "ase addresses they contain

+SI.* statement causes entry to the ta"le and DO$ statement remoes the correspondingta"le entry1 D#""!,!$'#+'! '! +%%!(>/!, #,!'#!% RESW +$ RESB

&SK -It reseres the indicated num"er of words for data area&g; 06 0664 T8&& &SK 0 In this instruction one word area (4 "ytes) is resered for thesym"ol T8&& If the memory is "yte addressa"le then the address assigned for the ne't sym"olis 0667&S! -It reseres the indicated num"er of "ytes for data area&g; 06 066= I.$+T &S! 0 In this instruction one "yte area is resered for the sym"olI.$+T 8ence the address assigned for the ne't sym"ol is 066?

1< D!"#$! ()#"#+'#)$ ,!), +$ 7#! #'% "),(+'This record contains the information a"out the modification in the o"Ject code during programrelocation The general format is Col 0 M Col 5-< starting location of the address field to "emodified relatie to the "eginning of the program Col =-? length of the address field to "emodified in half "ytes

15 W,#'! )*$ '! .+%% $=(>!,% PASS 1 PASS 2 )" '! ")//)*#$7 +'##'#!% '+' )=, #$

+ '*) .+%% +%%!(>/!,:

+ O>!' )! 7!$!,+'#)$

> L#'!,+/% +! ') /#'!,+/ '+>/!

L#%'#$7 .,#$'!

A,!%% /)+'#)$ )" /)+/ %&(>)/%a O"Ject code generation - $#SS 5 " %iterals added to literal ta"le - $#SS 0c %isting printed - $#SS5d #ddress location of local sym"ols - $#SS0

18 W+' #% (!+$' >& (+#$! #$!.!$!$' +%%!(>/!, "!+'=,!%;

The assem"ler feature that does not depend upon the machine architecture is nown as machineindependent assem"ler features&g; program "locs1 %iterals

19 ?)* '! ,!7#%'!, ') ,!7#%'!, #$%',='#)$% +,! ',+$%/+'! #$ +%%!(>/!,;In the case of register to register instructions the operand field contains the register name Duringthe translation first the o"Ject code is conerted into its corresponding machine languagee,uialent with the help of O$T#! Then the SQMT#! is searched for the numeric e,uialentof register and that alue is inserted into the operand field&g; 05> 0647 D&C C%&# !@06!@-macine e,uialent of the opcode C%&# 06-numeric e,uialent of the register

- 8 -

Page 9: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 9/29

20 W+' #% (!+$' >& !'!,$+/ ,!"!,!$!%;

#ssem"ler program can "e diided into many sections nown as control sections and eachcontrol section can "e loaded and relocated independently of the others If the instruction in onecontrol section need to refer instruction or data in another control section the assem"ler is una"leto process these references in normal way Such references "etween controls are called e'ternalreferences21 D!"#$! )$',)/ %!'#)$

# control section is a part of the program that maintains its identity after assem"lyN each controlsection can "e loaded and relocated independently of the others Control sections are most oftenused for su"routines The maJor "enefit of using control sections is to increase fle'i"ility

22 W+' #% '! #""!,!$! >!'*!!$ '! +%%!(>/!, #,!'#! EXTREF +$ EXTDEF

&TD&F names e'ternal sym"ols that are defined in a particular control section and may "eused "y other sections&T&F names e'ternal sym"ols that are referred in a particular control section and defined inanother control section

23 6#! '! 7!$!,+/ "),(+' )" !"#$!% ,!),

This record gies information a"out e'ternal sym"ols that are defined in a particular controlsection The format isCol 0 DCol 5-< name of e'ternal sym"ol defined in this control sectionCol =-04 relatie address of the sym"ol with in this control sectionCol 0@-<4 name and relatie address for other e'ternal sym"ols

24 6#! '! =%! )" +%%!(>/!, #,!'#! CSECT +$ USE

CS&CT - used to diide the program into many control sections+S& - used to diide the program in to many "locs called program "locs

2 W+' #% '! =%! )" '! +%%!(>/!, #,!'#! START;The assem"ler directie ST#T gies the name and starting address of the program The formatis$. ST#T 06668ere$. - .ame of the program0666 - Starting address of the program 2< W+' #% '! $!! "), +$ +%%!(>/!, #,!'#!; M+&=$! -2005

#ssem"ler directies are not translated into machine instruction Instead1 they proideinstructions to the assem"ler itself

25 W+' #% S&(>)/ T+>/!; ?)* #% #' =%!"=/; N)D! 200< M+&=$! -2005

Sym"ol ta"le is a data structure used to store all the la"els or sym"ols present in the assem"lylanguage program along with the alue assigned to that sym"ol During pass 0 of assem"ler1sym"ol ta"le is used to store the alues of the sym"ols and during pass 51 it is used to translatethe instruction "y o"tained the address of the sym"ol

28 W+' #% + .,)7,+( >/)H;

- 9 -

Page 10: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 10/29

$rogram "loc refers to segments that are rearranged within a single o"Ject program unit

29 What is Near !"#?"n a #eat $ump the Target is in the same code segment. % near $ump is assembledusing theCurrent code segment registers. The assembled machine instruction for a near $umpoccupies & or ' bytes. (g. )*+ Target.

30. What is $ar %!"#?% far $ump is a )ump to a target in a di,erent code segment. % ar )ump isassembled using aDi,erent segment register which is specied in an instruction pro/. The assembledinstructionfor a ar )ump re0uires 1 bytes.(g. )*+ %2+T2 T%23(T

UNIT III LOADERS AND LINKERS

 

1 W+' +,! '! >+%# "=$'#)$% )" /)+!,%;%oading - "rings the o"Ject program into memory for e'ecutionelocation - modifies the o"Ject program so that it can "e loaded at an address different from thelocation originally specified%ining - com"ines two or more separate o"Ject programs and also supplies the informationneeded to reference them

2 D!"#$! +>%)/='! /)+!,

The loader1 which is used only for loading1 is nown as a"solute loader &g !ootstrap loader 

3 W+' #% (!+$' >& >))'%',+. /)+!,; N)D! 200 N)D! 200<

If the loading process re,uires more instructions that can "e read in single record1 this first recordcauses the reading of other1 and these in turn can cause the reading of still more records This is aspecial type of a"solute loader which loads the first program to "e run "y the computer (+suallyan operating system)O # "oot strap loader is special type of loader1 which is e'ecuted when a computer is first turned onor restarted It loads the first program to "e run "y the computer (+sually an operating system)

4 D!"#$! >#' (+%H 

The relocation "its are gathered together following the length indicator in each te't record andwhich is called as "it mas For eg the "it mas FFC(000000000066) specifies that the first 06

words of o"Ject code are to "e modified during relocation

W+' #% '! =%! )" ()#"#+'#)$ ,!),; N)D! 2008

Modification record is used for program relocation &ach modification record specifies thestarting address and the length of the field whose alue is to "e altered and also descri"es themodification to "e performed

< W+' +,! '! 2 #""!,!$' '!$#=!% =%! "), ,!/)+'#)$;

- 10 -

Page 11: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 11/29

Modification record method and relocation "it method

5 W+' #% '! "=$'#)$ )" .+%% 2 )" + /)+!,; M+&=$! -2005

$ass 5 of loader e'tracts the translated instructions and data from the o"Ject modules and "uildsan image of the e'ecuta"le program It performs the actual loading1 relocation and lining of the program

8 W+' #% R!/)+'#)$ >#' (!');If the relocation "it corresponding to a word of o"Ject code is set to 01 the programGs startingaddress is to "e added to this word when the program is relocated !it alue 6 indicates nomodification is re,uired

9 W+' +,! ,!/+'#! ,!/)+'#! /)+!,%;

%oaders that allow for program relocation are called relocating loaders

10 W+' #% '! $!! )" ESTAB;

It is used to store the name and address of the each e'ternal sym"ol It also indicates in whichcontrol section the sym"ol is defined

11 W+' #% '! =%! )" '! +,#+>/! PRO6ADDR;

It gies the "eginning address in memory where the lined program is to "e loaded The startingaddress is o"tained from the operating system

12 W,#'! '! '*) .+%%!% )" + /#$H#$7 /)+!,

$ass0; assigns address to all e'ternal sym"ols$ass5; it performs actual loading1 relocation and lining

14 W+' #% '! "=$'#)$ )" MS-DOS LINK; M+&=$! -200<

MS-DOS %I. is a linage editor that com"ines one or more o"Ject modules to produce a

complete e'ecuta"le program This e'ecuta"le program has the file e'tension &&%I. canalso com"ine the translated program with other modules from o"Ject code li"raries

1 D!"#$! +=')(+'# /#>,+,& %!+,

In many lining loaders the su"routines called "y the program "eing loaded are automaticallyfetched from the li"rary1 lined with the main program and loaded This feature is referred to asautomatic li"rary search

1< L#%' '! /)+!, ).'#)$% INCLUDE DELETE

The general format of I.C%+D& is I.C%+D& program name (li"rary name)This commanddirect the loader to read the designated o"Ject program from a li"rary and treat it as the primary

loader inputThe general format of D&%&T& command is D&%&T& Csect-name it instructs the loader todelete the named control sections from the sets of programs loaded

15 6#! '! "=$'#)$% )" '! /#$H#$7 /)+!, M+&=$! -200<

The lining loader performs the process of lining and relocation It includes the operation of automatic li"rary search and the lined programs are directly loaded into the memory The

- 11 -

Page 12: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 12/29

relocation and lining is performed each time the program is loaded It produces a lined ersionof a program and which is written in a file for later e'ecution 8ere the loading can "eaccomplished in a single o passes are re,uired

18 D!"#$! &$+(# /#$H#$7

If the su"routine is loaded and lined to the program during its first call (run time)1 then it iscalled as dynamic loading or dynamic lining

19 W+' #% '! =%! )" /#$H+7! !#'),; N)D! 200i Simply preparing an o"Ject program for e'ecution

ii %inage editor can "e used to replace old ersion of su"routine "y new su"routinewithout affecting the original ersion of all the other su"routine

iii %inage editor can also "e used to "uild pacage of su"routines or other control sectionsthat are generally used together This can "e useful when dealing with su"routine li"rariesthat support high-leel programming language

20 W,#'! '! ++$'+7! )" &$+(# /#$H#$7 M+&=$! -2005

• The dynamic lining allows seeral e'ecuting programs to share one copy of su"routine

or li"rary

• It has the a"ility to load the routine only when they are needed• The dynamic lining aoids the loading of entire li"rary for each e'ecution

• In an o"Ject oriented system1 dynamic lining is often used for reference of software

o"Ject

21 W+' #% (!+$' >& %'+'# !!='+>/! +$ &$+(# !!='+>/!;

In static e'ecuta"le1 all e'ternal sym"ols are "ound and ready to run In dynamic e'ecuta"lessome sym"ols are "ound at run time

22 W+' #% %+,! +$ .,#+'! +'+;The data diided among processing element is called shared data If the data is not shared among processing elements then it is called priate data

23 W,#'! '! +>%)/='! /)+!, +/7),#'(

!eginead 8eader recordEerify program name and lengthead first te't recordKhile record type UB G&G do!egin

Moed o"Ject code to specified location in memoryead ne't o"Ject program record&nd9ump to address specified in &nd record

UNIT IV MACRO PROCESSORS

 

- 12 -

Page 13: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 13/29

Page 14: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 14/29

9 W+' #% '! =%! )" (+,) '#(! +,#+>/!;

Macro time aria"le can "e used to store woring alues during the macro e'pansion #nysym"ol that "egins with the character : and then is not a macro instruction parameter is assumedto "e a macro time aria"le

10 W+' +,! '! %'+'!(!$'% =%! "), )$#'#)$+/ (+,) !.+$%#)$;

IF-&%S&-&.DIF statement

K8I%&-&.DK statement

11 W+' #% (!+$' >& .)%#'#)$+/ .+,+(!'!,%;

If the parameters and arguments were associated with each other according to their positions inthe macro prototype and the macro inocation statement1 then these parameters in macrodefinitions are called as positional parameters

12 C)$%#!, '! (+,) !"#$#'#)$

@D!"#$! DISPLAYEXPR P,#$'"JEXPR $EXPR

&'pand the macro instruction DIS$%#Q (#.S)$rintf (2&$ B VdWn31 #.S)

13 ?)* '! (+,) #% .,)!%%! =%#$7 '*) .+%%!%;

$ass0; processing of definitions$ass 5; actual-macro e'pansion

14 6#! '! ++$'+7! )" /#$! >& /#$! .,)!%%),%

• It aoids the e'tra pass oer the source program during assem"ling

• It may use some of the utility that can "e used "y language translators so that can "e

loaded once

1 W+' #% (!+$' >& /#$! >& /#$! .,)!%%),;

This macro processor reads the source program statements1 process the statements and then theoutput lines are passed to the language translators as they are generated1 instead of "eing writtenin an e'panded file

1< 6#! '! ++$'+7!% )" 7!$!,+/-.=,.)%! (+,) .,)!%%),%

• The programmer does not need to learn a"out a macro facility for each compiler

• Oerall saing in software deelopment cost and maintenance cost

15 W+' #% (!+$' >& 7!$!,+/-.=,.)%! (+,) .,)!%%),%;The macro processors that are not dependent on any particular programming language1 "ut can "e used with a ariety of different languages are nown as general purpose macro processors&g; The &%&.# macro processor

18 W+' +,! '! #(.),'+$' "+'),% )$%#!,! *#/! !%#7$#$7 7!$!,+/ .=,.)%! (+,)

.,)!%%),%;

• Comments

- 14 -

Page 15: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 15/29

Page 16: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 16/29

4 %ocator deice

4 W+' #% '! "=$'#)$ .!,"),(! #$ !#'#$7 .+%!;

In the actual editing phase1 the target document is created or altered with a set of operations suchas insert1 delete1 replace1 moe and copy

D!"#$! L)+'), !#!;

%ocator deices are two-dimensional analog-to-digital conerters that position a cursor sym"ol

on the screen "y o"sering the userGs moement of the deice The most common such deicesfor editing applications are the mouse and the data ta"let

< W+' #% '! "=$'#)$ .!,"),(! #$ )#! #$.=' !#!;

Eoice-input deices1 which translate spoen words to their te'tual e,uialents1 may proe to "ethe te't input deices of the future Eoice recogniRers are currently aaila"le for command inputon some systems

5 W+' +,! +//! ')H!$%;

The le'ical analyRer tracs the source program one character at a time "y maing the source program into se,uence of atomic units is called toens

8 N+(! %)(! )" '&.#+/ ')H!$%

Identifiers1 eywords1 constants1 operators and punctuation sym"ols such as commas and parentheses are typical toens

9 M!$'#)$ '! (+#$ #%++$'+7! )" #$'!,.,!'!,

The main disadantage of interpreter is that the e'ecution time of interpreted program is slower than that of a corresponding compiled o"Ject program

10 W+' #% (!+$' >& /!!(!;The character that forms a toen is said to "e a le'eme

11 W+' #% (!+$' >& )! ).'#(#+'#)$;

The code optimiRation is designed to improe the intermediate code1 which helps the o"Ject program to run faster and taes less space

12 W+' #% !,,), +$/!,;

The error handler is used to chec if there is an error in the program If any error1 it should warnthe programmer "y instructions to proceed from phase to phase

13 ?)* '! (+..#$7 )" #!* >=""!, ') + *#$)* #% )$!; M+&=$! -2005The mapping of iew "uffer to a window is done with two components They are

• Eiewing component formulates as ideal iew

• Display component maps to the physical output deice

14 N+(! %)(! )" '!' !#'),%

• %ine editors

• Stream editors

- 16 -

Page 17: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 17/29

• Screen editors

• Kord processors

• Structure editors

1 W+' "), !>=7 ()$#'),% +,! =%!;

De"ug monitors are used in o"taining information for localiRation of errors

1< M!$'#)$ '! "!+'=,!% )" *), .,)!%%),%

• Moing te't from one place to another• Merging of te't

• Searching

• Kord replacement

15 W+' +,! '! .+%!% #$ .!,"),(#$7 !#'#$7 .,)!%%;

a Traeling phase " Filtering phasec Formatting phased &diting phase

18 D!"#$! ',+!/#$7 .+%!The phase specifies the region of interest Traeling is achieed using operations such as ne'tscreen full1 "ottom1 and find pattern

19 W+' #% !#'#$7 .+%!

In this phase1 the target document is altered with the set of operations such as insert1 delete1replace1 moe and copy

20 W+' #% F#/'!,#$7 .+%!;

The selection of what is to "e iewed and manipulated in gien "y filtering

21 D!"#$! =%!, #$'!,"+!; M+&=$! -200<

+ser interface is one1 which allows the user to communicate with the system in order to performcertain tass +ser interface is generally designed in a computer to mae it easier to use

22 D!"#$! #$.=' !#!;

Input deice is an electromechanical deice1 which accepts data from the outside world andtranslates them into a form1 which the computer can interpret

23 D!"#$! )='.=' !#!%

Output deices are used "y the user to iew the elements "eing edited and the results of the

editing operations

24 W+' #% '! .=,.)%! )" V)#! I$.=' D!#!; N)D! -2005

Eoice input deice translate orally spoen sentences into their te't e,uialents

2 W+' +,! +,#)=% "=$'#)$% )" + !>=77!,; M+&=$! -200< N)D! -2008

• !rea points

- 17 -

Page 18: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 18/29

• *aits

• Tracing

• Trace "ac 

2< W+' +,! '! (!')% #$ I$'!,+'#)$ /+$7=+7! )" + '!' !#'),;

a Typing -oriented or te't command oriented method " Function ey interfacesc menu oriented method

25 D!"#$! #$'!,+'#! !>=77#$7 %&%'!(%

#n interactie de"ugging system proides programmers with facilities that aid in the testing andde"ugging of programs0 De"ugging functions and capa"ilities5 elationship with other parts of the system4 +ser interface criteria

28 W+' ) &)= (!+$ >& ',+#$7; N)D! -200<

Tracing is a function proided "y a de"ugging system that can "e used to trac the flow of e'ecution logic and modification The control flow can "e traced at different leels of details1 procedure1 "ranch1 indiidual instructions and so on

29 D!"#$! !#'), %',='=,!

The command language processor accepts input from the users input deices and analyRes thetoens and syntactic structure of the commands

30 6#! '! )(.)$!$'% )" !#'), %',='=,!

There are @ components of editor structurea &diting component " Traeling component

c Eiewing componentd Display component

31 W+' +,! '! >+%# '&.!% )" )(.='#$7 !$#,)$(!$'% =%! #$ !#'),% "=$'#)$%;

&ditorGs function in three "asic types of computing enironmentsi Time sharing

ii Stand-aloneiii Distri"uted

 

PART -B

 UNIT 1

1 E./+#$ '! +,#'!'=,! )" SIC (+#$!

Draw neatly the !loc diagram&'plain each "loc separately

2 E./+#$ '! +,#'!'=,! )" SICXE (+#$!

Draw neatly the !loc diagram

- 18 -

Page 19: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 19/29

&'plain each "loc separately

3 M!$'#)$ '! #""!,!$!% >!'*!!$ SIC +$ SICXE

UNIT-II

1 E./+#$ #$ !'+#/ +>)=' >+%# +%%!(>/!, "=$'#)$%

 Y # simple SIC assem"ler  Y #ssem"ler #lgorithm Y Data structures

2 E./+#$ +>)=' '! (+#$!-D!.!$!$' A%%!(>/!, "!+'=,!%

 Y Instruction formats

 Y #ddressing modes Y $rogram elocation

3 D#%=%% #$ !'+#/ +>)=' '! (+#$!-I$!.!$!$' A%%!(>/!, "!+'=,!%

 Y %iterals Y Sym"ol-Defining Statements Y &'pressions Y $rogram "locs Y Control sections and $rogram %ining

4 E./+#$ #$ !'+#/ +>)=' '! +%%!(>/!, D!%#7$ ).'#)$%

 Y One-pass #ssem"ler  Y Multi-pass #ssem"ler 

D#%=%% #$ !'+#/ +>)=' MASM A%%!(>/!,

 Y Classes Y Data Segments Y .ear Jump Y Far Jump pro"lem

- 19 -

Page 20: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 20/29

 Y Segments Y M#SM directies

UNIT-III

1 E./+#$ #$ !'+#/ +>)=' >+%# /)+!, "=$'#)$%

 Y Design of an #"solute %oader  Y # simple !ootstrap loader 

2 E./+#$ +>)=' M+#$!-D!.!$!$' L)+!, F!+'=,!%

 Y elocation Y $rogram %ining Y #lgorithm Y Data structures

3 D#%=%% #$ !'+#/ +>)=' M+#$!-#$!.!$!$' L)+!, "!+'=,!%

 Y #utomatic %i"rary Search Y %oader Options

4 E./+#$ +>)=' '! L)+!, D!%#7$ O.'#)$% Y %inage &ditor  Y Dynamic lining Y !ootstrap loaders

E./+#$ #$ !'+#/ +>)=' MS-DOS L#$H!,

 Y MS-DOS #ssem"lers and Compilers Y MS-DOS %I.  Y MS-DOS O"Ject modules

UNIT-IV

1 E./#+$ #$ !'+#/ +>)=' '! >+%# M+,) P,)!%%), "=$'#)$%

2

 Y Macro Definition Y Macro e'pansion Y #lgorithm Y Data Structures

2 D#%=%% #$ !'+#/ +>)=' '! M+#$!-#$!.!$!$' (+,) .,)!%%), "!+'=,!%

 Y Concatenation of Macro parameters Y *eneration of uni,ue la"els

 Y conditional macro &'pansion Y eyword macro parameters

3E./+#$ +>)=' M+,) P,)!%%), D!%#7$ ).'#)$%

 Y ecursie Macro &'pansion Y *eneral purpose Macro $rocesors

- 20 -

Page 21: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 21/29

 Y Macroprocessing within %anguage Translators

4 E./+#$ #$ !'+#/ +>)=' MASM M+,) P,)!%%),

 Y Conditional assem"ly statements Y M#SM macro Y Conditional statements

E./+#$ #$ !'+#/ +>)=' ANSI C (+,) L+$7=+7! Y Macro definitions with parenthesis Y Macro e'pansion with parenthesis Y Conditional compilation statements Y De"ugging statements

UNIT-V

1 E./+#$ #$ !'+#/ +>)=' '! ")//)*#$7

i) &diting processii) +ser Interface

&diting process;Tass Y Select the part of the target document Y Determine how to format Y Specify and e'ecute operations Y +pdate+I-Conceptual model Y Operations on num"ered se,uence Y Manipulate portions of the plane Y Concerned i/p deices

2 E./+#$ +>)=' '! !#'), %',='=,!Diagram&'planation

3 D#%=%% #$ !'+#/ +>)=' !>=77#$7 "=$'#)$% +$ +.+>#/#'#!%

Different leels Y $rocedure Y !ranch Y Indiidual Instructions Y &'amples

4 E./+#$ #$ !'+#/ +>)=' '! ")//)*#$7i)elationships with other parts of the systemii)+ser Interface criteriaie,uirement-#lways "e aaila"le Y De"ugging Y #pplication deelopment time Y $roduction enironment Y Coordinate with e'isting and future language compilers and interpreters

- 21 -

Page 22: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 22/29

ii simple organiRation Y full screen displays and windowing systems Y command language should "e clear  Y On-line help facility

E./+#$ +>)=' +,#)=% %)"'*+,! '))/%

 Y Te't editors Y De"ugging system

G=!%'#)$ B+$H 

U$#' Q I

PART Q A

0 Define System Software5 Define data Format4 Khat is instruction setZ@ Khat is direct addressing mode and indirect addressing modeZ> Differentiate "etween #ssem"ler and Interpreter7 Khat is little &ndian and !ig &ndian "yte orderingZ< Khat is the purpose of register in a systemZ

- 22 -

Page 23: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 23/29

= %ist the types of registers used in a system? Khat is the siRe of the memory in a SIC and SIC/& machinesZ06 Khat are the instruction formats of SIC/SCZ00 Khat are the types of addressing modes in SIC and SIC/& machinesZ05 8ow input and Output operations are performed in $ower$C architectureZ04 Khat the types of I/O instructions aaila"le are in SIC machinesZ0@ Khat is Format4 and Format @ instructions in SIC/& machineZ0> Define the "ase relatie and program counter relatie addressing mode of SIC/&

machine07 %ist the units of Ean .ewman architecture0< Illustrate how input and output operations are performed in SIC0= *ie the instruction format of SIC/& machine0? Following is a memory configuration

#ddress alue egister  0 > >> <7 >< <Khat is the result of the following statementZ

56 Krite down the name and use of and % registers in SIC machine architecture50 Khat is #rithmetic and floating unit point unit in architectureZ55 Define Te't editor54 &'plain how memory is organiRed in SIC machine architecture5@ Khat are the registers in SIC machineZ5> Khat is the data format adapted in SIC machineZ57 Khat are the additional registers used "y SIC/& machine and what are their usZ5< Khat is the format of floating point data used in SIC/& machine5= Khat are the instructions aaila"le in SIC machineZ5? Khat are the arious load and store instructions aaila"le in SIC machineZ46 Khat are the arious integer arithmetic instructions aaila"le in SIC machineZ

40 Khat is the use of COM$ instructionZ45 Khat are the su"routine linage instructions aaila"le in SICZ44 Khat are the arious load and store instructions aaila"le in SIC/& machineZ4@ Khat are the arious floating point arithmetic instructions aaila"le in SIC /& machineZ4> Khat are the arious register-to-register arithmetic instructions aaila"le in SIC /&

machineZ47 8ow is a communication with OS is esta"lished in SIC/& while e'ecuting a programZ4< Krite a sample program segment to indicate the arithmetic operation for the SIC

machine4= Define simple addressing4? Khat is Superisor callZ

@6 Khat is Condition codeZ

P+,' Q B

0 %ist the salient features of hypothetical machine5 Discuss a"out SIC architecture4 Discuss a"out SIC/& architecture

- 23 -

Page 24: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 24/29

Page 25: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 25/29

Page 26: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 26/29

Page 27: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 27/29

Page 28: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 28/29

4 Khat are the four tass related to document editingZ@ Khat is meant "y filteringZ> Define formatting the document7 Khat is editingZ< Khat are the elements on which editing is doneZ= Khat does the conceptual model of the editing system representZ? Khat are the two fundamental types of editorsZ06 Khat is a data ta"letZ

00 Khat is the oldest editor interface usedZ05 8ow is the typing of commands made easy with editorsZ04 Khat are the semantic routines that encompass the editor structureZ0@ 8ow is the editing area selected in an editorZ0> Can the current editing pointer alteredZ07 Khat is the function of the traeling componentZ0< Khat is the name of the filter inoed when the edit command is issuedZ0= Khat is the purpose of the editing filterZ0? 8ow is the starting point of the editing area selected for iewingZ56 Draw the relationship "etween the iewing and editing "uffer50 8ow doest the editor wor with a non intelligent terminalZ

55 8ow does the editor wor with an intelligent worstationZ54 Khat is the disadantage of editing in a non-intelligent terminalZ5@ Khat are the facilities proided "y an interactie de"ugging systemZ5> Khat are the re,uirements of an interactie de"ugging systemZ57 Khat is meant "y e'ecution se,uencingZ5< Khat is a "rea pointZ5= Khat is the status of the program e'ecution once "rea point is reachedZ5? Khat is meant "y tracingZ46 Khat is meant "y trace "acZ40 .ame some optimiRation followed in an editor/45 8ow does the code rearrangement affect the de"uggerZ

44 Khat is the important re,uirement of an interactie de"uggerZ4@ Khat are the other parts of the system to which the de"ugger should "e related withZ4> Khat are the desired features of the user interfaceZ47 Khat is the re,uired feature of command formats in a user interfaceZ4< Khat is the desired feature of the command language in a user interfaceZ4= 8ow is the assistance proided for user interfaceZ4? Khat is the needed feature of menus in a user interfaceZ@6 Khat are tass of document editing processZ@0 Khat is the function of command language processorZ@5 Khat is a te't or string deiceZ@4 Khat are locator deicesZ

@@ Khat are oice-input deicesZ@> Khat is an interactie de"ugging system or de"ugging systemZ@7 Khat is e'ecution se,uencingZ@< Khat is tracingZ@= Khat is trace "acZ

- 28 -

Page 29: Cs2304 Ss 2marks

8/11/2019 Cs2304 Ss 2marks

http://slidepdf.com/reader/full/cs2304-ss-2marks 29/29