Self modifying code, lambda calculus - Re: ENIAC programming
Peter Coghlan
cctalk at beyondthepale.ie
Sun Sep 20 06:54:24 CDT 2015
>
> But in everything from ZX BASIC to BBC BASIC to GWBASIC, loading a
> program erases all lines of code in interpreter RAM and replaces the
> whole program with the one loaded from disk, but leaves variables etc.
> intact.
>
BBC BASIC (when running on a BBC Micro at least) does clear (most) variables
when a program is loaded. Most variables are stored in memory above the
program and if a small program was replaced by a larger program, some could get
overwritten. Acorn may have decided that it was too much trouble to figure out
whether or which variables might be affected and that it was easier to be safe
by clearing them every time a program is loaded.
BBC BASIC (on a BBC Micro) doesn't have a MERGE command or equivelant either
but it is possible to merge programs together using slight hackery. However,
once BASIC is made aware of the change, it will clear the variables so a
certain level of deviousness is required to do stuff like overlays.
Regards,
Peter Coghlan.
More information about the cctalk
mailing list