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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:02:23+00:00 2026-05-18T01:02:23+00:00

I am writing a number converter between the (b h d) numbering systems ,

  • 0

I am writing a number converter between the (b h d) numbering systems , the program accepts
16 bits binary number , or 4 digits hex. or 5 decimal.

the reading procedure i wrote seems to have a problem when the decimal value is above 65535 (FFFFh) since im dealing with 16 bit registers and it cant contain larger values

i would appreciate it if you help me.

here is my read procedure:

Proc R  
       mov ah,01;read first digit
   int 21h
   mov saveal,al

   cmp al,0dh; if it is a new line break then dont read
   jz toret

   mov al,radex ; the radex value already entered by user
   mov ah,0
   mul dx
   mov dx,ax; multiplies the radex by the number entered so far to shift it 1 dig.                     

   mov al,saveal
   cmp al,65
   jge big2
   sub al,30h; taking decimal value of the character

   cont2:
   call checkerror
   mov ah,0
   add dx,ax; adding the digit to the number read so far

 loop R

 toret:
 ret 
 endp

Thanks
Nataly

  • 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-05-18T01:02:24+00:00Added an answer on May 18, 2026 at 1:02 am

    you need more bits to go above 65536 (0xFFFF) so you need a larger register, 32 bit, or another 16 bit register. Set that other 16 bit register to zero and after your add to add the digits so far, put an add with carry to add the carry bit into this next register.

    So 0xFFFF + 5 for example is 0x10004 or 0x0004 with the carry bit set, take this other register add the carry bit to it to pick up that other bit, now you have 0x0001 in the high order register and 0x0004 in the low order register.

    Absolutely no difference than if you were to do addition with pencil and paper. 99+5 = 04 with a “carry the one” to the hundreds place. And when the hundreds place overflows you carry to the next place. binary is the same just much easier. Each bit column is like a decimal column when you do it on paper, it is just invisible from bit 0 to bit 15, but the carry from bit 15 is visible so you can chain adders together and make them as arbitrarily wide as you wish.

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

Sidebar

Related Questions

I'm writing a number converter. How can I convert a integer to a binary
I'm writing program in C# for converting between model formats. The model format has
In my program, I ran into a problem writing a small number to a
I'm writing a program to input a number and draw that number of circles
I'm writing a number of articles meant to teach beginning programming concepts through the
Im writing a .net webforms app. It has a number of classes, for example
I'm writing a script in PHP that compares people together based on the number
I have a number of data classes representing various entities. Which is better: writing
I am writing this java program to find all the prime numbers up to
I am writing a program that takes letters and converts them to telephone numbers.

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.