English
Language : 

45111 Datasheet, PDF (66/184 Pages) List of Unclassifed Manufacturers – 14-DAY MONEY BACK GUARANTEE
7 The SASM Assembler
Parameter substitution will occur at any point where the reference to a formal parameter can be
identified, except within string constants.
The notation "?token" will treat the actual value of the formal parameter named by "token" as if it were a
quoted string. This may be useful to use a parameter both as part of a string and as part of an operand
to an instruction. This is implemented by quoting the actual value with ASCII unit separator characters
($1f), unless it is already so quoted.
Also, the notation "?( ... )" is available to evaluate an arbitrary well-defined expression and use its value
as the text of a single actual parameter. The value is converted to text in the current default radix.
7.4.11 Macro Examples
This section shows some selected examples on how to use macros. Nevertheless, the macro features
offered by SASM are so powerful that this section can only cover a subset of what is possible.
7.4.11.1 Simple Macros with no Parameters
CtrlLedOn
MACRO
clrb
rb.0
ENDM
CtrlLEDOff
MACRO
setb
rb.0
ENDM
These two macros simply replace CtrlLEDOn and CtrlLEDOff in the source code by clrb and setb
instructions, i.e. the sequence
CtrlLEDOn
call
CtrlLEDOff
Delay
is assembled into
clrb
call
setb
rb.0
Delay
rb.0
The advantage of using macros here, is that it is only necessary to modify the macro definitions when
another port bit shall be assigned to control the LED later.
Page 66 • SX-Key/Blitz Development System Manual 2.0 • Parallax, Inc.