0% found this document useful (0 votes)
8 views36 pages

Chapter1 Sys SW

The document provides an introduction to system programming, focusing on system software, machine architecture, and the Simplified Instructional Computer (SIC) and its extended version (SIC/XE). It explains the roles of various system software components, such as compilers, loaders, and debuggers, and distinguishes between traditional CISC and RISC machines. Additionally, it details the architecture, instruction sets, and programming examples for both SIC and SIC/XE.

Uploaded by

Chú Báo Hồng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views36 pages

Chapter1 Sys SW

The document provides an introduction to system programming, focusing on system software, machine architecture, and the Simplified Instructional Computer (SIC) and its extended version (SIC/XE). It explains the roles of various system software components, such as compilers, loaders, and debuggers, and distinguishes between traditional CISC and RISC machines. Additionally, it details the architecture, instruction sets, and programming examples for both SIC and SIC/XE.

Uploaded by

Chú Báo Hồng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

System Programming

System Software:
An Introduction to Systems Programming

Leland L. Beck
3rd Edition
Addison-Wesley, 1997
1
Chapter 1
Background

2
Outline
 Introduction
 System Software and Machine Architecture
 The Simplified Instructional Computer (SIC)
 SIC Machine Architecture
 SIC/XE Machine Architecture
 SIC Programming Examples
 Traditional (CISC) Machines
 RISC Machines

3
1.1 Introduction
 System Software consists of a variety of programs that
support the operation of a computer.
 The programs implemented in either software and (or)
firmware that makes the computer hardware usable.
 The software makes it possible for the users to focus on
an application or other problem to be solved, without
needing to know the details of how the machine works
internally.
 Firmware: software that is programmed into chips.
Example: BIOS (Basic Input Output System)

4
1.2 System Software and Machine Architecture
 System Software vs Application
 One characteristic in which most system software
differs from application software is machine
dependency.
 System programs are intended to support the operation
and use of the computer itself, rather than any
particular application.
 Examples of system software
 Text editor, assembler, compiler, loader or linker,
debugger, macro processors, operating system,
database management systems, software engineering
tools, …

5
1.2 System Software and Machine Architecture

 Text editor
 Creates and modifies the program
 Compiler and assembler
 Translates these programs into machine language
 Loader or linker
 The resulting machine program is loaded into memory
and prepared for execution. Linker combines all object
files and creates a single executable file.
 Debugger
 Helps detect errors in the program

6
System Software Concept
Users

Application Program

Utility Program
Debugger Macro Processor Text Editor
(Library)

Complier Assembler Loader and Linker

OS
Memory Process Device Information
Management Management Management Management

Bare Machine (Computer)

7
System Software and Machine Architecture
 Machine dependent
 Instruction Set, Instruction Format, Addressing Mode,
Assembly language …
 Machine independent
 General design logic/strategy, Two passes
assembler…

Machine independent
Machine Dependent

Computer

8
1.3 The Simplified Instructional Computer (SIC)
 Like many other products, SIC comes in two
versions
 The standard model
 An XE version
 “extra equipments”, “extra expensive”
 The two versions have been designed to be
upward compatible
 SIC (Simplified Instructional Computer)
 SIC/XE (Extra Equipment)

9
1.3 The Simplified Instructional Computer
 SIC
 Upward compatible
 Memory consists of 8-bit bytes, 3 consecutive bytes
form a word (24 bits)
 There are a total of 32768 bytes (32 KB) in the
computer memory.
 5 registers, 24 bits in length
 A 0 Accumulator
 X 1 Index register
 L 2 Linkage register (JSUB)
 PC 8 Program counter
 SW 9 Status word (Condition Code)

10
1.3.1 SIC Machine Architecture
 Data Formats
 Integers are stored as 24-bit binary number
 2’s complement representation for negative values
 Characters are stored using 8-bit ASCII codes
 No floating-point hardware on the standard version of
SIC

11
Instruction Cycle
 CPU
 Control Unit (CU)
 Arithmetic and Logic Unit (ALU)
 Register
 Instruction Cycle
 Fetch Cycle
 Execution Cycle

Fetch Fetch
Decoder Computation Store Result
Instruction Operand

12
1.3.1 SIC Machine Architecture
 Instruction format
 24-bit format
 The flag bit x is used to indicate indexed-addressing
mode 8 1 15
opcode x address

 Addressing Modes
 There are two addressing modes available
 Indicated by x bit in the instruction
 (X) represents the contents of reg. X

