TIP: Click on subject to list as thread! ANSI
echo: z3_pascal
to: Bob Lawrence
from: Ian Smith
date: 1996-07-26 16:17:44
subject: Memory above 64K

BL>   Your demo is doing that intentionally, but you can do it
 BL> accidentally too. If you call part of a program within itself
 BL> recursively again and again, and use a new variable each time (a large
 BL> array, say) then you need stack space for that variable each time, and
 BL> you soon run over the 64K. If this happens, you need to know how to
 BL> get around it... by using the heap instead, or re-using the same
 BL> variable, or whatever.

Not to diminish your argument; deeply recursive calls with a lot of
parameters can certainly eat up stack space pretty quickly.  However,
arrays (and other structures longer than 4 bytes, with the exception of
reals) aren't passed on the stack at all; even if not declared as VAR
parameters, these are passed as a pointer to the structure.  Turbo then
makes a local copy for the current procedure's use, as covered in Chapter
18 of the TP6 Programmer's Guide.

Ian

--- MaltEd 1.0.b5
* Origin: Magic Puddin' BBS Nimbin 066-89-1843 V.32bis/V.42 (3:626/660)
SEEN-BY: 633/267 270
@PATH: 626/660 711/401 808 50/99 635/544 727 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.