System Software Unit 2
System Software Unit 2
System Software Unit 2
Department: CSE
Date
Executable
Code
Loader
Machine dependency
Different machine instruction formats and codes
Forward
reference
STCH BUFFER,X
---- ---- X--- ---- ---- ----
0101 0100 1001 0000 0011 1001549039
Source
program
Intermediate Object
Pass 1 Pass 2
file codes
PC-relative
10 0000 FIRST STL RETADR 17202D
(14)16 1 1 0 0 1 0 (02D) 16
displacement= RETADR - PC = 30-3 = 2D
40 0017 J CLOOP 3F2FEC
Base-relative
base register is under the control of the programmer
12 LDB #LENGTH
13 BASE LENGTH
160 104E STCH BUFFER, X 57C003
TA=RETADR=0030
TA=(PC)+disp=002D+0003
RSUB
COUNT RESW 1
TABLE RESW 2000
TABLE RESW 2000
TOTAL RESW 1
END FIRST
SYSTEM SOFTWARE - UNIT II 58
Question Bank
3) Write the fundamental functions of assembler.
4) Generate the object code for each statement & write the object
program for the following SIC/XE program.
WRREC START 105D Given details of opcode
for instruction
CLEAR X CLEAR=B4
LDT LENGTH T=5
WLOOP TD OUTPUT TIX=2C
JEQ WLOOP JLT=38
LDCH BUFFER, X STA=0C
WD OUTPUT RSUB=4C
TI XR T LDT=74
JLT WLOOP TD=E0
RSUB JEQ=30
OUTPUT BYTE X ‘05’ TI XR=B8
BUFFER RESB 400 LDCH=50
LENGTH RESB 2 WD=DC
END WRREC X=1
SYSTEM SOFTWARE - UNIT II 59
Question Bank
5) What is the need of pass 2 assembler? Reason out with simple
example.
6) Define assembler directive. Explain the different types of directives
used in SIC machine.
7) With brief explanation write the algorithm of PASS-1 of two pass
assembler.
8)Briefly explain each & every record format of an object program for
SIC/XE machine.
9) With an example explain OPTAB & SYMTAB.
10) What is program relocation? Explain the problems associated with it
& their solutions.
11)With brief explanation write the algorithm of PASS-2 of two pass
assembler.
TOTAL RESW 1
END FIRST