Question

Show the symbol table and activation record for the following function. double cubic(double x, int a,...

Show the symbol table and activation record for the following function.

double cubic(double x, int a, int b, int c, int d)

{

    double y = 0.0;

    y = a*x*x*x + b*x*x + c*x + d;

    return y;

}

0 0
Add a comment Improve this question Transcribed image text
Answer #1

A.

Variable Type Byte(space)
x double 8 bytes
a Integer 2 bytes
b Integer 2 bytes
c Integer 2 bytes
d Integer 2 bytes
y double 8 bytes

B. The structure of an activation record is as follows,

0xcff3: 0000    ; local variable a <= R6 (top of stack)
0xcff4: 0000    ; local variable b
0xcff5: 0004    ; local variable c
0xcff6: 0007    ; local variable d
0xcff7: 0000    ; local variable x
0xcff8: 0000    ; local variable y <== R5
0xcff9: cfff    ; frame pointer of "cubic"
0xcffa: 300a           ;  Return address
0xcffb: 0000           ;  Return value
 
Add a comment
Know the answer?
Add Answer to:
Show the symbol table and activation record for the following function. double cubic(double x, int a,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT