I am trying to develop a lab illustrating how C++ cross-compiles into fairly 'inefficient' assembly code, rather than writing directly in assembly. I wrote the following example program and cross-compiled it using a GNU 68HC12 (ver. 3.0.4) compiler:
int main (void)
int first = 4;
int second = 5;
int third = 6;
int final = first + second + third;
The first five assembly instructions are the following:
After quite a bit of searching, I have found out that the frame is a part of the stack used for parameters and local storage of variables and is only used with high-level languages, but I have not been able to find anything referencing how it is used/accessed. I have come up with less than that on the MOVW instruction being used with three parameters.
If anyone has any insight to how the frame works, the notation used, or the use of MOVW with three parameters, I would greatly appreciate it.