On Sun, 16 Mar 2008 14:13:35 GMT, I waved a wand and this message
magically appears in front of Bob Masta:
> >Ah, thanks I know what the error I've made - I did put all my
> >uninitialised data in the .bss section, but forgotten all about the
> >resb/d/q/t/o - I've been using db/w... Excellent, I'll save a lot of
> >space!
> >--
>
> Just remember that unless you do something to move it, the stack is at
> the top of your COM segment by default, and grows down toward that
> area you are using for BSS data. If you have a large COM app (code
> plus all data) and/or large stack needs due to recursion or whatever,
> you should either move your stack or put some of your data in its own
> segment above that. It can actually be a big help to move large data
> buffers and arrays to their own segments, becuse then you can index
> them starting at offset 0 in their segments. So the index becomes the
> pointer without needing a table offset added into every access.
Ah, stack handling - another subject I need to deal with. I understand
it's fine for tiny DOS executables; most of what I've written lately
fits in just 1K so there's not too many worries about stack handling.
For larger projects, yes I'd agree that giving the stack its own
segment would be more than sufficient to deal with recursion etc.
Should I run into problems with stack handling, are there any
references on the 'net that I can read through? It's been many years
since I dealt with that sort of thing!
--
http://www.munted.org.uk
Fearsome grindings.


|