forked from dspinellis/unix-history-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
s2.s
328 lines (308 loc) · 3.78 KB
/
s2.s
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
" s2
.status:
jms arg
dac .+5
jms arg
dac .+6
lac u.cdir
jms namei; ..
jms error
jms namei; ..
jms error
jms iget
lac u.ac
and o17777
jms betwen; o10000; o17762
jms error
dac .+3
jms copy; inode; ..; 12
lac d.i
dac 9 i
jmp okexit
.capt:
lac u.ac
dac u.dspbuf
jms movdsp
jmp sysexit
.rele:
dzm u.dspbuf
law dspbuf
jms movdsp
jmp sysexit
.chmod:
jms isown
lac u.ac
and o17
lmq
lac i.flags
and o777760
omq
dac i.flags
jms iput
jmp okexit
.chown:
jms isown
lac u.ac
dac i.uid
jms iput
jmp okexit
.getuid:
lac u.uid
dac u.ac
jmp sysexit
.seek:
jms seektell
tad u.base
spa
jms error
lmq
lac f.flags
and d1
sna
jmp 1f
lacq
jms betwen; d0; i.size
jms dacisize
jmp 2f
1:
lacq
jms betwen; d0; i.size
lac i.size
2:
dac f.badd
dac u.ac
jms fput
jmp sysexit
.tell:
jms seektell
cma
tad d1
tad u.base
dac u.ac
jmp sysexit
.link:
jms arg
dac 0f
jms arg
dac 1f
jms arg
dac 2f
lac d4
jms namei; 0:0
jms error
jms namei; 1:0
jms error
dac u.base
jms copy; 2:0; name; 4
lac u.cdir
jms namei; name
skp
jms error
lac d1
dac mode
jms access
jms dslot
lac u.base
jms iget
lac ii
dzm d.i
jms copy; name; d.name; 4
lac i.uniq
dac d.uniq
-1
tad i.nlks
dac i.nlks
jms iput
jms dput
jmp okexit
.unlink:
jms argname
dac u.base
lac d1
dac mode
jms access
dac d.i
jms dput
lac u.base
jms iget
isz i.nlks
jmp 1f
jms itrunc
dzm i.flags
1:
jms iput
jmp sysexit
.setuid:
lac u.uid
sma
jms error
lac u.ac
dac u.uid
jmp sysexit
.rename:
jms arg
dac 0f
jms arg
dac 1f
lac u.cdir
jms namei; 0:0
jms error
lac d1
dac mode
jms access
jms copy; 1:0; d.name; 4
jmp okexit
.time:
lac s.tim
dac u.ac
lac s.tim+1
dac u.mq
jmp sysexit
.chdir:
jms argname
jms iget
lac i.flags
and o20
sna
jms error
lac ii
dac u.cdir
jmp okexit
.open:
jms arg
dac 0f
jms arg
sza
lac d1
sna
lac d2
dac mode
lac u.cdir
jms namei; 0:0
jms error
jms iget
jms access
lac i.flags
and o20
sna
jmp open1
lac mode
and d1
sna
jmp open1
lac u.uid
sma
jms error
jmp open1
.creat:
lac d1
dac mode
jms arg
dac .+2
jms copy; ..; name; 4
lac u.cdir
jms namei; name
jmp 1f
jms iget
jms access
lac i.flags
and o20
sna
jmp .+4
lac u.uid
sma
jms error
jms itrunc
cla
jms dacisize
jmp open1
1:
jms access
lac u.ac
and o17
jms icreat
open1:
jms fassign
jms error
jmp sysexit
.close:
jms finac
dzm f.flags
jms fput
jmp sysexit
.read:
jms arg
and o17777
dac u.base
jms arg
dac u.count
lac u.base
jms betwen; o10000; o17777
jms error
tad u.count
jms betwen; u.base; o17777
jms error
dac u.limit
1:
jms finac
lac f.flags
and d1
sza
jms error
lac i.flags
and o40
sna
jmp 1f
iof
lac ii
tad swr
dac .+1
jmp .. i
1:
lac u.base
dac 1f+1
lac u.count
dac 1f+2
lac f.badd
1:
jms iread; ..; ..
jmp exitrw
.write:
jms arg
and o17777
dac u.base
jms arg
dac u.count
tad u.base
jms betwen; u.base; o17777
jms error
dac u.limit
jms finac
lac f.flags
and d1
sna
jms error
lac i.flags
and o40
sna
jmp 1f
iof
lac ii
tad sww
dac .+1
jmp .. i
1:
lac u.base
dac 1f+1
lac u.count
dac 1f+2
lac f.badd
1:
jms iwrite; ..; ..
exitrw:
dac u.ac
tad f.badd
dac f.badd
jms iput
jms fput
jmp sysexit