From: dnskiesling@telis.org (David Kiesling)
Subject: memory questions
I've been using PowerBasic for some time but never really understood
exactly how memory is structed. I'm very interested. I'm staring at
PowerBasic's FRE function and know it could be of use to me if I
understood memory.
It mentions the stack is used by a program for local variables in
procedures and functions, and that sounds logical to have a separate
defined area of memory for constantly-changing, appearing-disappearing
variables like that. But where is this "stack"? Is it somewhere in the
640k conventional memory? What about string segments? What's up with
those? Is that where all other strings in a program are stored? Do
numeric variables go there too?
What about RAM, and files on the hard disk? How are those structured
and how is stuff stored in those places?
What about static and dynamic variables? How are those stored/used?
If I were to dimension a dynamic string array with each variable
having a maximum (but not fixed) length of 12 (I'm thinking of 8.3
filenames here), how would I be able to tell, before dimensioning the
array, what the maximum number of elements is that I could fit into
memory? (using PowerBasic 3.5) Then, what about into EMS memory? I
want to think I just multiply the number of array elements by 12 to
get the total memory it would take up, but isn't there a certain
amount of overhead it would use as well?
Thanks for any help!
*** QwkNews (tm) v2.1
* [TN71] Internet Newsgroup: alt.lang.powerbasic
--- GEcho 1.20/Pro
---------------
* Origin: Toast House Remote (1:100/561)
|