This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: ECE 332 Homework 5 Fall 2010 Due: 09/27/2010 Page 1 of 4 1. Use the following assembly code and memory snapshots to answer the questions on the following page. # file: problem7.s .include “system.inc” .text _start: .global _start movia sp,STACK movi r17,801 srli r17,r17,4 andi r4,r17,0xf call magic A: mov r4,r2 call prints B: br . .end You can assume that the symbol _start is associated with memory address 0x20000 . Note: The data section of magic.s is loaded at memory address 0x200e0 . # file: magic.s .text magic: .global magic movia r8,LIST andi r9,r4,0xf C: slli r9,r9,2 add r9,r8,r9 ldw r2,0(r9) ret .data .word 0xaaaaaaaa LIST: .word m0, m1, m2, m3 .word 0xbbbbbbbb m0: .string "dragon" m1: .string "rat" m2: .string "rabbit" m3: .string "tiger" .word 0xcccccccc .end Figure 7.1. Partial memory snapshot of data section (word format) Figure 7.2. Partial memory snapshot of data section (byte format) ECE 332 Homework 5 Fall 2010 Due: 09/27/2010 Page 2 of 4 1. Based on the code and memory snapshots on the previous page : a. What is the value of the symbol...
View Full Document
This document was uploaded on 11/02/2011 for the course ECE 330 at Boise State.
- Fall '10