* chew.c (paramstuff, outputdots, perform, bang and usage): Remove
[binutils.git] / gas / testsuite / gasp / macro.asm
blobdfb16bff296667bfb187acfe707836fbbdc89dd1
1 .MACRO SUM FROM=0, TO=9
2 ; \FROM \TO
3 MOV R\FROM,R10
4 COUNT .ASSIGNA \FROM+1
5 .AWHILE \&COUNT LE \TO
6 MOV R\&COUNT,R10
7 COUNT .ASSIGNA \&COUNT+1
8 .AENDW
9 .ENDM
11 SUM 0,5
12 SUM TO=5
13 SUM FROM=2, TO=5
16 ; hi this is a comment
17 .MACRO BACK_SLASH_SET
18 \(MOV #"\",R0)
19 .ENDM
20 BACK_SLASH_SET
21 .MACRO COMM
22 bar ; this comment will get copied out
23 foo \; this one will get dropped
24 .ENDM
25 COMM
26 BACK_SLASH_SET
27 .MACRO PLUS2
28 ADD #1,R\&V1
29 .SDATA "\&V'1"
30 .ENDM
31 V .ASSIGNC "R"
32 V1 .ASSIGNA 1
33 PLUS2
34 .MACRO PLUS1 P,P1
35 ADD #1,\P1
36 .SDATA "\P'1"
37 .ENDM
38 PLUS1 R,R1
40 .MACRO SUM P1
41 MOV R0,R10
42 ADD R1,R10
43 ADD R2,R10
44 \P1
45 ADD R3,R10
46 .ENDM
48 SUM .EXITM
50 .MACRO foo bar=a default=b
51 \bar
52 \default
53 bar
54 default
55 .ENDM
56 foo default=dog bar=cat
57 foo X Y
58 foo
59 foo bar=cat default=dog
62 .MACRO foo bar
64 HI \bar
66 .ENDM
68 foo 1
69 foo 123
70 foo 1 2 3 4
71 foo
74 .MACRO PUSH Rn
75 MOV.L \Rn,@-r15
76 .ENDM
77 PUSH R0
78 PUSH R1
81 .MACRO RES_STR STR, Rn
82 MOV.L #str\@,\Rn
83 BRA end_str\@
84 NOP
85 str\@ .SDATA "\STR"
86 .ALIGN 2
87 end_str\@
88 .ENDM
90 RES_STR "ONE",R0
91 RES_STR "TWO",R1
92 RES_STR "THREE",R2
96 RES_STR STR=donkey Rn=R1
97 RES_STR donkey,R1
98 RES_STR donkey Rn=R1
99 .END