-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest-passes.asm
281 lines (223 loc) · 5.38 KB
/
test-passes.asm
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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
org 8000h
include src/zx-spec.asm
spec_init
describe 'assert_pass'
it 'passes test'
assert_pass
describe 'assert_hl_equal'
it 'passes for same value'
ld hl,$0102
assert_hl_equal $0102
it "doesn't affect value of hl"
ld hl,$0102
assert_hl_equal $0102
assert_hl_equal $0102
describe 'assert_bc_equal'
it 'passes for same value'
ld bc,$0102
assert_bc_equal $0102
it "doesn't affect value of bc"
ld bc,$0102
assert_bc_equal $0102
assert_bc_equal $0102
describe 'assert_de_equal'
it 'passes for same value'
ld de,$0102
assert_de_equal $0102
it "doesn't affect value of de"
ld de,$0102
assert_de_equal $0102
assert_de_equal $0102
describe 'assert_ix_equal'
it 'passes for same value'
ld ix,$0102
assert_ix_equal $0102
it "doesn't affect value of ix"
ld ix,$0102
assert_ix_equal $0102
assert_ix_equal $0102
describe 'assert_a_equal'
it 'passes for same value'
ld a,5
assert_a_equal 5
it "doesn't affect value of a"
ld a,5
assert_a_equal 5
assert_a_equal 5
describe 'assert_b_equal'
it 'passes for same value'
ld b,5
assert_b_equal 5
it "doesn't affect value of b"
ld b,5
assert_a_equal 5
assert_a_equal 5
describe 'assert_c_equal'
it 'passes for same value'
ld c,5
assert_c_equal 5
it "doesn't affect value of c"
ld c,5
assert_a_equal 5
assert_a_equal 5
describe 'assert_d_equal'
it 'passes for same value'
ld d,5
assert_d_equal 5
it "doesn't affect value of d"
ld d,5
assert_d_equal 5
assert_d_equal 5
describe 'assert_e_equal'
it 'passes for same value'
ld e,5
assert_e_equal 5
it "doesn't affect value of e"
ld e,5
assert_e_equal 5
assert_e_equal 5
describe 'assert_h_equal'
it 'passes for same value'
ld h,5
assert_h_equal 5
it "doesn't affect value of h"
ld h,5
assert_h_equal 5
assert_h_equal 5
describe 'assert_l_equal'
it 'passes for same value'
ld l,5
assert_l_equal 5
it "doesn't affect value of l"
ld l,5
assert_l_equal 5
assert_l_equal 5
describe 'assert_a_not_equal'
it 'passes for different value'
ld a,0
assert_a_not_equal 5
describe 'assert_b_not_equal'
it 'passes for different value'
ld b,0
assert_b_not_equal 5
describe 'assert_c_not_equal'
it 'passes for different value'
ld c,0
assert_c_not_equal 5
describe 'assert_d_not_equal'
it 'passes for different value'
ld d,0
assert_d_not_equal 5
describe 'assert_e_not_equal'
it 'passes for different value'
ld e,0
assert_e_not_equal 5
describe 'assert_h_not_equal'
it 'passes for different value'
ld h,0
assert_h_not_equal 5
describe 'assert_l_not_equal'
it 'passes for different value'
ld l,0
assert_l_not_equal 5
describe 'assert_hl_not_equal'
it 'passes for different value'
ld hl,$0002
assert_hl_not_equal $0103
describe 'assert_bc_not_equal'
it 'passes for different value'
ld bc,$0002
assert_bc_not_equal $0103
describe 'assert_de_not_equal'
it 'passes for different value'
ld de,$0002
assert_de_not_equal $0103
describe 'assert_ix_not_equal'
it 'passes for different value'
ld ix,$0002
assert_ix_not_equal $0103
describe 'assert_a_is_zero'
it 'passes for zero'
ld a,0
assert_a_is_zero
describe 'assert_a_is_not_zero'
it 'passes for non-zero'
ld a,5
assert_a_is_not_zero
describe 'assert_byte_equal'
it 'passes for same value'
assert_byte_equal tmp_1, $CC
describe 'assert_byte_not_equal'
it 'passes for different value'
assert_byte_not_equal tmp_1, $DD
describe 'assert_word_equal'
it 'passes for same value'
assert_word_equal tmp_2, $DDEE
describe 'assert_word_not_equal'
it 'passes for different value'
assert_word_not_equal tmp_2, $FFAA
describe 'assert_str_equal'
it 'passes for same value'
assert_str_equal tmp_str, 'test string'
it 'supports spectrum terminated string'
assert_str_equal copyright_rom_addr, "\x7f 1982 Sinclair Research Ltd"
describe 'assert_str_not_equal'
it 'passes for different value'
assert_str_not_equal tmp_str, 'diff string'
describe 'assert_bytes_equal'
it 'passes for same value'
assert_bytes_equal bytes_1, 8, bytes_2
describe 'assert_bytes_not_equal'
it 'passes for same value'
assert_bytes_not_equal bytes_1, 8, bytes_3
describe 'assert_z_set'
it "passes when zero flag set"
ld a,0
or a
assert_z_set
describe 'assert_z_reset'
it "passes when zero flag reset"
ld a,5
or 0
assert_z_reset
describe 'assert_carry_set'
it "passes when carry flag set"
ld a,$FF
add a,1
assert_carry_set
describe 'assert_carry_reset'
it "passes when carry flag reset"
ld a,$00
add a,1
assert_carry_reset
describe 'assert_s_set'
it "passes when signed flag set"
ld a,$00
dec a
assert_s_set
describe 'assert_s_reset'
it "passes when signed flag reset"
ld a,$00
inc a
assert_s_reset
describe 'assert_p_v_set'
it "passes when overflow flag set"
ld a,$7F
inc a
assert_p_v_set
describe 'assert_p_v_reset'
it "passes when overflow flag reset"
ld a,$80
inc a
assert_p_v_reset
spec_end
ret
bytes_1 db $12,$34,$56,$78,$9A,$BC,$DE,$F0
bytes_2 db $12,$34,$56,$78,$9A,$BC,$DE,$F0
bytes_3 db $12,$34,$55,$66,$AA,$BB,$DE,$F0
tmp_1 db $CC
tmp_2 dw $DDEE
tmp_str db 'test string'
tmp_str_end equ $
copyright_rom_addr equ 1539h
end 8000h