Size: px
Start display at page:

Download ""

Transcription

1 Introduction SIC, RISC & CISC 0. Introduction to Systems Programming This course aims at: Understanding what is going on behind the scenes The design and implementation of system software, such as Assemblers Loaders and linkers Macro processors Operating systems 0.1 System Software and Architecture Machine dependency of system software System programs are intended to support the operation and use of the computer. Machine architecture differs in: Machine code Instruction formats Addressing mode Registers Machine independency of system software Some features like General design and logic is basically the same: Code optimization Subprogram linking In short the course consists of: Introducing a hypothetical computer (SIC) for reducing the complexity and creating uniformity for learning the concepts. The basic functions of assemblers, loaders, linkers, macro processors and operating systems Machine-dependent functions Machine-independent functions Design options (single-pass vs. multipass) Examples of implementations 1.1 Simplified Instructional Computer (SIC) and SIC/XE [Extra Equipment] 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 Standard model (SIC) and an XE version (SIC/XE) Upward compatible (Programs for SIC can run on SIC/XE) SIC Architecture Memory - byte addressable (we can access each byte) - 32 KB Registers - Five registers - A (Accumulator used for arithmetic op.) - X (Index Register used for addressing) - L (Linkage register used to store return address when JSUB instruction is called) - PC (Program Counter) - SW (Status word contains various info.) Data formats Characters: 8-bit ASCII codes Integers 24-bit binary numbers 2 s complement for negative values Floating-point numbers: Not available 1

2 Introduction SIC, RISC & CISC Instruction Formats [Format/Meaning of each bit used in the instruction. Total number of instructions and formats are fixed and predetermined by the processor designer] 24- bit format Addressing modes [How the target address is calculated] Instruction set Load and store registers LDA, LDX, STA, STX Integer arithmetic operations (involve register A and a word in memory, save result in A) ADD, SUB, MUL, DIV Comparison (involves register A and a word in memory, save result in the condition code (CC) of SW) COMP Conditional jump instructions (according to CC) JLE, JEQ, JGT Subroutine linkage JSUB (jumps and places the return address in register L) RSUB (returns to the address in L) Input and output Each IO device is assigned a unique 8- bit code One byte at a time to or from the rightmost 8 bits of register A Three instructions: Test device (TD): Test whether the device is ready to send/receive Test result is set in CC Read data (RD): read one byte from the device to register A Write data (WD): write one byte from register A to the device SIC/XE Architecture Memory: - From bytes to 1 mega bytes. Registers: - 4 additional registers - B (Base register used for addressing) - S (General working Register) - T (General working Register) - F (Floating Point accumulator 48 bits) Data formats Additional data formats available Floating-point numbers (48 bits) sign bit s fraction f: a value between 0 and 1 exponent e: unsigned binary number between 0 and 2047 Value 2

3 Introduction SIC, RISC & CISC Instruction formats Total four instruction formats 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 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 Exception: indexing cannot be used with immediate or indirect addressing modes 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 Instruction set Additional Instructions are available Load and store registers LDX, STX, LDB, STB, Integer arithmetic operations ADDF, SUBF, MULF, DIVF, ADDR, SUBR, MULR, DIVR Comparison COMP Register move RMO Supervisor call (for generating an interrupt) SVC 3

4 Introduction SIC, RISC & CISC 1.2 Real Machines :RISC & CISC Two Categories: Based on the type of the processor Complex Instruction Set Computers (CISC) Relative large and complicated instruction set, more instruction formats, instruction lengths, and addressing modes Hardware implementation is complex - More number of instructions - Complicated architecure Examples: VAX Intel x86 Reduced Instruction Set Computers (RISC) Simplified design, faster and less expensive processor development, greater reliability, faster instruction execution times - less number of instructions Examples: Sun SPARC Example 1 : VAX Architecture (CISC) Memory: 232 bytes in virtual address space consists of 8-bit bytes: word: 2 bytes longword: 4 bytes quadword: 8 bytes octaword: 16 bytes can be divided into System space (OS and shared space) Process space (defined separately for each process) 32-bit registers 16 general-purpose registers R0-R11: no special functions AP: argument pointer (address of arguments when making a procedure call) FP: frame pointer (address of the stack frame when making a procedure call) SP: stack pointer (top of stack in program s process space) PC: program counter PSL: processor status longword Control registers to support OS Data formats Characters: 8-bit ASCII codes Integers: 2, 4, 8, 16-byte binary numbers 2 s complement for negative values Floating-point numbers: 4 different floating-point data ranging in length from 4 to 16 bytes Instruction formats Variable-length instruction format Each instruction consists of OP code (1 or 2 bytes) Up to 6 operand specifiers (depends on instruction) Addressing modes Register mode Register deferred mode Autoincrement and autodecrement modes Base relative modes PC relative modes Index modes Indirect modes Immediate mode etc. Instruction set Mnemonics format (e.g., ADDW2, MULL3) Prefix: type of operation Suffix: data type of the operands Modifier: number of operands involved In addition to computation, data movement and conversion, comparison, branching, VAX provides instructions that are hardware realizations of frequently occurring sequences of codes Load and store multiple registers Manipulate queues and variable-length bit fields Powerful instructions for calling and returning from procedure Input and output Each I/O device has a set of registers, which are assigned locations in the physical address space, called I/O space. Association of these registers with addresses in I/O space is handled by memory management routines. Device driver read/write values into these registers. Software routines read/write values in I/O space using standard instructions. 4

5 Introduction SIC, RISC & CISC Example 2 :Pentium Pro Architecture (CISC) Memory: virtual memory consists of 8-bit bytes: word: 2 bytes & double-word: 4 bytes can be divided into segments with different sizes Code, data, and stack segments Each segment can be divided into pages 32-bit registers 8 general-purpose registers EAX, EBX, ECX, EDX: data manipulation ESI, EDI, EBP, ESP: addresses Data formats Characters: 8-bit ASCII codes Integers: 1, 2, 4-byte binary numbers (8-byte signed integers for FPU) 2 s complement for negative values Little-endian byte ordering Binary coded decimal (packed or unpacked BCD) Floating-point numbers: Single-precision: 32 bits Double-precision: 64 bits Extended-precision: 80 bits Instruction formats Variable-length instruction format (1-10 bytes) Each instruction consists of Optional prefixes containing flags that modify the operation of the instruction Addressing modes Immediate mode Register mode Base relative mode PC relative mode Index mode Direct mode etc. Instruction set (>400 instructions) 0, 1, 2, or 3 operands Register-to-register, register-to-memory, and memory-to-memory instructions Special-purpose instructions that are frequently required in high-level languages, e.g., entering and leaving procedures, checking the bounds of an array Input and output I/O instructions that transfer one byte, word, or double-word from an I/O device into register EAX, or vice versa. Repetition prefixes can be used to transfer an entire string in a single operation Example 3: UltraSPARC Architecture (RISC) Memory: 264 bytes in virtual address space -consists of 8-bit bytes: -can be divided into pages halfword: 2 bytes word: 4 bytes doubleword: 8 bytes Large register file (>100 general-purpose registers) 32 bits for original SPARC, 64 bits for UltraSPARC Each procedure can access only 32 registers 8 global registers 24 registers in overlapped window A file of 64 double-precision floating-point registers fro FPU. Data formats Characters: 8-bit ASCII codes Integers: 1, 2, 4, 8-byte binary numbers 2 s complement for negative values Big- and little-endian and byte ordering Floating-point numbers: Single-precision: 32 bits Double-precision: 64 bits Quad-precision: 80 bits Instruction formats Fix-length instruction format (32 bits long) Can speed the process of instruction fetching and decoding 3 basic instruction formats Call instruction Branch instruction Register loads and stores, and three-operands arithmetic operations Each instruction consists of First 2 bits: identify formats OP code & Operands Addressing modes Immediate mode Register direct mode PC relative mode only for branch instructions Register indirect with displacement Register indirect indexed Instruction set (<100 instructions) Register-to-register instructions Load and store instructions (only instructions that access memory) Instruction execution is pipelined. Input and output A range of memory locations is logically replaced by device registers. Device driver read/write values into these registers. 5

