2. Analyze the Runtime Stack (40 points) The diagram below shows a snapshot of t
ID: 3851982 • Letter: 2
Question
2. Analyze the Runtime Stack (40 points) The diagram below shows a snapshot of the run-time stack on an LC-3 system while the minMax function is running. There is a comment that identifies the precise location of the snapshot. Answer the following questions about this program int minMax(int "x, int *min, int *max) static double average-0; lIglobal static int count-0; Iglobal int t-"x count++ average (average*(count-1) xcount OxFFAD 0xFFAE 0xFFAF 0xFFB0 OxFFB1 0xFFB2 0xFFB3 0xFFB4 0xFFB5 0xFFB6 OxFFB7 OxFFBF OxFFB8 R5 31 OxFFB7 0x4101 0 FFB7 FFB6 FFB5 if (t> "max) max t; *min) min t; if (t snapshot taken here */ 61 return count; 31 int main int x=0, min=0, max=0; int z-0 if (1=-scanf("%d",8x)) { min = x; max X else return 0 while(1 scanf("%d", &x;)) 2+=minMax(8x, &min;, &max;); printf("%d %dn", min, max) return 0Explanation / Answer
a.) return address of minmax function is oxFFAD OxFFB8
b.)when minmax returns, at oxFFB9 address will it store its return value. C.)the current value of variable z in the main function is oxFFB9. d.)the current value of variable t in minmax function is oxFFB8. e.)12 times the while loop in the main function has executed. f.)the meaning of the value held at address 0xFFB9 is the next max value. g.)31,0xFFB7,0xFFB7,0x4101,0,FFB7,FFB6,FFB5,9,61,1,31,0xFFBF these are activation records currently on the stack.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.