-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacros.inc
97 lines (87 loc) · 1.77 KB
/
macros.inc
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
.macro assertAEqualTo(expected)
cp expected
kjp(nz, fail)
.endmacro
.macro assertBEqualTo(expected)
push af
ld a, b
cp expected
kjp(nz, popOnceAndFail)
pop af
.endmacro
.macro assertCEqualTo(expected)
push af
ld a, c
cp expected
kjp(nz, popOnceAndFail)
pop af
.endmacro
.macro assertDEqualTo(expected)
push af
ld a, d
cp expected
kjp(nz, popOnceAndFail)
pop af
.endmacro
.macro assertEEqualTo(expected)
push af
ld a, e
cp expected
kjp(nz, popOnceAndFail)
pop af
.endmacro
.macro assertHEqualTo(expected)
push af
ld a, h
cp expected
kjp(nz, popOnceAndFail)
pop af
.endmacro
.macro assertLEqualTo(expected)
push af
ld a, l
cp expected
kjp(nz, popOnceAndFail)
pop af
.endmacro
.macro assertBCEqualTo(expected)
push af
ld a, b
cp (expected) >> 8
kjp(nz, popOnceAndFail)
ld a, c
cp (expected) & 0x00ff
kjp(nz, popOnceAndFail)
pop af
.endmacro
.macro assertDEEqualTo(expected)
push af
ld a, d
cp (expected) >> 8
kjp(nz, popOnceAndFail)
ld a, e
cp (expected) & 0x00ff
kjp(nz, popOnceAndFail)
pop af
.endmacro
.macro assertHLEqualTo(expected)
push af
ld a, h
cp (expected) >> 8
kjp(nz, popOnceAndFail)
ld a, l
cp (expected) & 0x00ff
kjp(nz, popOnceAndFail)
pop af
.endmacro
.macro assertIXEqualTo(expected)
push af \ push de
push ix \ pop de
ld a, d
cp (expected) >> 8
kjp(nz, popTwiceAndFail)
ld a, e
cp (expected) & 0x00ff
kjp(nz, popTwiceAndFail)
pop de \ pop af
.endmacro