-
Notifications
You must be signed in to change notification settings - Fork 0
/
pat61.cor
181 lines (178 loc) · 7.5 KB
/
pat61.cor
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
INS 47/1 ;SH1
;SOFTWARE HOUSE 4/3/85 (GC)
;/SH2/ Added COMPAT function 32 that will set/unset internal flag.
; The flag is tested instead of .JBCST to determine whether
; or not to unmap the LIBOL high-segment.
;SOFTWARE HOUSE 4/19/84 (JB)
;/SH/ Added storage for level 3 pc words.
;TS.JFOX 11/7/83 CHANGE VERSION NUMBER TO PRINT IN DECIMAL
;TS.CHull 10-13-83 Put our edits into this new source file--no edit number.
; Removed feature tests--just put it in and commented out old stuff.
;/A3/ TS.CHULL 8/26/82 ADD COMPAT FUNCTION 13 - SUPPORT EXTENDED INTERRUPTS.
; THE PHILOSOPHY IS TO ALLOW PA1050 TO WORK IN SECTION ZERO WITH THE
; INTERRUPT TABLE SET UP THE "EXTENDED" WAY (XSIR%). THERE IS NO
; GUARANTEE OF ANYTHING WORKING IF PA1050 IS INVOKED FROM OR EXECUTED
; IN A NON ZERO SECTION OF MEMORY.
;/A1/ WIZ.MT 7/27/81 PUT IN SOFTWARE HOUSE PATCHES
REP 6/2 ;SH2
.GROUP==0 ;GROUP WHO LAST MODIFIED PROGRAM
WIT
.GROUP==1 ;/A1/GROUP WHO LAST MODIFIED PROGRAM
REP 34/11 ;SH3
STDPRT=005000,,0 ;STANDARD FILE PROTECTION
WIT
;/A1/STDPRT=005000,,0 ;STANDARD FILE PROTECTION
STDPRT=077000,,0 ;/A1/STANDARD FILE PROTECTION
REP 56/15 ;SH4
ALC RETSAV,1 ;[432][437] RETURN SAVED BY PSEUDOINTERRUPT
ALC LV2SAV,1 ;[432][437] LEVEL 2 PC SAVE WORD
WIT
;/A1/ ALC RETSAV,1 ;[432][437] RETURN SAVED BY PSEUDOINTERRUPT
;/A1/ ALC LV2SAV,1 ;[432][437] LEVEL 2 PC SAVE WORD
ALC RETSAV,2 ;/A1/RETURN SAVED BY PSEUDOINTERRUPT
ALC LV2SAV,2 ;/A1/LEVEL 2 PC SAVE WORD
ALC LV3SAV,2 ;/SH/LEVEL 3 PC SAVE WORDS
INS 5/16 ;SH5
ALC EXTINF,1 ;/A3/EXTENDED INTERRUPT FLAG (SEE PSIFLP)
ALC UNMFLG,1 ;/SH2/NO UNMAP LIBOL FLAG
INS 41/105 ;SH6
REPEAT <COMPTT+31-1-.>,< ;/A3/
0,,CMPTE1 ;/A3/ERROR FOR UNDEFINED FUNCTIONS BEFORE 31
> ;/A3/
1,,COMP31 ;/A3/FUN 31 - EXTENDED INTERRUPT TABLE
0,,COMP32 ;/SH2/FUN 32 - SET FLAG INDICATING WHETHER OR
; NOT WE NEED TO UNMAP LIBOL
INS 86/111 ;SH7
SKIPN EXTINF ;/A3/DOING THINGS THE EXTENDED WAY?
JRST .+3 ;/A3/NO, NORMAL
HLLZ B,B ;/A3/YES, KEEP ONLY LEFT HALF
LSH B,^D12 ;/A3/SLIDE INTO PROPER EXTENDED PLACE
INS 1/114 ;SH8
;/A3/FUNCTION 31 - SET UP INTERRUPT STUFF SO IT WILL WORK IN EXTENDED
;/A3/SECTIONS OF MEMORY. OR SET IT BACK TO ONLY WORK IN SECTION ZERO
;/A3/ACCEPTS IN ARG/ NON-ZERO MEANS DO EXTENDED INTERRUPT HANDLING
;/A3/ ZERO MEANS DO NORMAL NON-EXTENDED HANDLING
COMP31: XCTUM <MOVE A,1(CAC)> ;/A3/GET USER "FLAG"
SKIPE A ;/A3/WANT BACK TO NORMAL?
SETO A, ;/A3/NO, LITE ALL BITS
HLLM A,EXTINF ;/A3/INDICATE USER'S DESIRE IN LEFT HALF
PUSHJ P,SETPSI ;/A3/GO SETUP NEW WAY
JRST MRETN2 ;/A3/AND EXIT
;/SH2/FUNCTION 32 - SET FLAG ACCORDING TO ARGUMENT. FLAG IS CHECKED LATER
;/SH2/TO INDICATE WHETHER WE SHOULD UNMAP LIBOL. FLAG ON MEANS DO NOT UNMAP.
;/SH2/FLAG IS IN LH OF WORD CONTAINING FUNCTION CODE 32.
COMP32: XCTUM <HLRE A,0(CAC)> ;/SH2/GET USER FLAG
MOVEM A,UNMFLG ;/SH2/SET INTERNAL FLAG
JRST MRETN2 ;/SH2/AND EXIT
INS 31/115 ;SH9
PUSHJ P,PSIFLP ;/A3/MAKE CHANNEL TABLE CORRECT
MOVEI A,.FHSLF ;/A3/RESTORE THIS
SKIPN EXTINF ;/A3/DOING EXTENDED METHOD?
JRST .+4 ;/A3/NO, NORMAL
MOVEI B,[EXP 3 ;/A3/YES, ADDRESS OF ARG BLOCK OF ADDRESSES
EXP LEVTAB ;/A3/
EXP CHNTAB] ;/A3/
XSIR% ;/A3/DO IT
JRST .+3 ;/A3/SKIP NORMAL STUFF
INS 2/116 ;SH10
;/A3/CHANGE THE CHANNEL TABLE FROM NON-EXTENDED TO EXTENDED OR VICE-VERSA.
;/A3/THE LEFT HALF OF EXTINF IS WHAT THE USER WANTS (0=NON EXT, -1=EXT).
;/A3/THE RIGHT HALF IS HOW THE TABLE IS CURRENTLY SET UP (0=NON EXT, -1=EXT).
;/A3/THEREFORE IF EXTINF IS ZERO OR -1 THERE IS NOTHING TO DO. IF THE HALVES
;/A3/DIFFER WE HAVE TO FLIP THE TABLE FROM ONE WAY TO THE OTHER.
;/A3/THIS SHOULD ONLY TAKE PLACE WHEN ALL INTERRUPT SERVICE ROUTINES ARE
;/A3/18 BIT ADDRESSES OTHERWISE THE SECTION NUMBERS WILL EITHER BE LOST OR,
;/A3/GOING THE OTHER WAY, WE WON'T KNOW WHAT TO FILL IN.
;/A3/THIS SHOULD ONLY BE CALLED IF THE TABLES HAVE ALREADY BEEN LOADED.
PSIFLP: MOVE A,EXTINF ;/A3/GET THE FLAG WORD
CAIE A,0 ;/A3/USER WANT WHAT IT ALREADY IS?
CAMN A,[EXP -1] ;/A3/..
RET ;/A3/YES, THEN NOTHING TO DO
HLRM A,EXTINF ;/A3/MARK TABLE AS BEING WHAT USER WANTS
MOVE A,[^D-36,,0] ;/A3/SET UP AOBJN COUNTER
PSIEX0: HLLZ B,CHNTAB(A) ;/A3/GET LEVEL NUMBER FROM TABLE ENTRY
MOVEI C,^D12 ;/A3/NUMBER OF BITS TO SHIFT EITHER WAY
SKIPN EXTINF ;/A3/GOING FROM EXTENDED TO NORMAL?
MOVN C,C ;/A3/YES, THEN SHIFT IS RIGHT
LSH B,(C) ;/A3/SHIFT IT
HLLM B,CHNTAB(A) ;/A3/PUT NEW LEVEL NUMBER BACK
AOBJN A,PSIEX0 ;/A3/LOOP IF MORE TO DO
RET ;/A3/
REP 6/116 ;SH11
0
WIT
EXP LV3SAV ;/SH/ STORAGE FOR LEVEL 3 PC
INS 57/118 ;SH12
SKIPN UNMFLG ;/SH2/DON'T LOSE LIBOL IF 1022 HOST LANG PROG
INS 63/118 ;SH13
SKIPE UNMFLG ;/SH2/IF 1022 HOST LANGUAGES
HRLI B,400 ;/SH2/START AT PAGE 400 IN ALL CASES
INS 14/140 ;SH14
SKIPN EXTINF ;/A3/EXTENDED METHOD?
JRST .+4 ;/A3/NO, NORMAL
MOVEI B,[EXP 3 ;/A3/ADDR OF ARG BLOCK OF ADDRS
EXP LEVTAB ;/A3/
EXP CHNTAB] ;/A3/
XSIR% ;/A3/
JRST .+3 ;/A3/SKIP NORMAL STUFF
INS 125/158 ;SH15
SKIPN EXTINF ;/A3/SKIP IF DOING EXTENDED
JRST NOX1 ;/A3/NOT EXTENDED, DO OLD NORMAL WAY
POP P,A ;/A3/GET OUR RETURN ADDRESS OFF STACK
HRRZM A,RETSAV+1 ;/A3/SAVE ADDRESS PART IN 2ND WORD
AND A,[777740,,0] ;/A3/KEEP ONLY THE FLAGS (B0 TO B12)
MOVEM A,RETSAV ;/A3/AND PUT THEM HERE IN 1ST WORD
JRST .+2 ;/A3/SKIP OVER NORMAL WAY
NOX1: ;/A3/
INS 20/178 ;SH16
SKIPE EXTINF ;/A3/EXTENDED METHOD?
MOVE A,RETSAV+1 ;/A3/YES, THEN IT IS REALLY HERE
INS 38/178 ;SH17
SKIPE EXTINF ;/A3/DOING EXTENDED METHOD?
MOVE 2,RETSAV+1 ;/A3/YES, THEN THE PC IS REALLY HERE
INS 6/184 ;SH18
SKIPE EXTINF ;/A3/DOING IT THE EXTENDED WAY?
MOVE A,RETSAV+1 ;/A3/YES, THEN THE REAL PC IS HERE
INS 36/184 ;SH19
SKIPN EXTINF ;/A3/DOING THE EXTENDED WAY?
JRST .+3 ;/A3/NO, DO NORMAL STUFF
EXCH B,RETSAV+1 ;/A3/YES, THEN THE PC IS HERE
JRST .+2 ;/A3/SKIP NORMAL WAY
INS 6/186 ;SH20
SKIPN EXTINF ;/A3/DOING THINGS THE EXTENDED WAY?
JRST .+4 ;/A3/NO, DO IT THE NORMAL WAY
MOVE A,RETSAV ;/A3/GET FLAGS
HRR A,RETSAV+1 ;/A3/GET RIGHT HALF OF SAVED PC
JRST .+2 ;/A3/(ONLY WORKS IN SECTION 0--FEATURE)
INS 18/186 ;SH21
SKIPN EXTINF ;/A3/DOING THINGS THE EXTENDED WAY?
JRST .+4 ;/A3/NO, DO IT NORMAL WAY
MOVE A,RETSAV ;/A3/GET FLAGS
HRR A,RETSAV+1 ;/A3/GET PC FROM HERE (RIGHT HALF ONLY)
JRST .+2 ;/A3/(ONLY MADE TO WORK IN SECTION 0)
INS 33/186 ;SH22
SKIPE EXTINF ;/A3/DOING THINGS THE EXTENDED WAY?
HRR A,RETSAV+1 ;/A3/YES, GET PC FROM HERE (SECT 0 ONLY)
INS 6/187 ;SH23
SKIPE EXTINF ;/A3/DOING THINGS THE EXTENDED WAY?
HRR A,RETSAV+1 ;/A3/YES, GET PC FROM HERE (SECT 0 ONLY)
INS 14/187 ;SH24
SKIPN EXTINF ;/A3/DOING THINGS THE EXTENDED WAY?
JRST .+3 ;/A3/NO, DO NORMAL
HRRZM A,RETSAV+1 ;/A3/YES, RETURN TO WHERE USER WANTS US TO
JRST .+2 ;/A3/SKIP NORMAL WAY
INS 28/187 ;SH25
SKIPN EXTINF ;/A3/DOING IT THE EXTENDED WAY?
JRST .+3 ;/A3/NO, DO IT NORMAL WAY
EXCH A,RETSAV+1 ;/A3/YES, PC IS HERE
JRST .+2 ;/A3/SKIP NORMAL WAY
INS 55/187 ;SH26
SKIPE EXTINF ;/A3/DOING FUNKY EXTENDED METHOD?
AOSA RETSAV+1 ;/A3/YES, INCR DEBRK ADDR AND SKIP
REP 11/188 ;SH27
WHODID: HRRZ A,RETSAV ;[365] GET ADDR OF INSTR THAT DID IT
WIT
WHODID:
SKIPE EXTINF ;/A3/DOING IT THE EXTENDED WAY?
SKIPA A,RETSAV+1 ;/A3/YES, GET ADDR FROM HERE AND SKIP
HRRZ A,RETSAV ;[365] GET ADDR OF INSTR THAT