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

  • Home
  • SEARCH
  • 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 8829837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:55:35+00:00 2026-06-14T07:55:35+00:00

GetLCM PROC tryAgain: mov bx, 0 inc Multiple mov ax, UserInputNum1 ;Move UserInputNum1 to

  • 0
GetLCM PROC
tryAgain:
   mov bx, 0
   inc Multiple
   mov ax, UserInputNum1              ;Move UserInputNum1 to the 16 bit Register
   mov bx, Multiple
   div bx                             ;<-------Error here
   cmp dx,0                           ;If dx is not zero then there is a remainder
   jne tryAgain                       ;If not equal jump
ret
GetLCM ENDP

I keep getting a integer overflow error when trying to div these two numbers. It breaks when i try to use div.

I am trying to find the least common multiple of two numbers entered by the user. I decided to try to divide each number to find prime numbers first then compare each time one is found to the other number the user entered. Of course I would be doing both numbers at the same time, but as of now I am trying to just get past this error.

This is only my fifth week in ASM so I am a little confuse why this is happening.
Also I would like to add that I would also like to make this work for 32bit numbers as well. My idea is to use pointers. Is this a good way to do this?
Thanks for any help!

  • 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-14T07:55:36+00:00Added an answer on June 14, 2026 at 7:55 am

    Read up on the div instruction again. What is divided by what? You are missing to set one of the operands to some sensible value.

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

Sidebar

Related Questions

What does this error mean? Generic.h:25: error: 'Generic' is not a template type Here's
I need to stream PCM data generated at runtime. So I have a thread
I think this is a general Java question, but it does involve some Android
I am currently working on a text based web game, where in I simulate
I need to store a TDSContent into a hashmap specifying a String key. I
I'm trying to write a custom Maven plugin that will parse the SCM changelog

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.