Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

including reference to binary data in .asm files

including reference to binary data in .asm files

including reference to binary data in .asm files

Dear All,

Sorry if you've seen this before: I asked over Christmas but got no reply, maybe because everyone was off having fun (hope so!).

Does anyone happen to know how to include a reference to a large file of binary data in the middle of a tasm .asm file, so it's simply included as it stands at that point in the final linked product? I know how to include a file that is itself assembleable, but I'd rather not have to convert my data files into text files full of db ........ lines.

I'm sorry to have to ask! This is probably a very trivial, but I can't find out how to do it. The application is I'd like to include some images and template data sets in an .exe file so it runs on its own, independant of any other files and things (I like programs that you can simply copy from one place to another without finding they no longer work because some essential file is missing). The data sets were produced on a separate drawing program.

Many thanks,

RE: including reference to binary data in .asm files

lionelhill, if u r making code for windoze, why dont u include ur data as resources?

RE: including reference to binary data in .asm files

thanks for the reply. This one is actually dos (shame on me, sorry, outdated etc.). And I'm very keen to have a product that is a single exe file containing everything it needs....
I wish life were simple, sometimes...

RE: including reference to binary data in .asm files

well, looks a bit harder..
i used to masm, but i dont think there is much difference in adding binary data here, and nothing comes to mind.
probably, creating a  stat6ic library with ur data could be a solution?

RE: including reference to binary data in .asm files

the simpest solution pops last :(
u can just append ur data to the exe with copy /b and then on runtime extract the data u need from the file knowing data signatures. that's not introducing binary in asm but definetely a workaround. let me know if u found the real solution..

RE: including reference to binary data in .asm files

Thanks oleksii!
Actually you have put your finger on more or less what I am trying to do. I already have a runtime linker that allows me to dump all sorts of things at the end of my dos exe file (created in a conventional high-level language), and use them at runtime. Most of what I've put there so far is code, but there's data too. I have a joining utility that takes half-baked exe files with code in them, knocks off the exe header and attaches the remainder in sequence to the end of the exe file, adding a "tailer" with details of their locations etc so they can be retrieved as required by the runtime stuff. It looks like my best bet is to enlarge the joiner so it can take binary non-exe source files and handle them more usefully. The nice thing about incorporating the reference to binary files in the asm files would have been that I'd have been able to mix code and data more freely (OK, OK, I can hear protected mode people objecting... ) and I can add the necessary extra information about what the data is and subdivisions in it. For instance, if I want to add a series of images from individual files, I could very easily add a table of offsets to their starts, and (mis)use tasm to create an image library in whatever format I want.
Ah well, not everything works out as straightforward as it should be.

I appreciate your reply!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close