SS Module 1
SS Module 1
MODULE I
• System Software Vs. Application Software
• Different System Software
o Assembler, Linker, Loader, Macro Processor, Text Editor,
Debugger, Device Driver, Compiler, Interpreter, Operating
System(Basic Concepts only)
• SIC & SIC/XE Architecture
o Addressing modes
o SIC & SIC/XE Instruction set
• Assembler Directives
Introduction
• Software is set of instructions or programs written to carry out certain task
on digital computers. It is classified into two.
o System software
o Application software
System Software
• It is a set of programs that supports the operation of a computer.
• It is a set of programs to perform a variety of system functions as file
editing, resource Management, I/O management and storage management.
• System software is intended to support the operation and use of the
computer itself, rather than any particular application. For this reason, they
are usually related to the architecture of the machine on which they are run.
• It acts as an intermediary between computer hardware and application
programs.
• It controls the computer system and enhances its performance.
• Eg: Operating system, Compiler, Debugger, Assembler, Interpreter etc.
Application Software
• Application software consists of programs designed to perform specific tasks
for users.
• It performs particular functions for the user.
• It is program written for or by a user to perform a particular job.
• An application program is primarily concerned with the solution of some
problem, using the computer as a tool.
• Application software lies on the top of the system software, because it is
unable to run without the operating system and system utilities.
1 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)
2 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)
User
Program
Input
Output
Application Software
Service Service
Request Responses
System Software
Hardware
Processing
Instructions
Result
Computer Hardware
3 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)
Assembler
• An assembler is a program that translates an assembly language program
into a machine language program.
• Two types:
o Self assembler/Resident assembler: An assembler runs on a
computer and produces machine code for the same computer.
o Cross assembler: An assembler runs on a computer and produces
machine code for other computer.
Compiler
• It is a program that translates a high level language into a machine language.
4 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)
Interpreter
• It is a program that translates statements of a program into machine code.
• It translates only one statement of a program at a time. It reads only one
statement, translate it and execute it. Then it reads the next statement and do
the same till all the statements are translated and executed.
• The main difference with that of compiler is, compiler goes through the
entire program and then translate the entire program into machine codes.
• So compiler is 5 to 25 times faster than interpreter.
• An interpreter is a small program compared to compiler. It occupies less
memory space, so it can be used in a smaller system which has very limited
memory space.
• By compiler, the machine codes are saved permanently for future references.
On the other hand, machine codes produced by interpreter are not saved.
Linker
• Linker is a program which helps to link a object modules of program into a
single object file. It performs the process of linking.
• Combines two or more separate object programs and supplies the
information needed to allow references between them.
5 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)
Loader
• Loader is a program that loads machine codes of a program into system
memory.
• Loader is a part of operating system that is responsible for loading program.
• Loading a program involves reading the contents of executable file into
memory.
• Once loading is completed, the OS starts the program by passing control to
the loaded program code.
• In many OS, the loader is permanently resident in memory.
Text Editor
• A text editor is tool that allows a user to create and revise documents in a
computer.
• Depending on how editing is performed and the type of output that can be
generated, editors are of different types, such as:
o Line Editor(edlin editor in MS DOS system)
o Word Editor(Microsoft wordpad, Notepad)
o Screen Editor(Emacs in UNIX system)
• Text editors provides some salient features such as:
o Interactive user interface
o Appropriate format for storing the document in file
o Efficient transfer of information between user interface and the file in
secondary storage
Debugger
• Debugging means locating and removing bugs, ie faults in programs.
• The main steps that are taken in debugging are:
o To examine the flow of control during the execution of the program.
o Examine values of variables at different points in the program.
o Examine the values of parameters passed to functions and values
returned by functions.
o Examine function call sequence.
• A debugger provides an interactive interface to the programmer to control
the execution of the program.
6 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)
Device Driver
• A device driver is a computer program that operates or controls a particular
type of device that is attached to the computer.
• A driver provides a software interface to hardware devices, so that the OS
and other computer programs can access the peripherals devices without
knowing the precise details of the hardware being used.
• Drivers are hardware dependent and OS specific.
• Eg: keyboard, printer, scanner, digital camera, external storage devices etc.
• Device driver acts as a translator between the OS and the devices connected
to it.
• For most of the devices, the necessary drivers are built into the OS.
• When you plug in a device, the OS starts looking for the right driver installs
it and ready to start using the device. This is referred to as plug-and-play.
Operating System
• It acts as an interface between the users and the system.
• The functions of OS are:
o Process management
o Memory management
o Resource management
o I/O operations
o Data management
o Providing security to user’s job.
7 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)
SIC\XE
• Memory consists of 8-bit
• Any 3 consecutive bytes form a word (1 word=24 bits)
• All addresses on SIC are byte addresses.
• Words are addressed by the lowest number byte
8 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)
o Register
SIC
• Five registers
• Each register is 24 bits in length
• SIC does not have any stack. It uses the linkage register to store
the return address. It is difficult to write the recursive program.
A programmer has to maintain memory for return addresses
when he writes more than one layer of function call.
SIC\XE
• Total nine registers
• Each register is 24 bits in length except F
9 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)
o Data Formats
SIC
• Characters
o 8-bit ASCII codes
• Integers
o 24-bit binary numbers
o 2’s complement for negative values
SIC\XE
• Characters
o 8-bit ASCII codes
• Integers
o 24-bit binary numbers
o 2’s complement for negative values
• Floating-point number
o 48 bit
o Instruction Formats
SIC
• 24-bits format
SIC\XE
• Since the memory used by SIC/XE may be 220 bytes, the
instruction format of SIC is not enough.
o Solutions
Use relative addressing
Extend the address field to 20 bits
10 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)
• 4 types of instructions.
o Format 1 (1 byte)
o Format 2 (2 bytes)
o Format 3 (3 bytes)
o Format 4 (4 bytes)
11 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)
o Addressing Modes
SIC
• There are two types of addressing modes
o Direct-addressing mode
o Indexed-addressing mode
SIC\XE
• The following addressing modes are available
o Direct-addressing mode
o Indexed-addressing mode
12 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)
o Instruction Set
SIC
• SIC provides 26 instructions
o Load and store registers: LDA, LDX, STA, STX.
o Integer arithmetic operations: ADD, SUB, MUL, DIV
All arithmetic operations involve register A and a word
in memory, with the result being left in A
o Compare Instruction: COMP
Involves register A and a word in memory.
This instruction sets a condition code (CC) of SW to
indicate the result(<,>,==)
o Conditional jump instructions: JLT, JEQ, JGT
Test the setting of CC, and jump accordingly
o Subroutine linkage
JSUB: Jumps to the subroutine and places the return
address in register L
RSUB: Returns to the address in L
13 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)
SIC\XE
• SIC/XE provides 59 instructions. It is divided into 9 categories.
o Load and store registers: LDA, LDX, STA, STX, LDB,
STB
o Integer arithmetic operations: ADD, SUB, MUL, DIV
All arithmetic operations involve register A and a word
in memory, with the result being left in A
o Floating-point arithmetic operations
Eg: ADDF, SUBF, MULF, DIVF
o Register-to-register arithmetic operations
Eg: ADDR, SUBR, MULR, DIVR
o Compare Instruction: COMP
Involves register A and a word in memory.
This instruction sets a condition code (CC) of SW to
indicate the result(<,>,==)
o Conditional jump instructions: JLT, JEQ, JGT
Test the setting of CC, and jump accordingly
o Subroutine linkage
JSUB: Jumps to the subroutine and places the return
address in register L
RSUB: Returns to the address in L
o Register move instruction: Eg: RMO
o Supervisor call instruction: generates an interrupt for OS
Eg: SVC
14 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)
SIC\XE
• Input and output are performed by transferring 1 byte at a time
to or from the rightmost 8 bits of register A
• Each device is assigned a unique 8-bits code
• Three I/O instructions
o Test Device (TD) instruction
Tests whether the addressed device is ready to send or
receive a byte of data. The conditional code(CC) is set
to indicate the result of this test.
• CC : < means device is ready
• CC : = means device is not ready
o Read Data (RD)
o Write Data (WD)
• There are I/O channels that can be used to perform input and
output while the CPU is executing other instructions
o SIO: start the operation of I/O channels
o TIO: test the operation of I/O channels
o HIO: halt the operation of I/O channels
Assembler
Tutorial Qustion
1. Consider the following memory and register status. Find the value loaded in
register A for the given hexacode of SIC/XE instructions
a. 022030
b. 010030
c. 003600
d. 0310C303
Answer:
16 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)
17 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)
18 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)
19 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)
P: privileged instruction
X: available only on XE
F: floating-point Instruction
C: condition code CC set to indicate result of
operation
20 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck