Sei sulla pagina 1di 10

KCG College of Technology,Chennai-96

Computer Science and Engineering


CS 120 S!STE" S#$T%&'E ((( Sem CSE
QUESTION BANK - UNIT-I
CS1203 SYSTEM SOFTWARE 3 0 0 100
AIM
To have an understanding of foundations of design of assemblers, loaders, linkers, and macro processors.
OBJECTIVES
To understand the relationship between system software and machine architecture.
To know the design and implementation of assemblers
To know the design and implementation of linkers and loaders.
To have an understanding of macroprocessors.
To have an understanding of system software tools.
UNIT I INTRODUCTION 8
System software and machine architecture The Simplified Instructional Computer (SIC ! "achine architecture !
#ata and instruction formats ! addressing modes ! instruction sets ! I$% and programming.
UNIT II ASSEMBLERS 10
&asic assembler functions - ' simple SIC assembler 'ssembler algorithm and data structures ! "achine
dependent assembler features - Instruction formats and addressing modes (rogram relocation ! "achine
independent assembler features ! )iterals Symbol!defining statements *+pressions ! %ne pass assemblers and
"ulti pass assemblers ! Implementation e+ample ! "'S" assembler.
UNIT III LOADERS AND LINKERS 9
&asic loader functions - #esign of an 'bsolute )oader ' Simple &ootstrap )oader ! "achine dependent loader
features ! ,elocation (rogram )inking 'lgorithm and #ata Structures for )inking )oader ! "achine!independent
loader features - 'utomatic )ibrary Search )oader %ptions ! )oader design options ! )inkage *ditors #ynamic
)inking &ootstrap )oaders ! Implementation e+ample ! "S#%S linker.
UNIT IV MACRO PROCESSORS 9
&asic macro processor functions ! "acro #efinition and *+pansion "acro (rocessor 'lgorithm and data
structures ! "achine!independent macro processor features ! Concatenation of "acro (arameters -eneration of
.ni/ue )abels Conditional "acro *+pansion 0eyword "acro (arameters!"acro within "acro!Implementation
e+ample ! "'S" "acro (rocessor '1SI C "acro language.
UNIT V SYSTEM SOFTWARE TOOLS 9
Te+t editors ! %verview of the *diting (rocess ! .ser Interface *ditor Structure. ! Interactive debugging systems -
#ebugging functions and capabilities ,elationship with other parts of the system .ser!Interface Criteria.
TOTAL : 4
TE!T BOOK
2. )eland ). &eck, 3System Software 'n Introduction to Systems (rogramming4, 5
rd
*dition, (earson
*ducation 'sia, 6777.
REFERENCES
2. #. ". #hamdhere, 3Systems (rogramming and %perating Systems4, Second ,evised *dition, Tata "c-raw!
8ill, 2999.
6. :ohn :. #onovan 3Systems (rogramming4, Tata "c-raw!8ill *dition, 29;6.
1) %hat i* *y*tem *oft+are,
System software consists of variety of programs that supports the operations of a computer This
ma!es it possi"#e for the user to focus on an app#ication or other pro"#em to "e so#ve$ %without
nee$ing to !now the $etai#s of how the machine wor!s interna##y
E&amp#es of system software are te&t-e$itors%compi#ers%#oa$ers or #in!ers%$e"uggers%assem"#ers%an$
operating systems
2) -o+ *y*tem *oft+are i* different from Soft+are,
The most important characteristic in which most system software $iffer from app#ication software is
machine $epen$ency
An app#ication program is primari#y concerne$ with the so#ution to some pro"#em%using computer as a
too# The focus is on the app#ication%not on the app#ication system
System programs% on the other han$%are inten$e$ to support the operation an$ use of the computer
itse#f%rather than any particu#ar app#ication They are usua##y re#ate$ to the architecture of the machine
on which they are to run
) E.plain the machine dependency of *y*tem *oft+are +ith e.ample*,
An assem"#er is a system software It trans#ates mnemonic instructions into machine co$e' the
instruction formats%a$$ressing mo$es %etc%are of $irect concern in assem"#er $esign
Simi#ar#y% compi#ers must generate machine #anguage co$e%ta!ing into account such har$ware
characteristics as the num"er an$ the types of registers an$ machine instructions avai#a"#e
Operating systems are $irect#y concerne$ with the management of near#y a## of the resources of a
computer system
E&amp#e(
)hen you too! the first programming course
Te.t editor - create an$ mo$ify the program
Compiler- trans#ate programs into machine #anguage
/oader or lin0er - #oa$ machine #anguage program into memory
an$ prepare$ for e&ecution
1e2ugger - he#p $etect errors in the program
)hen you wrote programs in assem"#er #anguage
&**em2ler - trans#ate assem"#y program into machine #anguage
"acro proce**or - trans#ate macros instructions into its $efinition
)hen you contro# a## of these processes
By interacting with the #S
3) %hat are the important machine *tructure* u*ed in the de*ign of *y*tem *oft+are,
*emory structure
+egisters
,ata formats
Instruction formats
A$$ressing mo$es
Instruction set
4) %hat i* S(C machine,
S(C refers to Simp#ifie$ Instruction -omputer which is a hypothetica# computer that has "een
$esigne$ to inc#u$e the har$ware features most often foun$ on rea# machines%whi#e avoi$ing unusua#
an$ irre#evant comp#e&ities This a##ows to c#ear#y separate the centra# concepts of a system software
from the imp#ementation $etai#s associate$ with a particu#ar machine
6) E.plain S(C "achine architecture5
S(C "achine &rchitecture
"emory
o ./0 "ytes in the computer memory
o 1 consecutive "ytes form a wor$
o 2-"it "ytes
'egi*ter*
1ata $ormat*
o Integers are store$ as .3-"it "inary num"ers' .4s comp#ement representation is use$ for
negative va#ues
o No f#oating-point har$ware
(n*truction $ormat*
&ddre**ing "ode*
(n*truction Set
o integer arithmetic operation*( A,,% SUB% *U5% ,I6% etc
A## arithmetic operations invo#ve register A an$ a wor$ in memory% with the resu#t
"eing #eft in the register
o compari*on( -O*7
-O*7 compares the va#ue in register A with a wor$ in memory% this instruction
sets a con$ition co$e -- to in$icate the resu#t
o conditional 6ump in*truction*( 85T% 8EQ% 89T
these instructions test the setting of -- an$ :ump accor$ing#y
o *u2routine lin0age( 8SUB% +SUB
8SUB :umps to the su"routine% p#acing the return a$$ress in register 5
+SUB returns "y :umping to the a$$ress containe$ in register 5
opco$e ;2< a$$ress ;/0< &
*nemonic Num"er Specia# use
A
0
Accumu#ator' use$ for arithmetic operations
=
1
In$e& register' use$ for a$$ressing
5
2
5in!age register' 8SUB
7-
8
7rogram counter
S)
9
Status wor$% inc#u$ing --
"ode (ndication Target addre** calculation
,irect &>? TA>a$$ress
In$e&e$ &>/ TA>a$$ress@;=<
(nput and #utput
o Input an$ output are performe$ "y transferring / "yte at a time to or from the rightmost 2
"its of register A
o The Test ,evice ;T,< instruction tests whether the a$$resse$ $evice is rea$y to sen$ or
receive a "yte of $ata
o +ea$ ,ata ;+,<
o )rite ,ata ;),<
7) %hat are the content* of *tatu* +ord regi*ter,
8)
9)
10)
11) E.plain S(C9:E architecture
S(C9:E "achine &rchitecture
"emory
"ore 'egi*ter*
1ata $ormat*
o A#oating-point $ata type( fracB.;e&p-/?.3<
frac( ?C/
e&p( ?C.?3D
(n*truction $ormat*
*nemonic Num"er Specia# use
B
3
Base register' use$ for a$$ressing
S
4
9enera# wor!ing register
T
5
9enera# wor!ing register
A
6
A#oating-point acumu#ator ;32"its<
Aormat /
op;2<
Aormat .
op;2< r/;3< r.;3<
(n*truction Set
o new registers( 5,B% STB% etc
o f#oating-point arithmetic( A,,A% SUBA% *U5A% ,I6A
o register move( +*O
o register-register arithmetic( A,,+% SUB+% *U5+% ,I6+
o supervisor ca##( S6-
generates an interrupt for OS
(nput9#utput
SIO% TIO% EIO( start% test% ha#t the operation of IFO $evice
12) E.plain S(C9:E (n*truction format*5
Instruction Aormats
5arger memory means an a$$ress cannot fit into a /0-"it fie#$
E&ten$ a$$ressing capacity
Use some form of relative addressing -G instruction
format 1
E&ten$ the a$$ress fie#$ to 20 bits -G instruction format 3
A$$itiona# instructions $o not reference memory
Instruction format / H .
1) E.plain S(C9:E addre**ing mode*5
-o+ to compute T&,
&ddre**ing mode*;
-o+ the target addre** i* u*ed,
Aormat 1 e>?
op;I< n I & " p e $isp;/.<
Aormat 3 e>/
op;I< n I & " p e a$$ress ;.?<
"ode (ndication Target addre** calculation operan$
Base re#ative ">/% p>? TA>;B<@$isp ;?J>$ispJ>3?K0< ;TA<
7--re#ative ">?% p>/ TA>;7-<@$isp ;-.?32J>$ispJ>.?3D< ;TA<
,irect ">?% p>? TA>$isp ;format 1< or a$$ress ;format 3< ;TA<
In$e&e$ &>/ TA>TA@;=< ;TA<
"ode (ndication operand <alue
imme$iate a$$ressing i>/% n>? TA
in$irect a$$ressing i>?% n>/ ;;TA<<
simp#e a$$ressing i>?% n>? SI- instruction ;a## en$ with ??<
i>/% n>/ SI-F=E instruction
&ddre**ing mode*
=a*e relati<e >n?1, i?1, 2?1, p?0)
@rogram-counter relati<e >n?1, i?1, 2?0, p?1)
1irect >n?1, i?1, 2?0, p?0)
(mmediate >n?0, i?1, .?0)
(ndirect >n?1, i?0, .?0)
(nde.ing >2oth n A i ? 0 or 1, .?1)
E.tended >e?1 for format 3, e?0 for format )
13) %hat i* direct addre**ing,
14) %hat i* inde.ed addre**ing,
16) %hat i* immediate addre**ing,
17) %hat i* indirect addre**ing,
18) %hat i* *imple addre**ing mode,
19) %hat are the in*truction *et for S(C9:E,
(n*truction Set
a new registers( 5,B% STB% etc
" f#oating-point arithmetic( A,,A% SUBA% *U5A% ,I6A
c register move( +*O
$ register-register arithmetic( A,,+% SUB+% *U5+% ,I6+
e supervisor ca##( S6-
- generates an interrupt for OS ;-hap I<
(nput9#utput
f SIO% TIO% EIO( start% test% ha#t the operation of IFO $evice
20) Gi<e programming e.ample* of S(C5
SI- 7rogramming E&amp#es
-- ,ata movement
A57EA +ES) /
AI6E )O+, 0
-EA+L BMTE -4L4
-/ +ESB/


5,A AI6E
STA A57EA
5,-E -EA+L
ST-E -/
>a)
No memory-memory move instruction
1-"yte wor$(
o 5,A% STA% 5,5% ST5% 5,=% ST=
/-"yte(
o 5,-E% ST-E
Storage $efinition
o )O+,% +ES)
o BMTE% +ESB
A## arithmetic operations are performe$ using register A% with the resu#t "eing #eft in register A
&rithmetic operation
/ooping and inde.ing
21) Gi<e an e.ample for S(C (# programming5
22) E.plain @entium @ro &rchitecture5
@entium @ro &rchitecture
"emory
physical level( a$$ress are "yte a$$resses
wor$ ;. "ytes<% $ou"#ewor$ ;or $wor$< ;3 "ytes<
Some operations are more efficient when operan$s are a#igne$
logical level( programmers usua##y view the &2I memory
as a collection of segments
An a$$ress consists of segments an$ offsets
In some cases% a segment can a#so "e $ivi$e$ into pages
The segmentFoffset a$$ress specifie$ "y the programmer is
trans#ate$ into a physica# a$$ress "y the &2I MMU (Memory
Management Unit)
'egi*ter*
Eight 1.-"it genera#-purpose registers(
EA=% EB=% E-=% E,=( $ata manipu#ation
ESI% E,I% EB7% ES7( a$$ress
Specia#-purpose registers(
Two 1.-"it registers(
EI7( pointer to the ne&t instruction
A5A9S( status wor$
Si& /I-"it segment registers(
-S( co$e segment register
SS( stac! segment register
,S% ES% AS% an$ 9S( $ata segments
A#oating-point unit ;A7U<
A## a"ove registers are avai#a"#e to app#ication programmers
Other registers use$ on#y "y system programs such as OS

Potrebbero piacerti anche