Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This lab will focus on: Looping Compare and jump statements Printing messages to

ID: 3586316 • Letter: T

Question

This lab will focus on: Looping Compare and jump statements Printing messages to the screen Skipping lines for more readable output Steps: 1. Start by calling the irvine32.lib "Clrser" subroutine, then 2. Write a message asking for the quotient and another asking for the divisor. Read each number after printing the message 3. Code the division using iterative subtraction 4. Print the results a. The quotient is xxx b-The remainder is xxx 5. Pause the program so you can read the screen Your screen should look something like the following. You can experiment with the output format nter Quotient: 89 nter Divisor: he Quotient: 29 The Remainder: +2

Explanation / Answer

Answer :

INCLUDE Irvine32.lib ;INCLUDING IRVINE32.LIB
call divison(int, int) ;iterative subtraction method divQuotient method for division
add eax, 1
.L3:
leave
ret
.LC0:
.string "Enter Quotient and Divisor : "
.LC1:
.string "%d %d"
.LC2:
.string "The Quotient : %d The Remainder %d "
main: ;main method
call ClrScr ;calling clscr
push rbp
mov rbp, rsp
sub rsp, 16
mov edi, OFFSET FLAT:.LC0
mov eax, 0
call printf
lea rdx, [rbp-16]
lea rax, [rbp-12]
mov rsi, rax
mov edi, OFFSET FLAT:.LC1
mov eax, 0
call scanf
mov edx, DWORD PTR [rbp-16]
mov eax, DWORD PTR [rbp-12]
mov esi, edx
mov edi, eax
call divison(int, int) ;calling of divison subroutine
mov DWORD PTR [rbp-4], eax
mov edx, DWORD PTR [rbp-12]
mov eax, DWORD PTR [rbp-16]
imul eax, DWORD PTR [rbp-4]
sub edx, eax
mov eax, edx
mov DWORD PTR [rbp-8], eax
mov edx, DWORD PTR [rbp-8]
mov eax, DWORD PTR [rbp-4]
mov esi, eax
mov edi, OFFSET FLAT:.LC2
mov eax, 0
call printf
mov eax, 0
call GETCH
leave
ret

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote