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