A large commit.
[pdp8.git] / sw / os8 / v3d / sources / fortran / all / rsw.ra
... / ...
CommitLineData
1/
2/ VERSION 5A 4-26-77 MH
3/
4/THE FOLLOWING IS A SET OF 8 MODE (RALF TYPE)
5/ROUTINES THAT ENABLE PDP 12(8) HARDWARE OPTIONS
6/THESE ROUTINES ARE CALLABLE AT THE FORTRAN LEVEL
7/THE FOLLOWING OPTIONS ARE SUPPORTED:
8/
9/ 1 READ A BIT IN THE RIGHT SWITCHES
10/ 2 READ A BIT IN THE LEFT SWITCHES
11/ 3 READ A SENSE SWITCH
12/ 4 READ AN EXTERNAL LEVEL
13/ 5 OPEN OR CLOSE A RELAY
14/
15/IF THE REQUESTED BIT OR SWITCH IS SET THE
16/SUBROUTINE RETURNS WITH THE CALLERS ARG SET TO
17/A 1,OTHERWISE IT IS SET TO A 0
18/
19/
20\f SECT8 RSW
21 INDEX P17
22 BASE 0
23 JSA SETUP /CHECK ONE RSW BIT
24 TRAP4 DORITE /CALL 8 MODE ROUT USER
25 /ARG IS IN FPP XR3
26CONT, STARTD /ANSWER IS IN XR3
27 FLDA% 0,XR2 /GET PTR TO CALLER ANS
28 FSTA 3
29 STARTF
30 XTA XR3
31 FSTA% 3 /GIVE ANS TO CALLER
32GOBAK, FLDA 30 /RTN TO CALLER
33 JAC
34 ENTRY LSW
35LSW, JSA SETUP /READ 1 LSW BIT
36 TRAP4 DOLEFT /CALL 8MODE ROUT
37 JA CONT
38 ENTRY SSW
39SSW, STARTD /READ A SENSE SWITCH
40 FLDA ANSNSI
41 JA ESSW
42 ENTRY ROPEN
43ROPEN, STARTD /OPEN A RELAY
44 FLDA ABCLI
45ERCLOS, FSTA MASK /PLANT A BCLI OR BSEI IN
46 /8 MODE ROUTINE
47 JSA SETUP
48 TRAP4 RELAY
49 FLDA 30
50 JAC
51 ENTRY EXTLVL
52EXTLVL, STARTD /READ AN EXTERNAL LEVEL
53 FLDA ANSXL
54ESSW, FSTA LSKP /PLANT SXLI OR SNS IN
55 JSA SETUP /8 MODE ROUTINE
56 TRAP4 DOSXL
57 JA CONT
58 ENTRY RCLOSE
59RCLOSE, STARTD /CLOSE A RELAY
60 FLDA ABSEI
61 JA ERCLOS
62SETUP, 0;0 /GET ARGS AND SETUP RTN
63 STARTD
64 SETX P17
65 FLDA% 0,XR1 /GET PTR TO 1ST USER ARG
66 FSTA 3
67 STARTF
68 FLDA% 3 /USER ARG TO FAC
69 ATX XR3 /PUT IN XR FOR 8 MODE
70 JA SETUP
71\fDORITE, 0 /READ RIGHT SWITCHES
72 LAS
73 DCA MASK
74 JMS SETBIT /GET REQUESTED BIT
75 AND MASK /MASK RSW
76 SZA CLA /IF BIT IS SET,SET XR3=1
77 ISZ XR3
78 CIF CDF /RTN TO RTS
79 JMP% DORITE
80DOLEFT, 0 /READ LEFT SWITCHES
81 TAD DOLEFT
82 DCA DORITE
83 IOF
84 6141 /LINC
85 517 /LSW
86 2 /PDP
87 ION
88 JMP DORITE+2
89DOSXL, 0 /READ SENSE SWITCH
90 /OR EXTERNAL LEVEL
91 TAD XR3 /=SSW OR LVL TO DO
92 AND P17
93 TAD LSKP
94 DCA LSKP
95 CLL CML /SET LNK=COND MET
96 IOF
97 6141
98LSKP, 0 /=SNS I N OR SXL N
99 261 /IF SKP FAILS THEN COND
100 /IS MET SO ROTATE LNK
101 /INTO AC(11) (261=ROL I 1)
102 2 /PDP
103 ION
104 DCA XR3 /SAVE ANSWER
105 CIF CDF
106 JMP% DOSXL /RTN TO RTS
107RELAY, 0 /OPEN A RELAY
108 TAD CONT /=6
109 JMS SETBIT /GO SET RELAY BIT
110 DCA MASK+1
111 IOF
112 6141
113 15 /GET RELAYS
114MASK, 0 /BCL I OR BSE I
115 0 /SET OR CLR 1 RELAY BIT
116 14 /ATR PUT RELAYS BACK
117 2
118 ION
119 CLA
120 CIF CDF
121 JMP% RELAY
122SETBIT, 0 /COME HERE TO POSITION
123 TAD XR3 /BIT IN AC ACCORDING TO
124 /C(AC)+XR3
125 CMA CLL CML /ROTATE BIT INTO POSITION
126 DCA XR3 /XR3 MUST=0 UPON EXIT
127 RAR /ROTATE LINK UNTIL
128 ISZ XR3 /XR3=0
129 JMP .-2
130 JMP% SETBIT /RTN WITH AC SET
131ABCLI, 1560 /BCL I
132ABSEI, 1620 /BSE I
133P17, 17 /FPP XR0
134XR1, 1
135XR2, 2
136XR3, 0
137ANSXL, 400 /SXL
138 261 /ROL I 1
139ANSNSI, 460 /SNS I
140 261
141\f