SSMOD1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

1

Praseeda K Gopinadhan, CSE, SNGCE

INTRODUCTION TO SYSTEM SOFTWARE AND


MACHINE STRUCTURE

1.1 SYSTEM SOFTWARE


 System software consists of a variety of programs that support 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.
 The characteristic in which system software differs from application software is
 machine dependency.
 An application program is primarily concerned with the solution of some
 problem, using the computer as a tool.
 System programs on the other hand are 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.
 For example, assemblers translate mnemonic instructions into machine code. The
 instruction formats, addressing modes are of direct concern in assembler design.
 There are some aspects of system software that do not directly depend upon the

KTU ASSIST
type of computing system being supported. These are known as machine-
 independent features.
· For example, the general design and logic of an assembler is basically the same
on most computers.System software can be broadly classified into
 System control programs: controls the execution of program manages the
storage, processing resources of the computer and performs other
management and monitoring functions. Operating systems, DBMS and
communication monitors are the examples of such systems.
 System support programs: provide routine service functions to the other
computer programs and computer users. Eg: Utilities, libraries,
performance monitors and job accounting.
 System development programs: programs assist in the creation of
application program.
TYPES OF SYSTEM SOFTWARE:
1. Operating system
2. Language translators
a. Compilers
b. Interpreters
c. Assemblers
d. Preprocessors
3. Loaders
4. Linkers
5. Macro processors

Downloaded from Ktunotes.in


2

Praseeda K Gopinadhan, CSE, SNGCE

Operating System
 It is the most important system program that act as an interface between the users
and the system. It makes the computer easier to use.
 It provides an interface that is more user-friendly than the underlying hardware.
 The functions of OS are:
1. Process management
2. Memory management
3. Resource management
4. I/O operations
5. Data management
6. Providing security to user’s job.
Language Translators
It is the program that takes an input program in one language and produces an output in
another language.

Language
Source Program Translator Object Program

Compilers
 A compiler is a language program that translates programs written in any high-

KTU ASSIST
 level language into its equivalent machine language program.
 It bridges the semantic gap between a programming language domain and the
 execution domain.
 Two aspects of compilation are:
o Generate code to increment meaning of a source program in the execution
domain.
o Provide diagnostics for violation of programming language, semantics in a
source program.
 The program instructions are taken as a whole.

Compiler
High level language Machine language program
Interpreters:
 It is a translator program that translates a statement of high-level language to
machine language and executes it immediately. The program instructions are
taken line by line.
 The interpreter reads the source program and stores it in memory.
 During interpretation, it takes a source statement, determines its meaning and
performs actions which increments it. This includes computational and I/O
actions.
 Program counter (PC) indicates which statement of the source program is to be
 interpreted next. This statement would be subjected to the interpretation cycle.
 The interpretation cycle consists of the following steps:
o Fetch the statement.
o Analyze the statement and determine its meaning.
o Execute the meaning of the statement.
 The following are the characteristics of interpretation:

Downloaded from Ktunotes.in


3

Praseeda K Gopinadhan, CSE, SNGCE

o The source program is retained in the source form itself, no target program
exists.
o A statement is analyzed during the interpretation.

Interpreter Memory

Source
Program Program
counter

Assemblers:
 Programmers found it difficult to write or red programs in machine language. In a
quest for a convenient language, they began to use a mnemonic (symbol) for each
machine instructions which would subsequently be translated into machine
 language.
  Such a mnemonic language is called Assembly language.
 Programs known as Assemblers are written to automate the translation of
assembly language into machine language.


KTU ASSIST
Assembly language program

 Fundamental functions:
Assembler
Machine language program

1. Translating mnemonic operation codes to their machine language equivalents.


2. Assigning machine addresses to symbolic tables used by the programmers.

APPLICATION SOFTWARES
Application software is a computer software which is designed to help the user in performing
single or multiple related tasks. In other words, application software is actually a subclass of
computer software, which employs the capabilities of a computer directly to a task that the user
wishes it to perform. Hence, often application software is looked upon as software as well as its
implementation.
There are different types of application software, which include Enterprise Resource Planning
Software, Accounting Software, Customer Relationship Management Software, Graphics
Software, Media Players, etc.

Downloaded from Ktunotes.in


4

Praseeda K Gopinadhan, CSE, SNGCE

Application software vs System software

Subject Application Software System Software

Application software is System software is computer software


computer software designed designed to operate the computer
Definition
to help the user to perform hardware and to provide a platform for
specific tasks. running application software.

It is specific purpose
Purpose It is general-purpose software.
software.

Time Sharing,
Resource Sharing,
Client Server
Classificat Package Program, Batch Processing Operating System
ion Customized Program Real time Operating System
Multi-processing Operating System

KTU ASSIST
Multi-programming Operating System
Distributed Operating System

Application Software
System Software Create his own
Environm performs in a environment
environment to run itself and run other
ent which created by
application.
System/Operating System

Execution It executes as and when


It executes all the time in computer.
Time required.

Essentialit Application is not essential System software is essential for a


y for a computer. computer

The number of application


