Sie sind auf Seite 1von 30

Chapter 1 Background

Professor Gwan-Hwan Hwang Dept. Computer Science and Information Engineering National Taiwan Normal University 9/17/2009

Outlines
1.1 Introduction 1.2 System Software and Machine Architecture p p (SIC) ) 1.3 The Simplified Instructional Computer (
SIC Machine Architecture SIC/XE Machine Architecture S C/ ac e c ec u e SIC Programming Examples

1 4 Traditional (CISC) Machines 1.4 1.5 RISC Machines


2

Introduction
Definition of System software
System software consists of a variety of programs that support the operation of a computer t

Examples
Text editor, compiler, loader or linker, debugger, macro processors, operating system, database management systems, software engineering tools, etc.
3

System Software and Machine Architecture


One characteristic in which most system software differs from application software is p y machine dependency System programs are intended to support the operation and use of the computer itself itself, rather than any particular application.
E.g. Assemblers, compilers, operating systems
4

System Software and Machine Architecture (Cont d) (Contd)


There are some aspects of system software that do not directly depend upon the type of p g y g pp computing system being supported
The second para. of Section 1.2

System Software and Machine Architecture (Cont d) (Contd)


Because most system software is machinedependent, we must include real machines d d t ti l d l hi and real pieces of software in our study. Simplified Instructional Computer (SIC)
SIC is a hypothetical computer that has been yp p carefully designed to include the hardware features most often found on real machines, while avoiding unusual or irrelevant complexities
6

The Simplified Instructional Computer (SIC)


Like many other products, SIC comes in two versions i
The standard model An XE version
extra equipments, extra expensive

The two versions has been designed to be upward compatible


An object program for the standard SIC machine will also execute properly on a SIC/XE system
7

SIC Machine Architecture


Memory
Memory consists of 8-bit bytes Any 3 consecutive bytes form a word (24 bits) Total of 32768 (215) bytes in the computer memory

SIC Machine Architecture (Cont d) (Contd)


Registers g
Five registers Each register is 24 bits in length Mnemonic A X L PC SW Number 0 1 2 8 9 Special use
Accumulator Index register Linkage register Program counter Status word
9

SIC Machine Architecture (Contd)


Data Formats
Integers are stored as 24-bit binary number 2s complement representation for negative 2s values Characters are stored using 8-bit ASCII codes 8 bit No floating-point hardware on the standard version of SIC i f

10

SIC Machine Architecture (Contd)


Instruction Formats
Standard version of SIC 24 bits

8 opcode

1 x

15 address

The flag bit x is used to indicate indexed-addressing mode

11

SIC Machine Architecture (Contd)


Addressing Modes
There are two addressing modes available
Indicated by x bit in the instruction Mode Direct Indexed Indication x=0 x 1 x=1 Target address calculation TA=address TA address+(X) TA=address+(X)

( ) (X): the contents of register X g


12

SIC Machine Architecture (Contd)


Instruction Set
Load and store registers
LDA LDX STA STX etc. LDA, LDX, STA, STX,

Integer arithmetic operations


ADD, SUB, MUL, DIV All arithmetic operations involve register A and a word in memory, with the result being left in A

COMP Conditional jump instructions


JLT, JEQ, JGT

Subroutine linkage
JSUB, RSUB

See appendix A, Pages 495-498


13

SIC Machine Architecture (Contd)


Input and Output
Input and output are performed by transferring 1 byte at a time to or from the rightmost 8 bits y g of register A
Test Device TD instruction Read Data (RD) Write Data (WD) ( )

14

SIC/XE Machine Architecture


Memory
Maximum memory available on a SIC/XE system is 1 megabyte ( 20 bytes) y g y (2 y )

15

SIC/XE Machine Architecture (Contd)


Registers
Additional registers are provided by SIC/XE Mnemonic Number Special use Base register B 3 S T F 4 5 6
General working register General working register Floating-point accumulator (48 bits) gp ( )
16

SIC/XE Machine Architecture (Contd)


There is a 48-bit floating-point data type
1 11 s exponent 36 fraction F*2(e-1024)

17

S C/ SIC/XE Machine Architecture (Contd) c e c ec u e (Co d)


Instruction Formats
15 bits in (SIC), 20 bits in (SIC/XE) 8 op 8 op 4 r1 4 r2

Format 1 (1 b ) F byte)

Format 2 (2 bytes)

Formats 1 and 2 are i d instructions that do not reference memory at all i h d f ll


18

SIC/XE Machine Architecture (Contd)


Format 3 (3 bytes)

6 op 6 op
Mode Base relative Program-counter relative

1 11111
n i x b p e Format 4 (5 bytes)

12 disp 20 address
Target address calculation TA=(B)+disp (0disp 4095) TA=(PC)+disp (-2048disp 2047)
19

1 11111
n i x b p e Indication b=1,p=0 b=1 p=0 b=0,p=1 p

SIC/XE Machine Architecture (Contd)


Instruction Formats
See Figure 1.1, P. 11.

20

21

SIC/XE Machine Architecture (Contd)


Instruction Set
I t ti Instructions to load and store the new registers t l d d t th it
LDB, STB, etc.

Floating-point arithmetic operations Floating point


ADDF, SUBF, MULF, DIVF

Register move instruction


RMO

Register-to-register arithmetic operations


ADDR SUBR MULR DIVR ADDR, SUBR, MULR,

Supervisor call instruction


SVC
22

SIC/XE Machine Architecture (Contd)


Input and Output
There are I/O channels that can be used to p perform input and output while the CPU is p p executing other instructions

23

SIC Programming Examples


Figure 1.2
Sample data movement operations

Figure 1.3
Sample arithmetic operations

Figure 1.4
Sample looping and indexing operations

Figure 1.5
Sample looping and indexing operations

Figure 1.6
I/O

Figure 1.7
Subroutine call
24

25

26

27

28

29

30

Das könnte Ihnen auch gefallen