OpenCores
URL https://opencores.org/ocsvn/tv80/tv80/trunk

Subversion Repositories tv80

[/] [tv80/] [branches/] [s80_env_devel/] [tests/] [tvs80/] [tvs80tst.asm] - Blame information for rev 104

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 8 ghutchis
; bjp   modified to assemble on as80.
2
; minor mods to account for changes in interrupt structure  and I/O
3
; all such are flagged with my initials.....
4
;
5
; The origional code used operators <   and  >  on symbols to extract the
6
; lower and higher bytes respectively.   It appears that as80 has no equivaltent.
7
; I have hand coded such ---- hopefully correctly.
8
; This is only a significant issue with such constructs as 
9
; My solution forces the stack to remain in its present location.
10
;
11
; WARNING   If you must move the stack  --   check comments and fix code for my kludges
12
;
13
;z80 simulator test routine
14
;total error count is left in a at end of test routine
15
 
16
; gth  modified to work in tv80 simulation environment
17
;      moved data segment from 7000 to 8000
18
;      replaced constants with stack_end_hi and stack_end_lo
19
 
20
                code
21
                org     #0000
22
;
23
rst_0000:       jp      rst_0000_1
24
;
25
                org     #0008
26
;
27
rst_0008:       ld      a,2
28
                ret
29
;
30
                org     #0010
31
;
32
rst_0010:       ld      a,3
33
                ret
34
;
35
                org     #0018
36
;
37
rst_0018:       ld      a,4
38
                ret
39
;
40
                org     #0020
41
;
42
rst_0020:       ld      a,5
43
                ret
44
;
45
                org     #0028
46
;
47
rst_0028:       ld      a,6
48
                ret
49
;
50
                org     #0030
51
;
52
rst_0030:       ld      a,7
53
                ret
54
;
55
                org     #0038
56
;
57
rst_0038:       ld      a,8
58
                ret
59
;
60
                code
61
;
62
 
63
fail:           db      'failed'
64
pass:           db      'passed'
65
message_addr:   equ     #be58
66
in_port:        equ     #ff
67
out_port:       equ     #10
68
;
69
data_55:        equ     #55
70
data_7f:        equ     #7f
71
data_80:        equ     #80
72
data_aa:        equ     #aa
73
data_ff:        equ     #ff
74
;
75
data_1234:      equ     #1234
76
data_55aa:      equ     #55aa
77
data_7fff:      equ     #7fff
78
data_8000:      equ     #8000
79
data_aa55:      equ     #aa55
80
data_ffff:      equ     #ffff
81
 
82
stack_end_hi:   equ     #81
83
stack_end_lo:   equ     #80
84
 
85
ctl_port:       equ     #80
86
print_port:     equ     #81
87
;
88
;inc_error_cnt  macro        ;bjp   change for initial test to halt on error
89
;               ld      hl,error_cnt
90
;               inc     (hl)
91
;               endm
92 11 ghutchis
;inc_error_cnt  macro        ; gth  replaced with fail_msg ###
93
;                ld      a, 2
94
;                out     (ctl_port), a
95
;               halt
96
;               endm
97 8 ghutchis
 
98
 
99
passed          macro
100
                ld      a, 1
101
                out     (ctl_port), a
102 17 ghutchis
                halt
103 8 ghutchis
                ;push   bc
104
                ;ld     bc,(pass)
105
                ;ld     (message_addr),bc
106
                ;ld     bc,(pass+2)
107
                ;ld     (message_addr+2),bc
108
                ;ld     bc,(pass+4)
109
                ;ld     (message_addr+4),bc
110
                ;pop    bc
111
                endm
112
;
113
failed          macro
114
                ld      a, 2
115
                out     (ctl_port), a
116
                halt
117
                ;push   bc
118
                ;ld     bc,(fail)
119
                ;ld     (message_addr),bc
120
                ;ld     bc,(fail+2)
121
                ;ld     (message_addr+2),bc
122
                ;ld     bc,(fail+4)
123
                ;ld     (message_addr+4),bc
124
                ;pop    bc
125
                endm
126
;
127
;
128
 
129
        ;; subroutine to print a message
130
        ;; called from within the "print" macro
131
        ;; expects address to be printed in hl
132
        ;; preserves all other registers
133
print_sub:
134
        push    bc
135
        ld      b, a
136
 
137
print_sub_loop:
138
        ld      a, (hl)
139
        cp      #0
140
        jp      z, print_sub_exit
141
        out     (print_port), a
142
        inc     hl
143
        jp      print_sub_loop
144
 
145
print_sub_exit:
146
        ld      a, b
147
        pop     bc
148
        ret
149
 
150
        ;; macro to print out a message
151
        ;; calls print_sub to do grunt work and minimize code impact of
152
        ;; strings
153
print   macro   message
154
 
155
        push    hl              ; preserve existing regs
156
        ld      hl, msg\?
157
        call    print_sub
158
        pop     hl
159
        jp      exit\?
160
 
161
msg\?   db      message
162
        db      #0a
163
        db      #00
164
 
165
exit\?:
166
 
167
        endm
168
 
169
        ;; print a hex number between 0-255, stored in the A register
170
print_number:
171
        push    bc
172
        ld      b, a            ; store number to be printed in b
173
 
174
        and     #f0
175
        sra     a
176
        sra     a
177
        sra     a
178
        sra     a
179
        cp      a, 10
180
        jp      p, alpha_0
181
        add     48              ; ordinal value of '0'
182
        out     (print_port), a
183
        jp      second_digit
184
alpha_0:
185 10 ghutchis
        add     55              ; 'A' - 10
186 8 ghutchis
        out     (print_port), a
187
 
188
second_digit:
189
        ld      a, b
190
        and     #0f
191
 
192
        cp      a, 10
193
        jp      p, alpha_1
194
        add     48
195
        out     (print_port), a
196
        jp      print_number_exit
197
 
198
alpha_1:
199 10 ghutchis
        add     55              ; 'A' - 10
200 8 ghutchis
        out     (print_port), a
201
 
202
print_number_exit:
203
        pop     bc
204
        ret
205
 
206
fail_text db   "Test failed at checkpoint #"
207
        db      #00
208
 
209
fail_routine:
210
        ld      hl, fail_text
211
        call    print_sub       ; print out boilerplate text
212 10 ghutchis
        ld      a, b
213 8 ghutchis
 
214 10 ghutchis
        call    print_number    ; print out error number
215 8 ghutchis
 
216
        ld      a, #0a          ; print carriage return
217
        out     (print_port), a
218
        failed
219
 
220
        ;; macro to print out failure checkpoint number
221
fail_msg macro number           ; fail with checkpoint number
222 10 ghutchis
        ld      b, number
223 8 ghutchis
        jp      fail_routine
224
        endm
225
 
226
print_ns macro message          ; print w/o using subroutine
227
 
228
        push    hl              ; preserve existing regs
229
        ld      hl, msg\?
230
 
231
        push    bc
232
        ld      b, a
233
loop\?:
234
        ld      a, (hl)
235
        cp      #0
236
        jp      z, exit\?
237
        out     (print_port), a
238
        inc     hl
239
        jp      loop\?
240
 
241
        pop     hl
242
        jp      exit\?
243
 
244
msg\?   db      message
245
        db      #0a
246
        db      #00
247
 
248
exit\?:
249
        ld      a, b
250
        pop     bc
251
        pop     hl
252
 
253
        endm
254
 
255
start:
256
                print "Starting test"
257
                xor     a
258
                ld      (pass_count),a
259
                ld      hl,error_cnt
260
                ld      (hl),a                  ;clear error count
261
nop_1:          nop
262
                nop
263
                print "Starting ld tests"
264
ld_167:         ld      a,data_55
265
                cp      data_55
266
                jr      z,ld_1
267
                fail_msg 167
268
 
269
ld_1:           ld      b,data_7f
270
                ld      a,data_7f
271
                cp      b
272
                jr      z,ld_2
273
                fail_msg 1
274
ld_2:           ld      c,data_80
275
                ld      a,data_80
276
                cp      c
277
                jr      z,ld_3
278
                fail_msg 2
279
ld_3:           ld      d,data_aa
280
                ld      a,data_aa
281
                cp      d
282
                jr      z,ld_4
283
                fail_msg 3
284
ld_4:           ld      e,data_55
285
                ld      a,data_55
286
                cp      e
287
                jr      z,ld_5
288
                fail_msg 4
289
ld_5:           ld      h,data_7f
290
                ld      a,data_7f
291
                cp      h
292
                jr      z,ld_6
293
                fail_msg 5
294
ld_6:           ld      l,data_80
295
                ld      a,data_80
296
                cp      l
297
                jr      z,ld_7
298
                fail_msg 6
299
ld_7:           ld      a,data_55
300
                ld      b,a
301
                cp      b
302
                jr      z,ld_8
303
                fail_msg 7
304
ld_8:           ld      c,b
305
                cp      c
306
                jr      z,ld_9
307
                fail_msg 8
308
ld_9:           ld      d,c
309
                cp      d
310
                jr      z,ld_10
311
                fail_msg 9
312
ld_10:          ld      e,d
313
                cp      e
314
                jr      z,ld_11
315
                fail_msg 10
316
ld_11:          ld      h,e
317
                cp      h
318
                jr      z,ld_12
319
                fail_msg 11
320
ld_12:          ld      l,h
321
                cp      l
322
                jr      z,ld_13
323
                fail_msg 12
324
ld_13:          ld      l,data_80
325
                ld      a,l
326
                cp      l
327
                jr      z,ld_14
328
                fail_msg 13
329
ld_14:          ld      h,l
330
                cp      h
331
                jr      z,ld_15
332
                fail_msg 14
333
ld_15:          ld      e,h
334
                cp      e
335
                jr      z,ld_16
336
                fail_msg 15
337
ld_16:          ld      d,e
338
                cp      d
339
                jr      z,ld_17
340
                fail_msg 16
341
ld_17:          ld      c,d
342
                cp      c
343
                jr      z,ld_18
344
                fail_msg 17
345
ld_18:          ld      b,c
346
                cp      b
347
                jr      z,ld_19
348
                fail_msg 18
349
ld_19:          ld      hl,var1
350
                ld      a,(hl)
351
                cp      data_ff
352
                jr      z,ld_20
353
                fail_msg 19
354
ld_20:          ld      hl,var2
355
                ld      a,data_55
356
                ld      b,(hl)
357
                cp      b
358
                jr      z,ld_21
359
                fail_msg 20
360
ld_21:          ld      hl,var1
361
                ld      c,(hl)
362
                ld      a,(hl)
363
                cp      c
364
                jr      z,ld_22
365
                fail_msg 21
366
ld_22:          ld      hl,var2
367
                ld      d,(hl)
368
                ld      a,(hl)
369
                cp      d
370
                jr      z,ld_23
371
                fail_msg 22
372
ld_23:          ld      hl,var1
373
                ld      e,(hl)
374
                ld      a,(hl)
375
                cp      e
376
                jr      z,ld_24
377
                fail_msg 23
378
ld_24:          ld      hl,var2
379
                ld      a,(hl)
380
                ld      h,(hl)
381
                cp      h
382
                jr      z,ld_25
383
                fail_msg 24
384
ld_25:          ld      hl,var1
385
                ld      a,(hl)
386
                ld      l,(hl)
387
                cp      l
388
                jr      z,ld_26
389
                fail_msg 25
390
ld_26:          ld      ix,var3
391
                ld      a,(ix-2)
392
                cp      data_ff
393
                jr      z,ld_27
394
                fail_msg 26
395
ld_27:          ld      a,(ix+2)
396
                cp      data_7f
397
                jr      z,ld_28
398
                fail_msg 27
399
ld_28:          ld      a,(ix-1)
400
                ld      b,(ix-1)
401
                cp      b
402
                jr      z,ld_29
403
                fail_msg 28
404
ld_29:          cp      data_55
405
                jr      z,ld_30
406
                fail_msg 29
407
ld_30:          ld      a,(ix+1)
408
                ld      c,(ix+1)
409
                cp      c
410
                jr      z,ld_31
411
                fail_msg 30
412
ld_31:          cp      data_aa
413
                jr      z,ld_32
414
                fail_msg 31
415
ld_32:          ld      d,(ix-2)
416
                ld      a,(ix-2)
417
                cp      d
418
                jr      z,ld_33
419
                fail_msg 32
420
ld_33:          cp      data_ff
421
                jr      z,ld_34
422
                fail_msg 33
423
ld_34:          ld      e,(ix+2)
424
                ld      a,(ix+2)
425
                cp      e
426
                jr      z,ld_35
427
                fail_msg 34
428
ld_35:          cp      data_7f
429
                jr      z,ld_36
430
                fail_msg 35
431
ld_36:          ld      h,(ix+0)
432
                ld      a,(ix+0)
433
                cp      h
434
                jr      z,ld_37
435
                fail_msg 36
436
ld_37:          cp      data_80
437
                jr      z,ld_38
438
                fail_msg 37
439
ld_38:          ld      l,(ix-1)
440
                ld      a,(ix-1)
441
                cp      l
442
                jr      z,ld_39
443
                fail_msg 38
444
ld_39:          cp      data_55
445
                jr      z,ld_40
446
                fail_msg 39
447
ld_40:          ld      iy,var3
448
                ld      a,(iy-2)
449
                cp      data_ff
450
                jr      z,ld_41
451
                fail_msg 40
452
ld_41:          ld      a,(iy+2)
453
                cp      data_7f
454
                jr      z,ld_42
455
                fail_msg 41
456
ld_42:          ld      b,(iy-1)
457
                ld      a,(iy-1)
458
                cp      b
459
                jr      z,ld_43
460
                fail_msg 42
461
ld_43:          cp      data_55
462
                jr      z,ld_44
463
                fail_msg 43
464
ld_44:          ld      c,(iy+1)
465
                ld      a,(iy+1)
466
                cp      c
467
                jr      z,ld_45
468
                fail_msg 44
469
ld_45:          cp      data_aa
470
                jr      z,ld_46
471
                fail_msg 45
472
ld_46:          ld      d,(iy-2)
473
                ld      a,(iy-2)
474
                cp      d
475
                jr      z,ld_47
476
                fail_msg 46
477
ld_47:          cp      data_ff
478
                jr      z,ld_48
479
                fail_msg 47
480
ld_48:          ld      e,(iy+2)
481
                ld      a,(iy+2)
482
                cp      e
483
                jr      z,ld_49
484
                fail_msg 48
485
ld_49:          cp      data_7f
486
                jr      z,ld_50
487
                fail_msg 49
488 17 ghutchis
ld_50:
489 10 ghutchis
                ld      h,(iy+0)
490 8 ghutchis
                ld      a,(iy+0)
491
                cp      h
492
                jr      z,ld_51
493
                fail_msg 50
494
ld_51:          cp      data_80
495
                jr      z,ld_52
496
                fail_msg 51
497
ld_52:          ld      l,(iy-2)
498
                ld      a,(iy-2)
499
                cp      l
500
                jr      z,ld_53
501
                fail_msg 52
502
ld_53:          cp      data_ff
503
                jr      z,ld_54
504
                fail_msg 53
505
ld_54:          ld      hl,t_var1
506
                ld      a,data_aa+1
507
                ld      (hl),a
508
                ld      b,(hl)
509
                cp      b
510
                jr      z,ld_55
511
                fail_msg 54
512
ld_55:          cp      data_aa+1
513
                jr      z,ld_56
514
                fail_msg 55
515
ld_56:          ld      b,data_80+1
516
                ld      (hl),b
517
                ld      a,(hl)
518
                cp      b
519
                jr      z,ld_57
520
                fail_msg 56
521
ld_57:          cp      data_80+1
522
                jr      z,ld_58
523
                fail_msg 57
524
ld_58:          ld      c,data_55-1
525
                ld      (hl),c
526
                ld      a,(hl)
527
                cp      c
528
                jr      z,ld_59
529
                fail_msg 58
530
ld_59:          cp      data_55-1
531
                jr      z,ld_60
532
                fail_msg 59
533
ld_60:          ld      d,data_ff-1
534
                ld      (hl),d
535
                ld      a,(hl)
536
                cp      d
537
                jr      z,ld_61
538
                fail_msg 60
539
ld_61:          cp      data_ff-1
540
                jr      z,ld_62
541
                fail_msg 61
542
ld_62:          ld      e,data_55+1
543
                ld      (hl),e
544
                ld      a,(hl)
545
                cp      e
546
                jr      z,ld_63
547
                fail_msg 62
548
ld_63:          cp      data_55+1
549
                jr      z,ld_64
550
                fail_msg 63
551
ld_64:          ld      (hl),h
552
                ld      a,(hl)
553
                cp      h
554
                jr      z,ld_65
555
                fail_msg 64
556
ld_65:          cp      #80             ;bjp  guess  >t_var1
557
                jr      z,ld_66
558
                fail_msg 65
559
ld_66:          ld      (hl),l
560
                ld      a,(hl)
561
                cp      l
562
                jr      z,ld_67
563
                fail_msg 66
564
ld_67:          cp      a, #00          ;bjp  guess 
565
                jr      z,ld_68
566
                fail_msg 67
567
ld_68:          ld      ix,t_var3
568
                ld      a,data_55
569
                ld      (ix-2),a
570
                ld      a,0
571
                ld      a,(ix-2)
572
                cp      data_55
573
                jr      z,ld_69
574
                fail_msg 68
575
ld_69:          ld      a,data_80
576
                ld      (ix+2),a
577
                ld      a,0
578
                ld      a,(ix+2)
579
                cp      data_80
580
                jr      z,ld_70
581
                fail_msg 69
582
ld_70:          ld      b,data_7f
583
                ld      (ix-1),b
584
                ld      a,(ix-1)
585
                cp      b
586
                jr      z,ld_71
587
                fail_msg 70
588
ld_71:          cp      data_7f
589
                jr      z,ld_72
590
                fail_msg 71
591
ld_72:          ld      c,data_aa
592
                ld      (ix+1),c
593
                ld      a,(ix+1)
594
                cp      c
595
                jr      z,ld_73
596
                fail_msg 72
597
ld_73:          cp      data_aa
598
                jr      z,ld_74
599
                fail_msg 73
600
ld_74:          ld      d,data_80
601
                ld      (ix+0),d
602
                ld      a,(ix+0)
603
                cp      d
604
                jr      z,ld_75
605
                fail_msg 74
606
ld_75:          cp      data_80
607
                jr      z,ld_76
608
                fail_msg 75
609
ld_76:          ld      e,data_55+2
610
                ld      (ix-2),e
611
                ld      a,(ix-2)
612
                cp      e
613
                jr      z,ld_77
614
                fail_msg 76
615
ld_77:          cp      data_55+2
616
                jr      z,ld_78
617
                fail_msg 77
618
ld_78:          ld      h,data_aa-2
619
                ld      (ix+2),h
620
                ld      a,(ix+2)
621
                cp      h
622
                jr      z,ld_79
623
                fail_msg 78
624
ld_79:          cp      data_aa-2
625
                jr      z,ld_80
626
                fail_msg 79
627
ld_80:          ld      l,data_aa+2
628
                ld      (ix-1),l
629
                ld      a,(ix-1)
630
                cp      l
631
                jr      z,ld_81
632
                fail_msg 80
633
ld_81:          cp      data_aa+2
634
                jr      z,ld_82
635
                fail_msg 81
636
ld_82:          ld      iy,t_var3
637
                ld      a,data_ff
638
                ld      (iy-2),a
639
                ld      a,0
640
                ld      a,(iy-2)
641
                cp      data_ff
642
                jr      z,ld_83
643
                fail_msg 82
644
ld_83:          ld      a,data_7f
645
                ld      (iy+2),a
646
                ld      a,0
647
                ld      a,(iy+2)
648
                cp      data_7f
649
                jr      z,ld_84
650
                fail_msg 83
651
ld_84:          ld      b,data_55
652
                ld      (iy-1),b
653
                ld      a,(iy-1)
654
                cp      b
655
                jr      z,ld_85
656
                fail_msg 84
657
ld_85:          cp      data_55
658
                jr      z,ld_86
659
                fail_msg 85
660
ld_86:          ld      c,data_aa
661
                ld      (iy+1),c
662
                ld      a,(iy+1)
663
                cp      c
664
                jr      z,ld_87
665
                fail_msg 86
666
ld_87:          cp      data_aa
667
                jr      z,ld_88
668
                fail_msg 87
669
ld_88:          ld      d,data_80
670
                ld      (iy+0),d
671
                ld      a,(iy+0)
672
                cp      d
673
                jr      z,ld_89
674
                fail_msg 88
675
ld_89:          cp      data_80
676
                jr      z,ld_90
677
                fail_msg 89
678
ld_90:          ld      e,data_ff-2
679
                ld      (iy-2),e
680
                ld      a,(iy-2)
681
                cp      e
682
                jr      z,ld_91
683
                fail_msg 90
684
ld_91:          cp      data_ff-2
685
                jr      z,ld_92
686
                fail_msg 91
687
ld_92:          ld      h,data_7f-3
688
                ld      (iy+2),h
689
                ld      a,(iy+2)
690
                cp      h
691
                jr      z,ld_93
692
                fail_msg 92
693
ld_93:          cp      data_7f-3
694
                jr      z,ld_94
695
                fail_msg 93
696
ld_94:          ld      l,data_55-5
697
                ld      (iy-1),l
698
                ld      a,(iy-1)
699
                cp      l
700
                jr      z,ld_95
701
                fail_msg 94
702
ld_95:          cp      data_55-5
703
                jr      z,ld_96
704
                fail_msg 95
705
ld_96:          ld      hl,t_var1
706
                ld      (hl),data_80+10
707
                ld      a,(hl)
708
                cp      data_80+10
709
                jr      z,ld_97
710
                fail_msg 96
711
ld_97:          ld      ix,t_var3
712
                ld      (ix-2),data_55-10
713
                ld      a,(ix-2)
714
                cp      data_55-10
715
                jr      z,ld_98
716
                fail_msg 97
717
ld_98:          ld      (ix+2),data_55+10
718
                ld      a,(ix+2)
719
                cp      data_55+10
720
                jr      z,ld_99
721
                fail_msg 98
722
ld_99:          ld      iy,t_var2
723
                ld      (iy-1),data_80+17
724
                ld      a,(iy-1)
725
                cp      data_80+17
726
                jr      z,ld_100
727
                fail_msg 99
728 17 ghutchis
ld_100:
729 10 ghutchis
                ld      (iy+1),data_80-17
730 8 ghutchis
                ld      a,(iy+1)
731
                cp      data_80-17
732
                jr      z,ld_101
733
                fail_msg 100
734
ld_101:         ld      hl,t_var5
735
                ld      bc,t_var5
736
                ld      (hl),data_aa-10
737
                ld      a,(bc)
738
                cp      data_aa-10
739
                jr      z,ld_102
740
                fail_msg 101
741
ld_102:         ld      hl,t_var3
742
                ld      de,t_var3
743
                ld      (hl),data_aa+10
744
                ld      a,(de)
745
                cp      data_aa+10
746
                jr      z,ld_103
747
                fail_msg 102
748
ld_103:         ld      hl,t_var2
749
                ld      (hl),data_7f-25
750
                ld      a,(t_var2)
751
                cp      data_7f-25
752
                jr      z,ld_104
753
                fail_msg 103
754
ld_104:         ld      hl,t_var4
755
                ld      bc,t_var4
756
                ld      a,data_55-20
757
                ld      (bc),a
758
                ld      b,(hl)
759
                cp      b
760
                jr      z,ld_105
761
                fail_msg 104
762
ld_105:         ld      a,b
763
                cp      data_55-20
764
                jr      z,ld_106
765
                fail_msg 105
766
ld_106:         ld      hl,t_var5
767
                ld      de,t_var5
768
                ld      a,data_55+20
769
                ld      (de),a
770
                ld      c,(hl)
771
                cp      c
772
                jr      z,ld_107
773
                fail_msg 106
774
ld_107:         ld      a,c
775
                cp      data_55+20
776
                jr      z,ld_108
777
                fail_msg 107
778
ld_108:         ld      hl,t_var4
779
                ld      a,data_ff-24
780
                ld      (t_var4),a
781
                ld      e,(hl)
782
                cp      e
783
                jr      z,ld_109
784
                fail_msg 108
785
ld_109:         ld      a,e
786
                cp      data_ff-24
787
                jr      z,ld_110
788
                fail_msg 109
789 10 ghutchis
 
790
; commented out ld_110 so test can continue
791
; may depend on side-effect in original Z80
792
ld_110:         ld      a, data_55
793
                jp      ld_125
794
;ld_110:                ld      a,data_55
795
;               ld      i,a
796
;               ld      a,0
797
;               ld      a,i
798
;               jr      nz,ld_111
799
;               fail_msg 110
800
;ld_111:                jp      p,ld_112
801
;               fail_msg 111
802
;ld_112:                cp      data_55
803
;               jr      z,ld_113
804
;               fail_msg 112
805
;ld_113:                ld      a,data_80
806
;               ld      i,a
807
;               ld      a,0
808
;               ld      a,i
809
;               jr      nz,ld_114
810
;               fail_msg 113
811
;ld_114:                jp      m,ld_115
812
;               fail_msg 114
813
;ld_115:                cp      data_80
814
;               jr      z,ld_116
815
;               fail_msg 115
816
;ld_116:                ld      a,0
817
;               ld      i,a
818
;               ld      a,data_55
819
;               ld      a,i
820
;               jr      z,ld_125
821
;               fail_msg 116
822 8 ghutchis
;   refresh register not implemented
823
;   test for ie ?
824
;ld_117:                ld      a,data_55
825
;               ld      r,a
826
;               ld      a,0
827
;               ld      a,r
828
;               jp      p,ld_118
829
;               inc_error_cnt
830
;ld_118:                jr      nz,ld_119
831
;               inc_error_cnt
832
;ld_119:                ld      a,data_ff
833
;               ld      r,a
834
;               ld      a,0
835
;               ld      a,r
836
;               jp      m,ld_120
837
;               inc_error_cnt
838
;ld_120:                ld      a,4                     ;totally sequence dependent
839
;               ld      r,a
840
;               ld      a,data_55
841
;               ld      a,r
842
;               jr      z,ld_121
843
;               inc_error_cnt
844
;ld_121:                ei                              ;set iff2
845
;               ld      a,i
846
;               jp      pe,ld_122               ;iff2 was set
847
;               inc_error_cnt
848
;ld_122:                di                              ;clear iff2
849
;               ld      a,i
850
;               jp      po,ld_123               ;iff2 was cleared
851
;               inc_error_cnt
852
;ld_123:                ei                              ;set iff2
853
;               ld      a,r
854
;               jp      pe,ld_124               ;iff2 was set
855
;               inc_error_cnt
856
;ld_124:                di                              ;clear iff2
857
;               ld      a,r
858
;               jp      po,ld_125               ;iff2 was cleared
859
;               inc_error_cnt
860
;
861
ld_125:         ld      bc,data_1234
862
                ld      a, #12                  ;bjp  guess >data_1234
863
                cp      b
864
                jr      z,ld_126
865
                fail_msg 125
866
ld_126:         ld      a, #34                  ;bjp  guess  
867
                cp      c
868
                jr      z,ld_127
869
                fail_msg 126
870
ld_127:         ld      de,data_55aa
871
                ld      a,data_55
872
                cp      d
873
                jr      z,ld_128
874
                fail_msg 127
875
ld_128:         ld      a,data_aa
876
                cp      e
877
                jr      z,ld_129
878
                fail_msg 128
879
ld_129:         ld      hl,data_7fff
880
                ld      a,data_7f
881
                cp      h
882
                jr      z,ld_130
883
                fail_msg 129
884
ld_130:         ld      a,data_ff
885
                cp      l
886
                jr      z,ld_131
887
                fail_msg 130
888
ld_131:         ld      sp,data_aa55
889
                ld      hl,0
890
                add     hl,sp
891
                ld      a,data_aa
892
                cp      h
893
                jr      z,ld_132
894
                fail_msg 131
895
ld_132:         ld      a,data_55
896
                cp      l
897
                jr      z,ld_133
898
                fail_msg 132
899
ld_133:         ld      ix,data_ffff
900
                ld      hl,0
901
                ld      sp,ix
902
                add     hl,sp
903
                ld      a,data_ff
904
                cp      h
905
                jr      z,ld_134
906
                fail_msg 133
907
ld_134:         cp      l
908
                jr      z,ld_135
909
                fail_msg 134
910
ld_135:         ld      iy,data_1234
911
                ld      hl,0
912
                ld      sp,iy
913
                add     hl,sp
914
                ld      a,#12      ;bjp was >data_1234
915
                cp      h
916
                jr      z,ld_136
917
                fail_msg 135
918
ld_136:         ld      a,#34      ;bjp was >data_1234
919
                cp      l
920
                jr      z,ld_137
921
                fail_msg 136
922
ld_137:         ld      hl,(w_var2)
923
                ld      a,data_55
924
                cp      h
925
                jr      z,ld_138
926
                fail_msg 137
927
ld_138:         ld      a,data_aa
928
                cp      l
929
                jr      z,ld_139
930
                fail_msg 138
931
ld_139:         ld      bc,(w_var1)
932
                ld      a,#12      ;bjp was >data_1234
933
                cp      b
934
                jr      z,ld_140
935
                fail_msg 139
936
ld_140:         ld      a,#34      ;bjp was >data_1234
937
                cp      c
938
                jr      z,ld_141
939
                fail_msg 140
940
ld_141:         ld      de,(w_var3)
941
                ld      a,data_7f
942
                cp      d
943
                jr      z,ld_142
944
                fail_msg 141
945
ld_142:         ld      a,data_ff
946
                cp      e
947
                jr      z,ld_143
948
                fail_msg 142
949
ld_143:         ld      hl,(w_var4)
950
                ld      a,data_80
951
                cp      h
952
                jr      z,ld_144
953
                fail_msg 143
954
ld_144:         ld      a,0
955
                cp      l
956
                jr      z,ld_145
957
                fail_msg 144
958
ld_145:         ld      sp,(w_var5)
959
                ld      hl,0
960
                add     hl,sp
961
                ld      a,data_aa
962
                cp      h
963
                jr      z,ld_146
964
                fail_msg 145
965
ld_146:         ld      a,data_55
966
                cp      l
967
                jr      z,ld_147
968
                fail_msg 146
969
ld_147:         ld      ix,(w_var6)
970
                ld      hl,0
971
                ld      sp,ix
972
                add     hl,sp
973
                ld      a,data_ff
974
                cp      h
975
                jr      z,ld_148
976
                fail_msg 147
977
ld_148:         cp      l
978
                jr      z,ld_149
979
                fail_msg 148
980
ld_149:         ld      iy,(w_var1)
981
                ld      hl,0
982
                ld      sp,iy
983
                add     hl,sp
984
                ld      a,#12      ;bjp was >data_1234
985
                cp      h
986
                jr      z,ld_150
987
                fail_msg 149
988 10 ghutchis
ld_150:
989
                ld      sp, stack_end ; reset stack pointer to EOM
990
                ld      a,#34      ;bjp was >data_1234
991 8 ghutchis
                cp      l
992
                jr      z,ld_151
993
                fail_msg 150
994
ld_151:         ld      hl,data_1234
995
                ld      (tw_var1),hl
996
                ld      bc,(tw_var1)
997
                ld      a,#12      ;bjp was >data_1234
998
                cp      b
999
                jr      z,ld_152
1000
                fail_msg 151
1001
ld_152:         ld      a,#34      ;bjp was >data_1234
1002
                cp      c
1003
                jr      z,ld_153
1004
                fail_msg 152
1005
ld_153:         ld      bc,data_55aa
1006
                ld      (tw_var2),bc
1007
                ld      hl,(tw_var2)
1008
                ld      a,data_55
1009
                cp      h
1010
                jr      z,ld_154
1011
                fail_msg 153
1012
ld_154:         ld      a,data_aa
1013
                cp      l
1014
                jr      z,ld_155
1015
                fail_msg 154
1016
ld_155:         ld      de,data_7fff
1017
                ld      (tw_var3),de
1018
                ld      hl,(tw_var3)
1019
                ld      a,data_7f
1020
                cp      h
1021
                jr      z,ld_156
1022
                fail_msg 155
1023
ld_156:         ld      a,data_ff
1024
                cp      l
1025
                jr      z,ld_157
1026
                fail_msg 156
1027
ld_157:         ld      hl,data_8000
1028
                ld      (tw_var4),hl
1029
                ld      bc,(tw_var4)
1030
                ld      a,data_80
1031
                cp      b
1032
                jr      z,ld_158
1033
                fail_msg 157
1034
ld_158:         ld      a,0
1035
                cp      c
1036
                jr      z,ld_159
1037
                fail_msg 158
1038
ld_159:         ld      sp,data_aa55
1039
                ld      (tw_var5),sp
1040
                ld      hl,(tw_var5)
1041
                ld      a,data_aa
1042
                cp      h
1043
                jr      z,ld_160
1044
                fail_msg 159
1045
ld_160:         ld      a,data_55
1046
                cp      l
1047
                jr      z,ld_161
1048
                fail_msg 160
1049
ld_161:         ld      ix,data_ffff
1050
                ld      (tw_var6),ix
1051
                ld      hl,(tw_var6)
1052
                ld      a,data_ff
1053
                cp      h
1054
                jr      z,ld_162
1055
                fail_msg 161
1056
ld_162:         cp      l
1057
                jr      z,ld_163
1058
                fail_msg 162
1059
ld_163:         ld      iy,data_1234
1060
                ld      (tw_var7),iy
1061
                ld      hl,(tw_var7)
1062
                ld      a,#12      ;bjp was >data_1234
1063
                cp      h
1064
                jr      z,ld_164
1065
                fail_msg 163
1066
ld_164:         ld      a,#34      ;bjp was >data_1234
1067
                cp      l
1068
                jr      z,ld_165
1069
                fail_msg 164
1070
ld_165:         ld      hl,data_55aa
1071
                ld      sp,hl
1072
                ld      hl,0
1073
                add     hl,sp
1074
                ld      a,data_55
1075
                cp      h
1076
                jr      z,ld_166
1077
                fail_msg 165
1078
ld_166:         ld      a,data_aa
1079
                cp      l
1080
                jr      z,push_0
1081
                fail_msg 166
1082 15 ghutchis
push_0:         ld      sp,stack_end
1083 10 ghutchis
                print   "push_0"
1084 8 ghutchis
                ld      bc,data_1234
1085
                push    bc
1086
                ld      bc,0
1087
                pop     bc
1088
                ld      a,#12      ;bjp was >data_1234
1089
                cp      b
1090
                jr      z,push_1
