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

Subversion Repositories 8051

[/] [8051/] [trunk/] [asm/] [testall.c] - Blame information for rev 186

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 simont
// Program tests all instructions except:
2
// ACALL, LCALL, MOVX(1-4), NOP, RET,and RETI
3
 
4
 
5
void main() {
6
 
7
        #pragma asm
8
 
9
////////////////   INST 2 ///////////////////////
10
 
11
        // Clear RAM
12
                MOV  R0,#128
13
        RAM_CLR_2:
14
                DEC  R0
15
                MOV  @R0,#0
16
                MOV  A,R0
17
                JNZ  RAM_CLR_2
18
                MOV  PSW,#0
19
 
20
// ADD A,Rn (2)
21
                MOV  A,#10
22
                MOV  R0,#10
23
                ADD  A,R0
24
                SUBB A,#20
25
                JZ   DONE_2
26
                MOV  P1,#2
27
                LJMP FAILED
28
        DONE_2:
29
 
30
 
31
////////////////   INST 3 ///////////////////////
32
 
33
        // Clear RAM
34
                MOV  R0,#128
35
        RAM_CLR_3:
36
                DEC  R0
37
                MOV  @R0,#0
38
                MOV  A,R0
39
                JNZ  RAM_CLR_3
40
                MOV  PSW,#0
41
 
42
// ADD A,direct (3)
43
                MOV  A,#10
44
                MOV  100,#10
45
                ADD  A,100
46
                SUBB A,#20
47
                JZ   DONE_3
48
                MOV  P1,#3
49
                LJMP FAILED
50
        DONE_3:
51
 
52
 
53
////////////////   INST 4 ///////////////////////
54
 
55
        // Clear RAM
56
                MOV  R0,#128
57
        RAM_CLR_4:
58
                DEC  R0
59
                MOV  @R0,#0
60
                MOV  A,R0
61
                JNZ  RAM_CLR_4
62
                MOV  PSW,#0
63
 
64
// ADD A,@Ri (4)
65
                MOV  A,#10
66
                MOV  R0,#100
67
                MOV  100,#10
68
                ADD  A,@R0
69
                SUBB A,#20
70
                JZ   DONE_4
71
                MOV  P1,#4
72
                LJMP FAILED
73
        DONE_4:
74
 
75
 
76
////////////////   INST 5 ///////////////////////
77
 
78
        // Clear RAM
79
                MOV  R0,#128
80
        RAM_CLR_5:
81
                DEC  R0
82
                MOV  @R0,#0
83
                MOV  A,R0
84
                JNZ  RAM_CLR_5
85
                MOV  PSW,#0
86
 
87
// ADD A,#data (5)
88
                MOV  A,#10
89
                ADD  A,#5
90
                SUBB A,#15
91
                JZ   DONE_5
92
                MOV  P1,#5
93
                LJMP FAILED
94
        DONE_5:
95
 
96
////////////////   INST 6 ///////////////////////
97
 
98
        // Clear RAM
99
                MOV  R0,#128
100
        RAM_CLR_6:
101
                DEC  R0
102
                MOV  @R0,#0
103
                MOV  A,R0
104
                JNZ  RAM_CLR_6
105
                MOV  PSW,#0
106
 
107
// ADDC A,Rn (6)
108
                MOV  A,#10
109
                MOV  R0,#10
110
                CPL  C
111
                ADDC A,R0
112
                SUBB A,#21
113
                JZ   DONE_6
114
                MOV  P1,#6
115
                LJMP FAILED
116
        DONE_6:
117
 
118
 
119
////////////////   INST 7 ///////////////////////
120
 
121
        // Clear RAM
122
                MOV  R0,#128
123
        RAM_CLR_7:
124
                DEC  R0
125
                MOV  @R0,#0
126
                MOV  A,R0
127
                JNZ  RAM_CLR_7
128
                MOV  PSW,#0
129
 
130
// ADDC A,direct (7)
131
                MOV  A,#10
132
                MOV  100,#10
133
                CPL  C
134
                ADDC A,100
135
                SUBB A,#21
136
                JZ   DONE_7
137
                MOV  P1,#7
138
                LJMP FAILED
139
        DONE_7:
140
 
141
 
142
////////////////   INST 8 ///////////////////////
143
 
144
        // Clear RAM
145
                MOV  R0,#128
146
        RAM_CLR_8:
147
                DEC  R0
148
                MOV  @R0,#0
149
                MOV  A,R0
150
                JNZ  RAM_CLR_8
151
                MOV  PSW,#0
152
 
153
// ADDC A,@Ri (8)
154
                MOV  A,#10
155
                MOV  R0,#100
156
                MOV  100,#10
157
                CPL  C
158
                ADDC A,@R0
159
                SUBB A,#21
160
                JZ   DONE_8
161
                MOV  P1,#8
162
                LJMP FAILED
163
        DONE_8:
164
 
165
 
166
////////////////   INST 9 ///////////////////////
167
 
168
        // Clear RAM
169
                MOV  R0,#128
170
        RAM_CLR_9:
171
                DEC  R0
172
                MOV  @R0,#0
173
                MOV  A,R0
174
                JNZ  RAM_CLR_9
175
                MOV  PSW,#0
176
 
177
// ADDC A,#data (9)
178
                MOV  A,#10
179
                CPL  C
180
                ADDC A,#5
181
                SUBB A,#16
182
                JZ   DONE_9
183
                MOV  P1,#9
184
                LJMP FAILED
185
        DONE_9:
186
 
187
////////////////  INST 10 ///////////////////////
188
 
189
        // Clear RAM
190
                MOV  R0,#128
191
        RAM_CLR_10:
192
                DEC  R0
193
                MOV  @R0,#0
194
                MOV  A,R0
195
                JNZ  RAM_CLR_10
196
                MOV  PSW,#0
197
 
198
// AJMP (10)
199
                AJMP DONE_10
200
                MOV  P1,#10
201
                LJMP FAILED
202
        DONE_10:
203
 
204
////////////////  INST 11 ///////////////////////
205
 
206
        // Clear RAM
207
                MOV  R0,#128
208
        RAM_CLR_11:
209
                DEC  R0
210
                MOV  @R0,#0
211
                MOV  A,R0
212
                JNZ  RAM_CLR_11
213
                MOV  PSW,#0
214
 
215
// ANL A,Rn (11)
216
                MOV  R0,#255
217
                MOV  A,#170
218
                ANL  A,R0
219
                SUBB A,#170
220
                JZ   DONE_11
221
                MOV  P1,#11
222
                LJMP FAILED
223
        DONE_11:
224
 
225
////////////////  INST 12 ///////////////////////
226
 
227
        // Clear RAM
228
                MOV  R0,#128
229
        RAM_CLR_12:
230
                DEC  R0
231
                MOV  @R0,#0
232
                MOV  A,R0
233
                JNZ  RAM_CLR_12
234
                MOV  PSW,#0
235
 
236
// ANL A,direct (12)
237
                MOV  127,#0
238
                MOV  A,#255
239
                ANL  A,127
240
                JZ   DONE_12
241
                MOV  P1,#12
242
                LJMP FAILED
243
        DONE_12:
244
 
245
////////////////  INST 13 ///////////////////////
246
 
247
        // Clear RAM
248
                MOV  R0,#128
249
        RAM_CLR_13:
250
                DEC  R0
251
                MOV  @R0,#0
252
                MOV  A,R0
253
                JNZ  RAM_CLR_13
254
                MOV  PSW,#0
255
 
256
// ANL A,@Ri (13)
257
                MOV  R0,#127
258
                MOV  127,#1
259
                MOV  A,#254
260
                ANL  A,@R0
261
                JZ   DONE_13
262
                MOV  P1,#13
263
                LJMP FAILED
264
        DONE_13:
265
 
266
////////////////  INST 14 ///////////////////////
267
 
268
        // Clear RAM
269
                MOV  R0,#128
270
        RAM_CLR_14:
271
                DEC  R0
272
                MOV  @R0,#0
273
                MOV  A,R0
274
                JNZ  RAM_CLR_14
275
                MOV  PSW,#0
276
 
277
// ANL A,#data (14)
278
                MOV  A,#255
279
                ANL  A,#255
280
                SUBB A,#255
281
                JZ   DONE_14
282
                MOV  P1,#14
283
                LJMP FAILED
284
        DONE_14:
285
 
286
////////////////  INST 15 ///////////////////////
287
 
288
        // Clear RAM
289
                MOV  R0,#128
290
        RAM_CLR_15:
291
                DEC  R0
292
                MOV  @R0,#0
293
                MOV  A,R0
294
                JNZ  RAM_CLR_15
295
                MOV  PSW,#0
296
 
297
// ANL direct,A (15)
298
                MOV  50,#255
299
                MOV  A,#0
300
                ANL  50,A
301
                MOV  A,50
302
                JZ   DONE_15
303
                MOV  P1,#15
304
                LJMP FAILED
305
        DONE_15:
306
 
307
////////////////  INST 16 ///////////////////////
308
 
309
        // Clear RAM
310
                MOV  R0,#128
311
        RAM_CLR_16:
312
                DEC  R0
313
                MOV  @R0,#0
314
                MOV  A,R0
315
                JNZ  RAM_CLR_16
316
                MOV  PSW,#0
317
 
318
// ANL direct,#data (16)
319
                MOV  25,#128
320
                ANL  25,#255
321
                MOV  A,25
322
                SUBB A,#128
323
                JZ   DONE_16
324
                MOV  P1,#16
325
                LJMP FAILED
326
        DONE_16:
327
 
328
////////////////  INST 17 ///////////////////////
329
 
330
        // Clear RAM
331
                MOV  R0,#128
332
        RAM_CLR_17:
333
                DEC  R0
334
                MOV  @R0,#0
335
                MOV  A,R0
336
                JNZ  RAM_CLR_17
337
                MOV  PSW,#0
338
 
339
// ANL C,bit (17)
340
                MOV  A,#128
341
                CPL  C
342
                ANL  C,ACC.7
343
                SUBB A,#127
344
                JZ   DONE_17
345
                MOV  P1,#17
346
                LJMP FAILED
347
        DONE_17:
348
 
349
////////////////  INST 18 ///////////////////////
350
 
351
        // Clear RAM
352
                MOV  R0,#128
353
        RAM_CLR_18:
354
                DEC  R0
355
                MOV  @R0,#0
356
                MOV  A,R0
357
                JNZ  RAM_CLR_18
358
                MOV  PSW,#0
359
 
360
// ANL C,/bit (18)
361
                MOV  A,#128
362
                CPL  C
363
                ANL  C,/ACC.7
364
                SUBB A,#128
365
                JZ   DONE_18
366
                MOV  P1,#18
367
                LJMP FAILED
368
        DONE_18:
369
 
370
////////////////  INST 19 ///////////////////////
371
 
372
        // Clear RAM
373
                MOV  R0,#128
374
        RAM_CLR_19:
375
                DEC  R0
376
                MOV  @R0,#0
377
                MOV  A,R0
378
                JNZ  RAM_CLR_19
379
                MOV  PSW,#0
380
 
381
// CJNE A,direct,rel (19)
382
                MOV  A,#128
383
                MOV  100,#128
384
                CJNE A,100,ERROR_19
385
                MOV  A,#127
386
                CJNE A,100,CHECK_C_19
387
        ERROR_19:
388
                MOV  P1,#19
389
                LJMP FAILED
390
        CHECK_C_19:             ;Checks that carry was set
391
                JC   DONE_19
392
                MOV  P1,#19
393
                LJMP FAILED
394
        DONE_19:
395
 
396
 
397
////////////////  INST 20 ///////////////////////
398
 
399
        // Clear RAM
400
                MOV  R0,#128
401
        RAM_CLR_20:
402
                DEC  R0
403
                MOV  @R0,#0
404
                MOV  A,R0
405
                JNZ  RAM_CLR_20
406
                MOV  PSW,#0
407
 
408
// CJNE A,#data,rel (20)
409
                MOV  A,#128
410
                CJNE A,#128,ERROR_20
411
                MOV  A,#127
412
                CJNE A,#128,CHECK_C_20
413
        ERROR_20:
414
                MOV  P1,#20
415
                LJMP FAILED
416
        CHECK_C_20:             ;Checks that carry was set
417
                JC   DONE_20
418
                MOV  P1,#20
419
                LJMP FAILED
420
        DONE_20:
421
 
422
 
423
////////////////  INST 21 ///////////////////////
424
 
425
        // Clear RAM
426
                MOV  R0,#128
427
        RAM_CLR_21:
428
                DEC  R0
429
                MOV  @R0,#0
430
                MOV  A,R0
431
                JNZ  RAM_CLR_21
432
                MOV  PSW,#0
433
 
434
// CJNE Rn,#data,rel (21)
435
                MOV  R1,#128
436
                CJNE R1,#128,ERROR_21
437
                MOV  R1,#127
438
                CJNE R1,#128,CHECK_C_21
439
        ERROR_21:
440
                MOV  P1,#21
441
                LJMP FAILED
442
        CHECK_C_21:             ;Checks that carry was set
443
                JC   DONE_21
444
                MOV  P1,#21
445
                LJMP FAILED
446
        DONE_21:
447
 
448
////////////////  INST 22 ///////////////////////
449
 
450
        // Clear RAM
451
                MOV  R0,#128
452
        RAM_CLR_22:
453
                DEC  R0
454
                MOV  @R0,#0
455
                MOV  A,R0
456
                JNZ  RAM_CLR_22
457
                MOV  PSW,#0
458
 
459
// CJNE @Ri,#data,rel (22)
460
                MOV  R1,#100
461
                MOV  100,#128
462
                CJNE @R1,#128,ERROR_22
463
                MOV  100,#127
464
                CJNE @R1,#128,CHECK_C_22
465
        ERROR_22:
466
                MOV  P1,#22
467
                LJMP FAILED
468
        CHECK_C_22:             ;Checks that carry was set
469
                JC   DONE_22
470
                MOV  P1,#22
471
                LJMP FAILED
472
        DONE_22:
473
 
474
 
475
////////////////  INST 23 ///////////////////////
476
 
477
        // Clear RAM
478
                MOV  R0,#128
479
        RAM_CLR_23:
480
                DEC  R0
481
                MOV  @R0,#0
482
                MOV  A,R0
483
                JNZ  RAM_CLR_23
484
                MOV  PSW,#0
485
 
486
// CLR A (23)
487
                MOV  A,#128
488
                CLR  A
489
                JZ   DONE_23
490
                MOV  P1,#23
491
                LJMP FAILED
492
        DONE_23:
493
 
494
 
495
////////////////  INST 24 ///////////////////////
496
 
497
        // Clear RAM
498
                MOV  R0,#128
499
        RAM_CLR_24:
500
                DEC  R0
501
                MOV  @R0,#0
502
                MOV  A,R0
503
                JNZ  RAM_CLR_24
504
                MOV  PSW,#0
505
 
506
// CLR C (24)
507
                CPL  C
508
                CLR  C
509
                JNC   DONE_24
510
                MOV  P1,#24
511
                LJMP FAILED
512
        DONE_24:
513
 
514
////////////////  INST 25 ///////////////////////
515
 
516
        // Clear RAM
517
                MOV  R0,#128
518
        RAM_CLR_25:
519
                DEC  R0
520
                MOV  @R0,#0
521
                MOV  A,R0
522
                JNZ  RAM_CLR_25
523
                MOV  PSW,#0
524
 
525
// CLR bit (25)
526
                MOV  A,#64
527
                CLR  ACC.6
528
                JZ   DONE_25
529
                MOV  P1,#25
530
                LJMP FAILED
531
        DONE_25:
532
 
533
////////////////  INST 26 ///////////////////////
534
 
535
        // Clear RAM
536
                MOV  R0,#128
537
        RAM_CLR_26:
538
                DEC  R0
539
                MOV  @R0,#0
540
                MOV  A,R0
541
                JNZ  RAM_CLR_26
542
                MOV  PSW,#0
543
 
544
// CPL A (26)
545
                MOV  A,#255
546
                CPL  A
547
                JZ   DONE_26
548
                MOV  P1,#26
549
                LJMP FAILED
550
        DONE_26:
551
 
552
 
553
////////////////  INST 27 ///////////////////////
554
 
555
        // Clear RAM
556
                MOV  R0,#128
557
        RAM_CLR_27:
558
                DEC  R0
559
                MOV  @R0,#0
560
                MOV  A,R0
561
                JNZ  RAM_CLR_27
562
                MOV  PSW,#0
563
 
564
// CPL C (27)
565
                CPL  C
566
                JC   DONE_27
567
                MOV  P1,#27
568
                LJMP FAILED
569
        DONE_27:
570
 
571
 
572
////////////////  INST 28 ///////////////////////
573
 
574
        // Clear RAM
575
                MOV  R0,#128
576
        RAM_CLR_28:
577
                DEC  R0
578
                MOV  @R0,#0
579
                MOV  A,R0
580
                JNZ  RAM_CLR_28
581
                MOV  PSW,#0
582
 
583
// CPL bit (28)
584
                MOV  A,#32
585
                CPL  ACC.5
586
                JZ   DONE_28
587
                MOV  P1,#28
588
                LJMP FAILED
589
        DONE_28:
590
 
591
 
592
////////////////  INST 29 ///////////////////////
593
 
594
        // Clear RAM
595
                MOV  R0,#128
596
        RAM_CLR_29:
597
                DEC  R0
598
                MOV  @R0,#0
599
                MOV  A,R0
600
                JNZ  RAM_CLR_29
601
                MOV  PSW,#0
602
 
603
// DA A (29)
604
                MOV  A,#80H
605
                ADD  A,#99H
606
                DA   A
607
                SUBB A,#78H     ;Will clr ACC if C set
608
                JZ   DONE_29
609
                MOV  P1,#29
610
                LJMP FAILED
611
        DONE_29:
612
 
613
 
614
/////////////////  INST 30 //////////////////////
615
 
616
        // Clear RAM
617
                MOV  R0,#128
618
        RAM_CLR_30:
619
                DEC  R0
620
                MOV  @R0,#0
621
                MOV  A,R0
622
                JNZ  RAM_CLR_30
623
                MOV  PSW,#0
624
 
625
// DEC A (30)
626
                MOV  A,#10
627
                DEC  A
628
                SUBB A,#9
629
                JZ   DONE_30
630
                MOV  P1,#30
631
                LJMP FAILED
632
        DONE_30:
633
 
634
/////////////////  INST 31 //////////////////////
635
 
636
        // Clear RAM
637
                MOV  R0,#128
638
        RAM_CLR_31:
639
                DEC  R0
640
                MOV  @R0,#0
641
                MOV  A,R0
642
                JNZ  RAM_CLR_31
643
                MOV  PSW,#0
644
 
645
// DEC Rn (31)
646
                MOV  R0,#10
647
                DEC  R0
648
                MOV  A,R0
649
                SUBB A,#9
650
                JZ   DONE_31
651
                MOV  P1,#31
652
                LJMP FAILED
653
        DONE_31:
654
 
655
/////////////////  INST 32 //////////////////////
656
 
657
        // Clear RAM
658
                MOV  R0,#128
659
        RAM_CLR_32:
660
                DEC  R0
661
                MOV  @R0,#0
662
                MOV  A,R0
663
                JNZ  RAM_CLR_32
664
                MOV  PSW,#0
665
 
666
// DEC direct (32)
667
                MOV  127,#10
668
                DEC  127
669
                MOV  A,127
670
                SUBB A,#9
671
                JZ   DONE_32
672
                MOV  P1,#32
673
                LJMP FAILED
674
        DONE_32:
675
 
676
/////////////////  INST 33 //////////////////////
677
 
678
        // Clear RAM
679
                MOV  R0,#128
680
        RAM_CLR_33:
681
                DEC  R0
682
                MOV  @R0,#0
683
                MOV  A,R0
684
                JNZ  RAM_CLR_33
685
                MOV  PSW,#0
686
 
687
// DEC @Ri (33)
688
                MOV  R0,#127
689
                MOV  127,#10
690
                DEC  @R0
691
                MOV  A,@R0
692
                SUBB A,#9
693
                JZ   DONE_33
694
                MOV  P1,#33
695
                LJMP FAILED
696
        DONE_33:
697
 
698
 
699
/////////////////  INST 34 //////////////////////
700
 
701
        // Clear RAM
702
                MOV  R0,#128
703
        RAM_CLR_34:
704
                DEC  R0
705
                MOV  @R0,#0
706
                MOV  A,R0
707
                JNZ  RAM_CLR_34
708
                MOV  PSW,#0
709
 
710
// DIV AB (34)
711
                MOV  A,#251
712
                MOV  B,#18
713
                DIV  AB
714
                SUBB A,#13
715
                JZ   CHECK_B_34
716
                MOV  P1,#34
717
        CHECK_B_34:
718
                MOV  A,B
719
                SUBB A,#17
720
                JZ   DONE_34
721
                MOV  P1,#34
722
                LJMP FAILED
723
        DONE_34:
724
 
725
 
726
/////////////////  INST 35 //////////////////////
727
 
728
        // Clear RAM
729
                MOV  R0,#128
730
        RAM_CLR_35:
731
                DEC  R0
732
                MOV  @R0,#0
733
                MOV  A,R0
734
                JNZ  RAM_CLR_35
735
                MOV  PSW,#0
736
 
737
// DJNZ Rn,rel (35)
738
                MOV  R0,#10
739
                DJNZ R0,JUMP_35         ;Should jump
740
                MOV  P1,#35
741
                LJMP FAILED
742
        JUMP_35:
743
                MOV  R0,#1
744
                DJNZ R0,NOT_JUMP_35     ;Should not jump
745
                AJMP DONE_35
746
        NOT_JUMP_35:
747
                MOV  P1,#35
748
                LJMP FAILED
749
        DONE_35:
750
 
751
/////////////////  INST 36 //////////////////////
752
 
753
        // Clear RAM
754
                MOV  R0,#128
755
        RAM_CLR_36:
756
                DEC  R0
757
                MOV  @R0,#0
758
                MOV  A,R0
759
                JNZ  RAM_CLR_36
760
                MOV  PSW,#0
761
 
762
// DJNZ direct,rel (36)
763
                MOV  127,#10
764
                DJNZ 127,JUMP_36        ;Should jump
765
                MOV  P1,#36
766
                LJMP FAILED
767
        JUMP_36:
768
                MOV  127,#1
769
                DJNZ 127,NOT_JUMP_36    ;Should not jump
770
                AJMP DONE_36
771
        NOT_JUMP_36:
772
                MOV  P1,#36
773
                LJMP FAILED
774
        DONE_36:
775
 
776
/////////////////  INST 37 //////////////////////
777
 
778
        // Clear RAM
779
                MOV  R0,#128
780
        RAM_CLR_37:
781
                DEC  R0
782
                MOV  @R0,#0
783
                MOV  A,R0
784
                JNZ  RAM_CLR_37
785
                MOV  PSW,#0
786
 
787
// INC A (37)
788
                MOV  A,#10
789
                INC  A
790
                SUBB A,#11
791
                JZ   DONE_37
792
                MOV  P1,#37
793
                LJMP FAILED
794
        DONE_37:
795
 
796
/////////////////  INST 38 //////////////////////
797
 
798
        // Clear RAM
799
                MOV  R0,#128
800
        RAM_CLR_38:
801
                DEC  R0
802
                MOV  @R0,#0
803
                MOV  A,R0
804
                JNZ  RAM_CLR_38
805
                MOV  PSW,#0
806
 
807
// INC Rn (38)
808
                MOV  R0,#10
809
                INC  R0
810
                MOV  A,R0
811
                SUBB A,#11
812
                JZ   DONE_38
813
                MOV  P1,#38
814
                LJMP FAILED
815
        DONE_38:
816
 
817
/////////////////  INST 39 //////////////////////
818
 
819
        // Clear RAM
820
                MOV  R0,#128
821
        RAM_CLR_39:
822
                DEC  R0
823
                MOV  @R0,#0
824
                MOV  A,R0
825
                JNZ  RAM_CLR_39
826
                MOV  PSW,#0
827
 
828
// INC direct (39)
829
                MOV  127,#10
830
                INC  127
831
                MOV  A,127
832
                SUBB A,#11
833
                JZ   DONE_39
834
                MOV  P1,#39
835
                LJMP FAILED
836
        DONE_39:
837
 
838
/////////////////  INST 40 //////////////////////
839
 
840
        // Clear RAM
841
                MOV  R0,#128
842
        RAM_CLR_40:
843
                DEC  R0
844
                MOV  @R0,#0
845
                MOV  A,R0
846
                JNZ  RAM_CLR_40
847
                MOV  PSW,#0
848
 
849
// INC @Ri (40)
850
                MOV  127,#10
851
                MOV  R0,#127
852
                INC  @R0
853
                MOV  A,@R0
854
                SUBB A,#11
855
                JZ   DONE_40
856
                MOV  P1,#40
857
                LJMP FAILED
858
        DONE_40:
859
 
860
 
861
/////////////////  INST 41 //////////////////////
862
 
863
        // Clear RAM
864
                MOV  R0,#128
865
        RAM_CLR_41:
866
                DEC  R0
867
                MOV  @R0,#0
868
                MOV  A,R0
869
                JNZ  RAM_CLR_41
870
                MOV  PSW,#0
871
 
872
// INC DPTR (41)
873
                MOV  DPTR,#12FFH
874
                INC  DPTR
875
                MOV  A,DPH
876
                SUBB A,#13H
877
                JZ   DPH_OK_41
878
                MOV  P1,#41
879
                LJMP FAILED
880
        DPH_OK_41:
881
                MOV  A,DPL
882
                JZ   DONE_41
883
                MOV  P1,#41
884
                LJMP FAILED
885
        DONE_41:
886
 
887
 
888
/////////////////  INST 42 //////////////////////
889
 
890
        // Clear RAM
891
                MOV  R0,#128
892
        RAM_CLR_42:
893
                DEC  R0
894
                MOV  @R0,#0
895
                MOV  A,R0
896
                JNZ  RAM_CLR_42
897
                MOV  PSW,#0
898
 
899
// JB bit,rel (42)
900
                MOV  A,#16
901
                JB   ACC.4,DONE_42
902
                MOV  P1,#42
903
                LJMP FAILED
904
        DONE_42:
905
 
906
 
907
/////////////////  INST 43 //////////////////////
908
 
909
        // Clear RAM
910
                MOV  R0,#128
911
        RAM_CLR_43:
912
                DEC  R0
913
                MOV  @R0,#0
914
                MOV  A,R0
915
                JNZ  RAM_CLR_43
916
                MOV  PSW,#0
917
 
918
// JBC bit,rel (43)
919
                MOV  A,#8
920
                JBC  ACC.3,CHECK_BIT_43
921
                MOV  P1,#43
922
                LJMP FAILED
923
        CHECK_BIT_43:
924
                JZ   DONE_43
925
                MOV  P1,#43
926
                LJMP FAILED
927
        DONE_43:
928
 
929
/////////////////  INST 44 //////////////////////
930
 
931
        // Clear RAM
932
                MOV  R0,#128
933
        RAM_CLR_44:
934
                DEC  R0
935
                MOV  @R0,#0
936
                MOV  A,R0
937
                JNZ  RAM_CLR_44
938
                MOV  PSW,#0
939
 
940
// JC rel (44)
941
                JC   ERROR_44
942
                CPL  C
943
                JC   DONE_44
944
        ERROR_44:
945
                MOV  P1,#44
946
                LJMP FAILED
947
        DONE_44:
948
 
949
/////////////////  INST 45 //////////////////////
950
 
951
        // Clear RAM
952
                MOV  R0,#128
953
        RAM_CLR_45:
954
                DEC  R0
955
                MOV  @R0,#0
956
                MOV  A,R0
957
                JNZ  RAM_CLR_45
958
                MOV  PSW,#0
959
 
960
// JMP @A+DPTR (45)
961
                MOV  A,#4
962
                MOV  DPTR,#JMP_TBL
963
                JMP  @A+DPTR
964
        JMP_TBL:
965
                AJMP JUMP_0
966
                AJMP JUMP_2
967
                AJMP JUMP_4
968
                AJMP JUMP_6
969
        JUMP_0:
970
        JUMP_2:
971
        JUMP_6:
972
                MOV  P1,#43
973
                LJMP FAILED
974
        JUMP_4:
975
 
976
/////////////////  INST 46 //////////////////////
977
 
978
        // Clear RAM
979
                MOV  R0,#128
980
        RAM_CLR_46:
981
                DEC  R0
982
                MOV  @R0,#0
983
                MOV  A,R0
984
                JNZ  RAM_CLR_46
985
                MOV  PSW,#0
986
 
987
// JNB bit,rel (46)
988
                MOV  A,#4
989
                JNB  ACC.2,ERROR_46
990
                JNB  ACC.1,DONE_46
991
        ERROR_46:
992
                MOV  P1,#46
993
                LJMP FAILED
994
        DONE_46:
995
 
996
/////////////////  INST 47 //////////////////////
997
 
998
        // Clear RAM
999
                MOV  R0,#128
1000
        RAM_CLR_47:
1001
                DEC  R0
1002
                MOV  @R0,#0
1003
                MOV  A,R0
1004
                JNZ  RAM_CLR_47
1005
                MOV  PSW,#0
1006
 
1007
// JNC rel (47)
1008
                CPL  C
1009
                JNC  ERROR_47
1010
                CPL  C
1011
                JNC  DONE_47
1012
        ERROR_47:
1013
                MOV  P1,#47
1014
                LJMP FAILED
1015
        DONE_47:
1016
 
1017
/////////////////  INST 48 //////////////////////
1018
 
1019
        // Clear RAM
1020
                MOV  R0,#128
1021
        RAM_CLR_48:
1022
                DEC  R0
1023
                MOV  @R0,#0
1024
                MOV  A,R0
1025
                JNZ  RAM_CLR_48
1026
                MOV  PSW,#0
1027
 
1028
// JNZ rel (48)
1029
                JNZ ERROR_48
1030
                MOV A,#1
1031
                JNZ DONE_48
1032
        ERROR_48:
1033
                MOV  P1,#48
1034
                LJMP FAILED
1035
        DONE_48:
1036
 
1037
/////////////////  INST 49 //////////////////////
1038
 
1039
        // Clear RAM
1040
                MOV  R0,#128
1041
        RAM_CLR_49:
1042
                DEC  R0
1043
                MOV  @R0,#0
1044
                MOV  A,R0
1045
                JNZ  RAM_CLR_49
1046
                MOV  PSW,#0
1047
 
1048
// JZ rel (49)
1049
                MOV  A,#2
1050
                JZ   ERROR_49
1051
                MOV  A,#0
1052
                JZ   DONE_49
1053
        ERROR_49:
1054
                MOV  P1,#49
1055
                LJMP FAILED
1056
        DONE_49:
1057
 
1058
/////////////////  INST 51 //////////////////////
1059
 
1060
        // Clear RAM
1061
                MOV  R0,#128
1062
        RAM_CLR_51:
1063
                DEC  R0
1064
                MOV  @R0,#0
1065
                MOV  A,R0
1066
                JNZ  RAM_CLR_51
1067
                MOV  PSW,#0
1068
 
1069
// LJMP (51)
1070
              LJMP DONE_51
1071
                MOV  P1,#51
1072
                LJMP FAILED
1073
        DONE_51:
1074
 
1075
/////////////////  INST 52 //////////////////////
1076
 
1077
        // Clear RAM
1078
                MOV  R0,#128
1079
        RAM_CLR_52:
1080
                DEC  R0
1081
                MOV  @R0,#0
1082
                MOV  A,R0
1083
                JNZ  RAM_CLR_52
1084
                MOV  PSW,#0
1085
 
1086
// MOV A,Rn (52)
1087
                MOV  R0,#10
1088
                MOV  A,R0
1089
                SUBB A,#10
1090
                JZ   DONE_52
1091
                MOV  P1,#52
1092
                LJMP FAILED
1093
        DONE_52:
1094
 
1095
 
1096
/////////////////  INST 53 //////////////////////
1097
 
1098
        // Clear RAM
1099
                MOV  R0,#128
1100
        RAM_CLR_53:
1101
                DEC  R0
1102
                MOV  @R0,#0
1103
                MOV  A,R0
1104
                JNZ  RAM_CLR_53
1105
                MOV  PSW,#0
1106
 
1107
// MOV A,direct (53)
1108
                MOV  127,#10
1109
                MOV  A,127
1110
                SUBB A,#10
1111
                JZ   DONE_53
1112
                MOV  P1,#53
1113
                LJMP FAILED
1114
        DONE_53:
1115
 
1116
/////////////////  INST 54 //////////////////////
1117
 
1118
        // Clear RAM
1119
                MOV  R0,#128
1120
        RAM_CLR_54:
1121
                DEC  R0
1122
                MOV  @R0,#0
1123
                MOV  A,R0
1124
                JNZ  RAM_CLR_54
1125
                MOV  PSW,#0
1126
 
1127
// MOV A,@Ri (54)
1128
                MOV  R0,#127
1129
                MOV  127,#10
1130
                MOV  A,@R0
1131
                SUBB A,#10
1132
                JZ   DONE_54
1133
                MOV  P1,#54
1134
                LJMP FAILED
1135
        DONE_54:
1136
 
1137
 
1138
/////////////////  INST 55 //////////////////////
1139
 
1140
        // Clear RAM
1141
                MOV  R0,#128
1142
        RAM_CLR_55:
1143
                DEC  R0
1144
                MOV  @R0,#0
1145
                MOV  A,R0
1146
                JNZ  RAM_CLR_55
1147
                MOV  PSW,#0
1148
 
1149
// MOV A,#data (55)
1150
                MOV  A,#10
1151
                SUBB A,#10
1152
                JZ   DONE_55
1153
                MOV  P1,#55
1154
                LJMP FAILED
1155
        DONE_55:
1156
 
1157
/////////////////  INST 56 //////////////////////
1158
 
1159
        // Clear RAM
1160
                MOV  R0,#128
1161
        RAM_CLR_56:
1162
                DEC  R0
1163
                MOV  @R0,#0
1164
                MOV  A,R0
1165
                JNZ  RAM_CLR_56
1166
                MOV  PSW,#0
1167
 
1168
// MOV Rn,A (56)
1169
                MOV  A,#10
1170
                MOV  R0,A
1171
                CLR  A
1172
                MOV  A,R0
1173
                SUBB A,#10
1174
                JZ   DONE_56
1175
                MOV  P1,#56
1176
                LJMP FAILED
1177
        DONE_56:
1178
 
1179
/////////////////  INST 57 //////////////////////
1180
 
1181
        // Clear RAM
1182
                MOV  R0,#128
1183
        RAM_CLR_57:
1184
                DEC  R0
1185
                MOV  @R0,#0
1186
                MOV  A,R0
1187
                JNZ  RAM_CLR_57
1188
                MOV  PSW,#0
1189
 
1190
// MOV Rn,direct (57)
1191
                MOV  127,#10
1192
                MOV  R0,127
1193
                MOV  A,R0
1194
                SUBB A,#10
1195
                JZ   DONE_57
1196
                MOV  P1,#57
1197
                LJMP FAILED
1198
        DONE_57:
1199
 
1200
/////////////////  INST 58 //////////////////////
1201
 
1202
        // Clear RAM
1203
                MOV  R0,#128
1204
        RAM_CLR_58:
1205
                DEC  R0
1206
                MOV  @R0,#0
1207
                MOV  A,R0
1208
                JNZ  RAM_CLR_58
1209
                MOV  PSW,#0
1210
 
1211
// MOV Rn,#data (58)
1212
                MOV  R0,#10
1213
                MOV  A,R0
1214
                SUBB A,#10
1215
                JZ   DONE_58
1216
                MOV  P1,#58
1217
                LJMP FAILED
1218
        DONE_58:
1219
 
1220
/////////////////  INST 59 //////////////////////
1221
 
1222
        // Clear RAM
1223
                MOV  R0,#128
1224
        RAM_CLR_59:
1225
                DEC  R0
1226
                MOV  @R0,#0
1227
                MOV  A,R0
1228
                JNZ  RAM_CLR_59
1229
                MOV  PSW,#0
1230
 
1231
// MOV direct,A (59)
1232
                MOV  A,#10
1233
                MOV  127,A
1234
                CLR  A
1235
                MOV  A,127
1236
                SUBB A,#10
1237
                JZ   DONE_59
1238
                MOV  P1,#59
1239
                LJMP FAILED
1240
        DONE_59:
1241
 
1242
/////////////////  INST 60 //////////////////////
1243
 
1244
        // Clear RAM
1245
                MOV  R0,#128
1246
        RAM_CLR_60:
1247
                DEC  R0
1248
                MOV  @R0,#0
1249
                MOV  A,R0
1250
                JNZ  RAM_CLR_60
1251
                MOV  PSW,#0
1252
 
1253
// MOV direct,Rn (60)
1254
                MOV  R0,#10
1255
                MOV  127,R0
1256
                MOV  A,127
1257
                SUBB A,#10
1258
                JZ   DONE_60
1259
                MOV  P1,#60
1260
                LJMP FAILED
1261
        DONE_60:
1262
 
1263
/////////////////  INST 61 //////////////////////
1264
 
1265
        // Clear RAM
1266
                MOV  R0,#128
1267
        RAM_CLR_61:
1268
                DEC  R0
1269
                MOV  @R0,#0
1270
                MOV  A,R0
1271
                JNZ  RAM_CLR_61
1272
                MOV  PSW,#0
1273
 
1274
// MOV direct,direct (61)
1275
                MOV  127,#10
1276
                MOV  126,127
1277
                MOV  A,126
1278
                SUBB A,#10
1279
                JZ   DONE_61
1280
                MOV  P1,#61
1281
                LJMP FAILED
1282
        DONE_61:
1283
 
1284
/////////////////  INST 62 //////////////////////
1285
 
1286
        // Clear RAM
1287
                MOV  R0,#128
1288
        RAM_CLR_62:
1289
                DEC  R0
1290
                MOV  @R0,#0
1291
                MOV  A,R0
1292
                JNZ  RAM_CLR_62
1293
                MOV  PSW,#0
1294
 
1295
// MOV direct,@Ri (62)
1296
                MOV  127,#10
1297
                MOV  R0,#127
1298
                MOV  126,@R0
1299
                MOV  A,126
1300
                SUBB A,#10
1301
                JZ   DONE_62
1302
                MOV  P1,#62
1303
                LJMP FAILED
1304
        DONE_62:
1305
 
1306
/////////////////  INST 63 //////////////////////
1307
 
1308
        // Clear RAM
1309
                MOV  R0,#128
1310
        RAM_CLR_63:
1311
                DEC  R0
1312
                MOV  @R0,#0
1313
                MOV  A,R0
1314
                JNZ  RAM_CLR_63
1315
                MOV  PSW,#0
1316
 
1317
// MOV direct,#data (63)
1318
                MOV  127,#10
1319
                MOV  A,127
1320
                SUBB A,#10
1321
                JZ   DONE_63
1322
                MOV  P1,#63
1323
                LJMP FAILED
1324
        DONE_63:
1325
 
1326
/////////////////  INST 64 //////////////////////
1327
 
1328
        // Clear RAM
1329
                MOV  R0,#128
1330
        RAM_CLR_64:
1331
                DEC  R0
1332
                MOV  @R0,#0
1333
                MOV  A,R0
1334
                JNZ  RAM_CLR_64
1335
                MOV  PSW,#0
1336
 
1337
// MOV @Ri,A (64)
1338
                MOV  A,#10
1339
                MOV  R0,#127
1340
                MOV  @R0,A
1341
                CLR  A
1342
                MOV  A,127
1343
                SUBB A,#10
1344
                JZ   DONE_64
1345
                MOV  P1,#64
1346
                LJMP FAILED
1347
        DONE_64:
1348
 
1349
/////////////////  INST 65 //////////////////////
1350
 
1351
        // Clear RAM
1352
                MOV  R0,#128
1353
        RAM_CLR_65:
1354
                DEC  R0
1355
                MOV  @R0,#0
1356
                MOV  A,R0
1357
                JNZ  RAM_CLR_65
1358
                MOV  PSW,#0
1359
 
1360
// MOV @Ri,direct (65)
1361
                MOV  127,#10
1362
                MOV  R0,#126
1363
                MOV  @R0,127
1364
                MOV  A,126
1365
                SUBB A,#10
1366
                JZ   DONE_65
1367
                MOV  P1,#65
1368
                LJMP FAILED
1369
        DONE_65:
1370
 
1371
/////////////////  INST 66 //////////////////////
1372
 
1373
        // Clear RAM
1374
                MOV  R0,#128
1375
        RAM_CLR_66:
1376
                DEC  R0
1377
                MOV  @R0,#0
1378
                MOV  A,R0
1379
                JNZ  RAM_CLR_66
1380
                MOV  PSW,#0
1381
 
1382
// MOV @Ri,#data (66)
1383
                MOV  R0,#127
1384
                MOV  @R0,#10
1385
                MOV  A,127
1386
                SUBB A,#10
1387
                JZ   DONE_66
1388
                MOV  P1,#66
1389
                LJMP FAILED
1390
        DONE_66:
1391
 
1392
/////////////////  INST 67 //////////////////////
1393
 
1394
        // Clear RAM
1395
                MOV  R0,#128
1396
        RAM_CLR_67:
1397
                DEC  R0
1398
                MOV  @R0,#0
1399
                MOV  A,R0
1400
                JNZ  RAM_CLR_67
1401
                MOV  PSW,#0
1402
 
1403
// MOV C,bit (67)
1404
                MOV  A,#1
1405
                MOV  C,ACC.0
1406
                JC   DONE_67
1407
                MOV  P1,#67
1408
                LJMP FAILED
1409
        DONE_67:
1410
 
1411
/////////////////  INST 68 //////////////////////
1412
 
1413
        // Clear RAM
1414
                MOV  R0,#128
1415
        RAM_CLR_68:
1416
                DEC  R0
1417
                MOV  @R0,#0
1418
                MOV  A,R0
1419
                JNZ  RAM_CLR_68
1420
                MOV  PSW,#0
1421
 
1422
// MOV bit,C (68)
1423
                CPL  C
1424
                MOV  ACC.0,C
1425
                CPL  C
1426
                SUBB A,#1
1427
                JZ   DONE_68
1428
                MOV  P1,#68
1429
                LJMP FAILED
1430
        DONE_68:
1431
 
1432
/////////////////  INST 69 //////////////////////
1433
 
1434
        // Clear RAM
1435
                MOV  R0,#128
1436
        RAM_CLR_69:
1437
                DEC  R0
1438
                MOV  @R0,#0
1439
                MOV  A,R0
1440
                JNZ  RAM_CLR_69
1441
                MOV  PSW,#0
1442
 
1443
// MOVC DPTR,#data (69)
1444
                MOV  DPTR,#1234H
1445
                MOV  A,DPH
1446
                SUBB A,#12H
1447
                JNZ  ERROR_69
1448
                MOV  A,DPL
1449
                SUBB A,#34H
1450
                JZ   DONE_69
1451
        ERROR_69:
1452
                MOV  P1,#69
1453
                LJMP FAILED
1454
        DONE_69:
1455
 
1456
 
1457
/////////////////  INST 70 //////////////////////
1458
 
1459
        // Clear RAM
1460
                MOV  R0,#128
1461
        RAM_CLR_70:
1462
                DEC  R0
1463
                MOV  @R0,#0
1464
                MOV  A,R0
1465
                JNZ  RAM_CLR_70
1466
                MOV  PSW,#0
1467
 
1468
// MOVC A,@A+DPTR (70)
1469
                MOV  DPTR,#DB_TBL
1470
                MOVC A,@A+DPTR
1471
                SUBB A,#66H
1472
                JNZ  ERROR_70
1473
                MOV  A,#1
1474
                MOVC A,@A+DPTR
1475
                SUBB A,#77H
1476
                JZ   DONE_70
1477
                JNZ  ERROR_70
1478
        DB_TBL:
1479
                DB   66H
1480
                DB   77H
1481
        ERROR_70:
1482
                MOV  P1,#70
1483
                LJMP FAILED
1484
        DONE_70:
1485
 
1486
 
1487
/////////////////  INST 71 //////////////////////
1488
 
1489
        // Clear RAM
1490
                MOV  R0,#128
1491
        RAM_CLR_71:
1492
                DEC  R0
1493
                MOV  @R0,#0
1494
                MOV  A,R0
1495
                JNZ  RAM_CLR_71
1496
                MOV  PSW,#0
1497
 
1498
// MOVC A,@A+PC (71)
1499
                MOV  A,#13
1500
                MOVC A,@A+PC
1501
                SUBB A,#66H
1502
                JNZ  ERROR_71
1503
                MOV  A,#7
1504
                MOVC A,@A+PC
1505
                SUBB A,#77H
1506
                JZ   DONE_71
1507
                JNZ  ERROR_71
1508
                DB   66H
1509
                DB   77H
1510
        ERROR_71:
1511
                MOV  P1,#71
1512
                LJMP FAILED
1513
        DONE_71:
1514
 
1515
 
1516
////////////////  INST 76 ///////////////////////
1517
 
1518
        // Clear RAM
1519
                MOV  R0,#128
1520
        RAM_CLR_76:
1521
                DEC  R0
1522
                MOV  @R0,#0
1523
                MOV  A,R0
1524
                JNZ  RAM_CLR_76
1525
                MOV  PSW,#0
1526
 
1527
// MUL AB (76)
1528
                MOV  A,#80
1529
                MOV  B,#160
1530
                MUL  AB         ; = 3200H
1531
                JNZ  ERROR_76
1532
                MOV  A,B
1533
                SUBB A,#32H
1534
                JZ   DONE_76
1535
        ERROR_76:
1536
                MOV  P1,#76
1537
                LJMP FAILED
1538
        DONE_76:
1539
 
1540
 
1541
////////////////  INST 78 ///////////////////////
1542
 
1543
        // Clear RAM
1544
                MOV  R0,#128
1545
        RAM_CLR_78:
1546
                DEC  R0
1547
                MOV  @R0,#0
1548
                MOV  A,R0
1549
                JNZ  RAM_CLR_78
1550
                MOV  PSW,#0
1551
 
1552
// ORL A,Rn (78)
1553
                MOV  A,#90H
1554
                MOV  R0,#9H
1555
                ORL  A,R0
1556
                SUBB A,#99H
1557
                JZ   DONE_78
1558
                MOV  P1,#78
1559
                LJMP FAILED
1560
        DONE_78:
1561
 
1562
////////////////  INST 79 ///////////////////////
1563
 
1564
        // Clear RAM
1565
                MOV  R0,#128
1566
        RAM_CLR_79:
1567
                DEC  R0
1568
                MOV  @R0,#0
1569
                MOV  A,R0
1570
                JNZ  RAM_CLR_79
1571
                MOV  PSW,#0
1572
 
1573
// ORL A,direct (79)
1574
                MOV  A,#9H
1575
                MOV  127,#90H
1576
                ORL  A,127
1577
                SUBB A,#99H
1578
                JZ   DONE_79
1579
                MOV  P1,#79
1580
                LJMP FAILED
1581
        DONE_79:
1582
 
1583
////////////////  INST 80 ///////////////////////
1584
 
1585
        // Clear RAM
1586
                MOV  R0,#128
1587
        RAM_CLR_80:
1588
                DEC  R0
1589
                MOV  @R0,#0
1590
                MOV  A,R0
1591
                JNZ  RAM_CLR_80
1592
                MOV  PSW,#0
1593
 
1594
// ORL A,@Ri (80)
1595
                MOV  A,#90H
1596
                MOV  R0,#127
1597
                MOV  127,#06H
1598
                ORL  A,@R0
1599
                SUBB A,#96H
1600
                JZ   DONE_80
1601
                MOV  P1,#80
1602
                LJMP FAILED
1603
        DONE_80:
1604
 
1605
////////////////  INST 81 ///////////////////////
1606
 
1607
        // Clear RAM
1608
                MOV  R0,#128
1609
        RAM_CLR_81:
1610
                DEC  R0
1611
                MOV  @R0,#0
1612
                MOV  A,R0
1613
                JNZ  RAM_CLR_81
1614
                MOV  PSW,#0
1615
 
1616
// ORL A,#data (81)
1617
                MOV  A,#11H
1618
                ORL  A,#22H
1619
                SUBB A,#33H
1620
                JZ   DONE_81
1621
                MOV  P1,#81
1622
                LJMP FAILED
1623
        DONE_81:
1624
 
1625
////////////////  INST 82 ///////////////////////
1626
 
1627
        // Clear RAM
1628
                MOV  R0,#128
1629
        RAM_CLR_82:
1630
                DEC  R0
1631
                MOV  @R0,#0
1632
                MOV  A,R0
1633
                JNZ  RAM_CLR_82
1634
                MOV  PSW,#0
1635
 
1636
// ORL direct,A (82)
1637
                MOV  A,#90H
1638
                MOV  127,#9H
1639
                ORL  127,A
1640
                CLR  A
1641
                MOV  A,127
1642
                SUBB A,#99H
1643
                JZ   DONE_82
1644
                MOV  P1,#82
1645
                LJMP FAILED
1646
        DONE_82:
1647
 
1648
////////////////  INST 83 ///////////////////////
1649
 
1650
        // Clear RAM
1651
                MOV  R0,#128
1652
        RAM_CLR_83:
1653
                DEC  R0
1654
                MOV  @R0,#0
1655
                MOV  A,R0
1656
                JNZ  RAM_CLR_83
1657
                MOV  PSW,#0
1658
 
1659
// ORL direct,#data (83)
1660
                MOV  127,#90H
1661
                ORL  127,#9H
1662
                MOV  A,127
1663
                SUBB A,#99H
1664
                JZ   DONE_83
1665
                MOV  P1,#83
1666
                LJMP FAILED
1667
        DONE_83:
1668
 
1669
////////////////  INST 84 ///////////////////////
1670
 
1671
        // Clear RAM
1672
                MOV  R0,#128
1673
        RAM_CLR_84:
1674
                DEC  R0
1675
                MOV  @R0,#0
1676
                MOV  A,R0
1677
                JNZ  RAM_CLR_84
1678
                MOV  PSW,#0
1679
 
1680
// ORL C,bit (84)
1681
                ORL  C,ACC.0
1682
                JC   ERROR_84
1683
                MOV  A,#1
1684
                ORL  C,ACC.0
1685
                JNC  ERROR_84
1686
                ORL  C,ACC.1
1687
                JC   DONE_84
1688
        ERROR_84:
1689
                MOV  P1,#84
1690
                LJMP FAILED
1691
        DONE_84:
1692
 
1693
////////////////  INST 85 ///////////////////////
1694
 
1695
        // Clear RAM
1696
                MOV  R0,#128
1697
        RAM_CLR_85:
1698
                DEC  R0
1699
                MOV  @R0,#0
1700
                MOV  A,R0
1701
                JNZ  RAM_CLR_85
1702
                MOV  PSW,#0
1703
 
1704
// ORL C,/bit (85)
1705
                MOV  A,#1
1706
                ORL  C,/ACC.0
1707
                JC   ERROR_85
1708
                ORL  C,/ACC.1
1709
                JNC  ERROR_85
1710
                ORL  C,/ACC.0
1711
                JC   DONE_85
1712
        ERROR_85:
1713
                MOV  P1,#85
1714
                LJMP FAILED
1715
        DONE_85:
1716
 
1717
 
1718
////////////////  INST 86,87 ///////////////////////
1719
 
1720
        // Clear RAM
1721
                MOV  R0,#128
1722
        RAM_CLR_87:
1723
                DEC  R0
1724
                MOV  @R0,#0
1725
                MOV  A,R0
1726
                JNZ  RAM_CLR_87
1727
                MOV  PSW,#0
1728
 
1729
// PUSH direct (87)
1730
                MOV  DPTR,#0123H
1731
                MOV  127,#8
1732
                PUSH DPL
1733
                PUSH DPH
1734
                PUSH 127
1735
                MOV  A,8
1736
                SUBB A,#23H
1737
                JNZ  ERROR_87
1738
                MOV  A,9
1739
                SUBB A,#1
1740
                JNZ ERROR_87
1741
                MOV  A,10
1742
                SUBB A,#8
1743
                JZ   DONE_87
1744
        ERROR_87:
1745
                MOV  P1,#87
1746
                LJMP FAILED
1747
        DONE_87:
1748
 
1749
// POP direct (86)
1750
                POP  SP
1751
                POP  100
1752
                MOV  A,100
1753
                SUBB A,#23H
1754
                JZ   DONE_86
1755
                MOV  P1,#86
1756
                LJMP FAILED
1757
        DONE_86:
1758
 
1759
////////////////  INST 90 ///////////////////////
1760
 
1761
        // Clear RAM
1762
                MOV  R0,#128
1763
        RAM_CLR_90:
1764
                DEC  R0
1765
                MOV  @R0,#0
1766
                MOV  A,R0
1767
                JNZ  RAM_CLR_90
1768
                MOV  PSW,#0
1769
 
1770
// RL A (90)
1771
                MOV  A,#129
1772
                RL   A
1773
                SUBB A,#3
1774
                JZ   DONE_90
1775
                MOV  P1,#90
1776
                LJMP FAILED
1777
        DONE_90:
1778
 
1779
 
1780
////////////////  INST 91 ///////////////////////
1781
 
1782
        // Clear RAM
1783
                MOV  R0,#128
1784
        RAM_CLR_91:
1785
                DEC  R0
1786
                MOV  @R0,#0
1787
                MOV  A,R0
1788
                JNZ  RAM_CLR_91
1789
                MOV  PSW,#0
1790
 
1791
// RLC A (91)
1792
                MOV  A,#129
1793
                RLC  A
1794
                SUBB A,#1       ;A(2)-C(1)-1
1795
                JZ   DONE_91
1796
                MOV  P1,#91
1797
                LJMP FAILED
1798
        DONE_91:
1799
 
1800
////////////////  INST 92 ///////////////////////
1801
 
1802
        // Clear RAM
1803
                MOV  R0,#128
1804
        RAM_CLR_92:
1805
                DEC  R0
1806
                MOV  @R0,#0
1807
                MOV  A,R0
1808
                JNZ  RAM_CLR_92
1809
                MOV  PSW,#0
1810
 
1811
// RR A (92)
1812
                MOV  A,#129
1813
                RR   A
1814
                SUBB A,#192
1815
                JZ   DONE_92
1816
                MOV  P1,#92
1817
                LJMP FAILED
1818
        DONE_92:
1819
 
1820
 
1821
////////////////  INST 93 ///////////////////////
1822
 
1823
        // Clear RAM
1824
                MOV  R0,#128
1825
        RAM_CLR_93:
1826
                DEC  R0
1827
                MOV  @R0,#0
1828
                MOV  A,R0
1829
                JNZ  RAM_CLR_93
1830
                MOV  PSW,#0
1831
 
1832
// RRC A (93)
1833
                MOV  A,#3
1834
                RRC  A
1835
                SUBB A,#0       ;A(1)-C(1)-0
1836
                JZ   DONE_93
1837
                MOV  P1,#93
1838
                LJMP FAILED
1839
        DONE_93:
1840
 
1841
////////////////  INST 94 ///////////////////////
1842
 
1843
        // Clear RAM
1844
                MOV  R0,#128
1845
        RAM_CLR_94:
1846
                DEC  R0
1847
                MOV  @R0,#0
1848
                MOV  A,R0
1849
                JNZ  RAM_CLR_94
1850
                MOV  PSW,#0
1851
 
1852
// SETB C (94)
1853
                SETB C
1854
                MOV  A,#1
1855
                SUBB A,#0       ;A(1)-C(1)-0
1856
                JZ   DONE_94
1857
                MOV  P1,#94
1858
                LJMP FAILED
1859
        DONE_94:
1860
 
1861
////////////////  INST 95 ///////////////////////
1862
 
1863
        // Clear RAM
1864
                MOV  R0,#128
1865
        RAM_CLR_95:
1866
                DEC  R0
1867
                MOV  @R0,#0
1868
                MOV  A,R0
1869
                JNZ  RAM_CLR_95
1870
                MOV  PSW,#0
1871
 
1872
// SETB bit (95)
1873
                SETB ACC.7
1874
                SUBB A,#128
1875
                JZ   DONE_95
1876
                MOV  P1,#95
1877
                LJMP FAILED
1878
        DONE_95:
1879
 
1880
////////////////  INST 96 ///////////////////////
1881
 
1882
        // Clear RAM
1883
                MOV  R0,#128
1884
        RAM_CLR_96:
1885
                DEC  R0
1886
                MOV  @R0,#0
1887
                MOV  A,R0
1888
                JNZ  RAM_CLR_96
1889
                MOV  PSW,#0
1890
 
1891
// SJMP (96)
1892
                SJMP DONE_96
1893
                MOV  P1,#96
1894
                LJMP FAILED
1895
        DONE_96:
1896
 
1897
////////////////  INST 97 ///////////////////////
1898
 
1899
        // Clear RAM
1900
                MOV  R0,#128
1901
        RAM_CLR_97:
1902
                DEC  R0
1903
                MOV  @R0,#0
1904
                MOV  A,R0
1905
                JNZ  RAM_CLR_97
1906
                MOV  PSW,#0
1907
 
1908
// SUBB A,Rn (97)
1909
                MOV  A,#10
1910
                MOV  R0,#10
1911
                SUBB A,R0
1912
                JZ   DONE_97
1913
                MOV  P1,#97
1914
                LJMP FAILED
1915
        DONE_97:
1916
 
1917
////////////////  INST 98 ///////////////////////
1918
 
1919
        // Clear RAM
1920
                MOV  R0,#128
1921
        RAM_CLR_98:
1922
                DEC  R0
1923
                MOV  @R0,#0
1924
                MOV  A,R0
1925
                JNZ  RAM_CLR_98
1926
                MOV  PSW,#0
1927
 
1928
// SUBB A,direct (98)
1929
                MOV  A,#10
1930
                MOV  127,#10
1931
                SUBB A,127
1932
                JZ   DONE_98
1933
                MOV  P1,#98
1934
                LJMP FAILED
1935
        DONE_98:
1936
 
1937
////////////////  INST 99 ///////////////////////
1938
 
1939
        // Clear RAM
1940
                MOV  R0,#128
1941
        RAM_CLR_99:
1942
                DEC  R0
1943
                MOV  @R0,#0
1944
                MOV  A,R0
1945
                JNZ  RAM_CLR_99
1946
                MOV  PSW,#0
1947
 
1948
// SUBB A,@Ri (99)
1949
                MOV  A,#10
1950
                MOV  R0,#127
1951
                MOV  127,#10
1952
                SUBB A,@R0
1953
                JZ   DONE_99
1954
                MOV  P1,#99
1955
                LJMP FAILED
1956
        DONE_99:
1957
 
1958
 
1959
//////////////// INST 100 ///////////////////////
1960
 
1961
        // Clear RAM
1962
                MOV  R0,#128
1963
        RAM_CLR_100:
1964
                DEC  R0
1965
                MOV  @R0,#0
1966
                MOV  A,R0
1967
                JNZ  RAM_CLR_100
1968
                MOV  PSW,#0
1969
 
1970
// SUBB A,#data (100)
1971
                MOV  A,#10
1972
                SUBB A,#10
1973
                JZ   DONE_100
1974
                MOV  P1,#100
1975
                LJMP FAILED
1976
        DONE_100:
1977
 
1978
//////////////// INST 101 ///////////////////////
1979
 
1980
        // Clear RAM
1981
                MOV  R0,#128
1982
        RAM_CLR_101:
1983
                DEC  R0
1984
                MOV  @R0,#0
1985
                MOV  A,R0
1986
                JNZ  RAM_CLR_101
1987
                MOV  PSW,#0
1988
 
1989
// SWAP A (101)
1990
                MOV  A,#23H
1991
                SWAP A
1992
                SUBB A,#32H
1993
                JZ   DONE_101
1994
                MOV  P1,#101
1995
                LJMP FAILED
1996
        DONE_101:
1997
 
1998
//////////////// INST 102 ///////////////////////
1999
 
2000
        // Clear RAM
2001
                MOV  R0,#128
2002
        RAM_CLR_102:
2003
                DEC  R0
2004
                MOV  @R0,#0
2005
                MOV  A,R0
2006
                JNZ  RAM_CLR_102
2007
                MOV  PSW,#0
2008
 
2009
// XCH A,Rn (102)
2010
                MOV  A,#10
2011
                MOV  R0,#99
2012
                XCH  A,R0
2013
                SUBB A,#99
2014
                JNZ  ERROR_102
2015
                MOV  A,R0
2016
                SUBB A,#10
2017
                JZ   DONE_102
2018
        ERROR_102:
2019
                MOV  P1,#102
2020
                LJMP FAILED
2021
        DONE_102:
2022
 
2023
//////////////// INST 103 ///////////////////////
2024
 
2025
        // Clear RAM
2026
                MOV  R0,#128
2027
        RAM_CLR_103:
2028
                DEC  R0
2029
                MOV  @R0,#0
2030
                MOV  A,R0
2031
                JNZ  RAM_CLR_103
2032
                MOV  PSW,#0
2033
 
2034
// XCH A,direct (103)
2035
                MOV  A,#10
2036
                MOV  127,#99
2037
                XCH  A,127
2038
                SUBB A,#99
2039
                JNZ  ERROR_103
2040
                MOV  A,127
2041
                SUBB A,#10
2042
                JZ   DONE_103
2043
        ERROR_103:
2044
                MOV  P1,#103
2045
                LJMP FAILED
2046
        DONE_103:
2047
 
2048
//////////////// INST 104 ///////////////////////
2049
 
2050
        // Clear RAM
2051
                MOV  R0,#128
2052
        RAM_CLR_104:
2053
                DEC  R0
2054
                MOV  @R0,#0
2055
                MOV  A,R0
2056
                JNZ  RAM_CLR_104
2057
                MOV  PSW,#0
2058
 
2059
// XCH A,@Ri (104)
2060
                MOV  A,#10
2061
                MOV  R0,#127
2062
                MOV  127,#99
2063
                XCH  A,@R0
2064
                SUBB A,#99
2065
                JNZ  ERROR_104
2066
                MOV  A,127
2067
                SUBB A,#10
2068
                JZ   DONE_104
2069
        ERROR_104:
2070
                MOV  P1,#104
2071
                LJMP FAILED
2072
        DONE_104:
2073
 
2074
//////////////// INST 105 ///////////////////////
2075
 
2076
        // Clear RAM
2077
                MOV  R0,#128
2078
        RAM_CLR_105:
2079
                DEC  R0
2080
                MOV  @R0,#0
2081
                MOV  A,R0
2082
                JNZ  RAM_CLR_105
2083
                MOV  PSW,#0
2084
 
2085
// XCHD A,@Ri (105)
2086
                MOV  A,#44H
2087
                MOV  R0,#127
2088
                MOV  127,#55H
2089
                XCHD A,@R0
2090
                SUBB A,#45H
2091
                JNZ  ERROR_105
2092
                MOV  A,127
2093
                SUBB A,#54H
2094
                JZ   DONE_105
2095
        ERROR_105:
2096
                MOV  P1,#105
2097
                LJMP FAILED
2098
        DONE_105:
2099
 
2100
 
2101
//////////////// INST 106 ///////////////////////
2102
 
2103
        // Clear RAM
2104
                MOV  R0,#128
2105
        RAM_CLR_106:
2106
                DEC  R0
2107
                MOV  @R0,#0
2108
                MOV  A,R0
2109
                JNZ  RAM_CLR_106
2110
                MOV  PSW,#0
2111
 
2112
// XRL A,Rn (106)
2113
                MOV  A,#35H
2114
                MOV  R0,#53H
2115
                XRL  A,R0
2116
                SUBB A,#66H
2117
                JZ   DONE_106
2118
                MOV  P1,#106
2119
                LJMP FAILED
2120
        DONE_106:
2121
 
2122
//////////////// INST 107 ///////////////////////
2123
 
2124
        // Clear RAM
2125
                MOV  R0,#128
2126
        RAM_CLR_107:
2127
                DEC  R0
2128
                MOV  @R0,#0
2129
                MOV  A,R0
2130
                JNZ  RAM_CLR_107
2131
                MOV  PSW,#0
2132
 
2133
// XRL A,direct (107)
2134
                MOV  A,#53H
2135
                MOV  127,#35H
2136
                XRL  A,127
2137
                SUBB A,#66H
2138
                JZ   DONE_107
2139
                MOV  P1,#107
2140
                LJMP FAILED
2141
        DONE_107:
2142
 
2143
 
2144
//////////////// INST 108 ///////////////////////
2145
 
2146
        // Clear RAM
2147
                MOV  R0,#128
2148
        RAM_CLR_108:
2149
                DEC  R0
2150
                MOV  @R0,#0
2151
                MOV  A,R0
2152
                JNZ  RAM_CLR_108
2153
                MOV  PSW,#0
2154
 
2155
// XRL A,@Ri (108)
2156
                MOV  A,#35H
2157
                MOV  R0,#127
2158
                MOV  127,#53H
2159
                XRL  A,@R0
2160
                SUBB A,#66H
2161
                JZ   DONE_108
2162
                MOV  P1,#108
2163
                LJMP FAILED
2164
        DONE_108:
2165
 
2166
 
2167
//////////////// INST 109 ///////////////////////
2168
 
2169
        // Clear RAM
2170
                MOV  R0,#128
2171
        RAM_CLR_109:
2172
                DEC  R0
2173
                MOV  @R0,#0
2174
                MOV  A,R0
2175
                JNZ  RAM_CLR_109
2176
                MOV  PSW,#0
2177
 
2178
// XRL A,#data (109)
2179
                MOV  A,#35H
2180
                XRL  A,#53H
2181
                SUBB A,#66H
2182
                JZ   DONE_109
2183
                MOV  P1,#109
2184
                LJMP FAILED
2185
        DONE_109:
2186
 
2187
 
2188
//////////////// INST 110 ///////////////////////
2189
 
2190
        // Clear RAM
2191
                MOV  R0,#128
2192
        RAM_CLR_110:
2193
                DEC  R0
2194
                MOV  @R0,#0
2195
                MOV  A,R0
2196
                JNZ  RAM_CLR_110
2197
                MOV  PSW,#0
2198
 
2199
// XRL direct,A (110)
2200
                MOV  A,#35H
2201
                MOV  127,#53H
2202
                XRL  127,A
2203
                CLR  A
2204
                MOV  A,127
2205
                SUBB A,#66H
2206
                JZ   DONE_110
2207
                MOV  P1,#110
2208
                LJMP FAILED
2209
        DONE_110:
2210
 
2211
 
2212
//////////////// INST 111 ///////////////////////
2213
 
2214
        // Clear RAM
2215
                MOV  R0,#128
2216
        RAM_CLR_111:
2217
                DEC  R0
2218
                MOV  @R0,#0
2219
                MOV  A,R0
2220
                JNZ  RAM_CLR_111
2221
                MOV  PSW,#0
2222
 
2223
// XRL direct,#data (111)
2224
                MOV  127,#35H
2225
                XRL  127,#53H
2226
                MOV  A,127
2227
                SUBB A,#66H
2228
                JZ   DONE_111
2229
                MOV  P1,#111
2230
                LJMP FAILED
2231
        DONE_111:
2232
 
2233
 
2234
/////////////////  DONE    //////////////////////
2235
 
2236
                MOV  P1,#127            ; All instructions passed
2237
 
2238
 
2239
        FAILED:
2240
 
2241
        #pragma endasm
2242
 
2243
        while(1);
2244
}
2245
 
2246
 
2247
 

powered by: WebSVN 2.1.0

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