-
Notifications
You must be signed in to change notification settings - Fork 1
/
code try6.asm
245 lines (245 loc) · 2.42 KB
/
code try6.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
const pcr 64
CONST pcd 65
const joy 66
CONST CT 69
CONST DIR 4
CONST TEMP 0
CONST DEL_TIME 5
CONST DEL1 1
CONST DEL2 2
CONST DEL3 3
CONST STARTPOS 234
start:
MOVE 32 DEL_TIME
MOVE STARTPOS PCR
MOVE 0 PCD
L1:
cmp joy IMED 0
add joy IMED 0 DIR
NOP
BRF L1 Z
NOP
CMP DIR IMED 7
NOP
BRF UP Z
CMP DIR IMED 6
NOP
BRF DOWN Z
CMP DIR IMED 5
NOP
BRF RIGHT Z
NOP
CMP DIR IMED 4
NOP
BRF LEFT Z
NOP
BRA START
NOP
UP:
SUB PCR IMED 16 PCR
NOP
NOP
NOP
CMP CT IMED 1
NOP
BRF UP2 Z
NOP
MOVE 240 PCD
USTEP:
BRA DEL
NOP
USTEP.1:
SUB PCD IMED 16 PCD
NOP
BRF UC Z
NOP
BRA USTEP
NOP
UC:
CMP CT IMED 2
NOP
BRF POST Z
CMP CT IMED 3
NOP
BRF GOAL Z
NOP
BRA UP
NOP
UP2:
ADD PCR IMED 16 PCR
BRA POST
NOP
DOWN:
ADD PCR IMED 16 PCR
NOP
NOP
NOP
CMP CT IMED 1
NOP
BRF DOWN2 Z
NOP
SUB PCR IMED 16 PCR
DSTEP:
BRA DEL
NOP
DSTEP.1:
ADD PCD IMED 16 PCD
NOP
NOP
CMP PCD IMED 0
NOP
BRF DC Z
NOP
BRA DSTEP
NOP
DC:
ADD PCR IMED 16 PCR
NOP
NOP
NOP
CMP CT IMED 2
NOP
BRF POST Z
CMP CT IMED 3
NOP
BRF GOAL Z
NOP
BRA DOWN
NOP
DOWN2:
SUB PCR IMED 16 PCR
BRA POST
NOP
LEFT:
SUB PCR IMED 1 PCR
NOP
NOP
NOP
CMP CT IMED 1
NOP
BRF LEFT2 Z
NOP
MOVE 15 PCD
LSTEP:
BRA DEL
NOP
LSTEP.1:
SUB PCD IMED 1 PCD
NOP
BRF LC Z
NOP
BRA LSTEP
NOP
LC:
MOVE 0 PCD
CMP CT IMED 2
NOP
BRF POST Z
CMP CT IMED 3
NOP
BRF GOAL Z
NOP
BRA LEFT
NOP
LEFT2:
ADD PCR IMED 1 PCR
BRA POST
NOP
RIGHT:
ADD PCR IMED 1 PCR
NOP
NOP
NOP
CMP CT IMED 1
NOP
BRF RIGHT2 Z
NOP
SUB PCR IMED 1 PCR
RSTEP:
BRA DEL
NOP
RSTEP.1:
ADD PCD IMED 1 PCD
NOP
NOP
cmp pcd imed 15 pcd
NOP
BRF RC Z
NOP
BRA RSTEP
NOP
RC:
MOVE 0 PCD
ADD PCR IMED 1 PCR
NOP
NOP
NOP
CMP CT IMED 2
NOP
BRF POST Z
CMP CT IMED 3
NOP
BRF GOAL Z
NOP
BRA RIGHT
NOP
RIGHT2:
SUB PCR IMED 1 PCR
BRA post
NOP
POST:
CMP JOY IMED 0
NOP
BRF L1 Z
NOP
BRA POST
NOP
DEL:
ADD DEL_TIME IMED 0 DEL1
DEL.1:
ADD DEL_TIME IMED 0 DEL2
DEL.2:
ADD DEL_TIME IMED 0 DEL3
DEL.3:
SUB DEL3 IMED 1 DEL3
NOP
BRF DEL.3C Z
NOP
BRA DEL.3
NOP
DEL.3C:
SUB DEL2 IMED 1 DEL2
NOP
BRF DEL.2C Z
NOP
BRA DEL.2
NOP
DEL.2C:
SUB DEL1 IMED 1 DEL1
NOP
BRF DEL.1C Z
NOP
BRA DEL.1
NOP
DEL.1C:
CMP DIR IMED 7
NOP
BRF USTEP.1 Z
CMP DIR IMED 5
NOP
BRF RSTEP.1 Z
CMP DIR IMED 6
NOP
BRF DSTEP.1 Z
NOP
CMP DIR IMED 4
NOP
BRF LSTEP.1 Z
NOP
BRA START
NOP
GOAL:
MOVE 0 DIR
MOVE $FF DEL_TIME
BRA DEL
NOP