1091 11 ghutchis
                fail_msg 0
1092 8 ghutchis
push_1:         ld      a,#34      ;bjp was >data_1234
1093
                cp      c
1094
                jr      z,push_2
1095 11 ghutchis
                fail_msg 1
1096 8 ghutchis
push_2:         ld      de,data_55aa
1097
                push    de
1098
                ld      de,0
1099
                pop     de
1100
                ld      a,data_55
1101
                cp      d
1102
                jr      z,push_3
1103 11 ghutchis
                fail_msg 2
1104 8 ghutchis
push_3:         ld      a,data_aa
1105
                cp      e
1106
                jr      z,push_4
1107 11 ghutchis
                fail_msg 3
1108 8 ghutchis
push_4:         ld      hl,data_7fff
1109
                push    hl
1110
                ld      hl,0
1111
                pop     hl
1112
                ld      a,data_7f
1113
                cp      h
1114
                jr      z,push_5
1115 11 ghutchis
                fail_msg 4
1116 8 ghutchis
push_5:         ld      a,data_ff
1117
                cp      l
1118
                jr      z,push_6
1119 11 ghutchis
                fail_msg 5
1120 8 ghutchis
push_6:         ld      a,data_80
1121
                push    af                      ;f depends on previous compare
1122
                ld      hl,0
1123
                pop     hl
1124
                cp      h
1125
                jr      z,push_7
1126 11 ghutchis
                fail_msg 6
1127 8 ghutchis
push_7:         ld      a,l
1128
                cp      #42
1129
                jr      z,push_8
1130
push_8:         ld      h,data_55
1131
                ld      l,data_80+#41
1132
                ld      a,0
1133
                push    hl
1134
                pop     af
1135
                jp      m,push_9
1136 11 ghutchis
                fail_msg 8
1137 8 ghutchis
push_9:         jr      z,push_10
1138 11 ghutchis
                fail_msg 9
1139 8 ghutchis
push_10:        jr      c,push_11
1140 11 ghutchis
                fail_msg 10
1141 8 ghutchis
push_11:        cp      data_55
1142
                jr      z,push_12
1143 11 ghutchis
                fail_msg 11
1144 8 ghutchis
push_12:        ld      ix,data_aa55
1145
                ld      bc,0
1146
                push    ix
1147
                pop     bc
1148
                ld      a,data_aa
1149
                cp      b
1150
                jr      z,push_13
1151 11 ghutchis
                fail_msg 12
1152 8 ghutchis
push_13:        ld      a,data_55
1153
                cp      c
1154
                jr      z,push_14
1155 11 ghutchis
                fail_msg 13
1156 8 ghutchis
push_14:        ld      iy,data_7fff
1157
                ld      de,0
1158
                push    iy
1159
                pop     de
1160
                ld      a,data_7f
1161
                cp      d
1162
                jr      z,push_15
1163 11 ghutchis
                fail_msg 14
1164 8 ghutchis
push_15:        ld      a,data_ff
1165
                cp      e
1166
                jr      z,push_16
1167 11 ghutchis
                fail_msg 15
1168 8 ghutchis
push_16:        ld      de,data_1234
1169
                ld      ix,0
1170
                ld      hl,0
1171
                push    de
1172
                pop     ix
1173
                ld      sp,ix
1174
                add     hl,sp
1175
                ld      a,#12      ;bjp was >data_1234
1176
                cp      h
1177
                jr      z,push_17
1178 11 ghutchis
                fail_msg 16
1179 8 ghutchis
push_17:        ld      a,#34      ;bjp was >data_1234
1180
                cp      l
1181
                jr      z,push_18
1182 11 ghutchis
                fail_msg 17
1183 8 ghutchis
push_18:        ld      sp,stack_end
1184
                ld      bc,data_55aa
1185
                ld      iy,0
1186
                ld      hl,0
1187
                push    bc
1188
                pop     iy
1189
                ld      sp,iy
1190
                add     hl,sp
1191
                ld      a,data_55
1192
                cp      h
1193
                jr      z,push_19
1194 11 ghutchis
                fail_msg 18
1195 8 ghutchis
push_19:        ld      a,data_aa
1196
                cp      l
1197
                jr      z,push_20
1198 11 ghutchis
                fail_msg 19
1199 8 ghutchis
push_20:        ld      sp,stack_end
1200 15 ghutchis
                print   "ex_0"
1201 8 ghutchis
ex_0:           ld      de,data_1234
1202
                ld      hl,data_ffff
1203
                ex      de,hl
1204
                ld      a,data_ff
1205
                cp      d
1206
                jr      z,ex_1
1207 11 ghutchis
                fail_msg 0
1208 8 ghutchis
ex_1:           cp      e
1209
                jr      z,ex_2
1210 11 ghutchis
                fail_msg 1
1211 8 ghutchis
ex_2:           ld      a,#12      ;bjp was >data_1234
1212
                cp      h
1213
                jr      z,ex_3
1214 11 ghutchis
                fail_msg 2
1215 8 ghutchis
ex_3:           ld      a,#34      ;bjp was >data_1234
1216
                cp      l
1217
                jr      z,ex_4
1218 11 ghutchis
                fail_msg 3
1219 8 ghutchis
ex_4:           ld      h,0
1220
                ld      l,0
1221
                push    hl
1222
                pop     af
1223
                ex      af,af'
1224
                ld      h,data_7f
1225
                ld      l,data_80+#41
1226
                push    hl
1227
                pop     af
1228
                ex      af,af'
1229
                cp      0
1230
                jr      z,ex_5
1231 11 ghutchis
                fail_msg 4
1232 8 ghutchis
ex_5:           ex      af,af'
1233
                jp      m,ex_6
1234 11 ghutchis
                fail_msg 5
1235 8 ghutchis
ex_6:           jr      z,ex_7
1236 11 ghutchis
                fail_msg 6
1237 8 ghutchis
ex_7:           cp      data_7f
1238
                jr      z,ex_8
1239 11 ghutchis
                fail_msg 7
1240 8 ghutchis
ex_8:           ld      hl,0
1241
                ld      bc,0
1242
                ld      de,0
1243
                exx
1244
                ld      hl,data_1234
1245
                ld      bc,data_7fff
1246
                ld      de,data_aa55
1247
                exx
1248
                ld      a,0
1249
                cp      h
1250
                jr      z,ex_9
1251 11 ghutchis
                fail_msg 8
1252 8 ghutchis
ex_9:           cp      l
1253
                jr      z,ex_10
1254 11 ghutchis
                fail_msg 9
1255 8 ghutchis
ex_10:          cp      d
1256
                jr      z,ex_11
1257 11 ghutchis
                fail_msg 10
1258 8 ghutchis
ex_11:          cp      e
1259
                jr      z,ex_12
1260 11 ghutchis
                fail_msg 11
1261 8 ghutchis
ex_12:          cp      b
1262
                jr      z,ex_13
1263 11 ghutchis
                fail_msg 12
1264 8 ghutchis
ex_13:          cp      c
1265
                jr      z,ex_14
1266 11 ghutchis
                fail_msg 13
1267 8 ghutchis
ex_14:          exx
1268
                ld      a,#12      ;bjp was >data_1234
1269
                cp      h
1270
                jr      z,ex_15
1271 11 ghutchis
                fail_msg 14
1272 8 ghutchis
ex_15:          ld      a,#34      ;bjp was >data_1234
1273
                cp      l
1274
                jr      z,ex_16
1275 11 ghutchis
                fail_msg 15
1276 8 ghutchis
ex_16:          ld      a,data_aa
1277
                cp      d
1278
                jr      z,ex_17
1279 11 ghutchis
                fail_msg 16
1280 8 ghutchis
ex_17:          ld      a,data_55
1281
                cp      e
1282
                jr      z,ex_18
1283 11 ghutchis
                fail_msg 17
1284 8 ghutchis
ex_18:          ld      a,data_7f
1285
                cp      b
1286
                jr      z,ex_19
1287 11 ghutchis
                fail_msg 18
1288 8 ghutchis
ex_19:          ld      a,data_ff
1289
                cp      c
1290
                jr      z,ex_20
1291 11 ghutchis
                fail_msg 19
1292 8 ghutchis
ex_20:          ld      bc,data_55aa
1293
                ld      hl,data_7fff
1294
                push    bc
1295
                ex      (sp),hl
1296
                pop     bc
1297
                ld      a,data_7f
1298
                cp      b
1299
                jr      z,ex_21
1300 11 ghutchis
                fail_msg 20
1301 8 ghutchis
ex_21:          ld      a,data_ff
1302
                cp      c
1303
                jr      z,ex_22
1304 11 ghutchis
                fail_msg 21
1305 8 ghutchis
ex_22:          ld      a,data_55
1306
                cp      h
1307
                jr      z,ex_23
1308 11 ghutchis
                fail_msg 22
1309 8 ghutchis
ex_23:          ld      a,data_aa
1310
                cp      l
1311
                jr      z,ex_24
1312 11 ghutchis
                fail_msg 23
1313 8 ghutchis
ex_24:          ld      bc,data_ffff
1314
                ld      ix,data_8000
1315
                ld      hl,0
1316
                push    bc
1317
                ex      (sp),ix
1318
                pop     bc
1319
                ld      sp,ix
1320
                add     hl,sp
1321
                ld      a,data_80
1322
                cp      b
1323
                jr      z,ex_25
1324 11 ghutchis
                fail_msg 24
1325 8 ghutchis
ex_25:          ld      a,0
1326
                cp      c
1327
                jr      z,ex_26
1328 11 ghutchis
                fail_msg 25
1329 8 ghutchis
ex_26:          ld      a,data_ff
1330
                cp      h
1331
                jr      z,ex_27
1332 11 ghutchis
                fail_msg 26
1333 8 ghutchis
ex_27:          cp      l
1334
                jr      z,ex_28
1335 11 ghutchis
                fail_msg 27
1336 8 ghutchis
ex_28:          ld      sp,stack_end
1337
                ld      bc,data_1234
1338
                ld      iy,data_7fff
1339
                ld      hl,0
1340
                push    bc
1341
                ex      (sp),iy
1342
                pop     bc
1343
                ld      sp,iy
1344
                add     hl,sp
1345
                ld      a,data_7f
1346
                cp      b
1347
                jr      z,ex_29
1348 11 ghutchis
                fail_msg 28
1349 8 ghutchis
ex_29:          ld      a,data_ff
1350
                cp      c
1351
                jr      z,ex_30
1352 11 ghutchis
                fail_msg 29
1353 8 ghutchis
ex_30:          ld      a,#12      ;bjp was >data_1234
1354
                cp      h
1355
                jr      z,ex_31
1356 11 ghutchis
                fail_msg 30
1357 8 ghutchis
ex_31:          ld      a,#34      ;bjp was >data_1234
1358
                cp      l
1359
                jr      z,add_0
1360 11 ghutchis
                fail_msg 31
1361 17 ghutchis
add_0:          ld      sp,stack_end ; reset stack after EX operations
1362 15 ghutchis
                print   "add_0"
1363
                ld      a,0
1364 8 ghutchis
                ld      b,data_7f
1365
                add     a,b
1366
                cp      data_7f
1367
                jr      z,add_1
1368 11 ghutchis
                fail_msg 0
1369 8 ghutchis
add_1:          ld      a,0
1370
                ld      b,0
1371
                add     a,b
1372
                jr      z,add_2
1373 11 ghutchis
                fail_msg 1
1374 8 ghutchis
add_2:          ld      b,data_55
1375
                add     a,b
1376
                jr      nz,add_3
1377 11 ghutchis
                fail_msg 2
1378 8 ghutchis
add_3:          cp      data_55
1379
                jr      z,add_4
1380 11 ghutchis
                fail_msg 3
1381 8 ghutchis
add_4:          ld      a,data_ff
1382
                ld      b,1
1383
                add     a,b
1384
                jr      c,add_5
1385 11 ghutchis
                fail_msg 4
1386 8 ghutchis
add_5:          add     a,b
1387
                jr      nc,add_6
1388 11 ghutchis
                fail_msg 5
1389 8 ghutchis
add_6:          ld      a,data_ff
1390
                ld      b,0
1391
                add     a,b
1392
                jp      m,add_7
1393 11 ghutchis
                fail_msg 6
1394 8 ghutchis
add_7:          ld      b,1
1395
                add     a,b
1396
                jp      p,add_8
1397 11 ghutchis
                fail_msg 7
1398 8 ghutchis
add_8:          ld      a,data_7f
1399
                ld      b,1
1400
                add     a,b
1401
                jp      pe,add_9
1402 11 ghutchis
                fail_msg 8
1403 8 ghutchis
add_9:          add     a,b
1404
                jp      po,add_10
1405 11 ghutchis
                fail_msg 9
1406 8 ghutchis
add_10:         ld      a,data_55
1407
                ld      c,2
1408
                add     a,c
1409
                cp      data_55+2
1410
                jr      z,add_11
1411 11 ghutchis
                fail_msg 10
1412 8 ghutchis
add_11:         ld      a,data_80
1413
                add     a,c
1414
                cp      data_80+2
1415
                jr      z,add_12
1416 11 ghutchis
                fail_msg 11
1417 8 ghutchis
add_12:         ld      a,data_aa
1418
                ld      d,data_55
1419
                add     a,d
1420
                cp      data_aa+data_55
1421
                jr      z,add_13
1422 11 ghutchis
                fail_msg 12
1423 8 ghutchis
add_13:         ld      a,data_aa
1424
                ld      e,2
1425
                add     a,e
1426
                cp      data_aa+2
1427
                jr      z,add_14
1428 11 ghutchis
                fail_msg 13
1429 8 ghutchis
add_14:         ld      a,data_55
1430
                ld      h,24
1431
                add     a,h
1432
                cp      data_55+24
1433
                jr      z,add_15
1434 11 ghutchis
                fail_msg 14
1435 8 ghutchis
add_15:         ld      a,data_7f-10
1436
                ld      l,10
1437
                add     a,l
1438
                cp      data_7f
1439
                jr      z,add_16
1440 11 ghutchis
                fail_msg 15
1441 8 ghutchis
add_16:         ld      a,1
1442
                add     a,data_7f
1443
                jp      pe,add_17
1444 11 ghutchis
                fail_msg 16
1445 8 ghutchis
add_17:         jp      m,add_18
1446 11 ghutchis
                fail_msg 17
1447 8 ghutchis
add_18:         jr      nz,add_19
1448 11 ghutchis
                fail_msg 18
1449 8 ghutchis
add_19:         cp      data_80
1450
                jr      z,add_20
1451 11 ghutchis
                fail_msg 19
1452 8 ghutchis
add_20:         ld      a,data_55
1453
                add     a,1
1454
                jp      po,add_21
1455 11 ghutchis
                fail_msg 20
1456 8 ghutchis
add_21:         jp      p,add_22
1457 11 ghutchis
                fail_msg 21
1458 8 ghutchis
add_22:         jr      nc,add_23
1459 11 ghutchis
                fail_msg 22
1460 8 ghutchis
add_23:         cp      data_55+1
1461
                jr      z,add_24
1462 11 ghutchis
                fail_msg 23
1463 8 ghutchis
add_24:         ld      a,data_ff
1464
                add     a,1
1465
                jr      c,add_25
1466 11 ghutchis
                fail_msg 24
1467 8 ghutchis
add_25:         jr      z,add_26
1468 11 ghutchis
                fail_msg 25
1469 8 ghutchis
add_26:         add     a,1
1470
                jr      nc,add_27
1471 11 ghutchis
                fail_msg 26
1472 8 ghutchis
add_27:         jr      nz,add_28
1473 11 ghutchis
                fail_msg 27
1474 8 ghutchis
add_28:         cp      1
1475
                jr      z,add_29
1476 11 ghutchis
                fail_msg 28
1477 8 ghutchis
add_29:         ld      hl,var2
1478
                ld      a,2
1479
                add     a,(hl)
1480
                jp      po,add_30
1481 11 ghutchis
                fail_msg 29
1482 8 ghutchis
add_30:         jp      p,add_31
1483 11 ghutchis
                fail_msg 30
1484 8 ghutchis
add_31:         jr      nz,add_32
1485 11 ghutchis
                fail_msg 31
1486 8 ghutchis
add_32:         jr      nc,add_33
1487 11 ghutchis
                fail_msg 32
1488 8 ghutchis
add_33:         cp      data_55+2
1489
                jr      z,add_34
1490 11 ghutchis
                fail_msg 33
1491 8 ghutchis
add_34:         ld      hl,var1
1492
                ld      a,1
1493
                add     a,(hl)
1494
                jr      c,add_35
1495 11 ghutchis
                fail_msg 34
1496 8 ghutchis
add_35:         jr      z,add_36
1497 11 ghutchis
                fail_msg 35
1498 8 ghutchis
add_36:         ld      hl,var5
1499
                ld      a,1
1500
                add     a,(hl)
1501
                jp      m,add_37
1502 11 ghutchis
                fail_msg 36
1503 8 ghutchis
add_37:         jp      pe,add_38
1504 11 ghutchis
                fail_msg 37
1505 8 ghutchis
add_38:         cp      data_80
1506
                jr      z,add_39
1507 11 ghutchis
                fail_msg 38
1508 8 ghutchis
add_39:         ld      ix,var3
1509
                ld      a,1
1510
                add     a,(ix-1)
1511
                jp      po,add_40
1512 11 ghutchis
                fail_msg 39
1513 8 ghutchis
add_40:         jp      p,add_41
1514 11 ghutchis
                fail_msg 40
1515 8 ghutchis
add_41:         jr      nz,add_42
1516 11 ghutchis
                fail_msg 41
1517 8 ghutchis
add_42:         jr      nc,add_43
1518 11 ghutchis
                fail_msg 42
1519 8 ghutchis
add_43:         cp      data_55+1
1520
                jr      z,add_44
1521 11 ghutchis
                fail_msg 43
1522 8 ghutchis
add_44:         ld      a,1
1523
                add     a,(ix+2)
1524
                jp      pe,add_45
1525 11 ghutchis
                fail_msg 44
1526 8 ghutchis
add_45:         jp      m,add_46
1527 11 ghutchis
                fail_msg 45
1528 8 ghutchis
add_46:         cp      data_80
1529
                jr      z,add_47
1530 11 ghutchis
                fail_msg 46
1531 8 ghutchis
add_47:         ld      a,1
1532
                add     a,(ix-2)
1533
                jr      c,add_48
1534 11 ghutchis
                fail_msg 47
1535 8 ghutchis
add_48:         jr      z,add_49
1536 11 ghutchis
                fail_msg 48
1537 8 ghutchis
add_49:         add     a,1
1538
                jr      nc,add_50
1539 11 ghutchis
                fail_msg 49
1540 8 ghutchis
add_50:         jr      nz,add_51
1541 11 ghutchis
                fail_msg 50
1542 8 ghutchis
add_51:         cp      1
1543
                jr      z,add_52
1544 11 ghutchis
                fail_msg 51
1545 8 ghutchis
add_52:         ld      iy,var3
1546
                ld      a,10
1547
                add     a,(iy-1)
1548
                jp      po,add_53
1549 11 ghutchis
                fail_msg 52
1550 8 ghutchis
add_53:         jp      p,add_54
1551 11 ghutchis
                fail_msg 53
1552 8 ghutchis
add_54:         jr      nz,add_55
1553 11 ghutchis
                fail_msg 54
1554 8 ghutchis
add_55:         jr      nc,add_56
1555 11 ghutchis
                fail_msg 55
1556 8 ghutchis
add_56:         cp      data_55+10
1557
                jr      z,add_57
1558 11 ghutchis
                fail_msg 56
1559 8 ghutchis
add_57:         ld      a,1
1560
                add     a,(iy+2)
1561
                jp      pe,add_58
1562 11 ghutchis
                fail_msg 57
1563 8 ghutchis
add_58:         jp      m,add_59
1564 11 ghutchis
                fail_msg 58
1565 8 ghutchis
add_59:         add     a,1
1566
                jp      po,add_60
1567 11 ghutchis
                fail_msg 59
1568 8 ghutchis
add_60:         cp      data_80+1
1569
                jr      z,add_61
1570 11 ghutchis
                fail_msg 60
1571 8 ghutchis
add_61:         ld      a,1
1572
                add     a,(iy-2)
1573
                jr      z,add_62
1574 11 ghutchis
                fail_msg 61
1575 8 ghutchis
add_62:         jr      c,add_63
1576 11 ghutchis
                fail_msg 62
1577 8 ghutchis
add_63:         add     a,1
1578
                jr      nc,add_64
1579 11 ghutchis
                fail_msg 63
1580 8 ghutchis
add_64:         jr      nz,add_65
1581 11 ghutchis
                fail_msg 64
1582 8 ghutchis
add_65:         cp      1
1583
                jr      z,add_66
1584 11 ghutchis
                fail_msg 65
1585 8 ghutchis
add_66:         ld      a,data_ff
1586
                add     a,data_80
1587
                jp      p,add_67
1588 11 ghutchis
                fail_msg 66
1589 8 ghutchis
add_67:         jp      pe,add_68
1590 11 ghutchis
                fail_msg 67
1591 8 ghutchis
add_68:         jr      c,add_69
1592 11 ghutchis
                fail_msg 68
1593 8 ghutchis
add_69:         add     a,1
1594
                jp      pe,add_70
1595 11 ghutchis
                fail_msg 69
1596 8 ghutchis
add_70:         jp      m,add_71
1597 11 ghutchis
                fail_msg 70
1598 8 ghutchis
add_71:         jr      nc,add_72
1599 11 ghutchis
                fail_msg 71
1600 8 ghutchis
add_72:         add     a,1
1601
                jp      po,add_73
1602 11 ghutchis
                fail_msg 72
1603 8 ghutchis
add_73:         cp      data_80+1
1604
                jr      z,adc_0
1605 11 ghutchis
                fail_msg 73
1606 15 ghutchis
adc_0:          nop
1607
                print   "adc_0"
1608
                ld      a,0                 ;clear cry
1609 8 ghutchis
                add     a,0
1610
                ld      b,data_7f
1611
                adc     a,b                  ;a=7f cry=0
1612
                jp      p,adc_1
1613 11 ghutchis
                fail_msg 0
1614 8 ghutchis
adc_1:          jp      po,adc_2
1615 11 ghutchis
                fail_msg 1
1616 8 ghutchis
adc_2:          jr      nc,adc_3
1617 11 ghutchis
                fail_msg 2
1618 8 ghutchis
adc_3:          jr      nz,adc_4
1619 11 ghutchis
                fail_msg 3
1620 8 ghutchis
adc_4:          ld      b,1
1621
                adc     a,b                     ;a=80 cry=0
1622
                jp      pe,adc_5                ;jp  ofl
1623 11 ghutchis
                fail_msg 4
1624 8 ghutchis
adc_5:          jp      m,adc_6
1625 11 ghutchis
                fail_msg 5
1626 8 ghutchis
adc_6:          cp      data_80
1627
                jr      z,adc_7                 ;z=0  ofl=0 cry=0 (borrow)
1628 11 ghutchis
                fail_msg 6
1629 8 ghutchis
adc_7:          ld      a,data_ff
1630
                ld      b,1
1631
                adc     a,b                      ;ff+1+0
1632
                jr      c,adc_8
1633 11 ghutchis
                fail_msg 7
1634 8 ghutchis
adc_8:          jr      z,adc_9
1635 11 ghutchis
                fail_msg 8
1636 8 ghutchis
adc_9:          adc     a,b
1637
                jr      nc,adc_10
1638 11 ghutchis
                fail_msg 9
1639 8 ghutchis
adc_10:         jr      nz,adc_11
1640 11 ghutchis
                fail_msg 10
1641 8 ghutchis
adc_11:         cp      2
1642
                jr      z,adc_12
1643 11 ghutchis
                fail_msg 11
1644 8 ghutchis
adc_12:         ld      a,data_ff
1645
                ld      c,0
1646
                adc     a,c
1647
                jp      m,adc_13
1648 11 ghutchis
                fail_msg 12
1649 8 ghutchis
adc_13:         jr      nc,adc_14
1650 11 ghutchis
                fail_msg 13
1651 8 ghutchis
adc_14:         ld      c,2
1652
                adc     a,c
1653
                jp      p,adc_15
1654 11 ghutchis
                fail_msg 14
1655 8 ghutchis
adc_15:         jr      c,adc_16
1656 11 ghutchis
                fail_msg 15
1657 8 ghutchis
adc_16:         ld      c,0
1658
                adc     a,c
1659
                cp      2
1660
                jr      z,adc_17
1661 11 ghutchis
                fail_msg 16
1662 8 ghutchis
adc_17:         ld      a,data_ff
1663
                ld      d,1
1664
                adc     a,d
1665
                jr      c,adc_18
1666 11 ghutchis
                fail_msg 17
1667 8 ghutchis
adc_18:         ld      d,0
1668
                adc     a,d
1669
                jr      nc,adc_19
1670 11 ghutchis
                fail_msg 18
1671 8 ghutchis
adc_19:         cp      1
1672
                jr      z,adc_20
1673 11 ghutchis
                fail_msg 19
1674 8 ghutchis
adc_20:         ld      a,data_aa
1675
                ld      e,data_7f
1676
                adc     a,e
1677
                jr      c,adc_21
1678 11 ghutchis
                fail_msg 20
1679 8 ghutchis
adc_21:         ld      e,#2b
1680
                adc     a,e
1681
                cp      data_55
1682
                jr      z,adc_22
1683 11 ghutchis
                fail_msg 21
1684 8 ghutchis
adc_22:         ld      a,data_ff
1685
                ld      h,1
1686
                adc     a,h
1687
                jr      c,adc_23
1688 11 ghutchis
                fail_msg 22
1689 8 ghutchis
adc_23:         adc     a,h
1690
                cp      2
1691
                jr      z,adc_24
1692 11 ghutchis
                fail_msg 23
1693 8 ghutchis
adc_24:         ld      a,data_ff
1694
                ld      l,1
1695
                adc     a,l
1696
                jr      c,adc_25
1697 11 ghutchis
                fail_msg 24
1698 8 ghutchis
adc_25:         adc     a,l
1699
                cp      2
1700
                jr      z,adc_26
1701 11 ghutchis
                fail_msg 25
1702 8 ghutchis
adc_26:         ld      a,0
1703
                adc     a,data_7f
1704
                jp      po,adc_27
1705 11 ghutchis
                fail_msg 26
1706 8 ghutchis
adc_27:         jp      p,adc_28
1707 11 ghutchis
                fail_msg 27
1708 8 ghutchis
adc_28:         jr      nc,adc_29
1709 11 ghutchis
                fail_msg 28
1710 8 ghutchis
adc_29:         jr      nz,adc_30
1711 11 ghutchis
                fail_msg 29
1712 8 ghutchis
adc_30:         adc     a,1
1713
                jp      pe,adc_31
1714 11 ghutchis
                fail_msg 30
1715 8 ghutchis
adc_31:         jp      m,adc_32
1716 11 ghutchis
                fail_msg 31
1717 8 ghutchis
adc_32:         cp      data_80
1718
                jr      z,adc_33
1719 11 ghutchis
                fail_msg 32
1720 8 ghutchis
adc_33:         ld      a,data_ff
1721
                adc     a,1
1722
                jr      c,adc_34
1723 11 ghutchis
                fail_msg 33
1724 8 ghutchis
adc_34:         jr      z,adc_35
1725 11 ghutchis
                fail_msg 34
1726 8 ghutchis
adc_35:         adc     a,1
1727
                jr      nc,adc_36
1728 11 ghutchis
                fail_msg 35
1729 8 ghutchis
adc_36:         jr      nz,adc_37
1730 11 ghutchis
                fail_msg 36
1731 8 ghutchis
adc_37:         cp      2
1732
                jr      z,adc_38
1733 11 ghutchis
                fail_msg 37
1734 8 ghutchis
adc_38:         ld      hl,var5
1735
                ld      a,0
1736
                adc     a,(hl)
1737
                jp      p,adc_39
1738 11 ghutchis
                fail_msg 38
1739 8 ghutchis
adc_39:         jp      po,adc_40
1740 11 ghutchis
                fail_msg 39
1741 8 ghutchis
adc_40:         jr      nz,adc_41
1742 11 ghutchis
                fail_msg 40
1743 8 ghutchis
adc_41:         jr      nc,adc_42
1744 11 ghutchis
                fail_msg 41
1745 8 ghutchis
adc_42:         ld      a,1
1746
                adc     a,(hl)
1747
                jp      m,adc_43
1748 11 ghutchis
                fail_msg 42
1749 8 ghutchis
adc_43:         jp      pe,adc_44
1750 11 ghutchis
                fail_msg 43
1751 8 ghutchis
adc_44:         cp      data_80
1752
                jr      z,adc_45
1753 11 ghutchis
                fail_msg 44
1754 8 ghutchis
adc_45:         ld      hl,var1
1755
                ld      a,1
1756
                adc     a,(hl)
1757
                jr      z,adc_46
1758 11 ghutchis
                fail_msg 45
1759 8 ghutchis
adc_46:         jr      c,adc_47
1760 11 ghutchis
                fail_msg 46
1761 8 ghutchis
adc_47:         ld      hl,var2
1762
                adc     a,(hl)
1763
                jr      nc,adc_48
1764 11 ghutchis
                fail_msg 47
1765 8 ghutchis
adc_48:         jr      nz,adc_49
1766 11 ghutchis
                fail_msg 48
1767 8 ghutchis
adc_49:         cp      data_55+1
1768
                jr      z,adc_50
1769 11 ghutchis
                fail_msg 49
1770 8 ghutchis
adc_50:         ld      ix,var3
1771
                ld      a,0
1772
                adc     a,(ix+2)
1773
                jp      p,adc_51
1774 11 ghutchis
                fail_msg 50
1775 8 ghutchis
adc_51:         jp      po,adc_52
1776 11 ghutchis
                fail_msg 51
1777 8 ghutchis
adc_52:         jr      nc,adc_53
1778 11 ghutchis
                fail_msg 52
1779 8 ghutchis
adc_53:         jr      nz,adc_54
1780 11 ghutchis
                fail_msg 53
1781 8 ghutchis
adc_54:         ld      a,1
1782
                adc     a,(ix+2)
1783
                jp      m,adc_55
1784 11 ghutchis
                fail_msg 54
1785 8 ghutchis
adc_55:         jp      pe,adc_56
1786 11 ghutchis
                fail_msg 55
1787 8 ghutchis
adc_56:         cp      data_80
1788
                jr      z,adc_57
1789 11 ghutchis
                fail_msg 56
1790 8 ghutchis
adc_57:         ld      a,1
1791
                adc     a,(ix-2)
1792
                jr      c,adc_58
1793 11 ghutchis
                fail_msg 57
1794 8 ghutchis
adc_58:         jr      z,adc_59
1795 11 ghutchis
                fail_msg 58
1796 8 ghutchis
adc_59:         adc     a,(ix-1)
1797
                jr      nc,adc_60
1798 11 ghutchis
                fail_msg 59
1799 8 ghutchis
adc_60:         jr      nz,adc_61
1800 11 ghutchis
                fail_msg 60
1801 8 ghutchis
adc_61:         cp      data_55+1
1802
                jr      z,adc_62
1803 11 ghutchis
                fail_msg 61
1804 8 ghutchis
adc_62:         ld      iy,var3
1805
                ld      a,0
1806
                adc     a,(ix+2)
1807
                jp      p,adc_63
1808 11 ghutchis
                fail_msg 62
1809 8 ghutchis
adc_63:         jp      po,adc_64
1810 11 ghutchis
                fail_msg 63
1811 8 ghutchis
adc_64:         jr      nc,adc_65
1812 11 ghutchis
                fail_msg 64
1813 8 ghutchis
adc_65:         jr      nz,adc_66
1814 11 ghutchis
                fail_msg 65
1815 8 ghutchis
adc_66:         ld      a,1
1816
                adc     a,(iy+2)
1817
                jp      m,adc_67
1818 11 ghutchis
                fail_msg 66
1819 8 ghutchis
adc_67:         jp      pe,adc_68
1820 11 ghutchis
                fail_msg 67
1821 8 ghutchis
adc_68:         cp      data_80
1822
                jr      z,adc_69
1823 11 ghutchis
                fail_msg 68
1824 8 ghutchis
adc_69:         ld      a,1
1825
                adc     a,(iy-2)
1826
                jr      c,adc_70
1827 11 ghutchis
                fail_msg 69
1828 8 ghutchis
adc_70:         jr      z,adc_71
1829 11 ghutchis
                fail_msg 70
1830 8 ghutchis
adc_71:         adc     a,(iy-1)
1831
                jr      nc,adc_72
1832 11 ghutchis
                fail_msg 71
1833 8 ghutchis
adc_72:         jr      nz,adc_73
1834 11 ghutchis
                fail_msg 72
1835 8 ghutchis
adc_73:         cp      data_55+1
1836
                jr      z,adc_74
1837 11 ghutchis
                fail_msg 73
1838 8 ghutchis
adc_74:         ld      a,data_ff
1839
                add     a,0
1840
                adc     a,data_80
1841
                jp      p,adc_75
1842 11 ghutchis
                fail_msg 74
1843 8 ghutchis
adc_75:         jp      pe,adc_76
1844 11 ghutchis
                fail_msg 75
1845 8 ghutchis
adc_76:         jr      nz,adc_77
1846 11 ghutchis
                fail_msg 76
1847 8 ghutchis
adc_77:         adc     a,0
1848
                jp      m,adc_78
1849 11 ghutchis
                fail_msg 77
1850 8 ghutchis
adc_78:         jp      pe,adc_79
1851 11 ghutchis
                fail_msg 78
1852 8 ghutchis
adc_79:         adc     a,1
1853
                jp      po,adc_80
1854 11 ghutchis
                fail_msg 79
1855 8 ghutchis
adc_80:         cp      data_80+1
1856
                jr      z,sub_0
1857 11 ghutchis
                fail_msg 80
1858 15 ghutchis
sub_0:          nop
1859
                print   "sub_0"
1860
                ld      a,0
1861 8 ghutchis
                ld      b,1
1862
                sub     a,b
1863
                jp      m,sub_1
1864 11 ghutchis
                fail_msg 0
1865 8 ghutchis
sub_1:          jp      po,sub_2
1866 11 ghutchis
                fail_msg 1
1867 8 ghutchis
sub_2:          jr      c,sub_3
1868 11 ghutchis
                fail_msg 2
1869 8 ghutchis
sub_3:          jr      nz,sub_4
1870 11 ghutchis
                fail_msg 3
1871 8 ghutchis
sub_4:          sub     a,b
1872
                jr      nc,sub_5
1873 11 ghutchis
                fail_msg 4