6 1.3 Assemblers Assembler converts assembly language program to machine language. Example: Assembly language Instruction: ADD loc Here ADD [Instruction], loc[address] Say value of ADD is18 (hex) & loc is 1500(hex) Machine Language equivalent of the above instruction is: or (hex) So the assembler s function can be represented using the fig. Mnemonic operation Symbolic labels Basic functions of assembler Machine language Machine addresses SIC Assembler s task: Convert mnemonic operation codes to their machine language equivalents Convert symbolic operands to their equivalent machine addresses Build machine instructions in proper format Convert data constants into internal machine representations (data formats) Write object program and the assembly listing SIC assembler directives START : Specify name and starting address for the program END : Indicate the end of the source program, and (optionally) the first executable instruction in the program. BYTE : Generate character or hexadecimal constant, occupying as many bytes as needed to represent the constant. WORD : Generate one-word integer constant RESB : Reserve the indicated number of bytes for a data area RESW : Reserve the indicated number of words for a data area A simple SIC assembler & its functions Convert mnemonic operation codes to their machine language equivalents Convert symbolic operands to their equivalent machine addresses ( normally require 2 passes) Decide the proper instruction format Convert the data constants to internal machine representations Write the object program and the assembly listing Difficult part : Convert symbolic operands to their equivalent machine addresses and we may need two passes (going through the same program twice) because of forward reference Forward reference - A reference to a label that is defined later in the program (example given in next page) Solution: 2 passes Assembler Directives Basic assembler directives (pseudo instructions): Assembler directives are not machine instructions, rather they are directions to the assembler itself. First pass: scan the source program for label definitions and assign addresses Second pass: perform actual translation 6

7 Example for SIC Assembly Program Line numbers Address Mnemonic opcode operand comment Fixed format Example for Forward Reference Forward reference 7

8 Format of the generated object program [Machine language (in hex) program input for linker/loader] Includes three records Header Col. 1 H Col. 2~7 Program name Col. 8~13 Starting address of object program (hex) Col Length of object program in bytes (hex) Text Col.1 T Col.2~7 Starting address for object code in this record (hex) Col. 8~9 Length of object code in this record in bytes (hex) Col. 10~69 Object code, represented in hex (2 col. per byte) End Col.1 E Col.2~7 Address of first executable instruction in object program (hex) Example: 1.4 Design of Two Pass SIC Assembler Pass 1 (define symbols) Assign addresses to all statements in the program Save the addresses assigned to all labels for use in Pass 2 Perform assembler directives, including those for address assignment, such as BYTE and RESW Pass 2 (assemble instructions and generate object program) Assemble instructions (generate opcode and look up addresses) Generate data values defined by BYTE, WORD Perform processing of assembler directives not done during Pass 1 Write the object program and the assembly listing Data Structures used in a two pass assembler Operation Code Table (OPTAB) Contents: Mnemonic operation codes Machine language equivalents Instruction format and length During pass 1: Validate operation codes Find the instruction length to increase LOCCTR During pass 2: Determine the instruction format Translate the operation codes to their machine language equivalents Implementation: a static hash table Symbol Table (SYMTAB) A variable accumulated for address assignment, i.e., LOCCTR gives the address of the associated label. LOCCTR is initialized to be the beginning address specified in the start statement. After each source statement is processed during pass 1, instruction length or data area is added to LOCCTR. Location Counter (LOCCTR) Contents: Label name Label address Flags (to indicate error conditions) Data type or length During pass 1: Store label name and assigned address (from LOCCTR) in SYMTAB During pass 2: Symbols used as operands are looked up in SYMTAB Implementation: a dynamic hash table for efficient insertion and retrieval Should perform well with non-random keys (LOOP1, LOOP2). Source program Pass 1 Pass 2 LOCCTR OPTAB Intermediate file SYMTAB Diagram showing different parts of an assembler Object program 8

9 Pass 1 & Pass 2 of SIC assembler [Refer Text for a clear view] (From now on we are discussing about SIC/XE Assembler features) 1.5 Machine-Dependent Assembler Features Outline: - Instruction formats and addressing modes - Program relocation Addressing modes [In which way the target address/operand value is calculated] PC-relative or Base-relative addressing usage: opcode m Indirect addressing usage: Immediate addressing usage: opcode #c Extended format usage: +opcode m Index addressing usage: opcode m,x Register-to-register instructions usage: opcode r1,r2 Benefits of SIC/XE Addressing Modes Register-to-register instructions Shorter than register-to-memory instructions No memory reference Immediate addressing mode No memory reference. The operand is already present as part of the instruction Indirect addressing mode Avoids the needs for another instruction Relative addressing mode Shorten than the extended instruction Easy program relocation Considering Instruction Formats START directive specifies a beginning program address of 0: a relocatable program. Register-to-register instructions: simply convert the mnemonic name to their number equivalents OPTAB: for opcodes SYMTAB: preloaded with register names and their values 9

10 Considering Addressing Modes PC or base relative addressing Calculate displacement Displacement must be small enough to fit in the 12-bit field ( for PC relative mode, for base relative mode) Extended instruction format (4-byte) 20-bit field for large displacements PC Relative Addressing Mode Instruction: FIRST STL RETADR 17202D LDB #LENGTH 69202D : : RETADR RESW 1 (14) (02D)16 Some Examples of using different addressing modes Immediate Addressing Mode Instruction: LDA #3 (00) (003)16 (01)16 (0)16 (003)16 Instruction: C +LDT #4096 (74) (01000)16 (75)16 (1)16 (01000)16 Extended Format Instruction: CLOOP +JSUB RDREC (48) (01036)16 (4B)16 (1)16 (01036)16 (17)16 (2)16 (02D)16 PC is advanced after each instruction is fetched and before it is executed. That is, PC contains the address of the next instruction. disp = (0030)16-(0003)16 = (002D)16 Choice of Addressing Modes 1) Programmer must specify the extended format (4-byte) by using the prefix + 2) If not, assembler first attempts PC-relative 3) If the required displacement is out of range, use base relative addressing 4) Otherwise, generate an error message Why Program Relocation It is desirable to load and run several programs at the same time To increase the productivity of the machine Want to load and run several programs at the same time (multiprogramming) Must be able to load programs into memory wherever there is room Actual starting address of the program is not known until load time Relocatable Program 10

