Fall 2000 |
Lab 4: DEBUGGING MIPS |
CS61C |
Purpose:
Prelab: The prelab deals with how to do debug in SPIM or XSPIM
Introduction:
Task:
main( ) { int *sourceptr; int *destptr; int source[7] = {3, 1, 4, 1, 5, 9, 0} int dest[7]; sourceptr = source; destptr = dest; while (*sourceptr != 0) { *destptr = *sourceptr; sourceptr++; destptr++; } }
loop: lw $t0, $0($s0) sw $t0, $0($s1) addiu $s0, $s0, 4 addiu $s1, $s1, 4 bne $t0, $0, loop1) Set a breakpoint at the address corresponding to instruction labeled by "loop". Run the program and look at the values of the registers.
loop: addiu $s0, $s0, 4 addiu $s1, $s1, 4 lw $t0, $0($s0) sw $t0, $0($s1) bne $t0, $0, loop
To Submit:
Last updated: 9/14