Answered step by step
Verified Expert Solution
Question
1 Approved Answer
User Assembly code: # void switcher ( long a , long b , long c , long * dest ) # a in % rsi,
User
Assembly code:
# void switcherlong a long b long c long dest
# a in rsi, b in rdi, c in rdx d in rcx
switcher:
cmpq $rdi
ja L
jmp Lrdi,
L:
divq rdi, rsi
movq rsi, rdx
L:
leaq rdxrdx
jmp L
L:
leaq rdxrsirdx
salq $rdx
jmp L
L:
movq rsi, rdx
L:
movq rdxrcx
ret
Jump table:
L:
quad L
quad L
quad L
quad L
quad L
quad L
quad L
quad L
quad L
Please complete the following C code based on the above assembly code.
void switcherlong a long b long c long dest
switch Blank Question
case Blank Question :
c a;
dest Blank Question ;
break;
case :
case :
case Blank Question :
Blank Question ;
break;
case : Jumps to L
case Blank Question :
dest Blank Question ;
break;
case :
c Blank Question ;
Fall through
case :
case Blank Question :
dest Blank Question ; movq rdxrcx
break;
default:
dest Blank Question ;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started