Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8231433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:29:24+00:00 2026-06-07T17:29:24+00:00

I have a program that multiplies 3 numbers and i am trying to understand.

  • 0

I have a program that multiplies 3 numbers and i am trying to understand. I have some questions and i am hoping someone can explain whats going on with the program and tell me if i am on the right track. I understand i have more than one question so i am sorry about that.

.data?
  num1 dd ?
  num2 dd ?
  num3 dd ?

.data
sum dd 0
prod dd 0

.code

start:



main proc


mov EAX, sval(input("Enter a number: "))
mov num1, EAX
mov EAX, sval(input("Enter a number: "))
mov num2, EAX
mov EAX, sval(input("Enter a number: "))
mov num3, EAX





mov EAX, num1
mov EBX, num2
mul BL                 

mov EBX, num3
mul BX              

mov prod, EDX

this has me confused…

mov EBX, num3
mul BX

so, we are storing num3 into BL?
but since the result of num1 and num2 is 16 bit and stored into AX
we mul BX? instead of BL? but isnt num3 in BL?

im sorry there isnt one specific question. If my logic is incorrect or close can you explain whats going on piece by piece and why?

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T17:29:27+00:00Added an answer on June 7, 2026 at 5:29 pm

    When you do an 8-bit multiplication like mul bl, it takes al, multiplies it by the specified input, and puts the result in ax.

    When you do a 16-bit multiplication like mul bx, it takes ax, multiplies it by the specified input, and puts the result in dx:ax (i.e., the 16 most significant bits of the result in dx, and the 16 least significant bits of the result in ax).

    (Just for completeness): if you do a 32-bit multiplication like mul ebx, it multiplies eax by ebx, and puts the result in edx:eax (offhand I don’t remember for sure, but I’d guess 64-bit multiplication works about the same way).

    As far as BL vs. BX goes (or AL/AH/AX, etc.), what you have aren’t really separate registers — AL is really the 8 least significant bits of AX. AH is the 8 most significant bits of AX. BL is the 8 least significant bits of BX, and BH is the 8 most significant bits of BX (and so on for CL/CH/DL/DH).

    For example, if you execute code like:

    xor bx, bx
    mov bl, 1
    

    BH will then equal 0 (set to zero by the xor bx, bx), BL will equal 1 (set by the mov) and bx will also equal 1 (because it now contains the bit pattern 00000000 00000001).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to create a program that takes an input file of unsorted numbers
I have a program that scans an image and converts gems to specific numbers.
I have a program that multiple people write and edit. Some parts of the
Greetings I have a program that creates multiples instances of a class, runs the
I have a program that creates multiple text files of rdf triples. I need
I have a program that works with multiple threads. For each I set uncaught
I have program that requires Python 3, but I develop Django and it uses
I have program that has a variable that should never change. However, somehow, it
I have program that runs fast enough. I want to see the number of
I have a program that gets a JSON from the server using getJSON and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.