11 What Needs to be Relocated Example: The only parts of the program that require modification at load time are those that specify direct addresses The rest of the instructions need not be modified Not a memory address (immediate addressing) PC-relative, Base-relative From the object program, it is not possible to distinguish the address and constant The assembler must keep some information to tell the loader The object program that contains the modification record is called a relocatable program The way to solve the relocation problem For an address label, its address is assigned relative to the start of the program (START 0) Produce a Modification record to store the starting location and the length of the address field to be modified. The command for the loader must also be a part of the object program Modification record One modification record for each address to be modified The length is stored in half-bytes (4 bits) The starting location is the location of the byte containing the leftmost bits of the address field to be modified. If the field contains an odd number of half- bytes, the starting location begins in the middle of the first byte. Format of Modification record Col. 1 M Col. 2-7 Starting location of the address field to be modified, relative to the beginning of the program (Hex) Col. 8-9 Length of the address field to be modified, in half-bytes (Hex) 1.6 Machine-Independent Assembler Features More related to issues about: Programmer convenience & Software environment Outline Literals Symbol Defining Statement Expressions Program Blocks Control Sections and Program Linking Literals Literal is equivalent to: Define a constant explicitly and assign an address label for it Use the label as the instruction operand Why use literals: To avoid defining the constant somewhere and making up a label for it Instead, to write the value of a constant operand as a part of the instruction How to use literals: A literal is identified with the prefix =, followed by a specification of the literal value Literal vs. Immediate Addressing Same: Operand field contains constant values Difference: Immediate addressing: the assembler put the constant value as part of the machine instruction Literal: the assembler store the constant value elsewhere and put that address as part of the machine instruction 11

12 Literal Pool All of the literal operands are gathered together into one or more literal pools. Where is the literal pool: At the end of the object program, generated immediately following the END statement At the location where the LTORG directive is encountered To keep the literal operand close to the instruction that uses it Duplicate Literals The same literal used more than once in the program Only one copy of the specified value needs to be stored For example, =X 05 in the example program How to recognize the duplicate literals Compare the character strings defining them Easier to implement, but has potential problem (see next) E.g., =X 05 Compare the generated data value Better, but will increase the complexity of the assembler E.g., =C EOF and =X 454F46 Implementation of Literal Data structure: a literal table LITTAB Literal name Operand value and length Address LITTAB is often organized as a hash table, using the literal name or value as the key Pass 1 As each literal operand is recognized Search the LITTAB for the specified literal name or value If the literal is already present, no action is needed Otherwise, the literal is added to LITTAB (store the name, value, and length, but not address) As LTORG or END is encountered Scan the LITTAB F or each literal with empty address field, assign the address and update the LOCCTR accordingly Pass 2 As each literal operand is recognized Search the LITTAB for the specified literal name or value If the literal is found, use the associated address as the operand of the instruction or Otherwise, error (should not happen) As LTORG or END is encountered insert the data values of the literals in the object program Modification record is generated if necessary Symbol-Defining Statements How to define symbols and their values Address label The label is the symbol name and the assigned address is its value FIRST STL RETADR Assembler directive EQU symbol EQU value This statement enters the symbol into SYMTAB and assigns to it the value specified The value can be a constant or an expression Assembler directive ORG ORG value Use of EQU T o improve the program readability, avoid using the magic numbers, make it easier to find and change constant values Replace +LDT #4096 with MAXLEN EQU LDT #MAXLEN Use of ORG Indirect value assignment: ORG value When ORG is encountered, the assembler resets its LOCCTR to the specified value ORG will affect the values of all labels defined until the next ORG If the previous value of LOCCTR can be automatically remembered, we can return to the normal use of LOCCTR by simply write ORG Expressions A single term as an instruction operand can be replaced by an expression. STAB RESB 1100 STAB RESB 11*100 STAB RESB (6+3+2)*MAXENTRIES The assembler has to evaluate the expression to produce a single operand address or value. Expressions consist of Operator +,-,*,/ (division is usually defined to produce an integer result) Individual terms Constants User-defined symbols Special terms, e.g., *, the current value of LOCCTR 12

13 1.6.4 Program Blocks Allow the generated machine instructions and data to appear in the object program in a different order Separating blocks for storing code, data, stack, and larger data block Example Program blocks v.s. Control sections Program blocks Segments of code that are rearranged within a single object program unit Control sections Segments of code that are translated into independent object program units Assembler directive USE for Program Block : USE [block name] At the beginning, statements are assumed to be part of the unnamed (default) block If no USE statements are included, the entire program belongs to this single block Each program block may actually contain several separate segments of the source program Assembler rearranges these segments to gather together the pieces of each block and assign address Separate the program into blocks in a particular order Large buffer area is moved to the end of the object program Program readability is better if data areas are placed in the source program close to the statements that reference them. Three blocks are used default: executable instructions CDATA: all data areas that are less in length CBLKS: all data areas that consists of larger blocks of memory 13

14 Why Program Blocks To satisfy the contradictive goals: Separate the program into blocks in a particular order Large buffer area is moved to the end of the object program Using the extended format instructions or base relative mode may be reduced. (lines 15, 35, and 65) Placement of literal pool is easier: simply put them before the large data area, CDATA block. (line 253) Data areas are scattered Program readability is better if data areas are placed in the source program close to the statements that reference them. How to Rearrange Codes into Program Blocks Pass 1 Maintain a separate LOCCTR for each program block initialized to 0 when the block is first begun saved when switching to another block restored when resuming a previous block Assign to each label an address relative to the start of the block that contains it Store the block name or number in the SYMTAB along with the assigned relative address of the label Indicate the block length as the latest value of LOCCTR for each block at the end of Pass1 Assign to each block a starting address in the object program by concatenating the program blocks in a particular order Pass 2 Calculate the address for each symbol relative to the start of the object program by adding the location of the symbol relative to the start of its block the assigned starting address of this block Object Program It is not necessary to physically rearrange the generated code in the object program to place the pieces of each program block together. The a ssembler just simply insert the proper load address in each Text record. Program Blocks Loaded in Memory Not present in object same order Rearrangement through loading Control sections can be loaded and relocated independently of the other control sections are most often used for subroutines or other logical subdivisions of a program the programmer can assemble, load, and manipulate each of these control sections separately because of this, there should be some means for linking control sections together assembler directive: CSECT secname CSECT separate location counter for each control section Program Linking in Control Sections Program linking is used to link together logically related control sections 14

