Module 1 Comments
Module 1 Comments
MODULE I
SYLLABUS
INTRODUCTION : System Software Vs. Application Software, Different System
Software– Assembler, Linker, Loader, Macro Processor, Text Editor, Debugger, Device
Driver, Compiler, Interpreter, Operating System(Basic Concepts only)
SIC & SIC/XE ARCHITECTURE: Addressing modes, SIC & SIC/XE Instruction set,
Assembler Directives and Programming.
INTRODUCTION
Computer Software
A computer cannot do anything on its own. It must be instructed to do a job. So its
necessary to specify a sequence of instructions that a computer must perform to solve a
problem. Such a sequence of instructions written in a language understood by a computer is
called a computer program. Computer software is the collection of computer programs and
related data that provide instructions telling a computer what to do. Software is divided into 2
types:
1. System Software
2. Application Software
1. System Software
System Software is a set of programs that manages and supports the operation of a
computer. It controls the computer system and enhances its performance. It enables the
application software to interact with the system hardware. That is system software act as a
bridge between application software and computer hardware. Eg: Operating System,
Compiler etc. System software can be broadly classified into 3 types:
i. System Control Programs
ii. System Support Programs
iii. System Development Programs
i.System Control Programs: controls the execution of programs, manage the storage and
processing resources of the computer and perform other management and monitoring
functions. Eg: Operating System, Database Management Systems(DBMS).
Page 1
CS303 System Software Module 1
ii. System Support Programs: provide routine service functions to the other computer
programs and computer users. Eg: utilities, libraries
System Development Programs: assists in the creation of application programs. Eg:
Language translators like compiler, assembler.
I. Application Software:
Application software consists of programs designed to perform specific tasks for
users. .Eg: Media player, Ms. Word, Notepad etc. There are 2 types of application software:
i. General Purpose Application Software: These provide general user needs, not for a
specific purpose. Eg: Spreadsheet program like Microsoft Excel, which can be used to
perform different applications.
ii. Special Purpose(Custom) Application Software: Typically used for specific
applications. Eg: Turbo Tax, which is a special purpose application used to perform tax
returns.
Application Software
System Software
Computer Hardware
System software control and manages hardware thereby providing a platform for
application software to operate. Application software helps user to accomplish one or more
tasks using a computer through system software. For an application to run on a computer it
needs to be allocate space from memory, allocated resources (CPU time, hardware like
keyboard, display, printer etc), given access to system libraries, all of which is done by
operating system which is a system software.
Page 2
CS303 System Software Module 1
Page 3
CS303 System Software Module 1
7. Operating Systems
8. Database Management Systems(DBMS)
1. Language Translators
It is the program that takes an input program in one language and produces an output
in another language.
a. Compiler
A compiler is a program that translates programs written in any high level language
(source program) into its equivalent machine language program(target language). An
important role of the compiler is to report any errors in the source program that it detects
during the translation process.
b. Interpreter
An interpreter is also a language translator which converts source program in high
level language into machine language, just like compiler did. It reads the source code one
line at a time, converts this line into machine code and executes it. The machine code is then
discarded and next line is processed. It stops translating after the first error.
Compilers, on the other hand, translates the entire program in one go and then
executes it. Compiler analyse the entire program, displays where errors have occurred. If
errors are present, then program cannot run.
Page 4
CS303 System Software Module 1
Interpreter works as follows. The interpreter reads the source program and stores it in
memory. Program counter (PC) indicates which statement of the source program is to be
interpreted next. During interpretation, it takes a source statement, determines its meaning
and performs the actions and PC is incremented. The interpretation cycle consists of the
following steps:
Fetch the statement.
Analyze the statement and determine its meaning.
Execute the meaning of the statement.
Advantages of interpreter:
Easier to use particularly for beginners, since errors are immediately displayed.
.Disdvantage of interpreter:
Every line has to be translated every time it is executed, even if it is executed many times
as the program runs. Because of this interpreters tend to be slow.
Example for interpreters: Basic on older home computers, script interpreters such as
JavaScript.
c. Assembler
Assembler converts assembly language program into its equivalent machine
language.
A macro processor is a program that 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 a macro. A simple example is the C language pre-processor:
Page 5
CS303 System Software Module 1
The C prerocessor reads the first line and stores it as macro definition. When it comes
across the later reference of max in the for loop, it replaces with the macro definition 100.
The output of the C processor is then fed to the C compiler.
2. Linker
A linker is a program that combines object modules to form an executable program.
Many programming languages allow us to write different pieces of code, called modules,
separately. This simplifies the programming task because we can break a large program into
small, more manageable pieces. Eventually, though, we need to put all the modules together.
This is the job of the linker. In addition to combining modules, a linker also replaces
symbolic addresses with real addresses. Therefore, we may need to link a program even if it
contains only one module.
3. Loader
A loader is the part of an operating system that is responsible for loading programs. It
is one of the essential stages in the process of starting a program, as it places programs into
memory and prepares them for execution. Loading a program involves reading the contents of
the executable file containing the program instructions into memory, and then carrying out
other required preparatory tasks to prepare the executable for running. Once loading is
complete, the operating system starts the program by passing control to the loaded program
code.
Page 6
CS303 System Software Module 1
4.Text Editors
A text editor is a type of program used for editing plain text files. Text editors are
often provided with operating systems or software development packages. Example for text
editors are Microsoft word, gedit in Linux etc.
5.Debuggers
6.Device Drivers
7.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.
Page 7
CS303 System Software Module 1
Page 8
CS303 System Software Module 1
• XE version
Memory
Registers
SIC machines have 5 registers, each 24 bits long and having both a numeric and
character representation. The registers are:
• A (0): Used for basic arithmetic operations; known as the accumulator register.
• X (1): Used for addressing; known as the index register.
• L (2): Used for storing the return address of the jump of subroutine
instructions(JSUB); known as the linkage register.
• PC (8): Contains the address of the next instruction to be executed; known as the
program counter register.
• SW (9): Contains a variety of information, (such as carry or overflow flags)including
a condition code(CC); known as the status word register.
(In the representation A(0) – A is the character representation for the accumulator register
and 0 is the numeric representation. Similarly for other registers.)
Data formats
• Integers are 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.
• SIC do not support floating point data items.
Page 9
CS303 System Software Module 1
Instruction Formats
• All machine instructions are of 24-bits length. It has following format:
Instruction Set
It includes instructions like:
1. Load and Store Registers (Data movement instruction)
Ex: LDA, STA, LDX, STX.
LDA – Load Accumulator, STA – Store the content of Accumulator to
specified location
LDX – Load X Register, STX – Store the content of X Register to specified
location
Page 10
CS303 System Software Module 1
This involves register A and a word in memory, with the result being left in
the A register.
3. Compare Instruction
Ex: COMP
Instruction COMP compares a value in A with a word in memory, and sets
the condition code CC to indicate the result of <, > and =.
1. 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
2. RD (Read Data)
- for reading data
3. WD (Write Data)
- for writing data
Page 11
CS303 System Software Module 1
• A program needing to transfer data must wait until the device is ready, then execute
RD or WD.
• This sequence must be repeated for each byte of data to be read or written.
Memory
• It consists of bytes(8 bits)
• Any 3 consecutive bytes form a word(24 bits) which are addressed by the location of
their lowest numbered byte.
• There are totally 220=1,048,576bytes (1 Mbyte) in memory.
Registers
Data formats
• Integers are 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.
• SIC/XE supports floating point data items. Floating point is stored in 48 bit signed-
exponent-fraction format
Page 12
CS303 System Software Module 1
• The fraction is represented as a 36 bit number and has value between 0 and 1
• The exponent is represented as a 11 bit unsigned binary number between 0 and 2047.
• The sign of the floating point number is indicated by s : 0=positive, 1=negative.
• Therefore, the absolute floating point number value is: f*2(e-1024)
Instruction Format
Page 13
CS303 System Software Module 1
Instruction Set
SIC/XE supports all of the instructions that are available on standard SIC. SIC/XE
supports following instructions:
1. Load and Store Registers (Data movement instruction)
Ex: LDCH, STCH, LDB, STB.
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
4. Compare Instruction
Ex: COMP
Instruction COMP compares a value in A with a word in memory, and sets
the condition code CC to indicate the result of <, > and =.
Page 14
CS303 System Software Module 1
3. WD (Write Data)
- for writing data
• A program needing to transfer data must wait until the device is ready, then execute
RD or WD.
• This sequence must be repeated for each byte of data to be read or written.
Page 15
CS303 System Software Module 1
• SIC/XE has capability for programmed I/O. Programmed I/O means I/O devices may
input or output data while CPU is busy with other works.3 instructions are provided
for handling programmed I/O features:
SIO - Start I/O
HIO - Halt I/O
TIO - Test I/O
Addressing Modes
The term addressing modes refers to the way in which the operand of an instruction is
specified. Instruction format 3 and 4 introduce addressing mode flag bits.
Flag e:
e=0 use Format 3
e=1 use Format 4
Flag p – indicates Program counter relative addressing
Flag b - indicates Base register relative addressing
Flag x – indicates indexing. (uses index register)
Flag i – indicates immediate addressing
Flag n – indicates indirect addressing
1. Indexed Addressing Mode
If x=1, then it indicates indexed addressing mode.
In this addressing mode, the content of x register is added with address/disp for the
target address calculation.
TA=address +(X)
Indexed addressing mode can be combined with PC relative and Base relative
addressing mode. In this case, the content of X register is also added for the target
address calculation.
Page 16
CS303 System Software Module 1
Page 17
CS303 System Software Module 1
TA = (PC)+disp
Indexed addressing mode can be combined with PC relative addressing mode. In this
case, the content of X register is also added for the target address calculation.
TA = (PC)+(X)+disp
TA=(B)+disp
Indexed addressing mode can be combined with Base relative addressing mode. In
this case, the content of X register is also added for the target address calculation.
TA = (B)+(X)+disp
Page 18
CS303 System Software Module 1
Page 19
CS303 System Software Module 1
4. RESB
Used to reserves specified byte for a data area.
Eg: A RESB 5
This is to reserve 5 bytes.
5. WORD
Used to generate one word integer constant
Eg: B WORD 6
This uses one word to store the integer constant 6 and the name B is assigned
to the first location
6. BYTE
Generate character constant using required number of bytes
Eg: ALPHA BYTE C ‘HAI’
This generates number of bytes needed to store HAI.
Page 20
CS303 System Software Module 1
Page 21
CS303 System Software Module 1
…
…
STR1 BYTE C’TEST STRING’ 11 byte string constant
STR2 RESB 11 11 byte variable
Page 22
CS303 System Software Module 1
-For the detailed explanation of program please go through the text book. (System Software –
An Introduction to Systems Programming – Leland L. Beck, page number 12 to 20)
Page 23