LA Load Address.

Slides:



Advertisements
Similar presentations
Loading Multiple Base Registers. Programmer Responsibilities Tell the assembler which registers to choose when creating base/displacement addresses X.
Advertisements

Instruction Set Design
The Microprocessor and its Architecture
CS 31003: Compilers Introduction to Phases of Compiler.
Fall EE 333 Lillevik 333f06-l4 University of Portland School of Engineering Computer Organization Lecture 4 Assembly language programming ALU and.
CEG 320/520: Computer Organization and Assembly Language Programming1 Assembly Language Programming Machine Code Hand Assembly.
2.3) Example of program execution 1. instruction  B25 8 Op-code B means to change the value of the program counter if the contents of the indicated register.
Some thoughts: If it is too good to be true, it isn’t. Success is temporary. It is hard work to make it simple. Knowing you did it right is enough reward.
The Structure of the CPU
Computer Organization and Architecture Tutorial 2 Kenneth Lee.
CS 300 – Lecture 6 Intro to Computer Architecture / Assembly Language Instructions.
ADDRESSING MODES OF Addressing Modes of  To perform any operation, we have to give the corresponding instructions to the microprocessor.
Assembly & Machine Languages
Fetch Execute Cycle Travis Griffiths. Naming Conventions and Disclaimer Individual registers in a particular CPU will have different names depending on.
Computer Science 210 Computer Organization The von Neumann Architecture.
Important Concepts  Parts of the CPU  Arithmetic/Logic Unit  Control Unit  Registers  Program Counter  Instruction Register  Fetch/Decode/Execute.
Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.
Memory Addressing Techniques. Immediate Addressing involves storing data in pairs with immediate values register pairs:
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
Multiplication Facts Table of Contents 0’s 1’s 2’s 3’s 4’s 5’s 6’s 7’s 8’s 9’s 10’s.
More on Pipelining 1 CSE 2312 Computer Organization and Assembly Language Programming Vassilis Athitsos University of Texas at Arlington.
Computer Systems – Machine & Assembly code. Objectives Machine Code Assembly Language Op-code Operand Instruction Set.
More on Pipelining 1 CSE 2312 Computer Organization and Assembly Language Programming Vassilis Athitsos University of Texas at Arlington.
RISC / CISC Architecture by Derek Ng. Overview CISC Architecture RISC Architecture  Pipelining RISC vs CISC.
PACK. Instruction type: SS2 Explicit Coding: D1(L1,B1),D2(L2,B2) – Example PACK 3(4,5),8(9,7) – Example PACK X(3),Y(4) Use: Converts zoned decimal fields.
UNPK. Instruction type: SS2 Explicit Coding: D1(L1,B1),D2(L2,B2) – Example UNPK 3(4,5),8(9,7) – Example UNPK X(3),Y(4) Use: Converts packed fields to.
1 Contents: 3.1 Instruction format and Addressing Modes 3.2 Instruction Introduction Chapter 3 Instruction system.
central heating system
Chapter 11 Instruction Sets
Multiplication table. x
Computer Science 210 Computer Organization
Chunking The easy way to divide!.
Chapter 3 Machine Language and Assembly Language.
Chapter 3 Machine Language and Assembly Language.
The fetch-execute cycle
MIPS Assembly.
Hmmm Assembly Language
CS 5513 Computer Architecture Pipelining Examples
L Load Fullword.
Computer Science 210 Computer Organization
8086 MICROPROCESSOR PROGRAMMING – INTEGER INSTRUCTIONS AND COMPUTATIONS Amar Saraswat.
ZAP Zero and Add Packed.
Chunking The easy way to divide!.
Computer Programming Machine and Assembly.
Chapter 4 Data Movement Instructions
MIPS assembly.
PA0 is due in 12 hours PA1 will be out in 12 hours
MIPS Instructions.
Instructions Instructions (referred to as micro-instructions in the book) specify a relatively simple task to be executed It is assumed that data are stored.
Computer Architecture and the Fetch-Execute Cycle
Architecture Overview
Sequencing, Selection, and Loops in Machine Language
THE FETCH-EXECUTE CYCLE.
CS 3843 Midterm Two Review Fall 2013 Prof. Qi Tian.
Lecture 06 Programming language.
Question 0: Register Files
Program Execution.
Example 1: (expression evaluation)
Target Code Generation
THE FETCH-EXECUTE CYCLE.
Problem: Consider the following two SRC code segments for implementing multiplication. Find which one is more efficient in terms of instruction count and.
William Stallings Computer Organization and Architecture 8 th Edition Chapter 11 Instruction Sets: Addressing Modes and Formats.
CS 3853 Computer Architecture Pipelining Examples
Hmmm Assembly Language
Instruction execution and ALU
Functions in Hmmm Assembly
Functions in Hmmm Assembly
CS 111 – Sept. 16 Machine language examples Instruction execution
Algoritmos y Programacion
Presentation transcript:

LA Load Address

LA Instruction type: RX Explicit Coding: B1,D2(X2,B2) Example LA 5,3(4,5) Example LA 8,TABLE(7) Use: Creates an address (operand 2) which is loaded into the operand 1 register

What does it do? LA 8,Y R8 00 12 3D 8A (Before) R8 00 00 10 04 (After) Memory F1 F2 F3 F4 F5 F6 F7 F8 F9 Address X’1000’ Y

What does it do? LA 8,Y(9) R8 00 12 3D 8A R9 00 00 00 04 R8 (Before) R8 00 12 3D 8A R9 00 00 00 04 R8 00 00 10 08 (After) Memory F1 F2 F3 F4 F5 F6 F7 F8 F9 Address X’1000’ Y

What does it do? LA 7,5(8,9) (Before) R8 00 00 20 00 R9 00 00 10 00 R7 00 00 12 34 (Before) R7 00 00 30 05 (After)

What does it do? LA 7,5(0,9) or LA 7,5(,9) R8 00 00 20 00 R9 00 00 20 00 R9 00 00 10 00 (Before) R7 00 00 12 34 R7 00 00 10 05 (After)

What does it do? LA 7,5 or LA 7,5(0,0) R7 00 00 12 34 R7 (Before) R7 00 00 12 34 R7 00 00 00 05 (After) This is an effective way to load a “small” number into a register. Small means < 4096. Why?

An Assembly Listing 4180 3004 00004 9 LA 8,4(0,3) 4180 3004 00004 10 LA 8,4(,3) 4183 0004 00004 11 LA 8,4(3) 4180 0004 00004 12 LA 8,4(0,0) 4180 0004 00004 13 LA 8,4

LA Example use: Assume: TABLE DC F ‘1’ Assume address 1000 DC F ‘2’ TABENTRY DS F You execute: LA R7,8 LA R8,TABLE LA R9,0(R7,R8) MCV TABENTRY,0(R9) R9 After: 00001008

Programming Tips It’s easy to make a simple mistake by coding L for LA or LA for L. Give it a moment’s extra thought when you code these. Do you want an address (LA)? Or do you want the contents at an address (L)? LA is often used for loading multiple base registers: BASR R12,R0 USING *,R12,R11 LA R11,2048 LA R11,2048(R11,R12)

Try it in VisibleZ Try the following programs: la.obj