-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patht65_inc_16.a65
112 lines (86 loc) · 1.56 KB
/
t65_inc_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
; Test the inc_16 macro.
.include "test65.i65"
.include "../asminc/set_16.i65"
.include "../asminc/inc_16.i65"
.export _main
.pc02
.zeropage
zpv: .res 2
ptr: .res 2
.data
abv: .res 12
.code
_main:
; Use macros to set the initial values.
set_16 zpv,$12FF
set_16 ptr,abv
set_16 (ptr),$12FF
ldy #10
set_16 {(ptr),y},$12FF
set_16 abv+2,$12FF
set_16 abv+4,$15FF
; Increment a zero page variable.
inc_16 zpv
; Test the low byte.
lda zpv
cmp #$00
fail_ne 10
; Test the high byte.
lda zpv+1
cmp #$13
fail_ne 11
; Use macro to increment an absolute variable.
inc_16 abv
; Test the low byte.
lda abv
cmp #$00
fail_ne 20
; Test the high byte.
lda abv+1
cmp #$13
fail_ne 21
; Use macro increment a zero page indirect variable.
inc_16 (ptr)
; Test the low byte.
lda abv
cmp #$01
fail_ne 30
; Test the high byte.
lda abv+1
cmp #$13
fail_ne 31
; Use macro to increment a zero page indirect indexed by Y variable.
ldy #10
inc_16 {(ptr),y}
; Test the low byte.
lda abv+10
cmp #$00
fail_ne 40
; Test the high byte.
lda abv+11
cmp #$13
fail_ne 41
; Use macro to increment a zero page indexed by X variable.
ldx #2
inc_16 {abv,x}
; Test the low byte.
lda abv+2
cmp #$00
fail_ne 50
; Test the high byte.
lda abv+3
cmp #$13
fail_ne 51
; Use macro to increment a zero page indexed by Y variable.
ldy #4
inc_16 {abv,y}
; Test the low byte.
lda abv+4
cmp #$00
fail_ne 60
; Test the high byte.
lda abv+5
cmp #$16
fail_ne 61
; That's all folks!
tests_pass