Chih-Hung Wang Chapter 1: Background (Part-1) 參考書目 Leland L. Beck, System Software: An Introduction to Systems Programming (3rd), Addison-Wesley, 1997.

Slides:



Advertisements
Similar presentations
Introduction – This book introduces to the design and implementation of System Software
Advertisements

Chapter Outline Chapter 1 of Beck’s “System Software” book
System Programming Design and Implementation of system software.
Chapter 8: Central Processing Unit
Princess Sumaya Univ. Computer Engineering Dept. Chapter 2: IT Students.
系 統 程 式 System Programming
Welcome to Systems Software The purpose of this course is to provide background in fundamental types of system software, particularly assemblers, loaders,
1 System Programming System Software, pp Chia-Hui Chang, Assistant Professor Dept. of Computer Science & Information Engineering National Central.
The Simplified Instructional Computer (SIC/SICXE)
1: Background1 System Programming ( 系統程式 ) Main goal: r What is a system software? m Compiler m Assembler m Loader and Linker m Debugger… r To design and.
Simplified Instructional Computer (SIC). SIC Architecture Two versions: SIC and SIC/XE (extra equipments). SIC program can be executed on SIC/XE. Memory.
SYSTEM SOFTWARE Dr.A.KANNAN, PROFESSOR & HEAD, DEPARTMENT OF IST CS2304.
Machine-Dependent Assembler Features (SIC/XE Assembler) Instruction Formats, Addressing Modes, and Program Relocation.
System Software by Leland L. Beck chapter 1, pp.1-20.
Chapter 1 Background System Software Chih-Shun Hsu
1 Chapter 1 Background Professor Gwan-Hwan Hwang Dept. Computer Science and Information Engineering National Taiwan Normal University 9/17/2009.
1 The Simplified Instructional Computer (SIC) Hsiang-Fu Yu National Taipei University of Education.
System Programming System Software:
System Software.
System Software by Leland L. Beck chapter 1, pp.1-20.
Chapter 6: Machine dependent Assembler Features
System Programming Chih-Hung Wang Chapter 1: Background (Part-1) 參考書目
Chih-Hung Wang Chapter 2: Assembler (Part-1) 參考書目 Leland L. Beck, System Software: An Introduction to Systems Programming (3rd), Addison-Wesley, 1997.
System Programming System Software:
State Machines Used to Design Sequential Circuits.
Assembler (Basic Functions)
Background. Outlines Brief introduction to system software System software and machine architecture Simplified Instructional Computer (SIC) –Architecture.
A Simple Two-Pass Assembler
Machine Instruction Characteristics
Chapter 4 MARIE: An Introduction to a Simple Computer.
Advanced Computer Architecture 0 Lecture # 1 Introduction by Husnain Sherazi.
Lecture 14 Today’s topics MARIE Architecture Registers Buses
1 Assemblers System Programming by Leland L. Beck Chapter 2.
CS 111 – Sept. 15 Chapter 2 – Manipulating data by performing instructions “What is going on in the CPU?” Commitment: –Please read through section 2.3.
2 : Assembler 1 Chapter II: Assembler Chapter goal: r Introduce the fundamental functions that any assembler must perform. m Assign machine address m Translate.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
What is a program? A sequence of steps
Instruction Sets: Characteristics and Functions  Software and Hardware interface Machine Instruction Characteristics Types of Operands Types of Operations.
CC410: System Programming Dr. Manal Helal – Fall 2014 – Lecture 10 – Loaders.
CPIT Program Execution. Today, general-purpose computers use a set of instructions called a program to process data. A computer executes the.
CPS4200 System Programming Spring 1 Systems Programming Chapter 1 Background I.
CC410: System Programming Dr. Manal Helal – Fall 2014 – Lecture 4 - Assembler 1.
Computer Architecture. Instruction Set “The collection of different instructions that the processor can execute it”. Usually represented by assembly codes,
김길용 교수 분산처리연구실 시스템 프로그래밍 김길용 교수 분산처리연구실
Machine dependent Assembler Features
Immediate Addressing Mode
MIPS Instruction Set Advantages
CC410: System Programming
Prof . Ki-Dong Chung Pusan Nat’l University
System Programming and administration
CHAPTER 6: The Little Man Computer
System Programming Design and Implementation of system software.
System Software by Leland L. Beck Chapter 2
SYSTEM SOFTWARE - UNIT II
THE sic mACHINE CSCI/CMPE 3334 David Egle.
Assemblers - 2 CSCI/CMPE 3334 David Egle.
Simplified Instructional Computer (SIC)
Chapter 1 Background Professor Gwan-Hwan Hwang
ECEG-3202 Computer Architecture and Organization
Simplified Instructional Computer (SIC)
ultraSPARC과 SIC/XE Machine 비교
A Simple Two-Pass Assembler
System Programming by Leland L. Beck Chapter 2
ECEG-3202 Computer Architecture and Organization
Assemblers CSCI/CMPE 3334 David Egle.
Welcome to Systems Software
Chapter 6 Programming the basic computer
SYSTEM SOFTWARE CS2304 Dr.A.KANNAN, PROFESSOR & HEAD,
Lecture 1: SIC Architecture
Presentation transcript:

Chih-Hung Wang Chapter 1: Background (Part-1) 參考書目 Leland L. Beck, System Software: An Introduction to Systems Programming (3rd), Addison-Wesley,

Outline of Chapter 1  System Software and Machine Architecture  The Simplified Instructional Computer (SIC)  Traditional (CISC) Machines  Complex Instruction Set Computers  RISC Machines  Reduced Instruction Set Computers 2

System Software vs. Machine Architecture  Machine dependent  The most important characteristic in which most system software differ from application software  e.g. assembler translate mnemonic instructions into machine code  e.g. compilers must generate machine language code  Machine architecture differs in:  Machine code  Instruction formats  Addressing mode  Registers  Machine independent  There are aspects of system software that do not directly depend upon the type of computing system  e.g. general design and logic of an assembler  e.g. code optimization techniques 3

System Software and Architecture  System software will be discussed:  The basic functions  Machine-dependent functions  Machine-independent functions  Design options (single-pass vs. multi-pass)  Examples of implementations 4

The Simplified Instructional Computer (SIC)  SIC is a hypothetical computer that includes the hardware features most often found on real machines.  Why the simplified instructional computer  To avoid various unique features and idiosyncrasies of a particular machine.  To focus on central, fundamental, and commonly encountered features and concepts.  Two versions of SIC  standard model (SIC)  extension version (SIC/XE)  Upward compatible  Programs for SIC can run on SIC/XE 5

SIC Machine Architecture (1/5)  Memory  2 15 (32,768) bytes in the computer memory  3 consecutive bytes form a word  8-bit bytes  Registers 6

SIC Machine Architecture (2/5)  Data Formats  Integers are stored as 24-bit binary numbers; 2’s complement representation is used for negative values  No floating-point hardware  Instruction Formats  Addressing Modes 7 x: indicate indexed-addressing mode () are used to indicate the content of a register.

SIC Machine Architecture (3/5)  Instruction Set  load and store: LDA, LDX, STA, STX, etc.  integer arithmetic operations: ADD, SUB, MUL, DIV, etc.  All arithmetic operations involve register A and a word in memory, with the result being left in the register  comparison: COMP  COMP compares the value in register A with a word in memory, this instruction sets a condition code CC to indicate the result 8

SIC Machine Architecture (4/5)  Instruction Set  conditional jump instructions: JLT, JEQ, JGT  these instructions test the setting of CC and jump accordingly  subroutine linkage: JSUB, RSUB  JSUB jumps to the subroutine, placing the return address in register L  RSUB returns by jumping to the address contained in register L 9

SIC Machine Architecture (5/5)  Input and Output  Input and output are performed by transferring 1 byte at a time to or from the rightmost 8 bits of register A  The Test Device (TD) instruction tests whether the addressed device is ready to send or receive a byte of data  Read Data (RD)  Write Data (WD) 10

SIC Programming Examples  Data movement Fig. 1.2  Arithmetic operation Fig. 1.3  Looping and indexing Fig. 1.4, Fig. 1.5  Input and output Fig. 1.6  Subroutine call Fig

SIC Programming Examples (Fig 1.2)-- Data movement 12 Assembler directives for defining storage Address labels

SIC Programming Example -- Arithmetic operation (Fig 1.3) BETA=ALPHA+INCR-ONE DELTA=GAMMA+INCR-ONE 13 All arithmetic operations are performed using register A, with the result being left in register A.

SIC Programming Example -- Looping and indexing (Fig. 1.4) 14