The number of system software is less
Number software is much more than
than application software.
system software.

Downloaded from Ktunotes.in


THE SIMPLIFIED INSTRUCTIONAL COMPUTER (SIC):
 Hypothetical computer that has been carefully designed to include the hardware features
most often found in real machines.
 Two versions
1. Standard Model
2. XE Model (Extra Equipment/Extra Expensive)

SIC Machine Architecture (Standard Model)


 Memory
 Consists of bytes (8 bits).
Byte addressable memory
 Any three consecutive bytes form a word (24 bits) which are addressed by the
location of their lowest numbered byte.
 There are totally 215 = 32,768 bytes in memory.
 Registers
Five registers each 24 bits (3 bytes) long.
Have both numeric and character representation.
 A (0)
 Used for basic arithmetic operations.
 Accumulator register
 X (1)
 Used for addressing.
 Index register
 L (2)
 Used for storing return address of the jump of subroutine instructions (JSUB)
 Linkage register
 PC (8)
 Contains address of next instruction to be executed.
 Program Counter register
 SW (9)
 Contains a variety of information (such as array and overflow flags) including
a Condition Code (CC).
 Status Word register
 Data Formats
 Integers stored as 24 bit binary numbers.
 Negative numbers represented in 2’s complement method.
 Characters stored using 8 bit ASCII codes.
 SIC do not support floating point data items.
 Instruction Formats
 All machine instructions are of 24 bits length.
 Format:

 X is a flag bit used to indicate indexed addressing mode.


If x=0, direct addressing mode
If x=1, indexed/indirect addressing mode
 Addressing Modes
Way in which the operand of an instruction is specified.
Two types of addressing modes:
 Direct addressing mode
 Indirect/indexed addressing mode

X – Contents of index register


 Instruction Set
 Data Movement Instructions
 LDA – Load Accumulator
 STA – Store Accumulator content to specified location
 LDX – Load X register
 STX – Store X register content to specified location
 Arithmetic Operating Instructions
 ADD, SUB, MUL, DIV
 Involves register A and a word in memory, with the result being left in the A
register.
 Compare Instruction
 COMP
 Compares a value in A with a word in memory and sets the condition code
CC to indicate the result of <, > and =.
 Branching Instructions
 Test the settings of CC and jump accordingly.
 JLT- Jump on less than
 JEQ – Jump on Equal
 JGT – Jump on Greater Than
 Subroutine Linkage Instructions
 JSUB – Jump to the subroutine
Return address placed in register L.
 RSUB – Returns to the address contained in register L.
 Input/output operations
- Performed by transferring one byte at a time to or from the rightmost 8 bits of register
A.
- Each device is assigned a unique 8-bit code
- Three I/O instructions, each of which specifies device code as an operand.
 TD (Test Device)
 Tests whether the addressed device is ready to send or receive a byte of
data.
 The condition code is set to indicate the result of this test.
 If CC setting is < the device is ready, if setting is = device is not ready.
 RD (Read Data)
 For reading data
 WD (Write Data)
 For writing data
SIC/XE Machine Architecture
 Memory
 Consists of bytes (8 bits).
 Any three consecutive bytes form a word (24 bits) which are addressed by the
location of their lowest numbered byte.
 Totally 220 = 1048576 bytes (1MB) in memory.
 Registers
 Nine registers
 All registers except Floating Point Accumulator are of 24 bits. Floating Point
Accumulator is of 48 bits.

 Data Formats
 Integers stored as 24 bit binary numbers.
 For storing negative numbers, 2’s complement representation is used
 Characters are stored using their 8 bit ASCII codes.
 Supports floating point data items. Floating point is used in 48 bit signed exponent
fraction format.

 Instruction Format
- Four different instruction formats
 Format 1
1 byte / 8 bits

 Format 2
2 bytes / 16 bits

 Format 3
3 bytes / 24 bits

 Format 4
4 bytes / 32 bits
- Formats 1 and 2 do not reference memory at all.
- Formats 3 and 4 introduce addressing mode flag bits.
Flag e:
e=0, Format 3
e=1, Format 4
Flag p:
p=1, Program Counter Relative Addressing
Flag b:
b=1, Base Register Relative Addressing
Flag x:
x=1, Indexing (uses index register)
Flag i:
i=1, Immediate Addressing
Flag n:
n=1, Indirect Addressing
 Instruction Set
- Supports all instructions that are available on standard SIC
 Data Movement Instructions
 LDCH – Load Accumulator with character
 STCH – Store the character on accumulator to specified location
 LDX – Load X register
 STX – Store the content of X register to specified location
 Integer Arithmetic Operating Instructions
 ADD, SUB, MUL, DIV
 Involves register A and a word in memory, with the result being left in A
register.
 Floating Point Arithmetic Instructions
 ADDF, SUBF, MULF, DIVF
 F stands for floating point.
 Compare Instruction
 COMP
 Compares a value in A with a word in memory and set the condition code CC
