ITEC 352 Lecture 13 ISA(4).

Slides:



Advertisements
Similar presentations
RAM (cont.) 220 bytes of RAM (1 Mega-byte) 20 bits of address Address
Advertisements

SE 292 (3:0) High Performance Computing L2: Basic Computer Organization R. Govindarajan
Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
1 Patt and Patel Ch. 7 LC-3 Assembly Language. 2 LC-3 is a load/store RISC architecture Has 8 general registersHas 8 general registers Has a flat 16-bit.
Chapter 16 Java Virtual Machine. To compile a java program in Simple.java, enter javac Simple.java javac outputs Simple.class, a file that contains bytecode.
Slides created by: Professor Ian G. Harris Efficient C Code  Your C program is not exactly what is executed  Machine code is specific to each ucontroller.
ARM versions ARM architecture has been extended over several versions.
Computer Science 210 Computer Organization Strings, I/O, and Trap Service Routines.
Cosc 2150: Computer Organization
CPSC 330 Fall 1999 HW #1 Assigned September 1, 1999 Due September 8, 1999 Submit in class Use a word processor (although you may hand-draw answers to Problems.
Stored Program Architecture
Assembly Language.
MIPS Assembly Tutorial
1 Lecture 3: MIPS Instruction Set Today’s topic:  More MIPS instructions  Procedure call/return Reminder: Assignment 1 is on the class web-page (due.
6-1 Chapter 6 - Datapath and Control Department of Information Technology, Radford University ITEC 352 Computer Organization Principles of Computer Architecture.
CS/COE0447 Computer Organization & Assembly Language
Chapter 7 Introduction to LC-3 Assembly Language Assembly Language Assembly Process Using the Editor & Simulator for Assembly Language Programming.
ITEC 352 Lecture 14 ISA(5). Review Questions? Exam 1 next Friday Assembly –Assembler –Basic structure –Registers –Memory.
Chapter 10- Instruction set architectures
ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson slides3.ppt Modification date: March 16, Addressing Modes The methods used in machine instructions.
 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
1 COMS 361 Computer Organization Title: Instructions Date: 9/28/2004 Lecture Number: 10.
ITEC 352 Lecture 17 Functions in Assembly. Functions + Assembly Review Questions? Branching Call / Jump Reminder exam on Friday, project due next Friday.
LC-3 Computer LC-3 Instructions
Chapter 2 Machine Language. Machine language The only language a computer can understand directly. Each type of computer has its own unique machine language.
CSS 372 Lecture 1 Course Overview: CSS 372 Web page Syllabus Lab Ettiquette Lab Report Format Review of CSS 371: Simple Computer Architecture Traps Interrupts.
Chapter 6 In introduction to System Software and Virtual Machine ***Assembly Language.
TK 2633 Microprocessor & Interfacing Lecture 3: Introduction to 8085 Assembly Language Programming (2) 1 Prepared By: Associate Prof. Dr Masri Ayob.
Chapter 5 The LC-3 LC-3 Computer Architecture Memory Map
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Chapters 4 & 5: LC-3 Computer Architecture Machine Instructions Assembly language Programming in Machine and Assembly Language.
ITEC 352 Lecture 11 ISA - CPU. ISA (2) Review Questions? HW 2 due on Friday ISA –Machine language –Buses –Memory.
4-1 Chapter 4 - The Instruction Set Architecture Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring.
Instruction Set Architecture
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
4-1 Chapter 4 - The Instruction Set Architecture Department of Information Technology, Radford University ITEC 352 Computer Organization Principles of.
ITEC 352 Lecture 20 JVM Intro. Functions + Assembly Review Questions? Project due today Activation record –How is it used?
Cosc 2150: Computer Organization
ITEC 352 Lecture 12 ISA(3). Review Buses Memory ALU Registers Process of compiling.
5-1 Chapter 5 - Languages and the Machine Department of Information Technology, Radford University ITEC 352 Computer Organization Principles of Computer.
ITEC 352 Lecture 14 ISA(6). Review Questions? Beginning / End Memory locations Variable / Memory syntax PSR Loops / Branches.
5-1 Chapter 5 - Languages and the Machine Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
Introduction to Computer Engineering ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin.
4-1 Chapter 4 - The Instruction Set Architecture Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles.
Copyright 2006 by Timothy J. McGuire, Ph.D. 1 MIPS Assembly Language CS 333 Sam Houston State University Dr. Tim McGuire.
1 Text Reference: Warford. 2 Computer Architecture: The design of those aspects of a computer which are visible to the programmer. Architecture Organization.
A summary of TOY. 4 Main Components Data Processor Control Processor Memory Input/Output Device.
 Lecture 2 Processor Organization  Control needs to have the  Ability to fetch instructions from memory  Logic and means to control instruction sequencing.
© GCSE Computing Candidates should be able to:  describe the characteristics of an assembler Slide 1.
1.4 Representation of data in computer systems Instructions.
ITEC 352 Lecture 19 Functions in Assembly. Functions + Assembly Review Questions? Project due on Friday Stacks Function activation / deactivation.
1 The Instruction Set Architecture September 27 th, 2007 By: Corbin Johnson CS 146.
ICC Module 3 Lesson 1 – Computer Architecture 1 / 13 © 2015 Ph. Janson Information, Computing & Communication Computer Architecture Clip 2 – Von Neumann.
ICC Module 3 Lesson 1 – Computer Architecture 1 / 6 © 2015 Ph. Janson Information, Computing & Communication Computer Architecture Clip 3 – Instruction.
Copyright 2006 by Timothy J. McGuire, Ph.D. 1 MIPS Assembly Language CS 333 Sam Houston State University Dr. Tim McGuire.
1 The user’s view  A user is a person employing the computer to do useful work  Examples of useful work include spreadsheets word processing developing.
PROGRAMMING THE BASIC COMPUTER
Computer Science 210 Computer Organization
Overview Introduction General Register Organization Stack Organization
Computer Architecture and Organization Miles Murdocca and Vincent Heuring Chapter 4 – The Instruction Set Architecture.
Chapter 5 The LC-3.
The Processor and Machine Language
LC-3 Details and Examples
Computer Science 210 Computer Organization
MARIE: An Introduction to a Simple Computer
COMS 361 Computer Organization
COMS 361 Computer Organization
Chapter 4 The Von Neumann Model
Presentation transcript:

ITEC 352 Lecture 13 ISA(4)

Review Binary Transistors / gates Circuits Architecture Assembly language High level languages

Outline Assembly in action

If we don’t use the %, the assembler will return a syntax error. ARC Registers ARC has 32 general purpose registers from r0 to r32 However, r0 is set to value 0 and cannot be changed. We can use all the other registers. Using registers is very easy ! Just refer to their contents using the “%” symbol. E.g., Consider the instruction: andcc %r1 %r2 %r3 In English this stands for: “Compute the logical bitwise AND of the contents of register r1 and register r2 and store in register r3” If we don’t use the %, the assembler will return a syntax error.

User-Visible Registers PC: program counter, next instruction to execute Stack Pointer: we will study later.

ARC Memory Using memory is not so straightforward as registers, but is still quite easy. If you enclose a memory location in “[ ]” it refers to the contents of the memory Else it refers to the actual memory location. Consider a Java (or C/C++ statement) int x = 10; In ARC, we can allocate this memory as x: 10 Now, to access the content of this memory we must enclose “x” in “[ ]” E.g., Consider the instruction: ld [x] %r1 // “Load the contents of memory location x in register r1” On the other hand, if we do not enclose x within the “[ ]”, then With “ld” and “st” instructions you will get a syntax error. These instructions require memory content, not data ! With “call” instruction it will end up calling the actual location of the memory. E.g., call x ; // here it will call the instruction located at memory location “x”

Summary so far … We looked at: ARC instructions Using registers Using memory. Lets look at a few ARC programs on the simulator and then get our hands dirty into how the assembly code is actually represented.

Example program Memory locations are represented within [ ] ld and st are the only two operations allowed on memory. These are information for the assembler. They are not part of the assembly language

Instruction Format Every ARC instruction is 32 bits in length. For instance, the instruction below must fit within 32 bits when represented in binary. To do this, ARC enforces certain formats that allow us to use the 32 bits in different ways. These are called instruction formats. A format defines how the various bit fields of an instruction are laid out within 32 bits and how it is interpreted by the ARC control unit.

ARC Instruction and PSR Formats

Data Formats

ARC Pseudo-Ops • Pseudo-ops are instructions to the assembler. They are not part of the ISA.

.org 3000 Adding 5 integers … a: 10 25 2 3 4 a_start: 3000 counter: 0 output: 0 ld [a_start], %r1 ! Load the starting address of a into %r1 ld [counter], %r2 ! Register r2 is the counter. andcc %r3,%r0, %r3 ! What does this do? loop: subcc %r2, 5, %r0 ! Have we reached the end of the array? be done ! If %r2 – 5 = 0, exit loop. addcc %r2, 1, %r2 ! Increment counter ld %r1, %r4 ! Load the number from the array addcc %r4, %r3, %r3 ! Accumulate sum into %r3. addcc %r1, 4, %r1 ! Goto next address ba loop done: st %r3, [output] jmpl %r15+4, %r0

Summary Storage location for address of the array a. Having this location allows us to load the address “3000” into a register. Length is being used as a “counter” to determine when to end the loop.

Other ARC instructions Software traps: Allows programs to invoke services from the OS/hardware, e.g., reading a keyboard or writing onto a display. ARC has trap instructions – but they do not control the OS/hardware (due to JVM limitations).

Summary Assembly programming 101 Different language, but still within same paradigm