This repository has been archived by the owner on Dec 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 91
/
Copy pathDAKAD.MAC.txt
2054 lines (1632 loc) · 63.8 KB
/
DAKAD.MAC.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
SUBTTL DIAGNOSTIC PARAMETERS
;ACCUMULATOR ASSIGNMENTS
;CONTROL WORDS
AROV=400000 ;ARITHMETIC OVERFLOW
CRY0=200000 ;CARRY 0
CRY1=100000 ;CARRY 1
FOV=40000 ;FLOATING OVERFLOW
BIS=20000 ;BYTE INTERRUPT
USERF=10000 ;USER MODE FLAG
EXIOT=4000 ;USER PRIV I/O FLAG
FXU=100 ;FLOATING UNDERFLOW
DCK=40 ;DIVIDE CHECK
;MACROS
; STOP - USED FOR SCOPE LOOP, IF INSTRUCTION FAILS, CHANGE (JUMPA .+1)
; TO A (JUMPA X) TO CYCLE ON FAILING INSTRUCTION
DEFINE STOP (A)<
HALT .+1 ;TEST FAILED IF PROGRAM HALTS HERE
JUMPA .+1 ;IF TEST FAILS, CHANGE THIS INSTRUCTION (JUMPA .+1)
;TO JUMPA X(X IS THE ADDRESS OF THE FIRST
;INSTRUCTION IN THE SUBTEST) TO LOOP ON ERROR
;AND CHANGE HALT INSTRUCTION TO JUMPA .+1>
; SFLAG - USED TO CLEAR ALL FLAGS THEN TO SET REQUESTED FLAG
DEFINE SFLAG (A)<
MOVSI 1,A
JFCL 17,.+1 ;RESET ALL FLAGS
JRST 2,.+1(1) ;SET A FLAG>
SUBTTL DIAGNOSTIC SECTION
START: ;SETZM USER# ;CLEAR USER CONTROL WORD
;JSP 0,.+1 ;GET FLAGS
;TLNE USERF ;IN USER MODE?
;SETOM USER ;YES, SET USER CONTROL WORD
;SKIPN MONFLG ;SPECIAL USER MODE?
;SETZM USER ;YES, CLEAR USER CONTROL WORD
;SKIPN USER
;JRST C00
;SKIPL MONCTL
;TTCALL 3,PGMNAM ;MENTION OUR NAME
JRST STARTA
PGMNAM: ASCIZ/
PDP-10 KA10 BASIC INSTRUCTION DIAGNOSTIC (4) [DAKAD]
/
;BASIC INSTRUCTION TEST (3)
;THE TEST IS DESIGNED FOR INITIAL DEBUGGING OF
;PROCESSOR HARDWARE AND TO DETECT (SOLID) FAILURES
;IN THE FIELD.
STARTA: JRST .+1
C00:
;TESTING BEGINS HERE
;IF ANY LOADING PROBLEMS OCCUR, START PROGRAM HERE.
;NOTE: AN "*" IN THE COMMENT FIELD OF AN INSTRUCTION INDICATES THAT
; IT IS THE TESTED INSTRUCTION.
SUBTTL TEST OF AC HARDWARE AND INDEX REGISTERS
;**********
;THIS TEST VERIFIES THAT AC1 IS ACCESSABLE
;IN THIS CASE, AC1 IS PRELOADED WITH 1.
;C(AC1) IS THEN CHECKED FOR A1. THIS TEST PASSES IF C(AC1)=1.
;IF THIS TEST FAILS, THE AC HARDWARE IS PROBABLY FAULTY
C100: SETZ ;CLEAR AC0
MOVEI 1,1 ;PRELOAD AC1 WITH 1
CAIE 1,1 ;PASS IF C(AC1)=1
STOP
;**********
;THIS TEST VERIFIES THAT AC2 IS ACCESSABLE.
;IN THIS CASE, AC2 IS PRELOADED WITH 2.
;C(AC2) IS THEN CHECKED FOR 2. THIS TEST PASSES IF C(AC2)=2.
;IF THIS TEST FAILS, THE AC HARDWARE IS PROBABLY FAULTY
C200: MOVEI 2,2 ;PRELOAD AC2 WITH 2
CAIE 2,2 ;PASS IF C(AC2)=2
STOP
;**********
;THIS TEST VERIFIES THAT AC4 IS ACCESSABLE.
;IN THIS CASE, AC4 IS PRELOADED WITH 4.
;C(AC4) IS THEN CHECKED FOR 4. THIS TEST PASSES IF C(AC4)=4.
;IF THIS TEST FAILS, THE AC HARDWARE IS PROBABLY FAULTY
C300: MOVEI 4,4 ;PRELOAD AC4 WITH 4
CAIE 4,4 ;PASS IF C(AC4)=4
STOP
;**********
;THIS TEST VERIFIES THAT AC10 IS ACCESSABLE.
;IN THIS CASE, AC10 IS PRELOADED WITH 10.
;C(AC10) IS THEN CHECKED FOR 10. THIS TEST PASSES IF C(AC10)=10.
;IF THIS TEST FAILS, THE AC HARDWARE IS PROBABLY FAULTY
C400: MOVEI 10,10 ;PRELOAD AC10 WITH 10
CAIE 10,10 ;PASS IF C(AC10)=10
STOP
;**********
SN=500
ZZ=-1
;THIS TEST VERIFIES THAT ALL ACS EXIST
;FIRST, EACH AC IS PRELOADED WITH ITS OWN ADDRESS;
;THEN, THE CONTENTS OF EACH AC IS CHECKED FOR ITS ADDRESS.
;IF ANY AC DOES NOT CONTAIN ITS ADDRESS, THIS TEST FAILS
C500: REPEAT ^D16,
< ZZ=ZZ+1
MOVEI ZZ,ZZ ;PRELOAD EACH AC WITH ITS ADDR>
PAGE
ZZ=20
REPEAT ^D16,<
;THIS TEST VERIFIES THAT ALL ACS EXIST.
;FIRST, EACH AC IS PRELOADED WITH ITS OWN ADDRESS;
;THEN, THE CONTENTS OF EACH AC IS CHECKED FOR ITS ADDRESS.
;IF ANY AC DOES NOT CONTAIN ITS ADDRESS, THIS TEST FAILS
SN=SN+1
ZZ=ZZ-1
CAIE ZZ,ZZ ;CHECK THAT EACH AC CONTAINS ITS OWN ADDRESS
STOP
;IN CASE OF FAILURE, LOOP TO C500 ADDRESS
;**********
>
SN=600
ZZ=0
;THIS TEST VERIFIES THAT AN ADDRESS WITHIN THE AC RANGE MAY BE ACCESSED AS
;EITHER AN AC OR A MEMORY LOCATION AND THAT EITHER REFERENCE REFERS TO THE
;SAME HARDWARE. EACH AC IS PRELOADED WITH ITS ADDRESS; THEN THE CONTENTS OF EACH
;AC IS CHECKED FOR ITS ADDRESS. IF ANY AC DOES NOT CONTAIN ITS ADDRESS, THIS TEST FAILS.
C600: REPEAT ^D15,
< ZZ=ZZ+1
MOVEI ZZ ;PRELOAD EACH AC WITH ITS ADDRESS
MOVEM ZZ ;BY REFERENCING EACH AC AS MEMORY.>
ZZ=20
REPEAT ^D15,<
;THIS TEST VERIFIES THAT AN ADDRESS WITHIN THE AC RANGE MAY BE ACCESSED AS
;EITHER AN AC OR A MEMORY LOCATION AND THAT EITHER REFERENCE REFERS TO THE
;SAME HARDWARE. EACH AC IS PRELOADED WITH ITS ADDRESS
;THEN THE CONTENTS OF EACH AC IS CHECKED FOR ITS ADDRESS.
;IF ANY AC DOES NOT CONTAIN ITS ADDRESS, THIS TEST FAILS.
SN=SN+1
ZZ=ZZ-1
CAIE ZZ,ZZ ;CHECK THAT EACH AC CONTAINS ITS OWN ADDRESS
STOP
;IN CASE OF FAILURE, LOOP TO C600 ADDRESS
;**********
>
SN=700
ZZ=0
C700: REPEAT ^D15,<
;THIS TEST VERIFIES THAT THE INDEX REGISTERS ARE ACCESSABLE.
;FIRST, AN INDEX REGISTER IS PRELOADED WITH ITS ADDRESS; THEN,
;IT IS REFERENCED AS AN INDEX REGISTER. IF IT CONTAINS ITS ADDRESS, THIS TEST PASSES.
;THIS TEST IS REPEATED 15 TIMES IN ORDER TO TEST EACH INDEX REGISTER.
SN=SN+1
ZZ=ZZ+1
MOVEI ZZ,ZZ ;PRELOAD INDEX REGISTER WITH ITS ADDRESS
CAIE ZZ,(ZZ) ;PASS IF INDEX REGISTER CONTAINS ITS ADDRESS
STOP
;**********
>
SN=1000
ZZ=0
C1000: REPEAT ^D15,<
;THIS TEST VERIFIES THAT ALL INDEX REGISTERS INDEX CORRECTLY.
;FIRST, BOTH HALVES OF THE INDEX REGISTER ARE PRELOADED WITH ITS ADDRESS.
;THEN, THE INDEX REGISTER IS REFERENCED. IT IS THEN CHECKED FOR ITS ADDRESS IN BOTH HALVES.
;IF IT CONTAINS ITS ADDRESS IN BOTH HALVES THIS TEST PASSES.
;THIS TEST IS REPEATED 15 TIMES IN ORDER TO TEST EACH INDEX REGISTER
SN=SN+1
ZZ=ZZ+1
MOVEI ZZ,ZZ ;PRELOAD BOTH HALVES OF INDEX REG WITH ITS ADDRESS
HRLI ZZ,ZZ ;PASS IF INDEX REGISTER CONTAINS ITS ADDRESS
CAME ZZ,(ZZ) ;IN BOTH HALVES
STOP
;**********
>
SUBTTL TEST OF INDEX REGISTER ADDRESSING
;**********
;THIS TEST VERIFIES THAT INDEX REGISTER ADDRESSING FUNCTIONS CORRECTLY.
;IN THIS TEST, A MOVE INSTRUCTION USING INDEXING IS EXECUTED. THE MOVE INSTRUCTION
;SHOULD PLACE THE CONTENTS OF THE LOCATION SPECIFIED BY INDEX REGISTER 2 INTO AC3.
;SINCE INDEX REGISTER 2 WAS PRELOADED WITH A 1 AND AC1 WAS PRELOADED WITH A 0,
;THE FINAL RESULT IN AC3 SHOULD BE 0. IF C(AC3)=0, THIS TEST PASSES.
C1100: SETOM 3 ;PRELOAD AC3 WITH -1,,1
SETZM 1 ;PRELOAD AC1 WITH 0
MOVEI 2,1 ;SETUP INDEX REGISTER 2 WITH 1
MOVE 3,(2) ;*FWT FROM INDEXED LOCATION
SKIPE 3 ;TEST INDEXING
STOP
;**********
SN=1200
ZZ=0
C1200: REPEAT ^D18,<
;THIS TEST VERIFIES THAT INDEX REGISTER ADDRESSING FUNCTIONS CORRECTLY.
;IN THIS TEST, A MOVE INSTRUCTION USING INDEXING IS EXECUTED. THE MOVE INSTRUCTION
;SHOULD PLACE THE CONTENTS OF THE LOCATION SPECIFIED BY INDEX REGISTER 2 INTO AC3.
;SINCE INDEX REGISTER 2 WAS PRELOADED WITH A 1 AND AC1 WAS PRELOADED WITH A
;FLOATING 1. THE FINAL RESULT IN AC3 SHOULD BE A FLOATING 1.
;IF C(AC3)=A FLOATING 1, THIS TEST PASSES.
SN=SN+1
ZZ=ZZ+ZZ
IFE ZZ,<ZZ=1>
SETOM 3 ;PRELOAD AC3 WITH -1,,-1
MOVEI 1,ZZ ;PRELOAD AC1 WITH FLOATING 1
MOVEI 2,1 ;SETUP INDEX REGISTER
MOVE 3,(2) ;*FWT FROM INDEXED LOCATION
CAIE 3,ZZ ;TEST INDEXING
STOP
;**********
>
SN=1300
ZZ=0
C1300: REPEAT ^D18,<
;THIS TEST VERIFIES THAT INDEX REGISTER ADDRESSING FUNCTIONS CORRECTLY.
;IN THIS TEST, A MOVE INSTRUCTION USING INDEXING IS EXECUTED. THE MOVE INSTRUCTION
;SHOULD PLACE THE CONTENTS OF THE LOCATION SPECIFIED BY INDEX REGISTER 2 INTO AC3.
;SINCE INDEX REGISTER 2 WAS PRELOADED WITH A 1 AND AC1 WAS PRELOADED WITH A
;FLOATING 1, THE FINAL RESULT IN AC3 SHOULD BE A FLOATING 1.
;IF C(AC3)=A FLOATING 1, THIS TEST PASSES.
SN=SN+1
ZZ=ZZ+ZZ
IFE ZZ,<ZZ=1>
SETOM 3 ;PRELOAD AC3 WITH -1,,-1
MOVSI 1,ZZ ;PRELOAD AC1 WITH FLOATING 1
MOVEI 2,1 ;SETUP INDEX REGISTER
MOVE 3,(2) ;*FWT FROM INDEXED LOCATION
CAME 3,[ZZ,,0] ;TEST INDEXING
STOP
;**********
>
;THIS TEST VERIFIES THAT INDEX REGISTER ADDRESSING FUNCTIONS CORRECTLY.
;IN THIS TEST, A MOVE INSTRUCTION USING INDEXING IS EXECUTED. THE MOVE INSTRUCTION
;SHOULD PLACE THE CONTENTS OF THE LOCATION SPECIFIED BY INDEX REGISTER 2 INTO AC3.
;SINCE INDEX REGISTER 2 WAS PRELOADED WITH A 1 AND AC1 WAS PRELOADED WITH -1,,-1,
;THE FINAL RESULT IN AC3 SHOULD BE -1,,-1. IF C(AC3)=-1,,-1, THIS TEST PASSES.
C1400: SETZM 3 ;PRELOAD AC3 WITH 0
SETOM 1 ;PRELOAD AC1 WITH -1,,-1
MOVEI 2,1 ;SETUP INDEX REGISTER
MOVE 3,(2) ;*FWT FROM INDEXED LOCATION
CAME 3,[-1,,-1] ;TEST INDEXING
STOP
;**********
SN=1500
ZZ=0
C1500: REPEAT ^D18,<
;THIS TEST VERIFIES THAT INDEX REGISTER ADDRESSING FUNCTIONS CORRECTLY.
;IN THIS TEST, A MOVE INSTRUCTION USING INDEXING IS EXECUTED. THE MOVE INSTRUCTION
;SHOULD PLACE THE CONTENTS OF THE LOCATION SPECIFIED BY INDEX REGISTER 2 INTO AC3.
;SINCE INDEX REGISTER 2 WAS PRELOADED WITH A 1 AND AC1 WAS PRELOADED WITH A
;FLOATING 0, THE FINAL RESULT IN AC3 SHOULD BE A FLOATING 0.
;IF C(AC3)=A FLOATING 0, THIS TEST PASSES.
SN=SN+1
ZZ=<ZZ+ZZ+1>&777777
IFE <ZZ-1>,<ZZ=777776>
SETZM 3 ;PRELOAD AC3 WITH 0
HRROI 1,ZZ ;PRELOAD AC1 WITH FLOATING 0
MOVEI 2,1 ;SETUP INDEX REGISTER
MOVE 3,(2) ;*FWT FROM INDEXED LOCATION
CAME 3,[-1,,ZZ] ;TEST INDEXING
STOP
;**********
>
SN=1600
ZZ=0
C1600: REPEAT ^D18,<
;THIS TEST VERIFIES THAT INDEX REGISTER ADDRESSING FUNCTIONS CORRECTLY.
;IN THIS TEST, A MOVE INSTRUCTION USING INDEXING IS EXECUTED. THE MOVE INSTRUCTION
;SHOULD PLACE THE CONTENTS OF THE LOCATION SPECIFIED BY INDEX REGISTER 2 INTO AC3.
;SINCE INDEX REGISTER 2 WAS PRELOADED WITH A 1 AND AC1 WAS PRELOADED WITH A
;FLOATING 0, THE FINAL RESULT IN AC3 SHOULD BE A FLOATING 0.
;IF C(AC3)=A FLOATING 0, THIS TEST PASSES.
SN=SN+1
ZZ=<ZZ+ZZ+1>&777777
IFE <ZZ-1>,<ZZ=777776>
SETZM 3 ;PRELOAD AC3 WITH 0
HRLOI 1,ZZ ;PRELOAD AC1 WITH FLOATING 0
MOVEI 2,1 ;SETUP INDEX REGISTER
MOVE 3,(2) ;*FWT FROM INDEXED LOCATION
CAME 3,[ZZ,,-1] ;TEST INDEXING
STOP
;**********
>
;VERIFY INDEXING WHERE 'E' IS NON-ZERO
SN=1700
ZZ=-1
XX=-10
;THIS TEST VERIFIES THAT INDEX REGISTER ADDRESSING FUNCTIONS CORRECTLY.
;IN THIS TEST, THE INDEX REG IS SET-UP WITH MOVEI ZZ+1,ZZ-XX,
;WHERE ZZ+1 IS THE INDEX REG. THE AC IS PRELOADED WITH ITS OWN ADDRESS, 0,,ZZ.
;CAIE IS USED TO TEST THE INDEXING OPERATION.
;IF THE RESULT IN C(AC)=XX+C(ZZ+1 - RIGHT), THIS TEST PASSES.
;XX+C(ZZ+1 - RIGHT) SHOULD = ZZ.
C1700: REPEAT ^D15,
<SN=SN+1
ZZ=ZZ+1
XX=XX+3
MOVEI ZZ+1,ZZ-XX ;SETUP INDEX REGISTER
MOVEI ZZ,ZZ ;PRELOAD AC WITH 0,,ZZ
CAIE ZZ,XX(ZZ+1) ;*TEST INDEXING
STOP
;**********
>
PAGE
SN=2000
ZZ=-1
XX=-20
;THIS TEST VERIFIES THAT INDEX REGISTER ADDRESSING FUNCTIONS CORRECTLY.
;IN THIS TEST, THE INDEX REG IS SET-UP WITH MOVEI ZZ+1,ZZ-XX,
;WHERE ZZ+1 IS THE INDEX REG. INDEXING IS TESTED BY LOADING
;THE AC VIA MOVEI ZZ,XX(ZZ+1), WHERE XX+C(ZZ+1)=ZZ.
;IF THE RESULT IN THE AC EQUALS 0,,ZZ, THIS TEST PASSES.
C2000: REPEAT ^D15,
<SN=SN+1
ZZ=ZZ+1
XX=XX+5
MOVEI ZZ+1,ZZ-XX ;SETUP INDEX REGISTER
MOVEI ZZ,XX(ZZ+1) ;*TEST INDEXING
CAIE ZZ,ZZ ;PASS IF C(AC)=0,,ADDRESS OF AC
STOP
;**********
>
SUBTTL TEST OF EXCH INSTRUCTION
;**********
;THIS TEST VERIFIES THAT EXCH MOVES C(E) INTO AC AND
;MOVES C(AC) INTO E.
;IN THIS CASE, AC=E=0 AND C(AC)=C(E). HENCE, THE FINAL RESULT
;IN AC0 SHOULD BE 0. IF C(AC)=0, THE TEST PASSES.
C2100: SETZ ;PRELOAD AC,E WITH 0
EXCH ;*EXCH SHOULD PLACE 0 INTO AC0
SKIPE ;PASS IF C(AC0)=0
STOP
;**********
;THIS TEST VERIFIES THAT EXCH MOVES C(E) INTO AC AND
;MOVES C(AC) INTO E.
;IN THIS CASE, AC=E=-1,,-1 AND C(AC)=C(E). HENCE, THE FINAL RESULT
;IN AC0 SHOULD BE -1,,-1. IF C(AC)=-1,,-1, THE TEST PASSES.
C2200: SETO ;PRELOAD AC,E WITH -1,,-1
EXCH ;*EXCH SHOULD PLACE -1,,-1 INTO AC0
CAME [-1] ;PASS IF C(AC0)=-1,,-1
STOP
;**********
;THIS TEST VERIFIES THAT EXCH MOVES C(E) INTO AC AND
;MOVES C(AC) INTO E.
;IN THIS CASE, C(AC)=-1,,0 AND C(E)=0,,-1. HENCE, THE FINAL RESULT
;IN THE AC SHOULD BE 0,,-1 AND THE RESULT IN E SHOULD BE -1,,0,
;IF THESE RESULTS OCCUR, THE TEST PASSES.
C2400: MOVSI -1 ;PRELOAD AC WITH -1,,0
MOVEI 1,-1 ;PRELOAD E WITH 0,,-1
EXCH 1 ;*EXCH SHOULD PLACE 0,,-1 INTO THE AC AND -1,,0 INTO E
CAME 1,[-1,,0] ;PASS IF C(E)=-1,,0
STOP
C2410: CAME 0,[0,,-1] ;PASS IF C(AC)=0,,-1
STOP
;**********
;THIS TEST VERIFIES THAT EXCH MOVES C(E) INTO AC AND
;MOVES C(AC) INTO E.
;IN THIS CASE, C(AC)=0,,-1 AND C(E)=-1,,0. HENCE, THE FINAL RESULT
;IN THE AC SHOULD BE -1,,0 AND THE RESULT IN E SHOULD BE 0,,-1.
;IF THESE RESULTS OCCUR, THE TEST PASSES.
C2700: MOVEI -1 ;PRELOAD AC WITH 0,,-1
MOVSI 1,-1 ;PRELOAD E WITH -1,,0
EXCH 1 ;*EXCH SHOULD PLACE -1,,0 INTO THE AC AND 0,,-1 INTO E
CAIE 1,-1 ;PASS IF C(E)=0,,-1
STOP
C2710: CAME ,[XWD -1,0] ;PASS IF C(AC)=-1,,0
STOP
;**********
;THIS TEST IS A RELIABILITY CHECK OF EXCH.
;FIRST, AC, E ARE PRELOADED WITH 252525,,252525. THERE, EXCH IS
;EXECUTED 7 TIMES. THE AC IS THEN CHECKED FOR 252525,,252525.
;IF C(AC)=C(E)=252525,,252525, THIS TEST PASSES.
;IN THIS TEST AC=E=AC0
C3000: MOVE [252525252525] ;PRELOAD AC,E WITH 252525,,252525
REPEAT 7,
< EXCH ;*EXCH SHOULD PLACE 252525,,252525 INTO AC0>
CAME [252525252525] ;PASS IF C(AC0)=252525,,252525
STOP
;**********
PAGE
;THIS TEST VERIFIES THAT EXCH MOVES C(AC) INTO E AND C(E) INTO THE AC.
;IN THIS CASE, C(AC)=0 AND C(E)=-1,,-1. EXCH IS EXECUTED 7 TIMES; THEN,
;THE AC IS CHECKED FOR -1,,-1 AND E IS CHECKED FOR 0. IF EITHER OF THESE
;RESULTS ARE NOT FOUND, THIS TEST FAILS.
C3100: SETZ ;PRELOAD AC WITH 0
SETO 1,0 ;PRELOAD E WITH -1,,-1
REPEAT 7,
< EXCH 1 ;*EXCH SHOULD EXCHANGE C(AC) AND C(E)>
CAME [-1] ;PASS IF C(AC)=-1,,-1
STOP
C3110: CAME 1,[0] ;PASS IF C(E)=0
STOP
;**********
SUBTTL TEST OF MOVEM INSTRUCTION
;THIS TEST VERIFIES THAT MOVEM PLACES C(AC) INTO E AND DOES NOT MODIFY C(AC)
;IN THIS CASE, C(AC)=-1,,-1 AND C(E)=0. HENCE, THE RESULT IN AC AND E SHOULD
;BE -1,,-1. IF C(AC) AND C(E)=-1,,-1, THIS TEST PASSES
C3200: SETO ;PRELOAD AC WITH -1,,-1
SETZ 1,0 ;PRELOAD E WITH 0
MOVEM 1 ;*MOVEM SHOULD PLACE -1,,-1 INTO E
CAME 1,[-1] ;PASS IF C(E)=-1,,-1
STOP
C3210: CAME 0,[-1] ;PASS IF C(AC)=-1,,-1
STOP
;**********
SUBTTL TEST OF JFCL INSTRUCTION AND ARITHMETIC FLAGS
;**********
;THIS TEST VERIFIES THAT JFCL 17,.+1 ALWAYS RETURNS TO THE NEXT SEQUENTIAL INSTRUCTION
;IF JFCL SKIPS THE NEXT INSTRUCTION, THIS TEST FAILS
C3300: MOVE [HALT .+3] ;THIS INSTRUCTION SHOULD NOT AFFECT THE TEST
JFCL 17,.+1 ;*JFCL SHOULD RETURN TO NEXT SEQUENTIAL INSTRUCTION
CAIA ;SKIP HALT INSTRUCTION IF JFCL PASSES
STOP
;**********
;THIS TEST VERIFIES THAT JFCL 17,.+1 ALWAYS CLEARS THE CRY0 FLAG.
;ADDI IS USED TO SET CRY0. THEN, JFCL 17,.+1 IS EXECUTED TO CLEAR CRY0.
;JFCL 4,.+2 IS EXECUTED TO DETERMINE WHETHER CRY0 WAS RESET BY THE PREVIOUS JFCL.
;THIS TEST FAILS IF JFCL 17,.+1 DID NOT CLEAR CRY0
C3400: MOVE [-1] ;PRELOAD AC WITH -1,,-1
ADDI 1 ;SET CRY0 FLAG
JFCL 17,.+1 ;*CLEAR ARITHMETIC FLAGS
JFCL 4,.+2 ;PASS IF CRY0 WAS RESET BY PREVIOUS INSTRUCTION
SKIPA ;SKIP HALT IF CRY0 WAS CLEARED
STOP
;**********
;THIS TEST VERIFIES THAT JFCL 17,.+1 ALWAYS CLEARS THE CRY1 FLAG.
;ADDI IS USED TO SET CRY1. THEN, JFCL 17,.+1 IS EXECUTED TO CLEAR CRY1.
;JFCL 4,.+2 IS EXECUTED TO DETERMINE WHETHER CRY1 WAS RESET BY THE PREVIOUS JFCL.
;THIS TEST FAILS IF JFCL 17,.+1 DID NOT CLEAR CRY1
C3500: MOVE [-1] ;PRELOAD AC WITH -1,,-1
ADDI 1 ;SET CRY1 FLAG
JFCL 17,.+1 ;*CLEAR ARITHMETIC FLAGS
JFCL 2,.+2 ;PASS IF CRY1 WAS RESET BY PREVIOUS INSTRUCTION
SKIPA ;SKIP HALT IF CRY1 WAS CLEARED
STOP
;**********
;THIS TEST VERIFIES THAT JFCL 17,.+1 ALWAYS CLEARS THE AROV FLAG.
;ADDI IS USED TO SET AROV. THEN, JFCL 17,.+1 IS EXECUTED TO CLEAR AROV.
;JFCL 4,.+2 IS EXECUTED TO DETERMINE WHETHER AROV WAS RESET BY THE PREVIOUS JFCL.
;THIS TEST FAILS IF JFCL 17,.+1 DID NOT CLEAR AROV
C3600: MOVSI 400000 ;PRELOAD AC WITH -1,,-1
ADD [XWD 400000,0] ;SET AROV FLAG
JFCL 17,.+1 ;*CLEAR ARITHMETIC FLAGS
JFCL 10,.+2 ;PASS IF AROV WAS RESET BY PREVIOUS INSTRUCTION
SKIPA ;SKIP HALT IF AROV WAS CLEARED
STOP
;**********
;THIS TEST VERIFIES THAT JFCL 0, IS A NO-OP.
;IN THIS TEST, ADD IS USED TO SET CRY0. THEN JFCL 0,.+2 IS EXECUTED.
;IF JFCL 0,.+2 DOES NOT SKIP THE NEXT INSTRUCTION, THIS TEST PASSES
C3700: MOVSI 400000 ;PRELOAD AC WITH MOST NEGATIVE NUMBER
ADD [-1] ;SET CRY0 FLAG
JFCL .+2 ;*JFCL SHOULD RETURN TO NEXT SEQUENTIAL INSTRUCTION
SKIPA ;PASS IF JFCL DID NOT SKIP
STOP
;**********
;THIS TEST VERIFIES THAT JFCL 0, IS A NO-OP.
;IN THIS TEST, ADD IS USED TO SET CRY1. THEN JFCL 0,.+2 IS EXECUTED.
;IF JFCL 0,.+2 DOES NOT SKIP THE NEXT INSTRUCTION, THIS TEST PASSES
C4000: MOVSI 200000 ;PRELOAD AC WITH MOST NEGATIVE NUMBER
ADD [XWD 200000,0] ;SET CRY1 FLAG
JFCL .+2 ;*JFCL SHOULD RETURN TO NEXT SEQUENTIAL INSTRUCTION
SKIPA ;PASS IF JFCL DID NOT SKIP
STOP
;**********
;THIS TEST VERIFIES THAT ADDI HAS THE ABILITY TO SET AN ARITHMETIC FLAG AND
;THAT 'JFCL 17,.+2' JUMPS WHENEVER ANY ARITHMETIC FLAG IS SET.
;IN THIS TEST, ADDI SHOULD SET CRY0 AND CRY1. THEN, JFCL SHOULD SKIP
;BECAUSE A FLAG WAS SET BY ADDI
;IF THIS TEST FAILS, ADDI COULD HAVE FAILED TO SET A FLAG OR
;JFCL COULD HAVE FAILED TO JUMP WHEN A FLAG WAS SET
C4100: MOVE [-1] ;PRELOAD AC WITH ALL ONES
ADDI 1 ;*ADDI SHOULD SET CRY0/1 FLAGS
JFCL 17,.+2 ;*JFCL SHOULD JUMP BECAUSE FLAGS ARE SET
STOP
;**********
;THIS TEST VERIFIES THAT CAI DOES NOT CLEAR ANY ARITHMETIC FLAGS.
;FIRST, CRY0 AND CRY1 ARE SET BY ADDI; THEN CAI IS EXECUTED.
;JFCL SHOULD JUMP BECAUSE FLAGS ARE SET. IF JFCL DOES NOT JUMP,
;THE FLAGS WERE CLEARED BY CAI. HENCE, CAI FAILED
C4200: MOVE [-1] ;PRELOAD AC WITH -1,,-1
ADDI 1 ;SET CYR0/1 FLAGS
CAI 17,17 ;*CAI SHOULD NOT CLEAR FLAGS
JFCL 17,.+2 ;PASS IF CAI CLEARED FLAGS
STOP
;**********
;THIS TEST VERIFIES THAT ADDI HAS THE ABILITY TO SET AN ARITHMETIC FLAG AND
;THAT 'JFCL 17,.+2' JUMPS WHENEVER ANY ARITHMETIC FLAG IS SET.
;IN THIS TEST, ADDI SHOULD SET CRY0 AND CRY1. THEN JFCL SHOULD SKIP
;BECAUSE A FLAG WAS SET BY ADDI
;IF THIS TEST FAILS, ADDI COULD HAVE FAILED TO SET A FLAG OR
;JFCL COULD HAVE FAILED TO JUMP WHEN A FLAG WAS SET
C4300: MOVE [-1] ;PRELOAD AC WITH ALL ONES
ADDI 1 ;*ADDI SHOULD SET CRY1 FLAGS
JFCL 2,.+2 ;*JFCL SHOULD JUMP BECAUSE CRY1 FLAG IS SET
STOP
;**********
;THIS TEST VERIFIES THAT ADDI HAS THE ABILITY TO SET AN ARITHMETIC FLAG AND
;THAT 'JFCL 17,.+2' JUMPS WHENEVER ANY ARITHMETIC FLAG IS SET.
;IN THIS TEST, ADDI SHOULD SET CRY0 AND CRY1. THEN, JFCL SHOULD SKIP
;BECAUSE A FLAG WAS SET BY ADDI
;IF THIS TEST FAILS, ADDI COULD HAVE FAILED TO SET A FLAG OR
;JFCL COULD HAVE FAILED TO JUMP WHEN A FLAG WAS SET
C4400: MOVE [-1] ;PRELOAD AC WITH ALL ONES
ADDI 1 ;*ADDI SHOULD SET CRY0 FLAG
JFCL 4,.+2 ;*JFCL SHOULD JUMP BECAUSE CRY0 FLAG IS SET
STOP
;**********
;THIS TEST VERIFIES THAT ADDI HAS THE ABILITY TO SET AN ARITHMETIC FLAG AND
;THAT 'JFCL 17,.+2' JUMPS WHENEVER ANY ARITHMETIC FLAG IS SET.
;BECAUSE A FLAG WAS SET BY ADD
;IF THIS TEST FAILS, ADDI COULD HAVE FAILED TO SET A FLAG OR
;JFCL COULD HAVE FAILED TO JUMP WHEN A FLAG WAS SET
C4500: MOVSI 400000 ;PRELOAD AC WITH ALL ONES
ADD [XWD 400000,0] ;*ADD SHOULD SET AROV FLAG
JFCL 10,.+2 ;*JFCL SHOULD JUMP BECAUSE AROV FLAG IS SET
STOP
;**********
;THIS TEST VERIFIES THAT JFCL 17,.+1 ALWAYS CLEARS THE FLOATING OVERFLOW FLAG (FOV).
;FIRST JFCL 17,.+1 IS EXECUTED TO CLEAR FOV. THEN, JFCL 1,.+2 IS EXECUTED TO DETERMINE
;WHETHER FOV WAS CLEARED. IF FOV WAS CLEAR, THIS TEST PASSES
C4600: JFCL 17,.+1 ;*CLEAR ARITHMETIC FLAGS
JFCL 1,.+2 ;PASS IF FOV WAS CLEARED
SKIPA ;SKIP HALT IF TEST PASSED
STOP
;**********
;THIS TEST VERIFIES THAT JFCL 13, DOES NOT RESET CRY0.
;FIRST CRY0 AND CRY1 ARE SET BY ADDI; THEN, JFCL 13,.+2 IS EXECUTED
;TO CLEAR ALL ARITHMETIC FLAGS EXCEPT CRY0.
;THIS TEST PASSES IF JFCL 13,.+1 DID NOT RESET CRY0.
C4700: MOVE [-1] ;RELOAD AC WITH -1,,-1
ADDI 1 ;SET CRY0/1
JFCL 13,.+1 ;*JFCL 13, SHOULD NOT RESET CRY0
JFCL 4,.+2 ;FAIL IF CRY 0 WAS RESET
STOP
;**********
;THIS TEST VERIFIES THAT JFCL 15, DOES NOT RESET CRY1.
;FIRST CRY0 AND CRY1 ARE SET BY ADDI; THEN, JFCL15,.+2 IS EXECUTED
;TO CLEAR ALL ARITHMETIC FLAGS EXCEPT CRY1.
;THIS TEST PASSES IF JFCL 15,.+1 DID NOT RESET CRY1.
C5000: MOVE [-1] ;PRELOAD AC WITH -1,,-1
ADDI 1 ;SET CRY0/1
JFCL 15,.+1 ;*JFCL15, SHOULD NOT RESET CRY0
JFCL 2,.+2 ;FAIL IF CRY1 WAS RESET
STOP
;**********
;THIS TEST VERIFIES THAT JFCL 17, DOES NOT RESET AROV.
;FIRST AROV IS SET BY ADD; THEN, JFCL 17,.+2 IS EXECUTED
;TO CLEAR ALL ARITHMETIC FLAGS EXCEPT AROV.
;THIS TEST PASSES IF JFCL 17,.+1 DID NOT RESET AROV.
C5100: MOVSI 400000 ;PRELOAD AC WITH -1,,-1
ADD [XWD 400000,0] ;SET AROV
JFCL 7,.+1 ;*JFCL 17, SHOULD NOT RESET AROV
JFCL 10,.+2 ;FAIL IF AROV WAS RESET
STOP
;**********
;THIS TEST VERIFIES THAT ADD OF 0 TO 0 WILL NOT SET AROV.
;FIRST, ALL FLAGS ARE RESET, THEN 0 IS ADDED TO 0 VIA ADD.
;AROV IS THEN CHECKED. IF AROV IS SET, THIS TEST FAILS.
C5200: JFCL 17,.+1 ;RESET ARITHMETIC FLAGS
SETZ ;PRELOAD AC,E WITH 0
ADD ;*ADD SHOULD NOT SET AROV
JFCL 10,.+2 ;PASS IF AROV WAS RESET
SKIPA ;SKIP HALT IF ADD PASSED
STOP
;**********
;THIS TEST VERIFIES THAT ADD OF 0 TO 0 WILL NOT SET CRY0.
;FIRST, ALL FLAGS ARE RESET, THEN 0 IS ADDED TO 0 VIA ADD.
;CRY0 IS THEN CHECKED. IF CRY0 IS SET, THIS TEST FAILS.
C5300: SETZ ;RESET ARITHMETIC FLAGS
JFCL 17,.+1 ;PRELOAD AC,E WITH 0
ADD ;*ADD SHOULD NOT SET CRY0
JFCL 4,.+2 ;PASS IF CRY0 WAS RESET
SKIPA ;SKIP HALT IF ADD PASSED
STOP
;**********
;THIS TEST VERIFIES THAT ADD OF 0 TO 0 WILL NOT SET CRY1.
;FIRST, ALL FLAGS ARE RESET, THEN 0 IS ADDED TO 0 VIA ADD.
;CRY1 IS THEN CHECKED. IF CRY1 IS SET, THIS TEST FAILS.
C5400: SETZ ;RESET ARITHMETIC FLAGS
JFCL 17,.+1 ;PRELOAD AC,E WITH 0
ADD ;*ADD SHOULD NOT SET CRY1
JFCL 2,.+2 ;PASS IF CRY1 WAS RESET
SKIPA ;SKIP HALT IF ADD PASSED
STOP
;**********
;THIS TEST VERIFIES THAT THE 30X AND THE 31X INSTRUCTION GROUPS DO NOT AFFECT
;THE ARITHMETIC FLAGS. FIRST, THE FLAGS ARE CLEARED AND AC0 IS CLEARED; THEN, CAI
;AND CAM ARE EXECUTED. THE FLAGS ARE THEN CHECKED. IF ANY OF THE FLAGS ARE SET,
;THIS TEST FAILS AND CAI OR CAM IS CONSIDERED TO HAVE ERRONEOUSLY SET THE FLAGS
C5500: JFCL 17,.+1 ;CLEAR ALL FLAGS
SETZ ;CLEAR AC,0
CAI ;*CAI SHOULD NOT SET ANY ARITHMETIC FLAG
CAM [-1] ;*CAM SHOULD NOT SET ANY ARITHMETIC FLAG
JFCL 17,.+2 ;FAIL IF ANY FLAG WAS SET
SKIPA ;SKIP HALT IF TEST PASSED
STOP
;**********
;THIS TEST VERIFIES THAT THE BOOLEAN INSTRUCTION GROUPS DO NOT AFFECT
;THE ARITHMETIC FLAGS. FIRST THE FLAGS ARE CLEARED AND AC0 IS CLEARED; THEN, XOR [0]
;AND XOR [-1] ARE EXECUTED. THE FLAGS ARE THEN CHECKED. IF ANY OF THE FLAGS ARE SET,
;THIS TEST FAILS AND XOR IS CONSIDERED TO HAVE ERRONEOUSLY SET THE FLAGS
C5600: JFCL 17,.+1 ;CLEAR ALL FLAGS
SETO ;CLEAR AC,0
XOR [0] ;*XOR SHOULD NOT SET ANY ARITHMETIC FLAG
XOR [-1] ;*XOR SHOULD NOT SET ANY ARITHMETIC FLAG
JFCL 17,.+2 ;FAIL IF ANY FLAG WAS SET
SKIPA ;SKIP HALT IF TEST PASSED
STOP
;**********
;THIS TEST VERIFIES THAT THE AOBJX INSTRUCTION GROUP DOES DO NOT AFFECT
;THE ARITHMETIC FLAGS. FIRST THE FLAGS ARE CLEARED AND AC0 IS CLEARED; THEN, AOBJN
;AND AOBJP ARE EXECUTED. THE FLAGS ARE THEN CHECKED. IF ANY OF THE FLAGS ARE SET,
;THIS TEST FAILS AND AOBJN OR AOBJP IS CONSIDERED TO HAVE ERRONEOUSLY SET THE FLAGS
C5700: SETO ;CLEAR ALL FLAGS
JFCL 17,.+1 ;CLEAR AC,0
AOBJN .+1 ;*AOBJN SHOULD NOT SET ANY ARITHMETIC ARITHMETIC
AOBJP .+1 ;*AOBJP SHOULD NOT SET ANY ARITHMETIC FLAG
JFCL 17,.+2 ;FAIL IF ANY FLAG WAS SET
SKIPA ;SKIP HALT IF TST PASSED
STOP
;**********
;THIS TEST VERIFIES THAT SKIP DOES NOT AFFECT THE FLAGS.
;FIRST, THE ARITHMETIC FLAGS ARE CLEARED; THEN, SKIP IS EXECUTED.
;IF SKIP SETS AROV, CRYO, CRY1 OR FOV, THIS TEST FAILS.
C5701: JFCL 17,.+1 ;CLEAR ALL FLAGS
SKIP 0,[-1] ;*SKIP SHOULD NOT SET ANY FLAGS
JFCL 17,.+2 ;FAIL IF ANY FLAG IS SET
SKIPA ;PASS IF NO FLAG IS SET
STOP
;**********
;THIS TEST VERIFIES THAT JUMP DOES NOT AFFECT THE FLAGS.
;FIRST, THE ARITHMETIC FLAGS ARE CLEARED; THEN, JUMP IS EXECUTED.
;IF JUMP SETS AROV, CRYO, CRY1 OR FOV, THIS TEST FAILS.
C5702: JFCL 17,.+1 ;CLEAR ALL FLAGS
JUMP 0,[-1] ;*JUMP SHOULD NOT SET ANY FLAGS
JFCL 17,.+2 ;FAIL IF ANY FLAG IS SET
SKIPA ;PASS IF NO FLAG IS SET
STOP
;**********
SUBTTL TEST OF JRST INSTRUCTION AND ARITHMETIC FLAGS
;**********
;THIS TEST VERIFIES THAT 'JRST, 0' DOES NOT SET ANY FLAGS.
;FIRST THE ARITHMETIC FLAGS ARE RESET; THEN, 'JRST 0,.+1' IS EXECUTED
;THE AROV,CRY0 AND CRY1 FLAGS ARE THEN CHECKED. IF ANY
;OF THESE FLAGS ARE SET, THIS TEST FAILS
C6000: JFCL 17,.+1 ;RESET ALL FLAGS
JRST .+1 ;*JRST SHOULD NOT SET ANY FLAGS
JFCL 16,.+2 ;PASS IF NO FLAGS ARE SET
SKIPA ;SKIP HALT IF JRST PASSES
STOP
;**********
;THIS TEST VERIFIES THAT 'MOVE 2,2' DOES NOT SET ANY FLAGS.
;FIRST, THE ARITHMETIC FLAGS ARE RESET; THEN, 'MOVE 2,2' IS EXECUTED.
;THE FOV,AROV,CRY0 AND CRY1 FLAGS ARE THEN CHECKED. IF ANY
;OF THESE FLAGS ARE SET, THIS TEST FAILS
C6100: JFCL 17,.+1 ;RESET ALL FLAGS
MOVE 2,2 ;*MOVE SHOULD NOT SET ANY FLAGS
JFCL 17,.+2 ;PASS IF NO FLAGS ARE SET
SKIPA ;SKIP HALT IF MOVE PASSED
STOP
;**********
;THIS TEST VERIFIES THAT JRST 2,.+1(1) WILL SET THE ARITHMETIC FLAG
;SPECIFIED IN AC1. IN THIS CASE, AC1 SPECIFIES THE CRY0 FLAG.
;FIRST, ALL FLAGS ARE RESET; THEN AC1 IS SET TO SPECIFY CRY0.
;NEXT, JRST 2,.+1(1) IS EXECUTED TO SET CRY0. CRY0 IS THEN CHECKED. IF
;CRY0 IS SET, THIS TEST PASSES. OTHERWISE, JRST 2,.+1 IS FAULTY
C6200: JFCL 17,.+1 ;CLEAR ALL FLAGS
SFLAG CRY0 ;SET CRY0 FLAG
JFCL 4,.+2 ;PASS IF CRY0 IS SET
STOP
;**********
;THIS TEST VERIFIES THAT JRST 2,.+(1) WILL SET THE ARITHMETIC FLAG
;SPECIFIED IN AC1. IN THIS CASE, AC1 CONTAIN 0. HENCE, JRST 2,.+1(1)
;SHOULD RESET THE ARITHMETIC FLAGS. FIRST, THE CRY0/1, FLAGS ARE SET BY ADDI;
;THEN THE FLAGS SHOULD BE CLEARED BY JRST 2,.+1. IF CRY1 WAS CLEARED, THE
;TEST PASSES. OTHERWISE, JRST 2,.+1 IS FAULTY
C6300: MOVE [-1] ;PRELOAD AC0 WITH -1,,-1
ADDI 1 ;SET CRY0/1 FLAGS
SFLAG 0 ;RESET ALL ARITHMETIC FLAGS
JFCL 2,.+2 ;PASS IF CRY1 IS RESET
SKIPA ;SKIP HALT INSTRUCTION IF TEST PASSED
STOP
;**********
;THIS TEST VERIFIES THAT JRST 2,.+(1) WILL SET THE ARITHMETIC FLAG
;SPECIFIED IN AC1. IN THIS CASE, AC1 CONTAIN 0. HENCE, JRST 2,.+1(1)
;SHOULD RESET THE ARITHMETIC FLAGS. FIRST, THE CRY0/1, FLAGS ARE SET BY ADD
;THEN THE FLAGS SHOULD BE CLEARED BY JRST 2,.+1. IF AROV WAS CLEARED, THE
;TEST PASSES. OTHERWISE, JRST 2,.+1 IS FAULTY
C6400: MOVSI 400000 ;PRELOAD AC0 WITH -1,,-1
ADD [-1] ;SET CRY0 AND AROV FLAGS
SFLAG 0 ;RESET ALL ARITHMETIC FLAGS
JFCL 10,.+2 ;PASS IF AROV IS RESET
SKIPA ;SKIP HALT INSTRUCTION IF TEST PASSED
STOP
;**********
;THIS TEST VERIFIES THAT JRST 2,.+1(1) WILL SET THE ARITHMETIC FLAG
;SPECIFIED IN AC1. IN THIS CASE, AC1 SPECIFIES THE AROV FLAG.
;FIRST, ALL FLAGS ARE RESET; THEN AC1 SET TO SPECIFY AROV.
;NEXT, JRST 2,.+1(1) IS EXECUTED TO SET AROV. AROV IS THEN CHECKED. IF
;AROV IS SET, THIS TEST PASSES. OTHERWISE, JRST 2,.+1 IS FAULTY
C6500: SFLAG AROV ;SET AROV FLAG
JFCL 10,.+2 ;PASS IF AROV WAS SET
STOP
;**********
;THIS TEST VERIFIES THAT JRST 2,.+1(1) WILL SET THE ARITHMETIC FLAG
;SPECIFIED IN AC1. IN THIS CASE, AC1 SPECIFIES THE CRY1 FLAG.
;FIRST, ALL FLAGS ARE RESET; THEN AC1 SET TO SPECIFY CRY1.
;NEXT, JRST 2,.+1(1) IS EXECUTED TO SET CRY1. CRY1 IS THEN CHECKED. IF
;CRY1 IS SET, THIS TEST PASSES. OTHERWISE, JRST 2,.+1 IS FAULTY
C6600: SFLAG CRY1 ;SET CRY1 FLAG
JFCL 2,.+2 ;PASS IF CRY1 WAS SET
STOP
;**********
;THIS TEST VERIFIES THAT JRST 2,.+1(1) WILL SET THE ARITHMETIC FLAG
;SPECIFIED IN AC1. IN THIS CASE, AC1 SPECIFIES THE FOV FLAG.
;FIRST, ALL FLAGS ARE RESET; THEN AC1 SET TO SPECIFY FOV.
;NEXT, JRST 2,.+1(1) IS EXECUTED TO SET FOV. FOV IS THEN CHECKED. IF
;FOV IS SET, THIS TEST PASSES. OTHERWISE, JRST 2,.+1 IS FAULTY
C6700: SFLAG FOV ;SET FOV FLAG
JFCL 1,.+2 ;PASS IF FOV WAS SET
STOP
;**********
;THIS TEST VERIFIES THAT JFCL 0, SHOULD NEVER JUMP.
;FIRST, FOV IS SET VIA JRST2, ;THEN JFCL 0,
;IS EXECUTED. IF JFCL 0, DOES NOT SKIP, THIS TEST PASSES
C7000: SFLAG FOV ;SET FOV FLAG
JFCL ,.+2 ;*JFCL SHOULD NOT JUMP
SKIPA ;PASS IF JFCL DID NOT JUMP
STOP
;**********
;THIS TEST VERIFIES THAT JRST 2,.+1(1) WILL SET THE ARITHMETIC FLAG
;SPECIFIED IN AC1. IN THIS CASE, AC1 CONTAINS 0. HENCE, JRST 2,.+1(1)
;SHOULD RESET THE ARITHMETIC FLAGS. FIRST, THE CRY0, FLAG IS SET BY JRST 2,.+1(1)
;WITH C(AC1)=CRY0. THEN, THE FLAGS SHOULD BE CLEARED BY JRST 2,.+1 WITH C(AC1)=0.
;IF CRY0 WAS CLEARED, THE TEST PASSES. OTHERWISE, JRST 2,.+1 IS FAULTY
C7100: SFLAG CRY0 ;SET CRY0 FLAGS
SETZ 1, ;SETUP MASK TO CLEAR ARITHMETIC FLAGS
JRST 2,.+1(1) ;*RESET ARITHMETIC FLAGS
JFCL 4,.+2 ;PASS IF CRY0 FLAG WAS RESET
SKIPA ;SKIP HALT INSTRUCTION IF TEST PSSED
STOP
;**********
;THIS TEST VERIFIES THAT JRST 2,.+1(1) WILL SET THE ARITHMETIC FLAG
;SPECIFIED IN AC1. IN THIS CASE, AC1 CONTAINS 0. HENCE, JRST 2,.+1(1)
;SHOULD RESET THE ARITHMETIC FLAGS. FIRST, THE FOV, FLAG IS SET BY JRST 2,.+1(1)
;WITH C(AC1)=FOV. THEN, THE FLAGS SHOULD BE CLEARED BY JRST 2,.+1 WITH C(AC1)=0.
;IF FOV WAS CLEARED, THE TEST PASSES. OTHERWISE, JRST 2,.+1 IS FAULTY
C7200: SFLAG FOV ;SET FOV FLAG
SETZ 1, ;SETUP MASK TO CLEAR ARITHMETIC FLAGS,
JRST 2,.+1(1) ;*RESET ARITHMETIC FLAGS
JFCL 1,.+2 ;PASS IF FOV FLAG WAS RESET
SKIPA ;SKIP HALT INSTRUCTION IF TEST PSSED
STOP
;**********
;THIS TEST VERIFIES THAT JRST 2,.+1(1) WILL SET THE ARITHMETIC FLAG
;SPECIFIED IN AC1. IN THIS CASE, AC1 CONTAINS 0. HENCE, JRST 2,.+1(1)
;SHOULD RESET THE ARITHMETIC FLAGS. FIRST, THE ARITHMETIC FLAGS ARE RESET BY
;JFCL 17,.+1. THEN, THE FLAGS SHOULD BE CLEARED BY JRST 2,.+1.
;IF ALL THE ARITHMETIC FLAGS WERE CLEARED,
;THE TEST PASSES. OTHERWISE, JRST 2,.+1 IS FAULTY
C7300: JFCL 17,.+1 ;CLEAR FLAGS
SETZ 1, ;SETUP MASK TO CLEAR ARITMETIC FLAGS
JRST 2,.+1(1) ;*RESET ARITHMETIC FLAGS
JFCL 17,.+2 ;PASS IF ALL FLAGS ARE RESET
SKIPA ;SKIP HALT INSTRUCTION IF TEST PASSED
STOP
;**********
SUBTTL TEST OF JSP INSTRUCTION
;**********
;THIS TEST VERIFIES THAT JSP ALWAYS STORES THE FLAGS AND PC IN THE AC.
;IN THIS CASE, THE FLAGS ARE RESET; THEN, JSP IS EXECUTED. THE AC IS THEN
;CHECKED FOR ITS CONTENTS NON-ZERO. IF C(AC)=0, IT INDICATES
;THAT NEITHER THE FLAGS NOR THE PC WAS SAVED. HENCE, THIS TEST FAILS.
C7400: SETZB 1 ;CLEAR AC AND SETUP MASK TO RESET FLAGS
JRST 2,.+1(1) ;RESET FLAGS
JSP .+1 ;*JSP SHOULD STORE FLAGS AND PC IN THE AC
SKIPN ;PASS IF C(AC) IS NON-ZERO
STOP ;IT DID NOT STORE ANY FLAGS OR PC
;**********
;THIS TEST VERIFIES THAT JSP ALWAYS STORES THE PC IN THE RIGHT HALF OF THE AC.
;IN THIS CASE, THE AC IS CLEARED, THEN, JSP IS EXECUTED. THE RIGHT HALF OF
;THE AC IS THEN CHECKED FOR ITS CONTENTS NON-ZERO. IF C(AC RIGHT HALF)
;IS NON-ZERO, IT INDICATED THAT THE PC WAS SAVED; AND THIS TEST PASSES.
C7500: SETZ ;CLEAN AC
JSP .+1 ;*JSP SHOULD STORE THE PC IN THE AC
TRNN -1 ;PASS IF C(AC) IN NON-ZERO
STOP
;**********
;THIS TEST VERIFIES THAT JSP ALWAYS STORES THE FLAGS IN THE LEFT HALF OF THE AC.
;FIST, THE AC IS CLEARED; THEN, SOME FLAGS ARE SET AND JSP IS EXECUTED.
;THE LEFT HALF OF THE AC IS CHECKED FOR ITS CONTENTS NON-ZERO TO DETERMINE
;WHETHER THE FLAGS WERE SAVED. IF C(AC-LEFT) IS NON-ZERO, THIS TEST PASSES
C7600: SETZM 0 ;CLEAR AC
MOVSI 1,740000 ;SET UP MASK TO SET FLAGS
JRST 2,.+1(1) ;SET SOME ARITHMETIC FLAGS
JSP .+1 ;*JSP SHOULD STORE FLAGS IN THE AC
TLNN -1 ;PASS IF C(AC) IS NON-ZERO
STOP
;**********
;THIS TEST VERIFIES THAT JSP ALWAYS STORES THE FLAGS IN THE LEFT HALF OF THE AC.
;FIRST, THE AC IS CLEARED; THEN, THE AROV FLAG IS SET AND JSP IS EXECUTED.
;THEN, THE AROV FLAG BIT OF
;THE LEFT HALF OF THE AC IS CHECKED FOR ITS CONTENTS NON-ZERO TO DETERMINE
;WHETHER THE AROV FLAG WAS SAVED. IF THE AROV FLAG BIT OF THE AC IS SET, THIS TEST PASSES
C7700: SETZM 0 ;CLEAR THE AC
SFLAG AROV ;SET AROV FLAG
JSP .+1 ;*JSP SHOULD SAVE THE FLAGS IN THE AC-LEFT
TLNN AROV ;PASS IF AROV WAS SAVED
STOP
;**********
;THIS TEST VERIFIES THAT JSP ALWAYS STORES THE FLAGS IN THE LEFT HALF OF THE AC.
;FIRST, THE AC IS CLEARED; THEN, THE CRY0 FLAG IS SET AND JSP IS EXECUTED.
;THEN, THE CRY0 FLAG BIT OF
;THE LEFT HALF OF THE AC IS CHECKED FOR ITS CONTENTS NON-ZERO TO DETERMINE
;WHETHER THE CRY0 FLAG WAS SAVED. IF THE CRY0 FLAG BIT OF THE AC IS SET, THIS TEST PASSES
C10000: SETZM 0 ;CLEAR THE AC