mirror of
https://github.com/DoctorWkt/unix-jun72.git
synced 2026-01-11 23:53:34 +00:00
more ocr fixes; added EAE register addresses
This commit is contained in:
parent
b42665c20d
commit
5f66d08cea
@ -1,4 +1,4 @@
|
||||
rtssyms:
|
||||
rtssym:
|
||||
mov r0,-(sp)
|
||||
mov r1,-(sp)
|
||||
mov 4(sp),r0
|
||||
|
||||
@ -5,7 +5,7 @@ sysent:
|
||||
beq 1f / in progress
|
||||
jmp panic / called if trap inside system
|
||||
1:
|
||||
mov $s.syst+2,c1ockp
|
||||
mov $s.syst+2,clockp
|
||||
mov r0,-(sp) / save user registers
|
||||
mov sp,u.r0 / pointer to bottom of users stack in u.r0
|
||||
mov r1,-(sp)
|
||||
|
||||
@ -17,7 +17,7 @@ swap:
|
||||
br swap
|
||||
1:
|
||||
tst -(r2) / restore pointer to right Q entry
|
||||
mov r2,u.pr1 / set present user to this run queue
|
||||
mov r2,u.pri / set present user to this run queue
|
||||
movb (r2)+,r1 / move 1st process in queue to r1
|
||||
cmpb r1,(r2)+ / is there only 1 process in this Q to be run
|
||||
beq 1f / yes
|
||||
|
||||
@ -22,7 +22,7 @@ wswap:
|
||||
sub $user,r2 / get number of bytes to write out (user up
|
||||
/ to end of stack gets written out) ~
|
||||
neg r2 / make it negative V
|
||||
asr r2 / ciange bytes to words (divide by 2)
|
||||
asr r2 / change bytes to words (divide by 2)
|
||||
mov r2,swp+4 / word count
|
||||
movb u.uno,r1 / move user process number to r1
|
||||
asl r1 / x2 for index
|
||||
@ -42,13 +42,13 @@ wswap:
|
||||
rswap:
|
||||
asl r1 / process number x2 for index
|
||||
mov p.break-2(r1), swp+4 / word count
|
||||
mov p.dska2(r1),swp+2 / disk address
|
||||
mov p.dska-2(r1),swp+2 / disk address
|
||||
bis $2000,swp / read
|
||||
jsr r0,ppoke / read it in
|
||||
1:
|
||||
tstb swp+1 / done l
|
||||
bne 1b / no, wait for bit 15 to clear (inhibit blt)
|
||||
mov u.emt,*$3O / yes move these
|
||||
mov u.emt,*$30 / yes move these
|
||||
mov u.ilgins,*$10 / back
|
||||
rts r0 / return
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
cmp r2,u.usp / is break_above the "stack pointer before
|
||||
/ swapping"
|
||||
bhis 2f / yes, return
|
||||
mov secore,r3 / r3 points to end of core
|
||||
mov $ecore,r3 / r3 points to end of core
|
||||
add r3,r2
|
||||
sub u.usp,r2 / end of users stack is in r2
|
||||
1:
|
||||
@ -16,7 +16,7 @@
|
||||
|
||||
putlu: / r1 = user process no.; r2 points to lowest priority queue
|
||||
tstb (r2)+ / is queue empty?
|
||||
beg 1f / yes, branch
|
||||
beq 1f / yes, branch
|
||||
movb (r2),r3 / no, save the last user processnumber in_r3
|
||||
movb r1,p.link-1(r3) / put pointer to user on last users- link
|
||||
br 2f /
|
||||
@ -53,7 +53,7 @@ idle:
|
||||
rts r0
|
||||
|
||||
clear:
|
||||
jsr r0,ws1ot / get an I/O buffer set bits 9 and 15 in first
|
||||
jsr r0,wslot / get an I/O buffer set bits 9 and 15 in first
|
||||
/ word of I/O queue r5 points to first data word
|
||||
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@ ttyi: / console tty input interrupt routine
|
||||
beq 2f / yes 2f
|
||||
cmp r1,$177 / char = "del" ?
|
||||
beq 2f / yes, 2f
|
||||
jsr r0,putc; O / put char in r1 on clist entry
|
||||
jsr r0,putc; 0 / put char in r1 on clist entry
|
||||
br 1f
|
||||
movb r1,ttyoch / put char in ttyoch
|
||||
jsr r0,startty / load char in tty output data buffer
|
||||
@ -39,7 +39,7 @@ ttyi: / console tty input interrupt routine
|
||||
beq 1f / yes, 1f
|
||||
cmp r1,$12 / r1 = "lf"
|
||||
beq 1f / yes 1f
|
||||
cmpb cc+O,$15. / are there less than 15 chars on the input list
|
||||
cmpb cc+0,$15. / are there less than 15 chars on the input list
|
||||
blo retisp / yes, return
|
||||
1:
|
||||
jsr r0,wakeup; runq; 0 / no, wakeup the input process
|
||||
|
||||
@ -17,7 +17,7 @@ retisp:
|
||||
mov (sp)+,r2
|
||||
mov (sp)+,r1
|
||||
mov (sp)+,r0
|
||||
rtl / return from interrupt
|
||||
rti / return from interrupt
|
||||
|
||||
ppti: / paper tape lnput interrupt routine M
|
||||
jsr r0,setisp / save registers
|
||||
@ -44,7 +44,7 @@ ppti: / paper tape lnput interrupt routine M
|
||||
mov *$prb,r1 / place contents ppt read buffer in r1
|
||||
jsr r0,putc; 2 / place character in clist area for ppt input
|
||||
br .+2 / temp / if no space ln clist character lost
|
||||
cmpb cc+2,$S0. / character count in clist area for ppt lnput
|
||||
cmpb cc+2,$50. / character count in clist area for ppt lnput
|
||||
/ greater than or equal to 50
|
||||
bhis retisp / yes
|
||||
inc *$prs / no, set reader enable bit in prs
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
/ jsr r0,set1sp
|
||||
/ jsr r0,star1pt
|
||||
/ jsr r0,setisp
|
||||
/ jsr r0,starlpt
|
||||
/ br retisp
|
||||
ppto: / paper tape output in errupt routine
|
||||
jsr r0,set1sp / save registers
|
||||
jsr r0,setisp / save registers
|
||||
jsr r0,starppt / get next character from clist, and output
|
||||
/ if possible .
|
||||
br retisp / pop register values from stack
|
||||
@ -29,7 +29,7 @@ startty: / start or restart console tty output
|
||||
1:
|
||||
tstb *$tps / test console output ready bit
|
||||
bge 2f / branch if ready bit is clear
|
||||
tstb toutt+O / is toutt for console a zero
|
||||
tstb toutt+0 / is toutt for console a zero
|
||||
bne 2f / if not; branch to 2f
|
||||
movb ttyoch,r1 / put character to be output in r1
|
||||
bne 1f
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
pptito: / paper tape input touts subrouting
|
||||
cmpb pptif1g,$2 / does "pptiflg" indicate file just opened
|
||||
cmpb pptiflg,$2 / does "pptiflg" indicate file just opened
|
||||
bne 1f / no, do nothing pyf
|
||||
movb $10.,toutt+1 / yes, place 10 in tout entry for tty input
|
||||
tstb *$prs+1 / is error bit set
|
||||
@ -11,13 +11,13 @@ pptito: / paper tape input touts subrouting
|
||||
starppt: / start ppt output
|
||||
cmpb cc+3,$10. / is character count for ppt output greater
|
||||
/ than 10.
|
||||
bhl 1f / yes, branch
|
||||
bhi 1f / yes, branch
|
||||
jsr r0,wakeup; runq+2; 3 / no, wakeup process in wlist
|
||||
/ entry for ppt input
|
||||
1:
|
||||
tstb *$pps / is ready bit set in punch status word
|
||||
bge 1f / no, branch
|
||||
jsr r0,qetc; 3 / yes, get next char in clist for pptout and
|
||||
jsr r0,getc; 3 / yes, get next char in clist for pptout and
|
||||
/ place in r1
|
||||
br 1f / if none, branch
|
||||
mov r1,*$ppb / place character in ppt buffer
|
||||
@ -32,7 +32,7 @@ wakeup: / wakeup processes waiting for an event by linking them to the
|
||||
movb wlist(r3),r1 / r1 contains process number in that wait
|
||||
/ channel that was sleeping
|
||||
beq 2f / if O return, nothing to wakeup
|
||||
cmp r2,u.pr1 / is rung greater than or equal to users process
|
||||
cmp r2,u.pri / is rung greater than or equal to users process
|
||||
/ priority
|
||||
bhis 1f / yes, don't set time quantum to zero
|
||||
clrb uquant / time quantum = O
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
br 2f / yes, return to new user
|
||||
movb (sp)+,r1 / no, r1 = old process number that was originally
|
||||
/ on the wait channel
|
||||
beg 1f / if 0 branch
|
||||
beq 1f / if 0 branch
|
||||
mov $runq+4,r2 / r2 points to lowest priority queue
|
||||
mov $300,*$ps / processor priority = 6
|
||||
jsr r0,putlu / create llnk to old process number
|
||||
@ -21,7 +21,7 @@ isintr:
|
||||
/ typewriter
|
||||
beq 1f / if 0, do nothing except skip return
|
||||
movb 6(r1),r1 / put interrupt char in the tty buffer in r1
|
||||
beg 1f / if its 0 do nothing except skip return
|
||||
beq 1f / if its 0 do nothing except skip return
|
||||
cmp r1,$177 / is interrupt char e delete?
|
||||
bne 3f / no, so lt must be a quit (fs)
|
||||
tst u.intr / yes, value of u.intr determines handling
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
/ u5 - unix
|
||||
|
||||
mget:
|
||||
mov *u.fofp,mq / file offset in mq
|
||||
clr ac / later to be high sig
|
||||
@ -9,7 +10,7 @@ mget:
|
||||
bit $!17,r2
|
||||
bne 3f / branch if/r2 greater than or equal to 16
|
||||
bic $!16,r2 / clear all bits but bits 1,2,3
|
||||
mov 1.dskp(r2),r1 / r1 has physical block number
|
||||
mov i.dskp(r2),r1 / r1 has physical block number
|
||||
bne 2f / lf physical block num is zero then need a new block
|
||||
/ for file
|
||||
jsr r0,alloc / allocate a new block
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
2:
|
||||
tst (sp)+ / bump stack pointer
|
||||
rts r0
|
||||
|
||||
alloc:
|
||||
mov r2,-(sp) / save r2, r3 on stack
|
||||
mov r3,-(sp)
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
jsr r0,3f / have found a free block
|
||||
bic r3,(r2) / set bit for this block i.e. assign block
|
||||
br 2f
|
||||
|
||||
free:
|
||||
mov r2,-(sp) / save r2, r3
|
||||
mov r3,-(sp)
|
||||
@ -47,6 +48,7 @@ free:
|
||||
rts r0 / return to 'free'
|
||||
2:
|
||||
.byte 1,2,4,10,20,40,100,200 / masks for bits 0,...,7
|
||||
|
||||
access:
|
||||
jsr r0,iget / read in i-node for current directory (i-number
|
||||
/ passed in r1)
|
||||
|
||||
@ -12,11 +12,13 @@
|
||||
jmp error
|
||||
1:
|
||||
rts r0
|
||||
|
||||
setimod:
|
||||
movb $1,imod / set current i-node modified bytes
|
||||
mov s.time,i.mtim / put present tlme into file modified time
|
||||
mov s.time+2,i.mtim+2
|
||||
rts r0
|
||||
|
||||
imap: / get the byte that has the allocation bit for the i-number contained
|
||||
/ in r1
|
||||
mov $1,mq / put 1 in the mq
|
||||
@ -43,6 +45,7 @@ imap: / get the byte that has the allocation bit for the i-number contained
|
||||
add (sp)+,r2 / ?
|
||||
add $2,r2 / ?
|
||||
rts r0
|
||||
|
||||
iget:
|
||||
cmp r1, ii / r1 = i-number of current flle
|
||||
bne 1f
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
2:
|
||||
mov ii,r1
|
||||
rts r0
|
||||
|
||||
icalc: / i-node i is located in block (i+31.)/16. and begins 32.*
|
||||
/ (i+31)mod16 bytes from its start
|
||||
add $31.,r1 / add 31. to i-number
|
||||
@ -43,10 +44,10 @@ icalc: / i-node i is located in block (i+31.)/16. and begins 32.*
|
||||
bic $!17,(sp) / zero all but last 4 bits; gives (i+31.) mod 16
|
||||
mov (sp)+,mq / calculate offset in data buffer; 32.*(i+31.)mod16
|
||||
mov $5,lsh / for i-node i.
|
||||
add mq,r5 / r5 points to flrst word in i-node i.
|
||||
add mq,r5 / r5 points to first word in i-node i.
|
||||
mov $inode,r1 / inode is address of first word of current i-node
|
||||
mov $16.,r3
|
||||
tst (r0)+ / branch to 2f when argument in icalc call = 0
|
||||
tst (r0)+ / branch to 2 fwhen argument in icalc call = 0
|
||||
beq 2f / r0 now contains proper return address for rts r0
|
||||
1:
|
||||
mov (r1)+,(r5)+ / over write old i-node
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
dec r3
|
||||
bgt 2b
|
||||
rts r0
|
||||
|
||||
itrunc:
|
||||
jsr r0,iget
|
||||
mov $i.dskp,r2 / address of block pointers in r2
|
||||
|
||||
@ -45,7 +45,7 @@ delim:
|
||||
1:
|
||||
rts r5
|
||||
blank:
|
||||
jsr pc,qetc / get next character
|
||||
jsr pc,getc / get next character
|
||||
cmp $' ,r0 / leadino blanks
|
||||
beq blank / yes, ’squeeze out'
|
||||
cmp r0,$200+'\n / new—line preceded by \ is translated
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user