code-trace-simulated-quiz

code-trace-simulated-quiz - CSE 341 Fall 2011 Code Trace...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 341 Fall 2011 Code Trace Exercise Consider the following program. A breakpoint is set at bkpt . Trace the program as it is executed. Indicate the values of registers t1, t4, t6, and v0 each time a breakpoint is hit and at the end of the program. In addition, complete the memory map, reflecting the contents of memory after the program has finished execution. Note that your answers should be the same as if you ran this program in XSPIM on the CSE Unix/Linux timeshare machines in bare mode and set a breakpoint at next . Any unknown (uninitialized) values should be indicated by a dash (-). You may not need all the lines provided. The initial value of register a0 is 0x0000000A. main: add $v0, $0, $0 sll $s2, $a0, 4 lui $s1, 0x1000 bkpt: lbu $t1, ($s1) andi $t4, $t1, 0xF0 beq $t1, $0, report sll $t5, $t4, 4 bne $t4, $s2, lower andi $t6, $t1, 0x0F addi $v0, $v0, 1 lower: bne $a0, $t6, bkpt addi $s1, $s1, 1 addi $v0, $v0, 1 j bkpt or $t0, $0, $0 report: lui $s1, 0x1000 sb $v0, ($s1) At Breakpoint
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 11/03/2011 for the course CSE 341 at SUNY Buffalo.

Ask a homework question - tutors are online