tags:

views:

62

answers:

1

Translate the following pseudocode expression to MIPS assembly language code. Include code to ensure thta there is no array bounds violation when the store word (sw) instruction is executed. Note that the array "zap" is an array containing 50 words, thus the value in resister $s0 must be in the range from 0 to 49. Be sure to convert the array index into a btye offest before accessing memory. If an array bounds violation is detected then branch to the label "Error".

               .data
               .align      2
    zap:       .space      200
               .code

               ...

               zap[$a0] = $s0;
+1  A: 

I recommend using the pseudocode expression to MIPS assembly translation engine conveniently located in your head. If it's not currently available, try exerting effort. Caffeine and a relevant textbook tend to help as well.

Dolph