13
1.3.1 SIC Machine Architecture
 Instruction set
 Format 3
 Load and store registers (LDA, LDX, STA, STX, etc.)
 Integer arithmetic operations (ADD, SUB, MUL, DIV)
 Compare instruction (COMP)
 Conditional jump instructions (JLT, JEQ, JGT)
 JSUB jumps to the subroutine, placing the return
address in register L.
 RSUB returns by jumping to the address contained in
register L.

14
1.3.1 SIC Machine Architecture
 I/O
 I/O are performed by transferring 1 byte at a time to or
from the rightmost 8 bits of register A.
 Each device is assigned a unique 8-bit code as an
operand.
 Test Device (TD): tests whether the addressed device is
ready to send or receive
 < ready = not ready
 Read Data (RD)
 Write Data (WD)

15
1.3.2 SIC/XE Machine Architecture
 1 megabytes (1024 KB) in memory
 3 additional registers, 24 bits in length
 B 3 Base register; used for addressing
 S 4 General working register
 T 5 General working register
 1 additional register, 48 bits in length
 F 6 Floating-point accumulator (48 bits)

16
1.3.2 SIC/XE Machine Architecture
 Data format
 24-bit binary number for integer, 2’s complement for
negative values
 48-bit floating-point data type
 The exponent is between 0 and 2047
 f*2(e-1024)
 0: set all bits to 0

1 11 36

S exponent fraction

17
1.3.2 SIC/XE Machine Architecture
 Instruction formats
 Relative addressing - format 3 (e=0)
 Extend the address to 20 bits - format 4 (e=1)
 Don’t refer memory at all - formats 1 and 2

18
1.3.2 SIC/XE Machine Architecture
 Addressing modes
 n i x b p e
 Simple n=0, i=0 (SIC) or n=1, i=1
 Immediate n=0, i=1 TA=Valus
 Indirect n=1, i=0 TA=(Operand)
 Base relative b=1, p=0 TA=(B)+disp
0 <= disp <= 4095
 PC relative b=0, p=1 TA=(PC)+disp
-2048 <= disp <= 2047

19
1.3.2 SIC/XE Machine Architecture
 Addressing mode
 Direct b=0, p=0 TA=disp
 Index x=1 TAnew=TAold+(X)
 Index+Base relative x=1, b=1, p=0
TA=(B)+disp+(X)
 Index+PC relative x=1, b=0, p=1
TA=(PC)+disp+(X)
 Index+Direct x=1, b=0, p=0
 Format 4 e=1
 Appendix and Fig. 1.1 Example

20
Figure 1.1

 Memory address
 00000
(0000 0000 0000 0000 0000)

 ~FFFFF (Byte)
(1111 1111 1111 1111 1111)

21
22
1.3.2 SIC/XE Machine Architecture
 Instruction set
 Format 1, 2, 3, or 4
 Load and store registers (LDB, STB, etc.)
 Floating-point arithmetic operations (ADDF, SUBF, MULF,
DIVF)
 Register-to-register arithmetic operations (ADDR, SUBR,
MULR, DIVR)
 A special supervisor call instruction (SVC) is provided
 I/O
 1 byte at a time, TD, RD, and WD
 SIO, TIO, and HIO are used to start, test, and halt the
operation of I/O channels.
23
1.3.3 SIC Programming Examples
 Sample data movement operations
 No memory-to-memory move instructions (Fig. 1.2)
LDA five LDA #5
… …
five word 5

24
1.3.3 SIC Programming Examples

25
1.3.3 SIC Programming Examples
 Sample arithmetic operations
 (ALPHA+INCR-1) assign to BETA (Fig. 1.3)
 (GAMMA+INCR-1) assign to DELTA

26
1.3.3 SIC Programming Examples

27
1.3.3 SIC Programming Examples
 String copy

28
1.3.3 SIC Programming Examples

29
1.3.3 SIC Programming Examples

30
1.3.3 SIC Programming Examples

31
1.3.3 SIC Programming Examples

32
1.3.3 SIC Programming Examples

33
1.3.3 SIC Programming Examples

34
Traditional (CISC) Machines
 Complex Instruction Set Computers (CISC)
 complicated instruction set
 different instruction formats and lengths
 many different addressing modes
 e.g. VAX or PDP-11 from DEC
 e.g. Intel x86 family
 Reduced Instruction Set Computer (RISC)

35
RISC Machines
 RISC system
 instruction
 standard, fixed instruction format
 single-cycle execution of most instructions
 memory access is available only for load and store instruction
 other instructions are register-to-register operations
 a small number of machine instructions, and instruction format
 a large number of general-purpose registers
 a small number of addressing modes
 Three RISC machines
 SPARC family
 PowerPC family
 Cray T3E

36

You might also like