Hi all, I am new to this forum, I am hope somebody can point me to the right direction if I am asking in the wrong place...

I have a lot of code written for the ASM286 compiler, which I am trying to run somewhere. Because it is a complex task, I am currently attempting to start by running the sample code that came with the ASM286 instruction manual: the program MMGAME.asm. I have compiled it successfully, and because it has a line:
EXTRN CI:FAR,CO:FAR
referencing input/output functions which are likely in the libraries udi.gat nuc.gat upifl.lib nucifl.lib which I do not have, I have replaced the calls with stubs, no problem (for now...!).

I am thus able to compile it OK, and I can even use BND286 and BLD286 to link them. To do this, I follow the steps indicated in the manual for BND286 and BLD286. The problem is, the end-product which the manual says is a DOS executable looks like nothing known. I was expecting an "MZ-type" executable (like the file ASM286.exe itself) instead I get something which looks suspiciously similar to an obj file. If I try to execute it (under DOS in WXP of course) I simply get the prompt back. Even if I change the code to an infinite loop...! So it is probably NOT running it. But I have no warnings and no errors throughout the compile/link/run cycle, I do not know what to do next.

So what am I doing wrong? Do I really need those libraries? Where do I find them? Google does not help... plus I cannot believe that simply adding extra libraries to the link process will change the output format.
Has anyone any memory of how this ancient compiler/linker worked? Thank you VERY MUCH in advance for you help!

> I have a lot of code written for the ASM286 compiler
Rewrite it in a compiled language of your choice.

> which are likely in the libraries udi.gat nuc.gat upifl.lib nucifl.lib which I do not have
Another reason to rewrite.

> So what am I doing wrong?
You're digging too deep into the past.
FWIW, I think you need to look at LNK286 if you want to run something on DOS.
IIRC, things like BIND are for producing absolute images you can put in ROM (like the BIOS).

Hello! Thank you for your reply.

Rewrite is unfortunately NOT an option. Would you rewrite the original autopilot software of the A320 (the aircraft)?
Exactly, I did not think so. Plus, it has to be that same code for certification reasons.

You may be right about LNK286 (which I do not have: do you?)
but the manual for BND286 specifically states that compilation with certain flags (which I used) will produce an executable ready to run on DOS. The compiler itself is made to run on DOS, so I tend to believe the manual. And there is no mention of LNK286 in the list of utilities...

>> So what am I doing wrong?
>You're digging too deep into the past.
Unfortunately, that is really what I am doing wrong. You are right. But I have no other option.

Do you know if there is an easy way to convert absolute images into executables? I would do it in Linux, preferably, even!
The hard way would be to create an MZ-format hollow executable and slip in the binary stuff. Do you have any experience or useful links for that?

Thank you again!

> Rewrite is unfortunately NOT an option. Would you rewrite the original autopilot software of the A320 (the aircraft)?
> Exactly, I did not think so. Plus, it has to be that same code for certification reasons.
So is this some anecdote, or are you really faced with this situation?

> but the manual for BND286 specifically states that compilation with certain flags
Can't help you there - If the manual says do it, then go with that.

I don't have those tools, and haven't used them since - well, since about 1985 as you put it.

Did all the files come with a readme.txt?
What about a "build.bat" or some other kind of script to basically build everything.

... it is not an anecdote, I have the real code.

From what you are saying, I think I am left with only the option of building the executable myself.

Based on your experience, and knowing that
1) the code is mainly math calculations and memory buffer copy: no print/user input
2) there are no system calls: the only "int" instruction I can find is a single "int 34"
3) I will have to figure out how to get rid of the "protected mode" switch because it is apparently not supported on modern CPUs like it was on the 286,

do you suggest using Linux or DOS for an attempt to insert the binary image I have into an executable? Has this any chance of success? Been done before? Mind you that I can fix the sources and recompile, so for this reason I am using as a test case a "guess the number" example that I found in the ASM manual. Once I can run that successfully, I will get busy with the real code.
Obviously I am going to do this on an x86-compatible CPU.

Any help is appreciated!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.