15 Problem: The assembler does not know where any other control section will be located at execution time. When an instruction needs to refer to instructions or data located in another control section, the assembler is unable to process this reference. The assembler has to generate information for such kind of references, called external references, that will allow the loader to perform the required linking. As sembler Directives for Control Section START: start the first control section set program name as the control section name define the control section name as an external symbol CSECT: start a new control section specify the control section name define the control section name as an external symbol EXTDEF: define external symbols EXTREF: name symbols defined in other control sections How to Handle External References CLOOP +JSUB RDREC 4B The operand RDREC is an external reference. The assembler has no idea where RDREC is inserts an address of zero can only use extended format to provide enough room (that is, relative addressing for external reference is invalid) passes information to the loader MAXLEN WORD BUFEND-BUFFER There are two external references in the expression, BUFEND and BUFFER. The assembler inserts a value of zero passes information to the loader Add to this data area the address of BUFEND Subtract from this data area the address of BUFFER On line 107, BUFEND and BUFFER are defined i n the same control section and the expression can be calculated immediately MAXLEN EQU BUFEND-BUFFER How to Handle Control Sections The assembler processes each control section independently establishes a separate LOCCTR (initialized to 0) for each control section stores in SYMTAB the control section in which a symbol is defined allow the same symbol to be used in different control sections reports an error when attempting to refer to a symbol in another control section, unless the symbol is defined as an external reference generates information in the object program for external references New Records for External References The assembler must include information in the object program that will cause the loader to insert proper values where they are required Define record (EXTDEF) Col. 1 D Col. 2-7 Name of external symbol defined in this control section Col Relative address within this control section (hexadeccimal) Co l Repeat information in Col for other external symbols Refer record (EXTREF) Col. 1 R Col. 2-7 Name of external symbol referred to in this control section Col Name of other external reference symbols Revised Modification Record Col. 1 M Col. 2-7 Starting address of the field to be modified (hexiadecimal) Col. 8-9 Length of the field to be modified, in half- symbol whose value is to be bytes (hexadeccimal) Col External added to or subtracted from the indicated field Control section name is automatically an external symbol, i.e. it is available for use in Modification records. 15

DHANALAKSHMI SRINIVASAN INSTITUTE OF RESEARCH AND TECHNOLOGY SIRUVACHUR, PERAMBALUR DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

DHANALAKSHMI SRINIVASAN INSTITUTE OF RESEARCH AND TECHNOLOGY SIRUVACHUR, PERAMBALUR DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING DHANALAKSHMI SRINIVASAN INSTITUTE OF RESEARCH AND TECHNOLOGY SIRUVACHUR, PERAMBALUR 621113. DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS2304- SYSTEM SOFTWARE PART-B QUESTIONS 1. EXPLAIN THE ARCHITECTURE

More information

Chapter 2. Assembler Design

Chapter 2. Assembler Design Chapter 2 Assembler Design Assembler is system software which is used to convert an assembly language program to its equivalent object code. The input to the assembler is a source code written in assembly

More information

Chapter 1. Introduction

Chapter 1. Introduction Chapter 1 Introduction This Chapter gives you System Software & Machine Architecture The Simplified Instructional Computer SIC and SIC/XE Traditional (CISC) Machines - Complex Instruction Set Computers

More information

UNIT II ASSEMBLERS www.noyesengine.com www.technoscriptz.com 1 1. BASIC ASSEMBLER FUNCTIONS 2. A SIMPLE SIC ASSEMBLER 3. ASSEMBLER ALGORITHM AND DATA STRUCTURES 4. MACHINE DEPENDENT ASSEMBLER FEATURES

More information

INTERNAL TEST (SCHEME AND SOLUTION)

INTERNAL TEST (SCHEME AND SOLUTION) PES Institute of Technology, Bangalore South Campus (Formerly PES School of Engineering) (Hosur Road, 1KM before Electronic City, Bangalore-560 100) Dept of MCA INTERNAL TEST (SCHEME AND SOLUTION) 1 Subject

More information

Assemblers. System Software by Leland L. Beck. Chapter 2

Assemblers. System Software by Leland L. Beck. Chapter 2 Assemblers System Software by Leland L. Beck Chapter 2 1 Role of Assembler Source Program Assembler Object Code Linker Executable Code Loader 2 Chapter 2 -- Outline Basic Assembler Functions Machine-dependent

More information

Chapter 1: Background

Chapter 1: Background Chapter 1: Background 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

More information

Unit 2 -- Outline. Basic Assembler Functions Machine-dependent Assembler Features Machine-independent Assembler Features Assembler Design Options

Unit 2 -- Outline. Basic Assembler Functions Machine-dependent Assembler Features Machine-independent Assembler Features Assembler Design Options Unit 2 -- Outline Basic Assembler Functions Machine-dependent Assembler Features Machine-independent Assembler Features Assembler Design Options Introduction to Assemblers Fundamental functions translating

More information

Chapter 1 Background. Professor Gwan-Hwan Hwang Dept. Computer Science and Information Engineering National Taiwan Normal University

Chapter 1 Background. Professor Gwan-Hwan Hwang Dept. Computer Science and Information Engineering National Taiwan Normal University Chapter 1 Background Professor Gwan-Hwan Hwang Dept. Computer Science and Information Engineering National Taiwan Normal University 9/17/2009 1 Outlines 1.1 Introduction 1.2 System Software and Machine

More information

Gechstudentszone.wordpress.com

Gechstudentszone.wordpress.com UNIT - 1 MACHINE ARCHITECTURE 11 Introduction: The Software is set of instructions or programs written to carry out certain task on digital computers It is classified into system software and application

More information

UNIT II ASSEMBLERS. Figure Assembler

UNIT II ASSEMBLERS. Figure Assembler 2.1 Basic assembler functions UNIT II ASSEMBLERS Assembler Assembler which converts assembly language programs into object files. Object files contain a combination of machine instructions, data, and information

More information

Gechstudentszone.wordpress.com

Gechstudentszone.wordpress.com CHAPTER -2 2.1 Basic Assembler Functions: The basic assembler functions are: ASSEMBLERS-1 Translating mnemonic language code to its equivalent object code. Assigning machine addresses to symbolic labels.

More information

UNIT I - INTRODUCTION

UNIT I - INTRODUCTION UNIT I - INTRODUCTION 1. Define system software. It consists of variety of programs that supports the operation of the computer. This software makes it possible for the user to focus on the other problems

More information

Chapter 2 Assemblers Machine-Dependent Assembler Features

Chapter 2 Assemblers Machine-Dependent Assembler Features Chapter 2 Assemblers -- 2.2 Machine-Dependent Assembler Features Outline Instruction format and addressing mode Program relocation Instruction format and addressing mode PC-relative or Base-relative addressing

More information

CS2304-SYSTEM SOFTWARE 2 MARK QUESTION & ANSWERS. UNIT I INTRODUCTION

CS2304-SYSTEM SOFTWARE 2 MARK QUESTION & ANSWERS. UNIT I INTRODUCTION CS2304-SYSTEM SOFTWARE 2 MARK QUESTION & ANSWERS. UNIT I INTRODUCTION 1. Define System Software. System software consists of a variety of programs that supports the operations of a computer. Eg. Compiler,

More information

1.Program to find factorial of a given number

1.Program to find factorial of a given number 1.Program to find factorial of a given number DATA SEGMENT X DW 06H FACT DW? DATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA START: MOV AX,DATA MOV DS,AX MOV AX,01H ;Set the value of AX as 01H. MOV CX,X

More information

CS2422 Assembly Language & System Programming

CS2422 Assembly Language & System Programming CS2422 Assembly Language & System Programming November 30, 2006 Today s Topic Assembler: Basic Functions Section 2.1 of Beck s System Software book. Reading Assignment: pages 43-52. Role of Assembler Source

More information

TRB-COMPUTER INSTRUCTOR COMPUTER SCIENCE UNIT IV. SYSTEM SOFTWARE 10% DISCOUNT FOR ALL PGTRB MATERIALS WITH QUESTION BANK.