1874 8 ghutchis
sub_5:          cp      data_ff-1
1875
                jr      z,sub_6
1876 11 ghutchis
                fail_msg 5
1877 8 ghutchis
sub_6:          ld      a,1
1878
                ld      b,0
1879
                sub     a,b
1880
                jr      nz,sub_7
1881 11 ghutchis
                fail_msg 6
1882 8 ghutchis
sub_7:          jp      p,sub_8
1883 11 ghutchis
                fail_msg 7
1884 8 ghutchis
sub_8:          ld      b,1
1885
                sub     a,b
1886
                jr      z,sub_9
1887 11 ghutchis
                fail_msg 8
1888 8 ghutchis
sub_9:          sub     a,b
1889
                jp      m,sub_10
1890 11 ghutchis
                fail_msg 9
1891 8 ghutchis
sub_10:         cp      data_ff
1892
                jr      z,sub_11
1893 11 ghutchis
                fail_msg 10
1894 8 ghutchis
sub_11:         ld      a,data_80
1895
                ld      b,data_7f
1896
                sub     a,b
1897
                jp      pe,sub_12
1898 11 ghutchis
                fail_msg 11
1899 8 ghutchis
sub_12:         sub     a,b
1900
                jp      po,sub_13
1901 11 ghutchis
                fail_msg 12
1902 8 ghutchis
sub_13:         cp      data_80+2
1903
                jr      z,sub_14
1904 11 ghutchis
                fail_msg 13
1905 8 ghutchis
sub_14:         ld      a,data_55
1906
                ld      c,data_55
1907
                sub     a,c
1908
                jr      z,sub_15
1909 11 ghutchis
                fail_msg 14
1910 8 ghutchis
sub_15:         ld      c,1
1911
                sub     a,c
1912
                jp      m,sub_16
1913 11 ghutchis
                fail_msg 15
1914 8 ghutchis
sub_16:         jr      c,sub_17
1915 11 ghutchis
                fail_msg 16
1916 8 ghutchis
sub_17:         cp      data_ff
1917
                jr      z,sub_18
1918 11 ghutchis
                fail_msg 17
1919 8 ghutchis
sub_18:         ld      a,data_55
1920
                ld      d,data_7f
1921
                sub     a,d
1922
                jr      c,sub_19
1923 11 ghutchis
                fail_msg 18
1924 8 ghutchis
sub_19:         cp      data_55-data_7f
1925
                jr      z,sub_20
1926 11 ghutchis
                fail_msg 19
1927 8 ghutchis
sub_20:         ld      a,0
1928
                ld      e,data_ff
1929
                sub     a,e
1930
                jr      c,sub_21
1931 11 ghutchis
                fail_msg 20
1932 8 ghutchis
sub_21:         cp      1
1933
                jr      z,sub_22
1934 11 ghutchis
                fail_msg 21
1935 8 ghutchis
sub_22:         ld      a,data_ff
1936
                ld      h,data_80
1937
                sub     a,h
1938
                jp      p,sub_23
1939 11 ghutchis
                fail_msg 22
1940 8 ghutchis
sub_23:         cp      data_7f
1941
                jr      z,sub_24
1942 11 ghutchis
                fail_msg 23
1943 8 ghutchis
sub_24:         ld      a,data_aa
1944
                ld      l,data_ff
1945
                sub     a,l
1946
                jr      c,sub_25
1947 11 ghutchis
                fail_msg 24
1948 8 ghutchis
sub_25:         cp      data_aa+1
1949
                jr      z,sub_26
1950 11 ghutchis
                fail_msg 25
1951 8 ghutchis
sub_26:         ld      a,data_7f
1952
                sub     a,data_ff
1953
                jp      pe,sub_27
1954 11 ghutchis
                fail_msg 26
1955 8 ghutchis
sub_27:         jp      m,sub_28
1956 11 ghutchis
                fail_msg 27
1957 8 ghutchis
sub_28:         sub     a,1
1958
                jp      p,sub_29
1959 11 ghutchis
                fail_msg 28
1960 8 ghutchis
sub_29:         sub     a,1
1961
                jp      po,sub_30
1962 11 ghutchis
                fail_msg 29
1963 8 ghutchis
sub_30:         jr      nz,sub_31
1964 11 ghutchis
                fail_msg 30
1965 8 ghutchis
sub_31:         sub     a,data_7f-1
1966
                jr      z,sub_32
1967 11 ghutchis
                fail_msg 31
1968 8 ghutchis
sub_32:         ld      a,0
1969
                sub     a,data_ff
1970
                jr      c,sub_33
1971 11 ghutchis
                fail_msg 32
1972 8 ghutchis
sub_33:         sub     a,1
1973
                jr      z,sub_34
1974 11 ghutchis
                fail_msg 33
1975 8 ghutchis
sub_34:         jr      nc,sub_35
1976 11 ghutchis
                fail_msg 34
1977 8 ghutchis
sub_35:         ld      hl,var1
1978
                ld      a,data_7f
1979
                sub     a,(hl)
1980
                jp      m,sub_36
1981 11 ghutchis
                fail_msg 35
1982 8 ghutchis
sub_36:         jp      pe,sub_37
1983 11 ghutchis
                fail_msg 36
1984 8 ghutchis
sub_37:         jr      c,sub_38
1985 11 ghutchis
                fail_msg 37
1986 8 ghutchis
sub_38:         ld      hl,var3
1987
                sub     a,(hl)
1988
                jp      p,sub_39
1989 11 ghutchis
                fail_msg 38
1990 8 ghutchis
sub_39:         jp      po,sub_40
1991 11 ghutchis
                fail_msg 39
1992 8 ghutchis
sub_40:         jr      nc,sub_41
1993 11 ghutchis
                fail_msg 40
1994 8 ghutchis
sub_41          jr      z,sub_42
1995 11 ghutchis
                fail_msg 40
1996 8 ghutchis
sub_42:         ld      hl,var2
1997
                sub     a,(hl)
1998
                jr      nz,sub_43
1999 11 ghutchis
                fail_msg 42
2000 8 ghutchis
sub_43:         cp      data_aa+1
2001
                jr      z,sub_44
2002 11 ghutchis
                fail_msg 43
2003 8 ghutchis
sub_44:         ld      ix,var3
2004
                ld      a,data_7f
2005
                sub     a,(ix-2)
2006
                jp      m,sub_45
2007 11 ghutchis
                fail_msg 44
2008 8 ghutchis
sub_45:         jp      pe,sub_46
2009 11 ghutchis
                fail_msg 45
2010 8 ghutchis
sub_46:         jr      c,sub_47
2011 11 ghutchis
                fail_msg 46
2012 8 ghutchis
sub_47:         sub     a,(ix+0)
2013
                jp      p,sub_48
2014 11 ghutchis
                fail_msg 47
2015 8 ghutchis
sub_48:         jp      po,sub_49
2016 11 ghutchis
                fail_msg 48
2017 8 ghutchis
sub_49:         jr      nc,sub_50
2018 11 ghutchis
                fail_msg 49
2019 8 ghutchis
sub_50:         jr      z,sub_51
2020 11 ghutchis
                fail_msg 50
2021 8 ghutchis
sub_51:         sub     a,(ix+2)
2022
                jr      nz,sub_52
2023 11 ghutchis
                fail_msg 51
2024 8 ghutchis
sub_52:         cp      data_80+1
2025
                jr      z,sub_53
2026 11 ghutchis
                fail_msg 52
2027 8 ghutchis
sub_53:         ld      iy,var3
2028
                ld      a,data_7f
2029
                sub     a,(iy-2)
2030
                jp      m,sub_54
2031 11 ghutchis
                fail_msg 53
2032 8 ghutchis
sub_54:         jp      pe,sub_55
2033 11 ghutchis
                fail_msg 54
2034 8 ghutchis
sub_55:         jr      c,sub_56
2035 11 ghutchis
                fail_msg 55
2036 8 ghutchis
sub_56:         jr      nz,sub_57
2037 11 ghutchis
                fail_msg 56
2038 8 ghutchis
sub_57:         sub     a,(iy+0)
2039
                jp      p,sub_58
2040 11 ghutchis
                fail_msg 57
2041 8 ghutchis
sub_58:         jp      po,sub_59
2042 11 ghutchis
                fail_msg 58
2043 8 ghutchis
sub_59:         jr      nc,sub_60
2044 11 ghutchis
                fail_msg 59
2045 8 ghutchis
sub_60:         jr      z,sub_61
2046 11 ghutchis
                fail_msg 60
2047 8 ghutchis
sub_61:         sub     a,(iy+2)
2048
                jr      nz,sub_62
2049 11 ghutchis
                fail_msg 61
2050 8 ghutchis
sub_62:         cp      data_80+1
2051
                jr      z,sbc_0
2052 11 ghutchis
                fail_msg 62
2053 15 ghutchis
sbc_0:          nop
2054
                print   "sbc_0"
2055
                ld      a,data_7f
2056 8 ghutchis
                ld      b,0
2057
                sub     a,b                     ;clear carry flag
2058
                ld      b,data_ff
2059
                sbc     a,b
2060
                jp      m,sbc_1
2061 11 ghutchis
                fail_msg 0
2062 8 ghutchis
sbc_1:          jp      pe,sbc_2
2063 11 ghutchis
                fail_msg 1
2064 8 ghutchis
sbc_2:          jr      c,sbc_3
2065 11 ghutchis
                fail_msg 2
2066 8 ghutchis
sbc_3:          jr      nz,sbc_4
2067 11 ghutchis
                fail_msg 3
2068 8 ghutchis
sbc_4:          ld      b,data_7f
2069
                sbc     a,b
2070
                jp      p,sbc_5
2071 11 ghutchis
                fail_msg 4
2072 8 ghutchis
sbc_5:          jp      pe,sbc_6
2073 11 ghutchis
                fail_msg 5
2074 8 ghutchis
sbc_6:          jr      nc,sbc_7
2075 11 ghutchis
                fail_msg 6
2076 8 ghutchis
sbc_7:          jr      z,sbc_8
2077 11 ghutchis
                fail_msg 7
2078 8 ghutchis
sbc_8:          ld      b,data_ff
2079
                sbc     a,b
2080
                jp      po,sbc_9
2081 11 ghutchis
                fail_msg 8
2082 8 ghutchis
sbc_9:          jr      nz,sbc_10
2083 11 ghutchis
                fail_msg 9
2084 8 ghutchis
sbc_10:         ld      b,0
2085
                sbc     a,b
2086
                jr      z,sbc_11
2087 11 ghutchis
                fail_msg 10
2088 8 ghutchis
sbc_11:         ld      a,data_aa
2089
                ld      c,data_ff
2090
                sbc     a,c
2091
                jr      c,sbc_12
2092 11 ghutchis
                fail_msg 11
2093 8 ghutchis
sbc_12:         ld      c,0
2094
                sbc     a,c
2095
                jr      nc,sbc_13
2096 11 ghutchis
                fail_msg 12
2097 8 ghutchis
sbc_13:         cp      data_aa
2098
                jr      z,sbc_14
2099 11 ghutchis
                fail_msg 13
2100 8 ghutchis
sbc_14:         ld      a,data_55
2101
                ld      d,data_ff
2102
                sbc     a,d
2103
                jr      c,sbc_15
2104 11 ghutchis
                fail_msg 14
2105 8 ghutchis
sbc_15:         ld      d,0
2106
                sbc     a,d
2107
                jr      nc,sbc_16
2108 11 ghutchis
                fail_msg 15
2109 8 ghutchis
sbc_16:         cp      data_55
2110
                jr      z,sbc_17
2111 11 ghutchis
                fail_msg 16
2112 8 ghutchis
sbc_17:         ld      a,data_aa
2113
                ld      e,data_ff
2114
                sbc     a,e
2115
                jr      c,sbc_18
2116 11 ghutchis
                fail_msg 17
2117 8 ghutchis
sbc_18:         ld      e,0
2118
                sbc     a,e
2119
                jr      nc,sbc_19
2120 11 ghutchis
                fail_msg 18
2121 8 ghutchis
sbc_19:         cp      data_aa
2122
                jr      z,sbc_20
2123 11 ghutchis
                fail_msg 19
2124 8 ghutchis
sbc_20:         ld      a,data_55
2125
                ld      h,data_ff
2126
                sbc     a,h
2127
                jr      c,sbc_21
2128 11 ghutchis
                fail_msg 20
2129 8 ghutchis
sbc_21:         ld      h,0
2130
                sbc     a,h
2131
                jr      nc,sbc_22
2132 11 ghutchis
                fail_msg 21
2133 8 ghutchis
sbc_22:         cp      data_55
2134
                jr      z,sbc_23
2135 11 ghutchis
                fail_msg 22
2136 8 ghutchis
sbc_23:         ld      a,data_aa
2137
                ld      l,data_ff
2138
                sbc     a,l
2139
                jr      c,sbc_24
2140 11 ghutchis
                fail_msg 23
2141 8 ghutchis
sbc_24:         ld      l,0
2142
                sbc     a,l
2143
                jr      nc,sbc_25
2144 11 ghutchis
                fail_msg 24
2145 8 ghutchis
sbc_25:         cp      data_aa
2146
                jr      z,sbc_26
2147 11 ghutchis
                fail_msg 25
2148 8 ghutchis
sbc_26:         ld      a,data_7f
2149
                sbc     a,data_ff
2150
                jp      m,sbc_27
2151 11 ghutchis
                fail_msg 26
2152 8 ghutchis
sbc_27:         jp      pe,sbc_28
2153 11 ghutchis
                fail_msg 27
2154 8 ghutchis
sbc_28:         jr      c,sbc_29
2155 11 ghutchis
                fail_msg 28
2156 8 ghutchis
sbc_29:         jr      nz,sbc_30
2157 11 ghutchis
                fail_msg 29
2158 8 ghutchis
sbc_30:         sbc     a,data_7f
2159
                jp      p,sbc_31
2160 11 ghutchis
                fail_msg 30
2161 8 ghutchis
sbc_31:         jp      pe,sbc_32
2162 11 ghutchis
                fail_msg 31
2163 8 ghutchis
sbc_32:         jr      nc,sbc_33
2164 11 ghutchis
                fail_msg 32
2165 8 ghutchis
sbc_33:         jr      z,sbc_34
2166 11 ghutchis
                fail_msg 33
2167 8 ghutchis
sbc_34:         sbc     a,data_ff
2168
                jr      nz,sbc_35
2169 11 ghutchis
                fail_msg 34
2170 8 ghutchis
sbc_35:         cp      1
2171
                jr      z,sbc_36
2172 11 ghutchis
                fail_msg 35
2173 8 ghutchis
sbc_36:         ld      hl,var1
2174
                ld      a,data_7f
2175
                sbc     a,(hl)
2176
                jp      m,sbc_37
2177 11 ghutchis
                fail_msg 36
2178 8 ghutchis
sbc_37:         jp      pe,sbc_38
2179 11 ghutchis
                fail_msg 37
2180 8 ghutchis
sbc_38:         jr      c,sbc_39
2181 11 ghutchis
                fail_msg 38
2182 8 ghutchis
sbc_39:         jr      nz,sbc_40
2183 11 ghutchis
                fail_msg 39
2184 8 ghutchis
sbc_40:         ld      hl,var5
2185
                sbc     a,(hl)
2186
                jp      p,sbc_41
2187 11 ghutchis
                fail_msg 40
2188 8 ghutchis
sbc_41:         jp      pe,sbc_42
2189 11 ghutchis
                fail_msg 41
2190 8 ghutchis
sbc_42:         jr      nc,sbc_43
2191 11 ghutchis
                fail_msg 42
2192 8 ghutchis
sbc_43:         jr      z,sbc_44
2193 11 ghutchis
                fail_msg 43
2194 8 ghutchis
sbc_44:         ld      hl,var2
2195
                sbc     a,(hl)
2196
                jr      nz,sbc_45
2197 11 ghutchis
                fail_msg 44
2198 8 ghutchis
sbc_45:         cp      data_aa+1
2199
                jr      z,sbc_46
2200 11 ghutchis
                fail_msg 45
2201 8 ghutchis
sbc_46:         ld      ix,var3
2202
                ld      a,data_7f
2203
                sbc     a,(ix-2)
2204
                jp      m,sbc_47
2205 11 ghutchis
                fail_msg 46
2206 8 ghutchis
sbc_47:         jp      pe,sbc_48
2207 11 ghutchis
                fail_msg 47
2208 8 ghutchis
sbc_48:         jr      c,sbc_49
2209 11 ghutchis
                fail_msg 48
2210 8 ghutchis
sbc_49:         jr      nz,sbc_50
2211 11 ghutchis
                fail_msg 49
2212 8 ghutchis
sbc_50:         sbc     a,(ix+2)
2213
                jp      p,sbc_51
2214 11 ghutchis
                fail_msg 50
2215 8 ghutchis
sbc_51:         jp      pe,sbc_52
2216 11 ghutchis
                fail_msg 51
2217 8 ghutchis
sbc_52:         jr      nc,sbc_53
2218 11 ghutchis
                fail_msg 52
2219 8 ghutchis
sbc_53:         jr      z,sbc_54
2220 11 ghutchis
                fail_msg 53
2221 8 ghutchis
sbc_54:         sbc     a,(ix-1)
2222
                jr      nz,sbc_55
2223 11 ghutchis
                fail_msg 54
2224 8 ghutchis
sbc_55:         cp      data_aa+1
2225
                jr      z,sbc_56
2226 11 ghutchis
                fail_msg 55
2227 8 ghutchis
sbc_56:         ld      iy,var3
2228
                ld      a,data_7f
2229
                sbc     a,(ix-2)
2230
                jp      m,sbc_57
2231 11 ghutchis
                fail_msg 56
2232 8 ghutchis
sbc_57:         jp      pe,sbc_58
2233 11 ghutchis
                fail_msg 57
2234 8 ghutchis
sbc_58:         jr      c,sbc_59
2235 11 ghutchis
                fail_msg 58
2236 8 ghutchis
sbc_59:         jr      nz,sbc_60
2237 11 ghutchis
                fail_msg 59
2238 8 ghutchis
sbc_60:         sbc     a,(ix+2)
2239
                jp      p,sbc_61
2240 11 ghutchis
                fail_msg 60
2241 8 ghutchis
sbc_61:         jp      pe,sbc_62
2242 11 ghutchis
                fail_msg 61
2243 8 ghutchis
sbc_62:         jr      nc,sbc_63
2244 11 ghutchis
                fail_msg 62
2245 8 ghutchis
sbc_63:         jr      z,sbc_64
2246 11 ghutchis
                fail_msg 63
2247 8 ghutchis
sbc_64:         sbc     a,(ix+1)
2248
                jr      nz,sbc_65
2249 11 ghutchis
                fail_msg 64
2250 8 ghutchis
sbc_65:         cp      data_55+1
2251
                jr      z,and_0
2252 11 ghutchis
                fail_msg 65
2253 15 ghutchis
and_0:          nop
2254
                print   "and_0"
2255
                ld      a,data_ff
2256 8 ghutchis
                add     a,1                     ;set carry
2257
                ld      a,data_ff
2258
                ld      b,data_aa
2259
                and     a,b
2260
                jr      nc,and_1
2261 11 ghutchis
                fail_msg 0
2262 8 ghutchis
and_1:          jp      m,and_2
2263 11 ghutchis
                fail_msg 1
2264 8 ghutchis
and_2:          jp      pe,and_3
2265 11 ghutchis
                fail_msg 2
2266 8 ghutchis
and_3:          jr      nz,and_4
2267 11 ghutchis
                fail_msg 3
2268 8 ghutchis
and_4:          ld      b,data_55
2269
                and     a,b
2270
                jp      p,and_5
2271 11 ghutchis
                fail_msg 4
2272 8 ghutchis
and_5:          jr      z,and_6
2273 11 ghutchis
                fail_msg 5
2274 8 ghutchis
and_6:          ld      a,data_ff
2275
                ld      b,data_7f
2276
                and     a,b
2277
                jp      po,and_7
2278 11 ghutchis
                fail_msg 6
2279 8 ghutchis
and_7:          ld      b,data_55
2280
                and     a,b
2281
                jp      pe,and_8
2282 11 ghutchis
                fail_msg 7
2283 8 ghutchis
and_8:          ld      a,data_ff
2284
                ld      c,data_80
2285
                and     a,c
2286
                jp      m,and_9
2287 11 ghutchis
                fail_msg 8
2288 8 ghutchis
and_9:          cp      data_80
2289
                jr      z,and_10
2290 11 ghutchis
                fail_msg 9
2291 8 ghutchis
and_10:         ld      a,data_ff
2292
                ld      d,data_7f
2293
                and     a,d
2294
                jp      p,and_11
2295 11 ghutchis
                fail_msg 10
2296 8 ghutchis
and_11:         cp      data_7f
2297
                jr      z,and_12
2298 11 ghutchis
                fail_msg 11
2299 8 ghutchis
and_12:         ld      a,data_ff
2300
                ld      e,data_aa
2301
                and     a,e
2302
                jp      m,and_13
2303 11 ghutchis
                fail_msg 12
2304 8 ghutchis
and_13:         cp      data_aa
2305
                jr      z,and_14
2306 11 ghutchis
                fail_msg 13
2307 8 ghutchis
and_14:         ld      a,data_ff
2308
                ld      h,data_55
2309
                and     a,h
2310
                jp      p,and_15
2311 11 ghutchis
                fail_msg 14
2312 8 ghutchis
and_15:         cp      data_55
2313
                jr      z,and_16
2314 11 ghutchis
                fail_msg 15
2315 8 ghutchis
and_16:         ld      a,data_ff
2316
                ld      l,data_aa
2317
                and     a,l
2318
                jp      m,and_17
2319 11 ghutchis
                fail_msg 16
2320 8 ghutchis
and_17:         cp      data_aa
2321
                jr      z,and_18
2322 11 ghutchis
                fail_msg 17
2323 8 ghutchis
and_18:         ld      a,data_ff
2324
                and     a,data_aa
2325
                jp      m,and_19
2326 11 ghutchis
                fail_msg 18
2327 8 ghutchis
and_19:         jr      nz,and_20
2328 11 ghutchis
                fail_msg 19
2329 8 ghutchis
and_20:         and     a,data_55
2330
                jp      p,and_21
2331 11 ghutchis
                fail_msg 20
2332 8 ghutchis
and_21:         jr      z,and_22
2333 11 ghutchis
                fail_msg 21
2334 8 ghutchis
and_22:         ld      a,data_ff
2335
                and     a,data_7f
2336
                jp      po,and_23
2337 11 ghutchis
                fail_msg 22
2338 8 ghutchis
and_23:         and     a,data_55
2339
                jp      pe,and_24
2340 11 ghutchis
                fail_msg 23
2341 8 ghutchis
and_24:         jr      nz,and_25
2342 11 ghutchis
                fail_msg 24
2343 8 ghutchis
and_25:         and     a,data_aa
2344
                jr      z,and_26
2345 11 ghutchis
                fail_msg 25
2346 8 ghutchis
and_26:         ld      a,data_ff
2347
                and     a,data_aa
2348
                cp      data_aa
2349
                jr      z,and_27
2350 11 ghutchis
                fail_msg 26
2351 8 ghutchis
and_27:         ld      hl,var4
2352
                ld      a,data_ff
2353
                and     a,(hl)
2354
                jp      m,and_28
2355 11 ghutchis
                fail_msg 27
2356 8 ghutchis
and_28:         jr      nz,and_29
2357 11 ghutchis
                fail_msg 28
2358 8 ghutchis
and_29:         ld      hl,var2
2359
                and     a,(hl)
2360
                jp      p,and_30
2361 11 ghutchis
                fail_msg 29
2362 8 ghutchis
and_30:         jr      z,and_31
2363 11 ghutchis
                fail_msg 30
2364 8 ghutchis
and_31:         ld      a,data_ff
2365
                ld      hl,var5
2366
                and     a,(hl)
2367
                jp      po,and_32
2368 11 ghutchis
                fail_msg 31
2369 8 ghutchis
and_32:         ld      hl,var2
2370
                and     a,(hl)
2371
                jp      pe,and_33
2372 11 ghutchis
                fail_msg 32
2373 8 ghutchis
and_33:         cp      data_55
2374
                jr      z,and_34
2375 11 ghutchis
                fail_msg 33
2376 8 ghutchis
and_34:         ld      ix,var3
2377
                ld      a,data_ff
2378
                and     a,(ix+1)
2379
                jp      m,and_35
2380 11 ghutchis
                fail_msg 34
2381 8 ghutchis
and_35:         jr      nz,and_36
2382 11 ghutchis
                fail_msg 35
2383 8 ghutchis
and_36:         and     a,(ix-1)
2384
                jp      p,and_37
2385 11 ghutchis
                fail_msg 36
2386 8 ghutchis
and_37:         jr      z,and_38
2387 11 ghutchis
                fail_msg 37
2388 8 ghutchis
and_38:         ld      a,data_ff
2389
                and     a,(ix+2)
2390
                jp      po,and_39
2391 11 ghutchis
                fail_msg 38
2392 8 ghutchis
and_39:         and     a,(ix-1)
2393
                jp      pe,and_40
2394 11 ghutchis
                fail_msg 39
2395 8 ghutchis
and_40:         cp      data_55
2396
                jr      z,and_41
2397 11 ghutchis
                fail_msg 40
2398 8 ghutchis
and_41:         ld      iy,var3
2399
                ld      a,data_ff
2400
                and     a,(iy+1)
2401
                jp      m,and_42
2402 11 ghutchis
                fail_msg 41
2403 8 ghutchis
and_42:         jr      nz,and_43
2404 11 ghutchis
                fail_msg 42
2405 8 ghutchis
and_43:         and     a,(iy-1)
2406
                jp      p,and_44
2407 11 ghutchis
                fail_msg 43
2408 8 ghutchis
and_44:         jr      z,and_45
2409 11 ghutchis
                fail_msg 44
2410 8 ghutchis
and_45:         ld      a,data_ff
2411
                and     a,(iy+2)
2412
                jp      po,and_46
2413 11 ghutchis
                fail_msg 45
2414 8 ghutchis
and_46:         and     a,(iy-1)
2415
                jp      pe,and_47
2416 11 ghutchis
                fail_msg 46
2417 8 ghutchis
and_47:         cp      data_55
2418
                jr      z,or_0
2419 11 ghutchis
                fail_msg 47
2420 15 ghutchis
or_0:           nop
2421
                print   "or_0"
2422
                ld      a,0
2423 8 ghutchis
                ld      b,data_7f
2424
                or      a,b
2425
                jp      p,or_1
2426 11 ghutchis
                fail_msg 0
2427 8 ghutchis
or_1:           jp      po,or_2
2428 11 ghutchis
                fail_msg 1
2429 8 ghutchis
or_2:           ld      b,data_80
2430
                or      a,b
2431
                jp      m,or_3
2432 11 ghutchis
                fail_msg 2
2433 8 ghutchis
or_3:           jp      pe,or_4
2434 11 ghutchis
                fail_msg 3
2435 8 ghutchis
or_4:           cp      data_ff
2436
                jr      z,or_5
2437 11 ghutchis
                fail_msg 4
2438 8 ghutchis
or_5:           ld      a,0
2439
                ld      b,0
2440
                or      a,b
2441
                jr      z,or_6
2442 11 ghutchis
                fail_msg 5
2443 8 ghutchis
or_6:           ld      b,data_55
2444
                or      a,b
2445
                jr      nz,or_7
2446 11 ghutchis
                fail_msg 6
2447 8 ghutchis
or_7:           cp      data_55
2448
                jr      z,or_8
2449 11 ghutchis
                fail_msg 7
2450 8 ghutchis
or_8:           ld      a,data_ff
2451
                add     a,1
2452
                jr      c,or_9
2453 11 ghutchis
                fail_msg 8
2454 8 ghutchis
or_9:           ld      b,data_7f
2455
                or      a,b
2456
                jr      nc,or_10
2457 11 ghutchis
                fail_msg 9
2458 8 ghutchis
or_10:          cp      data_7f
2459
                jr      z,or_11
2460 11 ghutchis
                fail_msg 10
2461 8 ghutchis
or_11:          ld      a,0
2462
                ld      c,data_55
2463
                or      a,c
2464
                cp      data_55
2465
                jr      z,or_12
2466 11 ghutchis
                fail_msg 11
2467 8 ghutchis
or_12:          ld      c,data_aa
2468
                or      a,c
2469
                cp      data_ff
2470
                jr      z,or_13
2471 11 ghutchis
                fail_msg 12
2472 8 ghutchis
or_13:          ld      a,0
2473
                ld      d,data_aa
2474
                or      a,d
2475
                cp      data_aa
2476
                jr      z,or_14
2477 11 ghutchis
                fail_msg 13
2478 8 ghutchis
or_14:          ld      e,data_55
2479
                or      a,e
2480
                cp      data_ff
2481
                jr      z,or_15
2482 11 ghutchis
                fail_msg 14
2483 8 ghutchis
or_15:          ld      a,0
2484
                ld      h,data_80
2485
                or      a,h
2486
                cp      data_80
2487
                jr      z,or_16
2488 11 ghutchis
                fail_msg 15
2489 8 ghutchis
or_16:          ld      l,data_7f
2490
                or      a,l
2491
                cp      data_ff
2492
                jr      z,or_17
2493 11 ghutchis
                fail_msg 16
2494 8 ghutchis
or_17:          ld      a,0
2495
                or      a,data_7f
2496
                jp      p,or_18
2497 11 ghutchis
                fail_msg 17
2498 8 ghutchis
or_18:          jp      po,or_19
2499 11 ghutchis
                fail_msg 18
2500 8 ghutchis
or_19:          or      a,data_80
2501
                jp      m,or_20
2502 11 ghutchis
                fail_msg 19
2503 8 ghutchis
or_20:          jp      pe,or_21
2504 11 ghutchis
                fail_msg 20
2505 8 ghutchis
or_21:          cp      data_ff
2506
                jr      z,or_22
2507 11 ghutchis
                fail_msg 21
2508 8 ghutchis
or_22:          ld      a,0
2509
                or      a,0
2510
                jr      z,or_23
2511 11 ghutchis
                fail_msg 22
2512 8 ghutchis
or_23:          or      a,data_7f
2513
                jr      nz,or_24
2514 11 ghutchis
                fail_msg 23
2515 8 ghutchis
or_24:          ld      a,data_ff
2516
                add     a,1
2517
                jr      c,or_25
2518 11 ghutchis
                fail_msg 24
2519 8 ghutchis
or_25:          or      a,data_55
2520
                jr      nc,or_26
2521 11 ghutchis
                fail_msg 25
2522 8 ghutchis
or_26:          cp      data_55
2523
                jr      z,or_27
2524 11 ghutchis
                fail_msg 26
2525 8 ghutchis
or_27:          ld      hl,var5
2526
                ld      a,0
2527
                or      a,(hl)
2528
                jp      p,or_28
2529 11 ghutchis
                fail_msg 27
2530 8 ghutchis
or_28:          jp      po,or_29
2531 11 ghutchis
                fail_msg 28
2532 8 ghutchis
or_29:          ld      hl,var3
2533
                or      a,(hl)
2534
                jp      m,or_30
2535 11 ghutchis
                fail_msg 29
2536 8 ghutchis
or_30:          jp      pe,or_31
2537 11 ghutchis
                fail_msg 30
2538 8 ghutchis
or_31:          cp      data_ff
2539
                jr      z,or_32
2540 11 ghutchis
                fail_msg 31
2541 8 ghutchis
or_32:          ld      hl,t_var1
2542
                ld      a,0
2543
                ld      (hl),a
2544
                or      a,(hl)
2545
                jr      z,or_33
2546 11 ghutchis
                fail_msg 32
2547 8 ghutchis
or_33:          ld      hl,var2
2548
                or      a,(hl)
2549
                jr      nz,or_34
2550 11 ghutchis
                fail_msg 33
2551 8 ghutchis
or_34:          cp      data_55
2552
                jr      z,or_35
2553 11 ghutchis
                fail_msg 34
2554 8 ghutchis
or_35:          ld      ix,var3
2555
                ld      a,0
2556
                or      a,(ix+2)
2557
                jp      p,or_36
2558 11 ghutchis
                fail_msg 35
2559 8 ghutchis
or_36:          jp      po,or_37
2560 11 ghutchis
                fail_msg 36
2561 8 ghutchis
or_37:          or      a,(ix+0)
2562
                jp      m,or_38
2563 11 ghutchis
                fail_msg 37
2564 8 ghutchis
or_38:          jp      pe,or_39
2565 11 ghutchis
                fail_msg 38
2566 8 ghutchis
or_39:          cp      data_ff
2567
                jr      z,or_40
2568 11 ghutchis
                fail_msg 39
2569 8 ghutchis
or_40:          ld      ix,t_var3
2570
                ld      a,0
2571
                ld      (ix-2),a
2572
                or      a,(ix-2)
2573
                jr      z,or_41
2574 11 ghutchis
                fail_msg 40
2575 8 ghutchis
or_41:          ld      (ix+2),data_aa
2576
                or      a,(ix+2)
2577
                jr      nz,or_42
2578 11 ghutchis
                fail_msg 41
2579 8 ghutchis
or_42:          cp      data_aa
2580
                jr      z,or_43
2581 11 ghutchis
                fail_msg 42
2582 8 ghutchis
or_43:          ld      iy,var3
2583
                ld      a,0
2584
                or      a,(iy+2)
2585
                jp      p,or_44
2586 11 ghutchis
                fail_msg 43
2587 8 ghutchis
or_44:          jp      po,or_45
2588 11 ghutchis
                fail_msg 44
2589 8 ghutchis
or_45:          or      a,(iy+0)
2590
                jp      m,or_46
2591 11 ghutchis
                fail_msg 45
2592 8 ghutchis
or_46:          jp      pe,or_47
2593 11 ghutchis
                fail_msg 46
2594 8 ghutchis
or_47:          cp      data_ff
2595
                jr      z,or_48
2596 11 ghutchis
                fail_msg 47
2597 8 ghutchis
or_48:          ld      iy,t_var3
2598
                ld      a,0
2599
                ld      (iy-2),a
2600
                or      a,(iy-2)
2601
                jr      z,or_49
2602 11 ghutchis
                fail_msg 48
2603 8 ghutchis
or_49:          ld      (iy+2),data_55
2604
                or      a,(iy+2)
2605
                jr      nz,or_50
2606 11 ghutchis
                fail_msg 49
2607 8 ghutchis
or_50:          cp      data_55
2608
                jr      z,xor_0
2609 11 ghutchis
                fail_msg 50
2610 15 ghutchis
xor_0:          nop
2611
                print   "xor_0"
