University Solved Answers Unit 1 SS (System Software Notes)
University Solved Answers Unit 1 SS (System Software Notes)
UNIT I-INTRODUCTION
1. Define system software.
It consists of variety of programs that supports the operation of the computer. This software makes it
possible for the user to focus on the other problems to be solved without needing to know how the machine works
internally. Eg: operating system, assembler, loader.
2. Give some applications of operating system.
to make the computer easier to use
to manage the resources in computer
process management
data and memory management
to provide security to the user.
Operating system acts as an interface between the user and the system
Eg:windows,linux,unix,dos
3. Define compiler and interpreter.
Compiler is a set of program which converts the whole high level language
program to
machine language program. Interpreter is a set of programs which converts high level language program to machine
language program line by line.
4. Define loader.
Loader is a set of program that loads the machine language translated by the translator into the main
memory and makes it ready for execution.
5.What is the need of MAR register.
MAR (memory address register) is used to store the address of the memory from which the data is to be read
or to which the data is to be written.
6. Draw SS instruction format.
It is
bytes data fro the storage location1
storage location2.
PC relative addressing
In this instruction one operand is in accumulator and the second operand is a immediate value the value
5 is directly added with the accumulator content and the result is stored in accumulator.
10. List out any two CISC and RISC machine.
CISC Power PC, Cray T3E
RISC VAX,Pentium Pro architecture
11.Following is a memory configuration:
Address
Value
Register R
1
5
6
5
7
6
5
What is the result of the following statement?
ADD 6(immediate) to R (indirect)
Here 6 is the immediate data and the next value is indirect data.ie the register contains the address of the operand.
Here the address of the operand is 5 and its corresponding value is 7.
6 + [R] = 6+ [5] = 6+ 7 =13
12. Following is a memory configuration:
Address Value
Register R
4
5
6
What is the result of the following statement?
SUB 4(direct) to R (direct) Here one operand is in the address location 4(direct addressing) and the next
operand is in the register(register direct).
The resultant value is 9 6 =3.
13. What is the name of X and L register in SIC machine and also specify its use.
A-accumulator Used for arithmetic operation.ie in the case of arithmetic operations one operand is in
the accumulator,and other operand may be a immediate value,registre operand or memory content.The operation
given in the instruction is performed and the result is stored in the accumulator register. L-linkage register It is
used to store the return address in the case of jump to subroutine (JSUB) instructions.
14. What are the instruction formats used in SIC/XE architecture? Give any one format.
Format 1 (1 byte), Format 2 (2 bytes), Format 3 (3 bytes) & Format 4(4 bytes)
Are the different
instructions used in SIC/XE architecture?
Format 2:
8
OPCODE
4
R1
4
R2
19. How do you calculate the actual address in the case of register indirect with immediate index mode?
Here the target address is calculated using the formula
T.A =(register) + displacement.
20.
Write the sequence of instructions to perform the operation BETA = ALPHA + 1 using SIC
instructions.
LDA
ALPHA
ADD
ONE
STA
BETA
.
.
ALPHA
RESW 1
BETA
RESW 1
ONE
RESW
1
21.Write the sequence of instructions to perform the operation BETA = ALPHA+5
using SIC/XE
instructions.
LDA
ALPHA
ADD
#1
STA
BETA
.
.
ALPHA
RESW
1
BETA
RESW
1
22. Differentiate system software from Application Software.
Based on operation, based on machine dependency
23. How do you calculate the target address in direct and indirect address mode of SIC/XE architecture?
Part B
1. Explain about SIC Architecture
Simplified Instructional Computer (SIC) is a hypothetical computer that includes the hardware features most often
found on real machines. There are two versions of SIC, they are, standard model (SIC), and, extension version
(SIC/XE) (extra equipment or extra expensive).
SIC Machine Architecture
We discuss here the SIC machine architecture with respect to its Memory and Registers, Data Formats, Instruction
Formats, Addressing Modes, Instruction Set, Input and Output
Memory
There are 215 bytes in the computer memory, which is 32,768 bytes, it uses Little Endian format to store the
numbers, 3 consecutive bytes form a word, and each location in memory contains 8-bit bytes.
Registers
There are five registers, each 24 bits in length. Their mnemonic, number and use are given in the following table.
Mnemonic
Number
Use
PC
Program counter
SW
Data Formats
Integers are stored as 24-bit binary numbers , 2s complement representation is used for negative values, characters
are stored using their 8-bit ASCII codes, No floating-point hardware on the standard version of SIC.
Instruction Formats
Opcode(8)
x
Address (15)
All machine instructions on the standard version of SIC have the 24-bit format as shown above
Addressing Modes
Mode
Indication
Direct
x=0
TA = address
Indexed
x=1
TA = address + (x)
There are two addressing modes available, which are as shown in the above table. Parentheses are used to
indicate the contents of a register or a memory location.
Instruction Set
SIC provides, load and store instructions (LDA, LDX, STA, STX, etc.).
Integer arithmetic operations: (ADD, SUB, MUL, DIV, etc.). All arithmetic operations involve register A and a
word in memory, with the result being left in the register.
COMP compares the value in register A with a word in memory, this instruction sets a condition code CC to indicate
the result. There are conditional jump instructions: (JLT, JEQ, JGT), these instructions test the setting of CC and
jump accordingly.
Two instructions are provided for subroutine linkage. JSUB jumps to the subroutine placing the return address in
register L, RSUB returns by jumping to the address contained in register L.
Input and Output
Input and Output are performed by transferring 1 byte at a time to or from the rightmost 8 bits of register A
(accumulator). The Test Device (TD) instruction tests whether the addressed device is ready to send or receive a
byte of data. Read Data (RD), Write Data (WD) are used for reading or writing the data.
Data movement and Storage Definition
LDA, STA, LDL, STL, LDX, STX ( A- Accumulator, L Linkage Register,
X Index Register), all uses 3-byte
word. LDCH, STCH associated with characters uses 1-byte. There are no memory-memory move instructions.
Storage definitions are
WORD - ONE-WORD CONSTANT
RESW - ONE-WORD VARIABLE
BYTE - ONE-BYTE CONSTANT
RESB - ONE-BYTE VARIABLE
2. Explain about architecture of SIC/XE
Memory
Maximum memory available on a SIC/XE system is 1 Megabyte (220 bytes)
Registers
Additional B, S, T, and F registers are provided by SIC/XE, in addition to the registers of SIC
Mnemonic
Number
Special use
B
Base register
exponent
fraction
Instruction Formats
The new set of instruction formats fro SIC/XE machine architecture are as follows. Format 1 (1 byte):
contains only operation code (straight from table). Format 2 (2 bytes): first eight bits for operation code, next
four for register 1 and following four for register 2. The numbers for the registers go according to the numbers
indicated at the registers section (ie, register T is replaced by hex 5, F is replaced by hex 6). Format 3 (3 bytes):
First 6 bits contain operation code, next 6 bits contain flags, last 12 bits contain displacement for the address of
the operand. Operation code uses only 6 bits, thus the second hex digit will be affected by the values of the first
two flags (n and i). The flags, in order, are: n, i, x, b, p, and e. Its functionality is explained in the next section.
The last flag e indicates the instruction format (0 for 3 and 1 for 4). Format 4 (4 bytes): same as format 3 with
an extra 2 hex digits (8 bits) for addresses that require more than 12 bits to be represented.
Format 1 (1 byte)
8
Op
Format 2 (2 bytes)
Op
r1
r2
Op
n
Format 4 (4 bytes)
1
Op
x b p e disp
1 1 1 1 1 20
i
x b p e address
b=1,p=0
TA=(B)+ disp
(0disp 4095)
TA=(PC)+ disp
(-2048disp 2047)
Instruction Set
SIC/XE provides all of the instructions that are available on the standard version. In addition we have,
Instructions to load and store the new registers LDB, STB, etc, Floating-point arithmetic operations, ADDF,
SUBF, MULF, DIVF, Register move instruction : RMO, Register-to-register arithmetic operations, ADDR,
SUBR, MULR, DIVR and, Supervisor call instruction : SVC.
Input and Output
There are I/O channels that can be used to perform input and output while the CPU is executing other
instructions. Allows overlap of computing and I/O, resulting in more efficient system operation. The
instructions SIO, TIO, and HIO are used to start, test and halt the operation of I/O channels.
3.
4.
Write and explain the sequence of code in SIC and SIC/XE to read 200 bytes record from the F1
using Subroutine
SIC code
JSUB READ
.
.
READ
LDX ZERO
CLOOP
TD
INDEV
JEQ CLOOP
RD
INDEV
STCH RECORD, X
TIX
B200
: add 1 to index compare 200 (B200)
JLT CLOOP
RSUB
..
..
INDEV
BYTE
X F5
RECORD RESB 200
ZERO
WORD 0
B200
WORD 200
SIC/XE
JSUB READ
.
.
READ
LDT #200
LDX #0
CLOOP
TD
INDEV
JEQ CLOOP
RD
INDEV
STCH RECORD, X
TIXR T
: add 1 to index compare T
JLT CLOOP
RSUB
..
..
INDEV
BYTE
X F5
RECORD RESB 200
5.
ALPHA
INCR
ONE
ALPHA
BETA
INCR
ONE
STA
BETA
RESW 1
RESW 1
RESW 1
WORD
1
(same to next instruction except Symbol change)
6.
Explain the data movement and arithmetic operations of SIC and SIC/XE
SIC provides, load and store instructions (LDA, LDX, STA, STX, etc.). Integer arithmetic operations:
(ADD, SUB, MUL, DIV, etc.). All arithmetic operations involve register A and a word in memory, with the
result being left in the register. Two instructions are provided for subroutine linkage. COMP compares the
value in register A with a word in memory, this instruction sets a condition code CC to indicate the result.
There are conditional jump instructions: (JLT, JEQ, JGT), these instructions test the setting of CC and jump
accordingly. JSUB jumps to the subroutine placing the return address in register L, RSUB returns by
jumping to the address contained in register L.
SIC/XE provides all of the instructions that are available on the standard version. In addition we have,
Instructions to load and store the new registers LDB, STB, etc, Floating-point arithmetic operations,
ADDF, SUBF, MULF, DIVF, Register move instruction : RMO, Register-to-register arithmetic operations,
ADDR, SUBR, MULR, DIVR and, Supervisor call instruction : SVC.
LDA
ALPHA
ADD
INCR
SUB
ONE
STA
BETA
ALPHA
RESW 1
BETA
RESW 1
INCR
RESW 1
ONE
WORD
1
(Explain code)
7. Explain the data movement and arithmetic operations for SIC. (10)
8. Explain the instruction formats and addressing modes of SIC/XE machine. (16)
Instruction format
The large memory available on SIC/XE means that an address will not fit in to 15
bit field. Hence instruction format used on the standard version is no longer suitable. To
make code compatible
1. Use relative addressing.
2. Extend address field of 20 bits.
There are four different type of instruction format. They are
Format 1 (1 byte)
8
Op
8
Op
Format 2 (2 bytes)
4
r1
4
r2
Op
n
Format 4 (4 bytes)
1
op
x b p e disp
1 1 1 1 1 20
i
x b p e address
9. Compare SIC and SIC/XE architecture with respect to memory, instruction formats, addressing modes and
data formats (16)
Comparison based on MEMORY,DATA FORMAT,INSTRUCTION FORMAT, INSTRUCTION SET, I/O
OPERATION(REFER 1 & 2)
10. What are the addressing modes available in SIC/XE machine? Explain in detail. (8)
Addressing modes
Two relative addressing modes are available for format 3 instruction. Indexing
cannot be used with immediate or indirect addressing modes. The two relative addressing
modes are
1. Base Relative addressing mode
2. Program Counter Relative addressing mode
Mode
Indication
Target Address Calculation
Base relative addressing
b=1
TA=Displacement + (B)
Mode
B Base Register.
P=0
Displacement is 12bit unsigned register.
Displacement lies between 0 to 4095
Program counter relative
b=0
TA=Displacement + (PC)
addressing mode
PC program counter
P=1
Displacement is 12bit signed integer.
Displacement lies between -2048 to 2047
Direct addressing mode
b=0, P=0
TA=address field of format 4 instruction
(Format 4 instruction)
b=0, P=0
TA=Displacement field value of format 3
(Format 3 instruction)
instruction
Base relative indexed
b=1, P=0
TA=Displacement + (B) + (X)
addressing mode
B Base register
X=1
X Index register
Displacement is 12bit unsigned register.
Displacement lies between 0 to 4095
Program counter relative
b=0, P=1
TA=Displacement + (PC) + (X)
indexed addressing
PC program counter
mode
X=1
X Indexed Register
Displacement is 12bit signed integer.
Displacement lies between -2048 to 2047
11. Explain the programming examples for SIC and SIC/XE.
Example Programs (SIC)
Example 1(Simple data and character movement operation)
LDA FIVE
STA ALPHA
LDCH CHARZ
STCH C1
.
ALPHA RESW 1
FIVE WORD 5
CHARZ BYTE CZ
C1 RESB 1
Example 2( Arithmetic operations)
LDA ALPHA
ADD INCR
SUB ONE STA BEETA
..
..
..
..
ONE WORD 1
ALPHA RESW 1
BEETA RESW 1
INCR RESW 1
Example 3(Looping and Indexing operation)
LDX ZERO : X = 0
MOVECH LDCH STR1, X : LOAD A FROM STR1
STCH STR2, X : STORE A TO STR2
TIX ELEVEN : ADD 1 TO X, TEST
JLT MOVECH
.
.
.
STR1 BYTE C HELLO WORLD
STR2 RESB 11
ZERO WORD 0
ELEVEN WORD 11
Example 4( Input and Output operation)
INLOOP TD INDEV : TEST INPUT DEVICE
JEQ INLOOP : LOOP UNTIL DEVICE IS READY
RD INDEV : READ ONE BYTE INTO A
STCH DATA : STORE A TO DATA
.
.
OUTLP TD OUTDEV : TEST OUTPUT DEVICE
JEQ OUTLP : LOOP UNTIL DEVICE IS READY
LDCH DATA : LOAD DATA INTO A
WD OUTDEV : WRITE A TO OUTPUT DEVICE
.
.
INDEV BYTE X F5 : INPUT DEVICE NUMBER
OUTDEV BYTE X 08 : OUTPUT DEVICE NUMBER
DATA RESB 1 : ONE-BYTE VARIABLE
Example 5 (To transfer two hundred bytes of data from input device to
memory)
LDX ZERO
CLOOP TD INDEV
JEQ CLOOP
RD INDEV
STCH RECORD, X
TIX B200
JLT CLOOP
.
.
INDEV BYTE X F5
RECORD RESB 200
ZERO WORD 0
B200 WORD 200
Example 6 (Subroutine to transfer two hundred bytes of data from input device
to memory)
JSUB READ
.
.
READ LDX ZERO
CLOOP TD INDEV
JEQ CLOOP
RD INDEV
STCH RECORD, X
TIX B200 : add 1 to index compare 200 (B200)
JLT CLOOP
RSUB
..
..
INDEV BYTE X F5
RECORD RESB 200
ZERO WORD 0
B200 WORD 200
Example Programs (SIC/XE)
Example 1 (Simple data and character movement operation)
LDA #5
STA ALPHA
LDA #90
STCH C1 .
.
ALPHA RESW 1
C1 RESB 1
Example 2(Arithmetic operations)
LDS INCR
LDA ALPHA
ADD S,A
SUB #1
STA BETA
.
..
ALPHA RESW 1
BETA RESW 1
INCR RESW 1
Example 3(Looping and Indexing operation)
LDT #11
LDX #0 : X = 0
MOVECH LDCH STR1, X : LOAD A FROM STR1
STCH STR2, X : STORE A TO STR2
TIXR T : ADD 1 TO X, TEST (T)
JLT MOVECH
.
.
Example 5 (Subroutine to transfer two hundred bytes of data from input device
to memory)
JSUB READ
.
.
READ LDT #200
LDX #0
CLOOP TD INDEV
JEQ CLOOP
RD INDEV
STCH RECORD, X
TIXR T : add 1 to index compare T
JLT CLOOP
RSUB
..
..
INDEV BYTE X F5
RECORD RESB 200