Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is assembly. Code assistance for below: It's supposed to output like the picture above but when it prints the first variable on-screen it's wrong
This is assembly. Code assistance for below: It's supposed to output like the picture above but when it prints the first variable on-screen it's wrong and just a jumble of numbers. I don't need new code just a fix on this code. The code below is what I'm getting. INCLUDE asmlib.inc .data prompt BYTE "Enter a number ", 0 outP BYTE "The difference of your numbers is ", 0 outP2 BYTE "First variable: ", 0 outP3 BYTE "Second variable: ", 0 val1 DWORD ? val2 DWORD ? .code main PROC mov edx, OFFSET prompt call writeLine call readInt mov val1, eax ; Prompt second number mov edx, OFFSET prompt call writeLine call readInt mov val2, eax sub eax, val1 mov edx, OFFSET outP call writeLine call writeInt xor eax, ebx xor ebx, eax xor eax, ebx mov ecx, eax mov ecx, ebx mov edx, OFFSET outP2 call writeLine call writeInt mov edx, val2 call writeInt mov edx, OFFSET outP3 call writeLine mov eax, val1 call writeInt exit main ENDP END mainUse the code that was given in the video to perform the following tasks: Create two DWORD variables. Prompt for input and store the values input from the keyboard into the variables. Subtract the second number from the first and output the difference. Using logic swap the values in the two variables with each other. Output the swapped values. Here is an example of how your program should run: nter a number nter a number he difference of your numbers is 2First variable: 383219213832192/ Second variable
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