ece330_f10_hw5 - ECE 332 Due Homework 5 Fall 2010 1 Use the...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
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)
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon