John J. McDonough wrote : > From: "Andrew Warren" > > > This is in contrast to what I think of as "real" allocation... > > Which would be the sort of thing you see in high-level > > languages, where (generally speaking) once a variable name is > > declared/used, other variable names will never be assigned to > > the same RAM. > > I'm not so sure I see the difference. > > The only time memory reserved by a res directive will be > re-used for another variable is when the res directive is > in the context of a udata_ovr,... Or, as Andrew implied (if I'm not wrong ?) if you are EQU'ing the same RAM address to a symbol and use that one to "re-use" the same address that was also RES'ed. The address allocated (note that the MPASM manual exclusivly use the term "reserved", if it makes any difference) is not "locked" from re-/miss-use by EQU's and CBLOCK's in the same application. By *exclusively* using the RES directive for RAM, you should be safe against that kind of misstakes. > where you are declaring your intention that it be re-used, > and have control over how. At least some high level > languages have a similar capability, or at > least had back when memory was scarce. COMMON blocks in Fortran. Was used to share a common storage spage (RAM) between different modules/subroutines in the same app, or between different applications that mapped (linked) the a "system global" COMMON area. Still useable now when memory is cheap... Jan-Erik. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist