| Re: Memory allocation in DOS precising ...... stack | |||
| Re: Re: Memory allocation in DOS precising ...... stack -- NTOSKRNL.VXE | Post Reply | Top of the thread | Forum |
|
Posted by: japheth 12/10/2006, 22:10:37 |
Most DOS MZ binaries do have this structure: - code
this is valid *after* DOS has loaded it into memory. In the binary file the uninitialized data and stack parts usually are missing, but DOS knows their total size from the bytes at offset 000Ah in the MZ header. So yes, if you do a "sub sp,4000h, you have 4000h just behind your binary (+ stack). You can also define 4000h bytes of uninitialized data, then it will be located just *below* your application's stack. In both cases you *don't* need to hack the MZ header yourself, the linker will setup it properly. What stack size is good? - Good is if it is "enough" :)
"Usually" a stack size of 2 kB is enough for simple dos apps. |
| Post Reply | Where am i? Original Post Top of the thread |
|