Lecture 10: Load/Store cont. and Integer Arithmetic CS 2011 Fall 2014, Dr. Rozier.

Slides:



Advertisements
Similar presentations
Ch. 7 Local Variables and Parameter Passing From the text by Valvano: Introduction to Embedded Systems: Interfacing to the Freescale 9S12.
Advertisements

Wat gaan we doen? harhaling data types
1 ARM Movement Instructions u MOV Rd, ; updates N, Z, C Rd = u MVN Rd, ; Rd = 0xF..F EOR.
Embedded System Design Center Sai Kumar Devulapalli ARM7TDMI Microprocessor Load and store instruction.
ECE 232 L6.Assemb.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 6 MIPS Assembly.
COMP3221 lec-12-mem-II.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lecture 12: Memory Access - II
ARM Microprocessor “MIPS for the Masses”.
Lecture 5: Decision and Control CS 2011 Fall 2014, Dr. Rozier.
Multiple data transfer instructions ARM also supports multiple loads and stores: ldm/ldmia/ldmfd: load multiple registers starting from [base register],
Elec2041 lec-11-mem-I.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lecture 11: Memory Access - I
1 ICS 51 Introductory Computer Organization Fall 2006 updated: Oct. 2, 2006.
COMP3221 lec18-function-III.1 Saeid Nooshabadi COMP 3221 Microprocessors and Embedded Systems Lectures 17 : Functions in C/ Assembly - III
Unit -II CPU Organization By- Mr. S. S. Hire. CPU organization.
Topic 8: Data Transfer Instructions CSE 30: Computer Organization and Systems Programming Winter 2010 Prof. Ryan Kastner Dept. of Computer Science and.
Subroutines and Stacks 1. Subroutines Separate, independent module of program, performs a specific task shortens code, provide reusable “tools” High-level.
Chapter 10 The Stack Stack: An Abstract Data Type An important abstraction that you will encounter in many applications. We will describe two uses:
ARM Assembly Programming Computer Organization and Assembly Languages Yung-Yu Chuang 2007/11/19 with slides by Peng-Sheng Chen.
Lecture 4: Advanced Instructions, Control, and Branching cont. EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer.
Linked Lists in MIPS Let’s see how singly linked lists are implemented in MIPS on MP2, we have a special type of doubly linked list Each node consists.
COMP2011 Assembly Language Programming and Introduction to WRAMP.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
Lecture 2: Basic Instructions CS 2011 Fall 2014, Dr. Rozier.
Lecture 4. ARM Instructions #1 Prof. Taeweon Suh Computer Science Education Korea University ECM586 Special Topics in Embedded Systems.
1 CS232: Computer Architecture II Fall 2011 Intel i7 Quad-core.
Lecture 2: Basic Instructions EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer Engineering Spring 2014, Dr.
Assembly Language A Brief Introduction. Unit Learning Goals CPU architecture. Basic Assembler Commands High level Programming  Assembler  Machine Language.
Lecture 8: Control, Procedures, and the Stack CS 2011 Fall 2014, Dr. Rozier.
More on Assembly 1 CSE 2312 Computer Organization and Assembly Language Programming Vassilis Athitsos University of Texas at Arlington.
Blackfin Array Handling Part 1 Making an array of Zeros void MakeZeroASM(int foo[ ], int N);
ECE 265 – LECTURE 5 The M68HC11 Basic Instruction Set 12/8/ ECE265.
Csci 136 Computer Architecture II – Summary of MIPS ISA Xiuzhen Cheng
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
More on Assembly 1 CSE 2312 Computer Organization and Assembly Language Programming Vassilis Athitsos University of Texas at Arlington.
Lecture 6: Branching CS 2011 Fall 2014, Dr. Rozier.
Lecture 8: Loading and Storing to Memory CS 2011 Fall 2014, Dr. Rozier.
The Stack. ARMSim memory space: 0x Unused 0x x11400 Stack 0x x09400 Heap 0x?????-0x01400 Data 0x x????? Text 0x x01000.
Assembly Variables: Registers Unlike HLL like C or Java, assembly cannot use variables – Why not? Keep Hardware Simple Assembly Operands are registers.
Instruction Set Architectures Early trend was to add more and more instructions to new CPUs to do elaborate operations –VAX architecture had an instruction.
Intel Xscale® Assembly Language and C. The Intel Xscale® Programmer’s Model (1) (We will not be using the Thumb instruction set.) Memory Formats –We will.
ARM Instruction Set Computer Organization and Assembly Languages Yung-Yu Chuang with slides by Peng-Sheng Chen.
Lecture 6: Decision and Control CS 2011 Spring 2016, Dr. Rozier.
Multiple data transfer instructions ARM also supports multiple loads and stores: When the data to be copied to the stack is known to be a multiple of 4.
ARM Programming CMPE 450/490 ©2010 Elliott, Durdle, Minderman
Assembly language.
Overview of Instruction Set Architectures
Chapter 15: Higher Level Constructs
Recitation: Bomb Lab _______________ 18 Sep 2017.
ECE 3430 – Intro to Microcomputer Systems
Introduction to the ARM Instruction Set
ARM Registers Register – internal CPU hardware device that stores binary data; can be accessed much more rapidly than a location in RAM ARM has.
The Stack.
Advanced Topic: Alternative Architectures Chapter 9 Objectives
Recitation: Bomb Lab _______________ 06 Feb 2017.
Processor Instructions set. Learning Objectives
Overview Introduction General Register Organization Stack Organization
Computer Architecture and Organization Miles Murdocca and Vincent Heuring Chapter 4 – The Instruction Set Architecture.
Overview Introduction General Register Organization Stack Organization
Chapter 3 Addressing Modes
The Stack.
C Prog. To Object Code text text binary binary Code in files p1.c p2.c
ARM Load/Store Instructions
ECEG-3202 Computer Architecture and Organization
ECEG-3202 Computer Architecture and Organization
Introduction to Microprocessor Programming
Computer Organization and Assembly Languages Yung-Yu Chuang 2008/11/17
8051 ASSEMBLY LANGUAGE PROGRAMMING
ARM ORGANISATION.
Lecture 4: Instruction Set Design/Pipelining
Introduction to Assembly Chapter 2
Presentation transcript:

