a few assembly questions

Started by
3 comments, last by CableGuy 15 years, 5 months ago
i'm working through some x86 assembly, and i've got a couple of simple questions 1: what are the fundamental differences between binary(COM) and executable(EXE) files, what are the things i should consider when writing one or the other in regards to layout, needed sections,etc...? 2:are all BIOS interrupts availible when writing and running assembly in windows?(Vista 32bit) 3:pertaining to the first question, COM files use the flat memory model right? therefore no care is needed when it comes to segments? other than the memory limit, are there any other difference? thanks
--------------------------------------Not All Martyrs See Divinity, But At Least You Tried
Advertisement
and two more

4:why must com files have an offset of 0x100

5:is there any difference between teh notations 0x05, and 0fh?


thanks a lot
--------------------------------------Not All Martyrs See Divinity, But At Least You Tried
1. COM files don't have a header - It just starts with the first instruction to be executed. COM files are limited to under 64K total. EXE files are a lot more complex and don't have the 64K limit.

2. Not really. The NT-based windows kernels pretty much prevent you from using any of the BIOS stuff directly. However, you might be able to access that kind of stuff in a kernel mode driver. I'm no expert on drivers, so I can't say for sure.

3. COM files put everything in a single segment. So it feels a lot like flat memory model even if it's not exactly the same.

4. Just a convention I guess. The format is ancient, so there may have been a reason.

5. They both mean the same thing, but you usually only see 0x in C-based languages, and the 'h' suffix in assembly language.
Quote:Original post by godsenddeath
5:is there any difference between teh notations 0x05, and 0fh?

Yes, the former equals the value 5, wheras the latter equals the value 15.
Quote:
4:why must com files have an offset of 0x100

When the COM is loaded the first 256 bytes store the PSP (Program segment prefix).

This topic is closed to new replies.

Advertisement