localX

localX <namelist>, size

The localX macro defines one or more frame variables for the function. To keep the words in the stack aligned, the macro ensures that the total space allocated is an even number of bytes.

Parameters

X

Specifies the storage size. This parameter can be one of the following types:

Type Description

B Byte (allocates a single byte of storage on the stack)
W Word (allocated on a word boundary)
D Doubleword (allocated on a word boundary)
V Variable size (allocated on a word boundary)
Q Quadruple word (aligned on a word boundary)
T 10-byte word (aligned on a word boundary)
CP Code pointer (one word for small and compact models)
DP Data pointer (one word for small and medium models)

namelist

Specifies the list of the names of the frame variables for the function.

size

Specifies the size of the variable. It is used with the localV macro only.

Comments

B-type variables are not necessarily aligned on word boundaries.

The localD macro creates two additional symbols, OFF_name and SEG_name. OFF_name is the offset portion of the parameter and SEG_name is the segment portion.

Only the name is required when referencing a variable. Write your code in the following manner:

mov     al,var1

It should not be written like this:

mov     al,byte ptr var1[bp]

Examples

The following examples demonstrate the usage of the localX macro:

localB <L1,L2,L3>
localW L4
localD <L5>
localV L6,%(size struc)