SIC Programming Example -- Looping and indexing (Fig. 1.5)  Arithmetic  Arithmetic operations are performed using register A, with the result being left in register A  Looping (TIX)  (X)=(X)+1  compare with operand  set CC GAMMA[I]=ALPHA[I]+BETA[I] I=0 to

SIC/XE Machine Architecture (1)  Memory  2 20 bytes in the computer memory  More Registers 16

SIC/XE Machine Architecture (2)  Data Formats  Floating-point data type: frac*2 (exp-1024)  frac: 0~1  exp: 0~ For normalized floating-point numbers, the high-order bit must be 1.

SIC/XE Machine Architecture (3)  Instruction formats No memory reference Relative addressing Extended address field for target address calculation SIC e=0 e=1 18

SIC/XE Machine Architecture (4)  Addressing modes:  two new relative addressing for format 3  Direct addressing for formats 3 and 4 if b=p=0  Indexed addressing can be combined if x=1:  the term (x) should be added 19

SIC/XE Machine Architecture (5)  Bits x,b,p,e: how to calculate the target address  relative, direct, and indexed addressing modes  Bits i and n: how to use the target address (TA)  i=1, n=0: immediate addressing  TA is used as the operand value, no memory reference  i=0, n=1: indirect addressing  The word at the TA is fetched  Value in this word is taken as the address of the operand value  i=0, n=0 (in SIC), or  i=1, n=1 (in SIC/XE): simple addressing  TA is taken as the address of the operand value  Any of these addressing modes can also be combined with indexed addressing. 20

SIC/XE Machine Architecture (6)  For upward compatibility  8-bit binary codes for all SIC instructions end in 00  If n=i=0, bits b,p,e are considered as part of the 15-bit address field 21

SIC/XE Machine Architecture (7)  How to compute TA?  How the target address is used?  Note: Indexing cannot be used with immediate or indirect addressing modes 22

SIC/XE Machine Architecture (8)  Instruction Set  new registers: LDB, STB, etc.  floating-point arithmetic: ADDF, SUBF, MULF, DIVF  register move: RMO  register-register arithmetic: ADDR, SUBR, MULR, DIVR  supervisor call: SVC  generates an interrupt for OS (Chap 6)  Input/Output  SIO, TIO, HIO: start, test, halt the operation of I/O device (Chap 6) 23

SIC/XE Machine Architecture (9)  Example. RSUB  Example. COMPR A, S  Example. LDA #3 (Format 3) 24

SIC/XE Machine Architecture (10)  Example. +JSUB RDREC (Format 4)  Example STX LENGTH 25

SIC/XE Machine Architecture (11)  Example STL RETADR  Example. LDA LENGTH (direct addressing) 26

SIC/XE Machine Architecture (12)  Example. STCH BUFFER, X  Example. LDA #9 27 [B]=0033 disp=3

SIC/XE Machine Architecture (13)  Example. 002A (indirect addressing) 28

c: constant between 0 and 4095 m: memory address or constant larger than 4095 S:Compatible with SIC A: Relative addressing D: Direct addressing 4: Format 4 SIC/XE Machine Architecture (14) 29

SIC/XE Machine Architecture (15) 30

SIC/XE Machine Architecture (16)  Instruction set  Load and store registers  LDA, LDX, STA, STX, LDB, STB, …  Integer arithmetic operations  ADD, SUB, MUL, DIV, ADDF, SUBF, MULF, DIVF, ADDR, SUBR, MULR, DIVR  Comparison COMP  Conditional jump instructions (according to CC)  JLE, JEQ, JGT  Subroutine linkage  JSUB  RSUB  Register move  RMO  Supervisor call (for generating an interrupt)  SVC 31

SIC/XE Machine Architecture (17)  Input and output  IO device  Three instructions:  Test device (TD)  Read data (RD)  Write data (WD)  IO channels  Perform IO while CPU is executing other instructions  Three instructions:  SIO: start the operation of IO channel  TIO: test the operation of IO channel  HIO: halt the operation of IO channel 32

SIC/XE Machine Architecture (18): I/O Mechanisms  Polling I/O  Interrupt-Driven I/O  DMA (Direct Memory Access) I/O 33

SIC/XE Instruction Set P: privileged X: only for XE F: floating- point C: set CC 34

for interrupt 35

36

Set Storage Key for memory protection 37

38

SIC/XE Programming Example (1) 39

SIC/XE Programming Example (2) 40

SIC/XE Programming Example (3) 41

SIC/XE Programming Example (4) 42