Machine Dependent Assembler Features

Slides:



Advertisements
Similar presentations
Instruction Set Design
Advertisements

ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson slides3.ppt Modification date: March 16, Addressing Modes The methods used in machine instructions.
3. Loaders & Linkers1 Chapter III: Loaders and Linkers Chapter goal: r To realize how a source program be loaded into memory m Loading m Relocation m Linking.
Machine Independent Assembler Features
Machine-Dependent Assembler Features (SIC/XE Assembler) Instruction Formats, Addressing Modes, and Program Relocation.
1 The Simplified Instructional Computer (SIC) Hsiang-Fu Yu National Taipei University of Education.
Chapter 6: Machine dependent Assembler Features
Chih-Hung Wang Chapter 2: Assembler (Full) 參考書目 Leland L. Beck, System Software: An Introduction to Systems Programming (3rd), Addison-Wesley,
System Software by Leland L. Beck Chapter 2
Chapter 2 Assemblers Assembler Linker Source Program Object Code
Assembler – Machine Dependent Features
1 Chapter 2 Assemblers Source Program Assembler Object Code Loader.
CS2422 Assembly Language and System Programming Machine Dependent Assembler Features Department of Computer Science National Tsing Hua University.
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
CS2422 Assembly Language & System Programming December 7, 2006.
Pentium Addressing Modes
Machine-Independent Assembler Features
Chapter 11 Instruction Sets: Addressing Modes and Formats HW: 11.4, 5, 13, 16 (Due 11/15)
Assembler – Machine Independent Features. Literals Design idea  Let programmers to be able to write the value of a constant operand as a part of the.
CS2422 Assembly Language & System Programming December 14, 2006.
Part II: Addressing Modes
ADDRESSING MODES OF Addressing Modes of  To perform any operation, we have to give the corresponding instructions to the microprocessor.
UNIT II ASSEMBLERS.
Computer Architecture and the Fetch-Execute Cycle
Memory and Addressing How and Where Information is Stored.
What is System Software? -a program that manages and supports the computer resources - manages operations of a computer system while it executes various.
1 Assemblers System Software by Leland L. Beck Chapter 2.
Assemblers System Software by Leland L. Beck Chapter 2.
Instruction Set Architecture The portion of the machine visible to the programmer Issues: Internal storage model Addressing modes Operations Operands Encoding.
Machine-Independent Assembler Features Literals, Symbol-Defining Statements, Expressions, Program Blocks, Control Sections and Program Linking.
2 : Assembler 1 Chapter II: Assembler Chapter goal: r Introduce the fundamental functions that any assembler must perform. m Assign machine address m Translate.
1 Assemblers System Software by Leland L. Beck Chapter 2.
ECEG-3202 Computer Architecture and Organization Chapter 6 Instruction Sets: Addressing Modes and Formats.
Machine Independent Assembler Features
Instruction Sets: Addressing modes and Formats Group #4  Eloy Reyes  Rafael Arevalo  Julio Hernandez  Humood Aljassar Computer Design EEL 4709c Prof:
G.Umamaheswari Lect/IT R.M.D.EC system software
Assemblers System Software by Leland L. Beck Chapter 2.
Assemblers Two functions: – Mnemonic opcode  Machine Code – Symbolic labels  machine addresses (in memory) Some features: – Depend on assembly language.
Assemblers System Software.
Computer Organization Instructions Language of The Computer (MIPS) 2.
Linking Loader untuk SIC/XE Machine. Lebih Lanjut mengenai Absolute Loader Shortcoming of an absolute loader –Programmer needs to specify the actual address.
CC410: System Programming Dr. Manal Helal – Fall 2014 – Lecture 10 – Loaders.
1 Contents: 3.1 Instruction format and Addressing Modes 3.2 Instruction Introduction Chapter 3 Instruction system.
CC410: System Programming Dr. Manal Helal – Fall 2014 – Lecture 9 - Assembler 4.
ADHIPARASAKTHI ENGINEERING COLLEGE
CC410: System Programming
Displacement (Indexed) Stack
Machine dependent Assembler Features
Addressing Modes in Microprocessors
Immediate Addressing Mode
CC410: System Programming
Machine Independent Assembler Features
Chapter 11 Instruction Sets
System Software by Leland L. Beck Chapter 2
SYSTEM SOFTWARE - UNIT II
Machine Independent Assembler Features
William Stallings Computer Organization and Architecture 8th Edition
THE sic mACHINE CSCI/CMPE 3334 David Egle.
Assemblers - 2 CSCI/CMPE 3334 David Egle.
MIPS Instruction Encoding
ECEG-3202 Computer Architecture and Organization
MIPS Instruction Encoding
Computer Architecture
Classification of instructions
Machine Independent Assembler Features
Loaders and Linkers.
Machine Independent Assembler Features
William Stallings Computer Organization and Architecture 8 th Edition Chapter 11 Instruction Sets: Addressing Modes and Formats.
Presentation transcript:

Machine Dependent Assembler Features Instruction Format and Addressing Mode PC-relative or Base-relative addressing: op m Indirect addressing: op @m Immediate addressing: op #c Extended format: +op m Index addressing: op m,x register-to-register instructions larger memory -> multi-programming (program allocation)

Translation Register translation Address translation register name (A, X, L, B, S, T, F, PC, SW) and their values (0,1, 2, 3, 4, 5, 6, 8, 9) preloaded in SYMTAB Address translation Most register-memory instructions use program counter relative or base relative addressing Format 3: 12-bit address field base-relative: 0~4095 pc-relative: -2048~2047 Format 4: 20-bit address field pc-relative first

Relative Addressing Modes PC-relative e.g. 10 0000 FIRST STL RETADR 17202D displacement= RETADR - PC = 30-3 = 2D e.g. 40 0017 J CLOOP 3F2FEC displacement= CLOOP - PC = 6 - 1A = -14 = FEC Base-relative base register is under the control of the programmer e.g. 12 LDB #LENGTH e.g. 13 BASE LENGTH e.g. 160 104E STCH BUFFER, X 57C003 displacement= BUFFER - B = 0036 - 0033 = 3 NOBASE is used to inform the assembler that the contents of the base register no longer be relied upon for addressing

Address Translation Immediate addressing e.g. 55 0020 LDA #3 010003 e.g. 133 103C +LDT #4096 75101000 e.g. 12 0003 LDB #LENGTH 69202D the immediate operand is the symbol LENGTH the address of this symbol LENGTH is loaded into register B LENGTH=0033=PC+displacement=0006+02D if immediate mode is specified, the target address becomes the operand

Address Translation (Cont.) Indirect addressing target addressing is computed as usual (PC-relative or BASE-relative) only the n bit is set to 1 e.g. 70 002A J @RETADR 3E2003

Program Relocation Example Fig. 2.1 Example Fig. 2.5: Absolute program, starting address 1000 e.g. 55 101B LDA THREE 00102D Relocate the program to 2000 e.g. 55 101B LDA THREE 00202D Each Absolute address should be modified Example Fig. 2.5: Except for absolute address, the rest of the instructions need not be modified not a memory address (immediate addressing) PC-relative, Base-relative The only parts of the program that require modification at load time are those that specify direct addresses

Example

Relocatable Program Modification record Col 1 M Col 2-7 Starting location of the address field to be modified, relative to the beginning of the program Col 8-9 length of the address field to be modified, in half- bytes

Object Code