(7 points) Translate the following high level language code into IJVM symbolic
instructions (like IADD, BIPUSH, etc). Make the function call and return
as is described in the text. All variables are local on the stack, be sure
to allocate space for them. Remember to make space for OBJREF when making
the call. Use IRETURN to indicate when the main program terminates.
main {
int total = 0;
int count;
int answer;
for (count = 0; count < 10; count++) {
answer = calculate(count, 10);
if (answer > 0) {
total += answer;
}
}
return 0;
}
function calculate(int count, int max) {
int result;
result = count + max - 30;
return result;
}