Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
34 views20 pages

SS Module 1

Module I of System Software (CST 305) covers the distinction between system software and application software, detailing various types of system software such as assemblers, compilers, and operating systems. It introduces the SIC and SIC/XE architecture, including their instruction sets and addressing modes. The module emphasizes the role of system software in managing computer hardware and providing a platform for application software to operate effectively.

Uploaded by

Ajina Joseph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views20 pages

SS Module 1

Module I of System Software (CST 305) covers the distinction between system software and application software, detailing various types of system software such as assemblers, compilers, and operating systems. It introduces the SIC and SIC/XE architecture, including their instruction sets and addressing modes. The module emphasizes the role of system software in managing computer hardware and providing a platform for application software to operate effectively.

Uploaded by

Ajina Joseph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Module I System Software (CST 305)

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)

• Application software can be used to assist with graphics and multimedia


projects, to support home, personal and educational activities and to
facilitate communications.
• Eg: Oracle, MS Access, Word processors, Web browsers, Spread sheets,
Media Player, MS PowerPoint etc.
Category System Software Application Software
It is designed to operate
the computer hardware
It is designed to help the user to
Definition and to provide a
perform specific task
platform for running
application software
It is a general purpose
Purpose It is a specific purpose software
software
In general, the user does
not interact with system
User In general, the user interacts with
software because it
Interaction application software.
works in the
background.
It create its own
environment to run itself It performs in an environment which
Environment
and run other is created by Operating System
applications
Execution It executes all the time
It executes as and when required
Time in computer
System software is Application is not essential for a
Essentials
essential for a computer computer
Number of system
Number of application software is
Number software is less than
much more than system software
application software
System software
supports the use and It focuses on applications rather than
Machine
operation of a computer. computer. So it is machine
Dependency
So it is machine independent.
dependent

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

Different System Softwares


System software is a computer software designed to operate and control the
computer hardware and to provide a platform for running application software.
Different System Softwares are:
1. Macro processor
2. Assembler
3. Compiler
4. Interpreter
5. Linker
6. Loader
7. Text Editor
8. Debugger
9. Device Driver
10.Database Management System
11.Operating System
Macro Processor
• Macro represents a commonly used group of statements in the source
program.
• Macro processor is a program that copies a stream of text from one place to
another, by making a systematic set of replacements.
• It reads a file and scans them for certain keywords. When a keyword is
found, it is replaced by some text. The keyword/text combination is called
macro.
• Macro processors are embedded in other programs such as assemblers and
compilers.

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.

• Compiler is more intelligent than an assembler.


• Compiler checks all kinds of limits, ranges, errors etc.
• Program run time is more and occupies a larger part of memory.
• Since the compiler goes through the entire program and then translates the
entire program in to machine codes, it has slow speed.
• Eg: C, C++, C# etc.
• Types of Compiler
o Single Pass Compiler: Source code is directly transforms into
machine code
o Two Pass Compiler
 Two pass Compiler is divided into two sections
• Front end: It maps legal code into Intermediate
Representation (IR).
• Back end: It maps IR onto the target machine
o Multi Pass Compiler
 The multipass compiler processes the source code of a program
several times.
 It divided a large program into multiple small programs and
process them.
 It develops multiple intermediate codes.
 All of these multipass take the output of the previous phase as
an input. So it requires less memory.

4 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)

• Different phases of compilation:

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)

• One of the main operations supported by the debugger is setting Breakpoints


at various positions in the program. The breakpoints are points in the
program at which the programmer whishes to suspend normal execution of
program and perform other tasks.

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.

Database Management System


• A DBMS is a system software for creating and managing databases.
• DBMS provides users and programmers with a systematic way to create,
retrieve, update and manage data.
• DBMS serves as an interface between the database and end users or
application programs.
• DBMS is useful for providing a centralized view of data that can be accessed
by multiple users from multiple locations in a controlled manner.
• Eg: MS Access, Oracle, MySQL

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)

• An OS is a system software that manages computer hardware and software


resources and provides common services for computer programs.
• OS is a component of system software in a computer system. Application
programs usually require an OS to function.
• OS acts as an intermediary between programs and the computer hardware.
• Eg: UNIX, Windows, iOS, Android, Fedora etc.

The Simplifies Instructional Computer(SIC)


• SIC is a hypothetical computer system.
• It is similar to a typical microcomputer.
• This machine has been designed to include the hardware features and
concepts found on real machines, while avoiding unusual or irrelevant
complexities.
• SIC comes in two versions
o SIC (Standard model)
o SIC-XE (“Extra Equipments” or “Extra Expensive”)
• The two versions has been designed to be upward compatible
o An object program for the standard SIC machine will also execute
properly on a SIC/XE system

• SIC & SIC/XE Architecture


o Memory
 SIC
• 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
• Maximum memory size = 215 bytes = 32768 bytes = 32KB

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

• Maximum memory size = 220 bytes =1048576bytes = 1


Megabyte

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 s : Sign bit ( 0-positive, 1-negative)


o exponent (e): unsigned binary number between 0 and 2047
o fraction (f): a value between 0 and 1
 The higher order bit of fraction must be 1