2612
                ld      a,data_ff
2613 8 ghutchis
                ld      b,data_55
2614
                xor     a,b
2615
                jp      m,xor_1
2616 11 ghutchis
                fail_msg 0
2617 8 ghutchis
xor_1:          jp      pe,xor_2
2618 11 ghutchis
                fail_msg 1
2619 8 ghutchis
xor_2:          ld      b,data_80
2620
                xor     a,b
2621
                jp      p,xor_3
2622 11 ghutchis
                fail_msg 2
2623 8 ghutchis
xor_3:          jp      po,xor_4
2624 11 ghutchis
                fail_msg 3
2625 8 ghutchis
xor_4:          cp      #2a
2626
                jr      z,xor_5
2627 11 ghutchis
                fail_msg 4
2628 8 ghutchis
xor_5:          ld      a,data_ff
2629
                ld      b,data_ff
2630
                xor     a,b
2631
                jr      z,xor_6
2632 11 ghutchis
                fail_msg 5
2633 8 ghutchis
xor_6:          ld      b,data_55
2634
                xor     a,b
2635
                jr      nz,xor_7
2636 11 ghutchis
                fail_msg 6
2637 8 ghutchis
xor_7:          cp      data_55
2638
                jr      z,xor_8
2639 11 ghutchis
                fail_msg 7
2640 8 ghutchis
xor_8:          ld      a,data_ff
2641
                add     a,1
2642
                jr      c,xor_9
2643 11 ghutchis
                fail_msg 8
2644 8 ghutchis
xor_9:          ld      b,data_aa
2645
                xor     a,b
2646
                jr      nc,xor_10
2647 11 ghutchis
                fail_msg 9
2648 8 ghutchis
xor_10:         cp      data_aa
2649
                jr      z,xor_11
2650 11 ghutchis
                fail_msg 10
2651 8 ghutchis
xor_11:         ld      a,data_ff
2652
                ld      c,data_7f
2653
                xor     a,c
2654
                jp      m,xor_12
2655 11 ghutchis
                fail_msg 11
2656 8 ghutchis
xor_12:         cp      data_80
2657
                jr      z,xor_13
2658 11 ghutchis
                fail_msg 12
2659 8 ghutchis
xor_13:         ld      a,data_ff
2660
                ld      d,data_55
2661
                xor     a,d
2662
                jp      m,xor_14
2663 11 ghutchis
                fail_msg 13
2664 8 ghutchis
xor_14:         cp      data_aa
2665
                jr      z,xor_15
2666 11 ghutchis
                fail_msg 14
2667 8 ghutchis
xor_15:         ld      e,data_55
2668
                xor     a,e
2669
                jp      m,xor_16
2670 11 ghutchis
                fail_msg 15
2671 8 ghutchis
xor_16:         cp      data_ff
2672
                jr      z,xor_17
2673 11 ghutchis
                fail_msg 16
2674 8 ghutchis
xor_17:         ld      a,data_ff
2675
                ld      h,data_7f
2676
                xor     a,h
2677
                jp      po,xor_18
2678 11 ghutchis
                fail_msg 17
2679 8 ghutchis
xor_18:         ld      l,data_7f
2680
                xor     a,l
2681
                jp      pe,xor_19
2682 11 ghutchis
                fail_msg 18
2683 8 ghutchis
xor_19:         cp      data_ff
2684
                jr      z,xor_20
2685 11 ghutchis
                fail_msg 19
2686 8 ghutchis
xor_20:         ld      a,data_ff
2687
                add     a,1
2688
                jr      c,xor_21
2689 11 ghutchis
                fail_msg 20
2690 8 ghutchis
xor_21:         ld      b,data_7f
2691
                xor     a,b
2692
                jr      nc,xor_22
2693 11 ghutchis
                fail_msg 21
2694 8 ghutchis
xor_22:         cp      data_7f
2695
                jr      z,xor_23
2696 11 ghutchis
                fail_msg 22
2697 8 ghutchis
xor_23:         ld      a,data_ff
2698
                xor     a,data_7f
2699
                jp      po,xor_24
2700 11 ghutchis
                fail_msg 23
2701 8 ghutchis
xor_24:         jp      m,xor_25
2702 11 ghutchis
                fail_msg 24
2703 8 ghutchis
xor_25:         xor     a,data_7f
2704
                jp      pe,xor_26
2705 11 ghutchis
                fail_msg 25
2706 8 ghutchis
xor_26:         jp      m,xor_27
2707 11 ghutchis
                fail_msg 26
2708 8 ghutchis
xor_27:         xor     a,data_aa
2709
                jp      p,xor_28
2710 11 ghutchis
                fail_msg 27
2711 8 ghutchis
xor_28:         cp      data_55
2712
                jr      z,xor_29
2713 11 ghutchis
                fail_msg 28
2714 8 ghutchis
xor_29:         ld      a,data_ff
2715
                xor     a,data_ff
2716
                jr      z,xor_30
2717 11 ghutchis
                fail_msg 29
2718 8 ghutchis
xor_30:         xor     a,data_80
2719
                jr      nz,xor_31
2720 11 ghutchis
                fail_msg 30
2721 8 ghutchis
xor_31:         cp      data_80
2722
                jr      z,xor_32
2723 11 ghutchis
                fail_msg 31
2724 8 ghutchis
xor_32:         ld      hl,var5
2725
                ld      a,data_ff
2726
                xor     a,(hl)
2727
                jp      m,xor_33
2728 11 ghutchis
                fail_msg 32
2729 8 ghutchis
xor_33:         jp      po,xor_34
2730 11 ghutchis
                fail_msg 33
2731 8 ghutchis
xor_34:         xor     a,(hl)
2732
                jp      m,xor_35
2733 11 ghutchis
                fail_msg 34
2734 8 ghutchis
xor_35:         jp      pe,xor_36
2735 11 ghutchis
                fail_msg 35
2736 8 ghutchis
xor_36:         ld      hl,var3
2737
                xor     a,(hl)
2738
                jp      p,xor_37
2739 11 ghutchis
                fail_msg 36
2740 8 ghutchis
xor_37:         cp      data_7f
2741
                jr      z,xor_38
2742 11 ghutchis
                fail_msg 37
2743 8 ghutchis
xor_38:         ld      hl,var1
2744
                ld      a,data_ff
2745
                xor     a,(hl)
2746
                jr      z,xor_39
2747 11 ghutchis
                fail_msg 38
2748 8 ghutchis
xor_39:         ld      hl,var2
2749
                xor     a,(hl)
2750
                jr      nz,xor_40
2751 11 ghutchis
                fail_msg 39
2752 8 ghutchis
xor_40:         cp      data_55
2753
                jr      z,xor_41
2754 11 ghutchis
                fail_msg 40
2755 8 ghutchis
xor_41:         ld      ix,var3
2756
                ld      a,data_ff
2757
                xor     a,(ix+2)
2758
                jp      m,xor_42
2759 11 ghutchis
                fail_msg 41
2760 8 ghutchis
xor_42:         jp      po,xor_43
2761 11 ghutchis
                fail_msg 42
2762 8 ghutchis
xor_43:         xor     a,(ix+2)
2763
                jp      m,xor_44
2764 11 ghutchis
                fail_msg 43
2765 8 ghutchis
xor_44:         jp      pe,xor_45
2766 11 ghutchis
                fail_msg 44
2767 8 ghutchis
xor_45:         xor     a,(ix+1)
2768
                jp      p,xor_46
2769 11 ghutchis
                fail_msg 45
2770 8 ghutchis
xor_46:         cp      data_55
2771
                jr      z,xor_47
2772 11 ghutchis
                fail_msg 46
2773 8 ghutchis
xor_47:         ld      a,data_ff
2774
                xor     a,(ix-2)
2775
                jr      z,xor_48
2776 11 ghutchis
                fail_msg 47
2777 8 ghutchis
xor_48:         xor     a,(ix+1)
2778
                jr      nz,xor_49
2779 11 ghutchis
                fail_msg 48
2780 8 ghutchis
xor_49:         cp      data_aa
2781
                jr      z,xor_50
2782 11 ghutchis
                fail_msg 49
2783 8 ghutchis
xor_50:         ld      iy,var3
2784
                ld      a,data_ff
2785
                xor     a,(iy+2)
2786
                jp      m,xor_51
2787 11 ghutchis
                fail_msg 50
2788 8 ghutchis
xor_51:         jp      po,xor_52
2789 11 ghutchis
                fail_msg 51
2790 8 ghutchis
xor_52:         xor     a,(iy+2)
2791
                jp      m,xor_53
2792 11 ghutchis
                fail_msg 52
2793 8 ghutchis
xor_53:         jp      pe,xor_54
2794 11 ghutchis
                fail_msg 53
2795 8 ghutchis
xor_54:         xor     a,(iy+1)
2796
                jp      p,xor_55
2797 11 ghutchis
                fail_msg 54
2798 8 ghutchis
xor_55:         cp      data_55
2799
                jr      z,xor_56
2800 11 ghutchis
                fail_msg 55
2801 8 ghutchis
xor_56:         ld      a,data_ff
2802
                xor     a,(iy-2)
2803
                jr      z,xor_57
2804 11 ghutchis
                fail_msg 56
2805 8 ghutchis
xor_57:         xor     a,(iy-1)
2806
                jr      nz,xor_58
2807 11 ghutchis
                fail_msg 57
2808 8 ghutchis
xor_58:         cp      data_55
2809
                jr      z,cp_0
2810 11 ghutchis
                fail_msg 58
2811 15 ghutchis
cp_0:           nop
2812
                print   "cp_0"
2813
                ld      a,0
2814 8 ghutchis
                ld      b,0
2815
                cp      a,b
2816
                jr      z,cp_1
2817 11 ghutchis
                fail_msg 0
2818 8 ghutchis
cp_1:           jp      p,cp_2
2819 11 ghutchis
                fail_msg 1
2820 8 ghutchis
cp_2:           jr      nc,cp_3
2821 11 ghutchis
                fail_msg 2
2822 8 ghutchis
cp_3:           ld      b,data_55
2823
                cp      a,b
2824
                jr      nz,cp_4
2825 11 ghutchis
                fail_msg 3
2826 8 ghutchis
cp_4:           jp      m,cp_5
2827 11 ghutchis
                fail_msg 4
2828 8 ghutchis
cp_5:           jr      c,cp_6
2829 11 ghutchis
                fail_msg 5
2830 8 ghutchis
cp_6:           ld      a,data_80
2831
                ld      b,data_7f
2832
                cp      a,b
2833
                jp      pe,cp_7
2834 11 ghutchis
                fail_msg 6
2835 8 ghutchis
cp_7:           jr      nc,cp_8
2836 11 ghutchis
                fail_msg 7
2837 8 ghutchis
cp_8:           ld      a,data_7f
2838
                ld      b,data_80
2839
                cp      a,b
2840
                jp      pe,cp_9
2841 11 ghutchis
                fail_msg 8
2842 8 ghutchis
cp_9:           jr      c,cp_10
2843 11 ghutchis
                fail_msg 9
2844 8 ghutchis
cp_10:          ld      b,0
2845
                cp      a,b
2846
                jp      po,cp_11
2847 11 ghutchis
                fail_msg 10
2848 8 ghutchis
cp_11:          jr      nc,cp_12
2849 11 ghutchis
                fail_msg 11
2850 8 ghutchis
cp_12:          ld      a,data_80
2851
                ld      c,0
2852
                cp      a,c
2853
                jp      m,cp_13
2854 11 ghutchis
                fail_msg 12
2855 8 ghutchis
cp_13:          ld      c,data_80
2856
                cp      a,c
2857
                jr      z,cp_14
2858 11 ghutchis
                fail_msg 13
2859 8 ghutchis
cp_14:          ld      a,data_7f
2860
                ld      d,data_55
2861
                cp      a,d
2862
                jp      p,cp_15
2863 11 ghutchis
                fail_msg 14
2864 8 ghutchis
cp_15:          jr      nz,cp_16
2865 11 ghutchis
                fail_msg 15
2866 8 ghutchis
cp_16:          ld      e,data_7f
2867
                cp      a,e
2868
                jr      z,cp_17
2869 11 ghutchis
                fail_msg 16
2870 8 ghutchis
cp_17:          ld      a,data_80
2871
                ld      h,data_ff
2872
                cp      a,h
2873
                jp      m,cp_18
2874 11 ghutchis
                fail_msg 17
2875 8 ghutchis
cp_18:          jr      c,cp_19
2876 11 ghutchis
                fail_msg 18
2877 8 ghutchis
cp_19:          ld      l,data_80
2878
                cp      a,l
2879
                jr      z,cp_20
2880 11 ghutchis
                fail_msg 19
2881 8 ghutchis
cp_20:          ld      a,data_80
2882
                cp      a,data_7f
2883
                jp      p,cp_21
2884 11 ghutchis
                fail_msg 20
2885 8 ghutchis
cp_21:          jp      pe,cp_22
2886 11 ghutchis
                fail_msg 21
2887 8 ghutchis
cp_22:          jr      nz,cp_23
2888 11 ghutchis
                fail_msg 22
2889 8 ghutchis
cp_23:          cp      a,data_80
2890
                jp      p,cp_24
2891 11 ghutchis
                fail_msg 23
2892 8 ghutchis
cp_24:          jp      po,cp_25
2893 11 ghutchis
                fail_msg 24
2894 8 ghutchis
cp_25:          jr      z,cp_26
2895 11 ghutchis
                fail_msg 25
2896 8 ghutchis
cp_26:          ld      a,data_55
2897
                cp      a,data_7f
2898
                jr      c,cp_27
2899 11 ghutchis
                fail_msg 26
2900 8 ghutchis
cp_27:          jp      m,cp_28
2901 11 ghutchis
                fail_msg 27
2902 8 ghutchis
cp_28:          cp      a,data_55
2903
                jr      nc,cp_29
2904 11 ghutchis
                fail_msg 28
2905 8 ghutchis
cp_29:          jr      z,cp_30
2906 11 ghutchis
                fail_msg 29
2907 8 ghutchis
cp_30:          ld      a,data_80
2908
                ld      hl,var5
2909
                cp      a,(hl)
2910
                jp      p,cp_31
2911 11 ghutchis
                fail_msg 30
2912 8 ghutchis
cp_31:          jp      pe,cp_32
2913 11 ghutchis
                fail_msg 31
2914 8 ghutchis
cp_32:          jr      nz,cp_33
2915 11 ghutchis
                fail_msg 32
2916 8 ghutchis
cp_33:          ld      hl,var3
2917
                cp      a,(hl)
2918
                jp      p,cp_34
2919 11 ghutchis
                fail_msg 33
2920 8 ghutchis
cp_34:          jp      po,cp_35
2921 11 ghutchis
                fail_msg 34
2922 8 ghutchis
cp_35:          jr      z,cp_36
2923 11 ghutchis
                fail_msg 35
2924 8 ghutchis
cp_36:          ld      a,data_55
2925
                ld      hl,var5
2926
                cp      a,(hl)
2927
                jr      c,cp_37
2928 11 ghutchis
                fail_msg 36
2929 8 ghutchis
cp_37:          jp      m,cp_38
2930 11 ghutchis
                fail_msg 37
2931 8 ghutchis
cp_38:          ld      hl,var2
2932
                cp      a,(hl)
2933
                jr      nc,cp_39
2934 11 ghutchis
                fail_msg 38
2935 8 ghutchis
cp_39:          jp      p,cp_40
2936 11 ghutchis
                fail_msg 39
2937 8 ghutchis
cp_40:          jr      z,cp_41
2938 11 ghutchis
                fail_msg 40
2939 8 ghutchis
cp_41:          ld      a,data_80
2940
                ld      ix,var3
2941
                cp      a,(ix+2)
2942
                jp      p,cp_42
2943 11 ghutchis
                fail_msg 41
2944 8 ghutchis
cp_42:          jp      pe,cp_43
2945 11 ghutchis
                fail_msg 42
2946 8 ghutchis
cp_43:          jr      nz,cp_44
2947 11 ghutchis
                fail_msg 43
2948 8 ghutchis
cp_44:          cp      a,(ix+0)
2949
                jp      p,cp_45
2950 11 ghutchis
                fail_msg 44
2951 8 ghutchis
cp_45:          jp      po,cp_46
2952 11 ghutchis
                fail_msg 45
2953 8 ghutchis
cp_46:          jr      z,cp_47
2954 11 ghutchis
                fail_msg 46
2955 8 ghutchis
cp_47:          ld      a,data_55
2956
                cp      a,(ix-2)
2957
                jr      nz,cp_48
2958 11 ghutchis
                fail_msg 47
2959 8 ghutchis
cp_48:          jr      c,cp_49
2960 11 ghutchis
                fail_msg 48
2961 8 ghutchis
cp_49:          cp      a,(ix-1)
2962
                jr      z,cp_50
2963 11 ghutchis
                fail_msg 49
2964 8 ghutchis
cp_50:          jr      nc,cp_51
2965 11 ghutchis
                fail_msg 50
2966 8 ghutchis
cp_51:          ld      iy,var3
2967
                ld      a,data_80
2968
                cp      a,(iy+2)
2969
                jp      p,cp_52
2970 11 ghutchis
                fail_msg 51
2971 8 ghutchis
cp_52:          jp      pe,cp_53
2972 11 ghutchis
                fail_msg 52
2973 8 ghutchis
cp_53:          jr      nz,cp_54
2974 11 ghutchis
                fail_msg 53
2975 8 ghutchis
cp_54:          cp      a,(iy+0)
2976
                jp      p,cp_55
2977 11 ghutchis
                fail_msg 54
2978 8 ghutchis
cp_55:          jp      po,cp_56
2979 11 ghutchis
                fail_msg 55
2980 8 ghutchis
cp_56:          jr      z,cp_57
2981 11 ghutchis
                fail_msg 56
2982 8 ghutchis
cp_57:          ld      a,data_55
2983
                cp      a,(iy-2)
2984
                jr      nz,cp_58
2985 11 ghutchis
                fail_msg 57
2986 8 ghutchis
cp_58:          jr      c,cp_59
2987 11 ghutchis
                fail_msg 58
2988 8 ghutchis
cp_59:          cp      a,(iy-1)
2989
                jr      z,cp_60
2990 11 ghutchis
                fail_msg 59
2991 8 ghutchis
cp_60:          jr      nc,inc_0
2992 11 ghutchis
                fail_msg 60
2993 17 ghutchis
inc_0:          nop
2994
                print "inc"
2995
                ld      a,data_7f
2996 8 ghutchis
                cp      a,data_7f
2997
                jr      z,inc_1
2998 11 ghutchis
                fail_msg 0
2999 8 ghutchis
inc_1:          inc     a
3000
                jp      pe,inc_2
3001 11 ghutchis
                fail_msg 1
3002 8 ghutchis
inc_2:          jp      m,inc_3
3003 11 ghutchis
                fail_msg 2
3004 8 ghutchis
inc_3:          jr      nz,inc_4
3005 11 ghutchis
                fail_msg 3
3006 8 ghutchis
inc_4:          ld      a,data_55
3007
                inc     a
3008
                jp      po,inc_5
3009 11 ghutchis
                fail_msg 4
3010 8 ghutchis
inc_5:          jp      p,inc_6
3011 11 ghutchis
                fail_msg 5
3012 8 ghutchis
inc_6:          cp      a,data_55+1
3013
                jr      z,inc_7
3014 11 ghutchis
                fail_msg 6
3015 8 ghutchis
inc_7:          ld      a,data_ff-1
3016
                inc     a
3017
                jr      nz,inc_8
3018 11 ghutchis
                fail_msg 7
3019 8 ghutchis
inc_8:          jp      m,inc_9
3020 11 ghutchis
                fail_msg 8
3021 8 ghutchis
inc_9:          inc     a
3022
                jr      z,inc_10
3023 11 ghutchis
                fail_msg 9
3024 8 ghutchis
inc_10:         ld      b,data_aa
3025
                inc     b
3026
                jp      m,inc_11
3027 11 ghutchis
                fail_msg 10
3028 8 ghutchis
inc_11:         ld      a,b
3029
                cp      a,data_aa+1
3030
                jr      z,inc_12
3031 11 ghutchis
                fail_msg 11
3032 8 ghutchis
inc_12:         ld      c,data_80
3033
                inc     c
3034
                jp      m,inc_13
3035 11 ghutchis
                fail_msg 12
3036 8 ghutchis
inc_13:         ld      a,c
3037
                cp      a,data_80+1
3038
                jr      z,inc_14
3039 11 ghutchis
                fail_msg 13
3040 8 ghutchis
inc_14:         ld      d,data_ff
3041
                inc     d
3042
                jr      z,inc_15
3043 11 ghutchis
                fail_msg 14
3044 8 ghutchis
inc_15:         ld      e,data_55
3045
                inc     e
3046
                jp      p,inc_16
3047 11 ghutchis
                fail_msg 15
3048 8 ghutchis
inc_16:         ld      a,e
3049
                cp      a,data_55+1
3050
                jr      z,inc_17
3051 11 ghutchis
                fail_msg 16
3052 8 ghutchis
inc_17:         ld      h,data_7f
3053
                inc     h
3054
                jp      pe,inc_18
3055 11 ghutchis
                fail_msg 17
3056 8 ghutchis
inc_18:         ld      a,h
3057
                cp      a,data_80
3058
                jr      z,inc_19
3059 11 ghutchis
                fail_msg 18
3060 8 ghutchis
inc_19:         ld      l,data_aa
3061
                inc     l
3062
                jp      m,inc_20
3063 11 ghutchis
                fail_msg 19
3064 8 ghutchis
inc_20:         ld      a,l
3065
                cp      a,data_aa+1
3066
                jr      z,inc_21
3067 11 ghutchis
                fail_msg 20
3068 8 ghutchis
inc_21:         ld      hl,t_var1
3069
                ld      a,data_7f
3070
                ld      (hl),a
3071
                cp      a,(hl)
3072
                jr      z,inc_22
3073 11 ghutchis
                fail_msg 21
3074 8 ghutchis
inc_22:         inc     (hl)
3075
                jp      m,inc_23
3076 11 ghutchis
                fail_msg 22
3077 8 ghutchis
inc_23:         jp      pe,inc_24
3078 11 ghutchis
                fail_msg 23
3079 8 ghutchis
inc_24:         ld      a,data_55
3080
                ld      (hl),a
3081
                inc     (hl)
3082
                jp      p,inc_25
3083 11 ghutchis
                fail_msg 24
3084 8 ghutchis
inc_25:         jp      po,inc_26
3085 11 ghutchis
                fail_msg 25
3086 8 ghutchis
inc_26:         ld      a,(hl)
3087
                cp      a,data_55+1
3088
                jr      z,inc_27
3089 11 ghutchis
                fail_msg 26
3090 8 ghutchis
inc_27:         ld      a,data_ff
3091
                ld      (hl),a
3092
                inc     (hl)
3093
                jr      z,inc_28
3094 11 ghutchis
                fail_msg 27
3095 8 ghutchis
inc_28:         inc     (hl)
3096
                jr      nz,inc_29
3097 11 ghutchis
                fail_msg 28
3098 8 ghutchis
inc_29:         ld      a,(hl)
3099
                cp      a,1
3100
                jr      z,inc_30
3101 11 ghutchis
                fail_msg 29
3102 8 ghutchis
inc_30:         ld      a,data_aa
3103
                ld      (hl),a
3104
                inc     (hl)
3105
                jp      m,inc_31
3106 11 ghutchis
                fail_msg 30
3107 8 ghutchis
inc_31:         ld      a,(hl)
3108
                cp      a,data_aa+1
3109
                jr      z,inc_32
3110 11 ghutchis
                fail_msg 31
3111 8 ghutchis
inc_32:         ld      ix,t_var3
3112
                ld      a,data_7f
3113
                ld      (ix-2),a
3114
                cp      a,data_7f
3115
                jr      z,inc_33
3116 11 ghutchis
                fail_msg 32
3117 8 ghutchis
inc_33:         inc     (ix-2)
3118
                jp      m,inc_34
3119 11 ghutchis
                fail_msg 33
3120 8 ghutchis
inc_34:         jp      pe,inc_35
3121 11 ghutchis
                fail_msg 34
3122 8 ghutchis
inc_35:         ld      a,data_55
3123
                ld      (ix+2),a
3124
                inc     (ix+2)
3125
                jp      p,inc_36
3126 11 ghutchis
                fail_msg 35
3127 8 ghutchis
inc_36:         jp      po,inc_37
3128 11 ghutchis
                fail_msg 36
3129 8 ghutchis
inc_37:         ld      a,(ix+2)
3130
                cp      a,data_55+1
3131
                jr      z,inc_38
3132 11 ghutchis
                fail_msg 37
3133 8 ghutchis
inc_38:         ld      a,data_ff
3134
                ld      (ix-1),a
3135
                inc     (ix-1)
3136
                jr      z,inc_39
3137 11 ghutchis
                fail_msg 38
3138 8 ghutchis
inc_39:         inc     (ix-1)
3139
                jr      nz,inc_40
3140 11 ghutchis
                fail_msg 39
3141 8 ghutchis
inc_40:         ld      a,(ix-1)
3142
                cp      a,1
3143
                jr      z,inc_41
3144 11 ghutchis
                fail_msg 40
3145 8 ghutchis
inc_41:         ld      a,data_aa
3146
                ld      (ix+1),a
3147
                inc     (ix+1)
3148
                jp      m,inc_42
3149 11 ghutchis
                fail_msg 41
3150 8 ghutchis
inc_42:         ld      a,(ix+1)
3151
                cp      a,data_aa+1
3152
                jr      z,inc_43
3153 11 ghutchis
                fail_msg 42
3154 8 ghutchis
inc_43:         ld      iy,t_var3
3155
                ld      a,data_7f
3156
                ld      (iy+2),a
3157
                cp      a,data_7f
3158
                jr      z,inc_44
3159 11 ghutchis
                fail_msg 43
3160 8 ghutchis
inc_44:         inc     (iy+2)
3161
                jp      m,inc_45
3162 11 ghutchis
                fail_msg 44
3163 8 ghutchis
inc_45:         jp      pe,inc_46
3164 11 ghutchis
                fail_msg 45
3165 8 ghutchis
inc_46:         ld      a,data_55
3166
                ld      (iy-2),a
3167
                inc     (iy-2)
3168
                jp      p,inc_47
3169 11 ghutchis
                fail_msg 46
3170 8 ghutchis
inc_47:         jp      po,inc_48
3171 11 ghutchis
                fail_msg 47
3172 8 ghutchis
inc_48:         ld      a,(iy-2)
3173
                cp      a,data_55+1
3174
                jr      z,inc_49
3175 11 ghutchis
                fail_msg 48
3176 8 ghutchis
inc_49:         ld      a,data_ff
3177
                ld      (iy+1),a
3178
                inc     (iy+1)
3179
                jr      z,inc_50
3180 11 ghutchis
                fail_msg 49
3181 8 ghutchis
inc_50:         inc     (iy+1)
3182
                jr      nz,inc_51
3183 11 ghutchis
                fail_msg 50
3184 8 ghutchis
inc_51:         ld      a,(iy+1)
3185
                cp      a,1
3186
                jr      z,inc_52
3187 11 ghutchis
                fail_msg 51
3188 8 ghutchis
inc_52:         ld      a,data_80
3189
                ld      (iy-1),a
3190
                inc     (iy-1)
3191
                jp      m,inc_53
3192 11 ghutchis
                fail_msg 52
3193 8 ghutchis
inc_53:         ld      a,(iy-1)
3194
                cp      a,data_80+1
3195
                jr      z,dec_0
3196 11 ghutchis
                fail_msg 53
3197 17 ghutchis
dec_0:          nop
3198
                print "dec"
3199
                ld      a,data_80
3200 8 ghutchis
                cp      a,data_80
3201
                jr      z,dec_1
3202 11 ghutchis
                fail_msg 0
3203 8 ghutchis
dec_1:          dec     a
3204
                jp      p,dec_2
3205 11 ghutchis
                fail_msg 1
3206 8 ghutchis
dec_2:          jp      pe,dec_3
3207 11 ghutchis
                fail_msg 2
3208 8 ghutchis
dec_3:          ld      a,0
3209
                dec     a
3210
                jp      m,dec_4
3211 11 ghutchis
                fail_msg 3
3212 8 ghutchis
dec_4:          jp      po,dec_5
3213 11 ghutchis
                fail_msg 4
3214 8 ghutchis
dec_5:          cp      a,data_ff
3215
                jr      z,dec_6
3216 11 ghutchis
                fail_msg 5
3217 8 ghutchis
dec_6:          ld      a,1
3218
                dec     a
3219
                jr      z,dec_7
3220 11 ghutchis
                fail_msg 6
3221 8 ghutchis
dec_7:          dec     a
3222
                jr      nz,dec_8
3223 11 ghutchis
                fail_msg 7
3224 8 ghutchis
dec_8:          cp      a,data_ff
3225
                jr      z,dec_9
3226 11 ghutchis
                fail_msg 8
3227 8 ghutchis
dec_9:          ld      a,data_aa
3228
                dec     a
3229
                cp      a,data_aa-1
3230
                jr      z,dec_10
3231 11 ghutchis
                fail_msg 9
3232 8 ghutchis
dec_10:         ld      b,data_7f
3233
                dec     b
3234
                ld      a,b
3235
                cp      a,data_7f-1
3236
                jr      z,dec_11
3237 11 ghutchis
                fail_msg 10
3238 8 ghutchis
dec_11:         ld      c,data_55
3239
                dec     c
3240
                ld      a,c
3241
                cp      a,data_55-1
3242
                jr      z,dec_12
3243 11 ghutchis
                fail_msg 11
3244 8 ghutchis
dec_12:         ld      d,data_aa
3245
                dec     d
3246
                ld      a,d
3247
                cp      a,data_aa-1
3248
                jr      z,dec_13
3249 11 ghutchis
                fail_msg 12
3250 8 ghutchis
dec_13:         ld      e,data_80
3251
                dec     e
3252
                ld      a,e
3253
                cp      a,data_80-1
3254
                jr      z,dec_14
3255 11 ghutchis
                fail_msg 13
3256 8 ghutchis
dec_14:         ld      h,data_ff
3257
                dec     h
3258
                ld      a,h
3259
                cp      a,data_ff-1
3260
                jr      z,dec_15
3261 11 ghutchis
                fail_msg 14
3262 8 ghutchis
dec_15:         ld      l,data_55
3263
                dec     l
3264
                ld      a,l
3265
                cp      a,data_55-1
3266
                jr      z,dec_16
3267 11 ghutchis
                fail_msg 15
3268 8 ghutchis
dec_16:         ld      hl,t_var5
3269
                ld      a,data_80
3270
                ld      (hl),a
3271
                cp      a,(hl)
3272
                jr      z,dec_17
3273 11 ghutchis
                fail_msg 16
3274 8 ghutchis
dec_17:         dec     (hl)
3275
                jp      p,dec_18
3276 11 ghutchis
                fail_msg 17
3277 8 ghutchis
dec_18:         jp      pe,dec_19
3278 11 ghutchis
                fail_msg 18
3279 8 ghutchis
dec_19:         ld      a,0
3280
                ld      (hl),a
3281
                dec     (hl)
3282
                jp      m,dec_20
3283 11 ghutchis
                fail_msg 19
3284 8 ghutchis
dec_20:         jp      po,dec_21
3285 11 ghutchis
                fail_msg 20
3286 8 ghutchis
dec_21:         ld      a,(hl)
3287
                cp      a,data_ff
3288
                jr      z,dec_22
3289 11 ghutchis
                fail_msg 21
3290 8 ghutchis
dec_22:         ld      a,1
3291
                ld      (hl),a
3292
                dec     (hl)
3293
                jr      z,dec_23
3294 11 ghutchis
                fail_msg 22
3295 8 ghutchis
dec_23:         dec     (hl)
3296
                jr      nz,dec_24
3297 11 ghutchis
                fail_msg 23
3298 8 ghutchis
dec_24:         ld      a,(hl)
3299
                cp      a,data_ff
3300
                jr      z,dec_25
3301 11 ghutchis
                fail_msg 24
3302 8 ghutchis
dec_25:         ld      a,data_aa
3303
                ld      (hl),a
3304
                dec     (hl)
3305
                ld      a,(hl)
3306
                cp      a,data_aa-1
3307
                jr      z,dec_26
3308 11 ghutchis
                fail_msg 25
3309 8 ghutchis
dec_26:         ld      ix,t_var3
3310
                ld      a,data_80
3311
                ld      (ix-2),a
3312
                cp      a,(ix-2)
3313
                jr      z,dec_27
3314 11 ghutchis
                fail_msg 26
3315 8 ghutchis
dec_27:         dec     (ix-2)
3316
                jp      p,dec_28
3317 11 ghutchis
                fail_msg 27
3318 8 ghutchis
dec_28:         jp      pe,dec_29
3319 11 ghutchis
                fail_msg 28
3320 8 ghutchis
dec_29:         ld      a,0
3321
                ld      (ix+2),a
3322
                dec     (ix+2)
3323
                jp      m,dec_30
3324 11 ghutchis
                fail_msg 29
3325 8 ghutchis
dec_30:         jp      po,dec_31
3326 11 ghutchis
                fail_msg 30
3327 8 ghutchis
dec_31:         ld      a,(ix+2)
3328
                cp      a,data_ff
3329
                jr      z,dec_32
3330 11 ghutchis
                fail_msg 31
3331 8 ghutchis
dec_32:         ld      a,1
3332
                ld      (ix-1),a
3333
                dec     (ix-1)
3334
                jr      z,dec_33
3335 11 ghutchis
                fail_msg 32
3336 8 ghutchis
dec_33:         dec     (ix-1)
3337
                jr      nz,dec_34
3338 11 ghutchis
                fail_msg 33
3339 8 ghutchis
dec_34:         ld      a,(ix-1)
3340
                cp      a,data_ff
3341
                jr      z,dec_35
3342 11 ghutchis
                fail_msg 34
3343 8 ghutchis
dec_35:         ld      a,data_7f
3344
                ld      (ix+1),a
3345
                dec     (ix+1)
3346
                ld      a,(ix+1)
3347
                cp      a,data_7f-1
3348
                jr      z,dec_36
3349 11 ghutchis
                fail_msg 35
3350 8 ghutchis
dec_36:         ld      iy,t_var3
3351
                ld      a,data_80
3352
                ld      (iy-2),a
3353
                cp      a,(iy-2)
3354
                jr      z,dec_37
3355 11 ghutchis
                fail_msg 36
3356 8 ghutchis
dec_37:         dec     (iy-2)
3357
                jp      p,dec_38
