Question: Starting with C code of the form short test (short x, short y, short z) { short val = ) { if C cmpq jle

Starting with C code of the form

short test (short x, short y, short z) { short val = ) { if C cmpq jle capq jle .L3: } GCC generates the

short test (short x, short y, short z) { short val = ) { if C cmpq jle capq jle .L3: } GCC generates the following assembly code: short test (short x, short y, short z) x in %rdi, y in Zrai, z in rdx test: movq idivq ret leaq (%rdx. %rai). %rax %rdi, %rax subq $5, %rdx .12 $2, %rsi .13 %rdi, %rax %rdx, %rax .L2: } else if ( val = return val; movq idivq ret if C cmpq jge .LA: val = movq idiva else val = %rdi, %rax %rsi, %rax $3, %rdx .LA %rdx, %rax Krsi, %rax rep: ret. Fill in the missing expressions in the C code.

Step by Step Solution

3.32 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

This problem requires that you work through a nested branch structure ... View full answer

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 Computer Systems A Programmers Perspective Questions!