TRB-COMPUTER INSTRUCTOR COMPUTER SCIENCE UNIT IV.  SYSTEM SOFTWARE 10% DISCOUNT FOR ALL PGTRB MATERIALS WITH QUESTION BANK. N COACHING CENTRE-TRICHY- TRB- COMPUTER INSTRUCTOR-COMPUTER SCIENCE STUDY MATERIAL-CONTACT: 822006 2017 N TRB-COMPUTER INSTRUCTOR COMPUTER SCIENCE UNIT IV SYSTEM SOFTWARE 10% DISCOUNT FOR ALL PGTRB MATERIALS

More information

Chapter 3 Loaders and Linkers

Chapter 3 Loaders and Linkers Chapter 3 Loaders and Linkers Outline 3.1 Basic Loader Functions 3.2 Machine-Dependent Loader Features 3.3 Machine-Independent Loader Features 3.4 Loader Design Options 3.5 Implementation Examples Introduction

More information

Chapter 3 Loaders and Linkers

Chapter 3 Loaders and Linkers Chapter 3 Loaders and Linkers Outline 3.1 Basic Loader Functions 3.2 Machine-Dependent Loader Features 3.3 Machine-Independent Loader Features 3.4 Loader Design Options 3.5 Implementation Examples Introduction

More information

Machine dependent Assembler Features

Machine dependent Assembler Features Machine dependent Assembler Features Assembler Features Machine Dependent Assembler Features Instruction formats and addressing modes (SIC/XE) Program relocation Machine Independent Assembler Features

More information

2.1. Basic Assembler Functions:

2.1. Basic Assembler Functions: 2.1. Basic Assembler Functions: The basic assembler functions are: Translating mnemonic language code to its equivalent object code. Assigning machine addresses to symbolic labels. SOURCE PROGRAM ASSEMBLER

More information

UNIT 1: MACHINE ARCHITECTURE

UNIT 1: MACHINE ARCHITECTURE VTU QUESTION PAPER SOLUTION UNIT 1: MACHINE ARCHITECTURE 1. a) Give the target address generated for the following machine instruction: (i) 032600h (ii) 03C300h (iii) 0310C303h if (B)=006000, (PC)=003000,

More information

CS2422 Assembly Language & System Programming

CS2422 Assembly Language & System Programming CS2422 Assembly Language & System Programming December 7, 2006 Today s Topic Assembler: Machine Dependent Features SIC/XE Program Relocation Modification Records in an Object File. Study Guide Sections

More information

System Programming. System Software: An Introduction to Systems Programming. Leland L. Beck 3rd Edition Addison-Wesley, 1997

System Programming. System Software: An Introduction to Systems Programming. Leland L. Beck 3rd Edition Addison-Wesley, 1997 System Programming System Software: An Introduction to Systems Programming Leland L. Beck 3rd Edition Addison-Wesley, 1997 1 http://web.thu.edu.tw/ctyang/ 2 http://hpc.csie.thu.edu.tw/ 3 Score List Participation:

More information

Systems Programming Assemblers Part 4 Control Sections

Systems Programming Assemblers Part 4 Control Sections Systems Programming Assemblers Part 4 Control Sections Prof. Dr. Hani Mahdi Department of Computer Science Al-Isra University, Amman, Jordan 1 1 Control Sections A Control Section is a part of the program

More information

CSI 402 Lecture 5 (Assemblers Continued) 5 1 / 18

CSI 402 Lecture 5 (Assemblers Continued) 5 1 / 18 CSI 402 Lecture 5 (Assemblers Continued) 5 1 / 18 Program Relocation Example 1: Consider the SIC instruction LDA THREE Assume the following: The START directive specifies the value 100 (decimal) The LC

More information

PESIT SOUTHCAMPUS 10CS52: SYSTEM SOFTWARE QUESTION BANK

PESIT SOUTHCAMPUS 10CS52: SYSTEM SOFTWARE QUESTION BANK CS52: SYSTEM SOFTWARE QUESTION BANK Chapter1: MACHINE ARCHITECTURE OBJECTIVE: Main Objective is to Know about the system software and architecture of Various Machines Like SIC, SIC/XE and Programming examples

More information

Systems Programming Assemblers Part 3-3 Program Blocks

Systems Programming Assemblers Part 3-3 Program Blocks Systems Programming Assemblers Part 3-3 Program Blocks Prof. Dr. Hani Mahdi Department of Computer Science Al-Isra University, Amman, Jordan Assembler Design 2. Basic Assembler Functions 2.2 Machine Dependent

More information

17. Instruction Sets: Characteristics and Functions

17. Instruction Sets: Characteristics and Functions 17. Instruction Sets: Characteristics and Functions Chapter 12 Spring 2016 CS430 - Computer Architecture 1 Introduction Section 12.1, 12.2, and 12.3 pp. 406-418 Computer Designer: Machine instruction set

More information

Instruction Sets: Characteristics and Functions

Instruction Sets: Characteristics and Functions Instruction Sets: Characteristics and Functions Chapter 10 Lesson 15 Slide 1/22 Machine instruction set Computer designer: The machine instruction set provides the functional requirements for the CPU.

More information

UNIT III - LOADERS AND LINKERS

UNIT III - LOADERS AND LINKERS 3.1 Introduction to Loaders UNIT III - LOADERS AND LINKERS A loader is the part of an operating system that is responsible for loading programs into memory and prepares them for execution. Loading a program

More information

AS-2883 B.Sc.(Hon s)(fifth Semester) Examination,2013 Computer Science (PCSC-503) (System Software) [Time Allowed: Three Hours] [Maximum Marks : 30]

AS-2883 B.Sc.(Hon s)(fifth Semester) Examination,2013 Computer Science (PCSC-503) (System Software) [Time Allowed: Three Hours] [Maximum Marks : 30] AS-2883 B.Sc.(Hon s)(fifth Semester) Examination,2013 Computer Science (PCSC-503) (System Software) [Time Allowed: Three Hours] [Maximum Marks : 30] Note: Question Number 1 is compulsory. Marks : 10X1

More information

CSIS1120A. 10. Instruction Set & Addressing Mode. CSIS1120A 10. Instruction Set & Addressing Mode 1

CSIS1120A. 10. Instruction Set & Addressing Mode. CSIS1120A 10. Instruction Set & Addressing Mode 1 CSIS1120A 10. Instruction Set & Addressing Mode CSIS1120A 10. Instruction Set & Addressing Mode 1 Elements of a Machine Instruction Operation Code specifies the operation to be performed, e.g. ADD, SUB

More information

Chapter 3 Loaders and Linkers -- Machine-Dependent Loader Feature

Chapter 3 Loaders and Linkers -- Machine-Dependent Loader Feature Chapter 3 Loaders and Linkers -- Machine-Dependent Loader Feature Motivation Shortcoming of an absolute loader Programmer needs to specify the actual address at which it will be loaded into memory. It

More information

UNIT 1: MACHINE ARCHITECTURE

UNIT 1: MACHINE ARCHITECTURE VTU QUESTION PAPER SOLUTION UNIT 1: MACHINE ARCHITECTURE 1. Give the target address generated for the following machine instruction: (i) 032600h (ii) 03C300h (iii) 0310C303h if (B)=006000, (PC)=003000,