3358 11 ghutchis
                fail_msg 37
3359 8 ghutchis
dec_38:         jp      pe,dec_39
3360 11 ghutchis
                fail_msg 38
3361 8 ghutchis
dec_39:         ld      a,0
3362
                ld      (iy+2),a
3363
                dec     (iy+2)
3364
                jp      m,dec_40
3365 11 ghutchis
                fail_msg 39
3366 8 ghutchis
dec_40:         jp      po,dec_41
3367 11 ghutchis
                fail_msg 40
3368 8 ghutchis
dec_41:         ld      a,(iy+2)
3369
                cp      a,data_ff
3370
                jr      z,dec_42
3371 11 ghutchis
                fail_msg 41
3372 8 ghutchis
dec_42:         ld      a,1
3373
                ld      (iy+1),a
3374
                dec     (iy+1)
3375
                jr      z,dec_43
3376 11 ghutchis
                fail_msg 42
3377 8 ghutchis
dec_43:         dec     (iy+1)
3378
                jr      nz,dec_44
3379 11 ghutchis
                fail_msg 43
3380 8 ghutchis
dec_44:         ld      a,(iy+1)
3381
                cp      a,data_ff
3382
                jr      z,dec_45
3383 11 ghutchis
                fail_msg 44
3384 8 ghutchis
dec_45:         ld      a,data_aa
3385
                ld      (iy-1),a
3386
                dec     (iy-1)
3387
                ld      a,(iy-1)
3388
                cp      a,data_aa-1
3389
                jr      z,cpl_0
3390 11 ghutchis
                fail_msg 45
3391 8 ghutchis
cpl_0:          ld      a,data_ff
3392
                cpl
3393
                cp      a,0
3394
                jr      z,cpl_1
3395 11 ghutchis
                fail_msg 0
3396 8 ghutchis
cpl_1:          ld      a,data_aa
3397
                cpl
3398
                cp      a,data_55
3399
                jr      z,cpl_2
3400 11 ghutchis
                fail_msg 1
3401 8 ghutchis
cpl_2:          cpl
3402
                cp      a,data_aa
3403
                jr      z,neg_0
3404 11 ghutchis
                fail_msg 2
3405 17 ghutchis
neg_0:          nop
3406
                print "neg"
3407
                ld      a,data_80
3408 8 ghutchis
                cp      a,data_80
3409
                jp      po,neg_1
3410 11 ghutchis
                fail_msg 0
3411 8 ghutchis
neg_1:          neg
3412
                jp      pe,neg_2
3413 11 ghutchis
                fail_msg 1
3414 8 ghutchis
neg_2:          jr      nz,neg_3
3415 11 ghutchis
                fail_msg 2
3416 8 ghutchis
neg_3:          jr      c,neg_4
3417 11 ghutchis
                fail_msg 3
3418 8 ghutchis
neg_4:          ld      a,0
3419
                neg
3420
                jp      po,neg_5
3421 11 ghutchis
                fail_msg 4
3422 8 ghutchis
neg_5:          jr      z,neg_6
3423 11 ghutchis
                fail_msg 5
3424 8 ghutchis
neg_6:          jr      nc,neg_7
3425 11 ghutchis
                fail_msg 6
3426 8 ghutchis
neg_7:          ld      a,data_55
3427
                cp      a,data_55
3428
                jp      p,neg_8
3429 11 ghutchis
                fail_msg 7
3430 8 ghutchis
neg_8:          neg
3431
                jp      m,neg_9
3432 11 ghutchis
                fail_msg 8
3433 8 ghutchis
neg_9:          neg
3434
                jp      p,neg_10
3435 11 ghutchis
                fail_msg 9
3436 8 ghutchis
neg_10:         cp      a,data_55
3437
                jr      z,ccf_0
3438 11 ghutchis
                fail_msg 10
3439 17 ghutchis
ccf_0:          nop
3440
                print "ccf/im"
3441
                scf
3442 8 ghutchis
                jr      c,ccf_1
3443 11 ghutchis
                fail_msg 0
3444 8 ghutchis
ccf_1:          ccf
3445
                jr      nc,ccf_2
3446 11 ghutchis
                fail_msg 1
3447 8 ghutchis
ccf_2:          ccf
3448
                jr      c,im_0
3449 11 ghutchis
                fail_msg 2
3450 8 ghutchis
im_0:           im      0
3451
                im      1
3452
                im      2
3453 17 ghutchis
daa_0:          nop
3454
                print "daa"
3455
                ld      a,#99
3456 8 ghutchis
                ld      b,#1
3457
                add     a,b
3458
                daa
3459
                jr      c,daa_1
3460 11 ghutchis
                fail_msg 0
3461 8 ghutchis
daa_1:          jr      z,daa_2
3462 11 ghutchis
                fail_msg 1
3463 8 ghutchis
daa_2:          add     a,b
3464
                jr      nc,daa_3
3465 11 ghutchis
                fail_msg 2
3466 8 ghutchis
daa_3:          jr      nz,daa_4
3467 11 ghutchis
                fail_msg 3
3468 8 ghutchis
daa_4:          cp      a,1
3469
                jr      z,daa_5
3470 11 ghutchis
                fail_msg 4
3471 8 ghutchis
daa_5:          ld      a,#98
3472
                ld      b,1
3473
                add     a,b
3474
                daa
3475
                jp      m,daa_6
3476 11 ghutchis
                fail_msg 5
3477 8 ghutchis
daa_6:          add     a,b
3478
                daa
3479
                jp      p,daa_7
3480 11 ghutchis
                fail_msg 6
3481 8 ghutchis
daa_7:          ld      a,1
3482
                ld      b,1
3483
                add     a,b
3484
                daa
3485
                jp      po,daa_8
3486 11 ghutchis
                fail_msg 7
3487 8 ghutchis
daa_8:          add     a,b
3488
                daa
3489
                jp      pe,daa_9
3490 11 ghutchis
                fail_msg 8
3491 8 ghutchis
daa_9:          cp      a,3
3492
                jr      z,add_74
3493 11 ghutchis
                fail_msg 9
3494 17 ghutchis
add_74:         nop
3495
                print "add"
3496
                ld      hl,data_1234
3497 8 ghutchis
                add     hl,hl
3498
                jr      nc,add_75
3499 11 ghutchis
                fail_msg 74
3500 8 ghutchis
add_75:         ld      a,h
3501
                cp      a,#24
3502
                jr      z,add_76
3503 11 ghutchis
                fail_msg 75
3504 8 ghutchis
add_76:         ld      a,l
3505
                cp      a,#68
3506
                jr      z,add_77
3507 11 ghutchis
                fail_msg 76
3508 8 ghutchis
add_77:         ld      hl,data_7fff
3509
                ld      bc,data_8000
3510
                add     hl,bc
3511
                jr      nc,add_78
3512 11 ghutchis
                fail_msg 77
3513 8 ghutchis
add_78:         ld      bc,1
3514
                add     hl,bc
3515
                jr      c,add_79
3516 11 ghutchis
                fail_msg 78
3517 8 ghutchis
add_79:         ld      a,h
3518
                cp      a,0
3519
                jr      z,add_80
3520 11 ghutchis
                fail_msg 79
3521 8 ghutchis
add_80:         ld      a,l
3522
                cp      a,0
3523
                jr      z,add_81
3524 11 ghutchis
                fail_msg 80
3525 8 ghutchis
add_81:         ld      hl,data_aa55
3526
                ld      de,data_ffff
3527
                add     hl,de
3528
                jr      c,add_82
3529 11 ghutchis
                fail_msg 81
3530 8 ghutchis
add_82:         ld      a,h
3531
                cp      a,data_aa
3532
                jr      z,add_83
3533 11 ghutchis
                fail_msg 82
3534 8 ghutchis
add_83:         ld      a,l
3535
                cp      a,data_55-1
3536
                jr      z,add_84
3537 11 ghutchis
                fail_msg 83
3538 8 ghutchis
add_84:         ld      hl,data_aa55
3539
                ld      sp,data_8000
3540
                add     hl,sp
3541
                jr      c,add_85
3542 11 ghutchis
                fail_msg 84
3543 8 ghutchis
add_85:         ld      a,h
3544
                cp      a,#2a
3545
                jr      z,add_86
3546 11 ghutchis
                fail_msg 85
3547 8 ghutchis
add_86:         ld      a,l
3548
                cp      a,data_55
3549
                jr      z,add_87
3550 11 ghutchis
                fail_msg 86
3551 8 ghutchis
add_87:         ld      sp,stack_end
3552
                ld      hl,data_1234
3553
                scf
3554
                ccf
3555
                adc     hl,hl
3556
                jr      nz,add_88
3557 11 ghutchis
                fail_msg 87
3558 8 ghutchis
add_88:         jr      nc,add_89
3559 11 ghutchis
                fail_msg 88
3560 8 ghutchis
add_89:         jp      p,add_90
3561 11 ghutchis
                fail_msg 89
3562 8 ghutchis
add_90:         jp      po,add_91
3563 11 ghutchis
                fail_msg 90
3564 8 ghutchis
add_91:         ld      bc,data_8000
3565
                adc     hl,bc
3566
                jp      m,add_92
3567 11 ghutchis
                fail_msg 91
3568 8 ghutchis
add_92:         jr      nc,add_93
3569 11 ghutchis
                fail_msg 92
3570 8 ghutchis
add_93:         jp      po,add_94
3571 11 ghutchis
                fail_msg 93
3572 8 ghutchis
add_94:         jp      nz,add_95
3573 11 ghutchis
                fail_msg 94
3574 8 ghutchis
add_95:         adc     hl,bc
3575
                jp      p,add_96
3576 11 ghutchis
                fail_msg 95
3577 8 ghutchis
add_96:         jp      pe,add_97
3578 11 ghutchis
                fail_msg 96
3579 8 ghutchis
add_97:         jr      c,add_98
3580 11 ghutchis
                fail_msg 97
3581 8 ghutchis
add_98:         jr      nz,add_99
3582 11 ghutchis
                fail_msg 98
3583 8 ghutchis
add_99:         ld      de,#db97
3584
                adc     hl,de
3585
                jr      z,add_100
3586 11 ghutchis
                fail_msg 99
3587 8 ghutchis
add_100:        jr      c,add_101
3588 11 ghutchis
                fail_msg 100
3589 8 ghutchis
add_101:        jp      po,add_102
3590 11 ghutchis
                fail_msg 101
3591 8 ghutchis
add_102:        ld      de,0
3592
                adc     hl,de
3593
                jr      nc,add_103
3594 11 ghutchis
                fail_msg 102
3595 8 ghutchis
add_103:        jr      nz,add_104
3596 11 ghutchis
                fail_msg 103
3597 8 ghutchis
add_104:        ld      a,h
3598
                cp      a,0
3599
                jr      z,add_105
3600 11 ghutchis
                fail_msg 104
3601 8 ghutchis
add_105:        ld      a,l
3602
                cp      a,1
3603
                jr      z,add_106
3604 11 ghutchis
                fail_msg 105
3605 8 ghutchis
add_106:        ld      hl,data_1234
3606
                ld      sp,data_ffff
3607
                adc     hl,sp
3608
                jr      c,add_107
3609 11 ghutchis
                fail_msg 106
3610 8 ghutchis
add_107:        ld      a,h
3611
                cp      a,#12
3612
                jr      z,add_108
3613 11 ghutchis
                fail_msg 107
3614 8 ghutchis
add_108:        ld      a,l
3615
                cp      a,#33
3616
                jr      z,sbc_66
3617 11 ghutchis
                fail_msg 108
3618 8 ghutchis
sbc_66:         ld      sp,stack_end
3619 17 ghutchis
                print   "sbc"
3620 8 ghutchis
                scf
3621
                ccf
3622
                ld      hl,data_1234
3623
                sbc     hl,hl
3624
                jr      z,sbc_67
3625 11 ghutchis
                fail_msg 66
3626 8 ghutchis
sbc_67:         jp      p,sbc_68
3627 11 ghutchis
                fail_msg 67
3628 8 ghutchis
sbc_68:         jp      po,sbc_69
3629 11 ghutchis
                fail_msg 68
3630 8 ghutchis
sbc_69:         jr      nc,sbc_70
3631 11 ghutchis
                fail_msg 69
3632 8 ghutchis
sbc_70:         ld      bc,data_1234
3633
                sbc     hl,bc
3634
                jr      nz,sbc_71
3635 11 ghutchis
                fail_msg 70
3636 8 ghutchis
sbc_71:         jr      c,sbc_72
3637 11 ghutchis
                fail_msg 71
3638 8 ghutchis
sbc_72:         jp      m,sbc_73
3639 11 ghutchis
                fail_msg 72
3640 8 ghutchis
sbc_73:         jp      po,sbc_74
3641 11 ghutchis
                fail_msg 73
3642 8 ghutchis
sbc_74:         ld      de,data_7fff
3643
                sbc     hl,de
3644
                jr      nz,sbc_75
3645 11 ghutchis
                fail_msg 74
3646 8 ghutchis
sbc_75:         jr      nc,sbc_76
3647 11 ghutchis
                fail_msg 75
3648 8 ghutchis
sbc_76:         jp      p,sbc_77
3649 11 ghutchis
                fail_msg 76
3650 8 ghutchis
sbc_77:         jp      pe,sbc_78
3651 11 ghutchis
                fail_msg 77
3652 8 ghutchis
sbc_78:         ld      sp,data_1234
3653
                sbc     hl,sp
3654
                jr      nz,sbc_79
3655 11 ghutchis
                fail_msg 78
3656 8 ghutchis
sbc_79:         ld      a,h
3657
                cp      a,#5b
3658
                jr      z,sbc_80
3659 11 ghutchis
                fail_msg 79
3660 8 ghutchis
sbc_80:         ld      a,l
3661
                cp      a,#98
3662
                jr      z,add_109
3663 11 ghutchis
                fail_msg 80
3664 8 ghutchis
add_109:        ld      sp,stack_end
3665 17 ghutchis
                print   "add"
3666 8 ghutchis
                ld      ix,0
3667
                add     ix,sp
3668
                jr      nc,add_110
3669 11 ghutchis
                fail_msg 109
3670 8 ghutchis
add_110:        push    ix
3671
                pop     hl
3672
                ld      a,h
3673
                cp      a,stack_end_hi          ; >stack_end
3674
                jr      z,add_111
3675 11 ghutchis
                fail_msg 110
3676 8 ghutchis
add_111:        ld      a,l
3677
                cp      a,stack_end_lo          ; 
3678
                jr      z,add_112
3679 11 ghutchis
                fail_msg 111
3680 8 ghutchis
add_112:        ld      ix,data_7fff
3681
                ld      bc,data_aa55
3682
                add     ix,bc
3683
                jr      c,add_113
3684 11 ghutchis
                fail_msg 112
3685 8 ghutchis
add_113:        add     ix,bc
3686
                jr      nc,add_114
3687 11 ghutchis
                fail_msg 113
3688 8 ghutchis
add_114:        push    ix
3689
                pop     hl
3690
                ld      a,h
3691
                cp      a,#d4
3692
                jr      z,add_115
3693 11 ghutchis
                fail_msg 114
3694 8 ghutchis
add_115:        ld      a,l
3695
                cp      a,#a9
3696
                jr      z,add_116
3697 11 ghutchis
                fail_msg 115
3698 8 ghutchis
add_116:        ld      ix,data_1234
3699
                ld      de,data_1234
3700
                add     ix,de
3701
                push    ix
3702
                pop     hl
3703
                ld      a,h
3704
                cp      a,#24           ;>(data_1234+data_1234)
3705
                jr      z,add_117
3706 11 ghutchis
                fail_msg 116
3707 8 ghutchis
add_117:        ld      a,l
3708
                cp      a,#68           ;<(data_1234+data_1234)
3709
                jr      z,add_118
3710 11 ghutchis
                fail_msg 117
3711 8 ghutchis
add_118:        ld      ix,data_1234
3712
                add     ix,ix
3713
                push    ix
3714
                pop     bc
3715
                ld      a,b
3716
                cp      a,#24           ;>(data_1234+data_1234)
3717
                jr      z,add_119
3718 11 ghutchis
                fail_msg 118
3719 8 ghutchis
add_119:        ld      a,c
3720
                cp      a,#68           ;<(data_1234+data_1234)
3721
                jr      z,add_120
3722 11 ghutchis
                fail_msg 119
3723 8 ghutchis
add_120:        ld      sp,stack_end
3724
                ld      iy,0
3725
                add     iy,sp
3726
                jr      nc,add_121
3727 11 ghutchis
                fail_msg 120
3728 8 ghutchis
add_121:        push    iy
3729
                pop     hl
3730
                ld      a,h
3731
                cp      a,stack_end_hi          ;>stack_end
3732
                jr      z,add_122
3733 11 ghutchis
                fail_msg 121
3734 8 ghutchis
add_122:        ld      a,l
3735
                cp      a,stack_end_lo          ;
3736
                jr      z,add_123
3737 11 ghutchis
                fail_msg 122
3738 8 ghutchis
add_123:        ld      iy,data_7fff
3739
                ld      bc,data_aa55
3740
                add     iy,bc
3741
                jr      c,add_124
3742 11 ghutchis
                fail_msg 123
3743 8 ghutchis
add_124:        add     iy,bc
3744
                jr      nc,add_125
3745 11 ghutchis
                fail_msg 124
3746 8 ghutchis
add_125:        push    iy
3747
                pop     hl
3748
                ld      a,h
3749
                cp      a,#d4
3750
                jr      z,add_126
3751 11 ghutchis
                fail_msg 125
3752 8 ghutchis
add_126:        ld      a,l
3753
                cp      a,#a9
3754
                jr      z,add_127
3755 11 ghutchis
                fail_msg 126
3756 8 ghutchis
add_127:        ld      iy,data_1234
3757
                ld      de,data_1234
3758
                add     iy,de
3759
                push    iy
3760
                pop     hl
3761
                ld      a,h
3762
                cp      a,#24           ;>(data_1234+data_1234)
3763
                jr      z,add_128
3764 11 ghutchis
                fail_msg 127
3765 8 ghutchis
add_128:        ld      a,l
3766
                cp      a,#68           ;<(data_1234+data_1234)
3767
                jr      z,add_129
3768 11 ghutchis
                fail_msg 128
3769 8 ghutchis
add_129:        ld      iy,data_1234
3770
                add     iy,iy
3771
                push    iy
3772
                pop     bc
3773
                ld      a,b
3774
                cp      a,#24           ;>(data_1234+data_1234)
3775
                jr      z,add_130
3776 11 ghutchis
                fail_msg 129
3777 8 ghutchis
add_130:        ld      a,c
3778
                cp      a,#68           ;<(data_1234+data_1234)
3779
                jr      z,inc_54
3780 11 ghutchis
                fail_msg 130
3781 17 ghutchis
inc_54:         ld      sp,stack_end
3782
                print "inc"
3783
                ld      bc,data_1234
3784 8 ghutchis
                inc     bc
3785
                ld      a,b
3786
                cp      a,#12      ;bjp was >data_1234
3787
                jr      z,inc_55
3788 11 ghutchis
                fail_msg 54
3789 8 ghutchis
inc_55:         ld      a,c
3790
                cp      a,#34+1      ;bjp was >data_1234+1
3791
                jr      z,inc_56
3792 11 ghutchis
                fail_msg 55
3793 8 ghutchis
inc_56:         ld      de,data_55aa
3794
                inc     de
3795
                ld      a,d
3796
                cp      a,#55           ;>data_55aa
3797
                jr      z,inc_57
3798 11 ghutchis
                fail_msg 56
3799 8 ghutchis
inc_57:         ld      a,e
3800
                cp      a,#ab           ;
3801
                jr      z,inc_58
3802 11 ghutchis
                fail_msg 57
3803 8 ghutchis
inc_58:         ld      hl,data_7fff
3804
                inc     hl
3805
                ld      a,h
3806
                cp      a,#80           ;>data_7fff+1
3807
                jr      z,inc_59
3808 11 ghutchis
                fail_msg 58
3809 8 ghutchis
inc_59:         ld      a,l
3810
                cp      a,#00           ;
3811
                jr      z,inc_60
3812 11 ghutchis
                fail_msg 59
3813 17 ghutchis
        ;; this test doesn't make any sense to me.  it looks
3814
        ;; like it increments SP, and then looks for *both*
3815
        ;; SPhigh and SPlow to have been incremented by 1.  The
3816
        ;; only way this works is if SP started as stack_end + 100
3817
        ;; added new statement accordingly. (gth)
3818
inc_60:         ld      sp,stack_end+#100 ; added new initial val (gth)
3819
                ld      hl,0
3820 8 ghutchis
                inc     sp
3821
                add     hl,sp
3822
                ld      sp,stack_end
3823
                ld      a,h
3824
                cp      a,stack_end_hi+1                ;>stack_end+1
3825
                jr      z,inc_61
3826 11 ghutchis
                fail_msg 60
3827 8 ghutchis
inc_61:         ld      a,l
3828
                cp      a,stack_end_lo+1                ;
3829
                jr      z,inc_62
3830 11 ghutchis
                fail_msg 61
3831 8 ghutchis
inc_62:         ld      ix,data_8000
3832
                inc     ix
3833
                push    ix
3834
                pop     de
3835
                ld      a,d
3836
                cp      a,#80           ;>data_8000
3837
                jr      z,inc_63
3838 11 ghutchis
                fail_msg 62
3839 8 ghutchis
inc_63:         ld      a,e
3840
                cp      a,#01           ;
3841
                jr      z,inc_64
3842 11 ghutchis
                fail_msg 63
3843 8 ghutchis
inc_64:         ld      iy,data_7fff
3844
                inc     iy
3845
                push    iy
3846
                pop     bc
3847
                ld      a,b
3848
                cp      a,#80           ;>data_7fff+1
3849
                jr      z,inc_65
3850 11 ghutchis
                fail_msg 64
3851 8 ghutchis
inc_65:         ld      a,c
3852
                cp      a,#00           ;
3853
                jr      z,dec_46
3854 11 ghutchis
                fail_msg 65
3855 17 ghutchis
dec_46:         nop
3856
                print   "dec"
3857
                ld      bc,data_1234
3858 8 ghutchis
                dec     bc
3859
                ld      a,b
3860
                cp      a,#12      ;bjp was >data_1234
3861
                jr      z,dec_47
3862 11 ghutchis
                fail_msg 46
3863 8 ghutchis
dec_47:         ld      a,c
3864
                cp      a,#34-1      ;bjp was >data_1234-1
3865
                jr      z,dec_48
3866 11 ghutchis
                fail_msg 47
3867 8 ghutchis
dec_48:         ld      de,data_8000
3868
                dec     de
3869
                ld      a,d
3870
                cp      a,#7f           ;>data_7fff
3871
                jr      z,dec_49
3872 11 ghutchis
                fail_msg 48
3873 8 ghutchis
dec_49:         ld      a,e
3874
                cp      a,#ff           ;
3875
                jr      z,dec_50
3876 11 ghutchis
                fail_msg 49
3877 8 ghutchis
dec_50:         ld      hl,data_aa55
3878
                dec     hl
3879
                ld      a,h
3880
                cp      a,#aa           ;>data_aa55
3881
                jr      z,dec_51
3882 11 ghutchis
                fail_msg 50
3883 8 ghutchis
dec_51:         ld      a,l
3884
                cp      a,#54           ;
3885
                jr      z,dec_52
3886 11 ghutchis
                fail_msg 51
3887 17 ghutchis
        ;; similar mysterious test to inc_60, expecting both halves
3888
        ;; of SP to be decremented.  Fix by setting sp stack_end-100 (gth)
3889
dec_52:         ld      sp, stack_end-#100 ; new starting SP (gth)
3890
                ld      hl,0
3891 8 ghutchis
                dec     sp
3892
                add     hl,sp
3893
                ld      a,h
3894
                cp      a,stack_end_hi-1                ;>stack_end-1
3895
                jr      z,dec_53
3896 11 ghutchis
                fail_msg 52
3897 8 ghutchis
dec_53:         ld      a,l
3898
                cp      a,stack_end_lo-1                ;
3899
                jr      z,dec_54
3900 11 ghutchis
                fail_msg 53
3901 8 ghutchis
dec_54:         ld      sp,stack_end
3902
                ld      ix,data_ffff
3903
                dec     ix
3904
                push    ix
3905
                pop     bc
3906
                ld      a,b
3907
                cp      a,#ff           ;>data_ffff
3908
                jr      z,dec_55
3909 11 ghutchis
                fail_msg 54
3910 8 ghutchis
dec_55:         ld      a,c
3911
                cp      a,#fe           ;
3912
                jr      z,dec_56
3913 11 ghutchis
                fail_msg 55
3914 8 ghutchis
dec_56:         ld      iy,data_aa55
3915
                dec     iy
3916
                push    iy
3917
                pop     de
3918
                ld      a,d
3919
                cp      a,#aa           ;>data_aa55
3920
                jr      z,dec_57
3921 11 ghutchis
                fail_msg 56
3922 8 ghutchis
dec_57:         ld      a,e
3923
                cp      a,#54           ;
3924
                jr      z,rlca_0
3925 11 ghutchis
                fail_msg 57
3926 17 ghutchis
rlca_0:         nop
3927
                print   "rlca/rla"
3928
                ld      a,data_80
3929 8 ghutchis
                rlca
3930
                jr      c,rlca_1
3931 11 ghutchis
                fail_msg 0
3932 8 ghutchis
rlca_1:         rlca
3933
                jr      nc,rlca_2
3934 11 ghutchis
                fail_msg 1
3935 8 ghutchis
rlca_2:         cp      a,2
3936
                jr      z,rlca_3
3937 11 ghutchis
                fail_msg 2
3938 8 ghutchis
rlca_3:         ld      a,data_55
3939
                rlca
3940
                cp      a,data_aa
3941
                jr      z,rla_0
3942 11 ghutchis
                fail_msg 3
3943 17 ghutchis
rla_0:
3944
                scf
3945 8 ghutchis
                ccf
3946
                ld      a,data_80
3947
                rla
3948
                jr      c,rla_1
3949 11 ghutchis
                fail_msg 0
3950 8 ghutchis
rla_1:          rla
3951
                jr      nc,rla_2
3952 11 ghutchis
                fail_msg 1
3953 8 ghutchis
rla_2:          cp      a,1
3954
                jr      z,rla_3
3955 11 ghutchis
                fail_msg 2
3956 8 ghutchis
rla_3:          ld      a,data_7f
3957
                rla
3958
                cp      a,data_ff-1
3959
                jr      z,rrca_0
3960 11 ghutchis
                fail_msg 3
3961 17 ghutchis
rrca_0:         nop
3962
                print "rrca/rra"
3963
                scf
3964 8 ghutchis
                ccf
3965
                ld      a,1
3966
                rrca
3967
                jr      c,rrca_1
3968 11 ghutchis
                fail_msg 0
3969 8 ghutchis
rrca_1:         rrca
3970
                jr      nc,rrca_2
3971 11 ghutchis
                fail_msg 1
3972 8 ghutchis
rrca_2:         cp      a,data_7f-#3f
3973
                jr      z,rrca_3
3974 11 ghutchis
                fail_msg 2
3975 8 ghutchis
rrca_3:         ld      a,data_aa
3976
                rrca
3977
                cp      a,data_55
3978
                jr      z,rra_0
3979 11 ghutchis
                fail_msg 3
3980 8 ghutchis
rra_0:          scf
3981
                ccf
3982
                ld      a,1
3983
                rra
3984
                jr      c,rra_1
3985 11 ghutchis
                fail_msg 0
3986 8 ghutchis
rra_1:          rra
3987
                jr      nc,rra_2
3988 11 ghutchis
                fail_msg 1
3989 8 ghutchis
rra_2:          cp      a,data_80
3990
                jr      z,rra_3
3991 11 ghutchis
                fail_msg 2
3992 8 ghutchis
rra_3:          ld      a,data_aa
3993
                rra
3994
                cp      a,data_55
3995
                jr      z,rlc_0
3996 11 ghutchis
                fail_msg 3
3997 17 ghutchis
rlc_0:          nop
3998
                print   "rlc"
3999
                ld      a,data_80
4000 8 ghutchis
                rlc     a
4001
                jr      c,rlc_1
4002 11 ghutchis
                fail_msg 0
4003 8 ghutchis
rlc_1:          jp      p,rlc_2
4004 11 ghutchis
                fail_msg 1
4005 8 ghutchis
rlc_2:          jr      nz,rlc_3
4006 11 ghutchis
                fail_msg 2
4007 8 ghutchis
rlc_3:          jp      po,rlc_4
4008 11 ghutchis
                fail_msg 3
4009 8 ghutchis
rlc_4:          rlc     a
4010
                jr      nc,rlc_5
4011 11 ghutchis
                fail_msg 4
4012 8 ghutchis
rlc_5:          rlc     a
4013
                rlc     a
4014
                rlc     a
4015
                rlc     a
4016
                rlc     a
4017
                rlc     a
4018
                jp      m,rlc_6
4019 11 ghutchis
                fail_msg 5
4020 8 ghutchis
rlc_6:          ld      a,data_55
4021
                rlc     a
4022
                jp      m,rlc_7
4023 11 ghutchis
                fail_msg 6
4024 8 ghutchis
rlc_7:          jp      pe,rlc_8
4025 11 ghutchis
                fail_msg 7
4026 8 ghutchis
rlc_8:          cp      a,data_aa
4027
                jr      z,rlc_9
4028 11 ghutchis
                fail_msg 8
4029 8 ghutchis
rlc_9:          ld      a,0
4030
                rlc     a
4031
                jr      z,rlc_10
4032 11 ghutchis
                fail_msg 9
4033 8 ghutchis
rlc_10:         ld      b,data_7f
4034
                rlc     b
4035
                ld      a,b
4036
                cp      a,data_ff-1
4037
                jr      z,rlc_11
4038 11 ghutchis
                fail_msg 10
4039 8 ghutchis
rlc_11:         ld      c,data_aa
4040
                rlc     c
4041
                jr      c,rlc_12
4042 11 ghutchis
                fail_msg 11
4043 8 ghutchis
rlc_12:         ld      a,c
4044
                cp      a,data_55
4045
                jr      z,rlc_13
4046 11 ghutchis
                fail_msg 12
4047 8 ghutchis
rlc_13:         ld      d,data_80
4048
                rlc     d
4049
                jr      c,rlc_14
4050 11 ghutchis
                fail_msg 13
4051 8 ghutchis
rlc_14:         ld      a,d
4052
                cp      a,1
4053
                jr      z,rlc_15
4054 11 ghutchis
                fail_msg 14
4055 8 ghutchis
rlc_15:         ld      e,data_ff
4056
                rlc     e
4057
                jr      c,rlc_16
4058 11 ghutchis
                fail_msg 15
4059 8 ghutchis
rlc_16:         ld      a,e
4060
                cp      a,data_ff
4061
                jr      z,rlc_17
4062 11 ghutchis
                fail_msg 16
4063 8 ghutchis
rlc_17:         ld      h,data_55
4064
                rlc     h
4065
                jp      m,rlc_18
4066 11 ghutchis
                fail_msg 17
4067 8 ghutchis
rlc_18:         ld      a,h
4068
                cp      a,data_aa
4069
                jr      z,rlc_19
4070 11 ghutchis
                fail_msg 18
4071 8 ghutchis
rlc_19:         ld      l,data_80
4072
                rlc     l
4073
                jp      p,rlc_20
4074 11 ghutchis
                fail_msg 19
4075 8 ghutchis
rlc_20:         ld      a,l
4076
                cp      a,1
4077
                jr      z,rlc_21
4078 11 ghutchis
                fail_msg 20
4079 8 ghutchis
rlc_21:         ld      hl,t_var1
4080
                ld      a,data_55
4081
                ld      (hl),a
4082
                rlc     (hl)
4083
                jp      m,rlc_22
4084 11 ghutchis
                fail_msg 21
4085 8 ghutchis
rlc_22:         jp      pe,rlc_23
4086 11 ghutchis
                fail_msg 22
4087 8 ghutchis
rlc_23:         jr      nc,rlc_24
4088 11 ghutchis
                fail_msg 23
4089 8 ghutchis
rlc_24:         jr      nz,rlc_25
4090 11 ghutchis
                fail_msg 24
4091 8 ghutchis
rlc_25:         rlc     (hl)
4092
                jp      p,rlc_26
4093 11 ghutchis
                fail_msg 25
4094 8 ghutchis
rlc_26:         jr      c,rlc_27
4095 11 ghutchis
                fail_msg 26
4096 8 ghutchis
rlc_27:         ld      a,(hl)
4097
                cp      a,data_55
4098
                jr      z,rlc_28
4099 11 ghutchis
                fail_msg 27
4100 8 ghutchis
rlc_28:         ld      a,data_7f
4101
                ld      (hl),a
4102
                rlc     (hl)
4103
                jp      po,rlc_29
4104 11 ghutchis
                fail_msg 28
4105 8 ghutchis
rlc_29:         ld      a,(hl)
4106
                cp      a,data_ff-1
4107
                jr      z,rlc_30
4108 11 ghutchis
                fail_msg 29
4109 8 ghutchis
rlc_30:         ld      a,0
4110
                ld      (hl),a
4111
                rlc     (hl)
4112
                jr      z,rlc_31
4113 11 ghutchis
                fail_msg 30
4114 8 ghutchis
rlc_31:         ld      ix,t_var3
4115
                ld      a,data_55
4116
                ld      (ix-2),a
4117
                rlc     (ix-2)
4118
                jp      m,rlc_32
4119 11 ghutchis
                fail_msg 31
4120 8 ghutchis
rlc_32:         jp      pe,rlc_33
4121 11 ghutchis
                fail_msg 32
4122 8 ghutchis
rlc_33:         jr      nz,rlc_34
4123 11 ghutchis
                fail_msg 33
4124 8 ghutchis
rlc_34:         jr      nc,rlc_35
4125 11 ghutchis
                fail_msg 34
4126 8 ghutchis
rlc_35:         rlc     (ix-2)
4127
                jp      p,rlc_36
4128 11 ghutchis
                fail_msg 35
4129 8 ghutchis
rlc_36:         jr      c,rlc_37
4130 11 ghutchis
                fail_msg 36
4131 8 ghutchis
rlc_37:         ld      a,(ix-2)
4132
                cp      a,data_55
4133
                jr      z,rlc_38
4134 11 ghutchis
                fail_msg 37
4135 8 ghutchis
rlc_38:         ld      a,data_7f
4136
                ld      (ix+2),a
4137
                rlc     (ix+2)
4138
                jp      po,rlc_39
4139 11 ghutchis
                fail_msg 38
