-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patht65_set_16.a65
263 lines (219 loc) · 3.23 KB
/
t65_set_16.a65
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
; Test the set_16 macro.
.include "test65.i65"
.include "../asminc/set_16.i65"
.export _main
.pc02
.zeropage
zpv: .res 2
.data
abv: .res 12
.code
_main:
; Use macro to set zero page variable.
set_16 zpv,$0000
lda zpv
fail_ne 10
lda zpv+1
fail_ne 11
set_16 zpv,$0001
lda zpv
cmp #$01
fail_ne 12
lda zpv+1
fail_ne 13
set_16 zpv,$0100
lda zpv
fail_ne 14
lda zpv+1
cmp #$01
fail_ne 15
set_16 zpv,$1234
lda zpv
cmp #$34
fail_ne 16
lda zpv+1
cmp #$12
fail_ne 17
set_16 zpv,exit
lda zpv
cmp #$F9
fail_ne 18
lda zpv+1
cmp #$FF
fail_ne 19
; Use macro to set absolute variable.
set_16 abv,$0000
lda abv
fail_ne 20
lda abv+1
fail_ne 21
set_16 abv,$0001
lda abv
cmp #$01
fail_ne 22
lda abv+1
fail_ne 23
set_16 abv,$0100
lda abv
fail_ne 24
lda abv+1
cmp #$01
fail_ne 25
set_16 abv,$1234
lda abv
cmp #$34
fail_ne 26
lda abv+1
cmp #$12
fail_ne 27
set_16 abv,exit
lda abv
cmp #$F9
fail_ne 28
lda abv+1
cmp #$FF
fail_ne 29
; Use macro to set zero page indirect variable.
set_16 zpv,abv
set_16 (zpv), $0000
lda abv
fail_ne 30
lda abv+1
fail_ne 31
set_16 (zpv), $0001
lda abv
cmp #$01
fail_ne 32
lda abv+1
fail_ne 33
set_16 (zpv), $0100
lda abv
fail_ne 34
lda abv+1
cmp #$01
fail_ne 35
set_16 (zpv), $1234
lda abv
cmp #$34
fail_ne 36
lda abv+1
cmp #$12
fail_ne 37
set_16 (zpv), exit
lda abv
cmp #$F9
fail_ne 38
lda abv+1
cmp #$FF
fail_ne 39
; Use macro to set zero page indirect indexed by Y variable.
ldy #10
set_16 {(zpv),y}, $0000
lda abv+10
fail_ne 40
lda abv+11
fail_ne 41
set_16 {(zpv),y}, $0001
lda abv+10
cmp #$01
fail_ne 42
lda abv+11
fail_ne 43
set_16 {(zpv),y}, $0100
lda abv+10
fail_ne 44
lda abv+11
cmp #$01
fail_ne 45
set_16 {(zpv),y}, $1234
lda abv+10
cmp #$34
fail_ne 46
lda abv+11
cmp #$12
fail_ne 47
set_16 {(zpv),y}, exit
lda abv+10
cmp #$F9
fail_ne 48
lda abv+11
cmp #$FF
fail_ne 49
; Special test for use of an intermediate variable.
zpvp2 = zpv+2
set_16 zpvp2,$FF00
set_16 (zpvp2),$1234
lda $FF00
cmp #$34
fail_ne 50
lda $FF01
cmp #$12
fail_ne 51
; Use macro to set absolute indexed by X variable.
ldx #10
set_16 {abv,x},$0000
lda abv+10
fail_ne 60
lda abv+11
fail_ne 61
set_16 {abv,x},$0001
lda abv+10
cmp #$01
fail_ne 62
lda abv+11
fail_ne 63
set_16 {abv,x},$0100
lda abv+10
fail_ne 64
lda abv+11
cmp #$01
fail_ne 65
set_16 {abv,x},$1234
lda abv+10
cmp #$34
fail_ne 66
lda abv+11
cmp #$12
fail_ne 67
set_16 {abv,x},exit
lda abv+10
cmp #$F9
fail_ne 68
lda abv+11
cmp #$FF
fail_ne 69
; Use macro to set absolute indexed by Y variable.
ldy #8
set_16 {abv,y},$0000
lda abv+8
fail_ne 70
lda abv+9
fail_ne 71
set_16 {abv,y},$0001
lda abv+8
cmp #$01
fail_ne 72
lda abv+9
fail_ne 73
set_16 {abv,y},$0100
lda abv+8
fail_ne 74
lda abv+9
cmp #$01
fail_ne 75
set_16 {abv,y},$1234
lda abv+8
cmp #$34
fail_ne 76
lda abv+9
cmp #$12
fail_ne 77
set_16 {abv,y},exit
lda abv+8
cmp #$F9
fail_ne 78
lda abv+9
cmp #$FF
fail_ne 79
; That's all folks!
tests_pass