1 answer

Please explain the table solution. The red answers are correct. Please explain step by step why...

Question:

5) Mutually assured instruction. (10 pts) a) First, deduce the following functions. (4pts) 000000000000064a <func1>: 64a: 48

pointing, and indicate the names/locations of any unknown registers pushed to stack, any known values pushed to the stack, an

Please explain the table solution. The red answers are correct. Please explain step by step why

5) Mutually assured instruction. (10 pts) a) First, deduce the following functions. (4pts) 000000000000064a <func1>: 64a: 48 83 ec 18 sub $0x18,%rsp 64e: 89 70 24 OC mov %edi, oxc(%rsp) 652: 83 70 24 Oc 00 cmpl $0x0, xc(%rsp) 657: 75 07 jne 660 <func1+0x16> 659: b8 01 00 00 00 mov $0x1,%eax 65e: ebbe jmp 66e <func1+0x24> 660: 85 44 24 Oc mov Oxc(%rsp), %eax 664: 83 e8 01 sub $0x1, %eax 667: 89 c7 mov %eax, %edi 669: 8 05 00 00 00 callq 673 <func2> 66e: 48 83 c4 18 add $0x18,%rsp 672: C3 reta int func1(unsigned int n) { if ( n == 0 ) return 1; else return func2(n-1); int func2(unsigned int n) { if ( n == 0 ) return 0; else return func1(n-1); 0000000000000673 <func2>: 673: 48 83 ec 18 677: 89 70 24 OC 67b: 83 7c 24 Oc 00 680: 75 07 682: b8 00 00 00 00 687: eb De 689: 85 44 24 Oc 68d: 83 e8 01 690: 89 c7 692: e8 b3 ff ff ff 697: 48 83 c4 18 69b: c3 sub $0x18,%rsp mov %edi, oxc(%rsp) cmpl $0x0, xc(%rsp) jne 689 <func2+0x16> mov $0x0,%eax jmp 697 <func2+0x24> mov exc(%rsp), %eax sub $0x1, %eax mov %eax, %edi callq 64a <func1> add $0x18,%rsp reta
pointing, and indicate the names/locations of any unknown registers pushed to stack, any known values pushed to the stack, and any unused stack space. (5pts) Assume each line of the table represents 4 bytes. caller return address <7-4> caller return address <3-0> Unused Unused Ox 00 00 00 02 Unused Unused Unused Ox 00 00 00 00 Ox 00 00 06 6e Unused Unused Ox 00 00 00 01 Unused Unused Unused Ox 00 00 00 00 Ox 00 00 06 97 Unused Unused Ox 00 00 00 00 Unused Unused Unused

Answers

The following Code is the operation done in Assembly Language. We are using simple push and pop with a different function

Let's learn about stack first Stack is a kind of memory that stores values provided the value can be removed or added accordingly. Now Stack works in 2 processes:-

1:LIFO( Last IN First Out)We can push the value from the last and remove a value ie pop from first

2.FILO(First In Last Out) We can push from the upper part of the stack and remove from the last part

Now register

The register is nothing but storage of the CPU what it does is it can store an instruction or any kind of data.

Lets first understand what does different function does

Data Movement

1. mov: this instruction copies the data item referred to ie. Register contents, memory contents etc.

(Arithmetic Instruction)

2.sub-Integer subtraction ---- The sub instruction stores the first operand value which is intern the result of the subtraction of second operand and the first operand.

3.

Add- This function stores the addition of two operands in its first operands

(Control Flow Instruction)

4.jmp: Jump function---it Transfers the control function to the instruction to the memory location which is mentioned in the instruction

5.jne: This is the same as a jump but j-Function also provides certain condition so jne jumps when it compares the previous operand and the given operand and it is not equal.

6.cmp-Compares the 2 operands

Now in the stack Unused is the part where the stack is empty and no address is saved rest is the address which is being stored.

Hope it explain you the code

.

Similar Solved Questions

1 answer
Convert qrxn to deltaH ΔΗ - 2 9 σκη Imol NaOH 0.506 mol NaOH.
convert qrxn to deltaH ΔΗ - 2 9 σκη Imol NaOH 0.506 mol NaOH....
1 answer
1. Centroids: Determine the area and location of the centroid X and Y of the following...
1. Centroids: Determine the area and location of the centroid X and Y of the following shape using double integrals and polar coordinates. Use the angles in radians. Use b=4 inches 300 450 A x area = ſſ dxdy 1. Centroids: Determine the area and location of the centroid X and Y of the follo...
1 answer
A 0.013 M solution of a weak acid (HA) has a pH of 4.38. What is...
A 0.013 M solution of a weak acid (HA) has a pH of 4.38. What is the K, of the acid? Ka = 10 (Enter your answer in scientific notation.)...
1 answer
Briefly explain how culture creates a cycle of poor dental health, poverty, and diet.
briefly explain how culture creates a cycle of poor dental health, poverty, and diet....
1 answer
Apps YouTube Gmail Translate D Genesis 8:20 The.. a AMAZONI Applied Calculus-Spring 2020 Homework: Homework 11...
Apps YouTube Gmail Translate D Genesis 8:20 The.. a AMAZONI Applied Calculus-Spring 2020 Homework: Homework 11 Score: 0 of 1 pt 7.4.1 Minimize 2x + 2y, subject to the constraint 128 - 4x - 4y = 0. The minimum value of the function is | (Type an exact answer in simplified form.) Enter your answer in ...
1 answer
TC03E08 A chemical reaction carried out at 30 °C takes in 550 J of heat which is transferred from the surroundings. The...
TC03E08 A chemical reaction carried out at 30 °C takes in 550 J of heat which is transferred from the surroundings. The reaction produces a gaseous product so that the reaction does 280 J of work on the atmosphere as the chemicals expand. What is ΔU for this reaction? Select one: a. -830 J...
1 answer
The distance from Paris to brussels is 291 km how many meters is this?
the distance from Paris to brussels is 291 km how many meters is this?...
1 answer
Cyclopropane isomerizes to propylene according to a first order reaction: cyclopropane → propylene The activation energy...
Cyclopropane isomerizes to propylene according to a first order reaction: cyclopropane → propylene The activation energy is Ea=272 kJ/mol. At 773K, the reaction rate constant is 6.1 x 10-4 5-1 a. Calculate the pre-exponential factor, A, for this reaction b. Calculate the rate constant for this ...
1 answer
It's xydz not xydx in the end. 13. Evaluate la 2 (21n(y) – yə)dır + 6...
it's xydz not xydx in the end. 13. Evaluate la 2 (21n(y) – yə)dır + 6 - <z) dy 2) dy – xydı....
1 answer
Port Ormond Carpet Company manufactures carpets. Fiber is placed in process in the Spinning Department, where...
Port Ormond Carpet Company manufactures carpets. Fiber is placed in process in the Spinning Department, where it is spun into yarn. The output of the Spinning Department is transferred to the Tufting Department, where carpet backing is added at the beginning of the process and the process is complet...
1 answer
In perfect competition as well as in monopolistic competition, a. profit is positive in a long-run...
In perfect competition as well as in monopolistic competition, a. profit is positive in a long-run equilibrium for each firm. b.entry and exit by firms are restricted. c. there are many firms in a single market. d. marginal revenue is equal to price for each firm. ECTION 22 Monopolistic competition ...
1 answer
Bertha Co purchased equipment 4 years ago for $1,663,081. The equipment was depreciated straight line to...
Bertha Co purchased equipment 4 years ago for $1,663,081. The equipment was depreciated straight line to zero over 7 years. What’s the current accumulated depreciation for the equipment?...
1 answer
Consider the optimization problem 5-6 5-6 F=(X-I)2 + (X Minimize: Subject to: 2-1) X +X-0.5s 0...
Consider the optimization problem 5-6 5-6 F=(X-I)2 + (X Minimize: Subject to: 2-1) X +X-0.5s 0 a. Write the expression for the augmented Lagrangian using r'p = 1. b. Beginning with λ 1 0 and λ2-0 , perform three iterations of the ALM method. c. Repeat part (b), beginning with &lamb...
1 answer
Please show how you would synthesize a terminal ALKYNE to this fluorescein dye. Terminal alkyne s...
Please show how you would synthesize a terminal ALKYNE to this fluorescein dye. Terminal alkyne should be added to the bottom aromatic (with the COOH group) you can use any reagent possible COOH COOH...
1 answer
Which of the following, if true, would be an example of a monopolistically competitive industry? In...
Which of the following, if true, would be an example of a monopolistically competitive industry? In the utilities industry, average cost declines over all levels of output. In the automobile industry, fixed costs as well as variable costs are high. In the retail trade industry, a large number of fir...
1 answer
What characteristic is given by the angular momentum quantum number?
What characteristic is given by the angular momentum quantum number?...
1 answer
Unit prime cost $529 $483 In addition, the following information was provided so that overhead costs...
Unit prime cost $529 $483 In addition, the following information was provided so that overhead costs could be assigned to each product: Activity Name Activity Driver Deluxe Regular Activity Cost Setups Number of setups 300 200 Machining Machine hours 100,000 300,000 $1,850,000 56,000,000 15,000,000 ...