to indicate the result of <, > and =
 Branching Instructions (Conditional Jump Instructions)
 Test the settings of CC and jump accordingly.
 JLT – Jump on less than
 JEQ – Jump on Equal
 JGT – Jump on Greater Than
 Subroutine Linkage Instructions
 JSUB – Jumps to the subroutine placing the return address in register L.
 RSUB – Returns by jumping to the address contained in register L.
 Register Related Instructions
 Involves instructions for register manipulation, operands-from-registers and
register-to-register arithmetic operations.
 RMO – Register Move
 AADR, SUBR, MULR, DIVR – Register Arithmetic Operations
 COMPR – Register Comparison
 SHIFTR – Register Shift
 Supervisor Call Instructions
 Generates an interrupt that can be used for communicating with the
operating system
 Input and Output Operations
- Performed by transferring one byte at a time to or from the rightmost 8 bits of A.
- Each device is assigned a unique 8-bit code.
- Three I/O instructions, each of which specifies device code a s an operand.
 TD (Test Device)
 Test whether the addressed device is ready to send or receive a byte of
data.
 Condition Code is set to indicate the result of this test.
 If CC is <, the device is ready.
If CC is =, the device is not ready.
 RD (Read Data)
 For reading data from I/O device.
 WD (Write Data)
 For writing data to I/O device.
- Programmed I/O
 Devices may input or output data while CPU is busy with other works
 Three instructions are provided for handling programmed I/O
SIO – Start I/O
HIO – Halt I/O
TIO – Test I/O
 Addressing Modes
- Refers to way in which the operand of an instruction is specified.
- Instruction format 3 and 4 introduce addressing mode flag bits.
- Format 3
3 bytes / 24 bits

- Format 4
4 bytes / 32 bits

Flag e:
e=0, Format 3
e=1, Format 4
Flag p:
p=1, Program Counter Relative Addressing
Flag b:
b=1, Base Register Relative Addressing
Flag x:
x=1, Indexing (uses index register)
Flag i:
i=1, Immediate Addressing
Flag n:
n=1, Indirect Addressing
 Immediate Addressing Mode
 i=1, n=0
 Operand is directly given in the instruction
 No memory reference
 Direct Addressing mode
 b=0, p=0
 Address of operand is provided in the instruction
 Indirect Addressing Mode
 i=0, n=1
 The word at the location given by the target address is fetched. The value
contained in this word is taken as the address of the operand value.
 Base Register Relative Addressing
 b=1, p=0
 Operand will be available at the location obtained by adding the content of
Base register and the value of displacement field.
 Target Address calculation
TA = [B] + disp
 Program Counter Relative Addressing
 b=0, p=1
 Operand will be available at the location obtained by adding the content of
Program Counter and the value of displacement field.
 Target Address calculation
TA = [PC] + disp
 Indexed Addressing Mode
 x=1
 Content of X register is added with the address/disp for the target address
calculation
 TA = Address/disp + [X]
 Indexed Addressing Mode can be combined with PC Relative and Base
Relative Addressing Modes. In this case, content of X register is also added
for the target address calculation.
 Simple Addressing Mode
 i=0, n=0 or i=1, n=1
 Value of address filed is the location of the operand.
- Example:
opcode n i x b p e Displacement/address
1 000000 1 1 0 0 1 0 0110 0000 0000
2 000000 1 1 1 1 0 0 0011 0000 0000
3 000000 1 0 0 0 1 0 0000 0011 0000
4 000000 0 1 0 0 0 0 0000 0011 0000
5 000000 1 1 0 0 0 1 0000 1100 0011 0000 0011
[B] = 006000
[PC] = 003000
[X] = 000090
03600 3030

103000 3600

00C303 6390

003030 C303

000000 is the code for the instruction LDA which means Load Accumulator
1) n=1, i=1 – Simple Addressing
b=0, p=1 – PC Relative Addressing
e=0 – Format 3
TA = [PC] + disp = 03000 + 600 = 3600
[3600] = 103000
So, [A] = 103000
2) n=1, i=1 – Simple Addressing
x=1 – Indexed Addressing
b=1, p=0 – Base Relative Addressing
e=0 – Format 3
TA = [B] + disp + [X] = 6000 + 300 + 90 = 6390
[6390] = 00C303
So, [A] = 00C303
3) n=1, i=0 – Indirect Addressing
b=0, p=1 – PC Relative
e=0 – Format 3
TA = [PC] + disp = 003000 + 030 = 3030
[3030] = 3600
[3600] = 103000
So, [A] = 103000
4) n=0, i=1 – Immediate Addressing
e=0 – Format 3
disp = 30
So, [A] = 30
5) e=1 – Format 4
n=1, i=1 – Simple Addressing
address = 0C303
[0C303] = 3030
So, [A] = 3030

Assembler Directives
- Pseudo Instructions
- Provide instruction to assembler itself
- Not translated to machine operation code
 START – Specify name and starting address of program
 END – Indicate end of the source program and specify first executable statement in
the program
 BYTE – Generate character or hexadecimal constant
 WORD – Generate one word integer constant
 RESB – Reserves the indicated number of bytes for data area.
 RESW – Reserves the indicated number of words for data area.

You might also like