.equ

The .equ statement allows the programmer to define a label which is independant of the currently active section and the location counter. All labels defined with the .equ statement belong to the const_section.

<label>    .equ    <expr>

Consider a constant that is dependent on the speed of the processor, the number of instructions the processor can execute per second. The speed has nothing to do with the location counter or the currently active section, but for convenience (we may need to refer to it many times in the source code) we will give it a symbolic name

e.g.
speed	.equ	100000
if we now need another constant that depends on speed, say number of instructions per minute we could use:
ins_per_min	.equ	speed * 60
Such constants can also be generated using the location counter. Consider the situation where we need to know how many characters are in a text message. We could use the following to produce a count.
msg1		.db	"this is a text message"
msg1_len	.equ	$-msg1
A slightly more complex example to give the number of long words in a table of long words would be:
tbl	.dl	1, 2, 3, 5, 7, 11
tbl_len	.equ	($-tbl)/4		 ; there are 4 bytes in a long word

 
BEWARE:

Lables defined using .equ will not be relocated, this is because they are ment to be constants that do not rely on program or data addresses