AUTO - define local storage.

Usage:

auto    (symbols)[,size[,<alignment>]]
<alignment> := EVEN | ODD

Examples:

auto    (unit,format),1
auto    (aq),2,even
auto    buff,20

Where:

symbols
is a list of the desired names of the local (auto) variables. The names must be valid GMAP symbols. If "symbols" has only one element, the element need not be enclosed in parentheses. Each symbol will be defined as a stack offset.
size
gives the amount of space on the stack to be reserved for each local variable. If "size" is not specified it defaults to one.
<alignment>
is used to align the variables on an odd or even boundary. If it is used, it must consist of either the character string EVEN or ODD. If it is not given, the next available location is used.

Description:

AUTO is used to give symbol names to offsets into the stack for the function to keep its auto variables. It is permissible to use several AUTO macro calls. AUTO should not be used to reserve space for function arguments; the ARGDEF macro should be used instead.

The AUTO macro does not set up a B vector. A size specified in the AUTO macro just reserves space. If a B vector is desired, a pointer to the remaining elements must still be placed in the first element by your program. Also make sure that sufficient space is reserved; one extra word will be needed to store the pointer to the rest of the vector, and a second extra word to compensate for B's allocating n+1 words when n are asked for.

Approximate equivalent code generated:

*      auto    local,4
local  set     .aut
.aut   set     .aut+4
.lcl   set     .aut+S.LENG
.lcl   set     .lcl/2*2
ARG.1  set     .lcl+1
ARG.2  set     .lcl+2
...
ARG.5  set     .lcl+5

See Also:

expl b bmac argdef
define function arguments

Copyright © 1996, Thinkage Ltd.