CS2304 Unit - 1
CS2304 Unit - 1
INTRODUCTION
What is system software?
System software consists of a variety of programs that support the
operation of a computer.
System programs were developed to make computers better adapted
to the needs of their users.
It allows us to focus on application without knowing details of
machine.
Examples of system software are text editor, compiler, loader or
linker, debugger, macro processor, operating system etc.
Text editor is used to create and modify the program.
Compiler translate the user program into machine
language
Loaders are system programs that prepare machine
language programs for execution
Debugger helps to detect errors in the program.
A translator is used to translate the assembly code into
machine code. This translator is called an assembler.
The most important system software is the OS, which is an integrated
system of programs that manages the system resources, and provides various
support services such as the computer executing the application programs of
users
LALITHAMBIGAI.B Page 1
SYSTEM SOFTWARE ( CS 2304) UNIT - I
Machine dependency
LALITHAMBIGAI.B Page 2
SYSTEM SOFTWARE ( CS 2304) UNIT - I
Machine independency
There are some aspects of system software that do not directly depend
upon the type of computing system being supported.
LALITHAMBIGAI.B Page 4
SYSTEM SOFTWARE ( CS 2304) UNIT - I
Registers
There are five registers each is 24 bits in length.
The following table indicates the numbers, mnemonics and uses of these registers
Mnemonics Number Special Use
A 0 Accumulator, used for
arithmetic operation
X 1 Index register, used for
addressing
L 2 Linkage register, the
Jump to Subroutine
(JSUB) instruction
stores the return address
in this register.
PC 8 Program Counter,
contains the address of
the next instruction to
be fetched for
execution.
SW 9 Status word, contains a
variety of information,
including a condition
code (CC)
The numbering scheme has been chosen for compatibility with the XE
version of SIC. i.e., number 3 to 7 is used by SIC / XE.
Data formats
Integers are stored as 24-bit binary number
Negative values are represented as 2’s compliment representation.
LALITHAMBIGAI.B Page 5
SYSTEM SOFTWARE ( CS 2304) UNIT - I
Instruction formats
All machine instructions on the standard version of SIC have
the 24-bit format as follows:
8 1 15
Opcode X Address
Addressing modes
There are two addressing modes available, by setting the x bit of
the instruction. They are:
Mode Indication Target Address
Calculation
1. Direct X=0 TA = address
2. Indexed X=1 TA = address + (X)
(Parenthesis are used to
indicate the contents of
a register or memory
location)
(X) – Content of Index register
Instruction Set
SIC provides a basic set of instructions that are sufficient for most
simple tasks. It includes:
LALITHAMBIGAI.B Page 6
SYSTEM SOFTWARE ( CS 2304) UNIT - I
Arithmetic instructions
ADD, SUB, MUL, DIV
(Ex) ADD WORD (Adds register A with memory WORD and result is
stored in A)
Comparison instruction
COMP
(ex) COMP WORD (Compares the value in register A with WORD and sets
condition code CC to indicate the result <, = or >)
Registers
LALITHAMBIGAI.B Page 8
SYSTEM SOFTWARE ( CS 2304) UNIT - I
Data formats
1 11 36
S Exponent fraction
Instruction formats
LALITHAMBIGAI.B Page 9
SYSTEM SOFTWARE ( CS 2304) UNIT - I
Format (1 byte)
Format ( 2 bytes)
Format (3 bytes)
Format ( 4 bytes)
Format 1 (1 byte):
op {8}
Format 2 (2 bytes):
op {8} r1 r2
{4} {4}
Format 3 (3 bytes):
Format 4 (4 bytes):
Flag x:
x=1 Indexed addressing add contents of X register to TA calculation
Flag e:
e=0 use Format 3
e=1 use Format 4
28 (256) I/O devices may be attached, each has its own unique 8-bit
address
1 byte of data will be transferred to/from the rightmost 8 bits of
register A
LALITHAMBIGAI.B Page 11
SYSTEM SOFTWARE ( CS 2304) UNIT - I
SIC/XE Has capability for programmed I/O (I/O device may input/output
data while CPU does other work) - 3 additional instructions are provided:
SIO Start I/O
HIO Halt I/O
TIO Test I/O .
Example Programs
LDA FIVE
STA ALPHA
LDCH CHARZ
STCH C1
.
ALPHA RESW 1
FIVE WORD 5
CHARZ BYTE C’Z’
C1 RESB 1
LDA ALPHA
ADD INCR
SUB ONE
STA BEETA
……..
……..
……..
……..
LALITHAMBIGAI.B Page 12
SYSTEM SOFTWARE ( CS 2304) UNIT - I
ONE WORD 1
ALPHA RESW 1
BEETA RESW 1
INCR RESW 1
LALITHAMBIGAI.B Page 13
SYSTEM SOFTWARE ( CS 2304) UNIT - I
LDX ZERO
CLOOP TD INDEV
JEQ CLOOP
RD INDEV
STCH RECORD, X
TIX B200
JLT CLOOP
.
.
INDEV BYTE X ‘F5’
RECORD RESB 200
ZERO WORD 0
B200 WORD 200
LDA #5
STA ALPHA
LDA #90
STCH C1 .
.
LALITHAMBIGAI.B Page 14
SYSTEM SOFTWARE ( CS 2304) UNIT - I
ALPHA RESW 1
C1 RESB 1
Arithmetic operations
LDS INCR
LDA ALPHA
ADD S,A
SUB #1
STA BETA
………….
…………..
ALPHA RESW 1
BEETA RESW 1
INCR RESW 1
LDT #11
LDX #0 : X=0
MOVECH LDCH STR1, X : LOAD A FROM STR1
STCH STR2, X : STORE A TO STR2
TIXR T : ADD 1 TO X, TEST (T)
JLT MOVECH
……….
……….
………
STR1 BYTE C ‘HELLO WORLD’
STR2 RESB 11
LALITHAMBIGAI.B Page 15
SYSTEM SOFTWARE ( CS 2304) UNIT - I
JLT CLOOP
.
.
INDEV BYTE X ‘F5’
RECORD RESB 200
JSUB READ
……….
……….
READ LDT #200
LDX #0
CLOOP TD INDEV
JEQ CLOOP
RD INDEV
STCH RECORD, X
TIXR T : add 1 to index compare T
JLT CLOOP
RSUB
……..
……..
INDEV BYTE X ‘F5’
RECORD RESB 200
LALITHAMBIGAI.B Page 16