Module 1 Notes
Module 1 Notes
MODULE – 1
Introduction
The Software is set of instructions or programs written to carry out certain task on digital
computers. It is classified into system software and application software.
System software consists of a variety of programs that support the operation of a computer.
Application software focuses on an application or problem to be solved.
Examples for system software are Operating system, compiler, assembler, macro processor,
loader or linker, debugger, text editor, database management systems (some of them) and,
software engineering tools.
These software’s make it possible for the user to focus on an application or other problem to
be solved, without needing to know the details of how the machine works internally.
System software – System software consists of a variety of programs that support the
operation of a computer . These softwares make it possible for the user to focus on an
application without needing to know how the system works internally. System software
manages system resources and provides a platform for application software to run. A system is
unable to run without system software. System software is general purpose. Eg: OS
Application software – Application software allows users to accomplish one or more specific
tasks. Application software focuses on an application. Application software runs when the
user requests. Application software is specific purpose. Eg: Microsoft office, Photoshop,
Educational software.
Linker – Linking is a process of collecting and combining various pieces of code and data into a
single file that can be loaded into memory and executed. Linking can be performed at compile time
or run time. Linkers play an important role in software development. Instead of organizing a large
Dept. of CSE,CCE 16
SYSTEM SOFTWARE CS303
application as one single source file we can decompose it into smaller modules that can be modified
and compiled separately. When we change one of these modules we can recompile it and relink the
application without having to recompile the other files.
Loader – A loader is a utility of an operating system. It copies programs from a storage device to
computer’s main memory where the program can be executed. Most loaders function without user
involvement.
Debugger- An interactive debugging system provides programmers with facilities that aid in
testing and debugging of programs. Debugging means locating bugs or faults in a program.
Debugging involves determination of the exact nature and location of the error and fixing it.
Device driver- A device driver is a system software which manages the communication with I/O
device. It is the task of the device driver to convert the logical requests from the user into specific
commands to the device.
Macro processor – Macros are special code fragments that are defined once in the program and are
used repetitively by calling them from different places within the program. A macroprocessor is a
program that copies a stream of text from one place to another making a systematic set of
replacements.
Text editors- A text editor is a program which allows the user to create the source in the form of
text into the main memory. The creation, editing, deletion, and updating can be done with the help
of text editor. The scope of editing is limited to text only.
Compiler- Compiler translates a source program which is written in a high level language into
machine language. For each high level language the machine requires a separate compiler. The
main phases involved in the compiler are Lexical analysis, Syntax analysis, Semantic analysis,
Intermediate code generation and code optimization.
Interpreter- An interpreter is a software which converts a high level language into machine
language line by line.
Interpreter Compiler
One characteristic in which most system software differs from application software is
machine dependency. System software supports operation and use of computer. Application
software provides solution to a problem.
Assembler translates mnemonic instructions into machine code. The instruction formats,
addressing modes etc., are of direct concern in assembler design.
Similarly, Compilers must generate machine language code, taking into account such
hardware characteristics as the number and type of registers and the machine instructions
available.
Operating systems are directly concerned with the management of the resources of a
computing system.
There are aspects of system software that do not directly depend upon the type of computing
system, general design and logic of an assembler, general design and logic of a compiler and
code optimization techniques, which are independent of target machines. Likewise, the
process of linking together independently assembled subprograms does not usually depend on
the computer being used.
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). The two versions have been designed to be
upward compatible- that is an object program for the standard SIC machine will also execute
properly on SIC/XE machine.
Dept. of CSE,CCE 16
SYSTEM SOFTWARE CS303
SIC machine architecture can be considered 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, that is 32,768 bytes. 3 consecutive bytes form a
word(24) bits .Each location in memory contains 8-bit bytes. All addresses on SIC are byte
addresses. Words are addressed by the location of their lowest numbered byte.
Registers:
There are five registers, each 24 bits in length. Their mnemonic, number and use are given in
the following table.
PC 8 Program counter
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:
All machine instructions on the standard version of SIC have the 24-bit format as shown
Dept. of CSE,CCE 16
SYSTEM SOFTWARE CS303
below.
The flag bit x is used to indicate indexed addressing mode.
8 1 15
opcode x address
Addressing Modes:
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.
The table describes how the target address is calculated from the address given in the instruction.
Instruction Set :
1. SIC provides, load and store instructions (LDA, LDX, STA, STX, etc.).
2. 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.
3. 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.
4. JSUB jumps to the subroutine placing the return address in register L, RSUB returns by
jumping to the address contained in register L.
5. 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.
Dept. of CSE,CCE 16
SYSTEM SOFTWARE CS303
Dept. of CSE,CCE 16
SYSTEM SOFTWARE CS303
LDA FIVE
STA ALPHA
LDCH CHARZ
STCH C1
ALPHA RESW 1
FIVE WORD 5
CHARZ BYTE C’Z’
C1 RESB 1
LDA ALPHA
ADD INCR
SUB ONE
STA BETA
ONE WORD 1
ALPHA RESW 1
BETA RESW 1
INCR RESW 1
ALPHA and BETA are two arrays of 100 numbers each. Add the corresponding elements of the arrays and atore
the result in GAMMA.
Dept. of CSE,CCE 16
SYSTEM SOFTWARE CS303
LDA INDEX (Add 3 to index value)
ADD THREE
STA INDEX
COMP K300 (Compare new index value to 300)
JLT ADDLP (Loop if index is less than 300)
INDEX RESW 1
ALPHA RESW 100
BETA RESW 100
GAMMA RESW 100
ZERO WORD 0
K300 WORD 300
THREE WORD 3
Example 5: To transfer one hundred bytes of data from input device to memory
Subroutine to read 100 byte record
Dept. of CSE,CCE 16
SYSTEM SOFTWARE CS303
Memory-
Memory structure same as SIC. Maximum memory available on a SIC/XE system is 1 Megabyte (220
bytes).
This increase leads to change in instruction formats and addressing modes.
Registers
Additional B, S, T, and F registers are provided by SIC/XE, in addition to the registers of
SIC.
B 3 Base register
Dept. of CSE,CCE 16
SYSTEM SOFTWARE CS303
Data Format
Same data format as SIC.
There is a 48-bit floating-point data type, F*2(e-1024)
1 11 36
s exponent fraction
Instruction Formats:
The new set of instruction formats for SIC/XE machine architecture are as follows.
Example: RSUB
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).
Dept. of CSE,CCE 16
SYSTEM SOFTWARE CS303
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.
Addressing Modes
1. Base Relative
2. Program Counter relative
3. Base relative with indexing
4. Program counter relative addressing
5. Direct Addressing
6. Immediate addressing
7. Indirect addressing
The bits n,i,x,b,p,e is used to indicate the addressing modes.
Base Relative
b=1, p=0. TA(Target Address)= disp+(B)
Dept. of CSE,CCE 16
SYSTEM SOFTWARE CS303
x=0, b=0,p=0
Bits n and i are either both 0 or both 1.
TA = disp( for format 3)
TA = address(for format 4)
Indirect Addressing
i=0 and n=1. The word at the location given by the displacement is fetched. The value contained in this
word is taken as the operand value.
For indirect addressing @ symbol is used.
Example: J @RETADR.
Figure1 (a) shows the contents of registers B,PC and X and of selected memory locations.(All
values are given in hexadecimal.
Dept. of CSE,CCE 16
SYSTEM SOFTWARE CS303
Figure 1
Figure 1
Figure 1 (b) gives a series of LDA instructions machine code. Find out the Target Address generated by each
instruction and the value that is loaded into register A.
Dept. of CSE,CCE 16
SYSTEM SOFTWARE CS303
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 r1,r2
Register-to-register arithmetic operations, ADDR, SUBR, MULR, DIVR and, Supervisor call
instruction : SVC- this instruction generates an interrupt that can be used for communication with OS.
Dept. of CSE,CCE 16
SYSTEM SOFTWARE CS303
ALPHA and BETA are two arrays of 100 numbers each. Add the corresponding elements of the arrays and store
the result in GAMMA.
Dept. of CSE,CCE 16
SYSTEM SOFTWARE CS303
Example 5: To transfer one hundred bytes of data from input device to memory
Subroutine to read 100 byte record
Dept. of CSE,CCE 16
SYSTEM SOFTWARE CS303
Dept. of CSE,CCE 16