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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:00:01+00:00 2026-05-25T15:00:01+00:00

I have a very simple problem: I want to store bytes in a 1d

  • 0

I have a very simple problem:

I want to store bytes in a 1d array in masm32 (I just started with it yesterday, used c# before), and then modify it with some simple math, but I didnt found anything useful in the net.

tiles BYTE 12 dup (0) ; array of 12 bytes with value 0

this is how i declare the array in the .data section, basically what I want to do in C# syntax is:

for(int i = 0; i < tiles.Length; i++)
    tiles[i] += 2;
  • 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-25T15:00:02+00:00Added an answer on May 25, 2026 at 3:00 pm

    I can’t remember the exact directives masm32 uses, but the basic structure should be something like this:

        mov edi, addr tiles ; might be called offset, some assemblers (notably gas) would use something like lea edi, [tiles] instead
        mov ecx, 12 ; the count, this could be gotten from an equ, read from a variable etc.
    for_loop:
        add byte ptr [edi], 2 ; tiles[i] += 2
        inc edi ; move to next tile
        dec ecx ; count--
        jnz for_loop ; if (count != 0) goto for_loop
    

    Or if you want it to be structured more like the c# code:

        mov edi, addr tiles
        sub ecx, ecx ; ecx = 0
    for_loop:
        cmp ecx, 12 ; ecx < tiles.Length ?
        jnl done ; jump not less
        add byte ptr [edi+ecx], 2 ; tiles[i] += 2
        inc ecx ; i++
        jmp for_loop
    done:
    

    Notice that if you change the type of tiles some of the code will have to change (the ones involving edi in particular).

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

Sidebar

Related Questions

Very simple problem: I have a Public Sub (in a module) that I want
i have very simple problem. I need to create model, that represent element of
I have a very simple problem which requires a very quick and simple solution
I have a very simple problem and a solution that will work, but I'm
I have a very simple problem but cannot find a nice solution. I have
I have made a very simple AppleScript to close tabs in Safari. The problem
I have a very simple problem for which though I have a solution but
I have what looked to me at first glance a very simple problem. I
I have very simple select like this: SELECT * FROM table WHERE column1 IN
I have very simple window where I have 2 buttons - one for cancel,

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.