Ssos - U1-23
Ssos - U1-23
Handled By
Dr.N.SUDHA
ASSOCIATE PROFESSOR
DEPARTMENT OF COMPUTER SCIENCE
SYSTEM SOFTWARE AND OPERATING SYSTEM – 43A
TEXT BOOKS
Course Study :
Consists of 5 Units : Unit 1 & 2 – System Software
Unit 3 to 5 – Operating Systems
Max.Marks : 100 Marks
Internal : 50 Marks
External : 50 Marks
UNIT – I
A software plays a key role of a mediator between the user and the computer hardware.
In the absence of software, a user essentially can’t perform any task on a computer.
Types Of Software
Software can be broadly divided into two categories
* System Software
* Application software
* System Software
System software is software designed to provide a platform for other software. System
Software In case of a system software, it helps the user as well as the hardware to function and
even interact with each other easily. Essentially, it is a software which is used to manage the
behavior of the computer hardware in order to offer basic functionalities which are needed by the
user. In simpler word, it can be said that system software is essentially an intermediater or even a
A system software essentially runs in the background, and it isn’t actually utilized by
the end-users. Due to this reason, the system software is also known popularly as low-level
software.
Examples of system software include operating systems like macOS, GNU/Linux ,
Android and Microsoft Windows, computational science software, game engines, industrial
SIC
SIC comes in two versions
• Standard model
• XE version (Extra Equipment’s)
Therefore these two version have been design to be upward compatible
SIC Machine Architecture – Standard Model
It consist of memory, registers, data formats, instruction formats , addressing modes ,
instruction set, input and output.
Memory
There are 215 bytes in the computer memory, that is 32,768 bytes , 3 consecutive bytes
form a word , 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
A 0 Accumulator; used for arithmetic operations
X 1 Index register; used for addressing
L 2 Linkage register JSUB(Jumps to subroutines )
instruction stores the return address in the register.
PC 8 Program counter contains the address of the next
instruction to be fetched for execution.
SW 9 Status word contains many types of information
including CC (condition code).
Data Formats
Integers are stored as 24-bit binary numbers , 2’s 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
8 1 15
Opcode x Address
All machine instructions on the standard version of SIC have the 24-bit format as
shown above. The flag bit x is used to indicate the indexed addressing modes.
Addressing Modes
Mode Indication Target address calculation
Direct x=0 TA = address
Indexed x=1 TA = address + (x)
There are two addressing modes available, indicated by the setting of the x bit in the
instruction as shown in the above table. Parentheses are used to indicate the contents of a register
or a memory location.
Instruction Set
SIC provides a basic set of instructions that are sufficient to perform the tasks. It
includes 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(< , > , ==). 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.
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).
op
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).
8 4 4
op r1 r2
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. The last flag e indicates the instruction format (0 for 3 and 1 for 4).
6 1 1 1 1 1 1 12
op n i x b p e disp
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.
6 1 1 1 1 1 1 20
op n i x b p e address
Addressing modes & Flag Bits
Five possible addressing modes plus the combinations are as follows.
Direct (x, b, and p all set to 0):
operand address goes as it is. n and i are both set to the same value, either 0 or 1. While
in general that value is 1, if set to 0 for format 3 we can assume that the rest of the flags (x, b, p,
and e) are used as a part of the address of the operand, to make the format compatible to the SIC
format.
The operand value is already enclosed on the instruction (ie. lies on the last 12/20 bits
of the instruction)
Indirect (i = 0, n = 1):
The operand value points to an address that holds the address for the operand value.
Indexed (x = 1):
value to be added to the value stored at the register x to obtain real address of the
operand. This can be combined with any of the previous modes except immediate.
The various flag bits used in the above formats have the following meanings e –
e = 0 means format 3,
e = 1 means format 4
Bits x,b,p:
Used to calculate the target address using relative, direct, and indexed
addressing Modes
Bits i and n:
Says, how to use the target address
Two new relative addressing modes are available for use with instructions assembled
using format 3.
Mode Indication Target address calculation
Base relative b=1,p=0 TA=(B)+ disp (0≤disp ≤4095)
Program-counter relative b=0,p=1 TA=(PC)+ disp (-2048≤disp ≤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
Supervisor call instruction ( SVC).
Executable code
Loader
A linker combines one or more object files and possible some library code into either
some executable, some library or a list of error messages. Some systems have a linker to perform
the linking operations and a separate loader to handle relocation and loading
Three fundamental processes
Loading – brings the object program into memory for execution.
Relocation – modifies the object program so that it can be loaded at an address
different from the location originally specified.
Linking – combines two or more separate object programs and supplies the
information needed to allow references between them.
BASIC LOADER FUNCTIONS
The most fundamental functions of a loader is bringing an object program into
memory and starting its execution.
2) As each Text record is read, the object code it contains is moved to the indicated address in
memory. No need to perform program linking and relocation
3)When the End record is encountered, the loader jumps to the specified address to begin
execution of the loaded program.
Advantage
o Simple and efficient
Disadvantages
• The need for programmer to specify the actual address at which it will be loaded
into memory
a. object program
Example :
convert the pair of characters “14” (two bytes) in the object program to a single byte
with hexadecimal value 14
A SIMPLE BOOTSTRAPLOADER
loader
When a computer is first turned on or restarted, a special type of absolute
called a bootstrap loader is executed. This bootstrap loads the first program to be run by the
computer usually an operating system.
The bootstrap itself begins at address Zero in the memory of the machine.
It loads the operating system or the other programs starting at address 80.
Because this loader is used in unique situation i.e the initial program load for the
system.
The object code from the device F1 is always loaded into consecutive bytes of memory
starting at address 80. There is no header record , end record or control information
such as address.
The work of a bootstrap loader is performed by the subroutine GETC. This subroutine
reads one character from the device and converts its from ASCII Character code to the
value of hexadecimal digit that is represented by the character.
The subroutine GETC jumps to the address 80 when end of file is read from the device.
Its skips all the other input characters that have ASCII character less then hexadecimal 30. This
cause bootstrap to ignore any control bit that are read.
The main loop of bootstrap keeps the address of the next memory location to be loader
in the register X. GETC is used to read and covert a par of character of from the device F1. These
two hexadecimal digit value are combined into single byte by shifting the first one left four bit
position and adding the second to it .
The resulting byte is stored at the address currently in the register X using STCH
instructions that refers to the location 0 using index addressing . The TIXR instruction is then
used to add one value in the register X.
Bootstrap loader for SIC/XE
Begin
X=0x80 ; the address of the next memory location to be loaded
Loop
A GETC ; read one char. From device F1 and convert it from the ;ASCII
character code to the value of the hex digit
save the value in the high-order 4 bits of S
A GETC
A (A+S) ; combine the value to form one byte
store the value (in A) to the address represented in register X
X X+1
end
MACHINE DEPENDENT LOADER FEATURES
When the program is assembled the actual address at which it will be loaded in to the
memory is one of the most obvious need of the programmer. There is only one room to run one
program at a time the starting address for this single user program is known in advance.
Writing obsolete program makes it difficult to use subroutine libraries efficiently. The
need for program relocation is a indirect consequence of the change to large and more powerful
computers. The way relocation is implemented in the loader is also dependent upon machine
characteristics.
- Relocation
- Program linking
- Algorithm and data structure for linking a loader
- Relocation
It discusses the dependencies by examining different implementation techniques.
Loaders that allow for program relocation are called relocating loaders are relative
loaders.
Line Loc
Source Object code
Statement
* LINKAGE EDITORS
* DYNAMIC LINKING