Specifications

4-4 Programmer’s Guide Sega
Psy-Q Development System
SET
Description Assigns the result of the expression, as a variable, to the preceding symbolic name.
Syntax symbol name SET expression
symbol name = expression
See Also EQU
Remarks
SET and equals (=) are interchangeable
Values assigned by a SET directive may be re-assigned at any time.
The Assembler does not allow the assigned expression in a SET directive to
contain forward references. If a SET cannot be evaluated as it is currently
defined, an error is generated.
If the symbol itself is used before it is defined, a warning is generated, and it is
assigned the value determined by the preliminary pass of the Assembler.
The symbol in a SET directive does not assume the type of the operand. It is,
therefore, better suited to setting local values, such as in macros, rather than in
code with a relative start position, such as a SECTION construct, which may
cause an error - see Examples.
Examples Loopcount set 0
GrandTotal = SubTotalA+SubTotalB
xdim set Bsize<<SC
cbb macro string
lc = 0
rept strlen(\string)
cc substr lc+1,lc+1,\string
dc.b '\cc'^($A5+lc)
lc = lc+1
endr
endm