APPENDIX B CREATING PROCEDURE OF ASSEMBLY SOURCE FILE (Sub tool chain)
258
EPSON
S5U1C88000C MANUAL II
WORKBENCH/DEV TOOLS/OLD ASSEMBLER
For example :
sum
macro
c,d
ld
a,[c]
add
a,d
sld
[c],a
endm
sum
total,#20
The above will be interpreted as follows :
l#20
a,[total]
a#20#20 a,#20
l#20
[total],a
If you redefine your macro definition as shown below, your input will be correctly replaced :
sum
macro
c,&d
ld
a,[c]
add
a,&d
ld
[c],a
endm
The blank characters before and after parameters and arguments will be discarded. The blank charac-
ters inside parameters and arguments, however, are valid. Please take caution in this respect. A macro
call from inside the body of the macro for a macro definition can also be done. In this case, a macro
call should be initiated at the time the macro call generates.
For example :
maca
macro
x,y
add
x,y
endm
macb
macro
x,y
maca
x,y
endm
macb
a,#2
→
add
a,#2
maca
macro
x,y
sub
x,y
endm
macb
a,#2
→
sub
a,#2
A macro call from the body of the macro can be executed according to the depth of your choice.
However, if the call enters a loop, the macro call will be suspended. Take a simple example for
instance :
add
macro
x,y
ld
a,x
add
a,y
ld
x,a
endm
When the macro defined as above is called, it is expanded as follows :
ld
a,b
add
b,#2
→
add
a,#2
ld
b,a
"add a,y" in the third line will call itself. The macro call, therefore, will not occur. It will turn out to be
a simple "add" instruction. If we take a look at a little more complicated example :
maca
macro
x,y
macb
x,y
macc
x,y
endm
Содержание S1C88 Series
Страница 4: ......
Страница 304: ......
Страница 305: ...S1C88 Family Development Tools Quick Reference ...