Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Lecture 10: Load/Store cont. and Integer Arithmetic CS 2011 Fall 2014, Dr. Rozier."— Presentation transcript:

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

2 EXAM AND HOMEWORK 1

3 ADVANCED MEMORY OPS

4 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.

5 Importance of Modes?

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

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

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

9 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:

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

11 THE STACK

12 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.

13 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

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

15 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

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

17 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}

18 MP0

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

20 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.

21 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.

22 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

23 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.

24 Lab 1: Binary Bomb Start early! The lab will not be easy! Bomb download site: – http://trustpi.eecs.uc.edu:15213/ http://trustpi.eecs.uc.edu:15213/ Bomb scoreboard: – http://trustpi.eecs.uc.edu:15213/scoreboard http://trustpi.eecs.uc.edu:15213/scoreboard

25 For next time Read Chapter 3 Sections 3.1 – 3.5


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

Similar presentations


Ads by Google