Commit | Line | Data |
---|---|---|
8d8c20ed DR |
1 | / |
2 | / | |
3 | ||
4 | / a6 -- pdp-11 assembler pass 1 | |
5 | ||
6 | opline: | |
7 | mov r4,r0 | |
8 | jsr r5,betwen; 0; 200 | |
9 | br 1f | |
10 | cmp r0,$'< | |
11 | bne xpr | |
12 | jmp opl17 | |
13 | xpr: | |
14 | jsr pc,expres | |
15 | add $2,dot | |
16 | rts pc | |
17 | 1: | |
18 | movb (r4),r0 | |
19 | cmp r0,$24 | |
20 | beq xpr | |
21 | jsr r5,betwen; 5; 36 | |
22 | br xpr | |
23 | mov r0,-(sp) | |
24 | jsr pc,readop | |
25 | mov (sp)+,r0 | |
26 | asl r0 | |
27 | jmp *1f-12(r0) | |
28 | ||
29 | 1: | |
30 | opl13 / map fop freg,fdst to double | |
31 | opl6 | |
32 | opl7 | |
33 | opl10 | |
34 | opl11 | |
35 | opl13 / map fld/fst to double | |
36 | opl13 | |
37 | opl13 / map fop fsrc,freg to double | |
38 | opl15 | |
39 | opl16 | |
40 | opl17 | |
41 | opl20 | |
42 | opl21 | |
43 | opl22 | |
44 | opl23 | |
45 | xpr | |
46 | opl25 | |
47 | opl26 | |
48 | opl27 | |
49 | opl13 / map mul s,r to double | |
50 | opl31 | |
51 | opl32 | |
52 | xpr | |
53 | xpr | |
54 | opl35 | |
55 | opl36 | |
56 | ||
57 | / jbr | |
58 | opl35: | |
59 | mov $4,-(sp) | |
60 | br 1f | |
61 | ||
62 | / jeq, etc | |
63 | opl36: | |
64 | mov $6,-(sp) | |
65 | 1: | |
66 | jsr pc,expres | |
67 | cmp r3,dotrel | |
68 | bne 1f | |
69 | sub dot,r2 | |
70 | bge 1f | |
71 | cmp r2,$-376 | |
72 | blt 1f | |
73 | mov $2,(sp) | |
74 | 1: | |
75 | add (sp)+,dot | |
76 | rts pc | |
77 | ||
78 | /double | |
79 | opl13: | |
80 | opl7: | |
81 | jsr pc,addres | |
82 | op2: | |
83 | cmp r4,$', | |
84 | beq 1f | |
85 | jsr pc,errora | |
86 | rts pc | |
87 | 1: | |
88 | jsr pc,readop | |
89 | opl15: / single operand | |
90 | jsr pc,addres | |
91 | add $2,dot | |
92 | rts pc | |
93 | ||
94 | opl31: / sob | |
95 | jsr pc,expres | |
96 | cmp r4,$', | |
97 | beq 1f | |
98 | jsr pc,errora | |
99 | 1: | |
100 | jsr pc,readop | |
101 | ||
102 | /branch | |
103 | opl6: | |
104 | opl10: | |
105 | opl11: | |
106 | jsr pc,expres | |
107 | add $2,dot | |
108 | rts pc | |
109 | ||
110 | / .byte | |
111 | opl16: | |
112 | jsr pc,expres | |
113 | inc dot | |
114 | cmp r4,$', | |
115 | bne 1f | |
116 | jsr pc,readop | |
117 | br opl16 | |
118 | 1: | |
119 | rts pc | |
120 | ||
121 | / < (.ascii) | |
122 | opl17: | |
123 | add numval,dot | |
124 | jsr pc,readop | |
125 | rts pc | |
126 | ||
127 | /.even | |
128 | opl20: | |
129 | inc dot | |
130 | bic $1,dot | |
131 | rts pc | |
132 | ||
133 | /.if | |
134 | opl21: | |
135 | jsr pc,expres | |
136 | tst r3 | |
137 | bne 1f | |
138 | jsr r5,error; 'U | |
139 | 1: | |
140 | tst r2 | |
141 | bne opl22 | |
142 | inc ifflg | |
143 | opl22: /endif | |
144 | rts pc | |
145 | ||
146 | /.globl | |
147 | opl23: | |
148 | cmp r4,$200 | |
149 | blo 1f | |
150 | bisb $40,(r4) | |
151 | jsr pc,readop | |
152 | cmp r4,$', | |
153 | bne 1f | |
154 | jsr pc,readop | |
155 | br opl23 | |
156 | 1: | |
157 | rts pc | |
158 | ||
159 | opl25: | |
160 | opl26: | |
161 | opl27: | |
162 | mov dotrel,r1 | |
163 | asl r1 | |
164 | mov dot,savdot-4(r1) | |
165 | mov savdot-[2*25](r0),dot | |
166 | asr r0 | |
167 | sub $25-2,r0 | |
168 | mov r0,dotrel | |
169 | rts pc | |
170 | ||
171 | / .common | |
172 | opl32: | |
173 | cmp r4,$200 | |
174 | blo 1f | |
175 | bis $40,(r4) | |
176 | jsr pc,readop | |
177 | cmp r4,$', | |
178 | bne 1f | |
179 | jsr pc,readop | |
180 | jsr pc,expres | |
181 | rts pc | |
182 | 1: | |
183 | jsr r5,error; 'x | |
184 | rts pc | |
185 | ||
186 | addres: | |
187 | cmp r4,$'( | |
188 | beq alp | |
189 | cmp r4,$'- | |
190 | beq amin | |
191 | cmp r4,$'$ | |
192 | beq adoll | |
193 | cmp r4,$'* | |
194 | beq astar | |
195 | getx: | |
196 | jsr pc,expres | |
197 | cmp r4,$'( | |
198 | bne 2f | |
199 | jsr pc,readop | |
200 | jsr pc,expres | |
201 | jsr pc,checkreg | |
202 | jsr pc,checkrp | |
203 | add $2,dot | |
204 | clr r0 | |
205 | rts pc | |
206 | 2: | |
207 | cmp r3,$24 / register type | |
208 | bne 1f | |
209 | jsr pc,checkreg | |
210 | clr r0 | |
211 | rts pc | |
212 | 1: | |
213 | add $2,dot | |
214 | clr r0 | |
215 | rts pc | |
216 | ||
217 | alp: | |
218 | jsr pc,readop | |
219 | jsr pc,expres | |
220 | jsr pc,checkrp | |
221 | jsr pc,checkreg | |
222 | cmp r4,$'+ | |
223 | bne 1f | |
224 | jsr pc,readop | |
225 | clr r0 | |
226 | rts pc | |
227 | 1: | |
228 | mov $2,r0 | |
229 | rts pc | |
230 | ||
231 | amin: | |
232 | jsr pc,readop | |
233 | cmp r4,$'( | |
234 | beq 1f | |
235 | mov r4,savop | |
236 | mov $'-,r4 | |
237 | br getx | |
238 | 1: | |
239 | jsr pc,readop | |
240 | jsr pc,expres | |
241 | jsr pc,checkrp | |
242 | jsr pc,checkreg | |
243 | clr r0 | |
244 | rts pc | |
245 | ||
246 | adoll: | |
247 | jsr pc,readop | |
248 | jsr pc,expres | |
249 | add $2,dot | |
250 | clr r0 | |
251 | rts pc | |
252 | ||
253 | astar: | |
254 | jsr pc,readop | |
255 | cmp r4,$'* | |
256 | bne 1f | |
257 | jsr r5,error; '* | |
258 | 1: | |
259 | jsr pc,addres | |
260 | add r0,dot | |
261 | rts pc | |
262 | ||
263 | errora: | |
264 | jsr r5,error; 'a | |
265 | rts pc | |
266 | ||
267 | checkreg: | |
268 | cmp r2,$7 | |
269 | bhi 1f | |
270 | cmp r3,$1 | |
271 | beq 2f | |
272 | cmp r3,$4 | |
273 | bhi 2f | |
274 | 1: | |
275 | jsr pc,errora | |
276 | 2: | |
277 | rts pc | |
278 | ||
279 | errore: | |
280 | jsr r5,error; 'e | |
281 | rts pc | |
282 | ||
283 | checkrp: | |
284 | cmp r4,$') | |
285 | beq 1f | |
286 | jsr r5,error; ') | |
287 | rts pc | |
288 | 1: | |
289 | jsr pc,readop | |
290 | rts pc | |
291 |