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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:39:49+00:00 2026-06-15T15:39:49+00:00

I’m currently working on an assembly project (MASM in combination with Dosbox), which is

  • 0

I’m currently working on an assembly project (MASM in combination with Dosbox), which is basically recreating pong for educational purposes. I wrote a function to draw sprites (byte arrays) to the video memory (mode 13h) but these sprites are starting to clutter the top half of the file (because they can be quite large, and I much prefer the artistic value of these large byte arrays in comparison to drawing from bitmaps)

I don’t really know how includes work (which is kind of the problem), but I found a file that shows me the general syntax.
For example, I could have a “DERP.INC” in combination with a “DERP.ASM” file. This ASM file would define a variable (db value) “horse” which I could export in the INC file by doing:

externdef horse:BYTE

and putting this in the ASM file:

PUBLIC horse

In the INC file, we clearly state the size of horse is one byte. Now, the sprites are defined like this:

sprite db 1, 0, 0
       db 0, 1, 0
       db 0, 0, 1 

How would I be able to export the whole byte array?

  • 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-15T15:39:50+00:00Added an answer on June 15, 2026 at 3:39 pm

    There’s no need. sprite is simply a name that will map to some address. It’s up to you to deal with how many bytes starting from that address might constitute parts of that same piece of data. One common method is something like:

    sprite db 1, 0, 0
           db 0, 1, 0
           db 0, 0, 1 
    
    sprite_len = $ - sprite
    

    Making the name public so it’s accessible from some other file doesn’t really change the situation. You’re still only making the name public. If you want to keep track of the length, you can make the name you’ve given to the length public as well. That doesn’t really export any more or less of the data though — if the receiver already knows that the sprite will always be 9 bytes long, they can work with a spite based only on its starting address, just like code in the same file would. The fact that you haven’t defined anything to specify the length of the sprite tends to indicate that your code depends on its being a fixed length — if so, just exporting sprite will work just fine.

    Bottom line: public and externdef basically make it as if the code and the data declaration were in the same file. “Exporting” the symbol doesn’t automatically give receiving code any more or less information about that symbol than if it was in the same file so the data declaration was directly visible.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I am currently running into a problem where an element is coming back from
I want use html5's new tag to play a wav file (currently only supported
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have an autohotkey script which looks up a word in a bilingual dictionary
I have an array which has BIG numbers and small numbers in it. I

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.