o value = (-1)s x 0.f x 2(e-1024)
o 0 is represented by setting all bits to 0

o Instruction Formats
 SIC
• 24-bits format

• The flag bit x is used to indicate addressing modes

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

 Eg: RSUB - Return to subroutine

o Format 2 (2 bytes)

 Eg: COMPR A,S -Compare the contents of


A and S

o Format 3 (3 bytes)

 Eg: LDA #3 - Load 3 to register A

o Format 4 (4 bytes)

 Eg: +JSUB RDREC - Jump to the address in


RDREC
• Formats 1 and 2 do not refer memory at all
• Both format 3 and format 4 have six-bit flag values:
o n : Indirect addressing flag
o i : Immediate addressing flag
o x : Indexed addressing flag
o b : Base address-relative flag
o p : Program counter-relative flag
o e : Format 4 instruction flag
 e=0 for format 3
 e=1 for format 4

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

• (X) represents the contents of reg X


• Eg:
o Direct addressing mode
 LDA TEN
Effective address = 1000
Content of address 1000 is loaded to Accumulator.
o Indexed addressing mode
 STCH BUFFER, X
Effective Address = 1000+(X)
= 1000 + contents of the index
register X

 SIC\XE
• The following addressing modes are available
o Direct-addressing mode
o Indexed-addressing mode

 Direct addressing mode: b=0, p=0, x=0


• Format 3: TA= disp
• Format 4: TA=address
 Indexed addressing mode: b=0, p=0, x=1
o Relative addressing mode: used in format 3
 Base relative
 Program Counter Relative

12 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)

o Simple addressing mode: n=0,i=0 (or n=1,i=1)


 TA is the location of the operand (TA=disp)
o Immediate addressing mode: n=0,i=1
 Target address is itself is used as the operand value
 Eg: LDA #9
o Indirect addressing mode: n=1,i=0
 The word at the location given by the target address is
fetched. The value contained in this word is then taken
as the address of the operand value.
o Index + Base relative: x=1,b=1,p=0
TA=disp + (X) + (B)
o Index + PC relative: x=1, b=0, p=1 TA=disp +
(X) + (PC)
o Index + Direct: x=1, b=0, p=0
TA=disp + (X)

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

o Input and Output


 SIC
• 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)

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

• Assembler translates mnemonic operation codes to their machine language


equivalents
• It also assigns machine addresses to symbolic labels

Assembler Directives (Psuedo Instructions)


• They provide instructions to the assembler itself
• They are not Translated into machine instructions
• SIC Assembler directives are:
o START : Specify name & starting address of the program
o END : Indicate the end of the source program and specify the
first
executable instruction in the program.
o BYTE : Generate character\hexadecimal constant,
occupying as many
bytes as needed to represent the constant.
o WORD : Generate one word integer constant.
o RESB : Reserve the indicated no of bytes for a data area
o RESW : Reserve the indicated no of words for a data area
15 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)

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)

Previous Year University Questions


1. Distinguish between Application software and System Software
2. System software is machine dependent. Justify the statement.
3. Describe in detail about any 4 system softwares.
4. Distinguish between interpreter and compiler.
5. What are the functions of Operating System?
6. Distinguish between an assembler and a compiler. Which are the different
types of compilers?
7. Illustrate the roles and functions of Operating System, Assembler, Compiler
and Linker in a modern computer system
8. What are the registers available in SIC and SIC/XE machine along with their
purpose
9. Explain how floating point numbers are represented in SIC/XE.
10. Compare the following with reference to SIC and SIC/XE machines:
a. Memory
b. Instruction format
11. Explain the instruction format and addressing modes of SIC machine
12. Explain the instruction format and addressing modes of SIC/XE machine with
suitable example
13. What are the various addressing modes supported by SIC/XE? With the help of
an example, explain how to find target address during assembling in each case.
14. What is the difference between the instructions LDA #5 and LDA FIVE?
Explain how each instruction is executed
15. Explain the different I/O instructions in SIC
16. Compare the Input-Output capabilities of the SIC and SIC/XE machine. Also
list the I/O instructions available in SIC and SIC/XE machines
17. Describe the different instruction formats available in SIC/XE machine
18. Write notes on SIC machine architecture.
19. Briefly discuss the architecture of SIC/XE machine
20. Compare the features of Standard SIC and SIC/XE architecture
21. Describe the use of n,i,x,b,p and e bits in the SIC/XE instruction format. Write
the binary combination for these bits such that the resultant target address
would be as below and also state what would be the addressing modes for each
a) (PC) + disp b) (B) + disp c) (PC) + disp + (X) d) (B) + disp + (X)
22. Why is the displacement field of PC related addressing mode interpreted as 12
bit signed integer?
23. Identify the addressing modes in the following machine code for SIC /XE
machine
a. 010030 b. 032600
24. What are assembler directives? List any five assembler directives in SIC
machine.

17 CS KTU Lectures
Reference Book: System Software: An Introduction to System Programming, Leland L Beck
Module I System Software (CST 305)

Complete Instruction Sets of SIC & SIC\XE

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

You might also like