]>
Commit | Line | Data |
---|---|---|
a16ba2b0 L |
1 | page 255\r |
2 | .z80\r | |
3 | \r | |
30d1329e | 4 | extrn ?const,?conin,?cono\r |
a16ba2b0 L |
5 | \r |
6 | global ddtz,bpent\r | |
7 | global $stack\r | |
8 | \r | |
9 | \r | |
10 | include config.inc\r | |
11 | include z180reg.inc\r | |
12 | include z180.lib\r | |
13 | \r | |
14 | BS equ 08h\r | |
15 | TAB equ 09h\r | |
16 | CR equ 0dh\r | |
17 | LF equ 0ah\r | |
18 | DEL equ 7fh\r | |
19 | CNTRX equ 'X'-'@'\r | |
20 | \r | |
21 | TPA equ 100h\r | |
22 | TOPRAM equ 0f000h\r | |
23 | \r | |
24 | \r | |
25 | MEMDUMP_CNT equ 16 ;mem dump bytes per line\r | |
26 | BP_CNT equ 12 ;number of breakbpoints\r | |
27 | \r | |
28 | \r | |
29 | ;--------------------------------------------------\r | |
30d1329e | 30 | ;\r |
a16ba2b0 L |
31 | \r |
32 | ; copy code to common memory and execute it there\r | |
33 | comst macro\r | |
34 | call ?excom\r | |
35 | ds 1\r | |
36 | ?lcs defl $\r | |
37 | endm\r | |
38 | \r | |
39 | ; mark end of common code snippet\r | |
40 | comend macro\r | |
41 | ?lce defl $\r | |
42 | ?lclen defl ?lce-?lcs\r | |
43 | org ?lcs-1\r | |
44 | db ?lclen\r | |
45 | org ?lce\r | |
46 | ifndef ?lcmax\r | |
47 | ?lcmax defl 0\r | |
48 | endif\r | |
49 | if ?lclen gt ?lcmax\r | |
50 | ?lcmax defl ?lclen\r | |
51 | endif\r | |
52 | endm\r | |
53 | \r | |
54 | ; repeat execution of last common code snippet\r | |
55 | comrep macro\r | |
56 | call ?exclst\r | |
57 | endm\r | |
58 | \r | |
59 | \r | |
60 | \r | |
61 | cseg\r | |
62 | \r | |
63 | ;----------------------------------------------------------\r | |
64 | \r | |
65 | MSG:\r | |
66 | DB 'DDT/Z - HD64180 (ROM)'\r | |
67 | DB CR,LF,0\r | |
68 | \r | |
69 | HLPMSG:\r | |
70 | DB 'DDT/Z180 (ROM) Commands:',CR,LF\r | |
71 | DB '> @ examine/substitute the displacement register @',CR,LF\r | |
72 | DB '> A [address] Assemble',CR,LF\r | |
73 | DB '> B[X] display [or clear] all Breakpoints',CR,LF\r | |
74 | DB ' B breakp [:count] [breakp..] set Breakpoints',CR,LF\r | |
75 | DB ' BX address [address..] clear Breakpoints',CR,LF\r | |
76 | DB '>>C[N][J] [count] trace over Calls [No list] [Jumps only]',CR,LF\r | |
77 | DB ' C[N][J] W|U expression trace over Calls While|Until ...',CR,LF\r | |
78 | DB '>>D [startadr] [endadr] Display memory in hex and ascii',CR,LF\r | |
79 | DB '> G [startadr] [;breakp..] Go [to start] [temporary breakpoints]',CR,LF\r | |
80 | DB '> H [expression [expression]] compute expressions / show High/max load adr.',CR,LF\r | |
81 | DB '>>I [port] Input a byte from port',CR,LF\r | |
82 | DB '>>L [startadr] [endadr] List disassembled code',CR,LF\r | |
83 | DB '> M[V] startadr endadr destadr Move memory [and verify]',CR,LF\r | |
84 | DB '>>O [byte] [port] Output a byte to port',CR,LF\r | |
85 | DB '> Q[J] startadr endadr bytes Qery memory for byte string [Justified]',CR,LF\r | |
86 | DB '> R [displacement] Read intel hex from console [add displacemt]',CR,LF\r | |
87 | DB '> S address Substitute memory',CR,LF\r | |
88 | DB '>>T[N][J] [count] Trace [No list] [Jumps only] [count steps]',CR,LF\r | |
89 | DB ' T[N][J] W|U expression Trace While|Until expression',CR,LF\r | |
90 | DB '> V startadr endadr destadr Verify (compare) two memory areas',CR,LF\r | |
91 | DB '> X[register] eXamine [and substitute] registers',CR,LF\r | |
92 | DB '> Y[0..9] eXamine [and substitute] Y variables',CR,LF\r | |
93 | DB '> Z startadr endadr bytes Zap (fill) memory with a byte string',CR,LF\r | |
94 | DB 0\r | |
95 | \r | |
96 | ddtz:\r | |
97 | ld sp,$stack\r | |
98 | ld a,(wstrtflg) ;check warm start flag\r | |
99 | or a\r | |
100 | jr nz,ddtz_w\r | |
101 | \r | |
102 | exx\r | |
103 | ld hl,sysramc\r | |
104 | ld de,topcodbeg\r | |
105 | ld bc,topcodend-topcodbeg\r | |
30d1329e L |
106 | ldir\r |
107 | \r | |
a16ba2b0 L |
108 | ld hl,vartab\r |
109 | ld de,ddtram\r | |
110 | ld bc,vartabe-vartab\r | |
30d1329e | 111 | ldir\r |
a16ba2b0 L |
112 | exx\r |
113 | \r | |
114 | ld a,e\r | |
115 | ld (ubbr),a\r | |
30d1329e | 116 | \r |
a16ba2b0 L |
117 | ddtz_w:\r |
118 | ld hl,MSG ;073c\r | |
119 | call PSTR ;073f\r | |
120 | call ddtei ;0742\r | |
121 | \r | |
122 | ; DDTZ main loop\r | |
123 | \r | |
124 | DDTZML:\r | |
125 | ld sp,$stack ;0761\r | |
126 | ld hl,l07eah ;0764\r | |
127 | ld (CMD_ERR),hl ;0767\r | |
128 | ld hl,(REG.PC) ;076a\r | |
129 | ld (OFFS.pc),hl ;076d\r | |
130 | call sub_0e68h ;0770\r | |
131 | ld hl,(CMD_RPT) ;0773\r | |
132 | ld de,DDTZML ;0776\r | |
133 | call CP.HL.DE ;0779\r | |
134 | ld a,'>' ;077c\r | |
135 | call OUTCHAR ;077e\r | |
136 | call nz,OUTCHAR ;0781\r | |
137 | call z,OUTBL ;0784\r | |
138 | call INLINE ;0787\r | |
139 | call SKIPBL ;078a\r | |
140 | jr z,exe_hl ;078d\r | |
141 | ld hl,DDTZML ;078f\r | |
142 | ld (CMD_RPT),hl ;0792\r | |
143 | inc de ;0795\r | |
144 | sub '?' ;0796\r | |
145 | jr c,ERROR ;0798\r | |
146 | cp 'Z'+1-'?' ;079a\r | |
147 | jr nc,ERROR ;079c\r | |
148 | add a,a ;079e\r | |
149 | ld hl,CMDTAB ;079f\r | |
150 | call ADD_HL_A ;07a2\r | |
151 | ld a,(hl) ;07a5\r | |
152 | inc hl ;07a6\r | |
153 | ld h,(hl) ;07a7\r | |
154 | ld l,a ;07a8\r | |
155 | jr exe_hl ;07a9\r | |
156 | ERROR:\r | |
157 | ld hl,(CMD_ERR) ;07ab\r | |
158 | exe_hl:\r | |
159 | call CALL.HL ;07ae\r | |
160 | jr DDTZML ;07b1\r | |
161 | \r | |
162 | CALL.HL:\r | |
163 | jp (hl) ;07b3\r | |
164 | \r | |
165 | \r | |
166 | CMDTAB:\r | |
167 | defw CMD.?\r | |
168 | defw CMD.@ ;07b4\r | |
169 | defw CMD.A ;07b6\r | |
170 | defw CMD.B ;07b8\r | |
171 | defw CMD.C ;07ba\r | |
172 | defw CMD.D ;07bc\r | |
173 | defw ERROR ;07be\r | |
174 | defw ERROR ;07c0\r | |
175 | defw CMD.G ;07c2\r | |
176 | defw CMD.H ;07c4\r | |
177 | defw CMD.I ;07c6\r | |
178 | defw ERROR ;07c8\r | |
179 | defw ERROR ;07ca\r | |
180 | defw CMD.L ;07cc\r | |
181 | defw CMD.M ;07ce\r | |
182 | defw ERROR ;07d0\r | |
183 | defw CMD.O ;07d2\r | |
184 | defw ERROR ;07d4\r | |
185 | defw CMD.Q ;07d6\r | |
186 | defw CMD.R ;07d8\r | |
187 | defw CMD.S ;07da\r | |
188 | defw CMD.T ;07dc\r | |
189 | defw ERROR ;07de\r | |
190 | defw CMD.V ;07e0\r | |
191 | defw ERROR ;07e2\r | |
192 | defw CMD.X ;07e4\r | |
193 | defw CMD.Y ;07e6\r | |
194 | defw CMD.Z ;07e8\r | |
195 | l07eah:\r | |
196 | ld a,'?' ;07ea\r | |
197 | call OUTCHAR ;07ec\r | |
198 | jp CRLF ;07ef\r | |
199 | \r | |
200 | CMD.?:\r | |
201 | call assert_eol\r | |
202 | ld hl,HLPMSG\r | |
203 | call PSTR\r | |
204 | ret\r | |
205 | \r | |
30d1329e L |
206 | $ci:\r |
207 | push hl\r | |
208 | push de\r | |
209 | push bc\r | |
210 | call ?conin\r | |
211 | pop bc\r | |
212 | pop de\r | |
213 | pop hl\r | |
214 | ret\r | |
215 | \r | |
216 | $co:\r | |
217 | push hl\r | |
218 | push de\r | |
219 | push bc\r | |
220 | ld c,a\r | |
221 | call ?cono\r | |
222 | pop bc\r | |
223 | pop de\r | |
224 | pop hl\r | |
225 | ret\r | |
226 | \r | |
a16ba2b0 | 227 | DELC:\r |
30d1329e L |
228 | ld a,b\r |
229 | or a\r | |
230 | ret z\r | |
231 | call DELC1\r | |
232 | dec hl\r | |
233 | dec b\r | |
234 | inc c\r | |
235 | ld a,(hl)\r | |
236 | cp ' '\r | |
237 | ret nc\r | |
238 | DELC1:\r | |
239 | push de\r | |
240 | push hl\r | |
241 | push bc\r | |
242 | ld c,BS\r | |
243 | call ?cono\r | |
244 | ld c,' '\r | |
245 | call ?cono\r | |
246 | ld c,BS\r | |
247 | call ?cono\r | |
248 | pop bc\r | |
249 | pop hl\r | |
250 | pop de\r | |
251 | ret\r | |
252 | \r | |
a16ba2b0 | 253 | DELL:\r |
3531528e L |
254 | ld a,b ;\r |
255 | or a ;\r | |
256 | ret z ;\r | |
257 | call DELC ;\r | |
258 | jr DELL ;\r | |
a16ba2b0 L |
259 | \r |
260 | INLINE:\r | |
3531528e L |
261 | push hl ;\r |
262 | ld hl,CI.BUF ;\r | |
263 | ld c,(hl) ;\r | |
264 | inc hl ;\r | |
265 | ld b,000h ;\r | |
266 | inc hl ;\r | |
a16ba2b0 | 267 | inlnxtch:\r |
3531528e L |
268 | ld a,c ;\r |
269 | or a ;\r | |
270 | jr z,inl_e ;\r | |
271 | call $ci ;\r | |
272 | cp CR ;\r | |
273 | jr z,inl_e ;Accept line\r | |
274 | cp LF ;\r | |
275 | jr z,inl_e ;Accept line\r | |
276 | cp BS ;\r | |
277 | jr nz,l0844h ;\r | |
278 | call DELC ;Delete Char\r | |
279 | jr inlnxtch ;\r | |
a16ba2b0 | 280 | l0844h:\r |
3531528e L |
281 | cp DEL ;\r |
282 | jr nz,l084dh ;\r | |
283 | call DELC ;Delete Char\r | |
284 | jr inlnxtch ;\r | |
a16ba2b0 | 285 | l084dh:\r |
3531528e L |
286 | cp CNTRX ;\r |
287 | jr nz,l0856h ;\r | |
288 | call DELL ;Delete Line\r | |
289 | jr inlnxtch ;\r | |
a16ba2b0 | 290 | l0856h:\r |
3531528e L |
291 | cp TAB ;\r |
292 | jr nz,l085ch ;\r | |
293 | ld a,' ' ;\r | |
a16ba2b0 | 294 | l085ch:\r |
3531528e L |
295 | ld (hl),a ;\r |
296 | cp ' ' ;\r | |
297 | jr nc,l0869h ;\r | |
298 | ld a,'^' ;Controle characters\r | |
299 | call $co ;\r | |
300 | ld a,(hl) ;\r | |
301 | add a,'@' ;\r | |
a16ba2b0 | 302 | l0869h:\r |
3531528e L |
303 | call $co ;\r |
304 | inc hl ;\r | |
305 | inc b ;\r | |
306 | dec c ;\r | |
307 | jr inlnxtch ;\r | |
a16ba2b0 L |
308 | \r |
309 | inl_e:\r | |
3531528e L |
310 | ld hl,ci.buf+1 ;\r |
311 | ld (hl),b ;\r | |
312 | call CRLF ;\r | |
313 | ld de,ci.buf+1 ;\r | |
314 | ld a,(de) ;\r | |
315 | ld b,a ;\r | |
316 | ld c,000h ;\r | |
317 | inc b ;\r | |
a16ba2b0 | 318 | l0880h:\r |
3531528e L |
319 | inc de ;\r |
320 | dec b ;\r | |
321 | jr z,l08b2h ;\r | |
322 | ld a,(de) ;\r | |
323 | bit 0,c ;\r | |
324 | call z,UPCASE ;\r | |
325 | ld (de),a ;\r | |
326 | cp '''' ;\r | |
327 | jr nz,l0880h ;\r | |
328 | push de ;\r | |
329 | dec de ;\r | |
330 | ld a,(de) ;\r | |
331 | cp '''' ;\r | |
332 | jr z,l08aeh ;\r | |
333 | dec de ;\r | |
334 | ld a,(de) ;\r | |
335 | cp '^' ;\r | |
336 | jr z,l08a2h ;\r | |
337 | dec de ;\r | |
338 | ld a,(de) ;\r | |
339 | cp '^' ;\r | |
340 | jr nz,l08aeh ;\r | |
a16ba2b0 | 341 | l08a2h:\r |
3531528e L |
342 | inc de ;\r |
343 | push bc ;\r | |
344 | call sub_0a0eh ;\r | |
345 | pop bc ;\r | |
346 | dec de ;\r | |
347 | ld a,(de) ;\r | |
348 | cp '''' ;\r | |
349 | jr z,l08afh ;\r | |
a16ba2b0 | 350 | l08aeh:\r |
3531528e | 351 | inc c ;\r |
a16ba2b0 | 352 | l08afh:\r |
3531528e L |
353 | pop de ;\r |
354 | jr l0880h ;\r | |
a16ba2b0 | 355 | l08b2h:\r |
3531528e L |
356 | xor a ;\r |
357 | ld (de),a ;\r | |
358 | ld de,ci.buf+2 ;\r | |
359 | pop hl ;\r | |
360 | ret ;\r | |
a16ba2b0 L |
361 | \r |
362 | UPCASE:\r | |
3531528e L |
363 | cp 'a' ;\r |
364 | ret c ;\r | |
365 | cp 'z'+1 ;\r | |
366 | ret nc ;\r | |
367 | and 05fh ;\r | |
368 | ret ;\r | |
a16ba2b0 L |
369 | \r |
370 | out.hl.@:\r | |
3531528e L |
371 | call out.hl ;\r |
372 | push de ;\r | |
373 | push hl ;\r | |
374 | ld de,(offs.@) ;\r | |
375 | ld a,d ;\r | |
376 | or e ;\r | |
377 | jr z,l08ddh ;\r | |
378 | call OUTBL ;\r | |
379 | ld a,'@' ;\r | |
380 | call OUTCHAR ;\r | |
381 | and a ;\r | |
382 | sbc hl,de ;\r | |
383 | call out.hl ;\r | |
a16ba2b0 | 384 | l08ddh:\r |
3531528e L |
385 | pop hl ;\r |
386 | pop de ;\r | |
387 | ret ;\r | |
a16ba2b0 L |
388 | \r |
389 | out.bin.w:\r | |
3531528e L |
390 | ld a,h ;\r |
391 | call out.bin.b ;\r | |
392 | ld a,l ;\r | |
a16ba2b0 | 393 | out.bin.b:\r |
3531528e | 394 | ld b,008h ;\r |
a16ba2b0 | 395 | l08e7h:\r |
3531528e L |
396 | add a,a ;\r |
397 | push af ;\r | |
398 | ld a,0 ;\r | |
399 | adc a,a ;\r | |
400 | call out.digit ;\r | |
401 | pop af ;\r | |
402 | djnz l08e7h ;\r | |
403 | ld a,'"' ;\r | |
404 | jp OUTCHAR ;\r | |
a16ba2b0 L |
405 | \r |
406 | sub_08f7h:\r | |
3531528e L |
407 | ld a,'-' ;\r |
408 | call OUTCHAR ;\r | |
409 | dec hl ;\r | |
410 | jp cpl.hl ;\r | |
a16ba2b0 L |
411 | \r |
412 | out.hl.decm:\r | |
3531528e L |
413 | push hl ;\r |
414 | call sub_08f7h ;\r | |
415 | db 3eh ; ld a,0E5h\r | |
a16ba2b0 L |
416 | out.hl.dec:\r |
417 | push hl\r | |
3531528e L |
418 | ld b,6 ;\r |
419 | call sub_0917h ;\r | |
420 | pop hl ;\r | |
421 | ld a,'.' ;\r | |
422 | call OUTCHAR ;\r | |
a16ba2b0 | 423 | l0911h:\r |
3531528e L |
424 | call OUTBL ;\r |
425 | djnz l0911h ;\r | |
426 | ret ;\r | |
a16ba2b0 L |
427 | \r |
428 | \r | |
429 | sub_0917h:\r | |
430 | dec b ;0917\r | |
431 | push de ;0918\r | |
432 | ld de,10 ;0919\r | |
433 | call DIV_HL_DE ;091c\r | |
434 | ld a,h ;091f\r | |
435 | or l ;0920\r | |
436 | call nz,sub_0917h ;0921\r | |
437 | ld a,e ;0924\r | |
438 | pop de ;0925\r | |
439 | jr out.digit ;0926\r | |
440 | \r | |
441 | sub_0928h:\r | |
442 | push hl ;0928\r | |
443 | call sub_08f7h ;0929\r | |
444 | call out.hl ;092c\r | |
445 | pop hl ;092f\r | |
446 | ret ;0930\r | |
447 | out.hl:\r | |
448 | ld a,h ;0931\r | |
449 | call out.hex ;0932\r | |
450 | ld a,l ;0935\r | |
451 | out.hex:\r | |
452 | push af ;0936\r | |
453 | rra ;0937\r | |
454 | rra ;0938\r | |
455 | rra ;0939\r | |
456 | rra ;093a\r | |
457 | call out.digit ;093b\r | |
458 | pop af ;093e\r | |
459 | out.digit:\r | |
460 | and 00fh ;093f\r | |
461 | cp 10 ;0941\r | |
462 | jr c,l0947h ;0943\r | |
463 | add a,007h ;0945\r | |
464 | l0947h:\r | |
465 | add a,'0' ;0947\r | |
466 | jr OUTCHAR ;0949\r | |
467 | l094bh:\r | |
468 | ld a,'-' ;094b\r | |
469 | call OUTCHAR ;094d\r | |
470 | ld a,040h ;0950\r | |
471 | out.ascii:\r | |
472 | ex af,af' ;0952\r | |
473 | call outquote ;0953\r | |
474 | ex af,af' ;0956\r | |
475 | push af ;0957\r | |
476 | res 7,a ;0958\r | |
477 | cp ' ' ;095a\r | |
478 | jr nc,l0960h ;095c\r | |
479 | sub 0c0h ;095e\r | |
480 | l0960h:\r | |
481 | call OUTCHAR ;0960\r | |
482 | push af ;0963\r | |
483 | cp '''' ;0964\r | |
484 | call z,OUTCHAR ;0966\r | |
485 | pop af ;0969\r | |
486 | ex af,af' ;096a\r | |
487 | call outquote ;096b\r | |
488 | pop af ;096e\r | |
489 | or a ;096f\r | |
490 | ld a,'.' ;0970\r | |
491 | call m,OUTCHAR ;0972\r | |
492 | ex af,af' ;0975\r | |
493 | jr c,l094bh ;0976\r | |
494 | ret ;0978\r | |
495 | \r | |
496 | outquote:\r | |
497 | ld a,'''' ;0979\r | |
498 | OUTCHAR:\r | |
30d1329e L |
499 | push hl\r |
500 | push de\r | |
501 | push bc\r | |
502 | push af\r | |
503 | and 07fh\r | |
504 | ld c,a\r | |
505 | call ?cono\r | |
506 | ld hl,CON.COL\r | |
507 | inc (hl)\r | |
508 | pop af\r | |
509 | pop bc\r | |
510 | pop de\r | |
511 | pop hl\r | |
a16ba2b0 L |
512 | ret ;0988\r |
513 | \r | |
514 | inchar:\r | |
30d1329e L |
515 | push hl\r |
516 | push de\r | |
517 | push bc\r | |
518 | call ?const\r | |
519 | and a\r | |
520 | jr z,inch1\r | |
521 | call ?conin\r | |
a16ba2b0 | 522 | scf ;0991\r |
30d1329e L |
523 | inch1:\r |
524 | pop bc\r | |
525 | pop de\r | |
526 | pop hl\r | |
a16ba2b0 L |
527 | ret ;0992\r |
528 | \r | |
529 | PSTR:\r | |
530 | ld c,000h ;0993\r | |
531 | l0995h:\r | |
532 | ld a,(hl) ;0995\r | |
533 | and a ;0996\r | |
534 | ret z ;0997\r | |
535 | call OUTCHAR ;0998\r | |
536 | inc c ;099b\r | |
537 | inc hl ;099c\r | |
538 | and a ;099d\r | |
539 | ret m ;099e\r | |
540 | jr l0995h ;099f\r | |
541 | \r | |
542 | outbl6:\r | |
543 | call outbl2 ;09a1\r | |
544 | outbl4:\r | |
545 | call outbl2 ;09a4\r | |
546 | outbl2:\r | |
547 | call OUTBL ;09a7\r | |
548 | OUTBL:\r | |
549 | ld a,' ' ;09aa\r | |
550 | jr OUTCHAR ;09ac\r | |
551 | CRLF:\r | |
552 | call inchar ;09ae\r | |
553 | ld a,CR ;09b1\r | |
554 | call OUTCHAR ;09b3\r | |
555 | ld a,LF ;09b6\r | |
556 | call OUTCHAR ;09b8\r | |
557 | ld a,000h ;09bb\r | |
558 | ld (CON.COL),a ;09bd\r | |
559 | jp c,DDTZML ;09c0\r | |
560 | ret ;09c3\r | |
561 | \r | |
562 | ADD_HL_A:\r | |
563 | add a,l ;09c4\r | |
564 | ld l,a ;09c5\r | |
565 | ret nc ;09c6\r | |
566 | inc h ;09c7\r | |
567 | ret ;09c8\r | |
568 | \r | |
569 | SKIPBL0:\r | |
570 | inc de ;09c9\r | |
571 | SKIPBL:\r | |
572 | ld a,(de) ;09ca\r | |
573 | cp ' ' ;09cb\r | |
574 | jr z,SKIPBL0 ;09cd\r | |
575 | cp 009h ;09cf\r | |
576 | jr z,SKIPBL0 ;09d1\r | |
577 | or a ;09d3\r | |
578 | ret ;09d4\r | |
579 | \r | |
580 | skip_to_nextarg:\r | |
581 | call SKIPBL ;09d5\r | |
582 | cp ',' ;09d8\r | |
583 | ret nz ;09da\r | |
584 | inc de ;09db\r | |
585 | call SKIPBL ;09dc\r | |
586 | cp a ;09df\r | |
587 | ret ;09e0\r | |
588 | \r | |
589 | assert_eol:\r | |
590 | call SKIPBL ;09e1\r | |
591 | ret z ;09e4\r | |
592 | l09e5h:\r | |
593 | jp ERROR ;09e5\r | |
594 | \r | |
595 | chk.sp:\r | |
596 | push hl ;09e8\r | |
597 | push de ;09e9\r | |
598 | ld hl,0 ;09ea\r | |
599 | add hl,sp ;09ed\r | |
600 | ld de,$stack-50 ;09ee\r | |
601 | call CP.HL.DE ;09f1\r | |
602 | pop de ;09f4\r | |
603 | pop hl ;09f5\r | |
604 | jr c,l09e5h ;09f6\r | |
605 | ret ;09f8\r | |
606 | \r | |
607 | CP.HL.DE:\r | |
608 | and a ;09f9\r | |
609 | sbc hl,de ;09fa\r | |
610 | add hl,de ;09fc\r | |
611 | ret ;09fd\r | |
612 | \r | |
613 | lookupch:\r | |
614 | ld b,000h ;09fe\r | |
615 | l0a00h:\r | |
616 | ld a,(hl) ;0a00\r | |
617 | and a ;0a01\r | |
618 | ret z ;0a02\r | |
619 | ld a,(de) ;0a03\r | |
620 | cp (hl) ;0a04\r | |
621 | jr z,l0a0bh ;0a05\r | |
622 | inc hl ;0a07\r | |
623 | inc b ;0a08\r | |
624 | jr l0a00h ;0a09\r | |
625 | l0a0bh:\r | |
626 | scf ;0a0b\r | |
627 | inc de ;0a0c\r | |
628 | ret ;0a0d\r | |
629 | \r | |
630 | sub_0a0eh:\r | |
631 | ld hl,b_0x132A_start ;0a0e\r | |
632 | ld b,07fh ;0a11\r | |
633 | jr l0a17h ;0a13\r | |
634 | \r | |
635 | sub_0a15h:\r | |
636 | ld b,0ffh ;0a15\r | |
637 | l0a17h:\r | |
638 | inc b ;0a17\r | |
639 | ld a,(hl) ;0a18\r | |
640 | and a ;0a19\r | |
641 | ret z ;0a1a\r | |
642 | call l0a27 ;0a1b\r | |
643 | jr nc,l0a17h ;0a1e\r | |
644 | res 7,b ;0a20\r | |
645 | ret ;0a22\r | |
646 | \r | |
647 | sub_0a23h:\r | |
648 | push bc ;0a23\r | |
649 | res 7,b ;0a24\r | |
650 | db 3eh ;0a26 ld a,0c5h\r | |
651 | l0a27:\r | |
652 | push bc ;0a27\r | |
653 | push de ;0a28\r | |
654 | l0a29h:\r | |
655 | ld a,(de) ;0a29\r | |
656 | xor (hl) ;0a2a\r | |
657 | and 07fh ;0a2b\r | |
658 | jr nz,l0a41h ;0a2d\r | |
659 | bit 7,(hl) ;0a2f\r | |
660 | inc hl ;0a31\r | |
661 | inc de ;0a32\r | |
662 | jr z,l0a29h ;0a33\r | |
663 | scf ;0a35\r | |
664 | bit 7,b ;0a36\r | |
665 | call z,sub_0d20h ;0a38\r | |
666 | jr nc,l0a44h ;0a3b\r | |
667 | pop af ;0a3d\r | |
668 | scf ;0a3e\r | |
669 | pop bc ;0a3f\r | |
670 | ret ;0a40\r | |
671 | \r | |
672 | l0a41h:\r | |
673 | call sub_0a50h ;0a41\r | |
674 | l0a44h:\r | |
675 | pop de ;0a44\r | |
676 | and a ;0a45\r | |
677 | pop bc ;0a46\r | |
678 | ret ;0a47\r | |
679 | \r | |
680 | sub_0a48h:\r | |
681 | inc b ;0a48\r | |
682 | l0a49h:\r | |
683 | dec b ;0a49\r | |
684 | ret z ;0a4a\r | |
685 | call sub_0a50h ;0a4b\r | |
686 | jr l0a49h ;0a4e\r | |
687 | sub_0a50h:\r | |
688 | ld a,(hl) ;0a50\r | |
689 | and a ;0a51\r | |
690 | ret z ;0a52\r | |
691 | l0a53h:\r | |
692 | ld a,(hl) ;0a53\r | |
693 | inc hl ;0a54\r | |
694 | and a ;0a55\r | |
695 | ret m ;0a56\r | |
696 | jr l0a53h ;0a57\r | |
697 | \r | |
698 | get_arg3:\r | |
699 | call get_arg_range ;0a59\r | |
700 | push hl ;0a5c\r | |
701 | push bc ;0a5d\r | |
702 | call skip_to_nextarg ;0a5e\r | |
703 | call get_arg ;0a61\r | |
704 | ex de,hl ;0a64\r | |
705 | pop bc ;0a65\r | |
706 | pop hl ;0a66\r | |
707 | ret ;0a67\r | |
708 | \r | |
709 | sub_0a68h:\r | |
710 | call EXPR ;0a68\r | |
711 | jr c,error0 ;0a6b\r | |
712 | ret ;0a6d\r | |
713 | \r | |
714 | get_arg:\r | |
715 | call sub_0a68h ;0a6e\r | |
716 | l0a71h:\r | |
717 | jp assert_eol ;0a71\r | |
718 | \r | |
719 | get_lastarg_def:\r | |
720 | call get_arg_def ;0a74\r | |
721 | jr l0a71h ;0a77\r | |
722 | \r | |
723 | get_arg_def:\r | |
724 | push hl ;0a79\r | |
725 | call EXPR ;0a7a\r | |
726 | jr c,l0a80h ;0a7d\r | |
727 | ex (sp),hl ;0a7f\r | |
728 | l0a80h:\r | |
729 | pop hl ;0a80\r | |
730 | ret ;0a81\r | |
731 | \r | |
732 | sub_0a82h:\r | |
733 | call sub_0a87h ;0a82\r | |
734 | jr l0a71h ;0a85\r | |
735 | \r | |
736 | sub_0a87h:\r | |
737 | db 0e6h ;0a87 and 037h (clear carry)\r | |
738 | get_arg_range:\r | |
739 | scf\r | |
740 | ex af,af' ;0a89\r | |
741 | push bc ;0a8a\r | |
742 | push hl ;0a8b\r | |
743 | call EXPR ;0a8c\r | |
744 | jr nc,l0a97h ;0a8f\r | |
745 | ex af,af' ;0a91\r | |
746 | jr c,error0 ;0a92\r | |
747 | ex af,af' ;0a94\r | |
748 | pop hl ;0a95\r | |
749 | \r | |
750 | defb 03eh ;0a96\r | |
751 | l0a97h:\r | |
752 | pop af ;0a97\r | |
753 | call sub_0aa5h ;0a98\r | |
754 | jr nc,l0aa3h ;0a9b\r | |
755 | ex af,af' ;0a9d\r | |
756 | pop bc ;0a9e\r | |
757 | ret nc ;0a9f\r | |
758 | error0:\r | |
759 | jp ERROR ;0aa0\r | |
760 | \r | |
761 | l0aa3h:\r | |
762 | pop af ;0aa3\r | |
763 | ret ;0aa4\r | |
764 | \r | |
765 | sub_0aa5h:\r | |
766 | call skip_to_nextarg ;0aa5\r | |
767 | cp 'S' ;0aa8\r | |
768 | jr nz,l0aadh ;0aaa\r | |
769 | inc de ;0aac\r | |
770 | l0aadh:\r | |
771 | push hl ;0aad\r | |
772 | push af ;0aae\r | |
773 | call EXPR ;0aaf\r | |
774 | jr c,l0ac3h ;0ab2\r | |
775 | ld b,h ;0ab4\r | |
776 | ld c,l ;0ab5\r | |
777 | pop af ;0ab6\r | |
778 | pop hl ;0ab7\r | |
779 | jr z,l0ac1h ;0ab8\r | |
780 | ld a,c ;0aba\r | |
781 | sub l ;0abb\r | |
782 | ld c,a ;0abc\r | |
783 | ld a,b ;0abd\r | |
784 | sbc a,h ;0abe\r | |
785 | ld b,a ;0abf\r | |
786 | inc bc ;0ac0\r | |
787 | l0ac1h:\r | |
788 | and a ;0ac1\r | |
789 | ret ;0ac2\r | |
790 | \r | |
791 | l0ac3h:\r | |
792 | pop af ;0ac3\r | |
793 | pop hl ;0ac4\r | |
794 | jr z,error0 ;0ac5\r | |
795 | scf ;0ac7\r | |
796 | ret ;0ac8\r | |
797 | \r | |
798 | EXPR:\r | |
799 | call SKIPBL ;0ac9\r | |
800 | EXPR1:\r | |
801 | call do_subexpr ;0acc\r | |
802 | ret c ;0acf\r | |
803 | call do_rel_op ;0ad0\r | |
804 | ret nc ;0ad3\r | |
805 | push bc ;0ad4\r | |
806 | push hl ;0ad5\r | |
807 | call do_subexpr ;0ad6\r | |
808 | jr c,error0 ;0ad9\r | |
809 | ex de,hl ;0adb\r | |
810 | ex (sp),hl ;0adc\r | |
811 | and a ;0add\r | |
812 | sbc hl,de ;0ade\r | |
813 | ld hl,0ffffh ;0ae0\r | |
814 | pop de ;0ae3\r | |
815 | ret ;0ae4\r | |
816 | \r | |
817 | do_op_eq:\r | |
818 | jr z,l0af8h ;0ae5\r | |
819 | jr l0af7h ;0ae7\r | |
820 | do_op_ne:\r | |
821 | jr nz,l0af8h ;0ae9\r | |
822 | jr l0af7h ;0aeb\r | |
823 | do_op_le:\r | |
824 | jr z,l0af8h ;0aed\r | |
825 | do_op_lt:\r | |
826 | jr c,l0af8h ;0aef\r | |
827 | jr l0af7h ;0af1\r | |
828 | do_op_gt:\r | |
829 | jr z,l0af7h ;0af3\r | |
830 | do_op_ge:\r | |
831 | jr nc,l0af8h ;0af5\r | |
832 | l0af7h:\r | |
833 | inc hl ;0af7\r | |
834 | l0af8h:\r | |
835 | and a ;0af8\r | |
836 | ret ;0af9\r | |
837 | \r | |
838 | do_rel_op:\r | |
839 | push hl ;0afa\r | |
840 | ld hl,tab_eq_le_ge ;0afb\r | |
841 | call lookupch ;0afe\r | |
842 | jr nc,l0b28h ;0b01\r | |
843 | ld a,b ;0b03\r | |
844 | or a ;0b04\r | |
845 | jr z,l0b1ch ;0b05\r | |
846 | ld a,(de) ;0b07\r | |
847 | cp '=' ;0b08\r | |
848 | jr nz,l0b11h ;0b0a\r | |
849 | inc de ;0b0c\r | |
850 | inc b ;0b0d\r | |
851 | inc b ;0b0e\r | |
852 | jr l0b1ch ;0b0f\r | |
853 | \r | |
854 | l0b11h:\r | |
855 | bit 0,b ;0b11\r | |
856 | jr z,l0b1ch ;0b13\r | |
857 | cp '>' ;0b15\r | |
858 | jr nz,l0b1ch ;0b17\r | |
859 | inc de ;0b19\r | |
860 | ld b,005h ;0b1a\r | |
861 | l0b1ch:\r | |
862 | ld hl,tab_func_eqlege ;0b1c\r | |
863 | ld a,b ;0b1f\r | |
864 | add a,a ;0b20\r | |
865 | call ADD_HL_A ;0b21\r | |
866 | ld c,(hl) ;0b24\r | |
867 | inc hl ;0b25\r | |
868 | ld b,(hl) ;0b26\r | |
869 | scf ;0b27\r | |
870 | l0b28h:\r | |
871 | pop hl ;0b28\r | |
872 | ret ;0b29\r | |
873 | \r | |
874 | tab_eq_le_ge:\r | |
875 | db '=<>',0\r | |
876 | \r | |
877 | tab_func_eqlege:\r | |
878 | defw do_op_eq ;0b2e\r | |
879 | defw do_op_lt ;0b30\r | |
880 | defw do_op_gt ;0b32\r | |
881 | defw do_op_le ;0b34\r | |
882 | defw do_op_ge ;0b36\r | |
883 | defw do_op_ne ;0b38\r | |
884 | \r | |
885 | do_subexpr:\r | |
886 | call do_factor ;0b3a\r | |
887 | ret c ;0b3d\r | |
888 | l0b3eh:\r | |
889 | call do_binary_op ;0b3e\r | |
890 | push hl ;0b41\r | |
891 | push bc ;0b42\r | |
892 | call do_factor ;0b43\r | |
893 | pop bc ;0b46\r | |
894 | ex de,hl ;0b47\r | |
895 | ex (sp),hl ;0b48\r | |
896 | jr nc,l0b52h ;0b49\r | |
897 | pop de ;0b4b\r | |
898 | ld a,b ;0b4c\r | |
899 | or c ;0b4d\r | |
900 | ret z ;0b4e\r | |
901 | jp ERROR ;0b4f\r | |
902 | \r | |
903 | l0b52h:\r | |
904 | ld a,b ;0b52\r | |
905 | or c ;0b53\r | |
906 | push bc ;0b54\r | |
907 | ret nz ;0b55\r | |
908 | pop bc ;0b56\r | |
909 | do_op_add:\r | |
910 | add hl,de ;0b57\r | |
911 | l0b58h:\r | |
912 | pop de ;0b58\r | |
913 | jr l0b3eh ;0b59\r | |
914 | \r | |
915 | do_op_sub:\r | |
916 | and a ;0b5b\r | |
917 | sbc hl,de ;0b5c\r | |
918 | jr l0b58h ;0b5e\r | |
919 | \r | |
920 | do_op_mlt:\r | |
921 | push bc ;0b60\r | |
922 | ld b,h\r | |
923 | ld c,e\r | |
924 | ld h,e\r | |
925 | ld e,l\r | |
926 | mlt bc\r | |
927 | mlt de\r | |
928 | mlt hl\r | |
929 | ld a,h\r | |
930 | add a,c\r | |
931 | add a,e\r | |
932 | ld h,a\r | |
933 | pop bc ;0b72\r | |
934 | jr l0b58h ;0b73\r | |
935 | \r | |
936 | do_op_div:\r | |
937 | call DIV_HL_DE ;0b75\r | |
938 | jr l0b58h ;0b78\r | |
939 | \r | |
940 | do_op_mod:\r | |
941 | call DIV_HL_DE ;0b7a\r | |
942 | ex de,hl ;0b7d\r | |
943 | jr l0b58h ;0b7e\r | |
944 | \r | |
945 | DIV_HL_DE:\r | |
946 | push bc ;0b80\r | |
947 | ex de,hl ;0b81\r | |
948 | ld b,h ;0b82\r | |
949 | ld c,l ;0b83\r | |
950 | ld hl,0 ;0b84\r | |
951 | ld a,16 ;0b87\r | |
952 | l0b89h:\r | |
953 | push af ;0b89\r | |
954 | add hl,hl ;0b8a\r | |
955 | ex de,hl ;0b8b\r | |
956 | xor a ;0b8c\r | |
957 | add hl,hl ;0b8d\r | |
958 | ex de,hl ;0b8e\r | |
959 | adc a,l ;0b8f\r | |
960 | sub c ;0b90\r | |
961 | ld l,a ;0b91\r | |
962 | ld a,h ;0b92\r | |
963 | sbc a,b ;0b93\r | |
964 | ld h,a ;0b94\r | |
965 | inc de ;0b95\r | |
966 | jr nc,l0b9ah ;0b96\r | |
967 | add hl,bc ;0b98\r | |
968 | dec de ;0b99\r | |
969 | l0b9ah:\r | |
970 | pop af ;0b9a\r | |
971 | dec a ;0b9b\r | |
972 | jr nz,l0b89h ;0b9c\r | |
973 | ex de,hl ;0b9e\r | |
974 | pop bc ;0b9f\r | |
975 | ret ;0ba0\r | |
976 | \r | |
977 | do_op_and:\r | |
978 | ld a,h ;0ba1\r | |
979 | and d ;0ba2\r | |
980 | ld h,a ;0ba3\r | |
981 | ld a,l ;0ba4\r | |
982 | and e ;0ba5\r | |
983 | ld l,a ;0ba6\r | |
984 | jr l0b58h ;0ba7\r | |
985 | \r | |
986 | do_op_or:\r | |
987 | ld a,h ;0ba9\r | |
988 | or d ;0baa\r | |
989 | ld h,a ;0bab\r | |
990 | ld a,l ;0bac\r | |
991 | or e ;0bad\r | |
992 | ld l,a ;0bae\r | |
993 | jr l0b58h ;0baf\r | |
994 | \r | |
995 | do_op_xor:\r | |
996 | ld a,h ;0bb1\r | |
997 | xor d ;0bb2\r | |
998 | ld h,a ;0bb3\r | |
999 | ld a,l ;0bb4\r | |
1000 | xor e ;0bb5\r | |
1001 | ld l,a ;0bb6\r | |
1002 | jr l0b58h ;0bb7\r | |
1003 | \r | |
1004 | do_binary_op:\r | |
1005 | push hl ;0bb9\r | |
1006 | ld hl,tab_op_a ;0bba\r | |
1007 | call lookupch ;0bbd\r | |
1008 | ld a,b ;0bc0\r | |
1009 | ld hl,tab_func_opa ;0bc1\r | |
1010 | add a,a ;0bc4\r | |
1011 | call ADD_HL_A ;0bc5\r | |
1012 | ld c,(hl) ;0bc8\r | |
1013 | inc hl ;0bc9\r | |
1014 | ld b,(hl) ;0bca\r | |
1015 | pop hl ;0bcb\r | |
1016 | ret ;0bcc\r | |
1017 | \r | |
1018 | tab_op_a:\r | |
1019 | DB '+-*/%&!#',0\r | |
1020 | tab_func_opa:\r | |
1021 | defw do_op_add ;0bd6\r | |
1022 | defw do_op_sub ;0bd8\r | |
1023 | defw do_op_mlt ;0bda\r | |
1024 | defw do_op_div ;0bdc\r | |
1025 | defw do_op_mod ;0bde\r | |
1026 | defw do_op_and ;0be0\r | |
1027 | defw do_op_or ;0be2\r | |
1028 | defw do_op_xor ;0be4\r | |
1029 | defw 0 ;0be6\r | |
1030 | \r | |
1031 | fact_factor:\r | |
1032 | call do_factor ;0be8\r | |
1033 | ret nc ;0beb\r | |
1034 | jp ERROR ;0bec\r | |
1035 | \r | |
1036 | do_factor:\r | |
1037 | call chk.sp ;0bef\r | |
1038 | call get.number ;0bf2\r | |
1039 | ret nc ;0bf5\r | |
1040 | inc de ;0bf6\r | |
1041 | ld hl,TOPRAM ;0bf7\r | |
1042 | cp 'T' ;0bfa\r | |
1043 | ret z ;0bfc\r | |
1044 | ld hl,(HILOD) ;0bfd\r | |
1045 | cp 'H' ;0c00\r | |
1046 | ret z ;0c02\r | |
1047 | ld hl,(MAXLOD) ;0c03\r | |
1048 | cp 'M' ;0c06\r | |
1049 | ret z ;0c08\r | |
1050 | ld hl,TPA ;0c09\r | |
1051 | cp 'L' ;0c0c\r | |
1052 | ret z ;0c0e\r | |
1053 | ld hl,(offs.@) ;0c0f\r | |
1054 | cp '@' ;0c12\r | |
1055 | ret z ;0c14\r | |
1056 | ld hl,(OFFS.pc) ;0c15\r | |
1057 | cp '$' ;0c18\r | |
1058 | ret z ;0c1a\r | |
1059 | cp '-' ;0c1b\r | |
1060 | jr z,fact_factneg ;0c1d\r | |
1061 | cp '~' ;0c1f\r | |
1062 | jr z,fact_factinv ;0c21\r | |
1063 | cp '+' ;0c23\r | |
1064 | jr z,fact_factor ;0c25\r | |
1065 | cp '^' ;0c27\r | |
1066 | jr z,fact_reg.CPU ;0c29\r | |
1067 | cp 'Y' ;0c2b\r | |
1068 | jr z,fact_reg.Y ;0c2d\r | |
1069 | cp '(' ;0c2f\r | |
1070 | jr z,fact_mem ;0c31\r | |
1071 | cp '[' ;0c33\r | |
1072 | jp z,EXPR_BRCKT ;0c35 [ expression ]\r | |
1073 | cp '''' ;0c38\r | |
1074 | jr z,fact_factstring ;0c3a\r | |
1075 | dec de ;0c3c\r | |
1076 | scf ;0c3d\r | |
1077 | ret ;0c3e\r | |
1078 | \r | |
1079 | fact_reg.Y:\r | |
1080 | call get.decdigit ;0c3f\r | |
1081 | jp c,ERROR ;0c42\r | |
1082 | inc de ;0c45\r | |
1083 | add a,a ;0c46\r | |
1084 | ld hl,reg.Y ;0c47\r | |
1085 | call ADD_HL_A ;0c4a\r | |
1086 | ld a,(hl) ;0c4d\r | |
1087 | inc hl ;0c4e\r | |
1088 | ld h,(hl) ;0c4f\r | |
1089 | ld l,a ;0c50\r | |
1090 | and a ;0c51\r | |
1091 | ret ;0c52\r | |
1092 | fact_factstring:\r | |
1093 | ld hl,0 ;0c53\r | |
1094 | l0c56h:\r | |
1095 | ld a,(de) ;0c56\r | |
1096 | cp '''' ;0c57\r | |
1097 | jr z,l0c62h ;0c59\r | |
1098 | and a ;0c5b\r | |
1099 | ret z ;0c5c\r | |
1100 | l0c5dh:\r | |
1101 | ld h,l ;0c5d\r | |
1102 | ld l,a ;0c5e\r | |
1103 | inc de ;0c5f\r | |
1104 | jr l0c56h ;0c60\r | |
1105 | \r | |
1106 | l0c62h:\r | |
1107 | inc de ;0c62\r | |
1108 | ld a,(de) ;0c63\r | |
1109 | cp '''' ;0c64\r | |
1110 | jr z,l0c5dh ;0c66\r | |
1111 | sub '.' ;0c68\r | |
1112 | or a ;0c6a\r | |
1113 | ret nz ;0c6b\r | |
1114 | inc de ;0c6c\r | |
1115 | set 7,l ;0c6d\r | |
1116 | ret ;0c6f\r | |
1117 | \r | |
1118 | fact_reg.CPU:\r | |
1119 | call sub_1315h ;0c70\r | |
1120 | jr nc,l0cbbh ;0c73\r | |
1121 | ld a,(hl) ;0c75\r | |
1122 | inc hl ;0c76\r | |
1123 | ld h,(hl) ;0c77\r | |
1124 | ld l,a ;0c78\r | |
1125 | and a ;0c79\r | |
1126 | bit 0,c ;0c7a\r | |
1127 | ret nz ;0c7c\r | |
1128 | ld h,000h ;0c7d\r | |
1129 | ret ;0c7f\r | |
1130 | \r | |
1131 | fact_factneg:\r | |
1132 | call fact_factor ;0c80\r | |
1133 | dec hl ;0c83\r | |
1134 | cpl.hl:\r | |
1135 | ld a,h ;0c84\r | |
1136 | cpl ;0c85\r | |
1137 | ld h,a ;0c86\r | |
1138 | ld a,l ;0c87\r | |
1139 | cpl ;0c88\r | |
1140 | ld l,a ;0c89\r | |
1141 | ret ;0c8a\r | |
1142 | fact_factinv:\r | |
1143 | call fact_factor ;0c8b\r | |
1144 | jr cpl.hl ;0c8e\r | |
1145 | \r | |
1146 | fact_mem:\r | |
1147 | call EXPR1 ;0c90\r | |
1148 | jr c,l0cbbh ;0c93\r | |
1149 | ld a,(de) ;0c95\r | |
1150 | cp ')' ;0c96\r | |
1151 | jr nz,l0cbbh ;0c98\r | |
1152 | inc de ;0c9a\r | |
1153 | comst\r | |
1154 | ld a,(hl) ;0c9f\r | |
1155 | inc hl ;\r | |
1156 | ld h,(hl) ;\r | |
1157 | comend\r | |
1158 | ld l,a ;0ca7\r | |
1159 | ld a,(de) ;0ca8\r | |
1160 | inc de ;0ca9\r | |
1161 | cp '.' ;0caa\r | |
1162 | ret z ;0cac\r | |
1163 | dec de ;0cad\r | |
1164 | xor a ;0cae\r | |
1165 | ld h,a ;0caf\r | |
1166 | ret ;0cb0\r | |
1167 | \r | |
1168 | EXPR_BRCKT:\r | |
1169 | call EXPR1 ;0cb1\r | |
1170 | jr c,l0cbbh ;0cb4\r | |
1171 | ld a,(de) ;0cb6\r | |
1172 | cp ']' ;0cb7\r | |
1173 | inc de ;0cb9\r | |
1174 | ret z ;0cba\r | |
1175 | l0cbbh:\r | |
1176 | jp ERROR ;0cbb\r | |
1177 | \r | |
1178 | get.number:\r | |
1179 | call get.hexdigit ;0cbe\r | |
1180 | ret c ;0cc1\r | |
1181 | push de ;0cc2\r | |
1182 | l0cc3h:\r | |
1183 | inc de ;0cc3\r | |
1184 | call get.hexdigit ;0cc4\r | |
1185 | jr nc,l0cc3h ;0cc7\r | |
1186 | pop de ;0cc9\r | |
1187 | cp '.' ;0cca\r | |
1188 | jr z,l0d04h ;0ccc\r | |
1189 | cp '"' ;0cce\r | |
1190 | jr z,l0ce9h ;0cd0\r | |
1191 | ld hl,0 ;0cd2\r | |
1192 | l0cd5h:\r | |
1193 | call get.hexdigit ;0cd5\r | |
1194 | jr c,l0ce4h ;0cd8\r | |
1195 | add hl,hl ;0cda\r | |
1196 | add hl,hl ;0cdb\r | |
1197 | add hl,hl ;0cdc\r | |
1198 | add hl,hl ;0cdd\r | |
1199 | call ADD_HL_A ;0cde\r | |
1200 | inc de ;0ce1\r | |
1201 | jr l0cd5h ;0ce2\r | |
1202 | l0ce4h:\r | |
1203 | xor 'H' ;0ce4\r | |
1204 | ret nz ;0ce6\r | |
1205 | inc de ;0ce7\r | |
1206 | ret ;0ce8\r | |
1207 | \r | |
1208 | l0ce9h:\r | |
1209 | ld hl,0 ;0ce9\r | |
1210 | l0cech:\r | |
1211 | call get.decdigit ;0cec\r | |
1212 | l0cefh:\r | |
1213 | inc de ;0cef\r | |
1214 | jr c,l0cf8h ;0cf0\r | |
1215 | add hl,hl ;0cf2\r | |
1216 | call ADD_HL_A ;0cf3\r | |
1217 | jr l0cech ;0cf6\r | |
1218 | l0cf8h:\r | |
1219 | cp '"' ;0cf8\r | |
1220 | jp nz,ERROR ;0cfa\r | |
1221 | call get.decdigit ;0cfd\r | |
1222 | jr nc,l0cefh ;0d00\r | |
1223 | or a ;0d02\r | |
1224 | ret ;0d03\r | |
1225 | l0d04h:\r | |
1226 | ld hl,0 ;0d04\r | |
1227 | l0d07h:\r | |
1228 | call get.decdigit ;0d07\r | |
1229 | inc de ;0d0a\r | |
1230 | jr c,l0d1ah ;0d0b\r | |
1231 | push bc ;0d0d\r | |
1232 | add hl,hl ;0d0e hl *= 10\r | |
1233 | ld b,h ;0d0f\r | |
1234 | ld c,l ;0d10\r | |
1235 | add hl,hl ;0d11\r | |
1236 | add hl,hl ;0d12\r | |
1237 | add hl,bc ;0d13\r | |
1238 | pop bc ;0d14\r | |
1239 | call ADD_HL_A ;0d15\r | |
1240 | jr l0d07h ;0d18\r | |
1241 | l0d1ah:\r | |
1242 | cp '.' ;0d1a\r | |
1243 | ret z ;0d1c\r | |
1244 | jp ERROR ;0d1d\r | |
1245 | \r | |
1246 | sub_0d20h:\r | |
1247 | ld a,(de) ;0d20\r | |
1248 | cp 05bh ;0d21\r | |
1249 | jr l0d28h ;0d23\r | |
1250 | \r | |
1251 | get.hexdigit:\r | |
1252 | ld a,(de) ;0d25\r | |
1253 | sub_0d26h:\r | |
1254 | cp 'F'+1 ;0d26\r | |
1255 | l0d28h:\r | |
1256 | ccf ;0d28\r | |
1257 | ret c ;0d29\r | |
1258 | cp 'A' ;0d2a\r | |
1259 | jr c,l0d32h ;0d2c\r | |
1260 | sub 'A'-10 ;0d2e\r | |
1261 | ret ;0d30\r | |
1262 | \r | |
1263 | get.decdigit:\r | |
1264 | ld a,(de) ;0d31\r | |
1265 | l0d32h:\r | |
1266 | cp '9'+1 ;0d32\r | |
1267 | jr l0d39h ;0d34\r | |
1268 | get.bindigit:\r | |
1269 | ld a,(de) ;0d36\r | |
1270 | cp '1'+1 ;0d37\r | |
1271 | l0d39h:\r | |
1272 | ccf ;0d39\r | |
1273 | ret c ;0d3a\r | |
1274 | cp '0' ;0d3b\r | |
1275 | ret c ;0d3d\r | |
1276 | sub '0' ;0d3e\r | |
1277 | ret ;0d40\r | |
1278 | \r | |
1279 | l0d41h:\r | |
1280 | call assert_eol ;0d41\r | |
1281 | \r | |
1282 | prnt_cpustat:\r | |
1283 | call prnt_f ;0d44\r | |
1284 | call outbl2 ;0d47\r | |
1285 | ld hl,b_0x0DFD_start ;0d4a\r | |
1286 | ld de,b_0x0E1D_start ;0d4d\r | |
1287 | ld b,006h ;0d50\r | |
1288 | l0d52h:\r | |
1289 | call prnt_regs ;0d52\r | |
1290 | djnz l0d52h ;0d55\r | |
1291 | push hl ;0d57\r | |
1292 | push de ;0d58\r | |
1293 | ld iy,(REG.PC) ;0d59\r | |
1294 | call sub_1f77h ;0d5d\r | |
1295 | exx ;0d60\r | |
1296 | ex af,af' ;0d61\r | |
1297 | call CRLF ;0d62\r | |
1298 | call prnt_f2 ;0d65\r | |
1299 | call outbl2 ;0d68\r | |
1300 | pop de ;0d6b\r | |
1301 | pop hl ;0d6c\r | |
1302 | ld b,007h ;0d6d\r | |
1303 | l0d6fh:\r | |
1304 | call prnt_regs ;0d6f\r | |
1305 | djnz l0d6fh ;0d72\r | |
1306 | exx ;0d74\r | |
1307 | ex af,af' ;0d75\r | |
1308 | and a ;0d76\r | |
1309 | jr z,l0d7fh ;0d77\r | |
1310 | call outbl6 ;0d79\r | |
1311 | call sub_1f5bh ;0d7c\r | |
1312 | l0d7fh:\r | |
1313 | jp crlf ;0d7f\r | |
1314 | \r | |
1315 | prnt_f:\r | |
1316 | ld a,(reg.f) ;0d82\r | |
1317 | call prnt_flags ;0d85\r | |
1318 | ld a,(reg.iff) ;0d88\r | |
1319 | cp 0f3h ;0d8b\r | |
1320 | jp z,outbl ;0d8d\r | |
1321 | ld a,'E' ;0d90\r | |
1322 | jp outchar ;0d92\r | |
1323 | \r | |
1324 | prnt_f2:\r | |
1325 | ld a,(reg.f2) ;0d95\r | |
1326 | call prnt_flags ;0d98\r | |
1327 | jp outbl ;0d9b\r | |
1328 | \r | |
1329 | prnt_flags:\r | |
1330 | ld b,a ;0d9e\r | |
1331 | ld a,'S' ;0d9f\r | |
1332 | call sub_0dbeh ;0da1\r | |
1333 | ld a,'Z' ;0da4\r | |
1334 | call sub_0dbeh ;0da6\r | |
1335 | rl b ;0da9\r | |
1336 | ld a,'H' ;0dab\r | |
1337 | call sub_0dbeh ;0dad\r | |
1338 | rl b ;0db0\r | |
1339 | ld a,'V' ;0db2\r | |
1340 | call sub_0dbeh ;0db4\r | |
1341 | ld a,'N' ;0db7\r | |
1342 | call sub_0dbeh ;0db9\r | |
1343 | ld a,'C' ;0dbc\r | |
1344 | sub_0dbeh:\r | |
1345 | rl b ;0dbe\r | |
1346 | jp c,OUTCHAR ;0dc0\r | |
1347 | jp OUTBL ;0dc3\r | |
1348 | \r | |
1349 | prnt_regs:\r | |
1350 | push bc ;0dc6\r | |
1351 | push de ;0dc7\r | |
1352 | call PSTR ;0dc8\r | |
1353 | ld a,'=' ;0dcb\r | |
1354 | call OUTCHAR ;0dcd\r | |
1355 | ex (sp),hl ;0dd0\r | |
1356 | ld e,(hl) ;0dd1\r | |
1357 | inc hl ;0dd2\r | |
1358 | ld d,(hl) ;0dd3\r | |
1359 | inc hl ;0dd4\r | |
1360 | ld a,(hl) ;0dd5\r | |
1361 | inc hl ;0dd6\r | |
1362 | push hl ;0dd7\r | |
1363 | and a ;0dd8\r | |
1364 | jr z,l0df2h ;0dd9\r | |
1365 | push af ;0ddb\r | |
1366 | ld a,(de) ;0ddc\r | |
1367 | ld l,a ;0ddd\r | |
1368 | inc de ;0dde\r | |
1369 | ld a,(de) ;0ddf\r | |
1370 | ld h,a ;0de0\r | |
1371 | pop af ;0de1\r | |
1372 | dec a ;0de2\r | |
1373 | jr z,l0dedh ;0de3\r | |
1374 | call out.hl.@ ;0de5\r | |
1375 | call z,outbl6 ;0de8\r | |
1376 | jr l0df6h ;0deb\r | |
1377 | l0dedh:\r | |
1378 | call out.hl ;0ded\r | |
1379 | jr l0df6h ;0df0\r | |
1380 | l0df2h:\r | |
1381 | ld a,(de) ;0df2\r | |
1382 | call out.hex ;0df3\r | |
1383 | l0df6h:\r | |
1384 | call OUTBL ;0df6\r | |
1385 | pop de ;0df9\r | |
1386 | pop hl ;0dfa\r | |
1387 | pop bc ;0dfb\r | |
1388 | ret ;0dfc\r | |
1389 | \r | |
1390 | b_0x0DFD_start:\r | |
1391 | DC 'A '\r | |
1392 | DC 'BC '\r | |
1393 | DC 'DE '\r | |
1394 | DC 'HL '\r | |
1395 | DC 'SP'\r | |
1396 | DC 'PC'\r | |
1397 | DC 'A'''\r | |
1398 | DC 'BC'''\r | |
1399 | DC 'DE'''\r | |
1400 | DC 'HL'''\r | |
1401 | DC 'IX'\r | |
1402 | DC 'IY'\r | |
1403 | DC 'I'\r | |
1404 | DB 0\r | |
1405 | \r | |
1406 | b_0x0E1D_start:\r | |
1407 | defw reg.a ;0e1d\r | |
1408 | defb 000h ;0e1f\r | |
1409 | defw reg.c ;0e20\r | |
1410 | defb 001h ;0e22\r | |
1411 | defw reg.e ;0e23\r | |
1412 | defb 001h ;0e25\r | |
1413 | defw reg.l ;0e26\r | |
1414 | defb 001h ;0e28\r | |
1415 | defw reg.sp ;0e29\r | |
1416 | defb 001h ;0e2b\r | |
1417 | defw reg.pc ;0e2c\r | |
1418 | defb 002h ;0e2e\r | |
1419 | defw reg.a2 ;0e2f\r | |
1420 | defb 000h ;0e31\r | |
1421 | defw reg.c2 ;0e32\r | |
1422 | defb 001h ;0e34\r | |
1423 | defw reg.e2 ;0e35\r | |
1424 | defb 001h ;0e37\r | |
1425 | defw reg.l2 ;0e38\r | |
1426 | defb 001h ;0e3a\r | |
1427 | defw reg.ix ;0e3b\r | |
1428 | defb 001h ;0e3d\r | |
1429 | defw reg.iy ;0e3e\r | |
1430 | defb 001h ;0e40\r | |
1431 | defw reg.i ;0e41\r | |
1432 | dw 0 ;0e43\r | |
1433 | \r | |
1434 | CMD.G:\r | |
1435 | sub a ;0e45\r | |
1436 | ld (TCFLG),a ;0e46\r | |
1437 | ld (XA747),a ;0e49\r | |
1438 | call EXPR ;0e4c\r | |
1439 | jr c,l0e54h ;0e4f\r | |
1440 | ld (REG.PC),hl ;0e51\r | |
1441 | l0e54h:\r | |
1442 | call SKIPBL ;0e54\r | |
1443 | jp z,l1183h ;0e57\r | |
1444 | cp ';' ;0e5a\r | |
1445 | jp nz,ERROR ;0e5c\r | |
1446 | inc de ;0e5f\r | |
1447 | ld a,002h ;0e60\r | |
1448 | call sub_0f24h ;0e62\r | |
1449 | jp l1183h ;0e65\r | |
1450 | \r | |
1451 | sub_0e68h:\r | |
1452 | ld b,BP_CNT ;0e68\r | |
1453 | ld ix,bp_tab ;0e6a\r | |
1454 | l0e6eh:\r | |
1455 | ld a,(ix+000h) ;0e6e\r | |
1456 | and 0f1h ;0e71\r | |
1457 | ld (ix+000h),a ;0e73\r | |
1458 | call sub_11c5h ;0e76\r | |
1459 | ld de,BP_SIZE ;0e79\r | |
1460 | add ix,de ;0e7c\r | |
1461 | djnz l0e6eh ;0e7e\r | |
1462 | ret ;0e80\r | |
1463 | \r | |
1464 | CMD.B:\r | |
1465 | call SKIPBL ;0e81\r | |
1466 | jr z,l0ecbh ;0e84\r | |
1467 | inc de ;0e86\r | |
1468 | cp 'X' ;0e87\r | |
1469 | jr z,l0e91h ;0e89\r | |
1470 | dec de ;0e8b\r | |
1471 | ld a,001h ;0e8c\r | |
1472 | jp sub_0f24h ;0e8e\r | |
1473 | l0e91h:\r | |
1474 | call SKIPBL ;0e91\r | |
1475 | jr z,l0ea6h ;0e94\r | |
1476 | l0e96h:\r | |
1477 | call EXPR ;0e96\r | |
1478 | jp c,assert_eol ;0e99\r | |
1479 | push de ;0e9c\r | |
1480 | call sub_0ea7h ;0e9d\r | |
1481 | pop de ;0ea0\r | |
1482 | call skip_to_nextarg ;0ea1\r | |
1483 | jr l0e96h ;0ea4\r | |
1484 | l0ea6h:\r | |
1485 | scf ;0ea6\r | |
1486 | sub_0ea7h:\r | |
1487 | ld b,BP_CNT ;0ea7\r | |
1488 | ld ix,bp_tab ;0ea9\r | |
1489 | l0eadh:\r | |
1490 | push af ;0ead\r | |
1491 | jr c,l0ebbh ;0eae\r | |
1492 | ld e,(ix+002h) ;0eb0\r | |
1493 | ld d,(ix+003h) ;0eb3\r | |
1494 | call CP.HL.DE ;0eb6\r | |
1495 | jr nz,l0ec2h ;0eb9\r | |
1496 | l0ebbh:\r | |
1497 | ld (ix+000h),000h ;0ebb\r | |
1498 | call sub_11c5h ;0ebf\r | |
1499 | l0ec2h:\r | |
1500 | ld de,BP_SIZE ;0ec2\r | |
1501 | add ix,de ;0ec5\r | |
1502 | pop af ;0ec7\r | |
1503 | djnz l0eadh ;0ec8\r | |
1504 | ret ;0eca\r | |
1505 | l0ecbh:\r | |
1506 | ld b,BP_CNT ;0ecb\r | |
1507 | ld ix,bp_tab ;0ecd\r | |
1508 | l0ed1h:\r | |
1509 | bit 0,(ix+000h) ;0ed1\r | |
1510 | jr z,l0f1ch ;0ed5\r | |
1511 | ld a,'R' ;0ed7\r | |
1512 | bit 4,(ix+000h) ;0ed9\r | |
1513 | jr nz,l0ee1h ;0edd\r | |
1514 | ld a,' ' ;0edf\r | |
1515 | l0ee1h:\r | |
1516 | call OUTCHAR ;0ee1\r | |
1517 | call OUTBL ;0ee4\r | |
1518 | ld l,(ix+002h) ;0ee7\r | |
1519 | ld h,(ix+003h) ;0eea\r | |
1520 | call out.hl.@ ;0eed\r | |
1521 | call outbl2 ;0ef0\r | |
1522 | ld a,':' ;0ef3\r | |
1523 | call OUTCHAR ;0ef5\r | |
1524 | ld l,(ix+004h) ;0ef8\r | |
1525 | ld h,(ix+005h) ;0efb\r | |
1526 | call out.hl ;0efe\r | |
1527 | ld l,(ix+006h) ;0f01\r | |
1528 | ld h,(ix+007h) ;0f04\r | |
1529 | ld a,h ;0f07\r | |
1530 | or l ;0f08\r | |
1531 | jr z,l0f19h ;0f09\r | |
1532 | call outbl4 ;0f0b\r | |
1533 | ld a,'I' ;0f0e\r | |
1534 | call OUTCHAR ;0f10\r | |
1535 | call outbl2 ;0f13\r | |
1536 | call PSTR ;0f16\r | |
1537 | l0f19h:\r | |
1538 | call CRLF ;0f19\r | |
1539 | l0f1ch:\r | |
1540 | ld de,BP_SIZE ;0f1c\r | |
1541 | add ix,de ;0f1f\r | |
1542 | djnz l0ed1h ;0f21\r | |
1543 | ret ;0f23\r | |
1544 | \r | |
1545 | sub_0f24h:\r | |
1546 | ld b,a ;0f24\r | |
1547 | call SKIPBL ;0f25\r | |
1548 | ret z ;0f28\r | |
1549 | cp 'R' ;0f29\r | |
1550 | jr nz,l0f30h ;0f2b\r | |
1551 | inc de ;0f2d\r | |
1552 | set 4,b ;0f2e\r | |
1553 | l0f30h:\r | |
1554 | push bc ;0f30\r | |
1555 | call EXPR ;0f31\r | |
1556 | jp c,ERROR ;0f34\r | |
1557 | pop bc ;0f37\r | |
1558 | bit 0,b ;0f38\r | |
1559 | push bc ;0f3a\r | |
1560 | push de ;0f3b\r | |
1561 | push hl ;0f3c\r | |
1562 | call nz,sub_0ea7h ;0f3d\r | |
1563 | pop hl ;0f40\r | |
1564 | call sub_0f68h ;0f41\r | |
1565 | pop de ;0f44\r | |
1566 | ld (ix+002h),l ;0f45\r | |
1567 | ld (ix+003h),h ;0f48\r | |
1568 | call sub_0f80h ;0f4b\r | |
1569 | ld (ix+004h),l ;0f4e\r | |
1570 | ld (ix+005h),h ;0f51\r | |
1571 | call sub_0f91h ;0f54\r | |
1572 | ld (ix+006h),l ;0f57\r | |
1573 | ld (ix+007h),h ;0f5a\r | |
1574 | call skip_to_nextarg ;0f5d\r | |
1575 | pop af ;0f60\r | |
1576 | ld (ix+000h),a ;0f61\r | |
1577 | and 00fh ;0f64\r | |
1578 | jr sub_0f24h ;0f66\r | |
1579 | sub_0f68h:\r | |
1580 | ld b,BP_CNT ;0f68\r | |
1581 | ld ix,bp_tab ;0f6a\r | |
1582 | l0f6eh:\r | |
1583 | ld a,(ix+000h) ;0f6e\r | |
1584 | and 00fh ;0f71\r | |
1585 | ret z ;0f73\r | |
1586 | push bc ;0f74\r | |
1587 | ld bc,BP_SIZE ;0f75\r | |
1588 | add ix,bc ;0f78\r | |
1589 | pop bc ;0f7a\r | |
1590 | djnz l0f6eh ;0f7b\r | |
1591 | jp ERROR ;0f7d\r | |
1592 | \r | |
1593 | sub_0f80h:\r | |
1594 | call SKIPBL ;0f80\r | |
1595 | ld hl,1 ;0f83\r | |
1596 | cp 03ah ;0f86\r | |
1597 | ret nz ;0f88\r | |
1598 | inc de ;0f89\r | |
1599 | call EXPR ;0f8a\r | |
1600 | jp c,ERROR ;0f8d\r | |
1601 | ret ;0f90\r | |
1602 | sub_0f91h:\r | |
1603 | call SKIPBL ;0f91\r | |
1604 | cp 049h ;0f94\r | |
1605 | ld hl,0 ;0f96\r | |
1606 | ret nz ;0f99\r | |
1607 | inc de ;0f9a\r | |
1608 | call SKIPBL ;0f9b\r | |
1609 | push de ;0f9e\r | |
1610 | call EXPR ;0f9f\r | |
1611 | jp c,ERROR ;0fa2\r | |
1612 | ex de,hl ;0fa5\r | |
1613 | pop de ;0fa6\r | |
1614 | push de ;0fa7\r | |
1615 | sbc hl,de ;0fa8\r | |
1616 | ld b,h ;0faa\r | |
1617 | ld c,l ;0fab\r | |
1618 | ld hl,(sexp1) ;0fac\r | |
1619 | push hl ;0faf\r | |
1620 | add hl,bc ;0fb0\r | |
1621 | ld de,sexpbufe ;0fb1\r | |
1622 | call CP.HL.DE ;0fb4\r | |
1623 | jp nc,ERROR ;0fb7\r | |
1624 | pop hl ;0fba\r | |
1625 | ld (sexp2),hl ;0fbb\r | |
1626 | pop de ;0fbe\r | |
1627 | ex de,hl ;0fbf\r | |
1628 | ldir ;0fc0\r | |
1629 | xor a ;0fc2\r | |
1630 | ld (de),a ;0fc3\r | |
1631 | inc de ;0fc4\r | |
1632 | ex de,hl ;0fc5\r | |
1633 | ld (sexp1),hl ;0fc6\r | |
1634 | ld hl,(sexp2) ;0fc9\r | |
1635 | ret ;0fcc\r | |
1636 | \r | |
1637 | bpddtz:\r | |
1638 | if ROMSYS\r | |
1639 | ld h,ROMEN ;0fcd\r | |
1640 | jr z,l0fd2h ;0fcf\r | |
1641 | inc h ;0fd1\r | |
1642 | l0fd2h:\r | |
1643 | push hl ;0fd2 save rom enable stat\r | |
1644 | endif\r | |
1645 | push bc ;0fd3\r | |
1646 | push de ;0fd4\r | |
1647 | push ix ;0fd5\r | |
1648 | push iy ;0fd7\r | |
1649 | ld a,i ;0fd9\r | |
1650 | ld h,a ;0fdb\r | |
1651 | ld l,000h ;0fdc\r | |
1652 | push hl ;0fde\r | |
1653 | ld a,0f3h ;0fdf DI\r | |
1654 | jp po,l0fe6h ;0fe1\r | |
1655 | ld a,0fbh ;0fe4 EI\r | |
1656 | l0fe6h:\r | |
1657 | ld (reg.iff),a ;0fe6\r | |
1658 | ld hl,ivtab ;0fe9\r | |
1659 | ld a,h ;0fec\r | |
1660 | ld i,a ;0fed\r | |
1661 | call ddtei ;0fef\r | |
1662 | ex af,af' ;0ff2\r | |
1663 | push af ;0ff3\r | |
1664 | exx ;0ff4\r | |
1665 | push bc ;0ff5\r | |
1666 | push de ;0ff6\r | |
1667 | push hl ;0ff7\r | |
1668 | call bp.unset ;0ff8\r | |
1669 | in0 a,(itc) ;0ffb\r | |
1670 | jp p,l1017h ;0ffe\r | |
1671 | res TRAP,a ;1001\r | |
1672 | out0 (itc),a ;1003\r | |
1673 | bit UFO,a ;1006\r | |
1674 | jr z,l1011h ;1008\r | |
1675 | ld hl,(REG.PC) ;100a\r | |
1676 | dec hl ;100d\r | |
1677 | ld (REG.PC),hl ;100e\r | |
1678 | l1011h:\r | |
1679 | ld hl,MSG_trap ;1011\r | |
1680 | call PSTR ;1014\r | |
1681 | l1017h:\r | |
1682 | ld a,(XBFE8) ;1017\r | |
1683 | dec a ;101a\r | |
1684 | jr z,l1051h ;101b\r | |
1685 | call inchar ;101d\r | |
1686 | jr c,l102eh ;1020\r | |
1687 | call sub_1059h ;1022\r | |
1688 | and a ;1025\r | |
1689 | jp z,l1183h ;1026\r | |
1690 | and 083h ;1029\r | |
1691 | jp z,l284ah ;102b\r | |
1692 | l102eh:\r | |
1693 | call sub_0e68h ;102e\r | |
1694 | call prnt_cpustat ;1031\r | |
1695 | jp DDTZML ;1034\r | |
1696 | \r | |
1697 | MSG_trap:\r | |
1698 | DB CR,LF,'Undefined opcode trap'\r | |
1699 | DB CR,LF,0\r | |
1700 | \r | |
1701 | l1051h:\r | |
1702 | ld (XBFE8),a ;1051\r | |
1703 | ld c,007h ;1054\r | |
1704 | jp l119fh ;1056\r | |
1705 | sub_1059h:\r | |
1706 | ld a,080h ;1059\r | |
1707 | ex af,af' ;105b\r | |
1708 | sub a ;105c\r | |
1709 | ld (XA747),a ;105d\r | |
1710 | ld b,BP_CNT ;1060\r | |
1711 | ld ix,bp_tab ;1062\r | |
1712 | l1066h:\r | |
1713 | ld a,(ix+000h) ;1066\r | |
1714 | and 007h ;1069\r | |
1715 | jr z,l107eh ;106b\r | |
1716 | ld e,(ix+002h) ;106d\r | |
1717 | ld d,(ix+003h) ;1070\r | |
1718 | ld hl,(REG.PC) ;1073\r | |
1719 | call CP.HL.DE ;1076\r | |
1720 | push bc ;1079\r | |
1721 | call z,sub_1087h ;107a\r | |
1722 | pop bc ;107d\r | |
1723 | l107eh:\r | |
1724 | ld de,BP_SIZE ;107e\r | |
1725 | add ix,de ;1081\r | |
1726 | djnz l1066h ;1083\r | |
1727 | ex af,af' ;1085\r | |
1728 | ret ;1086\r | |
1729 | sub_1087h:\r | |
1730 | ex af,af' ;1087\r | |
1731 | res 7,a ;1088\r | |
1732 | ex af,af' ;108a\r | |
1733 | ld e,(ix+006h) ;108b\r | |
1734 | ld d,(ix+007h) ;108e\r | |
1735 | ld a,d ;1091\r | |
1736 | or e ;1092\r | |
1737 | ld hl,0ffffh ;1093\r | |
1738 | call nz,EXPR ;1096\r | |
1739 | ld a,h ;1099\r | |
1740 | or l ;109a\r | |
1741 | jr z,l10aeh ;109b\r | |
1742 | ld e,(ix+004h) ;109d\r | |
1743 | ld d,(ix+005h) ;10a0\r | |
1744 | dec de ;10a3\r | |
1745 | ld a,d ;10a4\r | |
1746 | or e ;10a5\r | |
1747 | jr z,l10b9h ;10a6\r | |
1748 | ld (ix+004h),e ;10a8\r | |
1749 | ld (ix+005h),d ;10ab\r | |
1750 | l10aeh:\r | |
1751 | bit 4,(ix+000h) ;10ae\r | |
1752 | ret z ;10b2\r | |
1753 | ld a,001h ;10b3\r | |
1754 | ld (XA747),a ;10b5\r | |
1755 | ret ;10b8\r | |
1756 | l10b9h:\r | |
1757 | ex af,af' ;10b9\r | |
1758 | or (ix+000h) ;10ba\r | |
1759 | ex af,af' ;10bd\r | |
1760 | ret\r | |
1761 | \r | |
1762 | bp.unset:\r | |
1763 | ld b,BP_CNT ;10bf\r | |
1764 | ld ix,bp_tab ;10c1\r | |
1765 | l10c5h:\r | |
1766 | bit 5,(ix+000h) ;10c5\r | |
1767 | res 5,(ix+000h) ;10c9\r | |
1768 | jr z,l10e7h ;10cd\r | |
1769 | ld l,(ix+002h) ;10cf\r | |
1770 | ld h,(ix+003h) ;10d2\r | |
1771 | ld a,(ddtrst) ;10d5\r | |
1772 | comst ;10e2\r | |
1773 | cp (hl) ;10dc\r | |
1774 | comend\r | |
1775 | jr nz,l10e7h ;10dd\r | |
1776 | ld a,(ix+001h) ;10df\r | |
1777 | comst ;10e2\r | |
1778 | ld (hl),a ;10e6\r | |
1779 | comend\r | |
1780 | l10e7h:\r | |
1781 | res 3,(ix+000h) ;10e7\r | |
1782 | ld de,BP_SIZE ;10eb\r | |
1783 | add ix,de ;10ee\r | |
1784 | djnz l10c5h ;10f0\r | |
1785 | ret ;10f2\r | |
1786 | sub_10f3h:\r | |
1787 | ld b,BP_CNT ;10f3\r | |
1788 | ld ix,bp_tab ;10f5\r | |
1789 | l10f9h:\r | |
1790 | ld a,(ix+000h) ;10f9\r | |
1791 | and 003h ;10fc\r | |
1792 | jr z,l110dh ;10fe\r | |
1793 | ld e,(ix+002h) ;1100\r | |
1794 | ld d,(ix+003h) ;1103\r | |
1795 | ld hl,(REG.PC) ;1106\r | |
1796 | call CP.HL.DE ;1109\r | |
1797 | ret z ;110c\r | |
1798 | l110dh:\r | |
1799 | ld de,BP_SIZE ;110d\r | |
1800 | add ix,de ;1110\r | |
1801 | djnz l10f9h ;1112\r | |
1802 | sub a ;1114\r | |
1803 | inc a ;1115\r | |
1804 | ret ;1116\r | |
1805 | sub_1117h:\r | |
1806 | call sub_0f68h ;1117\r | |
1807 | ld (ix+004h),001h ;111a\r | |
1808 | ld (ix+005h),000h ;111e\r | |
1809 | ld (ix+002h),l ;1122\r | |
1810 | ld (ix+003h),h ;1125\r | |
1811 | ld (ix+006h),000h ;1128\r | |
1812 | ld (ix+007h),000h ;112c\r | |
1813 | ld a,(XBFE8) ;1130\r | |
1814 | and a ;1133\r | |
1815 | ld a,008h ;1134\r | |
1816 | jr nz,l113ah ;1136\r | |
1817 | ld a,004h ;1138\r | |
1818 | l113ah:\r | |
1819 | ld (ix+000h),a ;113a\r | |
1820 | ret ;113d\r | |
1821 | \r | |
1822 | bp.set:\r | |
1823 | ld b,BP_CNT ;113e\r | |
1824 | ld ix,bp_tab ;1140\r | |
1825 | l1144h:\r | |
1826 | ld a,(ix+000h) ;1144\r | |
1827 | and c ;1147\r | |
1828 | jr z,l117bh ;1148\r | |
1829 | set 5,(ix+000h) ;114a\r | |
1830 | ld l,(ix+002h) ;114e\r | |
1831 | ld h,(ix+003h) ;1151\r | |
1832 | \r | |
1833 | if 0\r | |
1834 | \r | |
1835 | comst ;1154\r | |
1836 | ld a,(hl) ;1158\r | |
1837 | comend\r | |
1838 | ld (ix+001h),a ;1159\r | |
1839 | ld a,(ddtrst) ;115c\r | |
1840 | comst ;115f\r | |
1841 | ld (hl),a ;1163\r | |
1842 | comend\r | |
1843 | and 038h ;1164\r | |
1844 | ld h,000h ;1166\r | |
1845 | ld l,a ;1168\r | |
1846 | ld a,0c3h ;1169\r | |
1847 | comrep ;116b\r | |
1848 | inc hl ;116e\r | |
1849 | ld de,bpent ;116f\r | |
1850 | ld a,e ;1172\r | |
1851 | comrep ;1173\r | |
1852 | inc hl ;1176\r | |
1853 | ld a,d ;1177\r | |
1854 | comrep ;1178\r | |
30d1329e | 1855 | \r |
a16ba2b0 L |
1856 | else\r |
1857 | \r | |
1858 | ld a,(ddtrst) ;115c\r | |
1859 | comst ;115f\r | |
1860 | ld e,(hl) ;1158\r | |
1861 | ld (hl),a ;1163\r | |
1862 | comend\r | |
1863 | ld (ix+001h),e ;1159\r | |
1864 | and 038h ;1164\r | |
1865 | ld h,0 ;1166\r | |
1866 | ld l,a ;1168\r | |
1867 | ld de,bpent ;116f\r | |
1868 | comst ;\r | |
1869 | ld (hl),0c3h ;1169\r | |
1870 | inc hl ;116e\r | |
1871 | ld (hl),e ;1172\r | |
1872 | inc hl ;1176\r | |
1873 | ld (hl),d ;1177\r | |
1874 | comend\r | |
1875 | \r | |
1876 | endif\r | |
1877 | \r | |
1878 | l117bh:\r | |
1879 | ld de,BP_SIZE ;117b\r | |
1880 | add ix,de ;117e\r | |
1881 | djnz l1144h ;1180\r | |
1882 | ret\r | |
1883 | ;1182\r | |
1884 | l1183h:\r | |
1885 | sub a ;1183\r | |
1886 | ld (XBFE8),a ;1184\r | |
1887 | ld a,(XA747) ;1187\r | |
1888 | and a ;118a\r | |
1889 | call nz,prnt_cpustat ;118b\r | |
1890 | call sub_10f3h ;118e\r | |
1891 | ld c,007h ;1191\r | |
1892 | jr nz,l119fh ;1193\r | |
1893 | ld a,001h ;1195\r | |
1894 | ld (XBFE8),a ;1197\r | |
1895 | call sub_26e7h ;119a\r | |
1896 | ld c,008h ;119d\r | |
1897 | l119fh:\r | |
1898 | call bp.set ;119f\r | |
1899 | ld sp,$stack ;11a2 set/restore user cpu state\r | |
1900 | pop hl ;11a5\r | |
1901 | pop de ;11a6\r | |
1902 | pop bc ;11a7\r | |
1903 | pop af ;11a8\r | |
1904 | exx ;11a9\r | |
1905 | ex af,af' ;11aa\r | |
1906 | pop af ;11ab\r | |
1907 | ld i,a ;11ac\r | |
1908 | pop iy ;11ae\r | |
1909 | pop ix ;11b0\r | |
1910 | pop de ;11b2\r | |
1911 | pop bc ;11b3\r | |
1912 | if ROMSYS\r | |
1913 | pop hl ;11b4\r | |
1914 | ld a,l ;11b5\r | |
1915 | and M_MWI ;11b6\r | |
1916 | ld l,a ;11b8\r | |
1917 | di ;11b9\r | |
1918 | in0 a,(dcntl) ;11ba\r | |
1919 | and ~M_MWI ;11bd\r | |
1920 | or l ;11bf\r | |
1921 | ld l,a ;11c0\r | |
1922 | ld a,h ;11c1\r | |
1923 | else\r | |
1924 | pop hl\r | |
1925 | di\r | |
1926 | endif\r | |
1927 | jp $go ;11c2 common ram, switch banks and go to user prog\r | |
1928 | \r | |
1929 | sub_11c5h:\r | |
1930 | ld a,(ix+000h) ;11c5\r | |
1931 | and 003h ;11c8\r | |
1932 | ret nz ;11ca\r | |
1933 | ld e,(ix+006h) ;11cb\r | |
1934 | ld d,(ix+007h) ;11ce\r | |
1935 | ld a,d ;11d1\r | |
1936 | or e ;11d2\r | |
1937 | ret z ;11d3\r | |
1938 | push bc ;11d4\r | |
1939 | ld h,d ;11d5\r | |
1940 | ld l,e ;11d6\r | |
1941 | sub a ;11d7\r | |
1942 | ld (ix+006h),a ;11d8\r | |
1943 | ld (ix+007h),a ;11db\r | |
1944 | ld bc,0ffffh ;11de\r | |
1945 | cpir ;11e1\r | |
1946 | l11e3h:\r | |
1947 | push de ;11e3\r | |
1948 | ld de,(sexp1) ;11e4\r | |
1949 | call CP.HL.DE ;11e8\r | |
1950 | pop de ;11eb\r | |
1951 | jr nc,l11f9h ;11ec\r | |
1952 | call sub_11ffh ;11ee\r | |
1953 | l11f1h:\r | |
1954 | ld a,(hl) ;11f1\r | |
1955 | ldi ;11f2\r | |
1956 | and a ;11f4\r | |
1957 | jr nz,l11f1h ;11f5\r | |
1958 | jr l11e3h ;11f7\r | |
1959 | l11f9h:\r | |
1960 | ld (sexp1),de ;11f9\r | |
1961 | pop bc ;11fd\r | |
1962 | ret ;11fe\r | |
1963 | sub_11ffh:\r | |
1964 | ld iy,bp_tab ;11ff\r | |
1965 | push de ;1203\r | |
1966 | l1204h:\r | |
1967 | ld e,(iy+006h) ;1204\r | |
1968 | ld d,(iy+007h) ;1207\r | |
1969 | call CP.HL.DE ;120a\r | |
1970 | jr z,l1216h ;120d\r | |
1971 | ld de,BP_SIZE ;120f\r | |
1972 | add iy,de ;1212\r | |
1973 | jr l1204h ;1214\r | |
1974 | l1216h:\r | |
1975 | pop de ;1216\r | |
1976 | ld (iy+006h),e ;1217\r | |
1977 | ld (iy+007h),d ;121a\r | |
1978 | ret ;121d\r | |
1979 | \r | |
1980 | CMD.Y:\r | |
1981 | call get.decdigit ;121e\r | |
1982 | jr c,l122fh ;1221\r | |
1983 | inc de ;1223\r | |
1984 | push af ;1224\r | |
1985 | call assert_eol ;1225\r | |
1986 | pop af ;1228\r | |
1987 | call sub_1248h ;1229\r | |
1988 | jp l127ch ;122c\r | |
1989 | l122fh:\r | |
1990 | call assert_eol ;122f\r | |
1991 | xor a ;1232\r | |
1992 | l1233h:\r | |
1993 | push af ;1233\r | |
1994 | call sub_1248h ;1234\r | |
1995 | call outbl4 ;1237\r | |
1996 | pop af ;123a\r | |
1997 | inc a ;123b\r | |
1998 | bit 0,a ;123c\r | |
1999 | push af ;123e\r | |
2000 | call z,CRLF ;123f\r | |
2001 | pop af ;1242\r | |
2002 | cp LF ;1243\r | |
2003 | jr c,l1233h ;1245\r | |
2004 | ret ;1247\r | |
2005 | \r | |
2006 | sub_1248h:\r | |
2007 | ld c,a ;1248\r | |
2008 | ld b,0 ;1249\r | |
2009 | add a,'0'+080h ;124b\r | |
2010 | ld de,msg.Y+1 ;124d\r | |
2011 | ld (de),a ;1250\r | |
2012 | dec de ;1251\r | |
2013 | ld hl,reg.Y ;1252\r | |
2014 | add hl,bc ;1255\r | |
2015 | add hl,bc ;1256\r | |
2016 | ex de,hl ;1257\r | |
2017 | ld c,003h ;1258\r | |
2018 | jp l129ah ;125a\r | |
2019 | \r | |
2020 | CMD.X:\r | |
2021 | call SKIPBL ;125d\r | |
2022 | call sub_1315h ;1260\r | |
2023 | jp nc,l0d41h ;1263\r | |
2024 | call assert_eol ;1266\r | |
2025 | ld a,b ;1269\r | |
2026 | cp 01fh ;126a\r | |
2027 | jr z,l12c6h ;126c\r | |
2028 | cp 020h ;126e\r | |
2029 | jr z,l12b6h ;1270\r | |
2030 | ex de,hl ;1272\r | |
2031 | ld hl,b_0x132A_start ;1273\r | |
2032 | call sub_0a48h ;1276\r | |
2033 | l1279h:\r | |
2034 | call l129ah ;1279\r | |
2035 | l127ch:\r | |
2036 | call OUTBL ;127c\r | |
2037 | push de ;127f\r | |
2038 | push bc ;1280\r | |
2039 | call INLINE ;1281\r | |
2040 | call SKIPBL ;1284\r | |
2041 | jr z,l1297h ;1287\r | |
2042 | call get_arg ;1289\r | |
2043 | ld b,h ;128c\r | |
2044 | ld c,l ;128d\r | |
2045 | pop af ;128e\r | |
2046 | pop hl ;128f\r | |
2047 | ld (hl),c ;1290\r | |
2048 | bit 0,a ;1291\r | |
2049 | ret z ;1293\r | |
2050 | inc hl ;1294\r | |
2051 | ld (hl),b ;1295\r | |
2052 | ret ;1296\r | |
2053 | l1297h:\r | |
2054 | pop af ;1297\r | |
2055 | pop hl ;1298\r | |
2056 | ret ;1299\r | |
2057 | l129ah:\r | |
2058 | ld b,c ;129a\r | |
2059 | call PSTR ;129b\r | |
2060 | ld a,'=' ;129e\r | |
2061 | call OUTCHAR ;12a0\r | |
2062 | ld a,(de) ;12a3\r | |
2063 | bit 0,b ;12a4\r | |
2064 | jp z,out.hex ;12a6\r | |
2065 | ld l,a ;12a9\r | |
2066 | inc de ;12aa\r | |
2067 | ld a,(de) ;12ab\r | |
2068 | dec de ;12ac\r | |
2069 | ld h,a ;12ad\r | |
2070 | bit 1,b ;12ae\r | |
2071 | jp z,out.hl ;12b0\r | |
2072 | jp out.hl.@ ;12b3\r | |
2073 | \r | |
2074 | l12b6h:\r | |
2075 | call prnt_f ;12b6\r | |
2076 | ld a,0f3h ;12b9\r | |
2077 | ld (reg.iff),a ;12bb\r | |
2078 | scf ;12be\r | |
2079 | call sub_12d1h ;12bf\r | |
2080 | ld (reg.f),a ;12c2\r | |
2081 | ret ;12c5\r | |
2082 | \r | |
2083 | l12c6h:\r | |
2084 | call prnt_f2 ;12c6\r | |
2085 | and a ;12c9\r | |
2086 | call sub_12d1h ;12ca\r | |
2087 | ld (reg.f2),a ;12cd\r | |
2088 | ret ;12d0\r | |
2089 | \r | |
2090 | sub_12d1h:\r | |
2091 | ex af,af' ;12d1\r | |
2092 | ld b,000h ;12d2\r | |
2093 | call outbl ;12d4\r | |
2094 | call assert_eol ;12d7\r | |
2095 | call inline ;12da\r | |
2096 | l12ddh:\r | |
2097 | call skipbl ;12dd\r | |
2098 | ld a,b ;12e0\r | |
2099 | ret z ;12e1\r | |
2100 | push bc ;12e2\r | |
2101 | ld hl,tab_pr_flags ;12e3\r | |
2102 | call lookupch ;12e6\r | |
2103 | jp nc,error ;12e9\r | |
2104 | ld a,b ;12ec\r | |
2105 | cp 008h ;12ed\r | |
2106 | jr z,l12feh ;12ef\r | |
2107 | inc b ;12f1\r | |
2108 | ld a,001h ;12f2\r | |
2109 | jr l12f7h ;12f4\r | |
2110 | l12f6h:\r | |
2111 | rlca ;12f6\r | |
2112 | l12f7h:\r | |
2113 | djnz l12f6h ;12f7\r | |
2114 | pop bc ;12f9\r | |
2115 | or b ;12fa\r | |
2116 | ld b,a ;12fb\r | |
2117 | jr l12ddh ;12fc\r | |
2118 | l12feh:\r | |
2119 | ex af,af' ;12fe\r | |
2120 | jp nc,ERROR ;12ff\r | |
2121 | ex af,af' ;1302\r | |
2122 | ld a,0FBh ;1303\r | |
2123 | ld (reg.iff),a ;1305\r | |
2124 | pop bc ;1308\r | |
2125 | jr l12ddh ;1309\r | |
2126 | \r | |
2127 | tab_pr_flags:\r | |
2128 | db 'CNV H ZSE'\r | |
2129 | db 0\r | |
2130 | \r | |
2131 | sub_1315h:\r | |
2132 | call sub_0a0eh ;1315\r | |
2133 | ret nc ;1318\r | |
2134 | ld a,b ;1319\r | |
2135 | add a,b ;131a\r | |
2136 | add a,b ;131b\r | |
2137 | ld hl,b_0x136C_start ;131c\r | |
2138 | call ADD_HL_A ;131f\r | |
2139 | ld c,(hl) ;1322\r | |
2140 | inc hl ;1323\r | |
2141 | ld a,(hl) ;1324\r | |
2142 | inc hl ;1325\r | |
2143 | ld h,(hl) ;1326\r | |
2144 | ld l,a ;1327\r | |
2145 | scf ;1328\r | |
2146 | ret ;1329\r | |
2147 | \r | |
2148 | b_0x132A_start:\r | |
2149 | DC 'CBAR'\r | |
2150 | DC 'BBR'\r | |
2151 | DC 'BC'''\r | |
2152 | DC 'DE'''\r | |
2153 | DC 'HL'''\r | |
2154 | DC 'BC'\r | |
2155 | DC 'DE'\r | |
2156 | DC 'HL'\r | |
2157 | DC 'A'''\r | |
2158 | DC 'B'''\r | |
2159 | DC 'C'''\r | |
2160 | DC 'D'''\r | |
2161 | DC 'E'''\r | |
2162 | DC 'H'''\r | |
2163 | DC 'L'''\r | |
2164 | DC 'A'\r | |
2165 | DC 'B'\r | |
2166 | DC 'C'\r | |
2167 | DC 'D'\r | |
2168 | DC 'E'\r | |
2169 | DC 'H'\r | |
2170 | DC 'L'\r | |
2171 | DC 'IX'\r | |
2172 | DC 'IY'\r | |
2173 | DC 'SP'\r | |
2174 | DC 'PC'\r | |
2175 | DC 'X'\r | |
2176 | DC 'Y'\r | |
2177 | DC 'S'\r | |
2178 | DC 'P'\r | |
2179 | DC 'I'\r | |
2180 | DC 'F'''\r | |
2181 | DC 'F'\r | |
2182 | if ROMSYS\r | |
2183 | DC 'ROMSEL'\r | |
2184 | endif\r | |
2185 | DB 0\r | |
2186 | b_0x136C_start:\r | |
2187 | defb 000h ;136c\r | |
2188 | defw ucbar ;136d\r | |
2189 | defb 000h ;136f\r | |
2190 | defw ubbr ;1370\r | |
2191 | defb 003h ;1372\r | |
2192 | defw reg.c2 ;1373\r | |
2193 | defb 003h ;1375\r | |
2194 | defw reg.e2 ;1376\r | |
2195 | defb 003h ;1378\r | |
2196 | defw reg.l2 ;1379\r | |
2197 | defb 003h ;137b\r | |
2198 | defw reg.c ;137c\r | |
2199 | defb 003h ;137e\r | |
2200 | defw reg.e ;137f\r | |
2201 | defb 003h ;1381\r | |
2202 | defw reg.l ;1382\r | |
2203 | defb 000h ;1384\r | |
2204 | defw reg.a2 ;1385\r | |
2205 | defb 000h ;1387\r | |
2206 | defw reg.b2 ;1388\r | |
2207 | defb 000h ;138a\r | |
2208 | defw reg.c2 ;138b\r | |
2209 | defb 000h ;138d\r | |
2210 | defw reg.d2 ;138e\r | |
2211 | defb 000h ;1390\r | |
2212 | defw reg.e2 ;1391\r | |
2213 | defb 000h ;1393\r | |
2214 | defw reg.h2 ;1394\r | |
2215 | defb 000h ;1396\r | |
2216 | defw reg.l2 ;1397\r | |
2217 | defb 000h ;1399\r | |
2218 | defw reg.a ;139a\r | |
2219 | defb 000h ;139c\r | |
2220 | defw reg.b ;139d\r | |
2221 | defb 000h ;139f\r | |
2222 | defw reg.c ;13a0\r | |
2223 | defb 000h ;13a2\r | |
2224 | defw reg.d ;13a3\r | |
2225 | defb 000h ;13a5\r | |
2226 | defw reg.e ;13a6\r | |
2227 | defb 000h ;13a8\r | |
2228 | defw reg.h ;13a9\r | |
2229 | defb 000h ;13ab\r | |
2230 | defw reg.l ;13ac\r | |
2231 | defb 003h ;13ae\r | |
2232 | defw reg.ix ;13af\r | |
2233 | defb 003h ;13b1\r | |
2234 | defw reg.iy ;13b2\r | |
2235 | defb 003h ;13b4\r | |
2236 | defw reg.sp ;13b5\r | |
2237 | defb 003h ;13b7\r | |
2238 | defw reg.pc ;13b8\r | |
2239 | defb 003h ;13ba\r | |
2240 | defw reg.ix ;13bb\r | |
2241 | defb 003h ;13bd\r | |
2242 | defw reg.iy ;13be\r | |
2243 | defb 003h ;13c0\r | |
2244 | defw reg.sp ;13c1\r | |
2245 | defb 003h ;13c3\r | |
2246 | defw reg.pc ;13c4\r | |
2247 | defb 000h ;13c6\r | |
2248 | defw reg.i ;13c7\r | |
2249 | defb 000h ;13c9\r | |
2250 | defw reg.f2 ;13ca\r | |
2251 | defb 000h ;13cc\r | |
2252 | defw reg.f ;13cd\r | |
2253 | if ROMSYS\r | |
2254 | defb 000h ;13cf\r | |
2255 | defw uromen ;13d0\r | |
2256 | endif\r | |
2257 | CMD.S:\r | |
2258 | ld hl,(lst.S) ;13d2\r | |
2259 | call get_lastarg_def ;13d5\r | |
2260 | l13d8h:\r | |
2261 | ld (lst.S),hl ;13d8\r | |
2262 | call out.hl.@ ;13db\r | |
2263 | call OUTBL ;13de\r | |
2264 | comst ;13e1\r | |
2265 | ld a,(hl) ;13e5\r | |
2266 | comend\r | |
2267 | call out.hex ;13e6\r | |
2268 | call outbl2 ;13e9\r | |
2269 | call INLINE ;13ec\r | |
2270 | call SKIPBL ;13ef\r | |
2271 | inc hl ;13f2\r | |
2272 | jr z,l13d8h ;13f3\r | |
2273 | dec hl ;13f5\r | |
2274 | inc de ;13f6\r | |
2275 | cp '.' ;13f7\r | |
2276 | jp z,assert_eol ;13f9\r | |
2277 | cp '-' ;13fc\r | |
2278 | jr nz,l1406h ;13fe\r | |
2279 | ld a,(de) ;1400\r | |
2280 | or a ;1401\r | |
2281 | dec hl ;1402\r | |
2282 | jr z,l13d8h ;1403\r | |
2283 | inc hl ;1405\r | |
2284 | l1406h:\r | |
2285 | dec de ;1406\r | |
2286 | call get_bytes_m ;1407\r | |
2287 | jr l13d8h ;140a\r | |
2288 | \r | |
2289 | CMD.@:\r | |
2290 | call assert_eol ;140c\r | |
2291 | ld hl,MSG_at ;140f\r | |
2292 | ld de,offs.@ ;1412\r | |
2293 | ld c,001h ;1415\r | |
2294 | jp l1279h ;1417\r | |
2295 | MSG_at:\r | |
2296 | dc '@'\r | |
2297 | \r | |
2298 | CMD.I:\r | |
2299 | ld hl,CMD.I ;141b\r | |
2300 | ld (CMD_RPT),hl ;141e\r | |
2301 | ld hl,(lst.IP) ;1421\r | |
2302 | call get_lastarg_def ;1424\r | |
2303 | ld (lst.IP),hl ;1427\r | |
2304 | ld b,h ;142a\r | |
2305 | ld c,l ;142b\r | |
2306 | ld a,b ;142c\r | |
2307 | or a ;142d\r | |
2308 | jr nz,l1442h ;142e\r | |
2309 | ld a,c ;1430\r | |
2310 | ld hl,ucbar ;1431\r | |
2311 | cp cbar ;1434\r | |
2312 | jr z,l143fh ;1436\r | |
2313 | ld hl,ubbr ;1438\r | |
2314 | cp bbr ;143b\r | |
2315 | jr nz,l1442h ;143d\r | |
2316 | l143fh:\r | |
2317 | ld a,(hl) ;143f\r | |
2318 | jr l1444h ;1440\r | |
2319 | l1442h:\r | |
2320 | in a,(c) ;1442\r | |
2321 | l1444h:\r | |
2322 | push af ;1444\r | |
2323 | call out.hex ;1445\r | |
2324 | call outbl4 ;1448\r | |
2325 | pop af ;144b\r | |
2326 | call out.bin.b ;144c\r | |
2327 | jp CRLF ;144f\r | |
2328 | CMD.O:\r | |
2329 | ld hl,CMD.O ;1452\r | |
2330 | ld (CMD_RPT),hl ;1455\r | |
2331 | ld hl,(lst.OD) ;1458\r | |
2332 | call get_arg_def ;145b\r | |
2333 | ld a,l ;145e\r | |
2334 | ld (lst.OD),a ;145f\r | |
2335 | push af ;1462\r | |
2336 | call skip_to_nextarg ;1463\r | |
2337 | ld hl,(lst.OP) ;1466\r | |
2338 | call get_lastarg_def ;1469\r | |
2339 | ld (lst.OP),hl ;146c\r | |
2340 | ld b,h ;146f\r | |
2341 | ld c,l ;1470\r | |
2342 | ld a,b ;1471\r | |
2343 | or a ;1472\r | |
2344 | jr nz,l1489h ;1473\r | |
2345 | ld a,c ;1475\r | |
2346 | ld hl,ucbar ;1476\r | |
2347 | cp cbar ;1479\r | |
2348 | jr z,l148dh ;147b\r | |
2349 | ld hl,ubbr ;147d\r | |
2350 | cp bbr ;1480\r | |
2351 | jr z,l148dh ;1482\r | |
2352 | cp cbr ;1484\r | |
2353 | jp z,ERROR ;1486\r | |
2354 | l1489h:\r | |
2355 | pop af ;1489\r | |
2356 | out (c),a ;148a\r | |
2357 | ret ;148c\r | |
2358 | l148dh:\r | |
2359 | pop af ;148d\r | |
2360 | ld (hl),a ;148e\r | |
2361 | ret ;148f\r | |
2362 | \r | |
2363 | CMD.V:\r | |
2364 | call get_arg3 ;1490 get from, size, to\r | |
2365 | cmp_mem:\r | |
2366 | push bc ;1493\r | |
2367 | comst ;1494\r | |
2368 | ld a,(de) ;1498\r | |
2369 | ld b,(hl) ;1499\r | |
2370 | comend\r | |
2371 | cp b ;149a\r | |
2372 | jr z,l14bah ;149b\r | |
2373 | ld c,a ;149d\r | |
2374 | call out.hl.@ ;149e\r | |
2375 | call OUTBL ;14a1\r | |
2376 | ld a,b ;14a4\r | |
2377 | call out.hex ;14a5\r | |
2378 | call outbl2 ;14a8\r | |
2379 | ld a,c ;14ab\r | |
2380 | call out.hex ;14ac\r | |
2381 | call OUTBL ;14af\r | |
2382 | ex de,hl ;14b2\r | |
2383 | call out.hl.@ ;14b3\r | |
2384 | ex de,hl ;14b6\r | |
2385 | call CRLF ;14b7\r | |
2386 | l14bah:\r | |
2387 | pop bc ;14ba\r | |
2388 | inc hl ;14bb\r | |
2389 | inc de ;14bc\r | |
2390 | dec bc ;14bd\r | |
2391 | ld a,b ;14be\r | |
2392 | or c ;14bf\r | |
2393 | jr nz,cmp_mem ;14c0\r | |
2394 | ret ;14c2\r | |
2395 | \r | |
2396 | CMD.M:\r | |
2397 | ld a,(de) ;14c3\r | |
2398 | cp 'V' ;14c4\r | |
2399 | jr nz,bm_nv ;14c6\r | |
2400 | inc de ;14c8\r | |
2401 | bm_nv:\r | |
2402 | push af ;14c9 save 'V' flag\r | |
2403 | call get_arg3 ;14ca\r | |
2404 | push hl ;14cd\r | |
2405 | push de ;14ce\r | |
2406 | push bc ;14cf\r | |
2407 | call CP.HL.DE ;14d0\r | |
2408 | jr nc,bm_mvdown ;14d3\r | |
2409 | add hl,bc ;14d5\r | |
2410 | ex de,hl ;14d6\r | |
2411 | add hl,bc ;14d7\r | |
2412 | ex de,hl ;14d8\r | |
2413 | dec hl ;14d9\r | |
2414 | dec de ;14da\r | |
2415 | comst ;14db\r | |
2416 | lddr ;14df\r | |
2417 | comend\r | |
2418 | jr bm_done ;14e1\r | |
2419 | bm_mvdown:\r | |
2420 | comst ;14e3\r | |
2421 | ldir ;14e7\r | |
2422 | comend\r | |
2423 | bm_done:\r | |
2424 | pop bc ;14e9\r | |
2425 | pop de ;14ea\r | |
2426 | pop hl ;14eb\r | |
2427 | pop af ;14ec\r | |
2428 | jr z,cmp_mem ;14ed validate?\r | |
2429 | ret ;14ef\r | |
2430 | CMD.H:\r | |
2431 | call EXPR ;14f0\r | |
2432 | jp c,l173ch ;14f3\r | |
2433 | call skip_to_nextarg ;14f6\r | |
2434 | push hl ;14f9\r | |
2435 | call EXPR ;14fa\r | |
2436 | push af ;14fd\r | |
2437 | call assert_eol ;14fe\r | |
2438 | pop af ;1501\r | |
2439 | ex de,hl ;1502\r | |
2440 | pop hl ;1503\r | |
2441 | jr c,l1511h ;1504\r | |
2442 | push hl ;1506\r | |
2443 | push de ;1507\r | |
2444 | add hl,de ;1508\r | |
2445 | call l1511h ;1509\r | |
2446 | pop de ;150c\r | |
2447 | pop hl ;150d\r | |
2448 | and a ;150e\r | |
2449 | sbc hl,de ;150f\r | |
2450 | l1511h:\r | |
2451 | call out.hl ;1511 val\r | |
2452 | call outbl2 ;1514\r | |
2453 | call sub_0928h ;1517 -val\r | |
2454 | call outbl4 ;151a\r | |
2455 | call out.hl.dec ;151d dec\r | |
2456 | call outbl2 ;1520\r | |
2457 | call out.hl.decm ;1523 -dec\r | |
2458 | call outbl4 ;1526\r | |
2459 | call out.bin.w ;1529 bin\r | |
2460 | call outbl2 ;152c\r | |
2461 | ld a,l ;152f\r | |
2462 | call out.ascii ;1530\r | |
2463 | jp CRLF ;1533\r | |
2464 | \r | |
2465 | CMD.Q:\r | |
2466 | ld a,(de) ;1536\r | |
2467 | sub 'J' ;1537\r | |
2468 | ld (lst.Qj),a ;1539\r | |
2469 | jr nz,l153fh ;153c\r | |
2470 | inc de ;153e\r | |
2471 | l153fh:\r | |
2472 | call get_arg_range ;153f\r | |
2473 | push bc ;1542\r | |
2474 | push hl ;1543\r | |
2475 | call sub_15a7h ;1544\r | |
2476 | pop hl ;1547\r | |
2477 | l1548h:\r | |
2478 | call sub_1594h ;1548\r | |
2479 | jr nz,l1562h ;154b\r | |
2480 | push bc ;154d\r | |
2481 | push hl ;154e\r | |
2482 | ld a,(lst.Qj) ;154f\r | |
2483 | or a ;1552\r | |
2484 | jr nz,l1559h ;1553\r | |
2485 | ld bc,-8 ;1555\r | |
2486 | add hl,bc ;1558\r | |
2487 | l1559h:\r | |
2488 | ld bc,MEMDUMP_CNT ;1559\r | |
2489 | and a ;155c\r | |
2490 | call memdump ;155d\r | |
2491 | pop hl ;1560\r | |
2492 | pop bc ;1561\r | |
2493 | l1562h:\r | |
2494 | inc hl ;1562\r | |
2495 | ex (sp),hl ;1563\r | |
2496 | dec hl ;1564\r | |
2497 | ld a,h ;1565\r | |
2498 | or l ;1566\r | |
2499 | ex (sp),hl ;1567\r | |
2500 | jr nz,l1548h ;1568\r | |
2501 | pop bc ;156a\r | |
2502 | ret ;156b\r | |
2503 | \r | |
2504 | CMD.Z:\r | |
2505 | call get_arg_range ;156c\r | |
2506 | push bc ;156f\r | |
2507 | push hl ;1570\r | |
2508 | call sub_15a7h ;1571\r | |
2509 | ld a,b ;1574\r | |
2510 | pop hl ;1575\r | |
2511 | pop bc ;1576\r | |
2512 | push hl ;1577\r | |
2513 | ex de,hl ;1578\r | |
2514 | l1579h:\r | |
2515 | push af ;1579\r | |
2516 | ld a,(hl) ;157a\r | |
2517 | comst ;157b\r | |
2518 | ld (de),a ;157f\r | |
2519 | comend\r | |
2520 | pop af ;1580\r | |
2521 | inc de ;1581\r | |
2522 | cpi ;1582\r | |
2523 | jp po,l1592h ;1584\r | |
2524 | dec a ;1587\r | |
2525 | jr nz,l1579h ;1588\r | |
2526 | pop hl ;158a\r | |
2527 | comst ;158b\r | |
2528 | ldir ;158f\r | |
2529 | comend\r | |
2530 | ret ;1591\r | |
2531 | l1592h:\r | |
2532 | pop hl ;1592\r | |
2533 | ret ;1593\r | |
2534 | \r | |
2535 | sub_1594h:\r | |
2536 | push hl ;1594\r | |
2537 | push de ;1595\r | |
2538 | push bc ;1596\r | |
2539 | l1597h:\r | |
2540 | ld a,(de) ;1597\r | |
2541 | comst ;1598\r | |
2542 | cp (hl) ;159c\r | |
2543 | comend\r | |
2544 | jr nz,l15a3h ;159d\r | |
2545 | inc de ;159f\r | |
2546 | inc hl ;15a0\r | |
2547 | djnz l1597h ;15a1\r | |
2548 | l15a3h:\r | |
2549 | pop bc ;15a3\r | |
2550 | pop de ;15a4\r | |
2551 | pop hl ;15a5\r | |
2552 | ret ;15a6\r | |
2553 | \r | |
2554 | sub_15a7h:\r | |
2555 | ld hl,ci.buf+1 ;15a7\r | |
2556 | call get_bytes ;15aa\r | |
2557 | ld de,ci.buf+1 ;15ad\r | |
2558 | and a ;15b0\r | |
2559 | sbc hl,de ;15b1\r | |
2560 | ld b,l ;15b3\r | |
2561 | ret nz ;15b4\r | |
2562 | jp ERROR ;15b5\r | |
2563 | \r | |
2564 | get_bytes:\r | |
2565 | db 0e6h ;15b8 and 037h (clear carry, skip next opc)\r | |
2566 | get_bytes_m:\r | |
2567 | scf\r | |
2568 | l15bah:\r | |
2569 | push af ;15ba\r | |
2570 | call skip_to_nextarg ;15bb\r | |
2571 | cp 'W' ;15be\r | |
2572 | jr nz,l15d9h ;15c0\r | |
2573 | inc de ;15c2\r | |
2574 | push hl ;15c3\r | |
2575 | call sub_0a68h ;15c4\r | |
2576 | ex de,hl ;15c7\r | |
2577 | pop bc ;15c8\r | |
2578 | pop af ;15c9\r | |
2579 | push af ;15ca\r | |
2580 | push bc ;15cb\r | |
2581 | ex (sp),hl ;15cc\r | |
2582 | jr nc,l15d3h ;15cd\r | |
2583 | comst ;15cf\r | |
2584 | l15d3h:\r | |
2585 | ld (hl),e ;15d3\r | |
2586 | comend\r | |
2587 | inc hl ;15d4\r | |
2588 | ld c,d ;15d5\r | |
2589 | pop de ;15d6\r | |
2590 | jr l15e5h ;15d7\r | |
2591 | l15d9h:\r | |
2592 | cp '''' ;15d9\r | |
2593 | jr z,l15f1h ;15db\r | |
2594 | push hl ;15dd\r | |
2595 | call EXPR ;15de\r | |
2596 | ld c,l ;15e1\r | |
2597 | pop hl ;15e2\r | |
2598 | jr c,l1626h ;15e3\r | |
2599 | l15e5h:\r | |
2600 | pop af ;15e5\r | |
2601 | push af ;15e6\r | |
2602 | jr nc,l15edh ;15e7\r | |
2603 | comst ;15e9\r | |
2604 | l15edh:\r | |
2605 | ld (hl),c ;15ed\r | |
2606 | comend\r | |
2607 | inc hl ;15ee\r | |
2608 | jr l161eh ;15ef\r | |
2609 | l15f1h:\r | |
2610 | inc de ;15f1\r | |
2611 | ld a,(de) ;15f2\r | |
2612 | cp '''' ;15f3\r | |
2613 | jr z,l1607h ;15f5\r | |
2614 | or a ;15f7\r | |
2615 | jr z,l1626h ;15f8\r | |
2616 | l15fah:\r | |
2617 | ld c,a ;15fa\r | |
2618 | pop af ;15fb\r | |
2619 | push af ;15fc\r | |
2620 | jr nc,l1603h ;15fd\r | |
2621 | comst ;15ff\r | |
2622 | l1603h:\r | |
2623 | ld (hl),c ;1603\r | |
2624 | comend\r | |
2625 | inc hl ;1604\r | |
2626 | jr l15f1h ;1605\r | |
2627 | l1607h:\r | |
2628 | inc de ;1607\r | |
2629 | ld a,(de) ;1608\r | |
2630 | cp '''' ;1609\r | |
2631 | jr z,l15fah ;160b\r | |
2632 | cp '.' ;160d\r | |
2633 | jr nz,l161eh ;160f\r | |
2634 | inc de ;1611\r | |
2635 | dec hl ;1612\r | |
2636 | pop af ;1613\r | |
2637 | push af ;1614\r | |
2638 | jr nc,l161bh ;1615\r | |
2639 | comst ;1617\r | |
2640 | l161bh:\r | |
2641 | set 7,(hl) ;161b\r | |
2642 | comend\r | |
2643 | inc hl ;161d\r | |
2644 | l161eh:\r | |
2645 | pop af ;161e\r | |
2646 | jr nc,l15bah ;161f\r | |
2647 | ld (lst.S),hl ;1621\r | |
2648 | jr l15bah ;1624\r | |
2649 | \r | |
2650 | l1626h:\r | |
2651 | pop af ;1626\r | |
2652 | ret nc ;1627\r | |
2653 | ld (lst.S),hl ;1628\r | |
2654 | ret ;162b\r | |
2655 | \r | |
2656 | CMD.D:\r | |
2657 | ld hl,CMD.D ;162c\r | |
2658 | ld (CMD_RPT),hl ;162f\r | |
2659 | ld hl,(lst.D) ;1632\r | |
2660 | ld bc,00080h ;1635\r | |
2661 | call sub_0a82h ;1638\r | |
2662 | scf ;163b\r | |
2663 | memdump:\r | |
2664 | push bc ;163c\r | |
2665 | push de ;163d\r | |
2666 | push hl ;163e\r | |
2667 | ex af,af' ;163f\r | |
2668 | l1640h:\r | |
2669 | call out.hl.@ ;1640\r | |
2670 | call z,outbl2 ;1643\r | |
2671 | call OUTBL ;1646\r | |
2672 | ld de,0 ;1649\r | |
2673 | l164ch:\r | |
2674 | comst ;164c\r | |
2675 | ld a,(hl) ;1650\r | |
2676 | comend\r | |
2677 | inc hl ;1651\r | |
2678 | call out.hex ;1652\r | |
2679 | call OUTBL ;1655\r | |
2680 | dec bc ;1658\r | |
2681 | inc e ;1659\r | |
2682 | ld a,e ;165a\r | |
2683 | cp 010h ;165b\r | |
2684 | jr z,l1668h ;165d\r | |
2685 | and 003h ;165f\r | |
2686 | call z,OUTBL ;1661\r | |
2687 | ld a,b ;1664\r | |
2688 | or c ;1665\r | |
2689 | jr nz,l164ch ;1666\r | |
2690 | l1668h:\r | |
2691 | call OUTBL ;1668\r | |
2692 | and a ;166b\r | |
2693 | sbc hl,de ;166c\r | |
2694 | l166eh:\r | |
2695 | comst ;166e\r | |
2696 | ld a,(hl) ;1672\r | |
2697 | comend\r | |
2698 | call sub_168fh ;1673\r | |
2699 | call OUTCHAR ;1676\r | |
2700 | inc hl ;1679\r | |
2701 | dec e ;167a\r | |
2702 | jr nz,l166eh ;167b\r | |
2703 | ex af,af' ;167d\r | |
2704 | jr nc,l1683h ;167e\r | |
2705 | ld (lst.D),hl ;1680\r | |
2706 | l1683h:\r | |
2707 | ex af,af' ;1683\r | |
2708 | call CRLF ;1684\r | |
2709 | ld a,b ;1687\r | |
2710 | or c ;1688\r | |
2711 | jr nz,l1640h ;1689\r | |
2712 | pop hl ;168b\r | |
2713 | pop de ;168c\r | |
2714 | pop bc ;168d\r | |
2715 | ret ;168e\r | |
2716 | sub_168fh:\r | |
2717 | and 07fh ;168f\r | |
2718 | cp 07fh ;1691\r | |
2719 | jr z,l1698h ;1693\r | |
2720 | cp 020h ;1695\r | |
2721 | ret nc ;1697\r | |
2722 | l1698h:\r | |
2723 | ld a,02eh ;1698\r | |
2724 | ret ;169a\r | |
2725 | \r | |
2726 | ; Read Intel Hex File from console.\r | |
a16ba2b0 L |
2727 | CMD.R:\r |
2728 | ld hl,0 ;169b\r | |
3531528e | 2729 | call get_lastarg_def ;169e get offset from command line\r |
a16ba2b0 L |
2730 | push hl ;16a1\r |
2731 | ld hl,0 ;16a2\r | |
2732 | ld (HILOD),hl ;16a5\r | |
2733 | w_recstart:\r | |
2734 | call i.getchar ;16a8\r | |
2735 | jr z,l16deh ;16ab\r | |
2736 | cp ':' ;16ad\r | |
2737 | jr nz,w_recstart ;16af\r | |
2738 | ld c,0 ;16b1 init checksum\r | |
2739 | call i.gethexbyte ;16b3 record len\r | |
2740 | ld b,a ;16b6\r | |
2741 | call i.gethexbyte ;16b7 address high\r | |
2742 | ld h,a ;16ba\r | |
2743 | call i.gethexbyte ;16bb address low\r | |
2744 | ld l,a ;16be\r | |
2745 | call i.gethexbyte ;16bf record type (ignored)\r | |
2746 | ld a,b ;16c2\r | |
2747 | and a ;16c3 record len == 0?\r | |
2748 | jr z,l16deh ;16c4\r | |
2749 | l16c6h:\r | |
2750 | call i.gethexbyte ;16c6\r | |
3531528e | 2751 | pop de ;16c9 offset\r |
a16ba2b0 L |
2752 | push de ;16ca\r |
2753 | push hl ;16cb\r | |
2754 | add hl,de ;16cc\r | |
2755 | call i.storebyte ;16cd\r | |
2756 | pop hl ;16d0\r | |
2757 | inc hl ;16d1\r | |
3531528e L |
2758 | djnz l16c6h ;16d2 repeat for record len\r |
2759 | call i.gethexbyte ;16d4 checksum\r | |
a16ba2b0 L |
2760 | ld a,c ;16d7\r |
2761 | and a ;16d8\r | |
2762 | jp nz,ERROR ;16d9 exit if checksum error\r | |
2763 | jr w_recstart ;16dc next record\r | |
2764 | l16deh:\r | |
2765 | pop hl ;16de\r | |
2766 | call i.gethexbyte ;16df\r | |
2767 | jp l173fh ;16e2\r | |
2768 | \r | |
2769 | i.gethexbyte:\r | |
2770 | call sub_16f6h ;16e5\r | |
2771 | rlca ;16e8\r | |
2772 | rlca ;16e9\r | |
2773 | rlca ;16ea\r | |
2774 | rlca ;16eb\r | |
2775 | ld d,a ;16ec\r | |
2776 | call sub_16f6h ;16ed\r | |
2777 | add a,d ;16f0\r | |
2778 | ld d,a ;16f1\r | |
2779 | add a,c ;16f2\r | |
2780 | ld c,a ;16f3\r | |
2781 | ld a,d ;16f4\r | |
2782 | ret ;16f5\r | |
2783 | \r | |
2784 | sub_16f6h:\r | |
2785 | call i.getchar ;16f6\r | |
2786 | jr z,l16ffh ;16f9\r | |
2787 | call sub_0d26h ;16fb\r | |
2788 | ret nc ;16fe\r | |
2789 | l16ffh:\r | |
2790 | jp ERROR ;16ff\r | |
2791 | \r | |
2792 | i.getchar:\r | |
2793 | call $ci ;1702\r | |
2794 | cp 01ah ;1705\r | |
2795 | ret ;1707\r | |
2796 | \r | |
2797 | i.storebyte:\r | |
2798 | push af ;1708\r | |
2799 | push de ;1709\r | |
3531528e | 2800 | ld de,TPA ;170a lowest allowed load address\r |
a16ba2b0 L |
2801 | call CP.HL.DE ;170d\r |
2802 | jp c,ERROR ;1710\r | |
3531528e | 2803 | ld de,$stcka ;1713 highest allowed load address\r |
a16ba2b0 L |
2804 | call CP.HL.DE ;1716\r |
2805 | jp nc,ERROR ;1719\r | |
2806 | ld de,(HILOD) ;171c\r | |
2807 | call CP.HL.DE ;1720\r | |
2808 | jr c,l1728h ;1723\r | |
2809 | ld (HILOD),hl ;1725\r | |
2810 | l1728h:\r | |
2811 | ld de,(MAXLOD) ;1728\r | |
2812 | call CP.HL.DE ;172c\r | |
2813 | jr c,l1734h ;172f\r | |
2814 | ld (MAXLOD),hl ;1731\r | |
2815 | l1734h:\r | |
2816 | pop de ;1734\r | |
2817 | pop af ;1735\r | |
2818 | comst ;1736\r | |
3531528e | 2819 | ld (hl),a ;173a store byte\r |
a16ba2b0 L |
2820 | comend\r |
2821 | ret ;173b\r | |
2822 | \r | |
2823 | l173ch:\r | |
2824 | call assert_eol ;173c\r | |
2825 | l173fh:\r | |
2826 | ld hl,MSG_high ;173f\r | |
2827 | call PSTR ;1742\r | |
2828 | ld hl,(HILOD) ;1745\r | |
2829 | call out.hl ;1748\r | |
2830 | ld hl,MSG_max ;174b\r | |
2831 | call PSTR ;174e\r | |
2832 | ld hl,(MAXLOD) ;1751\r | |
2833 | call out.hl ;1754\r | |
2834 | jp CRLF ;1757\r | |
2835 | \r | |
2836 | MSG_high:\r | |
2837 | DC 'High = '\r | |
2838 | MSG_max:\r | |
2839 | DC ' Max = '\r | |
2840 | \r | |
2841 | CMD.A:\r | |
2842 | ld hl,(lst.A) ;1769\r | |
2843 | call get_lastarg_def ;176c\r | |
2844 | push hl ;176f\r | |
2845 | pop iy ;1770\r | |
2846 | ld hl,l17c4h ;1772\r | |
2847 | ld (CMD_ERR),hl ;1775\r | |
2848 | ld (XB068),sp ;1778\r | |
2849 | l177ch:\r | |
2850 | push iy ;177c\r | |
2851 | pop hl ;177e\r | |
2852 | ld (lst.A),hl ;177f\r | |
2853 | ld (OFFS.pc),hl ;1782\r | |
2854 | push hl ;1785\r | |
2855 | call sub_1f3fh ;1786\r | |
2856 | pop iy ;1789\r | |
2857 | ld c,b ;178b\r | |
2858 | ld de,(offs.@) ;178c\r | |
2859 | ld a,d ;1790\r | |
2860 | or e ;1791\r | |
2861 | ld b,011h ;1792\r | |
2862 | jr z,l1798h ;1794\r | |
2863 | ld b,019h ;1796\r | |
2864 | l1798h:\r | |
2865 | call OUTBL ;1798\r | |
2866 | ld a,(CON.COL) ;179b\r | |
2867 | cp b ;179e\r | |
2868 | jr c,l1798h ;179f\r | |
2869 | push bc ;17a1\r | |
2870 | call INLINE ;17a2\r | |
2871 | pop bc ;17a5\r | |
2872 | call SKIPBL ;17a6\r | |
2873 | cp '.' ;17a9\r | |
2874 | ret z ;17ab\r | |
2875 | cp '-' ;17ac\r | |
2876 | jr nz,l17b6h ;17ae\r | |
2877 | ld iy,(XB06C) ;17b0\r | |
2878 | jr l177ch ;17b4\r | |
2879 | l17b6h:\r | |
2880 | and a ;17b6\r | |
2881 | call nz,sub_17cdh ;17b7\r | |
2882 | ld (XB06C),iy ;17ba\r | |
2883 | ld b,0 ;17be\r | |
2884 | add iy,bc ;17c0\r | |
2885 | jr l177ch ;17c2\r | |
2886 | l17c4h:\r | |
2887 | call l07eah ;17c4\r | |
2888 | ld sp,(XB068) ;17c7\r | |
2889 | jr l177ch ;17cb\r | |
2890 | \r | |
2891 | sub_17cdh:\r | |
2892 | call SKIPBL ;17cd\r | |
2893 | ld hl,t_MNEMONICS ;17d0\r | |
2894 | call sub_0a15h ;17d3\r | |
2895 | jp nc,ERROR ;17d6\r | |
2896 | call SKIPBL ;17d9\r | |
2897 | push de ;17dc\r | |
2898 | ld a,b ;17dd\r | |
2899 | add a,b ;17de\r | |
2900 | add a,b ;17df\r | |
2901 | ld hl,b_0x17EE_start ;17e0\r | |
2902 | call ADD_HL_A ;17e3\r | |
2903 | ld e,(hl) ;17e6\r | |
2904 | inc hl ;17e7\r | |
2905 | ld d,(hl) ;17e8\r | |
2906 | inc hl ;17e9\r | |
2907 | ld b,(hl) ;17ea\r | |
2908 | ex de,hl ;17eb\r | |
2909 | pop de ;17ec\r | |
2910 | jp (hl) ;17ed\r | |
2911 | \r | |
2912 | b_0x17EE_start:\r | |
2913 | defw l1b54h ;17ee\r | |
2914 | \r | |
2915 | b_0x17F0_start:\r | |
2916 | defb 088h ;17f0\r | |
2917 | \r | |
2918 | b_0x17F1_start:\r | |
2919 | defw l1b74h ;17f1\r | |
2920 | \r | |
2921 | b_0x17F3_start:\r | |
2922 | defb 080h ;17f3\r | |
2923 | \r | |
2924 | b_0x17F4_start:\r | |
2925 | defw l1babh ;17f4\r | |
2926 | \r | |
2927 | b_0x17F6_start:\r | |
2928 | defb 0a0h ;17f6\r | |
2929 | \r | |
2930 | b_0x17F7_start:\r | |
2931 | defw l1c14h ;17f7\r | |
2932 | \r | |
2933 | b_0x17F9_start:\r | |
2934 | defb 040h ;17f9\r | |
2935 | \r | |
2936 | b_0x17FA_start:\r | |
2937 | defw l1c38h ;17fa\r | |
2938 | \r | |
2939 | b_0x17FC_start:\r | |
2940 | defb 0c4h ;17fc\r | |
2941 | \r | |
2942 | b_0x17FD_start:\r | |
2943 | defw l1b36h ;17fd\r | |
2944 | \r | |
2945 | b_0x17FF_start:\r | |
2946 | defb 03fh ;17ff\r | |
2947 | \r | |
2948 | b_0x1800_start:\r | |
2949 | defw l1babh ;1800\r | |
2950 | \r | |
2951 | b_0x1802_start:\r | |
2952 | defb 0b8h ;1802\r | |
2953 | \r | |
2954 | b_0x1803_start:\r | |
2955 | defw gen.opc.ED2 ;1803\r | |
2956 | \r | |
2957 | b_0x1805_start:\r | |
2958 | defb 0a9h ;1805\r | |
2959 | \r | |
2960 | b_0x1806_start:\r | |
2961 | defw gen.opc.ED2 ;1806\r | |
2962 | \r | |
2963 | b_0x1808_start:\r | |
2964 | defb 0b9h ;1808\r | |
2965 | \r | |
2966 | b_0x1809_start:\r | |
2967 | defw gen.opc.ED2 ;1809\r | |
2968 | \r | |
2969 | b_0x180B_start:\r | |
2970 | defb 0a1h ;180b\r | |
2971 | \r | |
2972 | b_0x180C_start:\r | |
2973 | defw gen.opc.ED2 ;180c\r | |
2974 | \r | |
2975 | b_0x180E_start:\r | |
2976 | defb 0b1h ;180e\r | |
2977 | \r | |
2978 | b_0x180F_start:\r | |
2979 | defw l1b36h ;180f\r | |
2980 | \r | |
2981 | b_0x1811_start:\r | |
2982 | defb 02fh ;1811\r | |
2983 | \r | |
2984 | b_0x1812_start:\r | |
2985 | defw l1b36h ;1812\r | |
2986 | \r | |
2987 | b_0x1814_start:\r | |
2988 | defb 027h ;1814\r | |
2989 | \r | |
2990 | b_0x1815_start:\r | |
2991 | defw l1dabh ;1815\r | |
2992 | \r | |
2993 | b_0x1817_start:\r | |
2994 | defb 005h ;1817\r | |
2995 | \r | |
2996 | b_0x1818_start:\r | |
2997 | defw l1b36h ;1818\r | |
2998 | \r | |
2999 | b_0x181A_start:\r | |
3000 | defb 0f3h ;181a\r | |
3001 | \r | |
3002 | b_0x181B_start:\r | |
3003 | defw l1ca4h ;181b\r | |
3004 | \r | |
3005 | b_0x181D_start:\r | |
3006 | defb 010h ;181d\r | |
3007 | \r | |
3008 | b_0x181E_start:\r | |
3009 | defw l1b36h ;181e\r | |
3010 | \r | |
3011 | b_0x1820_start:\r | |
3012 | defb 0fbh ;1820\r | |
3013 | \r | |
3014 | b_0x1821_start:\r | |
3015 | defw l1d54h ;1821\r | |
3016 | \r | |
3017 | b_0x1823_start:\r | |
3018 | defb 0e3h ;1823\r | |
3019 | \r | |
3020 | b_0x1824_start:\r | |
3021 | defw l1b36h ;1824\r | |
3022 | \r | |
3023 | b_0x1826_start:\r | |
3024 | defb 0d9h ;1826\r | |
3025 | \r | |
3026 | b_0x1827_start:\r | |
3027 | defw l1b36h ;1827\r | |
3028 | \r | |
3029 | b_0x1829_start:\r | |
3030 | defb 076h ;1829\r | |
3031 | \r | |
3032 | b_0x182A_start:\r | |
3033 | defw l1cbfh ;182a\r | |
3034 | \r | |
3035 | b_0x182C_start:\r | |
3036 | defb 046h ;182c\r | |
3037 | \r | |
3038 | b_0x182D_start:\r | |
3039 | defw l1cf8h ;182d\r | |
3040 | \r | |
3041 | b_0x182F_start:\r | |
3042 | defb 040h ;182f\r | |
3043 | \r | |
3044 | b_0x1830_start:\r | |
3045 | defw l1dabh ;1830\r | |
3046 | \r | |
3047 | b_0x1832_start:\r | |
3048 | defb 004h ;1832\r | |
3049 | \r | |
3050 | b_0x1833_start:\r | |
3051 | defw gen.opc.ED2 ;1833\r | |
3052 | \r | |
3053 | b_0x1835_start:\r | |
3054 | defb 0aah ;1835\r | |
3055 | \r | |
3056 | b_0x1836_start:\r | |
3057 | defw gen.opc.ED2 ;1836\r | |
3058 | \r | |
3059 | b_0x1838_start:\r | |
3060 | defb 0bah ;1838\r | |
3061 | \r | |
3062 | b_0x1839_start:\r | |
3063 | defw gen.opc.ED2 ;1839\r | |
3064 | \r | |
3065 | b_0x183B_start:\r | |
3066 | defb 0a2h ;183b\r | |
3067 | \r | |
3068 | b_0x183C_start:\r | |
3069 | defw gen.opc.ED2 ;183c\r | |
3070 | \r | |
3071 | b_0x183E_start:\r | |
3072 | defb 0b2h ;183e\r | |
3073 | \r | |
3074 | b_0x183F_start:\r | |
3075 | defw l1c5eh ;183f\r | |
3076 | \r | |
3077 | b_0x1841_start:\r | |
3078 | defb 0c2h ;1841\r | |
3079 | \r | |
3080 | b_0x1842_start:\r | |
3081 | defw l1cabh ;1842\r | |
3082 | \r | |
3083 | b_0x1844_start:\r | |
3084 | defb 020h ;1844\r | |
3085 | \r | |
3086 | b_0x1845_start:\r | |
3087 | defw l1934h ;1845\r | |
3088 | \r | |
3089 | b_0x1847_start:\r | |
3090 | defb 040h ;1847\r | |
3091 | \r | |
3092 | b_0x1848_start:\r | |
3093 | defw gen.opc.ED2 ;1848\r | |
3094 | \r | |
3095 | b_0x184A_start:\r | |
3096 | defb 0a8h ;184a\r | |
3097 | \r | |
3098 | b_0x184B_start:\r | |
3099 | defw gen.opc.ED2 ;184b\r | |
3100 | \r | |
3101 | b_0x184D_start:\r | |
3102 | defb 0b8h ;184d\r | |
3103 | \r | |
3104 | b_0x184E_start:\r | |
3105 | defw gen.opc.ED2 ;184e\r | |
3106 | \r | |
3107 | b_0x1850_start:\r | |
3108 | defb 0a0h ;1850\r | |
3109 | \r | |
3110 | b_0x1851_start:\r | |
3111 | defw gen.opc.ED2 ;1851\r | |
3112 | \r | |
3113 | b_0x1853_start:\r | |
3114 | defb 0b0h ;1853\r | |
3115 | \r | |
3116 | b_0x1854_start:\r | |
3117 | defw gen.opc.ED2 ;1854\r | |
3118 | \r | |
3119 | b_0x1856_start:\r | |
3120 | defb 044h ;1856\r | |
3121 | \r | |
3122 | b_0x1857_start:\r | |
3123 | defw l1b36h ;1857\r | |
3124 | \r | |
3125 | b_0x1859_start:\r | |
3126 | defb 000h ;1859\r | |
3127 | \r | |
3128 | b_0x185A_start:\r | |
3129 | defw l1babh ;185a\r | |
3130 | \r | |
3131 | b_0x185C_start:\r | |
3132 | defb 0b0h ;185c\r | |
3133 | \r | |
3134 | b_0x185D_start:\r | |
3135 | defw gen.opc.ED2 ;185d\r | |
3136 | \r | |
3137 | b_0x185F_start:\r | |
3138 | defb 0bbh ;185f\r | |
3139 | \r | |
3140 | b_0x1860_start:\r | |
3141 | defw gen.opc.ED2 ;1860\r | |
3142 | \r | |
3143 | b_0x1862_start:\r | |
3144 | defb 0b3h ;1862\r | |
3145 | \r | |
3146 | b_0x1863_start:\r | |
3147 | defw l1d2ch ;1863\r | |
3148 | \r | |
3149 | b_0x1865_start:\r | |
3150 | defb 041h ;1865\r | |
3151 | \r | |
3152 | b_0x1866_start:\r | |
3153 | defw gen.opc.ED2 ;1866\r | |
3154 | \r | |
3155 | b_0x1868_start:\r | |
3156 | defb 0abh ;1868\r | |
3157 | \r | |
3158 | b_0x1869_start:\r | |
3159 | defw gen.opc.ED2 ;1869\r | |
3160 | \r | |
3161 | b_0x186B_start:\r | |
3162 | defb 0a3h ;186b\r | |
3163 | \r | |
3164 | b_0x186C_start:\r | |
3165 | defw l1ce4h ;186c\r | |
3166 | \r | |
3167 | b_0x186E_start:\r | |
3168 | defb 0c1h ;186e\r | |
3169 | \r | |
3170 | b_0x186F_start:\r | |
3171 | defw l1ce4h ;186f\r | |
3172 | \r | |
3173 | b_0x1871_start:\r | |
3174 | defb 0c5h ;1871\r | |
3175 | \r | |
3176 | b_0x1872_start:\r | |
3177 | defw l1c14h ;1872\r | |
3178 | \r | |
3179 | b_0x1874_start:\r | |
3180 | defb 080h ;1874\r | |
3181 | \r | |
3182 | b_0x1875_start:\r | |
3183 | defw l1c50h ;1875\r | |
3184 | \r | |
3185 | b_0x1877_start:\r | |
3186 | defb 0c0h ;1877\r | |
3187 | \r | |
3188 | b_0x1878_start:\r | |
3189 | defw gen.opc.ED2 ;1878\r | |
3190 | \r | |
3191 | b_0x187A_start:\r | |
3192 | defb 04dh ;187a\r | |
3193 | \r | |
3194 | b_0x187B_start:\r | |
3195 | defw gen.opc.ED2 ;187b\r | |
3196 | \r | |
3197 | b_0x187D_start:\r | |
3198 | defb 045h ;187d\r | |
3199 | \r | |
3200 | b_0x187E_start:\r | |
3201 | defw l1bd8h ;187e\r | |
3202 | \r | |
3203 | b_0x1880_start:\r | |
3204 | defb 010h ;1880\r | |
3205 | \r | |
3206 | b_0x1881_start:\r | |
3207 | defw l1b36h ;1881\r | |
3208 | \r | |
3209 | b_0x1883_start:\r | |
3210 | defb 017h ;1883\r | |
3211 | \r | |
3212 | b_0x1884_start:\r | |
3213 | defw l1bd8h ;1884\r | |
3214 | \r | |
3215 | b_0x1886_start:\r | |
3216 | defb 000h ;1886\r | |
3217 | \r | |
3218 | b_0x1887_start:\r | |
3219 | defw l1b36h ;1887\r | |
3220 | \r | |
3221 | b_0x1889_start:\r | |
3222 | defb 007h ;1889\r | |
3223 | \r | |
3224 | b_0x188A_start:\r | |
3225 | defw gen.opc.ED2 ;188a\r | |
3226 | \r | |
3227 | b_0x188C_start:\r | |
3228 | defb 06fh ;188c\r | |
3229 | \r | |
3230 | b_0x188D_start:\r | |
3231 | defw l1bd8h ;188d\r | |
3232 | \r | |
3233 | b_0x188F_start:\r | |
3234 | defb 018h ;188f\r | |
3235 | \r | |
3236 | b_0x1890_start:\r | |
3237 | defw l1b36h ;1890\r | |
3238 | \r | |
3239 | b_0x1892_start:\r | |
3240 | defb 01fh ;1892\r | |
3241 | \r | |
3242 | b_0x1893_start:\r | |
3243 | defw l1bd8h ;1893\r | |
3244 | \r | |
3245 | b_0x1895_start:\r | |
3246 | defb 008h ;1895\r | |
3247 | \r | |
3248 | b_0x1896_start:\r | |
3249 | defw l1b36h ;1896\r | |
3250 | \r | |
3251 | b_0x1898_start:\r | |
3252 | defb 00fh ;1898\r | |
3253 | \r | |
3254 | b_0x1899_start:\r | |
3255 | defw gen.opc.ED2 ;1899\r | |
3256 | \r | |
3257 | b_0x189B_start:\r | |
3258 | defb 067h ;189b\r | |
3259 | \r | |
3260 | b_0x189C_start:\r | |
3261 | defw l1cd5h ;189c\r | |
3262 | \r | |
3263 | b_0x189E_start:\r | |
3264 | defb 0c7h ;189e\r | |
3265 | \r | |
3266 | b_0x189F_start:\r | |
3267 | defw l1b54h ;189f\r | |
3268 | \r | |
3269 | b_0x18A1_start:\r | |
3270 | defb 098h ;18a1\r | |
3271 | \r | |
3272 | b_0x18A2_start:\r | |
3273 | defw l1b36h ;18a2\r | |
3274 | \r | |
3275 | b_0x18A4_start:\r | |
3276 | defb 037h ;18a4\r | |
3277 | \r | |
3278 | b_0x18A5_start:\r | |
3279 | defw l1c14h ;18a5\r | |
3280 | \r | |
3281 | b_0x18A7_start:\r | |
3282 | defb 0c0h ;18a7\r | |
3283 | \r | |
3284 | b_0x18A8_start:\r | |
3285 | defw l1bd8h ;18a8\r | |
3286 | \r | |
3287 | b_0x18AA_start:\r | |
3288 | defb 020h ;18aa\r | |
3289 | \r | |
3290 | b_0x18AB_start:\r | |
3291 | defw l1bd8h ;18ab\r | |
3292 | \r | |
3293 | b_0x18AD_start:\r | |
3294 | defb 028h ;18ad\r | |
3295 | \r | |
3296 | b_0x18AE_start:\r | |
3297 | defw l1bd8h ;18ae\r | |
3298 | \r | |
3299 | b_0x18B0_start:\r | |
3300 | defb 038h ;18b0\r | |
3301 | \r | |
3302 | b_0x18B1_start:\r | |
3303 | defw l1babh ;18b1\r | |
3304 | \r | |
3305 | b_0x18B3_start:\r | |
3306 | defb 090h ;18b3\r | |
3307 | \r | |
3308 | b_0x18B4_start:\r | |
3309 | defw l1babh ;18b4\r | |
3310 | \r | |
3311 | b_0x18B6_start:\r | |
3312 | defb 0a8h ;18b6\r | |
3313 | \r | |
3314 | b_0x18B7_start:\r | |
3315 | defw A.IN0 ;18b7\r | |
3316 | \r | |
3317 | b_0x18B9_start:\r | |
3318 | defb 000h ;18b9\r | |
3319 | \r | |
3320 | b_0x18BA_start:\r | |
3321 | defw A.MLT ;18ba\r | |
3322 | \r | |
3323 | b_0x18BC_start:\r | |
3324 | defb 04ch ;18bc\r | |
3325 | ld b,e ;18bd\r | |
3326 | dec de ;18be\r | |
3327 | \r | |
3328 | b_0x18BF_start:\r | |
3329 | defb 08bh ;18bf\r | |
3330 | \r | |
3331 | b_0x18C0_start:\r | |
3332 | defw gen.opc.ED2 ;18c0\r | |
3333 | \r | |
3334 | b_0x18C2_start:\r | |
3335 | defb 09bh ;18c2\r | |
3336 | \r | |
3337 | b_0x18C3_start:\r | |
3338 | defw gen.opc.ED2 ;18c3\r | |
3339 | \r | |
3340 | b_0x18C5_start:\r | |
3341 | defb 083h ;18c5\r | |
3342 | \r | |
3343 | b_0x18C6_start:\r | |
3344 | defw gen.opc.ED2 ;18c6\r | |
3345 | \r | |
3346 | b_0x18C8_start:\r | |
3347 | defb 093h ;18c8\r | |
3348 | \r | |
3349 | b_0x18C9_start:\r | |
3350 | defw l18fdh ;18c9\r | |
3351 | \r | |
3352 | b_0x18CB_start:\r | |
3353 | defb 001h ;18cb\r | |
3354 | \r | |
3355 | b_0x18CC_start:\r | |
3356 | defw gen.opc.ED2 ;18cc\r | |
3357 | \r | |
3358 | b_0x18CE_start:\r | |
3359 | defb 076h ;18ce\r | |
3360 | \r | |
3361 | b_0x18CF_start:\r | |
3362 | defw l191dh ;18cf\r | |
3363 | \r | |
3364 | b_0x18D1_start:\r | |
3365 | defb 004h ;18d1\r | |
3366 | \r | |
3367 | b_0x18D2_start:\r | |
3368 | defw l192ch ;18d2\r | |
3369 | \r | |
3370 | b_0x18D4_start:\r | |
3371 | defb 074h ;18d4\r | |
3372 | A.IN0:\r | |
3373 | call sub_1e41h ;18d5\r | |
3374 | jr nc,l1931h ;18d8\r | |
3375 | cp 006h ;18da\r | |
3376 | jr z,l1931h ;18dc\r | |
3377 | rlca ;18de\r | |
3378 | rlca ;18df\r | |
3379 | rlca ;18e0\r | |
3380 | add a,b ;18e1\r | |
3381 | ld b,a ;18e2\r | |
3382 | call sub_1ed1h ;18e3\r | |
3383 | call sub_1e06h ;18e6\r | |
3384 | l18e9h:\r | |
3385 | call assert_eol ;18e9\r | |
3386 | comst ;18ec\r | |
3387 | ld (iy+000h),0edh ;18f0\r | |
3388 | ld (iy+001h),b ;18f4\r | |
3389 | ld (iy+002h),l ;18f7\r | |
3390 | comend\r | |
3391 | ld c,003h ;18fa\r | |
3392 | ret ;18fc\r | |
3393 | l18fdh:\r | |
3394 | call sub_1e06h ;18fd\r | |
3395 | call sub_1ed1h ;1900\r | |
3396 | call sub_1e41h ;1903\r | |
3397 | jr nc,l1931h ;1906\r | |
3398 | cp 006h ;1908\r | |
3399 | jr z,l1931h ;190a\r | |
3400 | rlca ;190c\r | |
3401 | rlca ;190d\r | |
3402 | rlca ;190e\r | |
3403 | add a,b ;190f\r | |
3404 | ld b,a ;1910\r | |
3405 | jr l18e9h ;1911\r | |
3406 | A.MLT:\r | |
3407 | call sub_1e2eh ;1913\r | |
3408 | jr nc,l1931h ;1916\r | |
3409 | add a,b ;1918\r | |
3410 | ld b,a ;1919\r | |
3411 | jp gen.opc.ED2 ;191a\r | |
3412 | l191dh:\r | |
3413 | call sub_1e41h ;191d\r | |
3414 | jr nc,l192ah ;1920\r | |
3415 | rlca ;1922\r | |
3416 | rlca ;1923\r | |
3417 | rlca ;1924\r | |
3418 | add a,b ;1925\r | |
3419 | ld b,a ;1926\r | |
3420 | jp gen.opc.ED2 ;1927\r | |
3421 | l192ah:\r | |
3422 | ld b,064h ;192a\r | |
3423 | l192ch:\r | |
3424 | call sub_1e12h ;192c\r | |
3425 | jr l18e9h ;192f\r | |
3426 | l1931h:\r | |
3427 | jp ERROR ;1931\r | |
3428 | l1934h:\r | |
3429 | call sub_1e41h ;1934\r | |
3430 | jp c,l19bfh ;1937\r | |
3431 | call sub_1e68h ;193a\r | |
3432 | jp c,l1a64h ;193d\r | |
3433 | call sub_1e2eh ;1940\r | |
3434 | jp c,l1a93h ;1943\r | |
3435 | call sub_1e50h ;1946\r | |
3436 | jp c,l1af0h ;1949\r | |
3437 | ld a,(de) ;194c\r | |
3438 | cp 049h ;194d\r | |
3439 | jp z,l1b0ch ;194f\r | |
3440 | cp 052h ;1952\r | |
3441 | jp z,l1b14h ;1954\r | |
3442 | cp 028h ;1957\r | |
3443 | jp nz,ERROR ;1959\r | |
3444 | inc de ;195c\r | |
3445 | call sub_1e2eh ;195d\r | |
3446 | jp c,l1b23h ;1960\r | |
3447 | call tst_EXPR ;1963\r | |
3448 | call sub_1ed8h ;1966\r | |
3449 | call sub_1ed1h ;1969\r | |
3450 | call sub_1e2eh ;196c\r | |
3451 | jr c,l19adh ;196f\r | |
3452 | call sub_1e50h ;1971\r | |
3453 | jr nc,l1991h ;1974\r | |
3454 | ld b,022h ;1976\r | |
3455 | l1978h:\r | |
3456 | call assert_eol ;1978\r | |
3457 | ld a,(pfx.IXY) ;197b\r | |
3458 | l197eh:\r | |
3459 | comst ;197e\r | |
3460 | ld (iy+000h),a ;1982\r | |
3461 | ld (iy+001h),b ;1985\r | |
3462 | ld (iy+002h),l ;1988\r | |
3463 | ld (iy+003h),h ;198b\r | |
3464 | comend\r | |
3465 | ld c,004h ;198e\r | |
3466 | ret ;1990\r | |
3467 | l1991h:\r | |
3468 | ld a,(de) ;1991\r | |
3469 | cp 041h ;1992\r | |
3470 | jp nz,ERROR ;1994\r | |
3471 | inc de ;1997\r | |
3472 | ld b,032h ;1998\r | |
3473 | l199ah:\r | |
3474 | call assert_eol ;199a\r | |
3475 | comst ;199d\r | |
3476 | ld (iy+000h),b ;19a1\r | |
3477 | ld (iy+001h),l ;19a4\r | |
3478 | ld (iy+002h),h ;19a7\r | |
3479 | comend\r | |
3480 | ld c,003h ;19aa\r | |
3481 | ret ;19ac\r | |
3482 | l19adh:\r | |
3483 | cp 020h ;19ad\r | |
3484 | jr z,l19bbh ;19af\r | |
3485 | add a,043h ;19b1\r | |
3486 | ld b,a ;19b3\r | |
3487 | l19b4h:\r | |
3488 | call assert_eol ;19b4\r | |
3489 | ld a,0edh ;19b7\r | |
3490 | jr l197eh ;19b9\r | |
3491 | l19bbh:\r | |
3492 | ld b,022h ;19bb\r | |
3493 | jr l199ah ;19bd\r | |
3494 | l19bfh:\r | |
3495 | ld b,a ;19bf\r | |
3496 | call sub_1ed1h ;19c0\r | |
3497 | call sub_1e41h ;19c3\r | |
3498 | jr nc,l19dbh ;19c6\r | |
3499 | push af ;19c8\r | |
3500 | ld a,b ;19c9\r | |
3501 | rlca ;19ca\r | |
3502 | rlca ;19cb\r | |
3503 | rlca ;19cc\r | |
3504 | ld b,a ;19cd\r | |
3505 | pop af ;19ce\r | |
3506 | add a,b ;19cf\r | |
3507 | add a,040h ;19d0\r | |
3508 | cp 076h ;19d2\r | |
3509 | jp z,ERROR ;19d4\r | |
3510 | l19d7h:\r | |
3511 | ld b,a ;19d7\r | |
3512 | jp l1b36h ;19d8\r | |
3513 | l19dbh:\r | |
3514 | call sub_1e68h ;19db\r | |
3515 | jr nc,l1a02h ;19de\r | |
3516 | ld a,b ;19e0\r | |
3517 | rlca ;19e1\r | |
3518 | rlca ;19e2\r | |
3519 | rlca ;19e3\r | |
3520 | add a,046h ;19e4\r | |
3521 | cp 076h ;19e6\r | |
3522 | jp z,ERROR ;19e8\r | |
3523 | l19ebh:\r | |
3524 | ld b,a ;19eb\r | |
3525 | call assert_eol ;19ec\r | |
3526 | ld a,(pfx.IXY) ;19ef\r | |
3527 | comst ;19f2\r | |
3528 | ld (iy+000h),a ;19f6\r | |
3529 | ld (iy+001h),b ;19f9\r | |
3530 | ld (iy+002h),c ;19fc\r | |
3531 | comend\r | |
3532 | ld c,003h ;19ff\r | |
3533 | ret ;1a01\r | |
3534 | l1a02h:\r | |
3535 | ld a,(de) ;1a02\r | |
3536 | cp 'I' ;1a03\r | |
3537 | jr z,l1a15h ;1a05\r | |
3538 | cp 'R' ;1a07\r | |
3539 | jr nz,l1a21h ;1a09\r | |
3540 | ld a,b ;1a0b\r | |
3541 | cp 007h ;1a0c\r | |
3542 | jp nz,ERROR ;1a0e\r | |
3543 | ld b,05fh ;1a11\r | |
3544 | jr l1a1dh ;1a13\r | |
3545 | l1a15h:\r | |
3546 | ld a,b ;1a15\r | |
3547 | cp 007h ;1a16\r | |
3548 | jp nz,ERROR ;1a18\r | |
3549 | ld b,057h ;1a1b\r | |
3550 | l1a1dh:\r | |
3551 | inc de ;1a1d\r | |
3552 | jp gen.opc.ED2 ;1a1e\r | |
3553 | l1a21h:\r | |
3554 | cp '(' ;1a21\r | |
3555 | jr z,l1a3fh ;1a23\r | |
3556 | call sub_1e12h ;1a25\r | |
3557 | ld a,b ;1a28 ld r,nn\r | |
3558 | rlca ;1a29\r | |
3559 | rlca ;1a2a\r | |
3560 | rlca ;1a2b\r | |
3561 | add a,006h ;1a2c\r | |
3562 | l1a2eh:\r | |
3563 | ld b,a ;1a2e\r | |
3564 | l1a2fh:\r | |
3565 | call assert_eol ;1a2f\r | |
3566 | comst ;1a32\r | |
3567 | ld (iy+000h),b ;1a36\r | |
3568 | ld (iy+001h),l ;1a39\r | |
3569 | comend\r | |
3570 | ld c,002h ;1a3c\r | |
3571 | ret ;1a3e\r | |
3572 | l1a3fh:\r | |
3573 | inc de ;1a3f\r | |
3574 | ld a,b ;1a40\r | |
3575 | cp 007h ;1a41\r | |
3576 | jp nz,ERROR ;1a43\r | |
3577 | call sub_1e2eh ;1a46\r | |
3578 | jr nc,l1a59h ;1a49\r | |
3579 | cp 030h ;1a4b\r | |
3580 | jp nc,ERROR ;1a4d\r | |
3581 | add a,00ah ;1a50\r | |
3582 | ld b,a ;1a52\r | |
3583 | call sub_1ed8h ;1a53\r | |
3584 | jp l1b36h ;1a56\r | |
3585 | l1a59h:\r | |
3586 | call tst_EXPR ;1a59\r | |
3587 | call sub_1ed8h ;1a5c\r | |
3588 | ld b,03ah ;1a5f\r | |
3589 | jp l199ah ;1a61\r | |
3590 | l1a64h:\r | |
3591 | call sub_1ed1h ;1a64\r | |
3592 | call sub_1e41h ;1a67\r | |
3593 | jr nc,l1a76h ;1a6a\r | |
3594 | cp 006h ;1a6c\r | |
3595 | jp z,ERROR ;1a6e\r | |
3596 | add a,070h ;1a71\r | |
3597 | jp l19ebh ;1a73\r | |
3598 | l1a76h:\r | |
3599 | call sub_1e12h ;1a76\r | |
3600 | call assert_eol ;1a79\r | |
3601 | ld a,(pfx.IXY) ;1a7c\r | |
3602 | comst ;1a7f\r | |
3603 | ld (iy+000h),a ;1a83 dd/fd\r | |
3604 | ld (iy+001h),036h ;1a86\r | |
3605 | ld (iy+002h),c ;1a8a displacement\r | |
3606 | ld (iy+003h),l ;1a8d nn\r | |
3607 | comend\r | |
3608 | ld c,4 ;1a90\r | |
3609 | ret ;1a92\r | |
3610 | l1a93h:\r | |
3611 | ld b,a ;1a93\r | |
3612 | call sub_1ed1h ;1a94\r | |
3613 | ld hl,t_HL.AF ;1a97\r | |
3614 | call sub_0a23h ;1a9a\r | |
3615 | jr c,l1abeh ;1a9d\r | |
3616 | call sub_1e50h ;1a9f\r | |
3617 | jr nc,l1ac7h ;1aa2\r | |
3618 | ld a,b ;1aa4\r | |
3619 | cp 030h ;1aa5\r | |
3620 | jr nz,l1b20h ;1aa7\r | |
3621 | ld b,0f9h ;1aa9\r | |
3622 | l1aabh:\r | |
3623 | call assert_eol ;1aab\r | |
3624 | ld a,(pfx.IXY) ;1aae\r | |
3625 | comst ;1ab1\r | |
3626 | ld (iy+000h),a ;1ab5\r | |
3627 | ld (iy+001h),b ;1ab8\r | |
3628 | comend\r | |
3629 | ld c,002h ;1abb\r | |
3630 | ret ;1abd\r | |
3631 | l1abeh:\r | |
3632 | ld a,b ;1abe\r | |
3633 | cp 030h ;1abf\r | |
3634 | jr nz,l1b20h ;1ac1\r | |
3635 | ld b,0f9h ;1ac3\r | |
3636 | jr l1b36h ;1ac5\r | |
3637 | l1ac7h:\r | |
3638 | ld a,(de) ;1ac7\r | |
3639 | cp 028h ;1ac8\r | |
3640 | jr nz,l1ae3h ;1aca\r | |
3641 | inc de ;1acc\r | |
3642 | call tst_EXPR ;1acd\r | |
3643 | call sub_1ed8h ;1ad0\r | |
3644 | ld a,b ;1ad3\r | |
3645 | cp 020h ;1ad4\r | |
3646 | jr z,l1adeh ;1ad6\r | |
3647 | add a,04bh ;1ad8\r | |
3648 | ld b,a ;1ada\r | |
3649 | jp l19b4h ;1adb\r | |
3650 | l1adeh:\r | |
3651 | ld b,02ah ;1ade\r | |
3652 | jp l199ah ;1ae0\r | |
3653 | l1ae3h:\r | |
3654 | call tst_EXPR ;1ae3\r | |
3655 | call assert_eol ;1ae6\r | |
3656 | ld a,001h ;1ae9\r | |
3657 | add a,b ;1aeb\r | |
3658 | ld b,a ;1aec\r | |
3659 | jp l199ah ;1aed\r | |
3660 | l1af0h:\r | |
3661 | call sub_1ed1h ;1af0\r | |
3662 | ld a,(de) ;1af3\r | |
3663 | cp 028h ;1af4\r | |
3664 | jr nz,l1b04h ;1af6\r | |
3665 | inc de ;1af8\r | |
3666 | call tst_EXPR ;1af9\r | |
3667 | call sub_1ed8h ;1afc\r | |
3668 | ld b,02ah ;1aff\r | |
3669 | jp l1978h ;1b01\r | |
3670 | l1b04h:\r | |
3671 | call tst_EXPR ;1b04\r | |
3672 | ld b,021h ;1b07\r | |
3673 | jp l1978h ;1b09\r | |
3674 | l1b0ch:\r | |
3675 | inc de ;1b0c\r | |
3676 | call sub_1ed1h ;1b0d\r | |
3677 | ld b,047h ;1b10\r | |
3678 | jr l1b1ah ;1b12\r | |
3679 | l1b14h:\r | |
3680 | inc de ;1b14\r | |
3681 | call sub_1ed1h ;1b15\r | |
3682 | ld b,04fh ;1b18\r | |
3683 | l1b1ah:\r | |
3684 | ld a,(de) ;1b1a\r | |
3685 | inc de ;1b1b\r | |
3686 | cp 041h ;1b1c\r | |
3687 | jr z,gen.opc.ED2 ;1b1e\r | |
3688 | l1b20h:\r | |
3689 | jp ERROR ;1b20\r | |
3690 | l1b23h:\r | |
3691 | cp 020h ;1b23\r | |
3692 | jr nc,l1b20h ;1b25\r | |
3693 | add a,002h ;1b27\r | |
3694 | ld b,a ;1b29\r | |
3695 | call sub_1ed8h ;1b2a\r | |
3696 | call sub_1ed1h ;1b2d\r | |
3697 | ld a,(de) ;1b30\r | |
3698 | cp 041h ;1b31\r | |
3699 | jr nz,l1b20h ;1b33\r | |
3700 | inc de ;1b35\r | |
3701 | l1b36h:\r | |
3702 | call assert_eol ;1b36\r | |
3703 | comst ;1b39\r | |
3704 | ld (iy+000h),b ;1b3d\r | |
3705 | comend\r | |
3706 | ld c,001h ;1b40\r | |
3707 | ret ;1b42\r | |
3708 | gen.opc.ED2:\r | |
3709 | call assert_eol ;1b43\r | |
3710 | comst ;1b46\r | |
3711 | ld (iy+000h),0edh ;1b4a\r | |
3712 | ld (iy+001h),b ;1b4e\r | |
3713 | comend\r | |
3714 | ld c,002h ;1b51\r | |
3715 | ret ;1b53\r | |
3716 | l1b54h:\r | |
3717 | ld hl,t_HL.AF ;1b54\r | |
3718 | call sub_0a23h ;1b57\r | |
3719 | jr nc,l1babh ;1b5a\r | |
3720 | call sub_1ed1h ;1b5c\r | |
3721 | call sub_1e2eh ;1b5f\r | |
3722 | jp nc,ERROR ;1b62\r | |
3723 | push af ;1b65\r | |
3724 | ld a,b ;1b66\r | |
3725 | cp 088h ;1b67\r | |
3726 | ld b,04ah ;1b69\r | |
3727 | jr z,l1b6fh ;1b6b\r | |
3728 | ld b,042h ;1b6d\r | |
3729 | l1b6fh:\r | |
3730 | pop af ;1b6f\r | |
3731 | add a,b ;1b70\r | |
3732 | l1b71h:\r | |
3733 | ld b,a ;1b71\r | |
3734 | jr gen.opc.ED2 ;1b72\r | |
3735 | l1b74h:\r | |
3736 | ld hl,t_HL.AF ;1b74\r | |
3737 | call sub_0a23h ;1b77\r | |
3738 | jr c,l1b9dh ;1b7a\r | |
3739 | call sub_1e50h ;1b7c\r | |
3740 | jr nc,l1babh ;1b7f\r | |
3741 | call sub_1ed1h ;1b81\r | |
3742 | ld hl,t_BC.DE.IX.SP ;1b84\r | |
3743 | ld a,(pfx.IXY) ;1b87\r | |
3744 | cp 0fdh ;1b8a\r | |
3745 | jr nz,l1b91h ;1b8c\r | |
3746 | ld hl,t_BC.DE.IY.SP ;1b8e\r | |
3747 | l1b91h:\r | |
3748 | call sub_1e2bh ;1b91\r | |
3749 | jp nc,ERROR ;1b94\r | |
3750 | add a,009h ;1b97\r | |
3751 | l1b99h:\r | |
3752 | ld b,a ;1b99\r | |
3753 | jp l1aabh ;1b9a\r | |
3754 | l1b9dh:\r | |
3755 | call sub_1ed1h ;1b9d\r | |
3756 | call sub_1e2eh ;1ba0\r | |
3757 | jp nc,ERROR ;1ba3\r | |
3758 | add a,009h ;1ba6\r | |
3759 | jp l19d7h ;1ba8\r | |
3760 | l1babh:\r | |
3761 | ld a,(de) ;1bab\r | |
3762 | cp 041h ;1bac\r | |
3763 | jr nz,l1bbbh ;1bae\r | |
3764 | push de ;1bb0\r | |
3765 | inc de ;1bb1\r | |
3766 | call skip_to_nextarg ;1bb2\r | |
3767 | jr z,l1bbah ;1bb5\r | |
3768 | pop de ;1bb7\r | |
3769 | jr l1bbbh ;1bb8\r | |
3770 | l1bbah:\r | |
3771 | pop af ;1bba\r | |
3772 | l1bbbh:\r | |
3773 | call sub_1e41h ;1bbb\r | |
3774 | jr c,l1bceh ;1bbe\r | |
3775 | call sub_1e68h ;1bc0\r | |
3776 | jr c,l1bd2h ;1bc3\r | |
3777 | call sub_1e12h ;1bc5\r | |
3778 | ld a,b ;1bc8\r | |
3779 | add a,046h ;1bc9\r | |
3780 | jp l1a2eh ;1bcb\r | |
3781 | l1bceh:\r | |
3782 | add a,b ;1bce\r | |
3783 | jp l19d7h ;1bcf\r | |
3784 | l1bd2h:\r | |
3785 | ld a,b ;1bd2\r | |
3786 | add a,006h ;1bd3\r | |
3787 | jp l19ebh ;1bd5\r | |
3788 | l1bd8h:\r | |
3789 | call sub_1e41h ;1bd8\r | |
3790 | jr c,l1c01h ;1bdb\r | |
3791 | call sub_1e68h ;1bdd\r | |
3792 | jp nc,ERROR ;1be0\r | |
3793 | ld a,b ;1be3\r | |
3794 | add a,006h ;1be4\r | |
3795 | ld b,a ;1be6\r | |
3796 | l1be7h:\r | |
3797 | call assert_eol ;1be7\r | |
3798 | ld a,(pfx.IXY) ;1bea\r | |
3799 | comst ;1bed\r | |
3800 | ld (iy+000h),a ;1bf1\r | |
3801 | ld (iy+001h),0cbh ;1bf4\r | |
3802 | ld (iy+002h),c ;1bf8\r | |
3803 | ld (iy+003h),b ;1bfb\r | |
3804 | comend\r | |
3805 | ld c,004h ;1bfe\r | |
3806 | ret ;1c00\r | |
3807 | l1c01h:\r | |
3808 | add a,b ;1c01\r | |
3809 | l1c02h:\r | |
3810 | ld b,a ;1c02\r | |
3811 | call assert_eol ;1c03\r | |
3812 | comst ;1c06\r | |
3813 | ld (iy+000h),0cbh ;1c0a\r | |
3814 | ld (iy+001h),b ;1c0e\r | |
3815 | comend\r | |
3816 | ld c,002h ;1c11\r | |
3817 | ret ;1c13\r | |
3818 | l1c14h:\r | |
3819 | call sub_1de6h ;1c14\r | |
3820 | call sub_1ed1h ;1c17\r | |
3821 | call sub_1e41h ;1c1a\r | |
3822 | jr c,l1c2fh ;1c1d\r | |
3823 | call sub_1e68h ;1c1f\r | |
3824 | jp nc,ERROR ;1c22\r | |
3825 | ld a,l ;1c25\r | |
3826 | rlca ;1c26\r | |
3827 | rlca ;1c27\r | |
3828 | rlca ;1c28\r | |
3829 | add a,006h ;1c29\r | |
3830 | add a,b ;1c2b\r | |
3831 | ld b,a ;1c2c\r | |
3832 | jr l1be7h ;1c2d\r | |
3833 | l1c2fh:\r | |
3834 | add a,b ;1c2f\r | |
3835 | ld b,a ;1c30\r | |
3836 | ld a,l ;1c31\r | |
3837 | rlca ;1c32\r | |
3838 | rlca ;1c33\r | |
3839 | rlca ;1c34\r | |
3840 | add a,b ;1c35\r | |
3841 | jr l1c02h ;1c36\r | |
3842 | l1c38h:\r | |
3843 | push de ;1c38\r | |
3844 | call sub_1eb8h ;1c39\r | |
3845 | jr nc,l1c47h ;1c3c\r | |
3846 | add a,b ;1c3e\r | |
3847 | ld b,a ;1c3f\r | |
3848 | call skip_to_nextarg ;1c40\r | |
3849 | jr z,l1c49h ;1c43\r | |
3850 | pop de ;1c45\r | |
3851 | push de ;1c46\r | |
3852 | l1c47h:\r | |
3853 | ld b,0cdh ;1c47\r | |
3854 | l1c49h:\r | |
3855 | pop af ;1c49\r | |
3856 | call tst_EXPR ;1c4a\r | |
3857 | jp l199ah ;1c4d\r | |
3858 | l1c50h:\r | |
3859 | call sub_1eb8h ;1c50\r | |
3860 | jr nc,l1c59h ;1c53\r | |
3861 | add a,b ;1c55\r | |
3862 | ld b,a ;1c56\r | |
3863 | jr l1c5bh ;1c57\r | |
3864 | l1c59h:\r | |
3865 | ld b,0c9h ;1c59\r | |
3866 | l1c5bh:\r | |
3867 | jp l1b36h ;1c5b\r | |
3868 | l1c5eh:\r | |
3869 | push de ;1c5e\r | |
3870 | call sub_1eb8h ;1c5f\r | |
3871 | jr c,l1c71h ;1c62\r | |
3872 | l1c64h:\r | |
3873 | pop de ;1c64\r | |
3874 | ld hl,b_0x1C97_start ;1c65\r | |
3875 | call sub_0a15h ;1c68\r | |
3876 | jr c,l1c7fh ;1c6b\r | |
3877 | ld b,0c3h ;1c6d\r | |
3878 | jr l1c79h ;1c6f\r | |
3879 | l1c71h:\r | |
3880 | add a,b ;1c71\r | |
3881 | ld b,a ;1c72\r | |
3882 | call skip_to_nextarg ;1c73\r | |
3883 | jr nz,l1c64h ;1c76\r | |
3884 | pop af ;1c78\r | |
3885 | l1c79h:\r | |
3886 | call tst_EXPR ;1c79\r | |
3887 | jp l199ah ;1c7c\r | |
3888 | l1c7fh:\r | |
3889 | call assert_eol ;1c7f\r | |
3890 | ld a,b ;1c82\r | |
3891 | and a ;1c83\r | |
3892 | jr nz,l1c8bh ;1c84\r | |
3893 | ld b,0e9h ;1c86\r | |
3894 | jp l1b36h ;1c88\r | |
3895 | l1c8bh:\r | |
3896 | ld b,0ddh ;1c8b\r | |
3897 | dec a ;1c8d\r | |
3898 | jr z,l1c92h ;1c8e\r | |
3899 | ld b,0fdh ;1c90\r | |
3900 | l1c92h:\r | |
3901 | ld l,0e9h ;1c92\r | |
3902 | jp l1a2fh ;1c94\r | |
3903 | \r | |
3904 | b_0x1C97_start:\r | |
3905 | DC '(HL)'\r | |
3906 | DC '(IX)'\r | |
3907 | DC '(IY)'\r | |
3908 | DB 0\r | |
3909 | \r | |
3910 | l1ca4h:\r | |
3911 | call skip_to_nextarg ;1ca4\r | |
3912 | ld b,010h ;1ca7\r | |
3913 | jr l1cb9h ;1ca9\r | |
3914 | l1cabh:\r | |
3915 | call sub_1ebfh ;1cab\r | |
3916 | jr c,l1cb4h ;1cae\r | |
3917 | ld b,018h ;1cb0\r | |
3918 | jr l1cb9h ;1cb2\r | |
3919 | l1cb4h:\r | |
3920 | add a,b ;1cb4\r | |
3921 | ld b,a ;1cb5\r | |
3922 | call sub_1ed1h ;1cb6\r | |
3923 | l1cb9h:\r | |
3924 | call sub_1defh ;1cb9\r | |
3925 | jp l1a2fh ;1cbc\r | |
3926 | l1cbfh:\r | |
3927 | call sub_1e12h ;1cbf\r | |
3928 | ld a,l ;1cc2\r | |
3929 | cp 003h ;1cc3\r | |
3930 | jr nc,l1d23h ;1cc5\r | |
3931 | and a ;1cc7\r | |
3932 | jr z,l1cd2h ;1cc8\r | |
3933 | ld b,056h ;1cca\r | |
3934 | cp 001h ;1ccc\r | |
3935 | jr z,l1cd2h ;1cce\r | |
3936 | ld b,05eh ;1cd0\r | |
3937 | l1cd2h:\r | |
3938 | jp gen.opc.ED2 ;1cd2\r | |
3939 | l1cd5h:\r | |
3940 | call sub_1e12h ;1cd5\r | |
3941 | ld a,l ;1cd8\r | |
3942 | push af ;1cd9\r | |
3943 | add a,b ;1cda\r | |
3944 | ld b,a ;1cdb\r | |
3945 | pop af ;1cdc\r | |
3946 | and 0c7h ;1cdd\r | |
3947 | jr nz,l1d23h ;1cdf\r | |
3948 | jp l1b36h ;1ce1\r | |
3949 | l1ce4h:\r | |
3950 | call sub_1e50h ;1ce4\r | |
3951 | jr c,l1cf2h ;1ce7\r | |
3952 | call sub_1e25h ;1ce9\r | |
3953 | jr nc,l1d23h ;1cec\r | |
3954 | add a,b ;1cee\r | |
3955 | jp l19d7h ;1cef\r | |
3956 | l1cf2h:\r | |
3957 | ld a,b ;1cf2\r | |
3958 | add a,020h ;1cf3\r | |
3959 | jp l1b99h ;1cf5\r | |
3960 | l1cf8h:\r | |
3961 | call sub_1e41h ;1cf8\r | |
3962 | jr nc,l1d23h ;1cfb\r | |
3963 | cp 006h ;1cfd\r | |
3964 | jr z,l1d23h ;1cff\r | |
3965 | rlca ;1d01\r | |
3966 | rlca ;1d02\r | |
3967 | rlca ;1d03\r | |
3968 | add a,b ;1d04\r | |
3969 | ld b,a ;1d05\r | |
3970 | cp 078h ;1d06\r | |
3971 | jr nz,l1d1ah ;1d08\r | |
3972 | call sub_1ed1h ;1d0a\r | |
3973 | call sub_1d26h ;1d0d\r | |
3974 | jr c,l1d20h ;1d10\r | |
3975 | call sub_1e06h ;1d12\r | |
3976 | ld b,0dbh ;1d15\r | |
3977 | jp l1a2fh ;1d17\r | |
3978 | l1d1ah:\r | |
3979 | call sub_1ed1h ;1d1a\r | |
3980 | call sub_1d26h ;1d1d\r | |
3981 | l1d20h:\r | |
3982 | jp c,gen.opc.ED2 ;1d20\r | |
3983 | l1d23h:\r | |
3984 | jp ERROR ;1d23\r | |
3985 | sub_1d26h:\r | |
3986 | ld hl,t__C_ ;1d26\r | |
3987 | jp sub_0a23h ;1d29\r | |
3988 | l1d2ch:\r | |
3989 | call sub_1d26h ;1d2c\r | |
3990 | jr nc,l1d44h ;1d2f\r | |
3991 | call sub_1ed1h ;1d31\r | |
3992 | call sub_1e41h ;1d34\r | |
3993 | jr nc,l1d23h ;1d37\r | |
3994 | cp 006h ;1d39\r | |
3995 | jr z,l1d23h ;1d3b\r | |
3996 | rlca ;1d3d\r | |
3997 | rlca ;1d3e\r | |
3998 | rlca ;1d3f\r | |
3999 | add a,b ;1d40\r | |
4000 | jp l1b71h ;1d41\r | |
4001 | l1d44h:\r | |
4002 | call sub_1e06h ;1d44\r | |
4003 | call sub_1ed1h ;1d47\r | |
4004 | cp 041h ;1d4a\r | |
4005 | jr nz,l1d23h ;1d4c\r | |
4006 | inc de ;1d4e\r | |
4007 | ld b,0d3h ;1d4f\r | |
4008 | jp l1a2fh ;1d51\r | |
4009 | l1d54h:\r | |
4010 | ld hl,b_0x1D80_start ;1d54\r | |
4011 | call sub_0a15h ;1d57\r | |
4012 | jp nc,ERROR ;1d5a\r | |
4013 | ld c,b ;1d5d\r | |
4014 | call assert_eol ;1d5e\r | |
4015 | ld b,000h ;1d61\r | |
4016 | ld hl,b_0x1DA1_start ;1d63\r | |
4017 | add hl,bc ;1d66\r | |
4018 | add hl,bc ;1d67\r | |
4019 | ld a,(hl) ;1d68\r | |
4020 | comst ;1d69\r | |
4021 | ld (iy+000h),a ;1d6d\r | |
4022 | comend\r | |
4023 | ld c,001h ;1d70\r | |
4024 | inc hl ;1d72\r | |
4025 | ld a,(hl) ;1d73\r | |
4026 | and a ;1d74\r | |
4027 | ret z ;1d75\r | |
4028 | comst ;1d76\r | |
4029 | ld (iy+001h),a ;1d7a\r | |
4030 | comend\r | |
4031 | ld c,002h ;1d7d\r | |
4032 | ret ;1d7f\r | |
4033 | \r | |
4034 | b_0x1D80_start:\r | |
4035 | DC 'AF,AF'''\r | |
4036 | l1d86h:\r | |
4037 | DC 'DE,HL'\r | |
4038 | DC '(SP),HL'\r | |
4039 | DC '(SP),IX'\r | |
4040 | DC '(SP),IY'\r | |
4041 | db 000h ;1da0\r | |
4042 | \r | |
4043 | b_0x1DA1_start:\r | |
4044 | db 008h ;1da1\r | |
4045 | db 000h ;1da2\r | |
4046 | db 0ebh ;1da3\r | |
4047 | db 000h ;1da4\r | |
4048 | db 0e3h ;1da5\r | |
4049 | db 000h ;1da6\r | |
4050 | db 0ddh ;1da7\r | |
4051 | db 0e3h ;1da8\r | |
4052 | db 0fdh ;1da9\r | |
4053 | db 0e3h ;1daa\r | |
4054 | l1dabh:\r | |
4055 | call sub_1e50h ;1dab\r | |
4056 | jr c,l1dc6h ;1dae\r | |
4057 | call sub_1e2eh ;1db0\r | |
4058 | jr c,l1dd2h ;1db3\r | |
4059 | call sub_1e41h ;1db5\r | |
4060 | jr c,l1ddfh ;1db8\r | |
4061 | call sub_1e68h ;1dba\r | |
4062 | jp nc,ERROR ;1dbd\r | |
4063 | ld a,b ;1dc0\r | |
4064 | add a,030h ;1dc1\r | |
4065 | jp l19ebh ;1dc3\r | |
4066 | l1dc6h:\r | |
4067 | ld a,b ;1dc6\r | |
4068 | ld b,023h ;1dc7\r | |
4069 | cp 004h ;1dc9\r | |
4070 | jr z,l1dcfh ;1dcb\r | |
4071 | ld b,02bh ;1dcd\r | |
4072 | l1dcfh:\r | |
4073 | jp l1aabh ;1dcf\r | |
4074 | l1dd2h:\r | |
4075 | push af ;1dd2\r | |
4076 | ld a,b ;1dd3\r | |
4077 | ld b,003h ;1dd4\r | |
4078 | cp 004h ;1dd6\r | |
4079 | jr z,l1ddch ;1dd8\r | |
4080 | ld b,00bh ;1dda\r | |
4081 | l1ddch:\r | |
4082 | pop af ;1ddc\r | |
4083 | jr l1de2h ;1ddd\r | |
4084 | l1ddfh:\r | |
4085 | rlca ;1ddf\r | |
4086 | rlca ;1de0\r | |
4087 | rlca ;1de1\r | |
4088 | l1de2h:\r | |
4089 | add a,b ;1de2\r | |
4090 | jp l19d7h ;1de3\r | |
4091 | sub_1de6h:\r | |
4092 | call sub_1e12h ;1de6\r | |
4093 | ld a,l ;1de9\r | |
4094 | cp 008h ;1dea\r | |
4095 | jr nc,error1 ;1dec\r | |
4096 | ret ;1dee\r | |
4097 | sub_1defh:\r | |
4098 | call tst_EXPR ;1def\r | |
4099 | push bc ;1df2\r | |
4100 | push iy ;1df3\r | |
4101 | pop bc ;1df5\r | |
4102 | and a ;1df6\r | |
4103 | sbc hl,bc ;1df7\r | |
4104 | dec hl ;1df9\r | |
4105 | dec hl ;1dfa\r | |
4106 | pop bc ;1dfb\r | |
4107 | call sub_1e15h ;1dfc\r | |
4108 | ld a,h ;1dff\r | |
4109 | xor l ;1e00\r | |
4110 | bit 7,a ;1e01\r | |
4111 | jr nz,error1 ;1e03\r | |
4112 | ret ;1e05\r | |
4113 | sub_1e06h:\r | |
4114 | ld a,(de) ;1e06\r | |
4115 | cp 028h ;1e07\r | |
4116 | jr nz,sub_1e12h ;1e09\r | |
4117 | inc de ;1e0b\r | |
4118 | call sub_1e12h ;1e0c\r | |
4119 | jp sub_1ed8h ;1e0f\r | |
4120 | \r | |
4121 | sub_1e12h:\r | |
4122 | call tst_EXPR ;1e12\r | |
4123 | sub_1e15h:\r | |
4124 | ld a,h ;1e15\r | |
4125 | and a ;1e16\r | |
4126 | ret z ;1e17\r | |
4127 | inc a ;1e18\r | |
4128 | ret z ;1e19\r | |
4129 | jr error1 ;1e1a\r | |
4130 | \r | |
4131 | tst_EXPR:\r | |
4132 | push bc ;1e1c\r | |
4133 | call EXPR ;1e1d\r | |
4134 | pop bc ;1e20\r | |
4135 | ret nc ;1e21\r | |
4136 | error1:\r | |
4137 | jp ERROR ;1e22\r | |
4138 | sub_1e25h:\r | |
4139 | push hl ;1e25\r | |
4140 | ld hl,t_BC.DE.HL.AF ;1e26\r | |
4141 | jr l1e32h ;1e29\r | |
4142 | sub_1e2bh:\r | |
4143 | push hl ;1e2b\r | |
4144 | jr l1e32h ;1e2c\r | |
4145 | sub_1e2eh:\r | |
4146 | push hl ;1e2e\r | |
4147 | ld hl,t_BC.DE.HL.SP ;1e2f\r | |
4148 | l1e32h:\r | |
4149 | push bc ;1e32\r | |
4150 | call sub_0a15h ;1e33\r | |
4151 | jr nc,l1e3eh ;1e36\r | |
4152 | ld a,b ;1e38\r | |
4153 | rlca ;1e39\r | |
4154 | rlca ;1e3a\r | |
4155 | rlca ;1e3b\r | |
4156 | rlca ;1e3c\r | |
4157 | scf ;1e3d\r | |
4158 | l1e3eh:\r | |
4159 | pop bc ;1e3e\r | |
4160 | pop hl ;1e3f\r | |
4161 | ret ;1e40\r | |
4162 | sub_1e41h:\r | |
4163 | call SKIPBL ;1e41\r | |
4164 | push bc ;1e44\r | |
4165 | push hl ;1e45\r | |
4166 | ld hl,t_BCDEHL_HL_A ;1e46\r | |
4167 | call sub_0a15h ;1e49\r | |
4168 | ld a,b ;1e4c\r | |
4169 | pop hl ;1e4d\r | |
4170 | pop bc ;1e4e\r | |
4171 | ret ;1e4f\r | |
4172 | sub_1e50h:\r | |
4173 | push hl ;1e50\r | |
4174 | push bc ;1e51\r | |
4175 | ld hl,t_IX.IY ;1e52\r | |
4176 | call sub_0a15h ;1e55\r | |
4177 | jr nc,l1e65h ;1e58\r | |
4178 | ld a,0ddh ;1e5a\r | |
4179 | dec b ;1e5c\r | |
4180 | jr nz,l1e61h ;1e5d\r | |
4181 | ld a,0fdh ;1e5f\r | |
4182 | l1e61h:\r | |
4183 | ld (pfx.IXY),a ;1e61\r | |
4184 | scf ;1e64\r | |
4185 | l1e65h:\r | |
4186 | pop bc ;1e65\r | |
4187 | pop hl ;1e66\r | |
4188 | ret ;1e67\r | |
4189 | sub_1e68h:\r | |
4190 | push hl ;1e68\r | |
4191 | push bc ;1e69\r | |
4192 | ld a,(de) ;1e6a\r | |
4193 | cp '(' ;1e6b\r | |
4194 | jr nz,l1eb4h ;1e6d\r | |
4195 | push de ;1e6f\r | |
4196 | inc de ;1e70\r | |
4197 | ld hl,t_IX.IY ;1e71\r | |
4198 | call sub_0a15h ;1e74\r | |
4199 | jr nc,l1eb3h ;1e77\r | |
4200 | pop af ;1e79\r | |
4201 | ld a,0ddh ;1e7a\r | |
4202 | dec b ;1e7c\r | |
4203 | jr nz,l1e81h ;1e7d\r | |
4204 | ld a,0fdh ;1e7f\r | |
4205 | l1e81h:\r | |
4206 | ld (pfx.IXY),a ;1e81\r | |
4207 | ld a,(de) ;1e84\r | |
4208 | cp '+' ;1e85\r | |
4209 | jr z,l1e95h ;1e87\r | |
4210 | cp ')' ;1e89\r | |
4211 | ld hl,0 ;1e8b\r | |
4212 | jr z,l1eadh ;1e8e\r | |
4213 | cp '-' ;1e90\r | |
4214 | jp nz,ERROR ;1e92\r | |
4215 | l1e95h:\r | |
4216 | push af ;1e95\r | |
4217 | inc de ;1e96\r | |
4218 | call sub_1e12h ;1e97 get displacement\r | |
4219 | pop af ;1e9a\r | |
4220 | cp '+' ;1e9b\r | |
4221 | jr z,l1ea7h ;1e9d\r | |
4222 | ld b,h ;1e9f\r | |
4223 | ld c,l ;1ea0\r | |
4224 | ld hl,0 ;1ea1\r | |
4225 | and a ;1ea4\r | |
4226 | sbc hl,bc ;1ea5\r | |
4227 | l1ea7h:\r | |
4228 | ld a,(de) ;1ea7\r | |
4229 | cp ')' ;1ea8\r | |
4230 | jp nz,ERROR ;1eaa\r | |
4231 | l1eadh:\r | |
4232 | inc de ;1ead\r | |
4233 | pop bc ;1eae\r | |
4234 | ld c,l ;1eaf\r | |
4235 | pop hl ;1eb0\r | |
4236 | scf ;1eb1\r | |
4237 | ret ;1eb2\r | |
4238 | l1eb3h:\r | |
4239 | pop de ;1eb3\r | |
4240 | l1eb4h:\r | |
4241 | pop bc ;1eb4\r | |
4242 | pop hl ;1eb5\r | |
4243 | and a ;1eb6\r | |
4244 | ret ;1eb7\r | |
4245 | sub_1eb8h:\r | |
4246 | ld hl,t_tstfl_ZCPS ;1eb8\r | |
4247 | ld c,007h ;1ebb\r | |
4248 | jr l1ec4h ;1ebd\r | |
4249 | sub_1ebfh:\r | |
4250 | ld hl,t_tstfl_ZC ;1ebf\r | |
4251 | ld c,003h ;1ec2\r | |
4252 | l1ec4h:\r | |
4253 | push bc ;1ec4\r | |
4254 | call sub_0a15h ;1ec5\r | |
4255 | ld a,b ;1ec8\r | |
4256 | pop bc ;1ec9\r | |
4257 | ret nc ;1eca\r | |
4258 | and c ;1ecb\r | |
4259 | rlca ;1ecc\r | |
4260 | rlca ;1ecd\r | |
4261 | rlca ;1ece\r | |
4262 | scf ;1ecf\r | |
4263 | ret ;1ed0\r | |
4264 | sub_1ed1h:\r | |
4265 | call skip_to_nextarg ;1ed1\r | |
4266 | ret z ;1ed4\r | |
4267 | l1ed5h:\r | |
4268 | jp ERROR ;1ed5\r | |
4269 | sub_1ed8h:\r | |
4270 | ld a,(de) ;1ed8\r | |
4271 | cp 029h ;1ed9\r | |
4272 | jr nz,l1ed5h ;1edb\r | |
4273 | inc de ;1edd\r | |
4274 | ret ;1ede\r | |
4275 | CMD.L:\r | |
4276 | ld hl,CMD.L ;1edf\r | |
4277 | ld (CMD_RPT),hl ;1ee2\r | |
4278 | call EXPR ;1ee5\r | |
4279 | jr nc,l1eedh ;1ee8\r | |
4280 | ld hl,(lst.L) ;1eea\r | |
4281 | l1eedh:\r | |
4282 | push hl ;1eed\r | |
4283 | pop iy ;1eee\r | |
4284 | call skip_to_nextarg ;1ef0\r | |
4285 | call sub_0aa5h ;1ef3\r | |
4286 | jr nc,l1f17h ;1ef6\r | |
4287 | call assert_eol ;1ef8\r | |
4288 | ld b,010h ;1efb\r | |
4289 | l1efdh:\r | |
4290 | push bc ;1efd\r | |
4291 | push iy ;1efe\r | |
4292 | pop hl ;1f00\r | |
4293 | push hl ;1f01\r | |
4294 | call sub_1f3fh ;1f02\r | |
4295 | call CRLF ;1f05\r | |
4296 | pop iy ;1f08\r | |
4297 | ld c,b ;1f0a\r | |
4298 | ld b,000h ;1f0b\r | |
4299 | add iy,bc ;1f0d\r | |
4300 | ld (lst.L),iy ;1f0f\r | |
4301 | pop bc ;1f13\r | |
4302 | djnz l1efdh ;1f14\r | |
4303 | ret ;1f16\r | |
4304 | l1f17h:\r | |
4305 | call assert_eol ;1f17\r | |
4306 | ld h,b ;1f1a\r | |
4307 | ld l,c ;1f1b\r | |
4308 | ld a,b ;1f1c\r | |
4309 | or c ;1f1d\r | |
4310 | jr nz,l1f21h ;1f1e\r | |
4311 | dec hl ;1f20\r | |
4312 | l1f21h:\r | |
4313 | push hl ;1f21\r | |
4314 | push iy ;1f22\r | |
4315 | pop hl ;1f24\r | |
4316 | push hl ;1f25\r | |
4317 | call sub_1f3fh ;1f26\r | |
4318 | call CRLF ;1f29\r | |
4319 | pop iy ;1f2c\r | |
4320 | ld e,b ;1f2e\r | |
4321 | ld d,000h ;1f2f\r | |
4322 | add iy,de ;1f31\r | |
4323 | ld (lst.L),iy ;1f33\r | |
4324 | pop hl ;1f37\r | |
4325 | and a ;1f38\r | |
4326 | sbc hl,de ;1f39\r | |
4327 | ret z ;1f3b\r | |
4328 | ret c ;1f3c\r | |
4329 | jr l1f21h ;1f3d\r | |
4330 | sub_1f3fh:\r | |
4331 | call out.hl.@ ;1f3f\r | |
4332 | call z,OUTBL ;1f42\r | |
4333 | call OUTBL ;1f45\r | |
4334 | sub a ;1f48\r | |
4335 | ld (CON.COL),a ;1f49\r | |
4336 | call sub_1f77h ;1f4c\r | |
4337 | and a ;1f4f\r | |
4338 | ret z ;1f50\r | |
4339 | l1f51h:\r | |
4340 | call OUTBL ;1f51\r | |
4341 | ld a,(CON.COL) ;1f54\r | |
4342 | cp 010h ;1f57\r | |
4343 | jr c,l1f51h ;1f59\r | |
4344 | sub_1f5bh:\r | |
4345 | ld de,(offs.@) ;1f5b\r | |
4346 | ld a,d ;1f5f\r | |
4347 | or e ;1f60\r | |
4348 | ret z ;1f61\r | |
4349 | ld a,'(' ;1f62\r | |
4350 | call OUTCHAR ;1f64\r | |
4351 | ld a,'@' ;1f67\r | |
4352 | call OUTCHAR ;1f69\r | |
4353 | and a ;1f6c\r | |
4354 | sbc hl,de ;1f6d\r | |
4355 | call out.hl ;1f6f\r | |
4356 | ld a,')' ;1f72\r | |
4357 | jp OUTCHAR ;1f74\r | |
4358 | sub_1f77h:\r | |
4359 | sub a ;1f77\r | |
4360 | ld (XBE03),a ;1f78\r | |
4361 | call sub_1f9eh ;1f7b\r | |
4362 | jr nc,l1f91h ;1f7e\r | |
4363 | push bc ;1f80\r | |
4364 | call sub_2581h ;1f81\r | |
4365 | ex de,hl ;1f84\r | |
4366 | call sub_1fdbh ;1f85\r | |
4367 | pop bc ;1f88\r | |
4368 | ld a,(XBE03) ;1f89\r | |
4369 | ld hl,(XBE01) ;1f8c\r | |
4370 | scf ;1f8f\r | |
4371 | ret ;1f90\r | |
4372 | l1f91h:\r | |
4373 | ld hl,b_0x1F9B_start ;1f91\r | |
4374 | call PSTR ;1f94\r | |
4375 | ld b,001h ;1f97\r | |
4376 | sub a ;1f99\r | |
4377 | ret ;1f9a\r | |
4378 | \r | |
4379 | b_0x1F9B_start:\r | |
4380 | DC '???'\r | |
4381 | \r | |
4382 | sub_1f9eh:\r | |
4383 | sub a ;1f9e\r | |
4384 | ld (is.pfx.IXY),a ;1f9f\r | |
4385 | comst ;1fa2\r | |
4386 | ld a,(iy+000h) ;1fa6\r | |
4387 | comend\r | |
4388 | cp 0edh ;1fa9\r | |
4389 | jp z,disas_pfx.ED ;1fab\r | |
4390 | cp 0ddh ;1fae\r | |
4391 | jr z,l1fc5h ;1fb0\r | |
4392 | cp 0fdh ;1fb2\r | |
4393 | jr z,l1fc9h ;1fb4\r | |
4394 | sub_1fb6h:\r | |
4395 | comst ;1fb6\r | |
4396 | ld a,(iy+000h) ;1fba\r | |
4397 | comend\r | |
4398 | cp 0cbh ;1fbd\r | |
4399 | jp z,l2061h ;1fbf\r | |
4400 | jp l2078h ;1fc2\r | |
4401 | l1fc5h:\r | |
4402 | ld a,001h ;1fc5\r | |
4403 | jr l1fcbh ;1fc7\r | |
4404 | l1fc9h:\r | |
4405 | ld a,002h ;1fc9\r | |
4406 | l1fcbh:\r | |
4407 | ld (is.pfx.IXY),a ;1fcb\r | |
4408 | call sub_1fdch ;1fce\r | |
4409 | ret nc ;1fd1\r | |
4410 | push bc ;1fd2\r | |
4411 | call sub_1fb6h ;1fd3\r | |
4412 | pop af ;1fd6\r | |
4413 | add a,b ;1fd7\r | |
4414 | ld b,a ;1fd8\r | |
4415 | scf ;1fd9\r | |
4416 | ret ;1fda\r | |
4417 | \r | |
4418 | sub_1fdbh:\r | |
4419 | jp (hl) ;1fdb\r | |
4420 | \r | |
4421 | sub_1fdch:\r | |
4422 | inc iy ;1fdc\r | |
4423 | ld hl,b_0x2011_start ;1fde\r | |
4424 | call sub_20bbh ;1fe1\r | |
4425 | ld b,002h ;1fe4\r | |
4426 | ret c ;1fe6\r | |
4427 | ld hl,l202ch ;1fe7\r | |
4428 | call sub_20bbh ;1fea\r | |
4429 | ld b,001h ;1fed\r | |
4430 | ret c ;1fef\r | |
4431 | comst ;1ff0\r | |
4432 | ld a,(iy+000h) ;1ff4\r | |
4433 | comend\r | |
4434 | cp 0cbh ;1ff7\r | |
4435 | jr nz,l200fh ;1ff9\r | |
4436 | comst ;1ffb\r | |
4437 | ld a,(iy+002h) ;1fff\r | |
4438 | comend\r | |
4439 | cp 036h ;2002\r | |
4440 | ret z ;2004\r | |
4441 | and 007h ;2005\r | |
4442 | cp 006h ;2007\r | |
4443 | jr nz,l200fh ;2009\r | |
4444 | ld b,002h ;200b\r | |
4445 | scf ;200d\r | |
4446 | ret ;200e\r | |
4447 | l200fh:\r | |
4448 | and a ;200f\r | |
4449 | ret ;2010\r | |
4450 | \r | |
4451 | b_0x2011_start:\r | |
4452 | db 034h ;2011\r | |
4453 | db 035h ;2012\r | |
4454 | db 036h ;2013\r | |
4455 | db 046h ;2014\r | |
4456 | db 04eh ;2015\r | |
4457 | db 056h ;2016\r | |
4458 | db 05eh ;2017\r | |
4459 | db 066h ;2018\r | |
4460 | db 06eh ;2019\r | |
4461 | db 070h ;201a\r | |
4462 | db 071h ;201b\r | |
4463 | db 072h ;201c\r | |
4464 | db 073h ;201d\r | |
4465 | db 074h ;201e\r | |
4466 | db 075h ;201f\r | |
4467 | db 076h ;2020\r | |
4468 | db 077h ;2021\r | |
4469 | db 07eh ;2022\r | |
4470 | db 086h ;2023\r | |
4471 | db 08eh ;2024\r | |
4472 | db 096h ;2025\r | |
4473 | db 09eh ;2026\r | |
4474 | db 0a6h ;2027\r | |
4475 | db 0aeh ;2028\r | |
4476 | db 0b6h ;2029\r | |
4477 | db 0beh ;202a\r | |
4478 | db 000h ;202b\r | |
4479 | l202ch:\r | |
4480 | db 009h ;202c\r | |
4481 | db 019h ;202d\r | |
4482 | db 021h ;202e\r | |
4483 | db 022h ;202f\r | |
4484 | db 023h ;2030\r | |
4485 | db 029h ;2031\r | |
4486 | db 02ah ;2032\r | |
4487 | db 02bh ;2033\r | |
4488 | db 039h ;2034\r | |
4489 | db 0e1h ;2035\r | |
4490 | db 0e3h ;2036\r | |
4491 | db 0e5h ;2037\r | |
4492 | db 0e9h ;2038\r | |
4493 | db 0f9h ;2039\r | |
4494 | db 000h ;203a\r | |
4495 | \r | |
4496 | disas_pfx.ED:\r | |
4497 | inc iy ;203b\r | |
4498 | ld hl,b_0x2200_start ;203d\r | |
4499 | call sub_209dh ;2040\r | |
4500 | ld b,002h ;2043\r | |
4501 | ret c ;2045\r | |
4502 | ld hl,l2235h ;2046\r | |
4503 | call lookup_opc ;2049\r | |
4504 | ld b,002h ;204c\r | |
4505 | ret c ;204e\r | |
4506 | ld hl,l228bh ;204f\r | |
4507 | call lookup_opc ;2052\r | |
4508 | ld b,003h ;2055\r | |
4509 | ret c ;2057\r | |
4510 | ld hl,l22b4h ;2058\r | |
4511 | call lookup_opc ;205b\r | |
4512 | ld b,004h ;205e\r | |
4513 | ret ;2060\r | |
4514 | l2061h:\r | |
4515 | push iy ;2061\r | |
4516 | inc iy ;2063\r | |
4517 | ld a,(is.pfx.IXY) ;2065\r | |
4518 | and a ;2068\r | |
4519 | jr z,l206dh ;2069\r | |
4520 | inc iy ;206b\r | |
4521 | l206dh:\r | |
4522 | ld hl,l22c9h ;206d\r | |
4523 | call lookup_opc ;2070\r | |
4524 | pop iy ;2073\r | |
4525 | ld b,002h ;2075\r | |
4526 | ret ;2077\r | |
4527 | l2078h:\r | |
4528 | ld hl,b_0x218B_start ;2078\r | |
4529 | call lookup_opc ;207b\r | |
4530 | ld b,002h ;207e\r | |
4531 | ret c ;2080\r | |
4532 | ld hl,b_0x20ED_start ;2081\r | |
4533 | call sub_209dh ;2084\r | |
4534 | ld b,001h ;2087\r | |
4535 | ret c ;2089\r | |
4536 | ld hl,b_0x2108_start ;208a\r | |
4537 | call lookup_opc ;208d\r | |
4538 | ld b,001h ;2090\r | |
4539 | ret c ;2092\r | |
4540 | ld hl,b_0x21D2_start ;2093\r | |
4541 | call lookup_opc ;2096\r | |
4542 | ret nc ;2099\r | |
4543 | ld b,003h ;209a\r | |
4544 | ret ;209c\r | |
4545 | \r | |
4546 | sub_209dh:\r | |
4547 | ld a,(hl) ;209d\r | |
4548 | cp 0ffh ;209e\r | |
4549 | ret z ;20a0\r | |
4550 | comst ;20a1\r | |
4551 | cp (iy+000h) ;20a5\r | |
4552 | comend\r | |
4553 | jr z,l20aeh ;20a8\r | |
4554 | inc hl ;20aa\r | |
4555 | inc hl ;20ab\r | |
4556 | jr sub_209dh ;20ac\r | |
4557 | l20aeh:\r | |
4558 | inc hl ;20ae\r | |
4559 | ld c,(hl) ;20af\r | |
4560 | ld hl,t_MNEMONICS ;20b0\r | |
4561 | ld b,000h ;20b3\r | |
4562 | add hl,bc ;20b5\r | |
4563 | ld de,l230bh ;20b6\r | |
4564 | scf ;20b9\r | |
4565 | ret ;20ba\r | |
4566 | sub_20bbh:\r | |
4567 | ld a,(hl) ;20bb\r | |
4568 | and a ;20bc\r | |
4569 | ret z ;20bd\r | |
4570 | inc hl ;20be\r | |
4571 | comst ;20bf\r | |
4572 | cp (iy+000h) ;20c3\r | |
4573 | comend\r | |
4574 | jr nz,sub_20bbh ;20c6\r | |
4575 | scf ;20c8\r | |
4576 | ret ;20c9\r | |
4577 | \r | |
4578 | lookup_opc:\r | |
4579 | comst ;20ca\r | |
4580 | ld a,(iy+000h) ;20ce\r | |
4581 | comend\r | |
4582 | and (hl) ;20d1\r | |
4583 | inc hl ;20d2\r | |
4584 | cp (hl) ;20d3\r | |
4585 | jr z,l20dfh ;20d4\r | |
4586 | inc hl ;20d6\r | |
4587 | inc hl ;20d7\r | |
4588 | inc hl ;20d8\r | |
4589 | inc hl ;20d9\r | |
4590 | ld a,(hl) ;20da\r | |
4591 | and a ;20db\r | |
4592 | jr nz,lookup_opc ;20dc\r | |
4593 | ret ;20de\r | |
4594 | l20dfh:\r | |
4595 | inc hl ;20df\r | |
4596 | ld c,(hl) ;20e0\r | |
4597 | inc hl ;20e1\r | |
4598 | ld e,(hl) ;20e2\r | |
4599 | inc hl ;20e3\r | |
4600 | ld d,(hl) ;20e4\r | |
4601 | ld hl,t_MNEMONICS ;20e5\r | |
4602 | ld b,000h ;20e8\r | |
4603 | add hl,bc ;20ea\r | |
4604 | scf ;20eb\r | |
4605 | ret ;20ec\r | |
4606 | \r | |
4607 | b_0x20ED_start: ; 1 byte opcodes (no parameters)\r | |
4608 | db 076h ;20ed halt\r | |
4609 | db 039h ;20ee \r | |
4610 | db 0d9h ;20ef exx\r | |
4611 | db 036h ;20f0\r | |
4612 | db 0f3h ;20f1 di\r | |
4613 | db 02ch ;20f2\r | |
4614 | db 0fbh ;20f3 ei\r | |
4615 | db 032h ;20f4\r | |
4616 | db 000h ;20f5 nop\r | |
4617 | db 069h ;20f6\r | |
4618 | db 007h ;20f7 rlca\r | |
4619 | db 09eh ;20f8\r | |
4620 | db 00fh ;20f9 rrca\r | |
4621 | db 0adh ;20fa\r | |
4622 | db 017h ;20fb rla\r | |
4623 | db 098h ;20fc\r | |
4624 | db 01fh ;20fd rra\r | |
4625 | db 0a7h ;20fe\r | |
4626 | db 027h ;20ff daa\r | |
4627 | db 026h ;2100\r | |
4628 | db 02fh ;2101 cpl\r | |
4629 | db 023h ;2102\r | |
4630 | db 037h ;2103 scf\r | |
4631 | db 0bah ;2104\r | |
4632 | db 03fh ;2105 ccf\r | |
4633 | db 010h ;2106\r | |
4634 | db 0ffh ;2107 EOT\r | |
4635 | \r | |
4636 | b_0x2108_start: ; 1 byte opcodes\r | |
4637 | defb 0c0h ;2108 ld r,r\r | |
4638 | defb 040h ;2109\r | |
4639 | defb 056h ;210a\r | |
4640 | defw l22fch ;210b\r | |
4641 | \r | |
4642 | defb 0f8h ;210d add a,r\r | |
4643 | defb 080h ;210e\r | |
4644 | defb 003h ;210f\r | |
4645 | defw l2305h ;2110\r | |
4646 | \r | |
4647 | defb 0f8h ;2112 adc a,r\r | |
4648 | defb 088h ;2113\r | |
4649 | defb 000h ;2114\r | |
4650 | defw l2305h ;2115\r | |
4651 | \r | |
4652 | defb 0f8h ;2117\r | |
4653 | defb 090h ;2118\r | |
4654 | defb 0c9h ;2119\r | |
4655 | defw l24ebh ;211a\r | |
4656 | \r | |
4657 | defb 0f8h ;211c\r | |
4658 | defb 098h ;211d\r | |
4659 | defb 0b7h ;211e\r | |
4660 | defw l2305h ;211f\r | |
4661 | \r | |
4662 | defb 0f8h ;2121\r | |
4663 | defb 0a0h ;2122\r | |
4664 | defb 006h ;2123\r | |
4665 | defw l24ebh ;2124\r | |
4666 | \r | |
4667 | defb 0f8h ;2126\r | |
4668 | defb 0a8h ;2127\r | |
4669 | defb 0cch ;2128\r | |
4670 | defw l24ebh ;2129\r | |
4671 | \r | |
4672 | defb 0f8h ;212b\r | |
4673 | defb 0b0h ;212c\r | |
4674 | defb 06ch ;212d\r | |
4675 | defw l24ebh ;212e\r | |
4676 | \r | |
4677 | defb 0f8h ;2130\r | |
4678 | defb 0b8h ;2131\r | |
4679 | defb 013h ;2132\r | |
4680 | defw l24ebh ;2133\r | |
4681 | \r | |
4682 | defb 0c7h ;2135\r | |
4683 | defb 0c0h ;2136 ret cc\r | |
4684 | defb 08bh ;2137\r | |
4685 | defw l2561h ;2138\r | |
4686 | \r | |
30d1329e | 4687 | defb 0c7h ;213a rst\r |
a16ba2b0 L |
4688 | defb 0c7h ;213b\r |
4689 | defb 0b4h ;213c\r | |
4690 | defw l231eh ;213d\r | |
4691 | \r | |
4692 | defb 0ffh ;213f ret\r | |
4693 | defb 0c9h ;2140\r | |
4694 | defb 08bh ;2141\r | |
4695 | defw l230bh ;2142\r | |
4696 | \r | |
4697 | defb 0cfh ;2144 pop rr\r | |
4698 | defb 0c1h ;2145\r | |
4699 | defb 081h ;2146\r | |
4700 | defw l2546h ;2147\r | |
4701 | \r | |
4702 | defb 0cfh ;2149 push rr\r | |
4703 | defb 0c5h ;214a\r | |
4704 | defb 084h ;214b\r | |
4705 | defw l2546h ;214c\r | |
4706 | \r | |
4707 | defb 0ffh ;214e ex (sp),hl\r | |
4708 | defb 0e3h ;214f\r | |
4709 | defb 034h ;2150\r | |
4710 | defw l232ah ;2151\r | |
4711 | \r | |
4712 | defb 0ffh ;2153 jp (hl)\r | |
4713 | defb 0e9h ;2154\r | |
4714 | defb 052h ;2155\r | |
4715 | defw l2338h ;2156\r | |
4716 | \r | |
4717 | defb 0ffh ;2158 ex de,hl\r | |
4718 | defb 0ebh ;2159\r | |
4719 | defb 034h ;215a\r | |
4720 | defw l2345h ;215b\r | |
4721 | \r | |
4722 | defb 0ffh ;215d ld sp,hl\r | |
4723 | defb 0f9h ;215e\r | |
4724 | defb 056h ;215f\r | |
4725 | defw l234bh ;2160\r | |
4726 | \r | |
4727 | defb 0cfh ;2162 inc rr\r | |
4728 | defb 003h ;2163\r | |
4729 | defb 041h ;2164\r | |
4730 | defw l254bh ;2165\r | |
4731 | \r | |
4732 | defb 0cfh ;2167 dec rr\r | |
4733 | defb 00bh ;2168\r | |
4734 | defb 029h ;2169\r | |
4735 | defw l254bh ;216a\r | |
4736 | \r | |
4737 | defb 0c7h ;216c inc r\r | |
4738 | defb 004h ;216d\r | |
4739 | defb 041h ;216e\r | |
4740 | defw l24dfh ;216f\r | |
4741 | \r | |
4742 | defb 0c7h ;2171 dec r\r | |
4743 | defb 005h ;2172\r | |
4744 | defb 029h ;2173\r | |
4745 | defw l24dfh ;2174\r | |
4746 | \r | |
4747 | defb 0ffh ;2176 ex af,af'\r | |
4748 | defb 008h ;2177\r | |
4749 | defb 034h ;2178\r | |
4750 | defw l2357h ;2179\r | |
4751 | \r | |
4752 | defb 0cfh ;217b add hl,rr\r | |
4753 | defb 009h ;217c\r | |
4754 | defb 003h ;217d\r | |
4755 | defw l235dh ;217e\r | |
4756 | \r | |
4757 | defb 0efh ;2180 ld (rr),a ;rr=bc,de\r | |
4758 | defb 002h ;2181\r | |
4759 | defb 056h ;2182\r | |
4760 | defw l2366h ;2183\r | |
4761 | \r | |
4762 | defb 0efh ;2185 ld a,(rr) ;rr=bc,de\r | |
4763 | defb 00ah ;2186\r | |
4764 | defb 056h ;2187\r | |
4765 | defw l236fh ;2188\r | |
4766 | \r | |
4767 | defb 000h ;218a EOT\r | |
4768 | \r | |
4769 | b_0x218B_start: ; 2 byte opdodes\r | |
4770 | defb 0c7h ;218b ld r,nn\r | |
4771 | defb 006h ;218c\r | |
4772 | defb 056h ;218d\r | |
4773 | defw l2384h ;218e\r | |
4774 | \r | |
4775 | defb 0ffh ;2190 add a,nn\r | |
4776 | defb 0c6h ;2191\r | |
4777 | defb 003h ;2192\r | |
4778 | defw l237fh ;2193\r | |
4779 | \r | |
4780 | defb 0ffh ;2195 adc a,nn\r | |
4781 | defb 0ceh ;2196\r | |
4782 | defb 000h ;2197\r | |
4783 | defw l237fh ;2198\r | |
4784 | \r | |
4785 | defb 0ffh ;219a sub a,nn\r | |
4786 | defb 0d6h ;219b\r | |
4787 | defb 0c9h ;219c\r | |
4788 | defw l2397h ;219d\r | |
4789 | \r | |
4790 | defb 0ffh ;219f\r | |
4791 | defb 0deh ;21a0\r | |
4792 | defb 0b7h ;21a1\r | |
4793 | defw l237fh ;21a2\r | |
4794 | \r | |
4795 | defb 0ffh ;21a4 and a,nn\r | |
4796 | defb 0e6h ;21a5\r | |
4797 | defb 006h ;21a6\r | |
4798 | defw l2397h ;21a7\r | |
4799 | \r | |
4800 | defb 0ffh ;21a9\r | |
4801 | defb 0eeh ;21aa\r | |
4802 | defb 0cch ;21ab\r | |
4803 | defw l2397h ;21ac\r | |
4804 | \r | |
4805 | defb 0ffh ;21ae\r | |
4806 | defb 0f6h ;21af\r | |
4807 | defb 06ch ;21b0\r | |
4808 | defw l2397h ;21b1\r | |
4809 | \r | |
4810 | defb 0ffh ;21b3 cp a,nn\r | |
4811 | defb 0feh ;21b4\r | |
4812 | defb 013h ;21b5\r | |
4813 | defw l2397h ;21b6\r | |
4814 | \r | |
4815 | defb 0ffh ;21b8 djnz\r | |
4816 | defb 010h ;21b9\r | |
4817 | defb 02eh ;21ba\r | |
4818 | defw l23b0h ;21bb\r | |
4819 | \r | |
4820 | defb 0ffh ;21bd jr\r | |
4821 | defb 018h ;21be\r | |
4822 | defb 054h ;21bf\r | |
4823 | defw l23b0h ;21c0\r | |
4824 | \r | |
4825 | defb 0e7h ;21c2 jr,cc\r | |
4826 | defb 020h ;21c3\r | |
4827 | defb 054h ;21c4\r | |
4828 | defw l23a1h ;21c5\r | |
4829 | \r | |
4830 | defb 0ffh ;21c7\r | |
4831 | defb 0d3h ;21c8 out (nn),a\r | |
4832 | defb 076h ;21c9\r | |
4833 | defw l23d5h ;21ca\r | |
4834 | \r | |
4835 | defb 0ffh ;21cc in a,(nn)\r | |
4836 | defb 0dbh ;21cd\r | |
4837 | defb 03fh ;21ce\r | |
4838 | defw l23c3h ;21cf\r | |
4839 | \r | |
4840 | defb 000h ;21d1 EOT\r | |
4841 | \r | |
4842 | b_0x21D2_start: ; 3 byte opcodes\r | |
4843 | defb 0c7h ;21d2\r | |
4844 | defb 0c2h ;21d3\r | |
4845 | defb 052h ;21d4\r | |
4846 | defw l23e0h ;21d5\r | |
4847 | \r | |
4848 | defb 0c7h ;21d7\r | |
4849 | defb 0c4h ;21d8\r | |
4850 | defb 00ch ;21d9\r | |
4851 | defw l23e0h ;21da\r | |
4852 | \r | |
4853 | defb 0cfh ;21dc\r | |
4854 | defb 001h ;21dd\r | |
4855 | defb 056h ;21de\r | |
4856 | defw l23fch ;21df\r | |
4857 | \r | |
4858 | defb 0ffh ;21e1\r | |
4859 | defb 0c3h ;21e2\r | |
4860 | defb 052h ;21e3\r | |
4861 | defw l23e6h ;21e4\r | |
4862 | \r | |
4863 | defb 0ffh ;21e6\r | |
4864 | defb 0cdh ;21e7\r | |
4865 | defb 00ch ;21e8\r | |
4866 | defw l23e6h ;21e9\r | |
4867 | \r | |
4868 | defb 0ffh ;21eb\r | |
4869 | defb 022h ;21ec\r | |
4870 | defb 056h ;21ed\r | |
4871 | defw l2404h ;21ee\r | |
4872 | \r | |
4873 | defb 0ffh ;21f0\r | |
4874 | defb 02ah ;21f1\r | |
4875 | defb 056h ;21f2\r | |
4876 | defw l240dh ;21f3\r | |
4877 | \r | |
4878 | defb 0ffh ;21f5\r | |
4879 | defb 032h ;21f6\r | |
4880 | defb 056h ;21f7\r | |
4881 | defw l2416h ;21f8\r | |
4882 | \r | |
4883 | defb 0ffh ;21fa\r | |
4884 | defb 03ah ;21fb\r | |
4885 | defb 056h ;21fc\r | |
4886 | defw l2421h ;21fd\r | |
4887 | \r | |
4888 | defb 000h ;21ff\r | |
4889 | \r | |
4890 | b_0x2200_start: ; prefix ED + 1 byte opcode\r | |
4891 | defb 044h ;2200 neg\r | |
4892 | defb 066h ;2201\r | |
4893 | defb 045h ;2202 retn\r | |
4894 | defb 092h ;2203\r | |
4895 | defb 04dh ;2204 reti\r | |
4896 | defb 08eh ;2205\r | |
4897 | defb 067h ;2206 rrd\r | |
4898 | defb 0b1h ;2207\r | |
4899 | defb 06fh ;2208 rld\r | |
4900 | defb 0a2h ;2209\r | |
4901 | defb 0a0h ;220a ldi\r | |
4902 | defb 05fh ;220b\r | |
4903 | defb 0a1h ;220c\r | |
4904 | defb 01ch ;220d\r | |
4905 | defb 0a2h ;220e\r | |
4906 | defb 04bh ;220f\r | |
4907 | defb 0a3h ;2210\r | |
4908 | defb 07dh ;2211\r | |
4909 | defb 0a8h ;2212 ldd\r | |
4910 | defb 058h ;2213\r | |
4911 | defb 0a9h ;2214\r | |
4912 | defb 015h ;2215\r | |
4913 | defb 0aah ;2216\r | |
4914 | defb 044h ;2217\r | |
4915 | defb 0abh ;2218\r | |
4916 | defb 079h ;2219\r | |
4917 | defb 0b0h ;221a ldir\r | |
4918 | defb 062h ;221b\r | |
4919 | defb 0b1h ;221c\r | |
4920 | defb 01fh ;221d\r | |
4921 | defb 0b2h ;221e\r | |
4922 | defb 04eh ;221f\r | |
4923 | defb 0b3h ;2220\r | |
4924 | defb 072h ;2221\r | |
4925 | defb 0b8h ;2222 lddr\r | |
4926 | defb 05bh ;2223\r | |
4927 | defb 0b9h ;2224\r | |
4928 | defb 018h ;2225\r | |
4929 | defb 0bah ;2226\r | |
4930 | defb 047h ;2227\r | |
4931 | defb 0bbh ;2228\r | |
4932 | defb 06eh ;2229\r | |
4933 | defb 08bh ;222a otdm\r | |
4934 | defb 0d5h ;222b\r | |
4935 | defb 09bh ;222c otdmr\r | |
4936 | defb 0d9h ;222d\r | |
4937 | defb 083h ;222e otim\r | |
4938 | defb 0deh ;222f\r | |
4939 | defb 093h ;2230 otimr\r | |
4940 | defb 0e2h ;2231\r | |
4941 | defb 076h ;2232 slp\r | |
4942 | defb 0ebh ;2233\r | |
4943 | defb 0ffh ;2234 EOT\r | |
4944 | \r | |
4945 | l2235h:\r | |
4946 | defb 0e7h ;2235 in r,(c) ;r=bcde\r | |
4947 | defb 040h ;2236\r | |
4948 | defb 03fh ;2237\r | |
4949 | defw l2455h ;2238\r | |
4950 | \r | |
4951 | defb 0f7h ;223a in r,(c) ;r=hl\r | |
4952 | defb 060h ;223b\r | |
4953 | defb 03fh ;223c\r | |
4954 | defw l2455h ;223d\r | |
4955 | \r | |
4956 | defb 0ffh ;223f in r,(c) ;r=a\r | |
4957 | defb 078h ;2240\r | |
4958 | defb 03fh ;2241\r | |
4959 | defw l2455h ;2242\r | |
4960 | \r | |
4961 | defb 0e7h ;2244\r | |
4962 | defb 041h ;2245\r | |
4963 | defb 076h ;2246\r | |
4964 | defw l2461h ;2247\r | |
4965 | \r | |
4966 | defb 0f7h ;2249\r | |
4967 | defb 061h ;224a\r | |
4968 | defb 076h ;224b\r | |
4969 | defw l2461h ;224c\r | |
4970 | \r | |
4971 | defb 0ffh ;224e out (c),r ;r=a\r | |
4972 | defb 079h ;224f\r | |
4973 | defb 076h ;2250\r | |
4974 | defw l2461h ;2251\r | |
4975 | \r | |
4976 | defb 0cfh ;2253 sbc hl,rr\r | |
4977 | defb 042h ;2254\r | |
4978 | defb 0b7h ;2255\r | |
4979 | defw l246dh ;2256\r | |
4980 | \r | |
4981 | defb 0cfh ;2258 adc hl,rr\r | |
4982 | defb 04ah ;2259\r | |
4983 | defb 000h ;225a\r | |
4984 | defw l246dh ;225b\r | |
4985 | \r | |
4986 | defb 0ffh ;225d im 0\r | |
4987 | defb 046h ;225e\r | |
4988 | defb 03dh ;225f\r | |
4989 | defw l2427h ;2260\r | |
4990 | \r | |
4991 | defb 0ffh ;2262 im 1\r | |
4992 | defb 056h ;2263\r | |
4993 | defb 03dh ;2264\r | |
4994 | defw l242bh ;2265\r | |
4995 | \r | |
4996 | defb 0ffh ;2267 im 2\r | |
4997 | defb 05eh ;2268\r | |
4998 | defb 03dh ;2269\r | |
4999 | defw l242fh ;226a\r | |
5000 | \r | |
5001 | defb 0ffh ;226c ld i,a\r | |
5002 | defb 047h ;226d\r | |
5003 | defb 056h ;226e\r | |
5004 | defw l2434h ;226f\r | |
5005 | \r | |
5006 | defb 0ffh ;2271\r | |
5007 | defb 057h ;2272\r | |
5008 | defb 056h ;2273\r | |
5009 | defw l2439h ;2274\r | |
5010 | \r | |
5011 | defb 0ffh ;2276\r | |
5012 | defb 04fh ;2277\r | |
5013 | defb 056h ;2278\r | |
5014 | defw l243eh ;2279\r | |
5015 | \r | |
5016 | defb 0ffh ;227b\r | |
5017 | defb 05fh ;227c\r | |
5018 | defb 056h ;227d\r | |
5019 | defw l2443h ;227e\r | |
5020 | \r | |
5021 | defb 0cfh ;2280 mlt rr\r | |
5022 | defb 04ch ;2281\r | |
5023 | defb 0d2h ;2282\r | |
5024 | defw l254bh ;2283\r | |
5025 | \r | |
5026 | defb 0c7h ;2285 tst r\r | |
5027 | defb 004h ;2286\r | |
5028 | defb 0eeh ;2287\r | |
5029 | defw l24dfh ;2288\r | |
5030 | \r | |
5031 | defb 000h ;228a\r | |
5032 | \r | |
5033 | l228bh:\r | |
5034 | defb 0e7h ;228b\r | |
5035 | defb 000h ;228c\r | |
5036 | defb 0cfh ;228d\r | |
5037 | \r | |
5038 | b_0x228E_start:\r | |
5039 | defw l230ch ;228e\r | |
5040 | \r | |
5041 | b_0x2290_start:\r | |
5042 | defb 0f7h ;2290\r | |
5043 | defb 020h ;2291\r | |
5044 | defb 0cfh ;2292\r | |
5045 | \r | |
5046 | b_0x2293_start:\r | |
5047 | defw l230ch ;2293\r | |
5048 | \r | |
5049 | b_0x2295_start:\r | |
5050 | defb 0ffh ;2295\r | |
5051 | defb 038h ;2296\r | |
5052 | defb 0cfh ;2297\r | |
5053 | \r | |
5054 | b_0x2298_start:\r | |
5055 | defw l230ch ;2298\r | |
5056 | \r | |
5057 | b_0x229A_start:\r | |
5058 | defb 0e7h ;229a\r | |
5059 | defb 001h ;229b\r | |
5060 | defb 0e7h ;229c\r | |
5061 | \r | |
5062 | b_0x229D_start:\r | |
5063 | defw l2315h ;229d\r | |
5064 | \r | |
5065 | b_0x229F_start:\r | |
5066 | defb 0f7h ;229f\r | |
5067 | defb 021h ;22a0\r | |
5068 | defb 0e7h ;22a1\r | |
5069 | \r | |
5070 | b_0x22A2_start:\r | |
5071 | defw l2315h ;22a2\r | |
5072 | \r | |
5073 | b_0x22A4_start:\r | |
5074 | defb 0ffh ;22a4\r | |
5075 | defb 039h ;22a5\r | |
5076 | defb 0e7h ;22a6\r | |
5077 | \r | |
5078 | b_0x22A7_start:\r | |
5079 | defw l2315h ;22a7\r | |
5080 | \r | |
5081 | b_0x22A9_start:\r | |
5082 | defb 0ffh ;22a9\r | |
5083 | defb 064h ;22aa\r | |
5084 | defb 0eeh ;22ab\r | |
5085 | \r | |
5086 | b_0x22AC_start:\r | |
5087 | defw l2397h ;22ac\r | |
5088 | \r | |
5089 | b_0x22AE_start:\r | |
5090 | defb 0ffh ;22ae\r | |
5091 | defb 074h ;22af\r | |
5092 | defb 0f1h ;22b0\r | |
5093 | \r | |
5094 | b_0x22B1_start:\r | |
5095 | defw l2397h ;22b1\r | |
5096 | \r | |
5097 | b_0x22B3_start:\r | |
5098 | defb 000h ;22b3\r | |
5099 | l22b4h:\r | |
5100 | defb 0efh ;22b4\r | |
5101 | defb 043h ;22b5\r | |
5102 | defb 056h ;22b6\r | |
5103 | \r | |
5104 | b_0x22B7_start:\r | |
5105 | defw l2476h ;22b7\r | |
5106 | \r | |
5107 | b_0x22B9_start:\r | |
5108 | defb 0ffh ;22b9\r | |
5109 | defb 073h ;22ba\r | |
5110 | defb 056h ;22bb\r | |
5111 | \r | |
5112 | b_0x22BC_start:\r | |
5113 | defw l2476h ;22bc\r | |
5114 | \r | |
5115 | b_0x22BE_start:\r | |
5116 | defb 0efh ;22be\r | |
5117 | defb 04bh ;22bf\r | |
5118 | defb 056h ;22c0\r | |
5119 | \r | |
5120 | b_0x22C1_start:\r | |
5121 | defw l247fh ;22c1\r | |
5122 | \r | |
5123 | b_0x22C3_start:\r | |
5124 | defb 0ffh ;22c3\r | |
5125 | defb 07bh ;22c4\r | |
5126 | defb 056h ;22c5\r | |
5127 | \r | |
5128 | b_0x22C6_start:\r | |
5129 | defw l247fh ;22c6\r | |
5130 | \r | |
5131 | b_0x22C8_start:\r | |
5132 | defb 000h ;22c8\r | |
5133 | l22c9h:\r | |
5134 | defb 0f8h ;22c9\r | |
5135 | defb 000h ;22ca\r | |
5136 | defb 09bh ;22cb\r | |
5137 | \r | |
5138 | b_0x22CC_start:\r | |
5139 | defw l24aeh ;22cc\r | |
5140 | \r | |
5141 | b_0x22CE_start:\r | |
5142 | defb 0f8h ;22ce\r | |
5143 | defb 008h ;22cf\r | |
5144 | defb 0aah ;22d0\r | |
5145 | \r | |
5146 | b_0x22D1_start:\r | |
5147 | defw l24aeh ;22d1\r | |
5148 | \r | |
5149 | b_0x22D3_start:\r | |
5150 | defb 0f8h ;22d3\r | |
5151 | defb 010h ;22d4\r | |
5152 | defb 096h ;22d5\r | |
5153 | \r | |
5154 | b_0x22D6_start:\r | |
5155 | defw l24aeh ;22d6\r | |
5156 | \r | |
5157 | b_0x22D8_start:\r | |
5158 | defb 0f8h ;22d8\r | |
5159 | defb 018h ;22d9\r | |
5160 | defb 0a5h ;22da\r | |
5161 | \r | |
5162 | b_0x22DB_start:\r | |
5163 | defw l24aeh ;22db\r | |
5164 | \r | |
5165 | b_0x22DD_start:\r | |
5166 | defb 0f8h ;22dd\r | |
5167 | defb 020h ;22de\r | |
5168 | defb 0c0h ;22df\r | |
5169 | \r | |
5170 | b_0x22E0_start:\r | |
5171 | defw l24aeh ;22e0\r | |
5172 | \r | |
5173 | b_0x22E2_start:\r | |
5174 | defb 0f8h ;22e2\r | |
5175 | defb 028h ;22e3\r | |
5176 | defb 0c3h ;22e4\r | |
5177 | \r | |
5178 | b_0x22E5_start:\r | |
5179 | defw l24aeh ;22e5\r | |
5180 | \r | |
5181 | b_0x22E7_start:\r | |
5182 | defb 0f8h ;22e7\r | |
5183 | defb 038h ;22e8\r | |
5184 | defb 0c6h ;22e9\r | |
5185 | \r | |
5186 | b_0x22EA_start:\r | |
5187 | defw l24aeh ;22ea\r | |
5188 | \r | |
5189 | b_0x22EC_start:\r | |
5190 | defb 0c0h ;22ec\r | |
5191 | defb 040h ;22ed\r | |
5192 | defb 009h ;22ee\r | |
5193 | \r | |
5194 | b_0x22EF_start:\r | |
5195 | defw l2487h ;22ef\r | |
5196 | \r | |
5197 | b_0x22F1_start:\r | |
5198 | defb 0c0h ;22f1\r | |
5199 | defb 080h ;22f2\r | |
5200 | defb 088h ;22f3\r | |
5201 | \r | |
5202 | b_0x22F4_start:\r | |
5203 | defw l2487h ;22f4\r | |
5204 | \r | |
5205 | b_0x22F6_start:\r | |
5206 | defb 0c0h ;22f6\r | |
5207 | defb 0c0h ;22f7\r | |
5208 | defb 0bdh ;22f8\r | |
5209 | \r | |
5210 | b_0x22F9_start:\r | |
5211 | defw l2487h ;22f9\r | |
5212 | \r | |
5213 | b_0x22FB_start:\r | |
5214 | defb 000h ;22fb\r | |
5215 | l22fch:\r | |
5216 | call l24dfh ;22fc\r | |
5217 | call sub_257ch ;22ff\r | |
5218 | jp l24ebh ;2302\r | |
5219 | l2305h:\r | |
5220 | call sub_2579h ;2305\r | |
5221 | jp l24ebh ;2308\r | |
5222 | l230bh:\r | |
5223 | ret ;230b\r | |
5224 | l230ch:\r | |
5225 | call l24dfh ;230c\r | |
5226 | call sub_257ch ;230f\r | |
5227 | jp l23c6h ;2312\r | |
5228 | l2315h:\r | |
5229 | call l23c6h ;2315\r | |
5230 | call sub_257ch ;2318\r | |
5231 | jp l24dfh ;231b\r | |
5232 | l231eh:\r | |
5233 | comst ;231e\r | |
5234 | ld a,(iy+000h) ;2322\r | |
5235 | comend\r | |
5236 | and 038h ;2325\r | |
5237 | jp out.hex ;2327\r | |
5238 | l232ah:\r | |
5239 | ld hl,b_0x2333_start ;232a\r | |
5240 | call PSTR ;232d\r | |
5241 | jp l253eh ;2330\r | |
5242 | \r | |
5243 | b_0x2333_start:\r | |
5244 | DC '(SP),'\r | |
5245 | \r | |
5246 | l2338h:\r | |
5247 | ld a,'(' ;2338\r | |
5248 | call OUTCHAR ;233a\r | |
5249 | call l253eh ;233d\r | |
5250 | ld a,')' ;2340\r | |
5251 | jp OUTCHAR ;2342\r | |
5252 | l2345h:\r | |
5253 | ld hl,l1d86h ;2345\r | |
5254 | jp PSTR ;2348\r | |
5255 | l234bh:\r | |
5256 | ld hl,b_0x2354_start ;234b\r | |
5257 | call PSTR ;234e\r | |
5258 | jp l253eh ;2351\r | |
5259 | \r | |
5260 | b_0x2354_start:\r | |
5261 | DC 'SP,'\r | |
5262 | \r | |
5263 | l2357h:\r | |
5264 | ld hl,b_0x1D80_start ;2357\r | |
5265 | jp PSTR ;235a\r | |
5266 | l235dh:\r | |
5267 | call l253eh ;235d\r | |
5268 | call sub_257ch ;2360\r | |
5269 | jp l254bh ;2363\r | |
5270 | l2366h:\r | |
5271 | call sub_2372h ;2366\r | |
5272 | call sub_257ch ;2369\r | |
5273 | jp l23dbh ;236c\r | |
5274 | l236fh:\r | |
5275 | call sub_2579h ;236f\r | |
5276 | sub_2372h:\r | |
5277 | ld a,'(' ;2372\r | |
5278 | call OUTCHAR ;2374\r | |
5279 | call l254bh ;2377\r | |
5280 | ld a,')' ;237a\r | |
5281 | jp OUTCHAR ;237c\r | |
5282 | l237fh:\r | |
5283 | call sub_2579h ;237f\r | |
5284 | jr l2397h ;2382\r | |
5285 | l2384h:\r | |
5286 | call l24dfh ;2384\r | |
5287 | call sub_257ch ;2387\r | |
5288 | ld a,(is.pfx.IXY) ;238a\r | |
5289 | and a ;238d\r | |
5290 | comst ;238e\r | |
5291 | ld a,(iy+002h) ;2392\r | |
5292 | comend\r | |
5293 | jr nz,l239eh ;2395\r | |
5294 | l2397h:\r | |
5295 | comst ;2397\r | |
5296 | ld a,(iy+001h) ;239b\r | |
5297 | comend\r | |
5298 | l239eh:\r | |
5299 | jp out.hex ;239e\r | |
5300 | l23a1h:\r | |
5301 | comst ;23a1\r | |
5302 | ld a,(iy+000h) ;23a5\r | |
5303 | comend\r | |
5304 | and 018h ;23a8\r | |
5305 | call sub_2568h ;23aa\r | |
5306 | call sub_257ch ;23ad\r | |
5307 | l23b0h:\r | |
5308 | comst ;23b0\r | |
5309 | ld c,(iy+001h) ;23b4\r | |
5310 | comend\r | |
5311 | ld a,c ;23b7\r | |
5312 | rla ;23b8\r | |
5313 | sbc a,a ;23b9\r | |
5314 | ld b,a ;23ba\r | |
5315 | push iy ;23bb\r | |
5316 | pop hl ;23bd\r | |
5317 | add hl,bc ;23be\r | |
5318 | inc hl ;23bf\r | |
5319 | inc hl ;23c0\r | |
5320 | jr l23f0h ;23c1\r | |
5321 | l23c3h:\r | |
5322 | call sub_2579h ;23c3\r | |
5323 | l23c6h:\r | |
5324 | ld a,028h ;23c6\r | |
5325 | call OUTCHAR ;23c8\r | |
5326 | comst ;23cb\r | |
5327 | ld a,(iy+001h) ;23cf\r | |
5328 | comend\r | |
5329 | jp l252bh ;23d2\r | |
5330 | l23d5h:\r | |
5331 | call l23c6h ;23d5\r | |
5332 | call sub_257ch ;23d8\r | |
5333 | l23dbh:\r | |
5334 | ld a,041h ;23db\r | |
5335 | jp OUTCHAR ;23dd\r | |
5336 | l23e0h:\r | |
5337 | call l2561h ;23e0\r | |
5338 | call sub_257ch ;23e3\r | |
5339 | l23e6h:\r | |
5340 | comst ;23e6\r | |
5341 | ld l,(iy+001h) ;23ea\r | |
5342 | ld h,(iy+002h) ;23ed\r | |
5343 | comend\r | |
5344 | l23f0h:\r | |
5345 | ld a,002h ;23f0\r | |
5346 | sub_23f2h:\r | |
5347 | ld (XBE03),a ;23f2\r | |
5348 | ld (XBE01),hl ;23f5\r | |
5349 | call out.hl ;23f8\r | |
5350 | ret ;23fb\r | |
5351 | l23fch:\r | |
5352 | call l254bh ;23fc\r | |
5353 | call sub_257ch ;23ff\r | |
5354 | jr l23e6h ;2402\r | |
5355 | l2404h:\r | |
5356 | call sub_24c6h ;2404\r | |
5357 | call sub_257ch ;2407\r | |
5358 | jp l253eh ;240a\r | |
5359 | l240dh:\r | |
5360 | call l253eh ;240d\r | |
5361 | call sub_257ch ;2410\r | |
5362 | jp sub_24c6h ;2413\r | |
5363 | l2416h:\r | |
5364 | call sub_24c6h ;2416\r | |
5365 | call sub_257ch ;2419\r | |
5366 | ld a,041h ;241c\r | |
5367 | jp OUTCHAR ;241e\r | |
5368 | l2421h:\r | |
5369 | call sub_2579h ;2421\r | |
5370 | jp sub_24c6h ;2424\r | |
5371 | l2427h:\r | |
5372 | ld a,030h ;2427\r | |
5373 | jr l2431h ;2429\r | |
5374 | l242bh:\r | |
5375 | ld a,031h ;242b\r | |
5376 | jr l2431h ;242d\r | |
5377 | l242fh:\r | |
5378 | ld a,032h ;242f\r | |
5379 | l2431h:\r | |
5380 | jp OUTCHAR ;2431\r | |
5381 | l2434h:\r | |
5382 | ld hl,b_0x2449_start ;2434\r | |
5383 | jr l2446h ;2437\r | |
5384 | l2439h:\r | |
5385 | ld hl,l244ch ;2439\r | |
5386 | jr l2446h ;243c\r | |
5387 | l243eh:\r | |
5388 | ld hl,l244fh ;243e\r | |
5389 | jr l2446h ;2441\r | |
5390 | l2443h:\r | |
5391 | ld hl,l2452h ;2443\r | |
5392 | l2446h:\r | |
5393 | jp PSTR ;2446\r | |
5394 | \r | |
5395 | b_0x2449_start:\r | |
5396 | DC 'I,A'\r | |
5397 | l244ch:\r | |
5398 | DC 'A,I'\r | |
5399 | l244fh:\r | |
5400 | DC 'R,A'\r | |
5401 | l2452h:\r | |
5402 | DC 'A,R'\r | |
5403 | \r | |
5404 | l2455h:\r | |
5405 | call l24dfh ;2455\r | |
5406 | call sub_257ch ;2458\r | |
5407 | ld hl,t__C_ ;245b\r | |
5408 | jp PSTR ;245e\r | |
5409 | l2461h:\r | |
5410 | ld hl,t__C_ ;2461\r | |
5411 | call PSTR ;2464\r | |
5412 | call sub_257ch ;2467\r | |
5413 | jp l24dfh ;246a\r | |
5414 | l246dh:\r | |
5415 | call l253eh ;246d\r | |
5416 | call sub_257ch ;2470\r | |
5417 | jp l254bh ;2473\r | |
5418 | l2476h:\r | |
5419 | call sub_24c6h ;2476\r | |
5420 | call sub_257ch ;2479\r | |
5421 | jp l254bh ;247c\r | |
5422 | l247fh:\r | |
5423 | call l254bh ;247f\r | |
5424 | call sub_257ch ;2482\r | |
5425 | jr sub_24c6h ;2485\r | |
5426 | l2487h:\r | |
5427 | ld a,(is.pfx.IXY) ;2487\r | |
5428 | and a ;248a\r | |
5429 | jr nz,l2496h ;248b\r | |
5430 | comst ;248d\r | |
5431 | ld a,(iy+001h) ;2491\r | |
5432 | comend\r | |
5433 | jr l249dh ;2494\r | |
5434 | l2496h:\r | |
5435 | comst ;2496\r | |
5436 | ld a,(iy+002h) ;249a\r | |
5437 | comend\r | |
5438 | l249dh:\r | |
5439 | push af ;249d\r | |
5440 | rra ;249e\r | |
5441 | rra ;249f\r | |
5442 | rra ;24a0\r | |
5443 | and 007h ;24a1\r | |
5444 | add a,'0' ;24a3\r | |
5445 | call OUTCHAR ;24a5\r | |
5446 | call sub_257ch ;24a8\r | |
5447 | pop af ;24ab\r | |
5448 | jr l24f2h ;24ac\r | |
5449 | l24aeh:\r | |
5450 | ld a,(is.pfx.IXY) ;24ae\r | |
5451 | and a ;24b1\r | |
5452 | jr nz,l24bdh ;24b2\r | |
5453 | comst ;24b4\r | |
5454 | ld a,(iy+001h) ;24b8\r | |
5455 | comend\r | |
5456 | jr l24c4h ;24bb\r | |
5457 | l24bdh:\r | |
5458 | comst ;24bd\r | |
5459 | ld a,(iy+002h) ;24c1\r | |
5460 | comend\r | |
5461 | l24c4h:\r | |
5462 | jr l24f2h ;24c4\r | |
5463 | sub_24c6h:\r | |
5464 | ld a,'(' ;24c6\r | |
5465 | call OUTCHAR ;24c8\r | |
5466 | comst ;24cb\r | |
5467 | ld l,(iy+001h) ;24cf\r | |
5468 | ld h,(iy+002h) ;24d2\r | |
5469 | comend\r | |
5470 | ld a,001h ;24d5\r | |
5471 | call sub_23f2h ;24d7\r | |
5472 | ld a,')' ;24da\r | |
5473 | jp OUTCHAR ;24dc\r | |
5474 | l24dfh:\r | |
5475 | comst ;24df\r | |
5476 | ld a,(iy+000h) ;24e3\r | |
5477 | comend\r | |
5478 | rra ;24e6\r | |
5479 | rra ;24e7\r | |
5480 | rra ;24e8\r | |
5481 | jr l24f2h ;24e9\r | |
5482 | l24ebh:\r | |
5483 | comst ;24eb\r | |
5484 | ld a,(iy+000h) ;24ef\r | |
5485 | comend\r | |
5486 | l24f2h:\r | |
5487 | and 007h ;24f2\r | |
5488 | cp 006h ;24f4\r | |
5489 | jr nz,l2533h ;24f6\r | |
5490 | ld a,(is.pfx.IXY) ;24f8\r | |
5491 | and a ;24fb\r | |
5492 | ld a,006h ;24fc\r | |
5493 | jr z,l2533h ;24fe\r | |
5494 | ld hl,b_0x2538_start ;2500\r | |
5495 | ld a,(is.pfx.IXY) ;2503\r | |
5496 | dec a ;2506\r | |
5497 | jr z,l250ch ;2507\r | |
5498 | ld hl,b_0x253B_start ;2509\r | |
5499 | l250ch:\r | |
5500 | call PSTR ;250c\r | |
5501 | comst ;250f\r | |
5502 | ld a,(iy+001h) ;2513\r | |
5503 | comend\r | |
5504 | and a ;2516\r | |
5505 | push af ;2517\r | |
5506 | jp m,l2523h ;2518\r | |
5507 | ld a,'+' ;251b\r | |
5508 | call OUTCHAR ;251d\r | |
5509 | pop af ;2520\r | |
5510 | jr l252bh ;2521\r | |
5511 | l2523h:\r | |
5512 | ld a,'-' ;2523\r | |
5513 | call OUTCHAR ;2525\r | |
5514 | pop af ;2528\r | |
5515 | neg ;2529\r | |
5516 | l252bh:\r | |
5517 | call out.hex ;252b\r | |
5518 | ld a,')' ;252e\r | |
5519 | jp OUTCHAR ;2530\r | |
5520 | l2533h:\r | |
5521 | ld hl,t_BCDEHL_HL_A ;2533\r | |
5522 | jr l2572h ;2536\r | |
5523 | \r | |
5524 | b_0x2538_start:\r | |
5525 | DC '(IX'\r | |
5526 | b_0x253B_start:\r | |
5527 | DC '(IY'\r | |
5528 | \r | |
5529 | l253eh:\r | |
5530 | ld a,(is.pfx.IXY) ;253e\r | |
5531 | ld hl,t_HL.IX.IY ;2541\r | |
5532 | jr l2572h ;2544\r | |
5533 | l2546h:\r | |
5534 | ld hl,t_BC.DE.HL.AF ;2546\r | |
5535 | jr l254eh ;2549\r | |
5536 | l254bh:\r | |
5537 | ld hl,t_BC.DE.HL.SP ;254b\r | |
5538 | l254eh:\r | |
5539 | comst ;254e\r | |
5540 | ld a,(iy+000h) ;2552\r | |
5541 | comend\r | |
5542 | rra ;2555\r | |
5543 | rra ;2556\r | |
5544 | rra ;2557\r | |
5545 | rra ;2558\r | |
5546 | and 003h ;2559\r | |
5547 | cp 002h ;255b\r | |
5548 | jr z,l253eh ;255d\r | |
5549 | jr l2572h ;255f\r | |
5550 | l2561h:\r | |
5551 | comst ;2561\r | |
5552 | ld a,(iy+000h) ;2565\r | |
5553 | comend\r | |
5554 | sub_2568h:\r | |
5555 | rra ;2568\r | |
5556 | rra ;2569\r | |
5557 | rra ;256a\r | |
5558 | and 007h ;256b\r | |
5559 | ld hl,t_tstfl_ZCPS ;256d\r | |
5560 | jr l2572h ;2570\r | |
5561 | l2572h:\r | |
5562 | ld b,a ;2572\r | |
5563 | call sub_0a48h ;2573\r | |
5564 | jp PSTR ;2576\r | |
5565 | sub_2579h:\r | |
5566 | call l23dbh ;2579\r | |
5567 | sub_257ch:\r | |
5568 | ld a,',' ;257c\r | |
5569 | jp OUTCHAR ;257e\r | |
5570 | sub_2581h:\r | |
5571 | call PSTR ;2581\r | |
5572 | l2584h:\r | |
5573 | call OUTBL ;2584\r | |
5574 | inc c ;2587\r | |
5575 | ld a,c ;2588\r | |
5576 | cp 006h ;2589\r | |
5577 | jr nz,l2584h ;258b\r | |
5578 | ret ;258d\r | |
5579 | \r | |
5580 | t_MNEMONICS:\r | |
5581 | DC 'ADC'\r | |
5582 | DC 'ADD'\r | |
5583 | DC 'AND'\r | |
5584 | DC 'BIT'\r | |
5585 | DC 'CALL'\r | |
5586 | DC 'CCF'\r | |
5587 | DC 'CP'\r | |
5588 | DC 'CPD'\r | |
5589 | DC 'CPDR'\r | |
5590 | DC 'CPI'\r | |
5591 | DC 'CPIR'\r | |
5592 | DC 'CPL'\r | |
5593 | DC 'DAA'\r | |
5594 | DC 'DEC'\r | |
5595 | DC 'DI'\r | |
5596 | DC 'DJNZ'\r | |
5597 | DC 'EI'\r | |
5598 | DC 'EX'\r | |
5599 | DC 'EXX'\r | |
5600 | DC 'HALT'\r | |
5601 | DC 'IM'\r | |
5602 | DC 'IN'\r | |
5603 | DC 'INC'\r | |
5604 | DC 'IND'\r | |
5605 | DC 'INDR'\r | |
5606 | DC 'INI'\r | |
5607 | DC 'INIR'\r | |
5608 | DC 'JP'\r | |
5609 | DC 'JR'\r | |
5610 | DC 'LD'\r | |
5611 | DC 'LDD'\r | |
5612 | DC 'LDDR'\r | |
5613 | DC 'LDI'\r | |
5614 | DC 'LDIR'\r | |
5615 | DC 'NEG'\r | |
5616 | DC 'NOP'\r | |
5617 | DC 'OR'\r | |
5618 | DC 'OTDR'\r | |
5619 | DC 'OTIR'\r | |
5620 | DC 'OUT'\r | |
5621 | DC 'OUTD'\r | |
5622 | DC 'OUTI'\r | |
5623 | DC 'POP'\r | |
5624 | DC 'PUSH'\r | |
5625 | DC 'RES'\r | |
5626 | DC 'RET'\r | |
5627 | DC 'RETI'\r | |
5628 | DC 'RETN'\r | |
5629 | DC 'RL'\r | |
5630 | DC 'RLA'\r | |
5631 | DC 'RLC'\r | |
5632 | DC 'RLCA'\r | |
5633 | DC 'RLD'\r | |
5634 | DC 'RR'\r | |
5635 | DC 'RRA'\r | |
5636 | DC 'RRC'\r | |
5637 | DC 'RRCA'\r | |
5638 | DC 'RRD'\r | |
5639 | DC 'RST'\r | |
5640 | DC 'SBC'\r | |
5641 | DC 'SCF'\r | |
5642 | DC 'SET'\r | |
5643 | DC 'SLA'\r | |
5644 | DC 'SRA'\r | |
5645 | DC 'SRL'\r | |
5646 | DC 'SUB'\r | |
5647 | DC 'XOR'\r | |
5648 | DC 'IN0'\r | |
5649 | DC 'MLT'\r | |
5650 | DC 'OTDM'\r | |
5651 | DC 'OTDMR'\r | |
5652 | DC 'OTIM'\r | |
5653 | DC 'OTIMR'\r | |
5654 | DC 'OUT0'\r | |
5655 | DC 'SLP'\r | |
5656 | DC 'TST'\r | |
5657 | DC 'TSTIO'\r | |
5658 | DB 0\r | |
5659 | \r | |
5660 | t_BCDEHL_HL_A:\r | |
5661 | DC 'B'\r | |
5662 | DC 'C'\r | |
5663 | DC 'D'\r | |
5664 | DC 'E'\r | |
5665 | DC 'H'\r | |
5666 | DC 'L'\r | |
5667 | DC '(HL)'\r | |
5668 | DC 'A'\r | |
5669 | DB 0\r | |
5670 | t_BC.DE.HL.SP:\r | |
5671 | DC 'BC'\r | |
5672 | DC 'DE'\r | |
5673 | DC 'HL'\r | |
5674 | DC 'SP'\r | |
5675 | DB 0\r | |
5676 | t_BC.DE.HL.AF:\r | |
5677 | DC 'BC'\r | |
5678 | DC 'DE'\r | |
5679 | t_HL.AF:\r | |
5680 | DC 'HL'\r | |
5681 | DC 'AF'\r | |
5682 | DB 0\r | |
5683 | t_BC.DE.IY.SP:\r | |
5684 | DC 'BC'\r | |
5685 | DC 'DE'\r | |
5686 | DC 'IY'\r | |
5687 | DC 'SP'\r | |
5688 | DB 0\r | |
5689 | t_BC.DE.IX.SP:\r | |
5690 | DC 'BC'\r | |
5691 | DC 'DE'\r | |
5692 | DC 'IX'\r | |
5693 | DC 'SP'\r | |
5694 | DB 0\r | |
5695 | t_HL.IX.IY:\r | |
5696 | DC 'HL'\r | |
5697 | t_IX.IY:\r | |
5698 | DC 'IX'\r | |
5699 | DC 'IY'\r | |
5700 | DB 0\r | |
5701 | t_tstfl_ZC:\r | |
5702 | DC 'NZ'\r | |
5703 | DC 'Z'\r | |
5704 | DC 'NC'\r | |
5705 | DC 'C'\r | |
5706 | DC 'NE'\r | |
5707 | DC 'EQ'\r | |
5708 | DC 'GE'\r | |
5709 | DC 'LT'\r | |
5710 | DB 0\r | |
5711 | t_tstfl_ZCPS:\r | |
5712 | DC 'NZ'\r | |
5713 | DC 'Z'\r | |
5714 | DC 'NC'\r | |
5715 | DC 'C'\r | |
5716 | DC 'PO'\r | |
5717 | DC 'PE'\r | |
5718 | DC 'P'\r | |
5719 | DC 'M'\r | |
5720 | DC 'NE'\r | |
5721 | DC 'EQ'\r | |
5722 | DC 'GE'\r | |
5723 | DC 'LT'\r | |
5724 | DC 'NV'\r | |
5725 | DC 'V'\r | |
5726 | DB 0\r | |
5727 | t__C_:\r | |
5728 | DC '(C)'\r | |
5729 | DB 0\r | |
5730 | \r | |
5731 | sub_26e7h:\r | |
5732 | ld hl,(REG.PC) ;26e7\r | |
5733 | ld a,h ;26ea\r | |
5734 | or l ;26eb\r | |
5735 | jr z,l2715h ;26ec\r | |
5736 | ld iy,(REG.PC) ;26ee\r | |
5737 | call sub_1f9eh ;26f2\r | |
5738 | jp nc,ERROR ;26f5\r | |
5739 | ld c,b ;26f8\r | |
5740 | ld b,000h ;26f9\r | |
5741 | ld hl,(REG.PC) ;26fb\r | |
5742 | add hl,bc ;26fe\r | |
5743 | call sub_1117h ;26ff\r | |
5744 | ld iy,(REG.PC) ;2702\r | |
5745 | ld hl,b_0x2717_start ;2706\r | |
5746 | call lookup_opc ;2709\r | |
5747 | ccf ;270c\r | |
5748 | ret c ;270d\r | |
5749 | ex de,hl ;270e\r | |
5750 | call CALL.HL ;270f\r | |
5751 | call c,sub_1117h ;2712\r | |
5752 | l2715h:\r | |
5753 | scf ;2715\r | |
5754 | ret ;2716\r | |
5755 | \r | |
5756 | b_0x2717_start:\r | |
5757 | db 0ffh ;2717\r | |
5758 | db 0ddh ;2718\r | |
5759 | db 000h ;2719\r | |
5760 | dw x278d\r | |
5761 | \r | |
5762 | db 0ffh ;271c\r | |
5763 | db 0fdh ;271d\r | |
5764 | db 000h ;271e\r | |
5765 | dw x2792\r | |
5766 | \r | |
5767 | db 0ffh ;2721\r | |
5768 | db 0edh ;2722\r | |
5769 | db 000h ;2723\r | |
5770 | dw x27a2\r | |
5771 | \r | |
5772 | l2726h:\r | |
5773 | db 0ffh ;2726\r | |
5774 | db 0cdh ;2727\r | |
5775 | db 000h ;2728\r | |
5776 | dw x275e\r | |
5777 | \r | |
5778 | db 0ffh ;272b\r | |
5779 | db 0c3h ;272c\r | |
5780 | db 000h ;272d\r | |
5781 | dw x2769\r | |
5782 | \r | |
5783 | db 0ffh ;2730\r | |
5784 | db 0e9h ;2731\r | |
5785 | db 000h ;2732\r | |
5786 | dw x2788\r | |
5787 | \r | |
5788 | db 0ffh ;2735\r | |
5789 | db 0c9h ;2736\r | |
5790 | db 000h ;2737\r | |
5791 | dw x27c9\r | |
5792 | \r | |
5793 | db 0ffh ;273a\r | |
5794 | db 0cfh ;273b\r | |
5795 | db 000h ;273c\r | |
5796 | dw x280e\r | |
5797 | \r | |
5798 | db 0c7h ;273f\r | |
5799 | db 0c7h ;2740\r | |
5800 | db 000h ;2741\r | |
5801 | dw x27ea\r | |
5802 | \r | |
5803 | db 0c7h ;2744\r | |
5804 | db 0c4h ;2745\r | |
5805 | db 000h ;2746\r | |
5806 | dw x275e\r | |
5807 | \r | |
5808 | db 0f7h ;2749\r | |
5809 | db 010h ;274a\r | |
5810 | db 000h ;274b\r | |
5811 | dw x2775\r | |
5812 | \r | |
5813 | db 0e7h ;274e\r | |
5814 | db 020h ;274f\r | |
5815 | db 000h ;2750\r | |
5816 | dw x2775\r | |
5817 | \r | |
5818 | db 0c7h ;2753\r | |
5819 | db 0c2h ;2754\r | |
5820 | db 000h ;2755\r | |
5821 | dw x2769\r | |
5822 | \r | |
5823 | db 0c7h ;2758\r | |
5824 | db 0c0h ;2759\r | |
5825 | db 000h ;275a\r | |
5826 | dw x27b3\r | |
5827 | \r | |
5828 | db 000h ;275d\r | |
5829 | \r | |
5830 | x275e:\r | |
5831 | ld a,(XBFE8) ;275e\r | |
5832 | and a ;2761\r | |
5833 | jr nz,x2769 ;2762\r | |
5834 | ld a,(TCFLG) ;2764\r | |
5835 | and a ;2767\r | |
5836 | ret nz ;2768\r | |
5837 | \r | |
5838 | x2769:\r | |
5839 | comst ;2769\r | |
5840 | ld l,(iy+001h) ;276d\r | |
5841 | ld h,(iy+002h) ;2770\r | |
5842 | comend\r | |
5843 | scf ;2773\r | |
5844 | ret ;2774\r | |
5845 | \r | |
5846 | x2775:\r | |
5847 | comst ;2775\r | |
5848 | ld c,(iy+001h) ;2779\r | |
5849 | comend\r | |
5850 | ld a,c ;277c\r | |
5851 | rla ;277d\r | |
5852 | sbc a,a ;277e\r | |
5853 | ld b,a ;277f\r | |
5854 | ld hl,(REG.PC) ;2780\r | |
5855 | add hl,bc ;2783\r | |
5856 | inc hl ;2784\r | |
5857 | inc hl ;2785\r | |
5858 | scf ;2786\r | |
5859 | ret ;2787\r | |
5860 | \r | |
5861 | x2788:\r | |
5862 | ld hl,(REG.L) ;2788\r | |
5863 | scf ;278b\r | |
5864 | ret ;278c\r | |
5865 | \r | |
5866 | x278d:\r | |
5867 | ld hl,(reg.ix) ;278d\r | |
5868 | jr l2795h ;2790\r | |
5869 | \r | |
5870 | x2792:\r | |
5871 | ld hl,(reg.iy) ;2792\r | |
5872 | l2795h:\r | |
5873 | comst ;2795\r | |
5874 | ld a,(iy+001h) ;2799\r | |
5875 | comend\r | |
5876 | cp 0e9h ;279c\r | |
5877 | scf ;279e\r | |
5878 | ret z ;279f\r | |
5879 | and a ;27a0\r | |
5880 | ret ;27a1\r | |
5881 | \r | |
5882 | x27a2:\r | |
5883 | comst ;27a2\r | |
5884 | ld a,(iy+001h) ;27a6\r | |
5885 | comend\r | |
5886 | cp 04dh ;27a9\r | |
5887 | jr z,x27c9 ;27ab\r | |
5888 | cp 045h ;27ad\r | |
5889 | jr z,x27c9 ;27af\r | |
5890 | and a ;27b1\r | |
5891 | ret ;27b2\r | |
5892 | \r | |
5893 | x27b3:\r | |
5894 | comst ;27b3\r | |
5895 | ld a,(iy+000h) ;27b7\r | |
5896 | comend\r | |
5897 | ld (XBEDD),a ;27ba\r | |
5898 | ld hl,(REG.F) ;27bd\r | |
5899 | push hl ;27c0\r | |
5900 | pop af ;27c1\r | |
5901 | call XBEDD ;27c2\r | |
5902 | scf ;27c5\r | |
5903 | jr c,x27c9 ;27c6\r | |
5904 | ret ;27c8\r | |
5905 | \r | |
5906 | x27c9:\r | |
5907 | ld a,(XBFE8) ;27c9\r | |
5908 | and a ;27cc\r | |
5909 | jr nz,l27dah ;27cd\r | |
5910 | ld a,(TCFLG) ;27cf\r | |
5911 | and a ;27d2\r | |
5912 | jr z,l27dah ;27d3\r | |
5913 | call l27dah ;27d5\r | |
5914 | pop hl ;27d8\r | |
5915 | ret ;27d9\r | |
5916 | l27dah:\r | |
5917 | ld hl,(REG.SP) ;27da\r | |
5918 | comst ;27dd\r | |
5919 | ld e,(hl) ;27e1\r | |
5920 | inc hl ;27e2\r | |
5921 | ld d,(hl) ;27e3\r | |
5922 | comend\r | |
5923 | ex de,hl ;27e4\r | |
5924 | call sub_1117h ;27e5\r | |
5925 | and a ;27e8\r | |
5926 | ret ;27e9\r | |
5927 | \r | |
5928 | x27ea:\r | |
5929 | ld a,(ddtrst) ;27ea\r | |
5930 | comst ;27ed\r | |
5931 | cp (iy+000h) ;27f1\r | |
5932 | comend\r | |
5933 | ret z ;27f4\r | |
5934 | comst ;27f5\r | |
5935 | ld a,(iy+000h) ;27f9\r | |
5936 | comend\r | |
5937 | and 038h ;27fc\r | |
5938 | ld l,a ;27fe\r | |
5939 | ld h,000h ;27ff\r | |
5940 | ld a,(XBFE8) ;2801\r | |
5941 | and a ;2804\r | |
5942 | jr nz,l280ch ;2805\r | |
5943 | ld a,(TCFLG) ;2807\r | |
5944 | and a ;280a\r | |
5945 | ret nz ;280b\r | |
5946 | l280ch:\r | |
5947 | scf ;280c\r | |
5948 | ret ;280d\r | |
5949 | \r | |
5950 | x280e:\r | |
5951 | and a ;280e\r | |
5952 | ret ;280f\r | |
5953 | \r | |
5954 | CMD.C:\r | |
5955 | ld hl,CMD.C ;2810\r | |
5956 | ld a,001h ;2813\r | |
5957 | jr l281bh ;2815\r | |
5958 | \r | |
5959 | CMD.T:\r | |
5960 | xor a ;2817\r | |
5961 | ld hl,CMD.T ;2818\r | |
5962 | l281bh:\r | |
5963 | ld (CMD_RPT),hl ;281b\r | |
5964 | ld (TCFLG),a ;281e\r | |
5965 | ld a,(de) ;2821\r | |
5966 | sub 'N' ;2822\r | |
5967 | jr nz,l2827h ;2824\r | |
5968 | inc de ;2826\r | |
5969 | l2827h:\r | |
5970 | ld (TCNFLG),a ;2827\r | |
5971 | ld a,(de) ;282a\r | |
5972 | sub 'J' ;282b\r | |
5973 | jr nz,l2830h ;282d\r | |
5974 | inc de ;282f\r | |
5975 | l2830h:\r | |
5976 | ld (TRJFLG),a ;2830\r | |
5977 | call sub_289fh ;2833\r | |
5978 | jr z,l283eh ;2836\r | |
5979 | ld hl,1 ;2838\r | |
5980 | call get_lastarg_def ;283b\r | |
5981 | l283eh:\r | |
5982 | ld (TCCSTR),hl ;283e\r | |
5983 | sub a ;2841\r | |
5984 | ld (XA747),a ;2842\r | |
5985 | l2845h:\r | |
5986 | call sub_26e7h ;2845\r | |
5987 | jr l289ch ;2848\r | |
5988 | l284ah:\r | |
5989 | call sub_0e68h ;284a\r | |
5990 | ld a,(TRJFLG) ;284d\r | |
5991 | and a ;2850\r | |
5992 | jr nz,l2864h ;2851\r | |
5993 | ld iy,(REG.PC) ;2853\r | |
5994 | call sub_28c1h ;2857\r | |
5995 | jr z,l2864h ;285a\r | |
5996 | ld hl,l2726h ;285c\r | |
5997 | call lookup_opc ;285f\r | |
5998 | jr nc,l2845h ;2862\r | |
5999 | l2864h:\r | |
6000 | ld a,(XBFEA) ;2864\r | |
6001 | and a ;2867\r | |
6002 | jr z,l2881h ;2868\r | |
6003 | ld de,(TCCSTR) ;286a\r | |
6004 | call EXPR ;286e\r | |
6005 | ld a,h ;2871\r | |
6006 | or l ;2872\r | |
6007 | add a,0ffh ;2873\r | |
6008 | sbc a,a ;2875\r | |
6009 | ld hl,XBFEA ;2876\r | |
6010 | xor (hl) ;2879\r | |
6011 | bit 1,a ;287a\r | |
6012 | jr z,l288ch ;287c\r | |
6013 | l287eh:\r | |
6014 | jp l102eh ;287e\r | |
6015 | l2881h:\r | |
6016 | ld hl,(TCCSTR) ;2881\r | |
6017 | dec hl ;2884\r | |
6018 | ld (TCCSTR),hl ;2885\r | |
6019 | ld a,h ;2888\r | |
6020 | or l ;2889\r | |
6021 | jr z,l287eh ;288a\r | |
6022 | l288ch:\r | |
6023 | call sub_26e7h ;288c\r | |
6024 | jr nc,l287eh ;288f\r | |
6025 | ld a,(TCNFLG) ;2891\r | |
6026 | ld b,a ;2894\r | |
6027 | ld a,(XA747) ;2895\r | |
6028 | or b ;2898\r | |
6029 | ld (XA747),a ;2899\r | |
6030 | l289ch:\r | |
6031 | jp l1183h ;289c\r | |
6032 | \r | |
6033 | sub_289fh:\r | |
6034 | call SKIPBL ;289f\r | |
6035 | xor a ;28a2\r | |
6036 | ld (XBFEA),a ;28a3\r | |
6037 | ld a,(de) ;28a6\r | |
6038 | cp 'U' ;28a7\r | |
6039 | jr z,l28aeh ;28a9\r | |
6040 | cp 'W' ;28ab\r | |
6041 | ret nz ;28ad\r | |
6042 | \r | |
6043 | l28aeh:\r | |
6044 | inc de ;28ae\r | |
6045 | push af ;28af\r | |
6046 | push de ;28b0\r | |
6047 | call EXPR ;28b1\r | |
6048 | jp c,ERROR ;28b4\r | |
6049 | call assert_eol ;28b7\r | |
6050 | pop hl ;28ba\r | |
6051 | pop af ;28bb\r | |
6052 | ld (XBFEA),a ;28bc\r | |
6053 | sub a ;28bf\r | |
6054 | ret ;28c0\r | |
6055 | \r | |
6056 | sub_28c1h:\r | |
6057 | comst \r | |
6058 | ld a,(iy+000h) \r | |
6059 | ld b,(iy+0001)\r | |
6060 | comend\r | |
6061 | cp 0edh \r | |
6062 | jr z,l28dbh \r | |
6063 | and 0dfh \r | |
6064 | cp 0ddh \r | |
6065 | ret nz \r | |
6066 | ld a,b\r | |
6067 | cp 0e9h \r | |
6068 | ret \r | |
6069 | l28dbh:\r | |
6070 | ld a,b\r | |
6071 | and 0f7h \r | |
6072 | cp 045h \r | |
6073 | ret \r | |
6074 | \r | |
6075 | ?excom:\r | |
6076 | ex (sp),hl ;28e7\r | |
6077 | push af ;28e8\r | |
6078 | push bc ;28e9\r | |
6079 | push de ;28ea\r | |
6080 | ld c,(hl) ;28eb\r | |
6081 | ld b,000h ;28ec\r | |
6082 | inc hl ;28ee\r | |
6083 | ld a,?lcmax\r | |
6084 | sub c\r | |
6085 | ld de,?exeit ;28ef\r | |
6086 | ldir\r | |
6087 | ex de,hl\r | |
6088 | ld (hl),018h\r | |
6089 | inc hl\r | |
6090 | ld (hl),a\r | |
6091 | ex de,hl\r | |
6092 | pop de ;28f7\r | |
6093 | pop bc ;28f8\r | |
6094 | pop af ;28f9\r | |
6095 | ex (sp),hl ;28fa\r | |
6096 | ?exclst:\r | |
6097 | push hl ;28fb\r | |
6098 | ld hl,(ubbr) ;2900\r | |
6099 | \r | |
6100 | if ROMSYS\r | |
6101 | push af ;28fc\r | |
6102 | ld a,(uromen) ;28fd\r | |
6103 | endif\r | |
6104 | jp ?comcod ;2903\r | |
6105 | \r | |
6106 | ;------------------------------------------\r | |
6107 | ; ddtram\r | |
6108 | ;------------------------------------------\r | |
6109 | \r | |
6110 | vartab:\r | |
6111 | dseg\r | |
6112 | ddtram: \r | |
6113 | ;todo:\r | |
4caee1ec | 6114 | ; The following 2 params are changeable by user.\r |
a16ba2b0 L |
6115 | ; Should these moved to top ram?\r |
6116 | ;\r | |
6117 | ddtrst: inidat ;\r | |
6118 | rst DRSTNUM ;rst used by ddtz\r | |
6119 | inidate ;\r | |
6120 | ddtei: inidat ;\r | |
6121 | ei ;ints enabled/disabled while ddtz is running\r | |
6122 | ret ;\r | |
6123 | inidate ;\r | |
6124 | offs.pc:\r | |
6125 | inidat \r | |
6126 | dw TPA \r | |
6127 | inidate\r | |
6128 | offs.@:\r | |
6129 | inidat\r | |
6130 | dw 0 \r | |
6131 | inidate\r | |
6132 | CMD_ERR:\r | |
6133 | inidat\r | |
6134 | dw 0 \r | |
6135 | inidate\r | |
6136 | CMD_RPT:\r | |
6137 | inidat\r | |
6138 | dw DDTZML \r | |
6139 | inidate\r | |
6140 | ci.buf:\r | |
6141 | inidat\r | |
6142 | db 80 \r | |
6143 | rept 83\r | |
6144 | db 0\r | |
6145 | endm\r | |
6146 | inidate\r | |
6147 | CON.COL:\r | |
6148 | inidat\r | |
6149 | db 0 \r | |
6150 | inidate\r | |
6151 | XA747:\r | |
6152 | inidat\r | |
6153 | db 0 \r | |
6154 | inidate\r | |
6155 | bp_tab:\r | |
6156 | inidat\r | |
6157 | rept BP_CNT \r | |
6158 | db 0,0\r | |
6159 | dw 0,0,0\r | |
6160 | endm\r | |
6161 | BP_SIZE equ 8\r | |
6162 | inidate\r | |
6163 | sexp1:\r | |
6164 | inidat\r | |
6165 | dw sexpbuf \r | |
6166 | inidate\r | |
6167 | sexp2:\r | |
6168 | inidat\r | |
6169 | dw sexpbuf \r | |
6170 | inidate\r | |
6171 | sexpbuf:\r | |
6172 | inidat\r | |
6173 | rept 128 \r | |
6174 | db 0\r | |
6175 | endm\r | |
6176 | inidate\r | |
6177 | sexpbufe:\r | |
6178 | \r | |
6179 | msg.Y:\r | |
6180 | inidat\r | |
6181 | dc 'Y0' \r | |
6182 | inidate\r | |
6183 | reg.Y:\r | |
6184 | inidat\r | |
6185 | rept 10 \r | |
6186 | dw 0\r | |
6187 | endm\r | |
6188 | inidate\r | |
6189 | lst.S:\r | |
6190 | inidat\r | |
6191 | dw 0 \r | |
6192 | inidate\r | |
6193 | lst.IP:\r | |
6194 | inidat\r | |
6195 | dw 0 \r | |
6196 | inidate\r | |
6197 | lst.OP:\r | |
6198 | inidat\r | |
6199 | dw 0 \r | |
6200 | inidate\r | |
6201 | lst.OD:\r | |
6202 | inidat\r | |
6203 | db 0\r | |
6204 | inidate\r | |
6205 | lst.Qj:\r | |
6206 | inidat\r | |
6207 | db 0\r | |
6208 | inidate\r | |
6209 | lst.D:\r | |
6210 | inidat\r | |
6211 | dw 0 \r | |
6212 | inidate\r | |
6213 | HILOD:\r | |
6214 | inidat\r | |
6215 | dw 0 \r | |
6216 | inidate\r | |
6217 | MAXLOD:\r | |
6218 | inidat\r | |
6219 | dw 0 \r | |
6220 | inidate\r | |
6221 | XB068:\r | |
6222 | inidat\r | |
6223 | dw 0 \r | |
6224 | inidate\r | |
6225 | lst.A:\r | |
6226 | inidat\r | |
6227 | dw 0 \r | |
6228 | inidate\r | |
6229 | XB06C:\r | |
6230 | inidat\r | |
6231 | dw 0 \r | |
6232 | inidate\r | |
6233 | pfx.IXY:\r | |
6234 | inidat\r | |
6235 | db 000h \r | |
6236 | inidate\r | |
6237 | is.pfx.IXY:\r | |
6238 | inidat\r | |
6239 | db 000h \r | |
6240 | inidate\r | |
6241 | lst.L:\r | |
6242 | inidat\r | |
6243 | dw 0 \r | |
6244 | inidate\r | |
6245 | XBE01:\r | |
6246 | inidat\r | |
6247 | dw 0 \r | |
6248 | inidate\r | |
6249 | XBE03:\r | |
6250 | inidat\r | |
6251 | db 000h \r | |
6252 | inidate\r | |
6253 | XBEDD:\r | |
6254 | inidat\r | |
6255 | ret ;ret cc\r | |
6256 | and a \r | |
6257 | pop hl \r | |
6258 | inc hl \r | |
6259 | jp (hl) \r | |
6260 | inidate\r | |
6261 | XBFE8:\r | |
6262 | inidat\r | |
6263 | db 0 \r | |
6264 | inidate\r | |
6265 | TCFLG:\r | |
6266 | inidat\r | |
6267 | db 0 \r | |
6268 | inidate\r | |
6269 | XBFEA:\r | |
6270 | inidat\r | |
6271 | db 0 \r | |
6272 | inidate\r | |
6273 | TCCSTR:\r | |
6274 | inidat\r | |
6275 | dw 0 \r | |
6276 | inidate\r | |
6277 | TCNFLG:\r | |
6278 | inidat\r | |
6279 | db 0 \r | |
6280 | inidate\r | |
6281 | TRJFLG:\r | |
6282 | inidat\r | |
6283 | db 0 \r | |
6284 | inidate\r | |
6285 | wstrtflg:\r | |
6286 | inidat\r | |
6287 | db 1\r | |
6288 | inidate\r | |
6289 | \r | |
6290 | cseg\r | |
6291 | vartabe:\r | |
6292 | \r | |
6293 | ;------------------------------------------\r | |
6294 | \r | |
6295 | .phase sysram_start+stacksize\r | |
6296 | $stack:\r | |
6297 | $stcka equ $ - stacksize\r | |
6298 | \r | |
6299 | curphse defl $\r | |
6300 | .dephase\r | |
6301 | sysramc:\r | |
6302 | .phase curphse\r | |
6303 | topcodbeg:\r | |
6304 | \r | |
6305 | reg.l2: db 0 ; 0fe50h\r | |
6306 | reg.h2: db 0 ; 0fe51h\r | |
6307 | reg.e2: db 0 ; 0fe52h\r | |
6308 | reg.d2: db 0 ; 0fe53h\r | |
6309 | reg.c2: db 0 ; 0fe54h\r | |
6310 | reg.b2: db 0 ; 0fe55h\r | |
6311 | reg.f2: db 0 ; 0fe56h\r | |
6312 | reg.a2: db 0 ; 0fe57h\r | |
6313 | db 0\r | |
6314 | reg.i: db high ivtab\r | |
6315 | reg.iy: dw 0 ; 0fe5ah\r | |
6316 | reg.ix: dw 0 ; 0fe5ch\r | |
6317 | reg.e: db 0 ; 0fe5eh\r | |
6318 | reg.d: db 0 ; 0fe5fh\r | |
6319 | reg.c: db 0 ; 0fe60h\r | |
6320 | reg.b: db 0 ; 0fe61h\r | |
6321 | if ROMSYS\r | |
6322 | udcntl: db CWAITIO ; 0fe62h (mem-, io- wait)\r | |
6323 | uromen: db ROM_DIS ; 0fe63h\r | |
6324 | endif\r | |
6325 | ubbr: db 0 ; 0fe64h\r | |
6326 | ucbar: db USR$CBAR ; 0fe65h\r | |
6327 | reg.f: db 0 ; 0fe66h\r | |
6328 | reg.a: db 0 ; 0fe67h\r | |
6329 | reg.l: db 0 ; 0fe68h\r | |
6330 | reg.h: db 0 ; 0fe69h\r | |
6331 | reg.sp: dw TOPRAM ; 0fe6ah\r | |
6332 | \r | |
6333 | $go:\r | |
6334 | if ROMSYS\r | |
6335 | out (000h),a ;064c fe6c\r | |
6336 | out0 (dcntl),l ;064e\r | |
6337 | pop hl ;0651\r | |
6338 | endif\r | |
6339 | out0 (cbar),h ;0652\r | |
6340 | out0 (bbr),l ;0655\r | |
6341 | pop af ;0658\r | |
6342 | pop hl ;0659\r | |
6343 | ld sp,(reg.sp) ;065a\r | |
6344 | reg.iff:\r | |
6345 | ei ;065e\r | |
6346 | db 0C3h ;jp TPA ;065f feff ($+1): reg.pc\r | |
6347 | reg.pc:\r | |
6348 | dw TPA\r | |
6349 | \r | |
6350 | bpent:\r | |
6351 | ld (reg.l),hl ;0662 fe82: bpent:\r | |
6352 | pop hl ;0665\r | |
6353 | dec hl ;0666\r | |
6354 | ld (reg.pc),hl ;0667\r | |
6355 | ld (reg.sp),sp ;066a\r | |
6356 | ld sp,reg.l ;066e\r | |
6357 | push af ;0671\r | |
6358 | in0 h,(cbar) ;0672\r | |
6359 | in0 l,(bbr) ;0675\r | |
6360 | push hl ;0678\r | |
6361 | ld a,SYS$CBAR ;0679\r | |
6362 | out0 (cbar),a ;067b\r | |
6363 | \r | |
6364 | if ROMSYS\r | |
6365 | in0 l,(dcntl) ;067e\r | |
6366 | ld a,CWAITROM+CWAITIO ;0681\r | |
6367 | out0 (dcntl),a ;0683\r | |
6368 | ld a,($crom) ;0686\r | |
6369 | cp c$rom ;0689\r | |
6370 | ld a,ROM_EN ;068b\r | |
6371 | out (000h),a ;068d\r | |
6372 | endif\r | |
6373 | \r | |
6374 | jp bpddtz ;068f\r | |
6375 | \r | |
6376 | ?comcod:\r | |
6377 | if ROMSYS\r | |
6378 | out (000h),a ;0692 feb2\r | |
6379 | pop af ;069a\r | |
6380 | endif\r | |
6381 | \r | |
6382 | out0 (cbar),h ;0694\r | |
6383 | out0 (bbr),l ;0697\r | |
6384 | pop hl ;069b\r | |
6385 | ?exeit:\r | |
6386 | ds ?lcmax+2\r | |
6387 | push af ;069f\r | |
6388 | ld a,SYS$CBAR ;06a0\r | |
6389 | out0 (cbar),a ;06a2\r | |
6390 | \r | |
6391 | if ROMSYS\r | |
6392 | ld a,ROM_EN ;06a5\r | |
6393 | out (000h),a ;06a7\r | |
6394 | endif\r | |
6395 | \r | |
6396 | pop af ;06a9\r | |
6397 | ret ;06aa\r | |
6398 | \r | |
6399 | topcodend:\r | |
6400 | curph defl $\r | |
6401 | .dephase\r | |
6402 | sysrame:\r | |
6403 | \r | |
6404 | end\r | |
6405 | \r |