credit sdrawkcab
Code:lui t0 $XXXX//first half of controller address (real addressing) lw t0 $XXXX(t0)//second half of controller address lui t1 $XXXX//first half of pointer (real addressing) lw t1 $XXXX(t1)//second half of pointer lui t2 $first half of noped address addiu t3 zero $XXXX//mark value-1 addiu t4 zero $XXXX//recall value-1 addiu t5 zero $XXXX//mark value-2 addiu t6 zero $XXXX//recall value-2 bne t0 t3 $XXXXXXXX//branch to next bne nop lw t7 $XXXX//second half first nop address +0(t2) lw t8 $XXXX//second half first nop address +4(t2) lw t9 $XXXX//second half first nop address +8(t2) sw t7 $XXXX//x coordinate offset (t1) sw t8 $XXXX//y coordinate offset (t1) sw t9 $XXXX//z coordinate offset (t1) bne t0 t4 $XXXXXXXX//branch to next bne nop lw t7 $XXXX//x coordinate offset (t1) lw t8 $XXXX//y coordinate offset (t1) lw t9 $XXXX//z coordinate offset (t1) sw t7 $XXXX//second half first nop address +0(t2) sw t8 $XXXX//second half first nop address +4(t2) sw t9 $XXXX//second half first nop address +8(t2) bne t0 t5 $XXXXXXXXbranch to next bne nop lw t7 $XXXX//second half second nop address +0(t2) lw t8 $XXXX//second half second nop address +4(t2) lw t9 $XXXX//second half second nop address +8(t2) sw t7 $XXXX//x coordinate offset (t1) sw t8 $XXXX//y coordinate offset (t1) sw t9 $XXXX//z coordinate offset (t1) bne t0 t6 $XXXXXXXX//branch to jr ra nop lw t7 $XXXX//x coordinate offset (t1) lw t8 $XXXX//y coordinate offset (t1) lw t9 $XXXX//z coordinate offset (t1) sw t7 $XXXX//second half second nop address +0(t2) sw t8 $XXXX//second half second nop address +4(t2) sw t9 $XXXX//second half second nop address +8(t2) jr ra nop J $XXXXXXXX//hook