Shane Nelson wrote: > Hi, > > I'm trying to create a nice library of > subroutines, > but when reusing them I find it a pain > to have to > go through all the EQU's, to make sure > I'm not already > using those locations in another part of > my program. > > My question: is it possible to have the > compiler > dynamically allocate memory in some way? > > ie) > Instead of having to do this: > > COUNT equ h'7' > ACCA equ h'8' > ;16bit > ACCB equ h'9' > ACCD equ h'a' > > I want to be able to get away with > something more like this: > > db = define byte > dw = define word > > db COUNT > dw ACCA > db ACCB > db ACCD > > ----- > > Then, instead of hard coding variables > it could just use the > next available space. > > Thanks in advance. > -Shane. Why don't you define the last couple of RAM addresses as local variables. Ie: local1 equ 2f local2 equ 2e etc Using the SET command to equate your local (library) variables to those global ones. Ie: count set local1 acca set local2 -- Eric van Es | Cape Town, South-Africa Mailto:vanes@ilink.nis.za | WWW: http://www.nis.za/~vanes/ TEMPORARY/HOLIDAY ACCOMMODATION? http://www.nis.za/~vanes/accom.htm