@@ -4262,8 +4262,13 @@ macro actually takes in the definition. You may also leave intermediate
|
|||||||
parameters empty. Empty parameters are replaced by empty space (that is,
|
parameters empty. Empty parameters are replaced by empty space (that is,
|
||||||
they are removed when the macro is expanded). If you have a look at our
|
they are removed when the macro is expanded). If you have a look at our
|
||||||
macro definition above, you will see, that replacing the "addr" parameter
|
macro definition above, you will see, that replacing the "addr" parameter
|
||||||
by nothing will lead to wrong code in most lines. To help you, writing
|
by nothing will lead to wrong code in most lines.
|
||||||
macros with a variable parameter list, there are some control commands:
|
|
||||||
|
The names "a", "x" and "y" should be avoided for macro parameters, as these
|
||||||
|
will usually conflict with the 6502 registers.
|
||||||
|
|
||||||
|
For writing macros with a variable parameter list, control commands are
|
||||||
|
available:
|
||||||
|
|
||||||
<tt><ref id=".IFBLANK" name=".IFBLANK"></tt> tests the rest of the line and
|
<tt><ref id=".IFBLANK" name=".IFBLANK"></tt> tests the rest of the line and
|
||||||
returns true, if there are any tokens on the remainder of the line. Since
|
returns true, if there are any tokens on the remainder of the line. Since
|
||||||
@@ -4274,15 +4279,15 @@ opposite.
|
|||||||
Look at this example:
|
Look at this example:
|
||||||
|
|
||||||
<tscreen><verb>
|
<tscreen><verb>
|
||||||
.macro ldaxy a, x, y
|
.macro ldaxy i, j, k
|
||||||
.ifnblank a
|
.ifnblank i
|
||||||
lda #a
|
lda #i
|
||||||
.endif
|
.endif
|
||||||
.ifnblank x
|
.ifnblank j
|
||||||
ldx #x
|
ldx #j
|
||||||
.endif
|
.endif
|
||||||
.ifnblank y
|
.ifnblank k
|
||||||
ldy #y
|
ldy #k
|
||||||
.endif
|
.endif
|
||||||
.endmacro
|
.endmacro
|
||||||
</verb></tscreen>
|
</verb></tscreen>
|
||||||
|
|||||||
Reference in New Issue
Block a user