code-trace-simulated-quiz

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

Info icon This 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 t1: ________ t4: ________ t6: ________ v0: ________
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern