Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

including reference to binary data in .asm files

Status
Not open for further replies.

lionelhill

Technical User
Dec 14, 2002
1,520
0
0
GB
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,
Lionel
 
lionelhill, if u r making code for windoze, why dont u include ur data as resources?
 
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...
 
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?
 
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..
 
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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top