Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The function: long decode2 (long x, long y, long z); ... compiles, using gcc -og -s , to: decode2: mova suba imulq salg sarq xora
The function: long decode2 (long x, long y, long z); ... compiles, using gcc -og -s , to: decode2: mova suba imulq salg sarq xora adda ret trdi, frax frdx, frax frax, frdi $63, frax $63, frax trdi, frax $rsi, frax Your task is to write C code for decode2 that compiles exactly to these instructions. To check your solution, compile hw3.c using: $ gcc -Og -s hw3.c $ nano hw3.3 I recommend that you first identify which registers correspond to x, y, z. For this, you could try to see what is the assembly produced if decode2 were simply: The function: long decode2 (long x, long y, long z); ... compiles, using gcc -og -s , to: decode2: mova suba imulq salg sarq xora adda ret trdi, frax frdx, frax frax, frdi $63, frax $63, frax trdi, frax $rsi, frax Your task is to write C code for decode2 that compiles exactly to these instructions. To check your solution, compile hw3.c using: $ gcc -Og -s hw3.c $ nano hw3.3 I recommend that you first identify which registers correspond to x, y, z. For this, you could try to see what is the assembly produced if decode2 were simply
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