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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:07:40+00:00 2026-05-20T12:07:40+00:00

I just started working with assembly so this is probably a really simple question,

  • 0

I just started working with assembly so this is probably a really simple question, but I can’t figure it out at all.

I have created a table with these values in it:

EDIT

  .data 

NUMS       WORD 09EEBh, 0B0CFh, 061E5h, 089EDh, 0AF17h, 0D8D1h, 06C1Dh, 0594Eh, 0CF55h 
           WORD 0AFFFh, 05B8Fh, 06164h, 01CF7h, 09A41h, 0A525h, 0A5A1h, 08F05h, 07E4Ch
           WORD 0827Ah, 090B0h, 0722Dh, 0BCCFh, 033ABh, 0DC76h, 085B6h, 0AA5Fh, 03FB3h
           WORD 04BACh, 0B822h, 07768h, 0BF1Bh, 05783h, 07EEBh, 09F22h, 0B85Bh, 05312h
           WORD 05971h, 0B1B6h, 0B16Dh, 054B3h, 073C8h, 0586Bh, 08170h, 06F16h, 092A0h
           WORD 09680h, 0A23Bh, 0B45Dh, 01E91h, 0415Ah, 0B5D9h, 02D02h, 06748h, 03D39h

NUMS_SIZE EQU $-NUMS

NUMS_LENGTH EQU (NUMS_SIZE / TYPE NUMS)

.code

But when I run my subroutine to print out all the values in NUMS in it only prints the first row. Could anyone tell me why it’s not printing the whole table?

Here’s the way I’m printing the table:

printUnsort proc  ; print out unsorted table

mov ecx, NUMS_LENGTH
mov edi,0
mov edx, OFFSET s


.WHILE ecx > 0  
    .IF pcount != 9

        mov ax, (NUMS[di])

        call WriteHexB
        call WriteString
        add edi, TYPE NUMS
        inc ax
        dec ecx
        inc pcount
    .ELSE
        Call CrLf
        mov pcount, 0
    .ENDIF
.ENDW

ret
printUnsort endp

Any help or advice would be very helpful. 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-05-20T12:07:41+00:00Added an answer on May 20, 2026 at 12:07 pm

    The problem here is that LENGTHOF (and also SIZEOF) assumes the array begins and ends with the single data declaration. In your case, this is 9 words, regardless of the fact you have 45 more words following it. There are generally two ways to fix this:

    Use a single data declaration (note the use of the line continuation):

    NUMS WORD 1, 2, 3, 4, \
              5, 6, 7, 8, \
              ...

    However, you’ll likely run into MASM’s line length limitations with your declaration on a single line. Therefore, you could use this workaround by placing it immediately following your original declaration of NUMS:

    NUMS_SIZE EQU $-NUMS
    NUMS_LENGTH EQU (NUMS_SIZE / TYPE NUMS)

    And use “NUMS_LENGTH” instead of LENGTHOF NUMS. NUMS_SIZE will be the the size of the array in bytes (the current location minus where the array starts).

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

Sidebar

Related Questions

I just started working for a pretty large company and my group manages all
I've just started building a prototype application in Django. I started out by working
Issue: Just started today, all references to any assembly outside of the solution fail
Just started working with android and ran into a small problem. I am have
I have just started working with with Styles and Control Templates and have created
I have just started working at a new place and they don't have any
I've just recently started working with Visual Studio this summer, primarily on CUDA and
i have just started using visual studio 2008.I am working on c#. I want
I've just started working on an ASP.NET project which I hope to open source
I've just started working with ASP.NET MVC now that it's in beta. In my

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.