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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:03:58+00:00 2026-06-12T20:03:58+00:00

I am trying to write some macros in MASM to handle big numbers (i.e.

  • 0

I am trying to write some macros in MASM to handle big numbers (i.e. Numbers with values greater than can be stored in registers). However, I have run into a problem with creating bignums from constants at assemble time. It seems that MASM has limits on the size of numerical constants. What I would like to be able to do is something like this:

DECLARE_BIGINT example, 19292109310024103209481293008

But I get this error:

error A2071: initializer magnitude too large for specified size

Which I assume means that the constant was larger than MASM can handle. I thought I might be able to kludge my way around it by declaring the constant as text:

DECLARE_BIGINT example, <19292109310024103209481293008>

and then parsing digits out, but I have not been able to figure out how (or even if it’s possible) to manipulate text constants in MASM.

Any help would be greatly appreciated. Also, I’m doing this for fun, and to try to learn assembly and MASM better, so I’d rather not just use a library that does this for me (takes all of the fun out of it).

  • 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-12T20:03:59+00:00Added an answer on June 12, 2026 at 8:03 pm

    The integer constant doesn’t fit in 64 bits, which is the biggest integer any practical x86/64 assembler can possibly support these days.

    Specifically for MASM, look up the official documentation, read this page. It lists the data declaration types supported by MASM. Among them the biggest integer types are:

    QWORD = 8 bytes (or 64 bits) and
    TWORD = 10 bytes (or 80 bits).

    Your integer constant needs log2(19292109310024103209481293008) ≈ 94 bits or 12 bytes. That just won’t fit into a TWORD.

    Now, you can gain access to the individual characters of the string that comes as a parameter to the macro. Use FORC/IRPC for that.

    This would translate a string parameter into declaration of bytes, each representing the ASCII code of the respective character:

    FORC value, <012345>
    DB   '0' + value
    ENDM
    

    which is equivalent to

    DB '0'
    DB '1'
    DB '2'
    DB '3'
    DB '4'
    DB '5'
    

    But that alone isn’t going to help much.

    You might be able to do something useful with macro functions and string-manipulating macros (CATSTR, INSTR, SUBSTR). Some loops or recursion would be necessary as well to transform a string, representing a decimal integer into a sequence of bytes with the binary representation of that same integer. At the moment this doesn’t seem easy and I’m not entirely sure it’s possible.

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

Sidebar

Related Questions

Im trying to write some unit tests for a couple of merthods that are
I am currently trying to write some code that will accept some FTP details,
I am trying to write some simple code which will read a text file
I'm trying to write some html in the Html tab of TinyMCE while editing
I'm trying to write some convenience functions in Scala for reading in arrays of
I am trying to write some code that will generate accurate .proto files from
I'm trying to write some C# code to do administration on IIS. I have
I have been trying to write some code in Scala to read a file
I am trying to write some of my first code in emacs lisp and
I'm trying to write some command line PHP - is there a trick to

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.