forked from dspinellis/unix-history-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
s6.s
344 lines (324 loc) · 3.83 KB
/
s6.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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
" s6
itrunc: 0
-7
dac 9f+t
lac idskpp
dac 9f+t+1
1:
lac 9f+t+1 i
sna
jmp 4f
lac i.flags
and o200000
sna
jmp 3f
-64
dac 9f+t+2
lac dskbufp
dac 9f+t+3
2:
lac 9f+t+1 i
jms dskrd
lac 9f+t+3 i
sza
jms free
isz 9f+t+3
isz 9f+t+2
jmp 2b
3:
lac 9f+t+1 i
jms free
dzm 9f+t+1 i
4:
isz 9f+t+1
isz 9f+t
jmp 1b
lac i.flags
and o577777
dac i.flags
jmp itrunc i
t = t+4
namei: 0
jms iget
-1
tad namei i
dac 9f+t+1
isz namei
lac i.flags
and o20
sna
jmp namei i
-8
tad i.size
cma
lrss 3
dac 9f+t
sna
jmp namei i
dzm di
1:
lac di
jms dget
lac d.i
sna
jmp 2f
lac 9f+t+1
dac 8
lac d.name
sad 8 i
skp
jmp 2f
lac d.name+1
sad 8 i
skp
jmp 2f
lac d.name+2
sad 8 i
skp
jmp 2f
lac d.name+3
sad 8 i
skp
jmp 2f
lac d.i
isz namei
jmp namei i
2:
isz di
isz 9f+t
jmp 1b
jmp namei i
t = t+2
iget: 0
dac ii
cll; idiv; 5
dac 9f+t
lacq
tad d2
dac 9f+t+1
jms dskrd
lac 9f+t
cll; mul; 12
lacq
tad dskbufp
dac 9f+t
dac .+2
jms copy; ..; inode; 12
jmp iget i
iput: 0
lac 9f+t+1
jms dskrd
law inode-1
dac 8
-1
tad 9f+t
dac 9
-12
dac 9f+t+2
1:
lac 8 i
sad 9 i
skp
jmp 2f
isz 9f+t+2
jmp 1b
jmp iput i
2:
-1
tad 8
dac 8
-1
tad 9
dac 9
1:
lac 8 i
dac 9 i
isz 9f+t+2
jmp 1b
lac 9f+t+1
jms dskwr
jmp iput i
t = t+3
dget: 0
dac di
alss 3
dac 9f+t
jms pget
dac 9f+t+1
jms dskrd
lac 9f+t
and o77
tad dskbufp
dac 9f+t+2
dac .+2
jms copy; ..; dnode; 8
lac 9f+t
tad d8
jms betwen; d0; i.size
skp
jmp dget i
jms dacisize
dzm d.i
jmp dget i
dput: 0
lac 9f+t+1
jms dskrd
lac 9f+t+2
dac .+3
jms copy; dnode; ..; 8
lac 9f+t+1
jms dskwr
jmp dput i
t = t+3
pget: 0
lrss 6
dac 9f+t
lac i.flags
and o200000
sza
jmp 2f
lac 9f+t
jms betwen; d0; d6
jmp 1f
tad idskpp
dac 9f+t
lac 9f+t i
sna
jms alloc
dac 9f+t i
jmp pget i
1:
jms alloc
dac 9f+t+1
jms copy; i.dskps; dskbuf; 7
jms copyz; dskbuf+7; 64-7
lac 9f+t+1
jms dskwr
lac 9f+t+1
dac i.dskps
jms copyz; i.dskps+1; 6
lac i.flags
xor o200000
dac i.flags
2:
lac 9f+t
lrss 6
jms betwen; d0; d6
jms halt " file too big
tad idskpp
dac 9f+t+1
lac 9f+t+1 i
sna
jms alloc
dac 9f+t+1 i
dac 9f+t+2
jms dskrd
lac 9f+t
and o77
tad dskbufp
dac 9f+t+1
lac 9f+t+1 i
sza
jmp pget i
jms alloc
dac 9f+t
lac 9f+t+2
jms dskrd
lac 9f+t
dac 9f+t+1 i
lac 9f+t+2
jms dskwr
lac 9f+t
jmp pget i
t = t+3
iwrite: 0
dac 9f+t
lac iwrite
dac iread
lac cskp
dac iwrite
jmp 1f
iread: 0
dac 9f+t
lac cnop
dac iwrite
1:
-1
tad iread i
dac 10
dac 11
isz iread
lac iread i
dac 9f+t+1
isz iread
lac o70000
xct iwrite
lac i.size
cma
tad 9f+t
cma
jms betwen; d0; 9f+t+1
lac 9f+t+1
dac 9f+t+2
cma
tad d1
sna
jmp iread i
dac 9f+t+1
1:
lac 9f+t
jms pget
dac 9f+t+3
jms dskrd
lac 9f+t
and o77
tad dskbufp
tad dm1
xct iwrite
jmp .+3
dac 10
cskp:
skp
dac 11
2:
lac 11 i
dac 10 i
isz 9f+t
isz 9f+t+1
jmp 3f
xct iwrite
jmp 4f
lac 9f+t
jms betwen; d0; i.size
dac i.size
lac 9f+t+3
jms dskwr
4:
lac 9f+t+2
jmp iread i
3:
lac 9f+t
and o77
sza
jmp 2b
xct iwrite
jmp 1b
lac 9f+t+3
jms dskwr
jmp 1b
t = t+4
finac: 0
lac u.ac
jms fget
jms error
lac f.flags
sma
jms error
lac f.i
jms iget
jmp finac i
dacisize: 0
dac i.size
jms iput
lac i.size
jmp dacisize i