4140 8 ghutchis
rlc_39:         ld      a,(ix+2)
4141
                cp      a,data_ff-1
4142
                jr      z,rlc_40
4143 11 ghutchis
                fail_msg 39
4144 8 ghutchis
rlc_40:         ld      a,0
4145
                ld      (ix-1),a
4146
                rlc     (ix-1)
4147
                jr      z,rlc_41
4148 11 ghutchis
                fail_msg 40
4149 8 ghutchis
rlc_41:         ld      iy,t_var3
4150
                ld      a,data_55
4151
                ld      (iy+2),a
4152
                rlc     (iy+2)
4153
                jp      m,rlc_42
4154 11 ghutchis
                fail_msg 41
4155 8 ghutchis
rlc_42:         jp      pe,rlc_43
4156 11 ghutchis
                fail_msg 42
4157 8 ghutchis
rlc_43:         jr      nc,rlc_44
4158 11 ghutchis
                fail_msg 43
4159 8 ghutchis
rlc_44:         jr      nz,rlc_45
4160 11 ghutchis
                fail_msg 44
4161 8 ghutchis
rlc_45:         rlc     (iy+2)
4162
                jp      p,rlc_46
4163 11 ghutchis
                fail_msg 45
4164 8 ghutchis
rlc_46:         jr      c,rlc_47
4165 11 ghutchis
                fail_msg 46
4166 8 ghutchis
rlc_47:         ld      a,(iy+2)
4167
                cp      a,data_55
4168
                jr      z,rlc_48
4169 11 ghutchis
                fail_msg 47
4170 8 ghutchis
rlc_48:         ld      a,data_7f
4171
                ld      (iy-2),a
4172
                rlc     (iy-2)
4173
                jp      po,rlc_49
4174 11 ghutchis
                fail_msg 48
4175 8 ghutchis
rlc_49:         ld      a,(iy-2)
4176
                cp      a,data_ff-1
4177
                jr      z,rlc_50
4178 11 ghutchis
                fail_msg 49
4179 8 ghutchis
rlc_50:         ld      a,0
4180
                ld      (iy+1),a
4181
                rlc     (iy+1)
4182
                jr      z,rl_0
4183 11 ghutchis
                fail_msg 50
4184 17 ghutchis
rl_0:           nop
4185
                print   "rl"
4186
                scf
4187 8 ghutchis
                ccf
4188
                ld      a,data_55
4189
                rl      a
4190
                jp      m,rl_1
4191 11 ghutchis
                fail_msg 0
4192 8 ghutchis
rl_1:           jp      pe,rl_2
4193 11 ghutchis
                fail_msg 1
4194 8 ghutchis
rl_2:           jr      nc,rl_3
4195 11 ghutchis
                fail_msg 2
4196 8 ghutchis
rl_3:           jr      nz,rl_4
4197 11 ghutchis
                fail_msg 3
4198 8 ghutchis
rl_4:           rl      a
4199
                jp      p,rl_5
4200 11 ghutchis
                fail_msg 4
4201 8 ghutchis
rl_5:           jp      po,rl_6
4202 11 ghutchis
                fail_msg 5
4203 8 ghutchis
rl_6:           jr      c,rl_7
4204 11 ghutchis
                fail_msg 6
4205 8 ghutchis
rl_7:           rl      a
4206
                cp      a,data_aa-1
4207
                jr      z,rl_8
4208 11 ghutchis
                fail_msg 7
4209 8 ghutchis
rl_8:           ld      a,0
4210
                rl      a
4211
                jr      z,rl_9
4212 11 ghutchis
                fail_msg 8
4213 8 ghutchis
rl_9:           ld      b,data_aa
4214
                ld      c,data_7f
4215
                rl      b
4216
                jr      c,rl_10
4217 11 ghutchis
                fail_msg 9
4218 8 ghutchis
rl_10:          rl      c
4219
                jr      nc,rl_11
4220 11 ghutchis
                fail_msg 10
4221 8 ghutchis
rl_11:          ld      a,b
4222
                cp      a,data_55-1
4223
                jr      z,rl_12
4224 11 ghutchis
                fail_msg 11
4225 8 ghutchis
rl_12:          ld      a,c
4226
                cp      a,data_ff
4227
                jr      z,rl_13
4228 11 ghutchis
                fail_msg 12
4229 8 ghutchis
rl_13:          ld      d,data_ff
4230
                ld      e,data_80
4231
                rl      e
4232
                jr      c,rl_14
4233 11 ghutchis
                fail_msg 13
4234 8 ghutchis
rl_14:          rl      d
4235
                jr      c,rl_15
4236 11 ghutchis
                fail_msg 14
4237 8 ghutchis
rl_15:          ld      a,d
4238
                cp      a,data_ff
4239
                jr      z,rl_16
4240 11 ghutchis
                fail_msg 15
4241 8 ghutchis
rl_16:          ld      a,e
4242
                cp      a,0
4243
                jr      z,rl_17
4244 11 ghutchis
                fail_msg 16
4245 8 ghutchis
rl_17:          ld      h,data_7f
4246
                ld      l,data_55
4247
                rl      h
4248
                jp      m,rl_18
4249 11 ghutchis
                fail_msg 17
4250 8 ghutchis
rl_18:          rl      l
4251
                jp      m,rl_19
4252 11 ghutchis
                fail_msg 18
4253 8 ghutchis
rl_19:          ld      a,h
4254
                cp      a,data_ff-1
4255
                jr      z,rl_20
4256 11 ghutchis
                fail_msg 19
4257 8 ghutchis
rl_20:          ld      a,l
4258
                cp      a,data_aa
4259
                jr      z,rl_21
4260 11 ghutchis
                fail_msg 20
4261 8 ghutchis
rl_21:          ld      hl,t_var5
4262
                ld      a,data_55
4263
                ld      (hl),a
4264
                rl      (hl)
4265
                jp      m,rl_22
4266 11 ghutchis
                fail_msg 21
4267 8 ghutchis
rl_22:          jp      pe,rl_23
4268 11 ghutchis
                fail_msg 22
4269 8 ghutchis
rl_23:          jr      nc,rl_24
4270 11 ghutchis
                fail_msg 23
4271 8 ghutchis
rl_24:          jr      nz,rl_25
4272 11 ghutchis
                fail_msg 24
4273 8 ghutchis
rl_25:          rl      (hl)
4274
                jp      p,rl_26
4275 11 ghutchis
                fail_msg 25
4276 8 ghutchis
rl_26:          jp      po,rl_27
4277 11 ghutchis
                fail_msg 26
4278 8 ghutchis
rl_27:          jr      c,rl_28
4279 11 ghutchis
                fail_msg 27
4280 8 ghutchis
rl_28:          ld      a,(hl)
4281
                cp      a,data_55-1
4282
                jr      z,rl_29
4283 11 ghutchis
                fail_msg 28
4284 8 ghutchis
rl_29:          ld      a,0
4285
                ld      (hl),a
4286
                rl      (hl)
4287
                jr      z,rl_30
4288 11 ghutchis
                fail_msg 29
4289 8 ghutchis
rl_30:          ld      ix,t_var3
4290
                ld      a,data_55
4291
                ld      (ix-2),a
4292
                rl      (ix-2)
4293
                jp      m,rl_31
4294 11 ghutchis
                fail_msg 30
4295 8 ghutchis
rl_31:          jp      pe,rl_32
4296 11 ghutchis
                fail_msg 31
4297 8 ghutchis
rl_32:          jr      nc,rl_33
4298 11 ghutchis
                fail_msg 32
4299 8 ghutchis
rl_33:          jr      nz,rl_34
4300 11 ghutchis
                fail_msg 33
4301 8 ghutchis
rl_34:          rl      (ix-2)
4302
                jp      p,rl_35
4303 11 ghutchis
                fail_msg 34
4304 8 ghutchis
rl_35:          jp      po,rl_36
4305 11 ghutchis
                fail_msg 35
4306 8 ghutchis
rl_36:          jr      c,rl_37
4307 11 ghutchis
                fail_msg 36
4308 8 ghutchis
rl_37:          ld      a,(ix-2)
4309
                cp      a,data_55-1
4310
                jr      z,rl_38
4311 11 ghutchis
                fail_msg 37
4312 8 ghutchis
rl_38:          ld      a,0
4313
                ld      (ix+2),a
4314
                rl      (ix+2)
4315
                jr      z,rl_39
4316
rl_39:          ld      iy,t_var3
4317
                ld      a,data_55
4318
                ld      (iy-1),a
4319
                rl      (iy-1)
4320
                jp      m,rl_40
4321 11 ghutchis
                fail_msg 39
4322 8 ghutchis
rl_40:          jp      pe,rl_41
4323 11 ghutchis
                fail_msg 40
4324 8 ghutchis
rl_41:          jr      nc,rl_42
4325 11 ghutchis
                fail_msg 41
4326 8 ghutchis
rl_42:          jr      nz,rl_43
4327 11 ghutchis
                fail_msg 42
4328 8 ghutchis
rl_43:          rl      (iy-1)
4329
                jp      p,rl_44
4330 11 ghutchis
                fail_msg 43
4331 8 ghutchis
rl_44:          jp      po,rl_45
4332 11 ghutchis
                fail_msg 44
4333 8 ghutchis
rl_45:          jr      c,rl_46
4334 11 ghutchis
                fail_msg 45
4335 8 ghutchis
rl_46:          ld      a,(iy-1)
4336
                cp      a,data_55-1
4337
                jr      z,rl_47
4338 11 ghutchis
                fail_msg 46
4339 8 ghutchis
rl_47:          ld      a,0
4340
                ld      (iy+1),a
4341
                rl      (iy+1)
4342
                jr      z,rrc_0
4343 11 ghutchis
                fail_msg 47
4344 17 ghutchis
rrc_0:          nop
4345
                print   "rrc"
4346
                ld      a,data_aa
4347 8 ghutchis
                rrc     a
4348
                jp      p,rrc_1
4349 11 ghutchis
                fail_msg 0
4350 8 ghutchis
rrc_1:          jp      pe,rrc_2
4351 11 ghutchis
                fail_msg 1
4352 8 ghutchis
rrc_2:          jr      nz,rrc_3
4353 11 ghutchis
                fail_msg 2
4354 8 ghutchis
rrc_3:          jr      nc,rrc_4
4355 11 ghutchis
                fail_msg 3
4356 8 ghutchis
rrc_4:          rrc     a
4357
                jp      m,rrc_5
4358 11 ghutchis
                fail_msg 4
4359 8 ghutchis
rrc_5:          jr      c,rrc_6
4360 11 ghutchis
                fail_msg 5
4361 8 ghutchis
rrc_6:          cp      a,data_aa
4362
                jr      z,rrc_7
4363 11 ghutchis
                fail_msg 6
4364 8 ghutchis
rrc_7:          ld      a,1
4365
                rrc     a
4366
                jr      c,rrc_8
4367 11 ghutchis
                fail_msg 7
4368 8 ghutchis
rrc_8:          cp      a,data_80
4369
                jr      z,rrc_9
4370 11 ghutchis
                fail_msg 8
4371 8 ghutchis
rrc_9:          ld      a,data_7f
4372
                rrc     a
4373
                jp      po,rrc_10
4374 11 ghutchis
                fail_msg 9
4375 8 ghutchis
rrc_10:         cp      a,#bf
4376
                jr      z,rrc_11
4377 11 ghutchis
                fail_msg 10
4378 8 ghutchis
rrc_11:         ld      b,data_80
4379
                ld      c,data_55
4380
                rrc     b
4381
                jr      nc,rrc_12
4382 11 ghutchis
                fail_msg 11
4383 8 ghutchis
rrc_12:         rrc     c
4384
                jr      c,rrc_13
4385 11 ghutchis
                fail_msg 12
4386 8 ghutchis
rrc_13:         ld      a,b
4387
                cp      a,#40
4388
                jr      z,rrc_14
4389 11 ghutchis
                fail_msg 13
4390 8 ghutchis
rrc_14:         ld      a,c
4391
                cp      a,data_aa
4392
                jr      z,rrc_15
4393 11 ghutchis
                fail_msg 14
4394 8 ghutchis
rrc_15:         ld      d,data_aa
4395
                ld      e,1
4396
                rrc     d
4397
                jp      p,rrc_16
4398 11 ghutchis
                fail_msg 15
4399 8 ghutchis
rrc_16:         rrc     e
4400
                jp      m,rrc_17
4401 11 ghutchis
                fail_msg 16
4402 8 ghutchis
rrc_17:         ld      a,d
4403
                cp      a,data_55
4404
                jr      z,rrc_18
4405 11 ghutchis
                fail_msg 17
4406 8 ghutchis
rrc_18:         ld      a,e
4407
                cp      a,data_80
4408
                jr      z,rrc_19
4409 11 ghutchis
                fail_msg 18
4410 8 ghutchis
rrc_19:         ld      h,data_55
4411
                ld      l,data_ff
4412
                rrc     h
4413
                jr      c,rrc_20
4414 11 ghutchis
                fail_msg 19
4415 8 ghutchis
rrc_20:         rrc     l
4416
                jr      c,rrc_21
4417 11 ghutchis
                fail_msg 20
4418 8 ghutchis
rrc_21:         ld      a,h
4419
                cp      a,data_aa
4420
                jr      z,rrc_22
4421 11 ghutchis
                fail_msg 21
4422 8 ghutchis
rrc_22:         ld      a,l
4423
                cp      a,data_ff
4424
                jr      z,rrc_23
4425 11 ghutchis
                fail_msg 22
4426 8 ghutchis
rrc_23:         ld      hl,t_var4
4427
                ld      (hl),data_aa
4428
                rrc      (hl)
4429
                jp      p,rrc_24
4430 11 ghutchis
                fail_msg 23
4431 8 ghutchis
rrc_24:         jp      pe,rrc_25
4432 11 ghutchis
                fail_msg 24
4433 8 ghutchis
rrc_25:         jr      nz,rrc_26
4434 11 ghutchis
                fail_msg 25
4435 8 ghutchis
rrc_26:         jr      nc,rrc_27
4436 11 ghutchis
                fail_msg 26
4437 8 ghutchis
rrc_27:         rrc     (hl)
4438
                jp      m,rrc_28
4439 11 ghutchis
                fail_msg 27
4440 8 ghutchis
rrc_28:         jr      c,rrc_29
4441 11 ghutchis
                fail_msg 28
4442 8 ghutchis
rrc_29:         ld      a,(hl)
4443
                cp      a,data_aa
4444
                jr      z,rrc_30
4445 11 ghutchis
                fail_msg 29
4446 8 ghutchis
rrc_30:         ld      (hl),data_7f
4447
                rrc     (hl)
4448
                jp      po,rrc_31
4449 11 ghutchis
                fail_msg 30
4450 8 ghutchis
rrc_31:         ld      a,(hl)
4451
                cp      a,#bf
4452
                jr      z,rrc_32
4453 11 ghutchis
                fail_msg 31
4454 8 ghutchis
rrc_32:         ld      (hl),0
4455
                rrc     (hl)
4456
                jr      z,rrc_33
4457 11 ghutchis
                fail_msg 32
4458 8 ghutchis
rrc_33:         ld      ix,t_var3
4459
                ld      a,data_aa
4460
                ld      (ix+2),a
4461
                rrc     (ix+2)
4462
                jp      p,rrc_34
4463 11 ghutchis
                fail_msg 33
4464 8 ghutchis
rrc_34:         jp      pe,rrc_35
4465 11 ghutchis
                fail_msg 34
4466 8 ghutchis
rrc_35:         jr      nc,rrc_36
4467 11 ghutchis
                fail_msg 35
4468 8 ghutchis
rrc_36:         jr      nz,rrc_37
4469 11 ghutchis
                fail_msg 36
4470 8 ghutchis
rrc_37:         rrc     (ix+2)
4471
                jp      m,rrc_38
4472 11 ghutchis
                fail_msg 37
4473 8 ghutchis
rrc_38:         jr      c,rrc_39
4474 11 ghutchis
                fail_msg 38
4475 8 ghutchis
rrc_39:         ld      a,(ix+2)
4476
                cp      a,data_aa
4477
                jr      z,rrc_40
4478 11 ghutchis
                fail_msg 39
4479 8 ghutchis
rrc_40:         ld      a,1
4480
                ld      (ix-2),a
4481
                rrc     (ix-2)
4482
                jp      po,rrc_41
4483 11 ghutchis
                fail_msg 40
4484 8 ghutchis
rrc_41:         ld      a,(ix-2)
4485
                cp      a,data_80
4486
                jr      z,rrc_42
4487 11 ghutchis
                fail_msg 41
4488 8 ghutchis
rrc_42:         ld      a,0
4489
                ld      (ix+1),a
4490
                rrc     (ix+1)
4491
                jr      z,rrc_43
4492 11 ghutchis
                fail_msg 42
4493 8 ghutchis
rrc_43:         ld      iy,t_var3
4494
                ld      a,data_aa
4495
                ld      (iy+2),a
4496
                rrc     (iy+2)
4497
                jp      p,rrc_44
4498 11 ghutchis
                fail_msg 43
4499 8 ghutchis
rrc_44:         jp      pe,rrc_45
4500 11 ghutchis
                fail_msg 44
4501 8 ghutchis
rrc_45:         jr      nc,rrc_46
4502 11 ghutchis
                fail_msg 45
4503 8 ghutchis
rrc_46:         jr      nz,rrc_47
4504 11 ghutchis
                fail_msg 46
4505 8 ghutchis
rrc_47:         rrc     (iy+2)
4506
                jp      m,rrc_48
4507 11 ghutchis
                fail_msg 47
4508 8 ghutchis
rrc_48:         jr      c,rrc_49
4509 11 ghutchis
                fail_msg 48
4510 8 ghutchis
rrc_49:         ld      a,(iy+2)
4511
                cp      a,data_aa
4512
                jr      z,rrc_50
4513 11 ghutchis
                fail_msg 49
4514 8 ghutchis
rrc_50:         ld      a,1
4515
                ld      (iy-2),a
4516
                rrc     (iy-2)
4517
                jp      po,rrc_51
4518 11 ghutchis
                fail_msg 50
4519 8 ghutchis
rrc_51:         ld      a,(iy-2)
4520
                cp      a,data_80
4521
                jr      z,rrc_52
4522 11 ghutchis
                fail_msg 51
4523 8 ghutchis
rrc_52:         ld      a,0
4524
                ld      (iy+1),a
4525
                rrc     (iy+1)
4526
                jr      z,rr_0
4527 11 ghutchis
                fail_msg 52
4528 17 ghutchis
rr_0:           nop
4529
                print   "rr"
4530
                scf
4531 8 ghutchis
                ccf
4532
                ld      a,data_aa
4533
                rr      a
4534
                jp      p,rr_1
4535 11 ghutchis
                fail_msg 0
4536 8 ghutchis
rr_1:           jp      pe,rr_2
4537 11 ghutchis
                fail_msg 1
4538 8 ghutchis
rr_2:           jr      nc,rr_3
4539 11 ghutchis
                fail_msg 2
4540 8 ghutchis
rr_3:           jr      nz,rr_4
4541 11 ghutchis
                fail_msg 3
4542 8 ghutchis
rr_4:           rr      a
4543
                jr      c,rr_5
4544 11 ghutchis
                fail_msg 4
4545 8 ghutchis
rr_5:           jp      po,rr_6
4546 11 ghutchis
                fail_msg 5
4547 8 ghutchis
rr_6:           cp      a,#2a
4548
                jr      z,rr_7
4549 11 ghutchis
                fail_msg 6
4550 8 ghutchis
rr_7:           scf
4551
                ld      a,0
4552
                rr      a
4553
                jp      m,rr_8
4554 11 ghutchis
                fail_msg 7
4555 8 ghutchis
rr_8:           cp      a,data_80
4556
                jr      z,rr_9
4557 11 ghutchis
                fail_msg 8
4558 8 ghutchis
rr_9:           ld      a,0
4559
                rr      a
4560
                jr      z,rr_10
4561 11 ghutchis
                fail_msg 9
4562 8 ghutchis
rr_10:          ld      b,data_55
4563
                ld      c,data_aa
4564
                rr      b
4565
                jr      c,rr_11
4566 11 ghutchis
                fail_msg 10
4567 8 ghutchis
rr_11:          rr      c
4568
                jr      nc,rr_12
4569 11 ghutchis
                fail_msg 11
4570 8 ghutchis
rr_12:          ld      a,b
4571
                cp      a,#2a
4572
                jr      z,rr_13
4573 11 ghutchis
                fail_msg 12
4574 8 ghutchis
rr_13:          ld      a,c
4575
                cp      a,#d5
4576
                jr      z,rr_14
4577 11 ghutchis
                fail_msg 13
4578 8 ghutchis
rr_14:          ld      d,data_7f
4579
                ld      e,data_80
4580
                rr      d
4581
                jr      c,rr_15
4582 11 ghutchis
                fail_msg 14
4583 8 ghutchis
rr_15:          rr      e
4584
                jr      nc,rr_16
4585 11 ghutchis
                fail_msg 15
4586 8 ghutchis
rr_16:          ld      a,d
4587
                cp      a,#3f
4588
                jr      z,rr_17
4589 11 ghutchis
                fail_msg 16
4590 8 ghutchis
rr_17:          ld      a,e
4591
                cp      a,#c0
4592
                jr      z,rr_18
4593 11 ghutchis
                fail_msg 17
4594 8 ghutchis
rr_18:          ld      hl,t_var2
4595
                ld      (hl),data_55
4596
                rr      (hl)
4597
                jp      p,rr_19
4598 11 ghutchis
                fail_msg 18
4599 8 ghutchis
rr_19:          jp      po,rr_20
4600 11 ghutchis
                fail_msg 19
4601 8 ghutchis
rr_20:          jr      c,rr_21
4602 11 ghutchis
                fail_msg 20
4603 8 ghutchis
rr_21:          jr      nz,rr_22
4604 11 ghutchis
                fail_msg 21
4605 8 ghutchis
rr_22:          rr      (hl)
4606
                jp      m,rr_23
4607 11 ghutchis
                fail_msg 22
4608 8 ghutchis
rr_23:          jp      pe,rr_24
4609 11 ghutchis
                fail_msg 23
4610 8 ghutchis
rr_24:          jr      nc,rr_25
4611 11 ghutchis
                fail_msg 24
4612 8 ghutchis
rr_25:          ld      a,(hl)
4613
                cp      a,#95
4614
                jr      z,rr_26
4615 11 ghutchis
                fail_msg 25
4616 8 ghutchis
rr_26:          ld      (hl),0
4617
                rr      (hl)
4618
                jr      z,rr_27
4619 11 ghutchis
                fail_msg 26
4620 8 ghutchis
rr_27:          ld      ix,t_var3
4621
                ld      a,data_55
4622
                ld      (ix-2),a
4623
                rr      (ix-2)
4624
                jp      p,rr_28
4625 11 ghutchis
                fail_msg 27
4626 8 ghutchis
rr_28:          jp      po,rr_29
4627 11 ghutchis
                fail_msg 28
4628 8 ghutchis
rr_29:          jr      c,rr_30
4629 11 ghutchis
                fail_msg 29
4630 8 ghutchis
rr_30:          jr      nz,rr_31
4631 11 ghutchis
                fail_msg 30
4632 8 ghutchis
rr_31:          rr      (ix-2)
4633
                jp      m,rr_32
4634 11 ghutchis
                fail_msg 31
4635 8 ghutchis
rr_32:          jp      pe,rr_33
4636 11 ghutchis
                fail_msg 32
4637 8 ghutchis
rr_33:          jr      nc,rr_34
4638 11 ghutchis
                fail_msg 33
4639 8 ghutchis
rr_34:          ld      a,(ix-2)
4640
                cp      a,#95
4641
                jr      z,rr_35
4642 11 ghutchis
                fail_msg 34
4643 8 ghutchis
rr_35:          ld      a,0
4644
                ld      (ix+2),a
4645
                rr      (ix+2)
4646
                jr      z,rr_36
4647 11 ghutchis
                fail_msg 35
4648 8 ghutchis
rr_36:          ld      iy,t_var3
4649
                ld      a,data_55
4650
                ld      (iy+2),a
4651
                rr      (iy+2)
4652
                jp      p,rr_37
4653 11 ghutchis
                fail_msg 36
4654 8 ghutchis
rr_37:          jp      po,rr_38
4655 11 ghutchis
                fail_msg 37
4656 8 ghutchis
rr_38:          jr      c,rr_39
4657 11 ghutchis
                fail_msg 38
4658 8 ghutchis
rr_39:          jr      nz,rr_40
4659 11 ghutchis
                fail_msg 39
4660 8 ghutchis
rr_40:          rr      (iy+2)
4661
                jp      m,rr_41
4662 11 ghutchis
                fail_msg 40
4663 8 ghutchis
rr_41:          jp      pe,rr_42
4664 11 ghutchis
                fail_msg 41
4665 8 ghutchis
rr_42:          jr      nc,rr_43
4666 11 ghutchis
                fail_msg 42
4667 8 ghutchis
rr_43:          ld      a,(iy+2)
4668
                cp      a,#95
4669
                jr      z,rr_44
4670 11 ghutchis
                fail_msg 43
4671 8 ghutchis
rr_44:          ld      a,0
4672
                ld      (iy-1),a
4673
                rr      (iy-1)
4674
                jr      z,sla_0
4675 11 ghutchis
                fail_msg 44
4676 17 ghutchis
sla_0:          nop
4677
                print   "sla"
4678
                ld      a,data_55
4679 8 ghutchis
                sla     a
4680
                jp      m,sla_1
4681 11 ghutchis
                fail_msg 0
4682 8 ghutchis
sla_1:          jp      pe,sla_2
4683 11 ghutchis
                fail_msg 1
4684 8 ghutchis
sla_2:          jr      nc,sla_3
4685 11 ghutchis
                fail_msg 2
4686 8 ghutchis
sla_3:          jr      nz,sla_4
4687 11 ghutchis
                fail_msg 3
4688 8 ghutchis
sla_4:          sla     a
4689
                jp      p,sla_5
4690 11 ghutchis
                fail_msg 4
4691 8 ghutchis
sla_5:          jp      po,sla_6
4692 11 ghutchis
                fail_msg 5
4693 8 ghutchis
sla_6:          jr      c,sla_7
4694 11 ghutchis
                fail_msg 6
4695 8 ghutchis
sla_7:          cp      a,data_55-1
4696
                jr      z,sla_8
4697 11 ghutchis
                fail_msg 7
4698 8 ghutchis
sla_8:          ld      a,0
4699
                sla     a
4700
                jr      z,sla_9
4701 11 ghutchis
                fail_msg 8
4702 8 ghutchis
sla_9:          ld      b,data_80
4703
                ld      c,data_7f
4704
                sla     b
4705
                jr      c,sla_10
4706 11 ghutchis
                fail_msg 9
4707 8 ghutchis
sla_10:         ld      a,b
4708
                cp      a,0
4709
                jr      z,sla_11
4710 11 ghutchis
                fail_msg 10
4711 8 ghutchis
sla_11:         sla     c
4712
                jp      m,sla_12
4713 11 ghutchis
                fail_msg 11
4714 8 ghutchis
sla_12:         ld      a,c
4715
                cp      a,data_ff-1
4716
                jr      z,sla_13
4717 11 ghutchis
                fail_msg 12
4718 8 ghutchis
sla_13:         ld      d,data_aa
4719
                ld      e,data_55
4720
                sla     d
4721
                jr      c,sla_14
4722 11 ghutchis
                fail_msg 13
4723 8 ghutchis
sla_14:         ld      a,d
4724
                cp      a,data_55-1
4725
                jr      z,sla_15
4726 11 ghutchis
                fail_msg 14
4727 8 ghutchis
sla_15:         sla     e
4728
                jp      m,sla_16
4729 11 ghutchis
                fail_msg 15
4730 8 ghutchis
sla_16:         ld      a,e
4731
                cp      a,data_aa
4732
                jr      z,sla_17
4733 11 ghutchis
                fail_msg 16
4734 8 ghutchis
sla_17:         ld      h,#12      ;bjp was >data_1234
4735
                ld      l,#34      ;bjp was >data_1234
4736
                sla     h
4737
                jp      p,sla_18
4738 11 ghutchis
                fail_msg 17
4739 8 ghutchis
sla_18:         ld      a,h
4740
                cp      a,#24
4741
                jr      z,sla_19
4742 11 ghutchis
                fail_msg 18
4743 8 ghutchis
sla_19:         sla     l
4744
                jp      p,sla_20
4745 11 ghutchis
                fail_msg 19
4746 8 ghutchis
sla_20:         ld      a,l
4747
                cp      a,#68
4748
                jr      z,sla_21
4749 11 ghutchis
                fail_msg 20
4750 8 ghutchis
sla_21:         ld      hl,t_var3
4751
                ld      (hl),data_55
4752
                sla     (hl)
4753
                jp      m,sla_22
4754 11 ghutchis
                fail_msg 21
4755 8 ghutchis
sla_22:         jp      pe,sla_23
4756 11 ghutchis
                fail_msg 22
4757 8 ghutchis
sla_23:         jr      nc,sla_24
4758 11 ghutchis
                fail_msg 23
4759 8 ghutchis
sla_24:         jr      nz,sla_25
4760 11 ghutchis
                fail_msg 24
4761 8 ghutchis
sla_25:         sla     (hl)
4762
                jp      p,sla_26
4763 11 ghutchis
                fail_msg 25
4764 8 ghutchis
sla_26:         jp      po,sla_27
4765 11 ghutchis
                fail_msg 26
4766 8 ghutchis
sla_27:         jr      c,sla_28
4767 11 ghutchis
                fail_msg 27
4768 8 ghutchis
sla_28:         ld      a,(hl)
4769
                cp      a,data_55-1
4770
                jr      z,sla_29
4771 11 ghutchis
                fail_msg 28
4772 8 ghutchis
sla_29:         ld      (hl),0
4773
                sla     (hl)
4774
                jr      z,sla_30
4775 11 ghutchis
                fail_msg 29
4776 8 ghutchis
sla_30:         ld      ix,t_var3
4777
                ld      a,data_55
4778
                ld      (ix-2),a
4779
                sla     (ix-2)
4780
                jp      m,sla_31
4781 11 ghutchis
                fail_msg 30
4782 8 ghutchis
sla_31:         jp      pe,sla_32
4783 11 ghutchis
                fail_msg 31
4784 8 ghutchis
sla_32:         jr      nc,sla_33
4785 11 ghutchis
                fail_msg 32
4786 8 ghutchis
sla_33:         jr      nz,sla_34
4787 11 ghutchis
                fail_msg 33
4788 8 ghutchis
sla_34:         sla     (ix-2)
4789
                jp      p,sla_35
4790 11 ghutchis
                fail_msg 34
4791 8 ghutchis
sla_35:         jp      po,sla_36
4792 11 ghutchis
                fail_msg 35
4793 8 ghutchis
sla_36:         jr      c,sla_37
4794 11 ghutchis
                fail_msg 36
4795 8 ghutchis
sla_37:         ld      a,(ix-2)
4796
                cp      a,data_55-1
4797
                jr      z,sla_38
4798 11 ghutchis
                fail_msg 37
4799 8 ghutchis
sla_38:         ld      a,data_80
4800
                ld      (ix+2),a
4801
                sla     (ix+2)
4802
                jr      z,sla_39
4803 11 ghutchis
                fail_msg 38
4804 8 ghutchis
sla_39:         jr      c,sla_40
4805 11 ghutchis
                fail_msg 39
4806 8 ghutchis
sla_40:         ld      iy,t_var3
4807
                ld      a,data_55
4808
                ld      (iy+2),a
4809
                sla     (iy+2)
4810
                jp      m,sla_41
4811 11 ghutchis
                fail_msg 40
4812 8 ghutchis
sla_41:         jp      pe,sla_42
4813 11 ghutchis
                fail_msg 41
4814 8 ghutchis
sla_42:         jr      nc,sla_43
4815 11 ghutchis
                fail_msg 42
4816 8 ghutchis
sla_43:         jr      nz,sla_44
4817 11 ghutchis
                fail_msg 43
4818 8 ghutchis
sla_44:         sla     (iy+2)
4819
                jp      p,sla_45
4820 11 ghutchis
                fail_msg 44
4821 8 ghutchis
sla_45:         jp      po,sla_46
4822 11 ghutchis
                fail_msg 45
4823 8 ghutchis
sla_46:         jr      c,sla_47
4824 11 ghutchis
                fail_msg 46
4825 8 ghutchis
sla_47:         ld      a,(iy+2)
4826
                cp      a,data_55-1
4827
                jr      z,sla_48
4828 11 ghutchis
                fail_msg 47
4829 8 ghutchis
sla_48:         ld      a,data_80
4830
                ld      (iy-2),a
4831
                sla     (iy-2)
4832
                jr      z,sla_49
4833 11 ghutchis
                fail_msg 48
4834 8 ghutchis
sla_49:         jr      c,sra_0
4835 11 ghutchis
                fail_msg 49
4836 17 ghutchis
sra_0:          nop
4837
                print   "sra"
4838
                ld      a,data_55
4839 8 ghutchis
                sra     a
4840
                jp      p,sra_1
4841 11 ghutchis
                fail_msg 0
4842 8 ghutchis
sra_1:          jp      po,sra_2
4843 11 ghutchis
                fail_msg 1
4844 8 ghutchis
sra_2:          jr      c,sra_3
4845 11 ghutchis
                fail_msg 2
4846 8 ghutchis
sra_3:          jr      nz,sra_4
4847 11 ghutchis
                fail_msg 3
4848 8 ghutchis
sra_4:          sra     a
4849
                jp      po,sra_5
4850 11 ghutchis
                fail_msg 4
4851 8 ghutchis
sra_5:          jr      nc,sra_6
4852 11 ghutchis
                fail_msg 5
4853 8 ghutchis
sra_6:          sra     a
4854
                jp      pe,sra_7
4855 11 ghutchis
                fail_msg 6
4856 8 ghutchis
sra_7:          cp      a,#0a                   ;data_aa.and.#0f
4857
                jr      z,sra_8
4858 11 ghutchis
                fail_msg 7
4859 8 ghutchis
sra_8:          ld      a,1
4860
                sra     a
4861
                jr      c,sra_9
4862 11 ghutchis
                fail_msg 8
4863 8 ghutchis
sra_9:          jr      z,sra_10
4864 11 ghutchis
                fail_msg 9
4865 8 ghutchis
sra_10:         ld      a,data_80
4866
                sra     a
4867
                jp      m,sra_11
4868 11 ghutchis
                fail_msg 10
4869 8 ghutchis
sra_11:         cp      a,#c0
4870
                jr      z,sra_12
