System Software by Leland L. Beck chapter 1, pp.1-20.

Презентация:



Advertisements
Похожие презентации
Loader Design Options Linkage Editors Dynamic Linking Bootstrap Loaders.
Advertisements

CEG 320/520: Computer Organization and Assembly Language Programming1 Computer Organization and Assembly Language Programming.
Lecture # Computer Architecture Computer Architecture = ISA + MO ISA stands for instruction set architecture is a logical view of computer system.
CEG 320/520: Computer Organization and Assembly Language Programming1 Assembly Language Programming Introduction and Addressing Modes.
Sequences Sequences are patterns. Each pattern or number in a sequence is called a term. The number at the start is called the first term. The term-to-term.
HPC Pipelining Parallelism is achieved by starting to execute one instruction before the previous one is finished. The simplest kind overlaps the execution.
1 Chapter 4 Macro Processors. 2 Introduction A macro instruction (abbreviated to macro) is simply a notational convenience for the programmer. A macro.
© 2005 Cisco Systems, Inc. All rights reserved.INTRO v Building a Simple Ethernet Network Understanding How an Ethernet LAN Works.
Basic Input - Output. Output functions printf() – is a library function that displays information on-screen. The statement can display a simple text message.
© 2006 Cisco Systems, Inc. All rights reserved. MPLS v Complex MPLS VPNs Introducing Central Services VPNs.
Operators and Arithmetic Operations. Operators An operator is a symbol that instructs the code to perform some operations or actions on one or more operands.
© 2006 Cisco Systems, Inc. All rights reserved. MPLS v Complex MPLS VPNs Using Advanced VRF Import and Export Features.
© 2005 Cisco Systems, Inc. All rights reserved.INTRO v Managing Your Network Environment Managing Cisco Devices.
UNIT 2. Introduction to Computer Programming. COM E 211: Basic Computer Programming UNIT 2. Introduction to Computer Programming Algorithm & Flowcharting.
Lecture 11 Computer Architecture CPU Structure and Function.
Convolutional Codes Mohammad Hanaysheh Mahdi Barhoush.
The 8085 is an 8-bit general purpose microprocessor that can address 64K Byte of memory. It has 40 pins and uses +5V for power. It can run at a maximum.
© 2005 Cisco Systems, Inc. All rights reserved.INTRO v Building a Simple Serial Network Understanding the OSI Model.
© 2009 Avaya Inc. All rights reserved.1 Chapter Two, Voic Pro Components Module Two – Actions, Variables & Conditions.
Unit II Constructor Cont… Destructor Default constructor.
Транксрипт:

System Software by Leland L. Beck chapter 1, pp.1-20.

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

Chap 1 System Software vs. Machine Architecture n Machine dependent u The most important characteristic in which most system software differ from application software u e.g. assembler translate mnemonic instructions into machine code u e.g. compilers must generate machine language code n Machine independent u There are aspects of system software that do not directly depend upon the type of computing system u e.g. general design and logic of an assembler u e.g. code optimization techniques

Chap 1 The Simplified Instructional Computer (SIC) n SIC is a hypothetical computer that includes the hardware features most often found on real machines n Two versions of SIC u standard model u extension version

Chap 1 SIC Machine Architecture (1/5) n Memory u 2 15 bytes in the computer memory u 3 consecutive bytes form a word u 8-bit bytes n Registers

Chap 1 SIC Machine Architecture (2/5) n Data Formats u Integers are stored as 24-bit binary numbers; 2s complement representation is used for negative values u No floating-point hardware n Instruction Formats n Addressing Modes opcode (8)address (15) x

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

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

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

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

SIC Programming Examples (Fig 1.2) -- Data movement ALPHA RESW1 FIVE WORD5 CHARZ BYTECZ C1 RESB1. LDAFIVE STAALPHA LDCHCHARZ STCHC1 (a) n No memory-memory move instruction n 3-byte word: u LDA, STA, LDL, STL, LDX, STX n 1-byte: u LDCH, STCH n Storage definition u WORD, RESW u BYTE, RESB

Chap 1 SIC Programming Examples (Cont.) n All arithmetic operations are performed using register A, with the result being left in register A. BETA=ALPHA+INCR-ONE DELTA=GAMMA+INCR-ONE

SIC Programming Example -- Arithmetic operation (Fig 1.3) BETA=ALPHA+INCR-ONE DELTA=GAMMA+INCR-ONE

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

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

Chap 1 SIC/XE Machine Architecture (1/4) n Memory u 2 20 bytes in the computer memory n More Registers

Chap 1 SIC/XE Machine Architecture (2/4) n Data Formats u Floating-point data type: frac*2 (exp-1024) F frac: 0~1 F exp: 0~2047 n Instruction Formats exponent (11)fraction (36) s

Chap 1 SIC/XE Machine Architecture (3/4) n How to compute TA? n How the target address is used? u Note: Indexing cannot be used with immediate or indirect addressing modes

Example of SIC/XE instructions and addressing modes

Chap 1

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

SIC/XE Programming Examples (Fig 1.2) ALPHA RESW1 FIVE WORD5 CHARZ BYTECZ C1 RESB1. LDAFIVE STAALPHA LDCHCHARZ STCHC1 (a) ALPHA RESW1 C1 RESB1. LDA#5 STAALPHA LDA#90 STCHC1 (b)

SIC/XE Programming Example -- Looping and Indexing Example (Fig 1.4)

SIC/XE Programming Example -- Looping and indexing (Fig 1.5)

Chap 1 SIC/XE Programming Example n data movement u #: immediate addressing for SIC/XE n arithmetic u ADDRS,X n Looping (TIXR T) u (X)=(X)+1 u compare with register specified u set CC n COMPRX,T

SIC Programming Example -- Sample Input and Output (Fig 1.6)

Chap 1 Homework #1 n Write a sequence of instructions for SIC/XE to set ALPHA equal to 4*BETA-9. Assume that ALPHA and BETA are defined as in Fig. 1.3 (b) n Write a sequence of instructions for SIC to set ALPHA equal to the integer portion of BETA GAMMA. Assume that ALPHA and BETA are defined as in Fig. 1.3(a)

Chap 1 Homework #2 n Please write a program for SIC/XE that contains routines. The routines read records from an input device (identified with device code F1) and copies them to an output device (code 05). This main routine calls subroutine RDREC to read a record into a buffer and subroutine ERREC to write the record from the buffer to the output device. Each subroutine must transfer the record one character at a time because the only I/O instructions available are RD and WD.

Chap 1 Homework #2 n Program copy { n save return address; n cloop: call subroutine RDREC to read one record; n if length(record)=0 { n call subroutine WRREC to write EOF; n } else { n call subroutine WRREC to write one record; n goto cloop; n } n load return address n return to caller n }

Chap 1 Homework #2 (Cont.) Subroutine RDREC { clear A, X register to 0; rloop: read character from input device to A register if not EOR { store character into buffer[X]; X++; if X < maximum length goto rloop; } store X to length(record); return } EOR: character x00

Chap 1 Homework #2 (Cont.) n Subroutine WDREC { n clear X register to 0; n wloop: get character from buffer[X] n write character from X to output device n X++; n if X < length(record) n goto wloop; n return n }

Chap 1