SS-unit 1
SS-unit 1
SS-unit 1
REFERENCE BOOKS
Dhamdhere D M, “Systems programming and operating systems”, Tata
McGraw-Hill, Reprint 2006.
Unit 1:Introduction
Background
What does a computer system consists of?
Hardware
Software
Data
User
Background
Software are of 2 types. What are they?
System Software
Application Software
Background
Application Software:
◦ Operating Systems
Kernel
User Interface – Graphical and Command Line
◦ Utility Software
analyse, configure, optimize and maintain the computer.
Problem
Definition Program Coding Compile
*.OBJ
Library
DIFFERENT STEPS INVOLVED IN USING
ASSEMBLY LANGUAGE
◦ Machine Architecture
◦ Instruction formats
◦ Addressing modes
◦ The number of registers
◦ The type of registers
◦ OS – Management of all the resources
System Software and Machine
Architecture
Upward compatible.
Programs for SIC can run on SIC/XE.
SIC Machine Architecture
Memory
Registers
Data Formats
Instruction Formats
Addressing Modes
Instruction Set
Input and Output
SIC Machine Architecture
Memory:
◦ 8 – bit bytes.
◦ 3 consecutive bytes form a word (24 bits).
◦ There are 215 bytes in the computer memory,
that is 32,768 bytes .
◦ It uses Little Endian format to store the
numbers.
SIC Machine Architecture
Registers:
◦ There are five registers, each 24 bits in length.
Mnemonic Number Special Use
0 0 x 1 0 0 0
Effective address (EA) = 1000
Content of the address 1000 is loaded to Accumulator.
SIC Machine Architecture
5 4 X 1 0 0 0
◦ Subroutine Linkage:
◦ Additional Registers.
0100 1100
4 C
Format 2 (2 bytes) –
opcode r1 r2
8 4 4
Eg – COMPR A,S
A S
opcode n i x b p e displacement
6 bit 12 bit
6 bit 12 bit
Format 4 (4 bytes) –
opcode n i x b p e address
6 bit 20 bit
4 0 1 0 3 6
SIC / XE Machine Architecture
Addressing Modes:
6 1 1 1 1 1 1 12
Op n i x b p e disp
SIC / XE Machine Architecture
Relative (either b or p equal to 1 and the
other one to 0):
6 1 1 1 1 1 1 12
Op n i x b p e disp
SIC / XE Machine Architecture
Immediate (i = 1, n = 0):
6 1 1 1 1 1 1 12
Op n i x b p e disp
SIC / XE Machine Architecture
6 1 1 1 1 1 1 12
Indirect (i = 0, n = 1): Op n i x b p e disp
Indexed (x = 1): 6 1 1 1 1 1 1 12
Op n i x b p e disp
SIC / XE Machine Architecture
e = 1 means format 4.
6 1 1 1 1 1 1 12
Op n i x b p e disp
SIC / XE Machine Architecture
Bits i and n: Says, how to use the target
address. (Indirect i=0, n=1 / Immediate
i=1, n=0)
6 1 1 1 1 1 1 12
Op n i x b p e disp
SIC / XE Machine Architecture
b and p - both set to 0, disp field from
format 3 instruction is taken to be the
target address. (Direct)
6 1 1 1 1 1 1 12
Op n i x b p e disp
SIC / XE Machine Architecture
x - x is set to 1, X register value is added for
target address calculation.
ALPHA RESW 1
BETA RESW 1
GAMMA RESW 1
Write a sequence of instructions for SIC
to set ALPHA equal to the product of
BETA and GAMMA.
LDA BETA
MUL GAMMA
STA ALPHA
BETA RESW 1
GAMMA RESW 1
ALPHA RESW 1
Write SIC instructions to swap the
values of ALPHA and BETA.
LDA ALPHA
STA GAMMA
LDA BETA
STA ALPHA
LDA GAMMA
STA BETA
ALPHA RESW 1
BETA RESW 1
GAMMA RESW 1
Write a sequence of instructions
for SIC / XE to set ALPHA equal
to 4 * BETA – 9. Use immediate
addressing for the constants.
LDA BETA
LDS #4
MULR S,A
SUB #9
STA ALPHA
ALPHA RESW 1
BETA RESW 1
Write a sequence of instructions
in SIC to clear a 20-byte string to
all blanks.
LDX ZERO ;INITIALIZE INDEX REGISTER TO ZERO
LDCH CHR ;STORE BLANK IN REGISTER A