flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
windwakr 27 Jan 2010, 22:37
There is no header in .com files, but one sort of gets placed before it by DOS.
http://en.wikipedia.org/wiki/Program_Segment_Prefix That's why .com files need "org 100h" at the beginning of them. DOS creates the PSP from 0-FF and puts the program at 100h. EDIT: http://en.wikipedia.org/wiki/DOS_MZ_executable Quote:
Last edited by windwakr on 28 Jan 2010, 03:05; edited 2 times in total |
|||
![]() |
|
smiddy 28 Jan 2010, 01:42
The answer to your question is difficult to answer. What windwakr has given you is correct, but it isn't the whole story. As you can imagine, the reason executable file formats have changed over time due to the needs and pressures of the times. The basics of a COM file is that they were developed for a platform with a simple (relatively compared to especially an i7) architecture with very little memory. And speaking of realative, all memory associations where relative to one segment, so the COM got loaded into say 0900:0100h and the PSP was generated in association to where the OS loaded it (PSP is a basic linked listing of chained programs BTW) and this is why your limitation with COM files FEFFh (0100h less) and within that your stack and data would reside. That doesn't mean you couldn't develop a COM file that uses multiple segments, but their initial intention was not. I've written many COM files that can use multiple segments, but if the OS is called upon to load more code after your COM you risk it being overwritten unless you do some OS modifying within the COM itself.
![]() I hope this adds to your understanding. |
|||
![]() |
|
DOS386 28 Jan 2010, 06:17
> What is a .com file?
A raw 16-bit real mode DOS executable for 8086 or compatible CPU with no header, limited to 64 KiB in size. > is it just like a DOS .exe but with no header? NO, DOS MZ .EXE uses org 0, DOS .COM uses org $0100, MZ can be > 64 KiB, .COM can't. > i have heard it is emulated, is that true? NO (you can fraud everything not necessarily excluding DOS executables, but there is no such a "feature" of DOS .COM). > whats the real difference of use a DOS .exe or a .com file? See above. smiddy wrote: Microsoft describes it with a great level of detail here: http://support.macrosoft.com/kb/65122 NO. This text refers to Win16 NE EXE, not to DOS or DOS .COM at all. ![]() BTW, the DOS subforum has a FAQ covering also this problem ![]() |
|||
![]() |
|
Teehee 28 Jan 2010, 15:23
Thanks guys.
a little question: what's the diference of format PE console to format MZ? |
|||
![]() |
|
revolution 28 Jan 2010, 15:33
format PE console: Win32 program, 32bit.
format MZ: DOS program, 16bit. A big difference. |
|||
![]() |
|
Borsuc 28 Jan 2010, 17:30
The "PE" format is another different format than MZ (DOS .exe), but it has a short "DOS-stub" at the beginning that, if run by DOS, should display a message such as "This program cannot be run in DOS mode" and exit.
The actual PE format and header follows after that. |
|||
![]() |
|
smiddy 28 Jan 2010, 19:48
DOS386 wrote: NO. This text refers to Win16 NE EXE, not to DOS or DOS .COM at all. Ouch, are you seriously pissed? I thought it has a description of legacy EXE format. I didn't realize anyone would be offended by that. Last edited by smiddy on 28 Jan 2010, 22:02; edited 1 time in total |
|||
![]() |
|
LocoDelAssembly 28 Jan 2010, 20:13
DOS386, did you know that your joke link redirects to a credit card site? (probably of phishing-like purposes for doing such practices)
|
|||
![]() |
|
DOS386 29 Jan 2010, 10:37
smiddy wrote:
NO Quote: thought it has a description of legacy EXE format. Next time study link content before boasting with it. It's legacy NE, not "legacy" DOS MZ - the MZ stub is only there to output stupid hint "Macrosoft windows is required". Quote: I didn't realize anyone would be offended by that. Next time just avoid "arguments" like pissed, especially if YOU are wrong. Quote: a little question: what's the diference of format PE console to format MZ? MZ : DOS executable, use INT $21 + other INT's PE : usually Win32 executable, use imports + API, no INT's but also: PE : a PE-based 32-bit DOS extender, use INT $21 + other INT's, but care about protected mode http://board.flatassembler.net/topic.php?t=8670 !!! Quote: that your joke link redirects to a credit card COOL ![]() BTW: NE, LE, LX and PE formats are hacked "on the top" of MZ (good design, isn't it ![]() ![]() |
|||
![]() |
|
smiddy 29 Jan 2010, 11:48
Ah I see, it is not ok to ever be wrong...the spirit of this place is to learn (wrong being so absolute, which my post wasn't entirely wrong, it was a further perspective). You are not very encouraging. I never boasted...I simply offered details on an EXE executable, which are realavent to the discussion.
|
|||
![]() |
|
LocoDelAssembly 29 Jan 2010, 17:23
Quote:
What he should say instead? ![]() What amount of unneeded rudeness BTW... Also, since you seek for perfection many thanks for not editing your joke link so we can still help that probably malicious site to get more hits... |
|||
![]() |
|
Borsuc 29 Jan 2010, 19:23
Chill out guys.
|
|||
![]() |
|
bitshifter 29 Jan 2010, 19:54
Sometimes DOS386 will SHOUT at us
but its ok, he is just trying to help in his own way... We are all friends here so forget about anything like that. |
|||
![]() |
|
DOS386 30 Jan 2010, 09:58
LocoDelAssembly wrote: What amount of unneeded rudeness BTW... Who ? Some moderator other than me or Loco please fix or kill this thread ... for me it's done, EOD |
|||
![]() |
|
sinsi 30 Jan 2010, 10:10
edited by a now sober sinsi...apologies
dos386 has an agenda, who knows what it is. Late to answer, shouting, 'I know and you dont', and this person is a mod? sorry, the dos forum has gone downhill recently... Nice fucking link you wanker. Sick of your narrow-minded I-know-best crap. I agree, some responsible mod should kill this thread. Last edited by sinsi on 30 Jan 2010, 23:46; edited 1 time in total |
|||
![]() |
|
LocoDelAssembly 30 Jan 2010, 16:41
Quote:
His participation on this thread is the part that I don't like the most... |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.