4871 11 ghutchis
                fail_msg 11
4872 8 ghutchis
sra_12:         ld      b,data_7f
4873
                ld      c,data_aa
4874
                sra     b
4875
                jr      c,sra_13
4876 11 ghutchis
                fail_msg 12
4877 8 ghutchis
sra_13:         ld      a,b
4878
                cp      a,#3f
4879
                jr      z,sra_14
4880 11 ghutchis
                fail_msg 13
4881 8 ghutchis
sra_14:         sra     c
4882
                jr      nc,sra_15
4883 11 ghutchis
                fail_msg 14
4884 8 ghutchis
sra_15:         ld      a,c
4885
                cp      a,#d5
4886
                jr      z,sra_16
4887 11 ghutchis
                fail_msg 15
4888 8 ghutchis
sra_16:         ld      d,data_55
4889
                ld      e,data_ff
4890
                sra     d
4891
                jr      c,sra_17
4892 11 ghutchis
                fail_msg 16
4893 8 ghutchis
sra_17:         ld      a,d
4894
                cp      a,#2a
4895
                jr      z,sra_18
4896 11 ghutchis
                fail_msg 17
4897 8 ghutchis
sra_18:         sra     e
4898
                jp      m,sra_19
4899 11 ghutchis
                fail_msg 18
4900 8 ghutchis
sra_19:         ld      a,e
4901
                cp      a,data_ff
4902
                jr      z,sra_20
4903 11 ghutchis
                fail_msg 19
4904 8 ghutchis
sra_20:         ld      h,data_aa
4905
                ld      l,data_7f
4906
                sra     h
4907
                jp      m,sra_21
4908 11 ghutchis
                fail_msg 20
4909 8 ghutchis
sra_21:         ld      a,h
4910
                cp      a,#d5
4911
                jr      z,sra_22
4912 11 ghutchis
                fail_msg 21
4913 8 ghutchis
sra_22:         sra     l
4914
                jr      c,sra_23
4915 11 ghutchis
                fail_msg 22
4916 8 ghutchis
sra_23:         ld      a,l
4917
                cp      a,#3f
4918
                jr      z,sra_24
4919 11 ghutchis
                fail_msg 23
4920 8 ghutchis
sra_24:         ld      hl,t_var1
4921
                ld      (hl),data_55
4922
                sra     (hl)
4923
                jp      p,sra_25
4924 11 ghutchis
                fail_msg 24
4925 8 ghutchis
sra_25:         jp      po,sra_26
4926 11 ghutchis
                fail_msg 25
4927 8 ghutchis
sra_26:         jr      c,sra_27
4928 11 ghutchis
                fail_msg 26
4929 8 ghutchis
sra_27:         jr      nz,sra_28
4930 11 ghutchis
                fail_msg 27
4931 8 ghutchis
sra_28:         sra     (hl)
4932
                jr      nc,sra_29
4933 11 ghutchis
                fail_msg 28
4934 8 ghutchis
sra_29:         sra     (hl)
4935
                jp      pe,sra_30
4936 11 ghutchis
                fail_msg 29
4937 8 ghutchis
sra_30:         ld      a,(hl)
4938
                cp      a,#0a                   ;data_aa.and.#0f
4939
                jr      z,sra_31
4940 11 ghutchis
                fail_msg 30
4941 8 ghutchis
sra_31:         ld      (hl),data_80
4942
                sra     (hl)
4943
                jp      m,sra_32
4944 11 ghutchis
                fail_msg 31
4945 8 ghutchis
sra_32:         ld      a,(hl)
4946
                cp      a,#c0
4947
                jr      z,sra_33
4948 11 ghutchis
                fail_msg 32
4949 8 ghutchis
sra_33:         ld      (hl),1
4950
                sra     (hl)
4951
                jr      c,sra_34
4952 11 ghutchis
                fail_msg 33
4953 8 ghutchis
sra_34:         jr      z,sra_35
4954 11 ghutchis
                fail_msg 34
4955 8 ghutchis
sra_35:         ld      ix,t_var3
4956
                ld      a,data_55
4957
                ld      (ix-2),a
4958
                sra     (ix-2)
4959
                jp      p,sra_36
4960 11 ghutchis
                fail_msg 35
4961 8 ghutchis
sra_36:         jp      po,sra_37
4962 11 ghutchis
                fail_msg 36
4963 8 ghutchis
sra_37:         jr      c,sra_38
4964 11 ghutchis
                fail_msg 37
4965 8 ghutchis
sra_38:         jr      nz,sra_39
4966 11 ghutchis
                fail_msg 38
4967 8 ghutchis
sra_39:         sra     (ix-2)
4968
                jr      nc,sra_40
4969 11 ghutchis
                fail_msg 39
4970 8 ghutchis
sra_40:         sra     (ix-2)
4971
                jp      pe,sra_41
4972 11 ghutchis
                fail_msg 40
4973 8 ghutchis
sra_41:         ld      a,(ix-2)
4974
                cp      a,#0a           ;data_aa.and.#0f
4975
                jr      z,sra_42
4976 11 ghutchis
                fail_msg 41
4977 8 ghutchis
sra_42:         ld      a,data_80
4978
                ld      (ix+2),a
4979
                sra     (ix+2)
4980
                jp      m,sra_43
4981 11 ghutchis
                fail_msg 42
4982 8 ghutchis
sra_43:         ld      a,(ix+2)
4983
                cp      a,#c0
4984
                jr      z,sra_44
4985 11 ghutchis
                fail_msg 43
4986 8 ghutchis
sra_44:         ld      a,1
4987
                ld      (ix-1),a
4988
                sra     (ix-1)
4989
                jr      c,sra_45
4990 11 ghutchis
                fail_msg 44
4991 8 ghutchis
sra_45:         jr      z,sra_46
4992 11 ghutchis
                fail_msg 45
4993 8 ghutchis
sra_46:         ld      iy,t_var3
4994
                ld      a,data_55
4995
                ld      (iy-2),a
4996
                sra     (iy-2)
4997
                jp      p,sra_47
4998 11 ghutchis
                fail_msg 46
4999 8 ghutchis
sra_47:         jp      po,sra_48
5000 11 ghutchis
                fail_msg 47
5001 8 ghutchis
sra_48:         jr      c,sra_49
5002 11 ghutchis
                fail_msg 48
5003 8 ghutchis
sra_49:         jr      nz,sra_50
5004 11 ghutchis
                fail_msg 49
5005 8 ghutchis
sra_50:         sra     (iy-2)
5006
                jr      nc,sra_51
5007 11 ghutchis
                fail_msg 50
5008 8 ghutchis
sra_51:         sra     (iy-2)
5009
                jp      pe,sra_52
5010 11 ghutchis
                fail_msg 51
5011 8 ghutchis
sra_52:         ld      a,(iy-2)
5012
                cp      a,#0a           ;data_aa.and.#0f
5013
                jr      z,sra_53
5014 11 ghutchis
                fail_msg 52
5015 8 ghutchis
sra_53:         ld      a,data_80
5016
                ld      (iy+2),a
5017
                sra     (iy+2)
5018
                jp      m,sra_54
5019 11 ghutchis
                fail_msg 53
5020 8 ghutchis
sra_54:         ld      a,(iy+2)
5021
                cp      a,#c0
5022
                jr      z,sra_55
5023 11 ghutchis
                fail_msg 54
5024 8 ghutchis
sra_55:         ld      a,1
5025
                ld      (iy-1),a
5026
                sra     (iy-1)
5027
                jr      c,sra_56
5028 11 ghutchis
                fail_msg 55
5029 8 ghutchis
sra_56:         jr      z,srl_0
5030 11 ghutchis
                fail_msg 56
5031 17 ghutchis
srl_0:          nop
5032
                print   "srl"
5033
                ld      a,data_55
5034 8 ghutchis
                srl     a
5035
                jr      c,srl_1
5036 11 ghutchis
                fail_msg 0
5037 8 ghutchis
srl_1:          jp      po,srl_2
5038 11 ghutchis
                fail_msg 1
5039 8 ghutchis
srl_2:          srl     a
5040
                jr      nc,srl_3
5041 11 ghutchis
                fail_msg 2
5042 8 ghutchis
srl_3:          srl     a
5043
                jp      pe,srl_4
5044 11 ghutchis
                fail_msg 3
5045 8 ghutchis
srl_4:          cp      a,#0a                   ;data_aa.and.#0f
5046
                jr      z,srl_5
5047 11 ghutchis
                fail_msg 4
5048 8 ghutchis
srl_5:          ld      a,data_80
5049
                and     a
5050
                jp      m,srl_6
5051 11 ghutchis
                fail_msg 5
5052 8 ghutchis
srl_6:          srl     a
5053
                jp      p,srl_7
5054 11 ghutchis
                fail_msg 6
5055 8 ghutchis
srl_7:          ld      a,2
5056
                srl     a
5057
                jr      nz,srl_8
5058 11 ghutchis
                fail_msg 7
5059 8 ghutchis
srl_8:          srl     a
5060
                jr      z,srl_9
5061 11 ghutchis
                fail_msg 8
5062 8 ghutchis
srl_9:          jr      c,srl_10
5063 11 ghutchis
                fail_msg 9
5064 8 ghutchis
srl_10:         ld      b,data_aa
5065
                srl     b
5066
                jp      p,srl_11
5067 11 ghutchis
                fail_msg 10
5068 8 ghutchis
srl_11:         ld      a,b
5069
                cp      a,data_55
5070
                jr      z,srl_12
5071 11 ghutchis
                fail_msg 11
5072 8 ghutchis
srl_12:         ld      c,data_7f
5073
                srl     c
5074
                jr      c,srl_13
5075 11 ghutchis
                fail_msg 12
5076 8 ghutchis
srl_13:         ld      a,c
5077
                cp      a,#3f
5078
                jr      z,srl_14
5079 11 ghutchis
                fail_msg 13
5080 8 ghutchis
srl_14:         ld      d,data_55
5081
                srl     d
5082
                jr      c,srl_15
5083 11 ghutchis
                fail_msg 14
5084 8 ghutchis
srl_15:         ld      a,d
5085
                cp      a,#2a
5086
                jr      z,srl_16
5087 11 ghutchis
                fail_msg 15
5088 8 ghutchis
srl_16:         ld      e,data_ff
5089
                srl     e
5090
                jr      c,srl_17
5091 11 ghutchis
                fail_msg 16
5092 8 ghutchis
srl_17:         ld      a,e
5093
                cp      a,data_7f
5094
                jr      z,srl_18
5095 11 ghutchis
                fail_msg 17
5096 8 ghutchis
srl_18:         ld      h,#12      ;bjp was >data_1234
5097
                srl     h
5098
                jr      nc,srl_19
5099 11 ghutchis
                fail_msg 18
5100 8 ghutchis
srl_19:         ld      a,h
5101
                cp      a,9
5102
                jr      z,srl_20
5103 11 ghutchis
                fail_msg 19
5104 8 ghutchis
srl_20:         ld      l,#34      ;bjp was >data_1234
5105
                srl     l
5106
                jr      nc,srl_21
5107 11 ghutchis
                fail_msg 20
5108 8 ghutchis
srl_21:         ld      a,l
5109
                cp      a,#1a
5110
                jr      z,srl_22
5111 11 ghutchis
                fail_msg 21
5112 8 ghutchis
srl_22:         ld      hl,t_var1
5113
                ld      (hl),data_55
5114
                srl     (hl)
5115
                jr      c,srl_23
5116 11 ghutchis
                fail_msg 22
5117 8 ghutchis
srl_23:         jp      po,srl_24
5118 11 ghutchis
                fail_msg 23
5119 8 ghutchis
srl_24:         srl     (hl)
5120
                jr      nc,srl_25
5121 11 ghutchis
                fail_msg 24
5122 8 ghutchis
srl_25:         srl     (hl)
5123
                jp      pe,srl_26
5124 11 ghutchis
                fail_msg 25
5125 8 ghutchis
srl_26:         ld      a,(hl)
5126
                cp      a,#0a                   ;data_aa.and.#0f
5127
                jr      z,srl_27
5128 11 ghutchis
                fail_msg 26
5129 8 ghutchis
srl_27:         ld      (hl),data_80
5130
                and     (hl)
5131
                jp      z,srl_28
5132 11 ghutchis
                fail_msg 27
5133 8 ghutchis
srl_28:         srl     (hl)
5134
                jp      p,srl_29
5135 11 ghutchis
                fail_msg 28
5136 8 ghutchis
srl_29:         ld      a,(hl)
5137
                cp      a,#40
5138
                jr      z,srl_30
5139 11 ghutchis
                fail_msg 29
5140 8 ghutchis
srl_30:         ld      (hl),2
5141
                srl     (hl)
5142
                jr      nz,srl_31
5143 11 ghutchis
                fail_msg 30
5144 8 ghutchis
srl_31:         srl     (hl)
5145
                jr      z,srl_32
5146 11 ghutchis
                fail_msg 31
5147 8 ghutchis
srl_32:         jr      c,srl_33
5148 11 ghutchis
                fail_msg 32
5149 8 ghutchis
srl_33:         ld      ix,t_var3
5150
                ld      a,data_55
5151
                ld      (ix+2),a
5152
                srl     (ix+2)
5153
                jr      c,srl_34
5154 11 ghutchis
                fail_msg 33
5155 8 ghutchis
srl_34:         jp      po,srl_35
5156 11 ghutchis
                fail_msg 34
5157 8 ghutchis
srl_35:         srl     (ix+2)
5158
                jr      nc,srl_36
5159 11 ghutchis
                fail_msg 35
5160 8 ghutchis
srl_36:         srl     (ix+2)
5161
                jp      pe,srl_37
5162 11 ghutchis
                fail_msg 36
5163 8 ghutchis
srl_37:         ld      a,(ix+2)
5164
                cp      a,#0a                   ;data_aa.and.#0f
5165
                jr      z,srl_38
5166 11 ghutchis
                fail_msg 37
5167 8 ghutchis
srl_38:         ld      a,data_80
5168
                ld      (ix-2),a
5169
                and     (ix-2)
5170
                jp      m,srl_39
5171 11 ghutchis
                fail_msg 38
5172 8 ghutchis
srl_39:         srl     (ix-2)
5173
                jp      p,srl_40
5174 11 ghutchis
                fail_msg 39
5175 8 ghutchis
srl_40:         ld      a,(ix-2)
5176
                cp      a,#40
5177
                jr      z,srl_41
5178 11 ghutchis
                fail_msg 40
5179 8 ghutchis
srl_41:         ld      a,2
5180
                ld      (ix+1),a
5181
                srl     (ix+1)
5182
                jr      nz,srl_42
5183 11 ghutchis
                fail_msg 41
5184 8 ghutchis
srl_42:         srl     (ix+1)
5185
                jr      z,srl_43
5186 11 ghutchis
                fail_msg 42
5187 8 ghutchis
srl_43:         jr      c,srl_44
5188 11 ghutchis
                fail_msg 43
5189 8 ghutchis
srl_44:         ld      iy,t_var3
5190
                ld      a,data_55
5191
                ld      (iy+2),a
5192
                srl     (iy+2)
5193
                jr      c,srl_45
5194 11 ghutchis
                fail_msg 44
5195 8 ghutchis
srl_45:         jp      po,srl_46
5196 11 ghutchis
                fail_msg 45
5197 8 ghutchis
srl_46:         srl     (iy+2)
5198
                jr      nc,srl_47
5199 11 ghutchis
                fail_msg 46
5200 8 ghutchis
srl_47:         srl     (iy+2)
5201
                jp      pe,srl_48
5202 11 ghutchis
                fail_msg 47
5203 8 ghutchis
srl_48:         ld      a,(iy+2)
5204
                cp      a,#0a                   ;data_aa.and.#0f
5205
                jr      z,srl_49
5206 11 ghutchis
                fail_msg 48
5207 8 ghutchis
srl_49:         ld      a,data_80
5208
                ld      (iy-2),a
5209
                and     (iy-2)
5210
                jp      m,srl_50
5211 11 ghutchis
                fail_msg 49
5212 8 ghutchis
srl_50:         srl     (iy-2)
5213
                jp      p,srl_51
5214 11 ghutchis
                fail_msg 50
5215 8 ghutchis
srl_51:         ld      a,(iy-2)
5216
                cp      a,#40
5217
                jr      z,srl_52
5218 11 ghutchis
                fail_msg 51
5219 8 ghutchis
srl_52:         ld      a,2
5220
                ld      (iy+1),a
5221
                srl     (iy+1)
5222
                jr      nz,srl_53
5223 11 ghutchis
                fail_msg 52
5224 8 ghutchis
srl_53:         srl     (iy+1)
5225
                jr      z,srl_54
5226 11 ghutchis
                fail_msg 53
5227 8 ghutchis
srl_54:         jr      c,rld_0
5228 11 ghutchis
                fail_msg 54
5229 17 ghutchis
rld_0:          nop
5230
                print   "rld/rrd"
5231
                ld      hl,t_var5
5232 8 ghutchis
                ld      a,data_55
5233
                ld      (hl),data_aa
5234
                rld
5235
                jp      p,rld_1
5236 11 ghutchis
                fail_msg 0
5237 8 ghutchis
rld_1:          cp      a,data_55+5
5238
                jr      z,rld_2
5239 11 ghutchis
                fail_msg 1
5240 8 ghutchis
rld_2:          ld      a,(hl)
5241
                cp      a,data_aa-5
5242
                jr      z,rld_3
5243 11 ghutchis
                fail_msg 2
5244 8 ghutchis
rld_3:          ld      (hl),data_7f
5245
                ld      a,data_80
5246
                rld
5247
                jp      m,rld_4
5248 11 ghutchis
                fail_msg 3
5249 8 ghutchis
rld_4:          jp      pe,rld_5
5250 11 ghutchis
                fail_msg 4
5251 8 ghutchis
rld_5:          rld
5252
                jp      po,rld_6
5253 11 ghutchis
                fail_msg 5
5254 8 ghutchis
rld_6:          cp      a,data_80+15
5255
                jr      z,rld_7
5256 11 ghutchis
                fail_msg 6
5257 8 ghutchis
rld_7:          ld      a,(hl)
5258
                cp      a,7
5259
                jr      z,rld_8
5260 11 ghutchis
                fail_msg 7
5261 8 ghutchis
rld_8:          ld      a,#05                   ;data_55.and.#0f
5262
                ld      (hl),#0a                        ;data_aa.and.#0f
5263
                rld
5264
                jr      z,rld_9
5265 11 ghutchis
                fail_msg 8
5266 8 ghutchis
rld_9:          ld      a,(hl)
5267
                cp      a,#a5
5268
                jr      z,rrd_0
5269 11 ghutchis
                fail_msg 9
5270 8 ghutchis
rrd_0:          ld      hl,t_var3
5271
                ld      a,data_55
5272
                ld      (hl),data_aa
5273
                rrd
5274
                jp      p,rrd_1
5275 11 ghutchis
                fail_msg 0
5276 8 ghutchis
rrd_1:          jp      pe,rrd_2
5277 11 ghutchis
                fail_msg 1
5278 8 ghutchis
rrd_2:          jr      nz,rrd_3
5279 11 ghutchis
                fail_msg 2
5280 8 ghutchis
rrd_3:          cp      a,data_55+5
5281
                jr      z,rrd_4
5282 11 ghutchis
                fail_msg 3
5283 8 ghutchis
rrd_4:          ld      a,(hl)
5284
                cp      a,data_55+5
5285
                jr      z,rrd_5
5286 11 ghutchis
                fail_msg 4
5287 8 ghutchis
rrd_5:          ld      (hl),data_7f
5288
                ld      a,data_80
5289
                rrd
5290
                jp      m,rrd_6
5291 11 ghutchis
                fail_msg 5
5292 8 ghutchis
rrd_6:          jp      po,rrd_7
5293 11 ghutchis
                fail_msg 6
5294 8 ghutchis
rrd_7:          cp      a,data_80+15
5295
                jr      z,rrd_8
5296 11 ghutchis
                fail_msg 7
5297 8 ghutchis
rrd_8:          ld      a,(hl)
5298
                cp      a,7
5299
                jr      z,rrd_9
5300 11 ghutchis
                fail_msg 8
5301 8 ghutchis
rrd_9:          ld      a,8
5302
                ld      (hl),0
5303
                rrd
5304
                jr      z,rrd_10
5305 11 ghutchis
                fail_msg 9
5306 8 ghutchis
rrd_10:         ld      a,(hl)
5307
                cp      a,data_80
5308
                jr      z,bit_0
5309 11 ghutchis
                fail_msg 10
5310 17 ghutchis
bit_0:          nop
5311
                print   "bit"
5312
                ld      a,data_ff
5313 8 ghutchis
                bit     0,a
5314
                jr      nz,bit_1
5315 11 ghutchis
                fail_msg 0
5316 8 ghutchis
bit_1:          bit     1,a
5317
                jr      nz,bit_2
5318 11 ghutchis
                fail_msg 1
5319 8 ghutchis
bit_2:          bit     2,a
5320
                jr      nz,bit_3
5321 11 ghutchis
                fail_msg 2
5322 8 ghutchis
bit_3:          bit     3,a
5323
                jr      nz,bit_4
5324 11 ghutchis
                fail_msg 3
5325 8 ghutchis
bit_4:          bit     4,a
5326
                jr      nz,bit_5
5327 11 ghutchis
                fail_msg 4
5328 8 ghutchis
bit_5:          bit     5,a
5329
                jr      nz,bit_6
5330 11 ghutchis
                fail_msg 5
5331 8 ghutchis
bit_6:          bit     6,a
5332
                jr      nz,bit_7
5333 11 ghutchis
                fail_msg 6
5334 8 ghutchis
bit_7:          bit     7,a
5335
                jr      nz,bit_8
5336 11 ghutchis
                fail_msg 7
5337 8 ghutchis
bit_8:          ld      a,0
5338
                bit     0,a
5339
                jr      z,bit_9
5340 11 ghutchis
                fail_msg 8
5341 8 ghutchis
bit_9:          bit     1,a
5342
                jr      z,bit_10
5343 11 ghutchis
                fail_msg 9
5344 8 ghutchis
bit_10:         bit     2,a
5345
                jr      z,bit_11
5346 11 ghutchis
                fail_msg 10
5347 8 ghutchis
bit_11:         bit     3,a
5348
                jr      z,bit_12
5349 11 ghutchis
                fail_msg 11
5350 8 ghutchis
bit_12:         bit     4,a
5351
                jr      z,bit_13
5352 11 ghutchis
                fail_msg 12
5353 8 ghutchis
bit_13:         bit     5,a
5354
                jr      z,bit_14
5355 11 ghutchis
                fail_msg 13
5356 8 ghutchis
bit_14:         bit     6,a
5357
                jr      z,bit_15
5358 11 ghutchis
                fail_msg 14
5359 8 ghutchis
bit_15:         bit     7,a
5360
                jr      z,bit_16
5361 11 ghutchis
                fail_msg 15
5362 8 ghutchis
bit_16:         ld      b,data_80
5363
                bit     2,b
5364
                jr      z,bit_17
5365 11 ghutchis
                fail_msg 16
5366 8 ghutchis
bit_17:         bit     7,b
5367
                jr      nz,bit_18
5368 11 ghutchis
                fail_msg 17
5369 8 ghutchis
bit_18:         ld      c,data_55
5370
                bit     7,c
5371
                jr      z,bit_19
5372 11 ghutchis
                fail_msg 18
5373 8 ghutchis
bit_19:         bit     0,c
5374
                jr      nz,bit_20
5375 11 ghutchis
                fail_msg 19
5376 8 ghutchis
bit_20:         ld      d,data_aa
5377
                bit     7,d
5378
                jr      nz,bit_21
5379 11 ghutchis
                fail_msg 20
5380 8 ghutchis
bit_21:         bit     4,d
5381
                jr      z,bit_22
5382 11 ghutchis
                fail_msg 21
5383 8 ghutchis
bit_22:         ld      e,data_7f
5384
                bit     7,e
5385
                jr      z,bit_23
5386 11 ghutchis
                fail_msg 22
5387 8 ghutchis
bit_23:         bit     3,e
5388
                jr      nz,bit_24
5389 11 ghutchis
                fail_msg 23
5390 8 ghutchis
bit_24:         ld      h,#12      ;bjp was >data_1234
5391
                bit     4,h
5392
                jr      nz,bit_25
5393 11 ghutchis
                fail_msg 24
5394 8 ghutchis
bit_25:         bit     2,h
5395
                jr      z,bit_26
5396 11 ghutchis
                fail_msg 25
5397 8 ghutchis
bit_26:         ld      l,#34      ;bjp was >data_1234
5398
                bit     3,l
5399
                jr      z,bit_27
5400 11 ghutchis
                fail_msg 26
5401 8 ghutchis
bit_27:         bit     2,l
5402
                jr      nz,bit_28
5403 11 ghutchis
                fail_msg 27
5404 8 ghutchis
bit_28:         ld      hl,t_var4
5405
                ld      (hl),data_55
5406
                bit     0,(hl)
5407
                jr      nz,bit_29
5408 11 ghutchis
                fail_msg 28
5409 8 ghutchis
bit_29:         bit     1,(hl)
5410
                jr      z,bit_30
5411 11 ghutchis
                fail_msg 29
5412 8 ghutchis
bit_30:         bit     2,(hl)
5413
                jr      nz,bit_31
5414 11 ghutchis
                fail_msg 30
5415 8 ghutchis
bit_31:         bit     3,(hl)
5416
                jr      z,bit_32
5417 11 ghutchis
                fail_msg 31
5418 8 ghutchis
bit_32:         bit     4,(hl)
5419
                jr      nz,bit_33
5420 11 ghutchis
                fail_msg 32
5421 8 ghutchis
bit_33:         bit     5,(hl)
5422
                jr      z,bit_34
5423 11 ghutchis
                fail_msg 33
5424 8 ghutchis
bit_34:         bit     6,(hl)
5425
                jr      nz,bit_35
5426 11 ghutchis
                fail_msg 34
5427 8 ghutchis
bit_35:         bit     7,(hl)
5428
                jr      z,bit_36
5429 11 ghutchis
                fail_msg 35
5430 8 ghutchis
bit_36:         ld      ix,t_var3
5431
                ld      a,data_aa
5432
                ld      (ix-2),a
5433
                bit     0,(ix-2)
5434
                jr      z,bit_37
5435 11 ghutchis
                fail_msg 36
5436 8 ghutchis
bit_37:         bit     1,(ix-2)
5437
                jr      nz,bit_38
5438 11 ghutchis
                fail_msg 37
5439 8 ghutchis
bit_38:         bit     2,(ix-2)
5440
                jr      z,bit_39
5441 11 ghutchis
                fail_msg 38
5442 8 ghutchis
bit_39:         bit     3,(ix-2)
5443
                jr      nz,bit_40
5444 11 ghutchis
                fail_msg 39
5445 8 ghutchis
bit_40:         bit     4,(ix-2)
5446
                jr      z,bit_41
5447 11 ghutchis
                fail_msg 40
5448 8 ghutchis
bit_41:         bit     5,(ix-2)
5449
                jr      nz,bit_42
5450 11 ghutchis
                fail_msg 41
5451 8 ghutchis
bit_42:         bit     6,(ix-2)
5452
                jr      z,bit_43
5453 11 ghutchis
                fail_msg 42
5454 8 ghutchis
bit_43:         bit     7,(ix-2)
5455
                jr      nz,bit_44
5456 11 ghutchis
                fail_msg 43
5457 8 ghutchis
bit_44:         ld      iy,t_var3
5458
                ld      a,data_55
5459
                ld      (iy+2),a
5460
                bit     0,(iy+2)
5461
                jr      nz,bit_45
5462 11 ghutchis
                fail_msg 44
5463 8 ghutchis
bit_45:         bit     1,(iy+2)
5464
                jr      z,bit_46
5465 11 ghutchis
                fail_msg 45
5466 8 ghutchis
bit_46:         bit     2,(iy+2)
5467
                jr      nz,bit_47
5468 11 ghutchis
                fail_msg 46
5469 8 ghutchis
bit_47:         bit     3,(iy+2)
5470
                jr      z,bit_48
5471 11 ghutchis
                fail_msg 47
5472 8 ghutchis
bit_48:         bit     4,(iy+2)
5473
                jr      nz,bit_49
5474 11 ghutchis
                fail_msg 48
5475 8 ghutchis
bit_49:         bit     5,(iy+2)
5476
                jr      z,bit_50
5477 11 ghutchis
                fail_msg 49
5478 8 ghutchis
bit_50:         bit     6,(iy+2)
5479
                jr      nz,bit_51
5480 11 ghutchis
                fail_msg 50
5481 8 ghutchis
bit_51:         bit     7,(iy+2)
5482
                jr      z,set_0
5483 11 ghutchis
                fail_msg 51
5484 17 ghutchis
set_0:          nop
5485
                print   "set"
5486
                ld      a,0
5487 8 ghutchis
                set     0,a
5488
                set     2,a
5489
                set     4,a
5490
                set     6,a
5491
                cp      a,data_55
5492
                jr      z,set_1
5493 11 ghutchis
                fail_msg 0
5494 8 ghutchis
set_1:          set     1,a
5495
                set     3,a
5496
                set     5,a
5497
                set     7,a
5498
                cp      a,data_ff
5499
                jr      z,set_2
5500 11 ghutchis
                fail_msg 1
5501 8 ghutchis
set_2:          ld      b,0
5502
                set     1,b
5503
                set     3,b
5504
                ld      a,b
5505
                cp      a,#0a                   ;data_aa.and.#0f
5506
                jr      z,set_3
5507 11 ghutchis
                fail_msg 2
5508 8 ghutchis
set_3:          ld      c,0
5509
                set     1,c
5510
                set     4,c
5511
                ld      a,c
5512
                cp      a,#12      ;bjp was >data_1234
5513
                jr      z,set_4
5514 11 ghutchis
                fail_msg 3
5515 8 ghutchis
set_4:          ld      d,0
5516
                set     2,d
5517
                set     4,d
5518
                set     5,d
5519
                ld      a,d
5520
                cp      a,#34      ;bjp was >data_1234
5521
                jr      z,set_5
5522 11 ghutchis
                fail_msg 4
5523 8 ghutchis
set_5:          ld      e,0
5524
                set     7,e
5525
                ld      a,e
5526
                cp      a,data_80
5527
                jr      z,set_6
5528 11 ghutchis
                fail_msg 5
5529 8 ghutchis
set_6:          ld      h,0
5530
                set     0,h
5531
                set     2,h
5532
                set     4,h
5533
                set     6,h
5534
                ld      a,h
5535
                cp      a,data_55
5536
                jr      z,set_7
5537 11 ghutchis
                fail_msg 6
5538 8 ghutchis
set_7:          ld      l,0
5539
                set     1,l
5540
                set     3,l
5541
                set     5,l
5542
                set     7,l
5543
                ld      a,l
5544
                cp      a,data_aa
5545
                jr      z,set_8
5546 11 ghutchis
                fail_msg 7
5547 8 ghutchis
set_8:          ld      hl,t_var5
5548
                ld      (hl),0
5549
                set     0,(hl)
5550
                set     2,(hl)
5551
                set     4,(hl)
5552
                set     6,(hl)
5553
                ld      a,(hl)
5554
                cp      a,data_55
5555
                jr      z,set_9
5556 11 ghutchis
                fail_msg 8
5557 8 ghutchis
set_9:          ld      (hl),0
5558
                set     1,(hl)
5559
                set     3,(hl)
5560
                set     5,(hl)
5561
                set     7,(hl)
5562
                ld      a,(hl)
5563
                cp      a,data_aa
5564
                jr      z,set_10
5565 11 ghutchis
                fail_msg 9
5566 8 ghutchis
set_10:         ld      ix,t_var3
5567
                ld      a,0
5568
                ld      (ix-2),a
5569
                ld      (ix+2),a
5570
                set     0,(ix-2)
5571
                set     2,(ix-2)
5572
                set     4,(ix-2)
5573
                set     6,(ix-2)
5574
                ld      a,(ix-2)
5575
                cp      a,data_55
5576
                jr      z,set_11
5577 11 ghutchis
                fail_msg 10
5578 8 ghutchis
set_11:         set     1,(ix+2)
5579
                set     3,(ix+2)
5580
                set     5,(ix+2)
5581
                set     7,(ix+2)
5582
                ld      a,(ix+2)
5583
                cp      a,data_aa
5584
                jr      z,set_12
5585 11 ghutchis
                fail_msg 11
5586 8 ghutchis
set_12:         ld      iy,t_var3
5587
                ld      a,0
5588
                ld      (iy-1),a
5589
                ld      (iy+1),a
5590
                set     0,(iy-1)
5591
                set     2,(iy-1)
5592
                set     4,(iy-1)
5593
                set     6,(iy-1)
5594
                ld      a,(iy-1)
5595
                cp      a,data_55
5596
                jr      z,set_13
5597 11 ghutchis
                fail_msg 12
5598 8 ghutchis
set_13:         set     1,(iy+1)
5599
                set     3,(iy+1)
5600
                set     5,(iy+1)
5601
                set     7,(iy+1)
5602
                ld      a,(iy+1)
5603
                cp      a,data_aa
5604
                jr      z,res_0
5605 11 ghutchis
                fail_msg 13
5606 17 ghutchis
res_0:          nop
5607
                print   "res"
5608
                ld      a,data_ff
5609 8 ghutchis
                res     7,a
5610
                cp      a,data_7f
5611
                jr      z,res_1
5612 11 ghutchis
                fail_msg 0
5613 8 ghutchis
res_1:          res     5,a
5614
                res     3,a
5615
                res     1,a
5616
                cp      a,data_55
5617
                jr      z,res_2
5618 11 ghutchis
                fail_msg 1
5619 8 ghutchis
res_2:          ld      a,data_ff
5620
                res     0,a
5621
                res     2,a
5622
                res     4,a
5623
                res     6,a
5624
                cp      a,data_aa
5625
                jr      z,res_3
5626 11 ghutchis
                fail_msg 2
5627 8 ghutchis
res_3:          ld      b,data_ff
5628
                res     7,b
5629
                ld      a,b
5630
                cp      a,data_7f
5631
                jr      z,res_4
5632 11 ghutchis
                fail_msg 3
5633 8 ghutchis
res_4:          ld      c,data_ff
5634
                res     0,c
5635
                res     1,c
5636
                res     2,c
5637
                res     3,c
5638
                res     4,c
5639
                res     5,c
5640
                res     6,c
5641
                ld      a,c
5642
                cp      a,data_80
5643
                jr      z,res_5
5644 11 ghutchis
                fail_msg 4
