Question: As shown below, main ( ) passes char a , char b , char c , char d , int e , and short f

As shown below, main() passes char a,char b,char c,char d,int e, and short f to func(). Assume that SP points to $20000100. Fill the CPU register and stack contents when func() was just called.
#include
using namespace std;
void func( char param1, char param2, char param3, char param4, int param5, short param6){// entry address @0x003A
char x =0xAB;
char y =0xCD;
...;
}
char a =0x12;
char b =0x34;
char c =0x56;
char d =0x78;
int e =0x9ABCDEF0;
short f =0xABCD;
int main(){
func( a, b, c, d, e, f ); // encoded into @Address 0x0034 BL FUNC (@0x003A)
// BL is a 16-bit encoded instruction. THUMB2s LSB is 1.
}
CPU registers
R0
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
SP
LR
PC
Memory
0x20000200
0x200001FF
0x200001FE
0x200001FD
0x200001FC
0x200001FB
0x200001FA
0x200001F9
0x200001F8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!