More information

Interfacing Compiler and Hardware. Computer Systems Architecture. Processor Types And Instruction Sets. What Instructions Should A Processor Offer?

Interfacing Compiler and Hardware. Computer Systems Architecture. Processor Types And Instruction Sets. What Instructions Should A Processor Offer? Interfacing Compiler and Hardware Computer Systems Architecture FORTRAN 90 program C++ program Processor Types And Sets FORTRAN 90 Compiler C++ Compiler set level Hardware 1 2 What s Should A Processor

More information

PESIT Bangalore South Campus Department of MCA Course Information for. System Programming (13MCA24)

PESIT Bangalore South Campus Department of MCA Course Information for. System Programming (13MCA24) PESIT Bangalore South Campus Department of MCA Course Information for System Programming (13MCA24) 1.GENERAL INFORMATION Academic Year: 2015 Semester(s): 2 nd Title Code Duration (hrs) Lectures 48 Hrs

More information

CS1203-SYSTEM SOFTWARE UNIT I-INTRODUCTION

CS1203-SYSTEM SOFTWARE UNIT I-INTRODUCTION CS1203-SYSTEM SOFTWARE UNIT I-INTRODUCTION 1. Define system software. It consists of variety of programs that supports the operation of the computer. This software makes it possible for the user to focus

More information

Computer Organization CS 206 T Lec# 2: Instruction Sets

Computer Organization CS 206 T Lec# 2: Instruction Sets Computer Organization CS 206 T Lec# 2: Instruction Sets Topics What is an instruction set Elements of instruction Instruction Format Instruction types Types of operations Types of operand Addressing mode

More information

Practical Malware Analysis

Practical Malware Analysis Practical Malware Analysis Ch 4: A Crash Course in x86 Disassembly Revised 1-16-7 Basic Techniques Basic static analysis Looks at malware from the outside Basic dynamic analysis Only shows you how the

More information

COMPUTER ORGANIZATION & ARCHITECTURE

COMPUTER ORGANIZATION & ARCHITECTURE COMPUTER ORGANIZATION & ARCHITECTURE Instructions Sets Architecture Lesson 5a 1 What are Instruction Sets The complete collection of instructions that are understood by a CPU Can be considered as a functional

More information

EECE416 :Microcomputer Fundamentals and Design. X86 Assembly Programming Part 1. Dr. Charles Kim

EECE416 :Microcomputer Fundamentals and Design. X86 Assembly Programming Part 1. Dr. Charles Kim EECE416 :Microcomputer Fundamentals and Design X86 Assembly Programming Part 1 Dr. Charles Kim Department of Electrical and Computer Engineering Howard University www.mwftr.com 1 Multiple Address Access

More information

Chapter 3 Loaders and Linkers

Chapter 3 Loaders and Linkers Chapter 3 Loaders and Linkers Three fundamental processes: Loading brings the object program into memory for execution. Relocation modifies the object program so that it can be loaded at an address different

More information

Module 3 Instruction Set Architecture (ISA)

Module 3 Instruction Set Architecture (ISA) Module 3 Instruction Set Architecture (ISA) I S A L E V E L E L E M E N T S O F I N S T R U C T I O N S I N S T R U C T I O N S T Y P E S N U M B E R O F A D D R E S S E S R E G I S T E R S T Y P E S O

More information

Systems Architecture I

Systems Architecture I Systems Architecture I Topics Assemblers, Linkers, and Loaders * Alternative Instruction Sets ** *This lecture was derived from material in the text (sec. 3.8-3.9). **This lecture was derived from material

More information

Lecture 4: Instruction Set Architecture

Lecture 4: Instruction Set Architecture Lecture 4: Instruction Set Architecture ISA types, register usage, memory addressing, endian and alignment, quantitative evaluation Reading: Textbook (5 th edition) Appendix A Appendix B (4 th edition)

More information

UNIT III LOADERS AND LINKERS

UNIT III LOADERS AND LINKERS UNIT III LOADERS AND LINKERS INTRODUCTION Loader is a system program that performs the loading function. Many loaders also support relocation and linking. Some systems have a linker (linkage editor) to

More information

Instruction Sets: Characteristics and Functions Addressing Modes

Instruction Sets: Characteristics and Functions Addressing Modes Instruction Sets: Characteristics and Functions Addressing Modes Chapters 10 and 11, William Stallings Computer Organization and Architecture 7 th Edition What is an Instruction Set? The complete collection

More information

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

UNIT-II. Part-2: CENTRAL PROCESSING UNIT Page1 UNIT-II Part-2: CENTRAL PROCESSING UNIT Stack Organization Instruction Formats Addressing Modes Data Transfer And Manipulation Program Control Reduced Instruction Set Computer (RISC) Introduction:

More information

Chapter 2. lw $s1,100($s2) $s1 = Memory[$s2+100] sw $s1,100($s2) Memory[$s2+100] = $s1

Chapter 2. lw $s1,100($s2) $s1 = Memory[$s2+100] sw $s1,100($s2) Memory[$s2+100] = $s1 Chapter 2 1 MIPS Instructions Instruction Meaning add $s1,$s2,$s3 $s1 = $s2 + $s3 sub $s1,$s2,$s3 $s1 = $s2 $s3 addi $s1,$s2,4 $s1 = $s2 + 4 ori $s1,$s2,4 $s2 = $s2 4 lw $s1,100($s2) $s1 = Memory[$s2+100]

More information

Machine Code and Assemblers November 6

Machine Code and Assemblers November 6 Machine Code and Assemblers November 6 CSC201 Section 002 Fall, 2000 Definitions Assembly time vs. link time vs. load time vs. run time.c file.asm file.obj file.exe file compiler assembler linker Running

More information

Math 230 Assembly Programming (AKA Computer Organization) Spring 2008

Math 230 Assembly Programming (AKA Computer Organization) Spring 2008 Math 230 Assembly Programming (AKA Computer Organization) Spring 2008 MIPS Intro II Lect 10 Feb 15, 2008 Adapted from slides developed for: Mary J. Irwin PSU CSE331 Dave Patterson s UCB CS152 M230 L10.1

More information

Instruction Sets Ch 9-10

Instruction Sets Ch 9-10 Instruction Sets Ch 9-10 Characteristics Operands Operations Addressing Instruction Formats 1 Instruction Set (käskykanta) Collection of instructions that CPU understands Only interface to CPU from outside

More information

Instruction Sets Ch 9-10

Instruction Sets Ch 9-10 Instruction Sets Ch 9-10 Characteristics Operands Operations Addressing Instruction Formats 1 Instruction Set (käskykanta) Collection of instructions that CPU understands Only interface to CPU from outside

More information

Ethical Hacking. Assembly Language Tutorial

Ethical Hacking. Assembly Language Tutorial Ethical Hacking Assembly Language Tutorial Number Systems Memory in a computer consists of numbers Computer memory does not store these numbers in decimal (base 10) Because it greatly simplifies the hardware,

More information

Review Questions. 1 The DRAM problem [5 points] Suggest a solution. 2 Big versus Little Endian Addressing [5 points]

