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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:55:13+00:00 2026-06-08T18:55:13+00:00

I have an array that I am attempting to print. I would like to

  • 0

I have an array that I am attempting to print.
I would like to print it out so I can see if it is correct.
It is currently printing the number 1 and stopping. Or, if I mess with the ECX differently it prints out a bunch of zeros and crashes.

Here is my program.

.data

array DWORD 10 DUP(5, 7, 6, 1, 4, 3, 9, 2, 10, 8)
my_size dd 10

sorted DWORD 0
first DWORD 0
second DWORD 0

.code

start:
main proc
cls

 mov EBX, offset[array]
 mov ECX, [my_size]
 dec ECX
 sub ESI, ESI
 sub EDI, EDI

; print
mov EBX, offset aa
sub ECX, ECX
;mov ECX, my_size
mov ECX, 10

my_loop:
mov EAX, [EBX]
inc EBX
dec ECX

cmp ECX, 0
jle exit_loop

mov first, EAX
print chr$("printing array elements: ")
print str$(first)

loop  my_loop

exit_loop:
ret

main endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

end start
  • 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-08T18:55:15+00:00Added an answer on June 8, 2026 at 6:55 pm

    I see you’ve simplified the code. Good idea! I’m still not familiar with the macro you’re using, “print_str$”. That doesn’t “look” to me like it prints a number. Have you got a “print_int$” or similar? If you can get it to print just the first number “5”, that would be a good start.

    Now… working through your loop, you just “inc ebx”. That won’t get you the next dword, it’ll get you bytes 2, 3, and 4 from the first dword and the first byte from the second dword. Since you used “* 4” in the (removed) sort code, you probably want “[ebx * 4]” here. Either that, or add 4 to ebx each time through the loop. One or the other (but not both) should step through an array of dwords.

    I suspect that the first step would be to select the “right” macro to print a number. It’ll probably get easier from there(?). Courage! 🙂

    Best,
    Frank

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

Sidebar

Related Questions

I have an array that contains @sign in the object. I can't access that
I have an array that looks something like this: Array ( [0] => apple
I have an array that looks like this: [ Object actions: Array[2] comments: Object
I have an array that looks like the following: array = [[1, 5], [4,
I currently have an enquiry submission form that can only be completed by registered
I have an array that I populate with parents, children, children of children, children
I have an array that is produced from people wanting to reserve a time
I have one array that is filled by mysql_query. Values that are in this
I have an Array that contains some elements multiple times. Now I want to
I have this array that I am needing to insert into the database. 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.