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 7973601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:09:07+00:00 2026-06-04T08:09:07+00:00

Here is my code: .data ans1 db 0 ans2 db 0 .data? in1 db

  • 0

Here is my code:

.data
        ans1 db 0
        ans2 db 0
.data? 
        in1 db 100 dup(?) ; first input value
        in2 db 100 dup(?) ; second input value
.code
start:
        ; here I have code for input 
        ; I get 2 nums, and I want to multiply and divide them
        ; here is what I already have to mul/div them:
        lea eax, in1
        lea edx, in2
        imul eax ; multiply in1 and in2
        mov ans1, eax ; move result to ans1
        xor eax, eax ; clear register
        xor edx, edx ; " "
        lea eax, in1
        lea edx, in2
        idiv eax ; divide in1 by in2
        mov ans2, eax ; move result to ans2
        lea eax, ans1
        push eax
        call StdOut ; print ans1 (I have include instructions at the start)
        lea ebx, ans2
        push ebx  
        call StdOut ; print ans2 ("")

My question:
1. Exactly which register do I put in1 and in2 to multiply them?
2. ” ” to divide them?
3. Where is the remainder stored in a division?

And don’t worry about a general statement, could you just tell me which registers will definitely (as close as possible) work in multiplication and division.

NOTE:
Some may say that this post is a repetition of x86 assembly – masm32: absolute breakdown of multiplication and division , but (correct me if I am wrong) it is more respectful of the forum community to make a new post, rather than add comments to the old one and make it off topic.

  • 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-04T08:09:09+00:00Added an answer on June 4, 2026 at 8:09 am

    If you’re writing assembly, you should never be too far away from the reference spec:

    Unsigned multiply (AX ← AL ∗ r/m8).
    

    Tells you everything you need to know. The result will be placed in AX. The sources are AL and any 8 bit register or memory location.

    EDIT

    Your question isn’t/wasn’t formatted correctly, your questions were on the same line.

    Division is DIV:

    Unsigned divide AX by r/m8, with result stored in AL ← Quotient, AH ← Remainder
    

    Seriously: read the manual.

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

Sidebar

Related Questions

I have some troubles with receiving data on server side. Here goes the code:
Here's my code for reading my db data: OdbcDataReader rdr = cmd.ExecuteReader(); while (rdr.Read())
here is my code:(get file line num and word count) import System.IO import Data.Maybe
I want display data from database in Listbox...Here is my code, It is not
How do I print the ms access data(.mdb) in vb.net? Here is the code
I am trying to get some form data from POST method. Here's the code
Here is my jQuery code: $.get('/Home/GetList', function(data) { debugger; $('#myMultiSelect').val(data); }); Here is my
Here is the sample code, which produces interesting output: > gg<-data.frame(x=c(a,b),y=as.integer(c(1000,100000))) > gg x
Here is the object and global namespace for my Javascript code. Users.Cache.data = {
Here is a simplified version of my Code: data Bookmark = Bookmark { url

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.