Q2. Run the following assembly code: XXXXXXXXXX__/10 1. (3 marks) Identify and explain the two errors in the code 2. (3 marks) Fix the errors. Attached capture with corrected code 3. (1 mark) Use gdb...

There is two questions to do... in the document provided


Q2. Run the following assembly code: __/10 1. (3 marks) Identify and explain the two errors in the code 2. (3 marks) Fix the errors. Attached capture with corrected code 3. (1 mark) Use gdb debugger to execute the corrected code and disas the code. Attach the capture with the debugger (disas) 4. (3 marks) Identify the addresses that contain the values moved to bl,cx and ax respectively. Use the respective debugger command to verify the content of each of these addresses. Attach the capture with the content of the identified addresses Q3. Create an assembly code that implements the following: __ / 10 1. .bss section with a variable called Val1 to store an integer value provided by STDIN 2. Ask the user to input the value > 0 and read the value 3. Store read value from STDIN into register eax 4. Use xor to clean ecx register 5. In a loop increment ecx and compare it with eax. If ecx==eax print the value on STDOUT and exit. if the values are not equal yet, loop till ecx==eax. 6. Use nasm, ld and gdb to execute it 7. Identify the modified or set flags in this code 8. Run it and demonstrate that the value is printed on STDOUT 9. Attach screen captures with created assembly code and the result after executing it
Mar 18, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here