Can you show me the screen shot of the output consoleof the following assembly code

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Can you show me the screen shot of the output consoleof the following assembly code please

 

INCLUDE Irvine32.inc

.data
    multiplicand1 DWORD 65531
    multiplier1 DWORD 1029
    multiplicand2 DWORD 699050
    multiplier2 DWORD 5461
    multiplicand3 DWORD 21
    multiplier3 DWORD 178956970

.code
BitwiseMultiply PROC
    xor edx, edx        ; Clear edx
    mov ecx, eax        ; Save multiplier in ecx
    mov eax, ebx        ; Move multiplicand to eax
    mov ebx, 0          ; Clear ebx
loop_start:
    test cl, 1          ; Check if the lowest bit of the multiplier is set
    jz shift_left       ; If not, skip to shift_left
    add ebx, eax        ; Add multiplicand to product
shift_left:
    shl eax, 1          ; Shift multiplicand left by 1 bit
    rcl edx, 1          ; Rotate the carry flag into edx
    shr cl, 1           ; Shift the multiplier right by 1 bit
    jnz loop_start      ; Loop until the multiplier is zero
    mov eax, ebx        ; Move the result back to eax
    ret
BitwiseMultiply ENDP

main PROC
    ; Test case 1
    mov ebx, multiplicand1
    mov eax, multiplier1
    call BitwiseMultiply
    ; Display the result
    mov ecx, eax
    call display_result
    call crlf

    ; Test case 2
    mov ebx, multiplicand2
    mov eax, multiplier2
    call BitwiseMultiply
    ; Display the result
    mov ecx, eax
    call display_result
    call crlf

    ; Test case 3
    mov ebx, multiplicand3
    mov eax, multiplier3
    call BitwiseMultiply
    ; Display the result
    mov ecx, eax
    call display_result
    call crlf

    exit
main ENDP

display_result PROC
    ; Convert the result to a string and display it
    push ecx
    mov ecx, 10
    xor edx, edx
    div ecx
    push edx
    test eax, eax
    jz print_digit
print_next_digit:
    div ecx
    push edx
    test eax, eax
    jnz print_next_digit
print_digit:
    pop edx
    add dl, '0'
    mov [result], dl
    mov edx, OFFSET result
    call WriteString
    pop ecx
    ret
display_result ENDP

.data
    result BYTE ?

END main

Expert Solution
steps

Step by step

Solved in 5 steps with 5 images

Blurred answer
Knowledge Booster
Top down approach design
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education