1* Macro test 2 .sslist 3 .text 4 .global abc, def, ghi, adr 5 6* Macro library; load and use a macro in macros.lib 7 .mlib "macros.lib" 8 9 IN_MLIB abc,def,ghi 10 11add3 .macro P1,P2,P3,ADDRP 12 ld P1,a 13 add P2,a 14 add P3,a 15 stl a,ADDRP 16 .endm 17 add3 abc, def, ghi, adr 18 19* Forced substitution within a macro 20force .macro x 21 .asg 0, x 22 .loop 8 23AUX:x: .set x 24 .eval x+1,x 25 .endloop 26 .endm 27 force 28 29* Subsripted substitution symbols 30ADDX .macro ABC 31 .var TMP 32 .asg :ABC(1):,TMP 33 .if $symcmp(TMP,"#") == 0 34 ADD ABC,A 35 .else 36 .emsg "Bad macro parameter 'ABC'" 37 .endif 38 .endm 39 ADDX #100 ; ADD #100,A 40 .end 41