From: Jim M. <jmi...@ya...> - 2012-02-03 05:46:13
|
technically, you can have i386 instructions in it or i686 instructions in it or whatever. but according to the wikipedia article, you are limited to a single *segment*. if you define *that* as 16-bit, then OK. basically you are working in real mode. .com's don't have to be 16-bit. you can write it for whatever proc you want - but you are limited as to the size of the file unfortunately. If you really wanted to extend it, I don't know if you can ring-0 it and piggyback data on the end of the file or not. that would of course be entirely defeating the purpose of a .com file (and why would anyone want do do something like this? you still need either DOS or a 32-bit version of windows or XP Mode to run it). you would still run into the problem of whether or not the program loader would be able to load your program if you are doing this at all anyway since specs are probably being violated, so it's a bad idea in the first place. the .com involves a PSP, Program Segment Prefix. I vaguely remember something about this being a JMP instruction to 0x100 where your code is expected to start, but I may be muddling this. .com is maybe good for TSR's, loading module-based programs, and utilities that basically don't do a whole lot. also, I hear of late that disreputable people are using .com's to spread malware in email because they resemble domain names, so beware of attachments that look like a URL or domain name. blah. >________________________________ > From: Werner LEMBERG <wl...@gn...> >To: min...@li...; ct...@th... >Sent: Thursday, February 2, 2012 9:20 PM >Subject: Re: [Mingw-users] Precendence of COM and EXE > > >>> Secondly, if you want to make a Windows GUI application write to a >>> console if started from a console but do nothing if started as a >>> GUI (similar to Unix applications), there is the nice trick of >>> having two binaries, `foo.com' and `foo.exe'. You say `foo' on the >>> command line, and Windows executes `foo.com', a command-line >>> program. This in turn spawns `foo.exe', a GUI program, and >>> communicates with it using stdout and friends which are redirected >>> to pipes. >> >> I can't resist my curiosity on this one. >> >> Is the .com program a 16-bit, single segment tiny mode binary? Or >> is this win32 console application renamed to .com? [...] > >AFAIK, it's a real 16-bit tiny binary. See this: > > http://code.google.com/p/dualsubsystem/ > > > Werner > >------------------------------------------------------------------------------ >Try before you buy = See our experts in action! >The most comprehensive online learning library for Microsoft developers >is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, >Metro Style Apps, more. Free future releases when you subscribe now! >http://p.sf.net/sfu/learndevnow-dev2 >_______________________________________________ >MinGW-users mailing list >Min...@li... > >This list observes the Etiquette found at >http://www.mingw.org/Mailing_Lists. >We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated. > >_______________________________________________ >You may change your MinGW Account Options or unsubscribe at: >https://lists.sourceforge.net/lists/listinfo/mingw-users >Also: mailto:min...@li...?subject=unsubscribe > > > |