Review Questions. 1 The DRAM problem [5 points] Suggest a solution. 2 Big versus Little Endian Addressing [5 points] Review Questions 1 The DRAM problem [5 points] Suggest a solution 2 Big versus Little Endian Addressing [5 points] Consider the 32-bit hexadecimal number 0x21d3ea7d. 1. What is the binary representation

More information

Chapter 2A Instructions: Language of the Computer

Chapter 2A Instructions: Language of the Computer Chapter 2A Instructions: Language of the Computer Copyright 2009 Elsevier, Inc. All rights reserved. Instruction Set The repertoire of instructions of a computer Different computers have different instruction

More information

Memory Models. Registers

Memory Models. Registers Memory Models Most machines have a single linear address space at the ISA level, extending from address 0 up to some maximum, often 2 32 1 bytes or 2 64 1 bytes. Some machines have separate address spaces

More information

(2½ Hours) [Total Marks: 75]

(2½ Hours) [Total Marks: 75] (2½ Hours) [Total Marks: 75] N. B.: (1) All questions are compulsory. (2) Make suitable assumptions wherever necessary and state the assumptions made. (3) Answers to the same question must be written together.

More information

Instruction Set Architecture. "Speaking with the computer"

Instruction Set Architecture. Speaking with the computer Instruction Set Architecture "Speaking with the computer" The Instruction Set Architecture Application Compiler Instr. Set Proc. Operating System I/O system Instruction Set Architecture Digital Design

More information

CPE300: Digital System Architecture and Design

CPE300: Digital System Architecture and Design CPE300: Digital System Architecture and Design Fall 2011 MW 17:30-18:45 CBC C316 RISC: The SPARC 09282011 http://www.egr.unlv.edu/~b1morris/cpe300/ 2 Outline Recap Finish Motorola MC68000 The SPARC Architecture

More information

ORG ; TWO. Assembly Language Programming

ORG ; TWO. Assembly Language Programming Dec 2 Hex 2 Bin 00000010 ORG ; TWO Assembly Language Programming OBJECTIVES this chapter enables the student to: Explain the difference between Assembly language instructions and pseudo-instructions. Identify

More information

CSCE 5610: Computer Architecture

CSCE 5610: Computer Architecture HW #1 1.3, 1.5, 1.9, 1.12 Due: Sept 12, 2018 Review: Execution time of a program Arithmetic Average, Weighted Arithmetic Average Geometric Mean Benchmarks, kernels and synthetic benchmarks Computing CPI

More information

Chapter 2 Assemblers Assembler Design Options

Chapter 2 Assemblers Assembler Design Options Chapter 2 Assemblers -- 2.4 Assembler Design Options Outline One-pass assemblers Multi-pass assemblers Two-pass assembler with overlay structure Load-and-Go Assembler Load-and-go assembler generates their

More information

Instruction Set Architecture

Instruction Set Architecture C Fortran Ada etc. Basic Java Instruction Set Architecture Compiler Assembly Language Compiler Byte Code Nizamettin AYDIN naydin@yildiz.edu.tr http://www.yildiz.edu.tr/~naydin http://akademik.bahcesehir.edu.tr/~naydin

More information

The Instruction Set. Chapter 5

The Instruction Set. Chapter 5 The Instruction Set Architecture Level(ISA) Chapter 5 1 ISA Level The ISA level l is the interface between the compilers and the hardware. (ISA level code is what a compiler outputs) 2 Memory Models An

More information

Computer Organisation CS303

Computer Organisation CS303 Computer Organisation CS303 Module Period Assignments 1 Day 1 to Day 6 1. Write a program to evaluate the arithmetic statement: X=(A-B + C * (D * E-F))/G + H*K a. Using a general register computer with

More information

Chapter 3 Machine Instructions & Programs. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Chapter 3 Machine Instructions & Programs. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan Chapter 3 Machine Instructions & Programs Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan Outline Numbers, Arithmetic Operations, and Characters Memory Locations

More information

General Purpose Processors

General Purpose Processors Calcolatori Elettronici e Sistemi Operativi Specifications Device that executes a program General Purpose Processors Program list of instructions Instructions are stored in an external memory Stored program

More information

國立嘉義大學資訊工程學系系統程式期中考考卷

國立嘉義大學資訊工程學系系統程式期中考考卷 國立嘉義大學資訊工程學系系統程式期中考考卷 學號 : 姓名 : 1. Please write the content in the lines. (25%) PROGB START EXTDEF B1, B2 EXTREF A1 LDA B1 +LDA A1 STA B1 +STA A1 B1 WORD 7 BUF RESB 1 B2 RESW 1 MAX EQU 1 END H^PROGA^^

More information

Page 1. Structure of von Nuemann machine. Instruction Set - the type of Instructions

