-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathfkaca0.mac
2565 lines (2553 loc) · 77.1 KB
/
fkaca0.mac
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
;
; IDENTIFICATION
; --------------
; Product code: MAINDEC-11-DFKAC-A-D
; Product name: 11/34 EIS Instruction Test
; Date: Dec-1975
; Maintainer: Diagnostic Group
; Author: Glenn Jonhson
;
; Ccopyright (c) 1975
; Digital Equipment Corporation, Maynard, Mass.
;
; This software is furnished under a license for use only
; on a single computer system and may be copied only with
; the inclusion of the above copyright notice. This software,
; or any other copies thereof, may not be provided
; or otherwise made available to any other person except
; for use on such system and to one who agrees to these
; license terms. Title to and ownership of the software
; shall at all times remain in DEC.
;
; The information in.this document is subject to change
; without notice and should not be construed as a commit-
; ment by Digital Equipment Corporation,
;
; DEC assumes no responsibility for the use or reliability
; of its software on equipment which is not supplied by
; DEC.
;
;
; CONTENTS
;
; 1. Abstract
; 2. Requirements
; 2.1 Equipment
; 2.2 Storage
; 2.3 Preliminary programs
; 3. Loading procedure
; 4. Starting procedure
; 4.1 Control switch settings
; 4.2 Starting address
; 4.3 Program and/or operator action
; 5. Operating procedure
; 5.1 Switch settings
; 5.2 Subroutine abstracts
; 6. Errors
; 6.1 Error printout
; 6.2 Error recovery
; 7. Restrictions
; 8. Miscellaneous
; 8.1 Execution time
; 8.2 Stack pointer
; 8.3 Pass counter
; 8.4 Test number
; 8.5 Power fail
; 9. Program description
;
; 1. Abstract
;
; This program tests the 11/34 extended instruction set
; (ash, ashc, mul, and div) using registers 0-5 at-least
; once with each instruction. The program should be run for
; at least 2 passes with all switches low, the program is
; designed to run under apt, and act, systems.
;
; This program is a modification of the ls1-11 eis test,
; it has been modified to account for any lsi-11 - 11/34 differences.
;
;
; 2. Requirements
; 2.1 Equipment
;
; 11/34 standard computer and 4kW of memory
;
; 2.2 Storage
;
; Program storage - the routines use memory 0 - 17500
;
; 2.3 Preliminary programs
;
; none
;
; 3. Loading procedure
;
; Use standard procedure for ABS tapes,
;
; 4. Starting procedure
; 4.1 Control switch settings
;
; See 5.1 (all low for worst case testing)
;
; 4.2 Starting address
;
; After loading the program it should always be started at 200,
; if it is desired to save the pass counter then the program
; should be restarted at location restrt (i.e. 222j otherwise the
; program can be restarted at 200
;
; 4.3 Program and/or operator action
; 4.3.1 Stand alone
;
; 1) Load program into memory using ABS loader,
; 2) Set switches (see sec 5.1) all low for worst case,
; 3) Start at 200.
; 4) The program will loop and "END PASS" will be typed after
; completion of first pass and every 4th pass, however type
; out will be suppressed if bit 5 of location $envm is high
; 5) A minimum of two passes should always be run,
;
; 4.3.2 Under APT
;
; Load the program and start after setting the desired switches
; (see sec. 5.1).
;
; 5. Operating procedure
; 5.1 Switch settings
;
; If no hardware switch register is available, the program
; automatically uses the contents of loc. 176 as the software
; switch register. the user should set this location before
; starting the program,
;
; bit # octal value function
;
; 15 100000......... halt on error
; 13 020000......... inhibit printout
;
; An 8 bit byte $envm (i.e. location 421) has been used to define
; the operating mode, all typeouts can be suppressed by making
; bit 5 of byte $envm high, in other words by plcing a 20000 in
; location 420
;
; 5.2 Subroutine abstracts
; 5.2.1 Halt routine
;
; This routine called via jsr instruction i$ used each time
; an error is seen and an error message of the format given
; in sec, 6.1 is typed out unless supressed by the switches
; defined in sec, 5.1
;
; 5.2.2 Trap catcher
;
; A ".+2" - "halt" sequence is repeated from 0-776 to catch
; any unexpected traps, thus any unexpected traps or
; interrupts will halt at the vector +2.
;
; 6. Errors
; 6.1 Error printout
;
; The format is as follows:
;
; adr errnm
;
; Where:
; adr - address of error
; errnm - error number
;
; In most cases the comment beside the call for halt subroutine
; tells what was being checked and what was expected. all
; printouts will be suppressed when bit 5 of location $envm
; is high, while running under apt the diagnostic will not
; support spooling of console outputs,
;
;
; 6.2 Error recovery
;
; Restart at 200 or 222 (see sec 4.2)
;
;
; 7. Restrictions
;
; None
;
;
; 8. Miscellaneous
;
;
; 8.1 Execution time
;
; Normally first "END PASS" will be typed within 1 second and
; within 10 seconds for every consecutive 400 passes
;
; 8.2 Stack pointer
;
; Stack is initially set to 600
;
; 8.3 Pass count
;
; A 16 bit location "$pass" (i.e. location 406) is used to keep
; pass count. it can be cleared by restarting the program at 200
;
;
; 8.4 Test number
;
; A 16 bit location "$testn" (i.e. location 404) is used to keep track
; of the test number, upper byte of this location gives the iteration
; number and the lower byte the test that was being executed
;
;8.5 Power fail
;
; The diagnostic can be power failed with no errors. To use,
; start the test as usual and power down then up at any time,
; The program should restart from test 0 after typing "power"
; with no errors, however if the program is stored in a MOS
; memory that can not hold data with power down then the program
; will not recover from a power fail.
;
;9. Program description
;
; This program tests all the eis instructions of the 11/34
; for ash and ashc instructions every even pass is executed
; with destination mode 0 for all registers and every odd pass
; with destination mode,of 67, the diagnostic does not make a
; pass with T-bit set,
;_____________________________________________________________________________
;
HOEP = 0 ; halt on end-of-pass
NOSCO = 0 ; no scope trap
INSWR = 000000 ; 100000 for halt on error, no gtswr
SKIP = 0 ; skip final prints
;_____________________________________________________________________________
;
.asect ;
. = 0 ; loop on test
;
.title dfkaca ;
.nlist cnd, mc, md ;
.list me ;
;_____________________________________________________________________________
;
$tn = 1 ;
$swr = 160000 ; halt on error, loop on test
; inhibit error typout
dummy = 0 ;
errnm = 1 ;
f = 51 ;
n = 176 ;
;
.if ne NOSCO ;
scope = nop ;
scope1 = nop ;
scope3 = nop ;
.iff ;
scope = 10701 ;
scope1 = 10701 ;
scope3 = 10703 ;
.endc ;
;
sw09 = 1000 ;
sw10 = 2000 ;
sw11 = 4000 ;
sw12 = 10000 ;
type = iot ;
;_____________________________________________________________________________
;
.macro vect, offset, adr, val ;
. = offset ;
.if nb, <adr> ;
.word adr ;
.iff ;
.word .+2 ;
.endc ;
.if nb, <val> ;
.word val ;
.iff ;
.word 0 ;
.endc ;
.endm ;
;_____________________________________________________________________________
;
; All unused locations from 4-776 contain a ".+2, halt"
; sequence to catch illegal traps and interrupts
; location 0 contains 0 to catch improperly loaded vectors
;
.sbttl "trap catcher"
.nlist ;
vect 0, 2 ;
vect 4, 6 ;
vect 10, 12 ;
vect 14, 16 ;
vect 20, $type ;
vect 24, 200 ; for apt start up
vect 30, 32 ;
vect 34, 36 ;
vect 40, 42 ; hooks required by act-11
vect 44, $apthd, $endad ; set loc.46 to address of $endad in .seop
.list ;
;_____________________________________________________________________________
;
.sbttl "act11 hooks"
.nlist ;
vect 50, 52 ; set loc.52 to zero
vect 54, 56 ;
vect 60, 62 ;
vect 64, 66 ;
vect 70, 72 ;
vect 74, 76 ;
vect 100, 102 ;
vect 104, 106 ;
vect 110, 112 ;
vect 114, 116 ;
vect 120, 122 ;
vect 124, 126 ;
vect 130, 132 ;
vect 134, 136 ;
vect 140, 142 ;
vect 144, 146 ;
vect 150, 152 ;
vect 154, 156 ;
vect 160, 162 ;
vect 164, 166 ;
vect 170, 172 ;
.list ;
;
. = 174 ;
dispreg: .word 0 ; software display register
swreg: .word INSWR ; software switch register
;
;_____________________________________________________________________________
;
.sbttl "starting address(es)"
. = 200
mov #$pwrdn, @#24 ; prepare to service power down routine
mov #$devct, R0 ; prepare to initialize the stack
2$: clr -(R0) ;
cmp #$mail, R0 ;
bne 2$ ;
restrt: jmp begin ;
;
.nlist ;
vect 230, 232 ;
vect 234, 236 ;
vect 240, 242 ;
vect 244, 246 ;
vect 250, 252 ;
vect 254, 256 ;
vect 260, 262 ;
vect 264, 266 ;
vect 270, 272 ;
vect 274, 276 ;
vect 300, 302 ;
vect 304, 306 ;
vect 310, 312 ;
vect 314, 316 ;
vect 320, 322 ;
vect 324, 326 ;
vect 330, 332 ;
vect 334, 336 ;
vect 340, 342 ;
vect 344, 346 ;
vect 350, 352 ;
vect 354, 356 ;
vect 360, 362 ;
vect 364, 366 ;
vect 370, 372 ;
vect 374, 376 ;
.list
;_____________________________________________________________________________
;
. = 400
.sbttl "apt mailbox-etable"
.even ;
$mail: ; apt mailbox
$msgty: .word 0 ; amsgty - message type code
$fatal: .word 0 ; afatal - fatal error number
$testn: .word 0 ; atestn - test number
$pass: .word 0 ; apass - pass count
$devct: .word 0 ; adevct - device count
$unit: .word 0 ; aunit - i/o unit number
$msgad: .word 0 ; amsgad - message address
$msglg: .word 0 ; amsglg - message length
$etable: ; apt environment table
$env: .byte 0 ; aenv - environment byte
$envm: .byte 0 ; aenvm - environment mode bits
$swreg: .word 0 ; aswreg - apt switch register
$uswr: .word 0 ; auswr - user switches
$cpuop: .word 0 ; acpuop - cpu type, options
$etend:
;_____________________________________________________________________________
;
.sbttl "APT PARAMETER BLOCK"
;
; Setup apt parameter block as defined in the apt-pdp11 diagnostic interface spec.
;
$apthd:
$hibts: .word 0 ; two high bits of 18 bit mailbox addr.
$mbadr: .word $mail ; address of apt mailbox (bits 0-15)
$tstm: .word 3 ; run time of longest test
$pastm: .word 5 ; run time in secs. of 1st pass on 1 unit (quick verify)
$unitm: .word ; additional run time (secs) of a pass for each additional unit
.word $etend-$mail/2 ; length mailbox-etable(words)
;
. = $apthd ;
count: .blkw 1 ;
psword: .blkw 1 ;
temp1: .blkw 1 ;
temp2: .blkw 1 ;
temp3: .blkw 1 ;
temp4: .blkw 1 ;
temp5: .word 0 ;
temp6: .word 0 ;
typcnt: .byte 0 ;
$tpcnt: .byte 0 ;
;_____________________________________________________________________________
;
s0: .word 7 ;
s1: .word -7 ;
s2: .word s1 ;
s3: .word -6 ;
s4: .word -1 ;
s5: .word 40000 ;
s6: .word s5 ;
s7: .word 40000 ;
s8: .word -2 ;
s9: .word 2 ;
s10: .word s9 ;
s11: .word 2 ;
swr: .word 177570 ;
display: .word 177570 ;
ttyout: .word 64 ;
$tpb: .word 177566 ;
$tps: .word 177564 ;
;
$crlf: .asciz <15><12>/ / ;
power: .asciz <12><15>/POWER/ ;
.even ;
;_____________________________________________________________________________
;
vect 534, 536 ;
vect 540, 542 ;
vect 544, 546 ;
vect 550, 552 ;
vect 554, 556 ;
vect 560, 562 ;
vect 564, 566 ;
vect 570, 572 ;
vect 574, 576 ;
;_____________________________________________________________________________
;
.macro $err, num, label ;
beq .+10 ;
.if nb, <label> ;
label: ;
.endc ; seen an error, go to the halt routine
jsr PC, $hlt ;
.word num ;
.endm ;
;_____________________________________________________________________________
;
. = 600 ;
;
begin: mov #$testn, R5 ; make R5 point to the location $testn
clr @#count ; clear the counter
mov #1, (R5) ; initialize test number
mov #begin, SP ; ** stack at begin **
mov @#4, -(SP) ; save error vector
mov @#6, -(SP) ;
mov #1$, 4 ; set up time out vector
tst @swr ; try to reference hardware swr
br 3$ ; branch if no timeout trap occurs
1$: mov #swreg, swr ; point to software swr
mov #dispreg, display ; point to software display reg
cmp (SP)+, (SP)+ ; restore stack
3$: mov (SP)+, @#6 ; restore error vector
mov (SP)+, @#4 ;
mtps #0 ; place #0 in PSW
bitb #1, @#$env ; are we under APT ?
beq 2$ ; if not then go to 2$
mov #$swreg, swr ; use APT switch register
2$: mov #1, @#temp1 ; temp1=1
clr @#temp2 ; temp2=0
mov #1, @#temp3 ; temp3=1
clr @#temp4 ; temp4=0
;_____________________________________________________________________________
;
; ASH instruction tests, tests 1-36
;
start: scope1 ;
mov @#temp1, R0 ;
bit #1, @#$pass ; is it an even pass ?
bne 2$ ; if not then go to 2$
mov @#temp2, R1 ; otherwise execute the instruction
ash R1, R0 ; in mode 0 using R1
br 4$ ;
2$: ash temp2, R0 ; shift R0 by the number specified by temp2
4$: mfps @#psword ; save PSW
cmpb @#temp4, @#psword ; is the PSW = temp4 ?
$err 1 ; the ps is not equal to 0
;
inc @#count ; increment the counter
cmp @#temp3, R0 ; is the result in R0 equal to temp3?
$err 2, 6$ ; either incorrect R0 or incorrect sequence
;
cmp (R5), @#count ; is the test number equal to the counter?
bne 6$ ; if not go to the hlt above
inc (R5) ;
scope1 ;
cmp (R5), #37 ; has the contents of registers been shifted left
bge 8$ ; by 14. and right by 14.?
inc @#temp2 ;
asl temp3 ; shift temp3 left.
cmp (R5), #20 ; has the contents of registers been shifted left by 14.?
bne reg1 ;
jmp negat ; if so go to negat and initiate right shift
8$: jsr PC, tst37 ; if so go and continue the rest of the program
;
reg1: scope3 ;
mov @#temp1, R1 ; load R1 with the contents of temp1
bit #1, @#$pass ; is it an even pass ?
bne 2$ ; if not then go to 2$
mov @#temp2, R2 ; otherwise execute ash instruction in mode 0
ash R2, R1 ; using R1
br 4$ ;
2$: ash temp2, R1 ; shift R1 by the number specified by temp2
4$: mfps @#psword ; save PSW
cmpb @#temp4, @#psword ; is the PSW = temp4 ?
$err 3 ; the PSW is not equal to 0
;
inc @#count ; increment the counter
cmp @#temp3, R1 ; is the result in R1 equal to temp3?
$err 4, 6$ ; either incorrect R1 or incorrect sequence
;
cmp (R5), @#count ; is the test number equal to the counter?
bne 6$ ; if not go to the hlt above
inc (R5) ;
scope3 ;
cmp (R5), #37 ; has the contents of registers been shifted left
bge 8$ ; by 14. and right by 14.?
inc @#temp2 ;
asl temp3 ; shift temp3 left
cmp (R5), #20 ; has the contents of registers been shifted left by 14.?
bne reg2 ;
jmp negat ; if so go to negat and initiate right shift
8$: jsr PC, tst37 ; if so go and continue the rest of the program
reg2: scope1 ;
mov @#temp1, R2 ; load R2 with the contents of temp1
bit #1, @#$pass ; is it an even pass ?
bne 2$ ; if not then go to 2$
mov @#temp2, R3 ; otherwise execute ash instruction in mode 0
ash R3, R2 ; using R2
br 4$ ;
2$: ash temp2, R2 ; shift R2 by the number specified by temp2
4$: mfps @#psword ; save PSW
cmpb @#temp4, @#psword ; is the PSW = temp4 ?
$err 5 ; the PSW is not equal to 0
;
inc @#count ;
cmp @#temp3, R2 ; is the result in R2 equal to temp3?
$err 6, 6$ ;
;
cmp (R5), @#count ; is the test number equal to the counter?
bne 6$ ; if not go to the hlt above
inc (R5) ;
scope1 ;
cmp (R5), #37 ; has the contents of registers been shifted
bge 8$ ; left by 14. and right by 14.?
inc @#temp2 ;
asl temp3 ; shifted temp3 left
cmp (R5), #20 ; has the contents of registers been shifted left by 14.?
bne reg3 ;
jmp negat ; if so go to negat and initiate right shift
8$: jsr PC, tst37 ; if so go and continue the rest of the program
;
reg3: scope1 ;
mov @#temp1, R3 ; load R3 with the contents of temp1
bit #1, @#$pass ; is it an even pass ?
bne 2$ ; if not then go to 2$
mov @#temp2, R4 ; otherwise execute ash instruction in mode 0
ash R4, R3 ; using R3
br 4$ ;
2$: ash temp2, R3 ; shift R3 by the number specified by temp2
4$: mfps @#psword ; save ps
cmpb @#temp4, @#psword ; is the PSW = temp4 ?
$err 7 ; the PSW is not equal to 0.
;
inc @#count ;
cmp @#temp3, R3 ; is the result in R3 equal to temp3?
$err 10, 6$ ; either incorrect R3 or incorrect sequence
;
cmp (R5), @#count ; is the test number equal to the counter?
bne 6$ ; if not go to the hlt above
inc (R5) ;
scope1 ;
cmp (R5), #37 ; has the contents of registers been shifted
bge 8$ ; left by 14, and right by 14.?
inc @#temp2 ;
asl temp3 ; shift temp3 left?
cmp (R5),#20 ; has the contents of registers been shifted left by 14.?
bne reg4 ;
br negat ; if so go to negat and initiate right shift
8$: jsr PC,tst37 ; if so go and continue the rest of the program
;
reg4: scope3 ;
mov @#temp1, R4 ; load R4 with the contents of temp1
mov R5, R1 ; save R5
bit #1, @#$pass ; is it an even pass ?
bne 2$ ; if not then go to 2$
mov @#temp2, R5 ; otherwise execute ash instruction in mode 0
ash R5, R4 ; using R4
br 4$ ;
2$: ash temp2, R4 ; shift R4 by the number specified by temp2
4$: mfps @#psword ; save PSW
cmpb @#temp4, @#psword ; is ps = temp4 ?
$err 11 ; the ps is not equal to 0
;
inc @#count ;
cmp @#temp3, R4 ; is the result in R4 equal to temp3?
$err 12, 6$ ;
;
mov R1, R5 ; restore R5
cmp (R5), @#count ; is the test number equal to the counter?
bne 6$ ; if not go to the hlt above
inc (R5) ;
scope1 ;
cmp (R5), #37 ; has the contents of registers been
bge 8$ ; shifted left by 14. and right by 14.?
inc @#temp2 ;
asl temp3 ; shift temp3 left
cmp (R5), #20 ; has the contents of register been shifted by 14.?
bne reg5 ;
br negat ; if so go to negat and initiate right shift
8$: jsr PC, tst37 ; if so go and continue the rest of the program
;
reg5: scope1 ;
mov R5, R1 ; save R5
mov @#temp1, R5 ; load R5 with the contents of temp1
bit #1, @#$pass ; is it an even pass ?
bne 2$ ; if not then go to 2$
mov @#temp2, R0 ; otherwise execute ash instruction in mode 0
ash R0, R5 ; using R5
br 4$ ;
2$: ash temp2, R5 ; shift R5 by the number specified by temp2
4$: mfps @#psword ; save ps
cmpb @#temp4, @#psword ; is ps = temp4 ?
$err 13 ; the PSW 1s not equal to 0.
;
inc @#count ;
cmp @#temp3, R5 ; is the result in R5 equal to temp3?
$err 14, 6$ ; either incorrect R5 or incorrect sequence
;
cmp (R1), @#count ; is the test number equal to the counter?
bne 6$ ; if not go to the hlt above
mov R1, R5 ; restore R5
inc (R5) ;
scope1 ;
cmp (R5), #37 ; has the contents of registers been shifted
bge 8$ ; left by 14. and right by 14.?
inc @#temp2 ;
asl temp3 ; shift temp3 left
cmp (R5), #20 ; has the contents of registers been shifted left by 14.?
beq negat ; if so go to negat and initiate right shift
br 10$ ;
8$: jsr PC, tst37 ;
10$: jmp start ; go back to start
;
negat: mov #40000, @#temp1 ; temp1=40000
mov #177762, @#temp2 ; temp2=177762
mov #1, @#temp3 ; temp3=1
jmp start ;
;_____________________________________________________________________________
;
tst37: cmp (R5), #37 ; is it test 37?
bne tst40 ; if not then try test 40
clr @#temp1 ;
mov #16., @#temp2 ; shifted by 16
clr @#temp3 ; is=0
mov #4, @#temp4 ; and ps=4
rts PC ;
;
tst40: cmp (R5), #40 ; is it test 40?
bne tst41 ; if not then try test 41
clr @#temp2 ; 0 shifted by 0=0 and ps=4
rts PC ;
;
tst41: cmp (R5), #41 ; is it test 41?
bne tst42 ; if not then try test 42
mov #-16., @#temp2 ; 0 shifted by -16.=0 and ps=4
rts PC ;
;
tst42: cmp (R5), #42 ; is it test 42?
bne tst43 ; if not then try test 43
mov #100000, @#temp1 ;
inc @#temp2 ; shifted by -15
dec @#temp3 ; is=-1
mov #10, @#temp4 ; and ps=10
rts PC ;
;
tst43: cmp (R5), #43 ; is it test 43?
bne tst44 ; if not then if not then try test 44
mov #125252, @#temp1 ;
mov #-1, @#temp2 ; shifted by -1
mov #152525, @#temp3 ; is=152525 and ps=10
rts PC ;
;
tst44: cmp (R5), #44 ; is it test 44?
bne tst45 ; if not then try test 45
mov #1, @#temp2 ; 125252 shifted by 1
mov #52524, @#temp3 ; is=52524
mov #3, @#temp4 ; and ps=3
rts PC ;
;
tst45: cmp (R5), #45 ; is it test 45?
bne tst46 ; if not then try test 46
mov #-2, @#temp2 ; 125252 shifted by -2
mov #165252, @#temp3 ; is=165252
mov #11, @#temp4 ; and ps=11
rts PC ;
;
tst46: cmp (R5), #46 ; is it test 46?
bne tst47 ;if not then try test 47
mov #-1, @#temp1 ; -1
mov #16., @#temp2 ; shifted by 15.
clr @#temp3 ; is=0
mov #7, @#temp4 ; and ps=7
rts PC ;
;
tst47: cmp (R5), #47 ; is it test 47?
bne tst50 ; if not then try test 50
dec @#temp2 ; -1 shifted by 15
mov #100000, @#temp3 ; is=100000
mov #11, @#temp4 ; and ps=11
rts PC ;
;
tst50: cmp (R5), #50 ; is it test 50
bne ent51 ; if not then try test 51
mov #137777, @#temp1 ; 137777 shifted by 15. is=100000
mov #13, @#temp4 ; and ps=13
rts PC ;
;
ent51: cmp (R5), #51 ; is it entering test 51?
$err 15 ; test number goofed
tst (SP)+ ; restore stack pointer
mov #-7, R4 ;
mov #s1, R2 ;
mov #s2, R3 ;
;_____________________________________________________________________________
;
; Test 51 - ash 125252 shifted by #5 = 52500 ps = 3
;
tst51: scope1 ;
mov #125252, R1 ; load R1 with 125252
ash #5, R1 ; shift R1 by #5
mfps @#psword ; save ps
cmpb #3, @#psword ; is the ps 3?
$err 16 ; the ps is not equal to 3
cmp #52500, R1 ; is the result 52500?
$err 17, 1$ ; R1 is not equal to 52500
cmp (R5), #51 ; is $testn = #51
bne 1$ ; if not then go to hlt above
inc (R5) ;
;_____________________________________________________________________________
;
; Test 52 - ash 125252 shifted by @s2 = 177525 ps = 10
;
tst52: scope1 ;
mov #125252, R0 ; load R0 with 125252
ash @s2, R0 ; shift R0 by @s2
mfps @#psword ; save ps
cmpb #10, @#psword ; is the ps 10?
$err 20 ; the ps is not equal to 10
cmp #177525, R0 ; is the result 177525?
$err 21, 1$ ; R0 is not equal to 177525
cmp (R5), #52 ;
bne 1$ ;
inc (R5) ;
;_____________________________________________________________________________
;
; Test 53 - ash 125252 shifted by @#s1 = 177525 ps = 10
;
tst53: scope1 ;
mov #125252, R0 ; load R0 with 125252
ash @#s1, R0 ; shift R0 by @#s1
mfps @#psword ; save ps
cmpb #10, @#psword ; is the ps 10?
$err 22 ; the ps is not equal to 10
cmp #177525, R0 ; is the result 177525?
$err 23, 1$ ; R0 is not equal to 177525
cmp (R5), #53 ;
bne 1$ ;
inc (R5) ;
;_____________________________________________________________________________
;
; Test 54 - ash 125252 shifted by (2) = 177525 ps = 10
;
tst54: scope1 ;
mov #125252, R0 ; load R0 with 125252
ash (R2), R0 ; shift R0 by (R2)
mfps @#psword ; save ps
cmpb #10, @#psword ; is the ps 10?
$err 24 ; the ps is not equal to 10
cmp #177525,R0 ; is the result 177525?
$err 25, 1$ ; R0 is not equal to 177525
cmp (R5), #54 ;
bne 1$ ;
inc (R5) ;
;_____________________________________________________________________________
;
; Test 55 - ash 125252 shifted by (2)+ = 177525 ps = 10
;
tst55: scope1 ;
mov #125252, R0 ; load R0 with 125252
ash (R2)+, R0 ; shift R0 by (R2)+
mfps @#psword ; save ps
cmpb #10, @#psword ; is the ps 10?
$err 26 ; the ps is not equal to 10
cmp #177525, R0 ; is the result 177525?
$err 27, 1$ ; R0 is not equal to 177525
cmp (R5), #55 ;
bne 1$ ;
inc (R5) ;
;_____________________________________________________________________________
;
; Test 56 - ash 125252 shifted by -(2) = 177525 ps = 10
;
tst56: scope1 ;
mov #125252, R0 ; load R0 with 125252
ash -(R2), R0 ; shift R0 by -(R2)
mfps @#psword ; save ps
cmpb #10, @#psword ; is the ps 10?
$err 30 ; the ps is not equal to 10
cmp #177525, R0 ; is the result 177525?
$err 31, 1$ ; R0 is not equal to 177525
cmp (R5), #56 ; is $testn = #56
bne 1$ ; if not then go to hlt above
inc (R5) ;
;_____________________________________________________________________________
;
; Test 57 - ash 125252 shifted by 2(3) = 177252 ps = 11
;
tst57: scope1 ;
mov #125252, R0 ; load R0 with 125252
ash 2(R3), R0 ; shift R0 by 2(R3)
mfps @#psword ; save ps
cmpb #11, @#psword ; is the ps = 11?
$err 32 ; the ps is not equal to 11
cmp #177252, R0 ; is the result 177252?
$err 33, 1$ ; R0 is not equal to 177252
cmp (R5), #57 ;
bne 1$ ;
inc (R5) ;
;_____________________________________________________________________________
;
; Test 60 - ash 125252 shifted by @(3) = 177525 ps = 10
;
tst60: scope1
mov #125252, R0 ; load R0 with 125252
ash @(R3), R0 ; shift R0 by @(R3)
mfps @#psword ; save ps
cmpb #10, @#psword ; is the ps 10?
$err 34 ; the ps is not equal to 10
cmp #177525, R0 ; is the result 177525?
$err 35, 1$ ; R0 is not equal to 177525
cmp (R5), #60 ; is $testn = #60
bne 1$ ; if not then go to hlt above
inc (R5) ;
;_____________________________________________________________________________
;
; Test 61 - ash 125252 shifted by @(3)+ = 177525 ps = 10
;
tst61: scope1 ;
mov #125252, R0 ; load R0 with 125252
ash @(R3)+, R0 ; shift R0 by @(R3)+
mfps @#psword ; save ps
cmpb #10, @#psword ; is the ps 10?
$err 36 ; the ps is not equal to 10
cmp #177525, R0 ; is the result 177525?
$err 37, 1$ ;
cmp (R5), #61 ; is $testn = #61
bne 1$ ; if not then go to hltabove
inc (R5) ;
;_____________________________________________________________________________
;
; Test 62 - ash 125252 shifted by @-(3) = 177525 ps = 10
;
tst62: scope1 ;
mov #125252, R0 ; load R0 with 125252
ash @-(R3), R0 ; shift R0 by @-(R3)
mfps @#psword ; save ps
cmpb #10, @#psword ; is the ps 10?
$err 40 ; the ps is not equal to 10
cmp #177525, R0 ; is the result 177525?
$err 41, 1$ ; R0 is not equal to 177525
cmp (R5), #62 ; is $testn = #62
bne 1$ ; if not then go to hlt above
inc (R5) ;
;_____________________________________________________________________________
;
; ASHC instruction tests - tests 63-157
;
mov #62, @#count ;
clr @#temp1 ; temp1=0
mov #1, @#temp2 ; temp2=1
clr @#temp3 ; temp3=0
clr @#temp4 ; temp4=0
mov #1, @#temp5 ; temp5=1
clr @#temp6 ; 0 1 shifted by 0=0 1, ps=0
;
reg01: scope3 ;
mov R5,R2 ; save R5
mov @#temp1, R0 ; place the contents of temp1 in register 0
mov @#temp2, R1 ; place the contents of temp2 in register 1
clc ;
bit #1, @#$pass ; is it an even pass ?
bne 2$ ; if not then go to 2$
mov @#temp3, R5 ; otherwise execute ashc instruction in mode 0
ashc R5, R0 ; using R0
br 4$ ;
;
2$: ashc temp3, R0 ; ashc register 0 by the contents of temp3
4$: mfps @#psword ; save ps
cmpb @#temp6, @#psword ; compare ps with the contents of tem?6
$err 42 ; wrong ps
inc @#count ;
cmp @#temp4, R0 ; is the result in R0 same as temp4?
$err 43 ; wrong result in R0
cmp @#temp5, R1 ; is the result in R1 same as temp5?
$err 44 ; wrong result in R1
mov R2, R5 ; restore R5
cmp (R5), @#count ; is test number=counter?
$err 45 ; no
;
inc (R5) ;
cmp (R5), #160 ; have the first 159 test been executed?
bge 6$ ; yes
inc @#temp3 ;
clc ;
rol @#temp5 ; rotate temp5 left by 1 place
rol @#temp4 ; introduce carry from temp4 in temp5
cmp (R5), #121 ; is it test 121?
bne reg23 ;
jsr R4, ritsh ; if so then go and initiate right shift
6$: jsr PC, tst160 ;
;_____________________________________________________________________________
;
reg23: scope1 ;
mov @#temp1, R2 ; place the contents of temp1 in register 2
mov @#temp2, R3 ; place the contents of temp2 in register 3
clc ;
bit #1, @#$pass ; is it an even pass ?
bne 2$ ; if not then go to 2$
mov @#temp3, R4 ; otherwise execute ashc instruction in mode 0
ashc R4, R2 ; using R2
br 4$ ;
2$: ashc temp3, R2 ; ashc register 2 by the contetns of temp3
4$: mfps @#psword ; save ps
cmpb @#temp6, @#psword ; compare ps with the contents of temp6
$err 46 ; wrong ps
inc @#count ;
cmp @#temp4, R2 ; is the result in R2 same as temp4?
$err 47 ; wrong result in R2
cmp @#temp5, R3 ; is the result in R3 same as temp5?
$err 50 ; wrong result in R1
cmp (R5), @#count ; is test number=counter?
$err 51 ;
inc (R5) ;
cmp (R5), #160 ; have the first 159 test been executed?
bge 6$ ; yes
inc @#temp3 ;
clc ;
rol @#temp5 ; rotate temp5 left by 1 place
rol @#temp4 ; introduce carry from temp5 in temp4
cmp (R5), #121 ; is it test 121?
bne reg45 ;
jsr R4, ritsh ; if so then go and initiate right shift
6$: jsr PC, tst160 ;
;
reg45: scope1 ;
mov R5, R1 ; save R5
mov @#temp1, R4 ; place the contents of temp1 in register 4
mov @#temp2, R5 ; place the contents of temp2 in register 5
clc ;
bit #1, @#$pass ; is it an even pass ?
bne 2$ ; if not then go to 2$
mov @#temp3, R0 ; otherwise execute ashc instruction in mode 0
ashc R0, R4 ; using R4
br 4$ ;
;
2$: ashc temp3, R4 ; ashc register 4 by the contents of temp3
4$: mfps @#psword ; save ps
cmpb @#temp6, @#psword ; compare ps with the contents of temp6
$err 52 ; wrong ps
inc @#count ;
cmp @#temp4, R4 ; is the result in R4 same as temp4?
$err 53 ; wrong result in R4
cmp @#temp5, R5 ; is the result in R5 same as temp5?
$err 54 ; wrong result in R5
cmp (R1), @#count ; is test number=counter?
$err 55 ;
mov R1, R5 ; restore R5
inc (R5) ;
cmp (R5), #160 ; have the first 159 test been executed?
bge 6$ ; yes
inc @#temp3 ;
clc ;
rol @#temp5 ; rotate temp5 left by 1 place