1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
.MACRO SUM FROM=0, TO=9
; \FROM \TO
MOV R\FROM,R10
COUNT .ASSIGNA \FROM+1
.AWHILE \&COUNT LE \TO
MOV R\&COUNT,R10
COUNT .ASSIGNA \&COUNT+1
.AENDW
.ENDM
SUM 0,5
SUM TO=5
SUM FROM=2, TO=5
; hi this is a comment
.MACRO BACK_SLASH_SET
\(MOV #"\",R0)
.ENDM
BACK_SLASH_SET
.MACRO COMM
bar ; this comment will get copied out
foo \; this one will get dropped
.ENDM
COMM
BACK_SLASH_SET
.MACRO PLUS2
ADD #1,R\&V1
.SDATA "\&V'1"
.ENDM
V .ASSIGNC "R"
V1 .ASSIGNA 1
PLUS2
.MACRO PLUS1 P,P1
ADD #1,\P1
.SDATA "\P'1"
.ENDM
PLUS1 R,R1
.MACRO SUM P1
MOV R0,R10
ADD R1,R10
ADD R2,R10
\P1
ADD R3,R10
.ENDM
SUM .EXITM
.MACRO foo bar=a default=b
\bar
\default
bar
default
.ENDM
foo default=dog bar=cat
foo X Y
foo
foo bar=cat default=dog
.MACRO foo bar
HI
HI \bar
HI
.ENDM
foo 1
foo 123
foo 1 2 3 4
foo
.MACRO PUSH Rn
MOV.L \Rn,@-r15
.ENDM
PUSH R0
PUSH R1
.MACRO RES_STR STR, Rn
MOV.L #str\@,\Rn
BRA end_str\@
NOP
str\@ .SDATA "\STR"
.ALIGN 2
end_str\@
.ENDM
RES_STR "ONE",R0
RES_STR "TWO",R1
RES_STR "THREE",R2
RES_STR STR=donkey Rn=R1
RES_STR donkey,R1
RES_STR donkey Rn=R1
.END
|