5645 8 ghutchis
res_5:          ld      d,data_ff
5646
                res     0,d
5647
                res     2,d
5648
                res     4,d
5649
                res     6,d
5650
                ld      a,d
5651
                cp      a,data_aa
5652
                jr      z,res_6
5653 11 ghutchis
                fail_msg 5
5654 8 ghutchis
res_6:          ld      e,data_ff
5655
                res     1,e
5656
                res     3,e
5657
                res     5,e
5658
                res     7,e
5659
                ld      a,e
5660
                cp      a,data_55
5661
                jr      z,res_7
5662 11 ghutchis
                fail_msg 6
5663 8 ghutchis
res_7:          ld      h,data_ff
5664
                res     0,h
5665
                res     2,h
5666
                res     3,h
5667
                res     5,h
5668
                res     6,h
5669
                res     7,h
5670
                ld      a,h
5671
                cp      a,#12      ;bjp was >data_1234
5672
                jr      z,res_8
5673 11 ghutchis
                fail_msg 7
5674 8 ghutchis
res_8:          ld      l,data_ff
5675
                res     0,l
5676
                res     1,l
5677
                res     3,l
5678
                res     6,l
5679
                res     7,l
5680
                ld      a,l
5681
                cp      a,#34      ;bjp was >data_1234
5682
                jr      z,res_9
5683 11 ghutchis
                fail_msg 8
5684 8 ghutchis
res_9:          ld      hl,t_var3
5685
                ld      (hl),data_ff
5686
                res     0,(hl)
5687
                res     2,(hl)
5688
                res     4,(hl)
5689
                res     6,(hl)
5690
                ld      a,(hl)
5691
                cp      a,data_aa
5692
                jr      z,res_10
5693 11 ghutchis
                fail_msg 9
5694 8 ghutchis
res_10:         res     1,(hl)
5695
                res     3,(hl)
5696
                res     5,(hl)
5697
                res     7,(hl)
5698
                ld      a,(hl)
5699
                cp      a,0
5700
                jr      z,res_11
5701 11 ghutchis
                fail_msg 10
5702 8 ghutchis
res_11:         ld      ix,t_var3
5703
                ld      a,data_ff
5704
                ld      (ix-2),a
5705
                ld      (ix+2),a
5706
                res     1,(ix-2)
5707
                res     3,(ix-2)
5708
                res     5,(ix-2)
5709
                res     7,(ix-2)
5710
                ld      a,(ix-2)
5711
                cp      a,data_55
5712
                jr      z,res_12
5713 11 ghutchis
                fail_msg 11
5714 8 ghutchis
res_12:         res     0,(ix+2)
5715
                res     2,(ix+2)
5716
                res     4,(ix+2)
5717
                res     6,(ix+2)
5718
                ld      a,(ix+2)
5719
                cp      a,data_aa
5720
                jr      z,res_13
5721 11 ghutchis
                fail_msg 12
5722 8 ghutchis
res_13:         ld      iy,t_var3
5723
                ld      a,data_ff
5724
                ld      (iy-1),a
5725
                ld      (iy+1),a
5726
                res     1,(iy-1)
5727
                res     3,(iy-1)
5728
                res     5,(iy-1)
5729
                res     7,(iy-1)
5730
                ld      a,(iy-1)
5731
                cp      a,data_55
5732
                jr      z,res_14
5733 11 ghutchis
                fail_msg 13
5734 8 ghutchis
res_14:         res     0,(iy+1)
5735
                res     2,(iy+1)
5736
                res     4,(iy+1)
5737
                res     6,(iy+1)
5738
                ld      a,(iy+1)
5739
                cp      a,data_aa
5740
                jr      z,jp_0
5741 11 ghutchis
                fail_msg 14
5742 17 ghutchis
jp_0:           nop
5743
                print   "jp"
5744
                jp      jp_1
5745 8 ghutchis
                nop
5746
                nop
5747 11 ghutchis
                fail_msg 0
5748 8 ghutchis
jp_1:           ld      a,0
5749
                and     a
5750
                jp      z,jp_2
5751 11 ghutchis
                fail_msg 1
5752 8 ghutchis
jp_2:           jp      nc,jp_3
5753 11 ghutchis
                fail_msg 2
5754 8 ghutchis
jp_3:           ld      b,1
5755
                sub     a,b
5756
                jp      nz,jp_4
5757 11 ghutchis
                fail_msg 3
5758 8 ghutchis
jp_4:           jp      c,jp_5
5759 11 ghutchis
                fail_msg 4
5760 8 ghutchis
jp_5:           jp      jp_7
5761 11 ghutchis
                fail_msg 5
5762 8 ghutchis
jp_6:           jp      jr_0
5763 11 ghutchis
                fail_msg 6
5764 8 ghutchis
jp_7:           jp      jp_6
5765 11 ghutchis
                fail_msg 7
5766 8 ghutchis
jr_0:           jr      jr_2
5767 11 ghutchis
                fail_msg 0
5768 8 ghutchis
jr_1:           jr      jr_3
5769 11 ghutchis
                fail_msg 1
5770 8 ghutchis
jr_2:           jr      jr_1
5771 11 ghutchis
                fail_msg 2
5772 8 ghutchis
jr_3:           ld      hl,jp_9
5773
                jp      (hl)
5774 11 ghutchis
                fail_msg 3
5775 8 ghutchis
jp_8:           ld      ix,jp_10
5776
                jp      (ix)
5777 11 ghutchis
                fail_msg 8
5778 8 ghutchis
jp_9:           jp      jp_8
5779 11 ghutchis
                fail_msg 9
5780 8 ghutchis
jp_10:          ld      iy,djnz_0
5781
                jp      (iy)
5782 11 ghutchis
                fail_msg 10
5783 8 ghutchis
djnz_0:         ld      b,5
5784
                ld      a,0
5785
djnz_1:         inc     a
5786
                djnz    djnz_1
5787
                cp      a,5
5788
                jr      z,call_0
5789 11 ghutchis
                fail_msg 1
5790 17 ghutchis
call_0:         nop
5791
                print   "call"
5792
                ld      a,0
5793 8 ghutchis
                call    sub1
5794
                cp      a,data_7f
5795
                jr      z,call_1
5796 11 ghutchis
                fail_msg 0
5797 8 ghutchis
call_1:         ld      a,0
5798
                and     a
5799
                call    z,sub2
5800
                cp      a,data_55
5801
                jr      z,call_2
5802 11 ghutchis
                fail_msg 1
5803 8 ghutchis
call_2:         ld      a,data_aa
5804
                and     a
5805
                call    nz,sub3
5806
                cp      a,data_aa+1
5807
                jr      z,call_3
5808 11 ghutchis
                fail_msg 2
5809 8 ghutchis
call_3:         ld      a,0
5810
                cp      a,0
5811
                call    nc,sub4
5812
                cp      a,data_ff
5813
                jr      z,call_4
5814 11 ghutchis
                fail_msg 3
5815 8 ghutchis
call_4:         ld      a,0
5816
                sub     a,1
5817
                call    c,sub5
5818
                cp      a,data_ff-1
5819
                jr      z,call_5
5820 11 ghutchis
                fail_msg 4
5821 8 ghutchis
call_5:         ld      a,data_7f
5822
                sla     a
5823
                call    po,sub6
5824
                cp      a,data_7f
5825
                jr      z,call_6
5826 11 ghutchis
                fail_msg 5
5827 8 ghutchis
call_6:         ld      a,data_aa
5828
                srl     a
5829
                call    pe,sub7
5830
                cp      a,data_aa
5831
                jr      z,call_7
5832 11 ghutchis
                fail_msg 6
5833 8 ghutchis
call_7:         ld      a,data_80
5834
                sra     a
5835
                call    m,sub8
5836
                cp      a,data_80
5837
                jr      z,call_8
5838 11 ghutchis
                fail_msg 7
5839 8 ghutchis
call_8:         ld      a,data_7f
5840
                sra     a
5841
                call    p,sub9
5842
                cp      a,data_7f
5843
                jr      z,rst_0
5844 11 ghutchis
                fail_msg 8
5845 17 ghutchis
rst_0:          ld      a, 1
5846
                ld      (rst_state),a
5847
                print   "rst"
5848
                rst     #00
5849 8 ghutchis
                cp      a,1
5850
                jr      z,rst_1
5851 11 ghutchis
                fail_msg 0
5852 8 ghutchis
rst_1:          rst     #08
5853
                cp      a,2
5854
                jr      z,rst_2
5855 11 ghutchis
                fail_msg 1
5856 8 ghutchis
rst_2:          rst     #10
5857
                cp      a,3
5858
                jr      z,rst_3
5859 11 ghutchis
                fail_msg 2
5860 8 ghutchis
rst_3:          rst     #18
5861
                cp      a,4
5862
                jr      z,rst_4
5863 11 ghutchis
                fail_msg 3
5864 8 ghutchis
rst_4:          rst     #20
5865
                cp      a,5
5866
                jr      z,rst_5
5867 11 ghutchis
                fail_msg 4
5868 8 ghutchis
rst_5:          rst     #28
5869
                cp      a,6
5870
                jr      z,rst_6
5871 11 ghutchis
                fail_msg 5
5872 8 ghutchis
rst_6:          rst     #30
5873
                cp      a,7
5874
                jr      z,rst_7
5875 11 ghutchis
                fail_msg 6
5876 8 ghutchis
rst_7:          rst     #38
5877
                cp      a,8
5878 17 ghutchis
                jp      z,ldi_ops
5879 11 ghutchis
                fail_msg 7
5880 17 ghutchis
 
5881
        ;; skip the in instructions, as they need to be reworked
5882
        ;; for TV80 environment. (gth)
5883 8 ghutchis
in_0:           in      a,(in_port)
5884
                cp      a,data_7f
5885
                jr      z,in_1
5886 11 ghutchis
                fail_msg 0
5887 8 ghutchis
in_1:           ld      c,in_port
5888
                in      a,(c)
5889
                jr      nz,in_2
5890 11 ghutchis
                fail_msg 1
5891 8 ghutchis
in_2:           jp      p,in_3
5892 11 ghutchis
                fail_msg 2
5893 8 ghutchis
in_3:           jp      pe,in_4
5894 11 ghutchis
                fail_msg 3
5895 8 ghutchis
in_4:           cp      a,data_55
5896
                jr      z,in_5
5897 11 ghutchis
                fail_msg 4
5898 8 ghutchis
in_5:           in      a,(c)
5899
                jp      m,in_6
5900 11 ghutchis
                fail_msg 5
5901 8 ghutchis
in_6:           jp      po,in_7
5902 11 ghutchis
                fail_msg 6
5903 8 ghutchis
in_7:           jr      nz,in_8
5904 11 ghutchis
                fail_msg 7
5905 8 ghutchis
in_8:           cp      a,data_80
5906
                jr      z,in_9
5907 11 ghutchis
                fail_msg 8
5908 8 ghutchis
in_9:           in      a,(c)
5909
                jr      z,in_10
5910 11 ghutchis
                fail_msg 9
5911 8 ghutchis
in_10:          in      b,(c)
5912
                jp      m,in_11
5913 11 ghutchis
                fail_msg 10
5914 8 ghutchis
in_11:          ld      a,b
5915
                cp      a,data_ff
5916
                jr      z,in_12
5917 11 ghutchis
                fail_msg 11
5918 8 ghutchis
in_12:          in      d,(c)
5919
                jp      pe,in_13
5920 11 ghutchis
                fail_msg 12
5921 8 ghutchis
in_13:          ld      a,d
5922
                cp      a,data_aa
5923
                jr      z,in_14
5924 11 ghutchis
                fail_msg 13
5925 8 ghutchis
in_14:          in      e,(c)
5926
                jp      p,in_15
5927 11 ghutchis
                fail_msg 14
5928 8 ghutchis
in_15:          ld      a,e
5929
                cp      a,data_7f
5930
                jr      z,in_16
5931 11 ghutchis
                fail_msg 15
5932 8 ghutchis
in_16:          in      h,(c)
5933
                jp      pe,in_17
5934 11 ghutchis
                fail_msg 16
5935 8 ghutchis
in_17:          ld      a,h
5936
                cp      a,data_55
5937
                jr      z,in_18
5938 11 ghutchis
                fail_msg 17
5939 8 ghutchis
in_18:          in      l,(c)
5940
                jp      m,in_19
5941 11 ghutchis
                fail_msg 18
5942 8 ghutchis
in_19:          ld      a,l
5943
                cp      a,data_80
5944
                jr      z,in_20
5945 11 ghutchis
                fail_msg 19
5946 8 ghutchis
in_20:          in      c,(c)
5947
                jr      z,in_21
5948 11 ghutchis
                fail_msg 20
5949 8 ghutchis
in_21:          ld      c,in_port
5950
                ld      b,2
5951
                ld      hl,t_var1
5952
                ini
5953
                jr      nz,in_22
5954 11 ghutchis
                fail_msg 21
5955 8 ghutchis
in_22:          ini
5956
                jr      z,in_23
5957 11 ghutchis
                fail_msg 22
5958 8 ghutchis
in_23:          ld      hl,t_var1
5959
                ld      a,(hl)
5960
                cp      a,data_ff
5961
                jr      z,in_24
5962 11 ghutchis
                fail_msg 23
5963 8 ghutchis
in_24:          inc     hl
5964
                ld      a,(hl)
5965
                cp      a,data_aa
5966
                jr      z,in_25
5967 11 ghutchis
                fail_msg 24
5968 8 ghutchis
in_25:          ld      b,5
5969
                ld      c,in_port
5970
                ld      hl,t_var1
5971
                inir
5972
                jr      z,in_26
5973 11 ghutchis
                fail_msg 25
5974 8 ghutchis
in_26:          ld      hl,t_var1
5975
                ld      a,(hl)
5976
                cp      a,data_7f
5977
                jr      z,in_27
5978 11 ghutchis
                fail_msg 26
5979 8 ghutchis
in_27:          inc     hl
5980
                ld      a,(hl)
5981
                cp      a,data_55
5982
                jr      z,in_28
5983 11 ghutchis
                fail_msg 27
5984 8 ghutchis
in_28:          inc     hl
5985
                ld      a,(hl)
5986
                cp      a,data_80
5987
                jr      z,in_29
5988 11 ghutchis
                fail_msg 28
5989 8 ghutchis
in_29:          inc     hl
5990
                ld      a,(hl)
5991
                cp      a,0
5992
                jr      z,in_30
5993 11 ghutchis
                fail_msg 29
5994 8 ghutchis
in_30:          inc     hl
5995
                ld      a,(hl)
5996
                cp      a,data_ff
5997
                jr      z,in_31
5998 11 ghutchis
                fail_msg 30
5999 8 ghutchis
in_31:          ld      b,2
6000
                ld      c,in_port
6001
                ld      hl,t_var5
6002
                ind
6003
                jr      nz,in_32
6004 11 ghutchis
                fail_msg 31
6005 8 ghutchis
in_32:          ind
6006
                jr      z,in_33
6007 11 ghutchis
                fail_msg 32
6008 8 ghutchis
in_33:          ld      hl,t_var5
6009
                ld      a,(hl)
6010
                cp      a,data_aa
6011
                jr      z,in_34
6012 11 ghutchis
                fail_msg 33
6013 8 ghutchis
in_34:          dec     hl
6014
                ld      a,(hl)
6015
                cp      a,data_7f
6016
                jr      z,in_35
6017 11 ghutchis
                fail_msg 34
6018 8 ghutchis
in_35:          ld      b,5
6019
                ld      c,in_port
6020
                ld      hl,t_var5
6021
                indr
6022
                jr      z,in_36
6023 11 ghutchis
                fail_msg 35
6024 8 ghutchis
in_36:          ld      hl,t_var5
6025
                ld      a,(hl)
6026
                cp      a,data_55
6027
                jr      z,in_37
6028 11 ghutchis
                fail_msg 36
6029 8 ghutchis
in_37:          dec     hl
6030
                ld      a,(hl)
6031
                cp      a,data_80
6032
                jr      z,in_38
6033 11 ghutchis
                fail_msg 37
6034 8 ghutchis
in_38:          dec     hl
6035
                ld      a,(hl)
6036
                cp      a,0
6037
                jr      z,in_39
6038 11 ghutchis
                fail_msg 38
6039 8 ghutchis
in_39:          dec     hl
6040
                ld      a,(hl)
6041
                cp      a,data_ff
6042
                jr      z,in_40
6043 11 ghutchis
                fail_msg 39
6044 8 ghutchis
in_40:          dec     hl
6045
                ld      a,(hl)
6046
                cp      a,data_aa
6047
                jr      z,ldi_0
6048 11 ghutchis
                fail_msg 40
6049 17 ghutchis
 
6050
ldi_ops:        nop
6051
                print   "ldi"
6052 8 ghutchis
ldi_0:          ld      hl,t_var1
6053
                ld      a,#12      ;bjp was >data_1234
6054
                ld      (hl),a
6055
                inc     hl
6056
                ld      a,#34      ;bjp was >data_1234
6057
                ld      (hl),a
6058
                dec     hl
6059
                ld      de,t_var3
6060
                ld      bc,2
6061
                ldi
6062
                jp      pe,ldi_1
6063 11 ghutchis
                fail_msg 0
6064 8 ghutchis
ldi_1:          ldi
6065
                jp      po,ldi_2
6066 11 ghutchis
                fail_msg 1
6067 8 ghutchis
ldi_2:          ld      hl,t_var3
6068
                ld      a,(hl)
6069
                cp      a,#12      ;bjp was >data_1234
6070
                jr      z,ldi_3
6071 11 ghutchis
                fail_msg 2
6072 8 ghutchis
ldi_3:          inc     hl
6073
                ld      a,(hl)
6074
                cp      a,#34      ;bjp was >data_1234
6075
                jr      z,ldir_0
6076 11 ghutchis
                fail_msg 3
6077 8 ghutchis
ldir_0:         ld      hl,var1
6078
                ld      de,t_var1
6079
                ld      bc,5
6080
                ldir
6081
                jp      po,ldir_1
6082 11 ghutchis
                fail_msg 0
6083 8 ghutchis
ldir_1:         ld      hl,t_var1
6084
                ld      a,(hl)
6085
                cp      a,data_ff
6086
                jr      z,ldir_2
6087 11 ghutchis
                fail_msg 1
6088 8 ghutchis
ldir_2:         inc     hl
6089
                ld      a,(hl)
6090
                cp      a,data_55
6091
                jr      z,ldir_3
6092 11 ghutchis
                fail_msg 2
6093 8 ghutchis
ldir_3:         inc     hl
6094
                ld      a,(hl)
6095
                cp      a,data_80
6096
                jr      z,ldir_4
6097 11 ghutchis
                fail_msg 3
6098 8 ghutchis
ldir_4:         inc     hl
6099
                ld      a,(hl)
6100
                cp      a,data_aa
6101
                jr      z,ldir_5
6102 11 ghutchis
                fail_msg 4
6103 8 ghutchis
ldir_5:         inc     hl
6104
                ld      a,(hl)
6105
                cp      a,data_7f
6106
                jr      z,ldd_0
6107 11 ghutchis
                fail_msg 5
6108 8 ghutchis
ldd_0:          ld      hl,t_var5
6109
                ld      a,#12      ;bjp was >data_1234
6110
                ld      (hl),a
6111
                dec     hl
6112
                ld      a,#34      ;bjp was >data_1234
6113
                ld      (hl),a
6114
                inc     hl
6115
                ld      bc,2
6116
                ld      de,t_var3
6117
                ldd
6118
                jp      pe,ldd_1
6119 11 ghutchis
                fail_msg 0
6120 8 ghutchis
ldd_1:          ldd
6121
                jp      po,ldd_2
6122 11 ghutchis
                fail_msg 1
6123 8 ghutchis
ldd_2:          ld      hl,t_var3
6124
                ld      a,(hl)
6125
                cp      a,#12      ;bjp was >data_1234
6126
                jr      z,ldd_3
6127 11 ghutchis
                fail_msg 2
6128 8 ghutchis
ldd_3:          dec     hl
6129
                ld      a,(hl)
6130
                cp      a,#34      ;bjp was >data_1234
6131
                jr      z,lddr_0
6132 11 ghutchis
                fail_msg 3
6133 8 ghutchis
lddr_0:         ld      bc,5
6134
                ld      hl,var5
6135
                ld      de,t_var5
6136
                lddr
6137
                jp      po,lddr_1
6138 11 ghutchis
                fail_msg 0
6139 8 ghutchis
lddr_1:         ld      hl,t_var1
6140
                ld      a,(hl)
6141
                cp      a,data_ff
6142
                jr      z,lddr_2
6143 11 ghutchis
                fail_msg 1
6144 8 ghutchis
lddr_2:         inc     hl
6145
                ld      a,(hl)
6146
                cp      a,data_55
6147
                jr      z,lddr_3
6148 11 ghutchis
                fail_msg 2
6149 8 ghutchis
lddr_3:         inc     hl
6150
                ld      a,(hl)
6151
                cp      a,data_80
6152
                jr      z,lddr_4
6153 11 ghutchis
                fail_msg 3
6154 8 ghutchis
lddr_4:         inc     hl
6155
                ld      a,(hl)
6156
                cp      a,data_aa
6157
                jr      z,lddr_5
6158 11 ghutchis
                fail_msg 4
6159 8 ghutchis
lddr_5:         inc     hl
6160
                ld      a,(hl)
6161
                cp      a,data_7f
6162
                jr      z,cpi_0
6163 11 ghutchis
                fail_msg 5
6164 8 ghutchis
cpi_0:          ld      hl,t_var1
6165
                ld      bc,5
6166
                ld      a,data_7f
6167
                cpi
6168
                jp      pe,cpi_1
6169 11 ghutchis
                fail_msg 0
6170 8 ghutchis
cpi_1:          jp      m,cpi_2
6171 11 ghutchis
                fail_msg 1
6172 8 ghutchis
cpi_2:          jr      nz,cpi_3
6173 11 ghutchis
                fail_msg 2
6174 8 ghutchis
cpi_3:          cpi
6175
                jp      pe,cpi_4
6176 11 ghutchis
                fail_msg 3
6177 8 ghutchis
cpi_4:          jp      p,cpi_5
6178 11 ghutchis
                fail_msg 4
6179 8 ghutchis
cpi_5:          jr      nz,cpi_6
6180 11 ghutchis
                fail_msg 5
6181 8 ghutchis
cpi_6:          cpi
6182
                jp      pe,cpi_7
6183 11 ghutchis
                fail_msg 6
6184 8 ghutchis
cpi_7:          jp      m,cpi_8
6185 11 ghutchis
                fail_msg 7
6186 8 ghutchis
cpi_8:          jr      nz,cpi_9
6187 11 ghutchis
                fail_msg 8
6188 8 ghutchis
cpi_9:          cpi
6189
                jp      pe,cpi_10
6190 11 ghutchis
                fail_msg 9
6191 8 ghutchis
cpi_10:         jp      m,cpi_11
6192 11 ghutchis
                fail_msg 10
6193 8 ghutchis
cpi_11:         jr      nz,cpi_12
6194 11 ghutchis
                fail_msg 11
6195 8 ghutchis
cpi_12:         cpi
6196
                jp      po,cpi_13
6197 11 ghutchis
                fail_msg 12
6198 8 ghutchis
cpi_13:         jp      p,cpi_14
6199 11 ghutchis
                fail_msg 13
6200 8 ghutchis
cpi_14:         jr      z,cpir_0
6201 11 ghutchis
                fail_msg 14
6202 8 ghutchis
cpir_0:         ld      a,data_aa
6203
                ld      hl,var1
6204
                ld      bc,5
6205
                cpir
6206
                jr      z,cpir_1
6207 11 ghutchis
                fail_msg 0
6208 8 ghutchis
cpir_1:         jp      pe,cpir_2
6209 11 ghutchis
                fail_msg 1
6210 8 ghutchis
cpir_2:         ld      a,b
6211
                cp      a,0
6212
                jr      z,cpir_3
6213 11 ghutchis
                fail_msg 2
6214 8 ghutchis
cpir_3:         ld      a,c
6215
                cp      a,1
6216
                jr      z,cpir_4
6217 11 ghutchis
                fail_msg 3
6218 8 ghutchis
cpir_4:         ld      a,data_7f
6219
                ld      hl,var1
6220
                ld      bc,5
6221
                cpir
6222
                jp      po,cpir_5
6223 11 ghutchis
                fail_msg 4
6224 8 ghutchis
cpir_5:         jr      z,cpir_6
6225 11 ghutchis
                fail_msg 5
6226 8 ghutchis
cpir_6:         ld      a,#34      ;bjp was >data_1234
6227
                ld      hl,var1
6228
                ld      bc,5
6229
                cpir
6230
                jp      po,cpir_7
6231 11 ghutchis
                fail_msg 6
6232 8 ghutchis
cpir_7:         jr      nz,cpir_8
6233 11 ghutchis
                fail_msg 7
6234 8 ghutchis
cpir_8:         jp      m,cpir_9
6235 11 ghutchis
                fail_msg 8
6236 8 ghutchis
cpir_9:         ld      a,data_aa
6237
                ld      hl,var1
6238
                ld      bc,3
6239
                cpir
6240
                jp      po,cpir_10
6241 11 ghutchis
                fail_msg 9
6242 8 ghutchis
cpir_10:        jp      p,cpir_11
6243 11 ghutchis
                fail_msg 10
6244 8 ghutchis
cpir_11:        jr      nz,cpd_0
6245 11 ghutchis
                fail_msg 11
6246 8 ghutchis
cpd_0:          ld      a,data_ff
6247
                ld      hl,var5
6248
                ld      bc,5
6249
                cpd
6250
                jp      m,cpd_1
6251 11 ghutchis
                fail_msg 0
6252 8 ghutchis
cpd_1:          jp      pe,cpd_2
6253 11 ghutchis
                fail_msg 1
6254 8 ghutchis
cpd_2:          jr      nz,cpd_3
6255 11 ghutchis
                fail_msg 2
6256 8 ghutchis
cpd_3:          cpd
6257
                jp      p,cpd_4
6258 11 ghutchis
                fail_msg 3
6259 8 ghutchis
cpd_4:          jp      pe,cpd_5
6260 11 ghutchis
                fail_msg 4
6261 8 ghutchis
cpd_5:          jr      nz,cpd_6
6262 11 ghutchis
                fail_msg 5
6263 8 ghutchis
cpd_6:          cpd
6264
                jp      p,cpd_7
6265 11 ghutchis
                fail_msg 6
6266 8 ghutchis
cpd_7:          jp      pe,cpd_8
6267 11 ghutchis
                fail_msg 7
6268 8 ghutchis
cpd_8:          jr      nz,cpd_9
6269 11 ghutchis
                fail_msg 8
6270 8 ghutchis
cpd_9:          cpd
6271
                jp      m,cpd_10
6272 11 ghutchis
                fail_msg 9
6273 8 ghutchis
cpd_10:         jp      pe,cpd_11
6274 11 ghutchis
                fail_msg 10
6275 8 ghutchis
cpd_11:         jr      nz,cpd_12
6276 11 ghutchis
                fail_msg 11
6277 8 ghutchis
cpd_12:         cpd
6278
                jp      p,cpd_13
6279 11 ghutchis
                fail_msg 12
6280 8 ghutchis
cpd_13:         jp      po,cpd_14
6281 11 ghutchis
                fail_msg 13
6282 8 ghutchis
cpd_14:         jr      z,cpdr_0
6283 11 ghutchis
                fail_msg 14
6284 8 ghutchis
cpdr_0:         ld      a,data_80
6285
                ld      hl,var5
6286
                ld      bc,5
6287
                cpdr
6288
                jp      pe,cpdr_1
6289 11 ghutchis
                fail_msg 0
6290 8 ghutchis
cpdr_1:         jp      p,cpdr_2
6291 11 ghutchis
                fail_msg 1
6292 8 ghutchis
cpdr_2:         jr      z,cpdr_3
6293 11 ghutchis
                fail_msg 2
6294 8 ghutchis
cpdr_3:         ld      a,b
6295
                cp      a,0
6296
                jr      z,cpdr_4
6297 11 ghutchis
                fail_msg 3
6298 8 ghutchis
cpdr_4:         ld      a,c
6299
                cp      a,2
6300
                jr      z,cpdr_5
6301 11 ghutchis
                fail_msg 4
6302 8 ghutchis
cpdr_5:         ld      a,#34      ;bjp was >data_1234
6303
                ld      hl,var5
6304
                ld      bc,5
6305
                cpdr
6306
                jp      po,cpdr_6
6307 11 ghutchis
                fail_msg 5
6308 8 ghutchis
cpdr_6:         jr      nz,cpdr_7
6309 11 ghutchis
                fail_msg 6
6310 8 ghutchis
cpdr_7:         jp      p,cpdr_8
6311 11 ghutchis
                fail_msg 7
6312 8 ghutchis
cpdr_8:         ld      a,#34      ;bjp was >data_1234
6313
                ld      hl,var5
6314
                ld      bc,3
6315
                cpdr
6316
                jp      po,cpdr_9
6317 11 ghutchis
                fail_msg 8
6318 8 ghutchis
cpdr_9:         jr      nz,cpdr_10
6319 11 ghutchis
                fail_msg 9
6320 17 ghutchis
cpdr_10:        jp      m,test_exit
6321 11 ghutchis
                fail_msg 10
6322 17 ghutchis
 
6323
        ;; this section needs to be reworked for the TV80 environment.
6324
        ;; Since env uses ports for all its test control, this gets
6325
        ;; partially covered by normal operation. (gth)
6326 8 ghutchis
;
6327
;the file portfe.xxx must be examined to see if the proper output is generated
6328
;
6329
out_0:          ld      a,#30
6330
                out     (out_port),a
6331
                ld      c,out_port
6332
                ld      a,#31
6333
                out     (c),a
6334
                ld      b,#32
6335
                out     (c),b
6336
                ld      d,#33
6337
                out     (c),d
6338
                ld      e,#34
6339
                out     (c),e
6340
                ld      h,#35
6341
                out     (c),h
6342
                ld      l,#36
6343
                out     (c),l
6344
                out     (c),c                   ;output value divider
6345
outi_0:         ld      a,#31                   ;set up output values
6346
                ld      b,5
6347
                ld      hl,t_var1
6348
outi_1:         ld      (hl),a
6349
                inc     a
6350
                inc     hl
6351
                djnz    outi_1
6352
outi_2:         ld      c,out_port
6353
                ld      b,5
6354
                ld      hl,t_var1
6355
outi_3:         outi
6356
                jr      nz,outi_3
6357
otir_0:         out     (c),c                   ;output value divider
6358
                ld      hl,t_var1
6359
                ld      b,5
6360
                otir
6361
                jr      z,outd_0
6362 11 ghutchis
                fail_msg 0
6363 8 ghutchis
outd_0:         out     (c),c
6364
                ld      hl,t_var5
6365
                ld      b,5
6366
outd_1:         outd
6367
                jr      nz,outd_1
6368
otdr_0:         out     (c),c
6369
                ld      b,5
6370
                ld      hl,t_var5
6371
                otdr
6372
                jr      z,otdr_1
6373 11 ghutchis
                fail_msg 0
6374 8 ghutchis
otdr_1:         out     (c),c
6375
                ld      a,#0d
6376
                out     (c),a
6377
                ld      a,#0a
6378
                out     (c),a
6379
 
6380 17 ghutchis
test_exit:
6381
        ;; complicated pass/fail computation no longer necessary
6382
        ;; if we got here, we passed
6383
        passed
6384
 
6385 8 ghutchis
;
6386
;subroutine 1, must load a with #7f
6387
;
6388
sub1:           ld      a,data_7f
6389
                ret
6390
;
6391
;
6392
;subroutine 2, must load a with #55
6393
;
6394
sub2:           ld      a,data_55
6395
                cp      a,data_55
6396
                ret     z
6397
;
6398
;subroutine 3, increments a
6399
;
6400
sub3:           inc     a
6401
                and     a
6402
                ret     nz
6403
;
6404
;subroutine 4, subtracts 1 from a
6405
;
6406
sub4:           sub     a,1
6407
                ret     c
6408
;
6409
;subroutine 5, subtracts 1 from a
6410
;
6411
sub5:           sub     a,1
6412
                ret     nc
6413
;
6414
;subroutine 6, shifts a right logically
6415
;
6416
sub6:           srl     a
6417
                ret     po
6418
;
6419
;subroutine 7, shifts a left arithmetically
6420
;
6421
sub7:           sla     a
6422
                ret     pe
6423
;
6424
;subroutine 8, shifts a left arithmetically
6425
;
6426
sub8:           sla     a
6427
                ret     m
6428
;
6429
;subroutine 9, rotates a left
6430
;
6431
sub9:           rl      a
6432
                ret     p
6433
;
6434
;restart 0 routine
6435
;
6436
rst_0000_1:
6437 17 ghutchis
                ld      a, (rst_state)
6438
                cp      1
6439
                jp      z,rst_test_ret
6440
 
6441 8 ghutchis
                ld      a, 3
6442
                out     (ctl_port), a   ; enable dumping
6443
                ld      a, 0
6444
                out     (#82), a        ; disable timeout count
6445
 
6446
                ld      a,(pass_count)
6447
                or      a
6448
                jp      nz,start
6449
                ld      a,1
6450
                ret
6451 17 ghutchis
 
6452
rst_test_ret:   ret
6453 8 ghutchis
;
6454
;               data
6455
;
6456
var1:           db      data_ff
6457
var2:           db      data_55
6458
var3:           db      data_80
6459
var4:           db      data_aa
6460
var5:           db      data_7f
6461
;
6462
 
6463
                org     #8000
6464
t_var1:         db      0
6465
t_var2:         db      0
6466
t_var3:         db      0
6467
t_var4:         db      0
6468
t_var5:         db      0
6469
;
6470
w_var1:         dw      data_1234
6471
w_var2:         dw      data_55aa
6472
w_var3:         dw      data_7fff
6473
w_var4:         dw      data_8000
6474
w_var5:         dw      data_aa55
6475
w_var6:         dw      data_ffff
6476
;
6477
tw_var1:        dw      0
6478
tw_var2:        dw      0
6479
tw_var3:        dw      0
6480
tw_var4:        dw      0
6481
tw_var5:        dw      0
6482
tw_var6:        dw      0
6483
tw_var7:        dw      0
6484
;
6485
error_cnt:      db      0
6486
pass_count:     db      1
6487
fail_num        db      0
6488 17 ghutchis
rst_state       db      0
6489 8 ghutchis
;
6490
                org     #8100
6491
stack:          ds      128
6492
stack_end:      equ     $
6493
;
6494
                end start

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.