Equates

Status
Not open for further replies.

Wp100

Well-Known Member
Hi All,

A little problem in that I was trying to help someone else but realised I did not understand things properly my self.

I have seen the recent EQU v DEF thread but it does not help clarify the point.

Typically in books you see the authors use code examples like this


STATUS EQU 03
Z EQU 2
COUNTER EQU 0C : 16C71 chip

When using the EQU with the COUNTER label, the expression value creates a entry in ram for that label.

When using the label Z it save the value of 2.
Address 2 is the PCL so must assume it does not replace that - so where is the value held once programmed ?

Similarly what determines if its a user register is to be created or a value to be retained ? - is it simply the fact you would write to the user register ?

thanks
 
You're imagining there's more to it than there is, essentially all EQU does is a simple text search and replace - it doesn't allocate RAM or anything like that. All that Counter line above does is replace every appearance of 'Counter' in the source code with '2' instead. Likewise the INC file, it's basically a simple text search and replace.
 

hi Nigel,
Is that a typo for 'Counter' replaced by 2.?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…