Page 1. Structure of von Nuemann machine. Instruction Set - the type of Instructions Structure of von Nuemann machine Arithmetic and Logic Unit Input Output Equipment Main Memory Program Control Unit 1 1 Instruction Set - the type of Instructions Arithmetic + Logical (ADD, SUB, MULT, DIV,

More information

CPE300: Digital System Architecture and Design

CPE300: Digital System Architecture and Design CPE300: Digital System Architecture and Design Fall 2011 MW 17:30-18:45 CBC C316 Arithmetic Unit 10032011 http://www.egr.unlv.edu/~b1morris/cpe300/ 2 Outline Recap Chapter 3 Number Systems Fixed Point

More information

Instruction Set. Instruction Sets Ch Instruction Representation. Machine Instruction. Instruction Set Design (5) Operation types

Instruction Set. Instruction Sets Ch Instruction Representation. Machine Instruction. Instruction Set Design (5) Operation types Instruction Sets Ch 10-11 Characteristics Operands Operations Addressing Instruction Formats Instruction Set Collection of instructions that CPU understands Only interface to CPU from outside CPU executes

More information

When an instruction is initially read from memory it goes to the Instruction register.

When an instruction is initially read from memory it goes to the Instruction register. CS 320 Ch. 12 Instruction Sets Computer instructions are written in mnemonics. Mnemonics typically have a 1 to 1 correspondence between a mnemonic and the machine code. Mnemonics are the assembly language

More information

EC-801 Advanced Computer Architecture

EC-801 Advanced Computer Architecture EC-801 Advanced Computer Architecture Lecture 5 Instruction Set Architecture I Dr Hashim Ali Fall 2018 Department of Computer Science and Engineering HITEC University Taxila!1 Instruction Set Architecture

More information

CPU Structure and Function. Chapter 12, William Stallings Computer Organization and Architecture 7 th Edition

CPU Structure and Function. Chapter 12, William Stallings Computer Organization and Architecture 7 th Edition CPU Structure and Function Chapter 12, William Stallings Computer Organization and Architecture 7 th Edition CPU must: CPU Function Fetch instructions Interpret/decode instructions Fetch data Process data

More information

Assembly Language. Lecture 2 - x86 Processor Architecture. Ahmed Sallam

Assembly Language. Lecture 2 - x86 Processor Architecture. Ahmed Sallam Assembly Language Lecture 2 - x86 Processor Architecture Ahmed Sallam Introduction to the course Outcomes of Lecture 1 Always check the course website Don t forget the deadline rule!! Motivations for studying

More information

UNIT- 5. Chapter 12 Processor Structure and Function

UNIT- 5. Chapter 12 Processor Structure and Function UNIT- 5 Chapter 12 Processor Structure and Function CPU Structure CPU must: Fetch instructions Interpret instructions Fetch data Process data Write data CPU With Systems Bus CPU Internal Structure Registers

More information

Outline. What Makes a Good ISA? Programmability. Implementability

Outline. What Makes a Good ISA? Programmability. Implementability Outline Instruction Sets in General MIPS Assembly Programming Other Instruction Sets Goals of ISA Design RISC vs. CISC Intel x86 (IA-32) What Makes a Good ISA? Programmability Easy to express programs

More information

Announcements HW1 is due on this Friday (Sept 12th) Appendix A is very helpful to HW1. Check out system calls

Announcements HW1 is due on this Friday (Sept 12th) Appendix A is very helpful to HW1. Check out system calls Announcements HW1 is due on this Friday (Sept 12 th ) Appendix A is very helpful to HW1. Check out system calls on Page A-48. Ask TA (Liquan chen: liquan@ece.rutgers.edu) about homework related questions.

More information

Hardware and Software Architecture. Chapter 2

Hardware and Software Architecture. Chapter 2 Hardware and Software Architecture Chapter 2 1 Basic Components The x86 processor communicates with main memory and I/O devices via buses Data bus for transferring data Address bus for the address of a

More information

Communicating with People (2.8)

Communicating with People (2.8) Communicating with People (2.8) For communication Use characters and strings Characters 8-bit (one byte) data for ASCII lb $t0, 0($sp) ; load byte Load a byte from memory, placing it in the rightmost 8-bits

More information

EC 413 Computer Organization

EC 413 Computer Organization EC 413 Computer Organization Review I Prof. Michel A. Kinsy Computing: The Art of Abstraction Application Algorithm Programming Language Operating System/Virtual Machine Instruction Set Architecture (ISA)

More information

Basic Execution Environment

Basic Execution Environment Basic Execution Environment 3 CHAPTER 3 BASIC EXECUTION ENVIRONMENT This chapter describes the basic execution environment of an Intel Architecture processor as seen by assembly-language programmers.

More information

Lecture 15 Intel Manual, Vol. 1, Chapter 3. Fri, Mar 6, Hampden-Sydney College. The x86 Architecture. Robb T. Koether. Overview of the x86

Lecture 15 Intel Manual, Vol. 1, Chapter 3. Fri, Mar 6, Hampden-Sydney College. The x86 Architecture. Robb T. Koether. Overview of the x86 Lecture 15 Intel Manual, Vol. 1, Chapter 3 Hampden-Sydney College Fri, Mar 6, 2009 Outline 1 2 Overview See the reference IA-32 Intel Software Developer s Manual Volume 1: Basic, Chapter 3. Instructions

More information

Computer Organization & Assembly Language Programming

Computer Organization & Assembly Language Programming Computer Organization & Assembly Language Programming CSE 2312-002 (Fall 2011) Lecture 8 ISA & Data Types & Instruction Formats Junzhou Huang, Ph.D. Department of Computer Science and Engineering Fall

More information

Loaders. Systems Programming. Outline. Basic Loader Functions

Loaders. Systems Programming. Outline. Basic Loader Functions Loaders Systems Programming Chapter 3 Linkers and Loaders A loader is a system program that performs the loading function. many also support relocation & linking others have a separate linker and loader

More information

Instruction Set Design

Instruction Set Design Instruction Set Design software instruction set hardware CPE442 Lec 3 ISA.1 Instruction Set Architecture Programmer's View ADD SUBTRACT AND OR COMPARE... 01010 01110 10011 10001 11010... CPU Memory I/O

More information

CENG3420 Lecture 03 Review

CENG3420 Lecture 03 Review CENG3420 Lecture 03 Review Bei Yu byu@cse.cuhk.edu.hk 2017 Spring 1 / 38 CISC vs. RISC Complex Instruction Set Computer (CISC) Lots of instructions of variable size, very memory optimal, typically less

More information

Computer Processors. Part 2. Components of a Processor. Execution Unit The ALU. Execution Unit. The Brains of the Box. Processors. Execution Unit (EU)

Computer Processors. Part 2. Components of a Processor. Execution Unit The ALU. Execution Unit. The Brains of the Box. Processors. Execution Unit (EU) Part 2 Computer Processors Processors The Brains of the Box Computer Processors Components of a Processor The Central Processing Unit (CPU) is the most complex part of a computer In fact, it is the computer

More information

We briefly explain an instruction cycle now, before proceeding with the details of addressing modes.

We briefly explain an instruction cycle now, before proceeding with the details of addressing modes. Addressing Modes This is an important feature of computers. We start with the known fact that many instructions have to include addresses; the instructions should be short, but addresses tend to be long.

More information

Computer System Architecture

Computer System Architecture CSC 203 1.5 Computer System Architecture Department of Statistics and Computer Science University of Sri Jayewardenepura Instruction Set Architecture (ISA) Level 2 Introduction 3 Instruction Set Architecture

More information

CS4617 Computer Architecture

CS4617 Computer Architecture 1/27 CS4617 Computer Architecture Lecture 7: Instruction Set Architectures Dr J Vaughan October 1, 2014 2/27 ISA Classification Stack architecture: operands on top of stack Accumulator architecture: 1

More information

William Stallings Computer Organization and Architecture 8 th Edition. Chapter 12 Processor Structure and Function

William Stallings Computer Organization and Architecture 8 th Edition. Chapter 12 Processor Structure and Function William Stallings Computer Organization and Architecture 8 th Edition Chapter 12 Processor Structure and Function CPU Structure CPU must: Fetch instructions Interpret instructions Fetch data Process data

More information

Summary: Direct Code Generation

Summary: Direct Code Generation Summary: Direct Code Generation 1 Direct Code Generation Code generation involves the generation of the target representation (object code) from the annotated parse tree (or Abstract Syntactic Tree, AST)

More information

Representation of Information

Representation of Information Representation of Information CS61, Lecture 2 Prof. Stephen Chong September 6, 2011 Announcements Assignment 1 released Posted on http://cs61.seas.harvard.edu/ Due one week from today, Tuesday 13 Sept

More information

Computer Organization MIPS ISA

Computer Organization MIPS ISA CPE 335 Computer Organization MIPS ISA Dr. Iyad Jafar Adapted from Dr. Gheith Abandah Slides http://www.abandah.com/gheith/courses/cpe335_s08/index.html CPE 232 MIPS ISA 1 (vonneumann) Processor Organization

More information

Chapter 1 Microprocessor architecture ECE 3120 Dr. Mohamed Mahmoud http://iweb.tntech.edu/mmahmoud/ mmahmoud@tntech.edu Outline 1.1 Computer hardware organization 1.1.1 Number System 1.1.2 Computer hardware

More information

3.1 DATA MOVEMENT INSTRUCTIONS 45

3.1 DATA MOVEMENT INSTRUCTIONS 45 3.1.1 General-Purpose Data Movement s 45 3.1.2 Stack Manipulation... 46 3.1.3 Type Conversion... 48 3.2.1 Addition and Subtraction... 51 3.1 DATA MOVEMENT INSTRUCTIONS 45 MOV (Move) transfers a byte, word,

More information