switch (c) { case 1: a = 10; break; case 2: a = 20; break; case 3: a = 30; break; default: a = 0; }
Translate this piece of C codes into ILOC codes. Variable c and a should be stored in the activation record. Your translated codes start at address 1000 and grow to larger addresses. The address of a variable in the activation record is r_arp[@name], where r_arp is the register storing the activation record address and @name is the macro for the offset of the variable name.
You may use labels instead of address number in jump/branch instructions.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here