0% found this document useful (0 votes)
3 views

Module 1 Notes

The document provides an overview of system software, distinguishing it from application software, and detailing various types of system software such as assemblers, linkers, loaders, and compilers. It also introduces the Simplified Instructional Computer (SIC) and its architecture, including memory, registers, data formats, instruction formats, and addressing modes. Additionally, it discusses the SIC/XE architecture, highlighting enhancements and compatibility with the original SIC design.

Uploaded by

Cinu Joseph
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Module 1 Notes

The document provides an overview of system software, distinguishing it from application software, and detailing various types of system software such as assemblers, linkers, loaders, and compilers. It also introduces the Simplified Instructional Computer (SIC) and its architecture, including memory, registers, data formats, instruction formats, and addressing modes. Additionally, it discusses the SIC/XE architecture, highlighting enhancements and compatibility with the original SIC design.

Uploaded by

Cinu Joseph
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

SYSTEM SOFTWARE CS303

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 vs Application Software

 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.

Different System software


 Assembler – Assembler is a system software which converts an assembly language program into
machine language.

 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.

Difference between Interpreter and Compiler

Interpreter Compiler

Translates program one Translates the program as a whole


statement at a time

Execution time is slower Execution time is faster

No intermediate object code Generates intermediate object code ,


is generated, hence are hence require more memory
memory efficient
Dept. of CSE,CCE 16
SYSTEM SOFTWARE CS303

Eg: Python, Ruby Eg: C,C++

 Operating system – An operating system is a collection of software that manages computer


hardware resources and provide common services for computer programs. Application programs
require an operating system to function.

System Software and Machine Architecture:

 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.

The Simplified Instructional Computer (SIC):

 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:

 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.

Mnemonic Number Use

A 0 Accumulator; used for arithmetic operations

X 1 Index register; used for addressing

L 2 Linkage register; JSUB

PC 8 Program counter

SW 9 Status word, including CC

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:

Mode Indication Target address calculation

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.
 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

Example Programs (SIC):

Example 1: Simple data and character movement operation:


Program to store a number and character into memory locations.

LDA FIVE
STA ALPHA
LDCH CHARZ
STCH C1
ALPHA RESW 1
FIVE WORD 5
CHARZ BYTE C’Z’
C1 RESB 1

Example 2:Arithmetic operations:


Program to perform the operation BETA= ALPHA+INCR-1

LDA ALPHA
ADD INCR
SUB ONE
STA BETA
ONE WORD 1
ALPHA RESW 1
BETA RESW 1
INCR RESW 1

Example 3: Looping and Indexing operation


Program to copy a 11 byte character string to another

LDX ZERO (Initialise index register to 0)


MOVECH LDCH STR1,X ( load character from STR1 into register A)
STCH STR2,X (Store character into STR2)
TIX ELEVEN (Add 1 to index register , compare result to 11)
JLT MOVECH (Loop if index is less than 11)
STR1 BYTE C’HELLO WORLD’ (11 byte character constant)
STR2 RESB 11 (11 byte variable)
ZERO WORD 0
ELEVEN WORD 11

ALPHA and BETA are two arrays of 100 numbers each. Add the corresponding elements of the arrays and atore
the result in GAMMA.

LDA ZERO (Initialize index value to zero)


STA INDEX
ADDLP LDX INDEX (Load index value into register X)
LDA ALPHA, X (Load word from ALPHA to register A)
ADD BETA, X (Add word from BETA)
STA GAMMA, X (Store the result in a word 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 4: Input and Output operation


Program to read 1 byte of data from device F1 to device 05

INLOOP TD INDEV (Test input device)


JEQ INLOOP (loop until device is ready)
RD INDEV (Read one byte into register A)
STCH DATA (Store byte that was read)
.
.
.
OUTLP TD OUTDEV (Test output device)
JEQ OUTLP (loop until device is ready)
LDCH DATA (Load data byte into register A)
WD OUTDEV (Write one byte into output device)
.
.
.
INDEV BYTE X’F1’ (input device number)
OUTDEV BYTE X’05’ (output device number)
DATA RESB 1 (one byte variable)

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

SIC/XE Machine Architecture:

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.

Mnemonic Number Special use

B 3 Base register

S 4 General working register

T 5 General working register

F 6 Floating-point accumulator (48 bits)

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.

 Format 1 (1 byte): contains only operation code

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).

Example: COMPR A,S


 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).
Example: LDA #3

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.

Example: +JSUB RDREC( jump to the address RDREC).


Formats 1 and 2 are instructions do not reference memory at all.

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)

Program Counter Relative


b=0, p=1 TA = disp+ (PC)

Base relative with indexing


b=1,p=0, x=1 TA = disp+(B)+ (X)

Program counter relative with index addressing

b=0, p=1, x=1 TA = disp+(PC)+ (X)

Dept. of CSE,CCE 16
SYSTEM SOFTWARE CS303

Direct Addressing (format3 and format4)

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)

Immediate addressing( format 3)

i=1 and n=0


displacement is the operand value. No memory address or Target Address.
Example: LDA #9
# symbol is used in immediate mode.

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.

Compatibility of SIC and SIC/XE


If bits n and i are both 0 , then bits b,p, e are considered to be part of the address field. This makes
format 3 identical to standard SIC.

Example of Addressing modes of SIC/XE

 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.

Input and Output:

Instructions those are availablein SIC.


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.

Example Programs (SIC/XE)

Example 1: Simple data and character movement operation

Example 2: Arithmetic operations

Dept. of CSE,CCE 16
SYSTEM SOFTWARE CS303

Example 3: Looping and Indexing operation


Program to copy a 11 byte character string to another

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

You might also like