Prelab:
Think about these questions before you try the lab. They should make the lab easier.
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) addi $s0,$s0,4 addi $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: addi $s0,$s0,4 addi $s1,$s1,4 lw $t0,0($s0) sw $t0,0($s1) bne $t0,$0,loop
Checkoff: