On Tue, 30 Mar 2004 13:07:54 +0100, Vadim Borshchev <vadim.borshchev@127.0.0.1> wrote:> To run a thingy under DOS only assemble and link are necessary. Not to > say "renaming the .hex file to an .exe file" ...The same answer as in the above posting: the link86 doesn't produce any .exe or .com file. It produces an .lnk file, which is not executable, even not, when renamed to file.exe – I tried it the latter, but I didn't seriously believe, that it would function, and it doesn’t. Bogdan
Programs compiled with Intel's ASM86 won't run under DOS operating system
Started by ●March 30, 2004
Reply by ●March 30, 20042004-03-30
Reply by ●March 30, 20042004-03-30
On Tue, 30 Mar 2004 14:48:58 GMT, Ignacio G.T. <igtorque.remove@evomer.yahoo.es> wrote:> Bogdan, try this: > ASM86 FILE.C >What do you mean by "ASM86 file.c" ? – or did you mean "ASM86 file.src" ? – we are talking about assembler, not C.> LINK86 FILE.OBJ TO FILE.EXE EXE >Now, I've also tried with the linker option "exe", but my link86 (version 2.7) doesn’t support such an option -it produces an error massage. Is there any newer version of link86, which does support this option? Could you mail it to me? It was difficult enough, to find Intel's assembler, linker, etc. nowadays, and the versions I have are the only ones, I could find. Thanks. Bogdan
Reply by ●March 30, 20042004-03-30
On Tue, 30 Mar 2004 07:58:09 +0200, Meindert Sprang <mhsprang@NOcustomSPAMware.nl> wrote:> You're take too many steps here. You only need to run the assembler and > the > linker. The linker will produce an .exe file which you can execute in > DOS.The linker doesn't produce any .exe or .com file. It produces an .lnk file, which is not executable, even not, when renamed to file.exe – I tried the latter, but I didn't seriously believe, that it would function, and it doesn't. Bogdan
Reply by ●March 30, 20042004-03-30
PISZCZ, Bogdan wrote:> I was also before aware of the fact, that an .exe at 0h and a .com at > 100h starts. But what causes the program to start at the one or at the > other one address? Is it only the .exe or the .com extension or are > there other mechanisms? Are there more differences between them?A '.com' file is merely a raw binary image which is loaded into a segment starting at 0x100 and executed. An '.exe' is structured file format containing multiple segments and relocation information. -- Wishing you good fortune, --Robin Kay-- (komadori)
Reply by ●March 30, 20042004-03-30
PISZCZ, Bogdan wrote:> On Tue, 30 Mar 2004 07:58:09 +0200, Meindert Sprang > <mhsprang@NOcustomSPAMware.nl> wrote: > > >> You're take too many steps here. You only need to run the assembler and >> the >> linker. The linker will produce an .exe file which you can execute in >> DOS. > > The linker doesn't produce any .exe or .com file. It produces an .lnk > file, which is not executable, even not, when renamed to file.exe I > tried the latter, but I didn't seriously believe, that it would function, > and it doesn't.Why not pick up MASM or TASM? and google some examples.
Reply by ●March 30, 20042004-03-30
On 2004-03-31, PISZCZ, Bogdan <b.piszcz@t-online.de> wrote:> But the .hex file is loaded into memory and launched on an embedded > system.Then there's a loader program running on the embedded system that's converting the hex file back into binary before running it.> What I don?t understand: how can an ASCII file run on a processor, > with or without OS?It isn't. It's converted back into binary before being run. -- Grant Edwards grante Yow! Yow! Are we in the at perfect mood? visi.com
Reply by ●March 31, 20042004-03-31
> > LINK86 FILE.OBJ TO FILE.EXE EXE > > > > Now, I've also tried with the linker option "exe", but my link86 (version > 2.7) doesn't support such an option -it produces an error massage. > > Is there any newer version of link86, which does support this option? > Could you mail it to me? >Your problem is obviously with the linker. It is the linker that produces the .exe file and nothing else can do it. Now, I don't have intel's linker but in dos world and x86 domain, you can use ANY linker (microsofts' or borlands' link program) to link your intel .obj files and make an exe. I'm sure you can find TASM or MASM much more easily on the web and then you can only use the link program if you really want to keep with ASM86 syntax. The options for the linker are different but there are lots of resources on web for theses programs. However, my suggestion is to switch to TASM ro MASM. The reason is after a while you'll realize that they are actually the standard by which 99.9% of ASM progams for DOS has been written and virtually any resource you find on web, like source codes or libraries are for these assemblers and ASM86 is something nobody actually use. Regards Arash ps. You may look for ASM386 as well. If you find it, the linker that comes with it should solve your problem.
Reply by ●March 31, 20042004-03-31
PISZCZ, Bogdan <b.piszcz@t-online.de> wrote:>On Tue, 30 Mar 2004 15:33:45 +0200, Meindert Sprang ><mhsprang@NOcustomSPAMware.nl> wrote: >> An .exe program starts at 0000h. And this is default when no .ORG is >> given. >> Only a .com needs to be a 0100h. > >I was also before aware of the fact, that an .exe at 0h and a .com at 100h >starts. But what causes the program to start at the one or at the other >one address? Is it only the .exe or the .com extension or are there other >mechanisms? Are there more differences between them? > >Do you know a web site or a paper printed documentation about this item? >Could you mail it to me (the latter as scanned picture, for instance, or >the author and title) ? – ThanksSearch for "Program Segment Prefix" might also help to learn to use debug. John
Reply by ●March 31, 20042004-03-31
On Wed, 31 Mar 2004 02:06:51 +0200, "PISZCZ, Bogdan" <b.piszcz@t-online.de> wrote:>On Tue, 30 Mar 2004 15:33:45 +0200, Meindert Sprang ><mhsprang@NOcustomSPAMware.nl> wrote: > >> An .exe program starts at 0000h. And this is default when no .ORG is >> given. >> Only a .com needs to be a 0100h. >> >> Meindert > >I was also before aware of the fact, that an .exe at 0h and a .com at 100h >starts. But what causes the program to start at the one or at the other >one address? Is it only the .exe or the .com extension or are there other >mechanisms? Are there more differences between them? >EXEs don't start at address 0h, they are "relocated" by the system loader (see below). COM files are a historical relic which predate modern compiler and OS features such as relocatable code and virtual memory. DOS divides memory into 16 byte "paragraphs", an address is computed by ((segment * 16) + offset). Both the segment and the offset are 16bit values, but DOS is (historically) limited to the 1MB address space of the 8086. The first few kilobytes of RAM are reserved by the BIOS and by DOS. 100h:0h (((256 *16) + 0) = 4096) was initially picked as a known safe place to load a program. You can specify other load addresses as long as you know the target memory is unused. COM files are limited to one 64KB segment for code and a total of 64KB for all program data (static and runtime) and the runtime stack. They are written using the small address model (16bit pointers) and are not relocatable (though the code may be position independent). EXE files can have multiple code and static data segments and can be written using any address model appropriate for the processor and operating system. EXE files are relocatable - the files contain addtional information which allows the operating system to put the code and static data anywhere in memory and to patch the code so it will run wherever it is located. EXE files are far more flexible than COM files and you should use them if your application is intended to run under an operating system. George ============================================== Send real email to GNEUNER2 at COMCAST dot NET
Reply by ●March 31, 20042004-03-31
On Wed, 31 Mar 2004 11:16:01 +0200, Arash Salarian <arash dot salarian at epfl dot ch> wrote:> Your problem is obviously with the linker. It is the linker that produces > the .exe file and nothing else can do it. Now, I don't have intel's > linker > but in dos world and x86 domain, you can use ANY linker (microsofts' or > borlands' link program) to link your intel .obj files and make an exe.Well, I took other linkers, and ... ... IT WORKS !!!!!!!!!!!!!!!!!!!!!!!!! Thank you very much! (Are you a Guru? :-) ) Nevertheless, both, the TASM linker and the MASM 6.11 linker produce the warning "no stack segment" or "no stack", respectively. Furthermore: the MASM6.11 linker produces another warning: "program has no starting address" but in spite of that the program does run properly (in both cases). However, in my source code I did initialise both, the stack segment and even the top of the stack although, I think, both unnecessarily (what for should I initialise the stack segment, if I don't use it?). But this initialisation doesn't prevent the linkers from producing the warnings. Regarding the warning "program has no starting address" (produced only by MASM 6.11 linker): doesn't the OS locate the program in the memory (i.e. assign the program its starting address)? Why doesn't the TASM linker complain either? One more question: Why didn't it work before - with Intel's linker? What's the difference in the function between Intel's linker and other linker? Bogdan