Parameters and local variables created by using the parmX and localX macros actually correspond to expressions of the following form:
localB x ==> x equ byte ptr [bp+nn]
parmB y ==> y equ byte ptr [bp+nn]
In this example, the nn parameter specifies an offset from the current BP register value.
These expressions let you use the names without having to explicitly type in operators. This means that x can be referred to as follows:
mov al,x
and that y can be referred to as follows:
mov ax,y
A problem arises if the type must be overridden. The assembler creates an error message if it encounters the following line:
mov ax,word ptr x
This can be solved by enclosing the name in parentheses:
mov ax,word ptr (x)
One exception to this pattern is the localV macro. The expression generated by this macro does not have a type associated with it. It can, therefore, be overridden without the parentheses:
localV horse,10 = = > horse equ [bp+nn]