Chapter1 PDF
Chapter1 PDF
Hsung-Pin Chang
Department of Computer Science
National Chung Hsing University
Outline
1.1 Introduction
1.2 System Software and Machine Architecture
1.3 The Simplified Instructional Computer (SIC)
SIC Machine Architecture
SIC/XE Machine Architecture
SIC Programming Examples
1.4 Traditional (CISC) Machines
1.5 RISC Machines
1.1 Introduction
Definition: System Software
Consist of a variety of programs that support the
operation of a computer
X 1 Index register
L 2 Linkage register
PC 8 Program counter
SW 9 Status word
1.3.1 SIC Machine Architecture (Cont.)
Status Word register contents
Bit position Field name Use
0 MODE 0=user mode, 1=supervisor mode
1 IDLE 0=running, 1=idle
2~5 ID Process identifier
6~7 CC Condition code
8~11 MASK Interrupt mask
12~15 Unused
16~23 ICODE Interruption code
1.3.1 SIC Machine Architecture (Cont.)
Data Formats
Integers: stored as 24-bit binary numbers;
2’
s complement representation is used for negative values
Characters: stored as 8-bit ASCII codes
No floating-point hardware
1 11 36
s exponent fraction
6 1 1 1 1 1 1 12
Format 3 (3 bytes) op n i x b p e disp
e=0
6 1 1 1 1 1 1 20
Format 4 (4 bytes)
e=1
op n i x b p e address
1.3.2 SIC/XE Machine Architecture
(Cont.)
Addressing Modes
Base relative addressing - format 3 only
n = 1, i = 1, b=1, p=0
Program-counter relative addressing - format 3 only
n = 1, i = 1, b=0, p=1
Direct addressing –format 3 and 4
n = 1, i = 1, b=0, p=0
Indexed addressing –format 3 and 4
n = 1, i = 1, x = 1 or n = 0, i = 0, x = 1
Immediate addressing –format 3 and 4
n = 0, i = 1, x = 0 // cannot combine with indexed
Indirect addressing –format 3 and 4
n = 1, i = 0, x = 0 // cannot combine with indexed
Simple addressing –format 3 and 4
n = 0, i = 0 or n = 1, i = 1
1.3.2 SIC/XE Machine Architecture
(Cont.)
Base Relative Addressing
n i x b p e
opcode 1 1 1 0 disp
n=1, i=1, b=1, p=0, TA=(B)+disp (0disp 4095)
n i x b p e
opcode 1 1 0 0 disp/address
n i x b p e
opcode 1 1 1 disp/address
Indirect Addressing
n i x b p e
opcode 1 0 0 disp/address
n=1, i=0, x=0, TA=(disp), operand = (TA) = ((disp))
n=1, i=0, x=0, TA=(address), operand = (TA) = ((address))
1.3.2 SIC/XE Machine Architecture
(Cont.)
Simple Addressing Mode
n i x b p e
Case 1 opcode 1 1 disp/address
Format 3: i=1, n=1, TA=disp, operand = (disp)
Format 4: i=1, n=1, TA=address, operand = (address)
n i x b p e
Case 2 opcode 0 0 disp
Greater reliability
Greater reliability