mirror of
https://github.com/DoctorWkt/unix-jun72.git
synced 2026-04-20 09:36:36 +00:00
according to what seemed right by reading the code. Documented all of the changes in notes.txt. Mostly accepting the hand written corrections in the pdf file.
56 lines
1.8 KiB
Plaintext
56 lines
1.8 KiB
Plaintext
put:
|
|
asr r2 / divide r2 by 2; r2 is offset in clist
|
|
mov r2,-(sp) / save r2 on stack
|
|
movb cl+1(r1),r2 / move offset of last char in list (r1) into r2
|
|
beq 1f / offset = 0 then go to 1f (i.e., start a new list)
|
|
bic $!377,r2 / zero top half of r2
|
|
asl r2 / multiply offset by 2, r2 now has offset in clist
|
|
movb (sp),clist-1(r2) / link new list entry to current last
|
|
/ entry in list (r1)
|
|
br 2f
|
|
1:
|
|
movb (sp),cf+1(r1) / put new list entry offset into first char
|
|
/ offset of list (r1)
|
|
2:
|
|
mov (sp)+,r2 / pop stack into r2; offset of new list
|
|
/ entry in r2
|
|
movb r2,cl+1(r1) / make new list entry the last entry in list
|
|
/ (r1)
|
|
asl r2 / multiply r2 by 2; r2 has clist offset for new
|
|
/ list entry
|
|
rts r0
|
|
|
|
iopen: / open file whose i-number is in r1
|
|
tst r1 / write or read access?
|
|
blt 2f / write, go to 2f
|
|
jsr r0,access; 2 / get inode into core with read access
|
|
cmp r1,340. / is it a special file
|
|
bgt 3f / no. 3f
|
|
mov r1,-(sp) / yes, figure out
|
|
asl r1
|
|
jmp *1f-2(r1) / which one and transfer to it
|
|
1:
|
|
otty / tty
|
|
oppt / ppt
|
|
sret / mem
|
|
sret / rf0
|
|
sret / rk0
|
|
sret / tap0
|
|
sret / tapl
|
|
sret / tap2
|
|
sret / tap3
|
|
sret / tap4
|
|
sret / tap5
|
|
sret / tap6
|
|
sret / tap7
|
|
ocvt / tty0
|
|
ocvt / ttyl
|
|
ocvt / tty2
|
|
ocvt / tty3
|
|
ocvt / tty4
|
|
ocvt / tty5
|
|
ocvt / tty6
|
|
ocvt / tty7
|
|
error / crd
|
|
|