Q.1 I'm suppose to write a MIPs code for the following procedure code but I'm confused about the fact that this function has 6 arguments while only 4 registers $a0 -$a3 are said to hold arguments ? Can I simply use $t0 etc to store the arguments?
Int array (int a, int b, int c, int i, int g, int j)
a[i] = b + c[j];
f = g + a[i];
Q.2 The following C code allocates three fields with a word labeled receiver: a 1-bit field
named ready, a 1-bit field named enable, and an 8-bit field named receivedByte. It copies
receivedByte into data, sets ready to 0, and sets enable to 1.
unsigned int ready: 1;
unsigned int enable: 1;
unsigned int receivedByte: 8;
data = receiver.receivedByte;
receiver.ready = 0;
receiver.enable = 1;
What is the compiled MIPS code? Assume data and receiver are allocated to $s0 and $s1.