Lecture 10: Load/Store cont. and Integer Arithmetic CS 2011 Fall 2014, Dr. Rozier

EXAM AND HOMEWORK 1

ADVANCED MEMORY OPS

Multiple Register Data Transfer LDM, STM – load/store multiple – {cond} Rn{!}, Modes control how Rn is changed – IA – increment after – IB – increment before – DA – decrement after – DB – decrement before The ! suffix to Rn tells the operation to write the results back when done.

Importance of Modes?

What does this instruction mean? LDMIA r0, {r3, r7}

What does this instruction mean? LDMIA r0, {r3-r7}

What does this instruction mean? STMDB r1!, {r6-r8}

Memory Puzzle mov sp, #135, lsl #3 mov r0, #0 mov r1, #1 mov r2, #2 mov r3, #3 mov r4, #4 mov r5, #5 stmia r13, {r0-r5} stmib r13, {r1-r4} ldmia r13, {r0-r5} Checkpoint1: stmia r13!, {r1-r3} ldmda r13!, {r1-r3} Checkpoint2:

RISC Load/Store Architecture Processor Registers Add Cmp Load Etc Store Memory

THE STACK

The Stack There is nothing special about the stack – It’s a conceptual abstraction we use to implement higher features. – ARM has no new instructions to implement the stack.

The Stack ARM assembler does provide “pseudo- instructions” – Pseudo-instructions are nicknames for existing instructions that make our job easier FD – full descending ED – empty descending FA – full ascending EA – empty ascending

Work out how FD,ED,FA,EA map to our real instructions.

The Stack While we could use any method (so long as we are consistent), it is rare to see anything but a full descending stack. The pseudo-instructions PUSH and POP assume a full descending stack

PUSH and POP PUSH{cond} POP{cond} PUSH and POP assume use of the stack pointer.

Memory Puzzle mov sp, #135, lsl #3 mov r0, #0 mov r1, #1 mov r2, #2 mov r3, #3 mov r4, #4 mov r5, #5 push {r0, r4-r5} pop {r1} push {r1-r3} pop {r2-r5}

MP0

Lab 1: Binary Bomb MP 1 is out today Due Thursday, October 30th at 11:59pm.

Lab 1: Binary Bomb Your task is to solve a series of six stages by finding the password. You will get a unique compiled binary. You will need to disassemble this binary to find the passwords.

Lab 1: Binary Bomb If you enter a wrong password, the bomb will “explode” and notify us. The bomb has tamper proof protections. Do not try to run it on a non-lab computer, or it will notify us and abort! Each explosion deducts half a point from your lab score.

Lab 1: Binary Bomb Assignment PartPoints Phase 110 Phase 210 Phase 310 Phase 410 Phase 515 Phase 615 Write up10 Explosions-0.5 each 80 pts maximum score

Lab 1: Binary Bomb If you do things right, your bomb should never blow up! Think carefully! Use the debugger gdb to step through and analyze the program. – Figure out what the code is doing to check for a correct result, and how to pass the checks.

Lab 1: Binary Bomb Start early! The lab will not be easy! Bomb download site: – Bomb scoreboard: –

For next time Read Chapter 3 Sections 3.1 – 3.5