System Storage and Compilers
System Storage and Compilers
1. Bring out the difference between system software and application software. Given examples
for each. 6M
2. Discuss the architecture of a SIC machine. 10M
3. Discuss the architecture of a SIC/XE machine. 10M
4. With reference to SIC and SIC/XE machine architecture, compare memory, Registers, data
formats, instruction formats and addressing modes. 10M
5. With reference to SIC/XE machine architecture, explain instruction formats and addressing
modes, clearly indicating the settings of different flag bits. 10M
6. What are assembler directives? Explain. Write the fundamental functions of assembler. 6M
7. List the functions of the two passes of assembler. 6M
8. With an illustrative example, explain the need for a two pass assembler. Explain the different
data structures used in 2-pass assembler. Mention their functions clearly during pass1 and
pass2. 10M
9. With brief explanation write the algorithm of Pass-1 of two pass assembler. 8M
10. With brief explanation write the algorithm of Pass-2 of two pass assembler. 8M
11. List all the Machine dependent and Independent assembler features. 6M
12. What is program relocation? Why is it required? Explain the problems associated with it &
their solutions. 10M OR
What is a relocatable program? Explain the concept of program relocation with an example
program segment. Specify how the relocation information is passed on to the loader with
necessary example. 10M
13. Briefly explain each & every record format of an object program for SIC/XE machine. 5M
14. What is a literal? With example explain how are literals handled by an assembler in the
presence or absence of LTORG? 5M
15. Differentiate between literal and immediate operand with an example. 4M
16. Explain the following machine independent features of an assembler: i) Symbol-Defining
statements ii) Expressions 8M
17. Define program block. How are they handled by an assembler? Explain with an example. 10M
18. Define control section. Explain how linking is performed between control sections. 10M
19. Give the formats for DEFINE and REFER records? Also, give the format of the revised
Modification record. 6M
Problems:
Give the target address generated for the following instruction, if:
(B)=006000, (PC) = 003000, (X) = 000090
i) 010030 ii) 0310C303 iii) 002600 iv) 03C300 8M
Generate the complete object program for the following SIC/XE assembly language
programs.
1.
SUM START 0
FIRST CLEAR X
LDA #0
+LDB #TOTAL
BASE TOTAL
LOOP ADD TABLE,X
TIX COUNT
JLT LOOP
STA TOTAL
COUNT RESW 1
TABLE RESW 2000
TOTAL RESW 1
END FIRST
2. SUM START 0
FIRST LDX #0
LDA #0
+LDB #TABLE2
BASE TABLE2
LOOP ADD TABLE, X
ADD TABLE2, X
TIX COUNT
JLT LOOP
+STA TOTAL
RSUB
COUNT RESW 1
TABLE RESW 2000
TABLE2 RESW 2000
TOTAL RESW 1
END FIRST
3. Use the opcodes given below for the mnemonics in the source program:
CLEAR – B4 LDT-74 LDCH-50
STCH-54 TIXR-B8 JLT-38
COPY START 0
CLEAR X
LDT #11
MOVECH LDCH STR1, X
STCH STR2, X
TIXR T
JLT MOVECH
STR1 BYTE X’5445535440535452494E47’
STR2 RESB 11
END COPY
4. Use the opcodes given below for the mnemonics in the source program:
CLEAR-B4 LDT-74 LDCH-50
STCH-54 TIXR-B8 JLT-38
COPY START 0
FIRST CLEAR X
LDT #3
MOVECH LDCH STR1, X
STCH STR2, X
TIXR T
JLT MOVECH
STR1 BYTE C’EOF’
STR2 RESB 3
END FIRST
Extra Questions:
Write an algorithm for One-Pass Assembler. Explain how forward reference problem is handled
in One-Pass assembler. 10M
Outline the logic flow for a simple one-pass load-and-go assembler.
With suitable example, explain multi-pass assembler.
Mention the basic functions of a macro processor. Taking a suitable example, discuss the usage of
various data structures in handling the macro definitions and macro expansions.
Write an algorithm for macro definition and macro expansion.
What is a loader? What are its advantages and disadvantages? Explain the bootstrap loader with
algorithm or source program.
Give and explain the algorithm of an absolute loader
Explain in detail, SIC/XE relocation loader algorithm with suitable example.
What is a relocating loader? Explain the relocation bit technique for specifying relocation as a part
of object program.
Explain the various data structures used for linking loader.
Discuss the detailed design of a linking and relocating loader with an example. Hence explain how
program linking and relocation is performed by a linking loader when the subprograms use
external reference.
Write pass 1 and pass 2 algorithm of linking loader.
What is dynamic binding? Explain the process of loading and calling of subroutine using dynamic
linking loader.
Differentiate the processing of an object program by linking loader and linkage editor with
necessary diagrams.
List any 5 loader option commands.
Show the representation of loading this object program into memory (Refer Slide 123 of ppt)
Medle
se os3ieocme stokesd e
Saos eanRGio
postba
oupu eo ase & houw oute,s o
Sumbor ake Wh aCome lex
Cxpoñn e nee Du e paaSes ia O CoMler-
(D e comptex ceMshodi ocS
W t Sepexote Lexiea Aaasis & fosi
Awsi Smth Sest mpreau Conlex dpeie
hancia Coomkec bstabtk
lao ensbhos
exostpe
67
++
ercple) 235
hat j sht tdua paser List tle actlono S
shik vecuco Pas - t an
exanple, ekpain le
tack
inolemerkatlon JhE Fedue crses 235
Exploin
h On xunple
cletnil the Stubuc o 24CPg,
Lith
exolc, pb dyernce bet")
LEX and Hand- ssitkn Lexe
Lht CA
Kea eypin) Eypla jn
lyeent meta chora tea ed
with xaple
in
LEXprog nn
Eplain Juntkis
Jylo () olhing
y3 in ()
)yparse ()
Eypa in
exayple
SJt /@dutaPari wed in yace ith
Lhet Jac Ctanat Po yatain.
Eplain.
Als shen Cannt ue precedena ule
Chayate-S
Byine S DD So
explain t
Rxplain STT
Guwe
exacles Jor
kindo
cadh.
atbbute o r rornttr uncls
/or
4 hat i Onnotatd
(Pre brre 9 Loite tree
Syntou beej Porse
SOD er a
inmple dusk Cal culot Show U , annotale
Pase rte Ao premism (3+ (S+ C). & 3G
3 S+ n
Givee On SDD Jor a 2ingple desk Calcdatr go omrd
utatle