1
0
mirror of https://github.com/DoctorWkt/unix-jun72.git synced 2026-04-09 06:39:24 +00:00

cleaned up assembly errors

This commit is contained in:
brad@heeltoe.com
2008-04-30 19:43:42 +00:00
parent 9b04bd95db
commit dfafd5e39a
11 changed files with 53 additions and 57 deletions

View File

@@ -17,9 +17,9 @@ clock: / interrupt from 60 cycle clock
inc -(r0)
1:
mov clockp,r0 / increment appropriate time category
inc (rO)
inc (r0)
bne 1f
inc -(rO)
inc -(r0)
1:
mov $uquant,r0 / decrement user time quantum
decb (r0)
@@ -36,7 +36,7 @@ clock: / interrupt from 60 cycle clock
sys 0 / sysrele
rti
2: / priority is high so just decrement time out counts
mov $toutt,r0 / rO points to beginning of time out table
mov $toutt,r0 / r0 points to beginning of time out table
2:
tstb (r0) / is the time out?
beq 3f / yes, 3f (get next entry)

View File

@@ -54,5 +54,3 @@ sleep: / wait for event
movb u.uno,wlist(r1) / put process number of process to put
/ to sleep in there
mov cdev,-(sp) / nothing happened in isintr so

View File

@@ -1,4 +1,4 @@
jar r0,swap / swap out process that needs to sleep
jsr r0,swap / swap out process that needs to sleep
mov (sp)+,cdev / restore device
jsr r0,isintr / check for interrupt of new process
br 2f / yes, return to new user
@@ -16,9 +16,9 @@
isintr:
mov r1,-(sp) / put number of wait channel on the stack
mov r2,—(sP) / save r2 .
mov r2,—(sp) / save r2
mov u.ttyp,r1 / r1 = pointer to buffer of process control
/ typewriter
/ 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

View File

@@ -36,7 +36,7 @@ preread:
dskrd:
jsr r0,bufaloc / shuffle off to bufalocg get a free I/0 buffer
br 1f
bis $2000,(rS) / set bit 10 of word 1 of I/O queue entry
bis $2000,(r5) / set bit 10 of word 1 of I/O queue entry
/ for buffer
jsr r0,poke / just assigned in bufalocg bit 10:1 says read
1:
@@ -53,5 +53,3 @@ dskrd:
wslot:
jsr r0,bufaloc / get a free I/0 buffer; pointer to first
br 1f / word in buffer in r5

View File

@@ -10,7 +10,7 @@
bis $101000,(r5) / set bits 9, 15 in 1st word of I/O queue
/ (write, inhibit bits)
clr *$ps / clear processor status
add $8,rS / r5 points to first word in data area for this
add $8,r5 / r5 points to first word in data area for this
/ block
rts r0
@@ -26,7 +26,7 @@ ppoke:
poke:
mov r1,—(sp)
mov r2,—(sp)
mov r3,-(sp)
mov r3,-(sp)
mov $bufp+nbuf+nbuf+6,r2 / r2 points to highest priority I/O
/ queue pointer
1:
@@ -47,7 +47,7 @@ poke:
blt prf / device id = 0; device is drum
bgt ptc / device id greater than or equal to 1; device is
/ dec tape
blt $2,active / test disk busy bit
bit $2,active / test disk busy bit
bne 2f / branch if bit is set
bis $2,active / set disk busy bit
mov r1,rkap / rkap points to current I/O queue entry for disk

View File

@@ -1,8 +1,8 @@
mov $rkda+2,r3 / A
mov ac,-(sp) / put remainder from divide on stack; gives
/ sector number
/ sector number
mov $4,lsh / shift quotient 4 bits, to align with cyl and surf
/ bits in rkda
/ bits in rkda
bis mq,(sp) / or mq with sector; gives total disk address
br 3f
prf: / drum
@@ -13,44 +13,44 @@ prf: / drum
mov $dae+2,r3
clr -(sp)
movb 2(r1),1(sp) / move low byte of physical block number into
/ high byte of stack
/ high byte of stack
clr -(sp) / word
movb 3(r1),(sp) / move high byte of physical block number into
/ low byte of stack
/ low byte of stack
mov (sp)+,-(r3) / load dae with high byt. of physical block
/ number
/ number
3:
mov (sp)+,-(r3) / load rkda register; load dar register
mov 6(r1),—(r3) / load bus address register
mov 4(r1),-(r3) / load word count register
mov $103,-(sp) / 103 indicates write operation when loaded
/ in csr
Abit $2000,(r1) / if bit 10 of word 1 of I/O queue entry is
bit $2000,(r1) / if bit 10 of word 1 of I/O queue entry is
/ a one
beq 3f / then read operation is indicated
mov $105,(sp) / 105 indicates read operation
beq 3f / then read operation is indicated
mov $105,(sp) / 105 indicates read operation
3:
mov (sp)+,—(r3) / load csr with interrupt enabled, command, go
br seta
mov (sp)+,—(r3) / load csr with interrupt enabled, command, go
br seta
ptc: / tape I/O
bit $4,active
bne 2f
mov tccm,r3
swab r3
bic $17,r3
add $2,r3
cmpb r3,(r1)
beq 3f
movb $1,tccm / stop transport if not same unit
bit $4,active
bne 2f
mov tccm,r3
swab r3
bic $17,r3
add $2,r3
cmpb r3,(r1)
beq 3f
movb $1,tccm / stop transport if not same unit
3:
bis $4,active
mov r1,tcap
mov $20.,tcerrc
mov sta e1,tcstate
movb (r1),r3 / device
sub $2,r3 / now unit
swab r3
bis $103,r3 / now rbn,for,un1t,1e
mov r3,tccm
bis $4,active
mov r1,tcap
mov $20.,tcerrc
mov sta e1,tcstate
movb (r1),r3 / device
sub $2,r3 / now unit
swab r3
bis $103,r3 / now rbn,for,un1t,1e
mov r3,tccm
seta: / I/O queue bookkeeping; set read/write waiting bits.
mov (r1),r3 / move word 1 of I/O queue entry into r3
mov (r1),r3 / move word 1 of I/O queue entry into r3

View File

@@ -1,5 +1,5 @@
bic $13000,r3 / clear all bits except 9 and 10
blc $3000,(r1) / clear only bits 9 and 10
bic $3000,(r1) / clear only bits 9 and 10
rol r3
rol r3
rol r3
@@ -52,5 +52,5 @@ bufaloc:
tst (r0)+ / skip if warmed over buffer
1:
mov -(r2),r5 / put pointer to word 1 of I/O queue entry in r5
movb cdev (rS) / put current device number in I/O queue entry
mov r1,2(r5) / move block number 1nto word 2 of I/O queue
movb cdev,(r5) / put current device number in I/O queue entry
mov r1,2(r5) / move block number into word 2 of I/O queue

View File

@@ -18,10 +18,10 @@ tape: / dec tape interrupt
taper: / dec tape error
dec tcerrc / decrement the number of errors
bne 1f / if more than 1 branch
bne 1f / if more than 1 branch
movb 1(r2),r3 / r2+1 points to command register upper byte
bic $17,r3 / clear all but bits 8-10 (Unit Selection)
lncb deverr+2(r3) / set error bit for this tape unit
incb deverr+2(r3) / set error bit for this tape unit
br tape3
1: / more than 1 error
bit $4000,(r2) / direction of tape
@@ -43,13 +43,13 @@ tape1: / read bn forward
bgt taper / if gt, reverse
mov 6(r1),—(r0) / put bus address in tcba
mov 4(r1),-(r0) / put word count in tcwc
mov $115,—(sp) / put end interrupt enable" »
bit $20000,(r1) / is waiting to read bit of I/O queue set?
mov $115,—(sp) / put end interrupt enable
bit $20000,(r1) / is "waiting to read bit" of I/O queue set?
beq 1f / no 1f
mov $105,(sp) / yes, put and lnterrupt enable
1:
movb (sp)+,(r2) / move function into command register (tccm)
bis $4,actlve / set active bit ·
bis $4,actlve / set active bit
mov $tape3,tcstate / get ready for I/O transfer
br 4f / go to retisp (rtl)

View File

@@ -29,10 +29,10 @@ disk:
br 3f / no, errors
mov $115,(r2) / drive reset, errbit was set
mov $1f,0b-2 / next time jmp *$0f is executed jmp will be
/ to 1f
/ to 1f
br 4f
1:
blt $20000,rkcs
bit $20000,rkcs
beq 4f / wait for seek complete
mov $0b,0b-2
mov rkap,r1

View File

@@ -4,12 +4,12 @@
trapt: / r2 points to the
mov (r0)+,r2 / device control register
mov *(r0)+,r1 / transaction pointer points to buffer
tst (sp)+
tst (sp)+
tstb (r2) / is ready bit of dcs set?
bge 4b / device still active so branch
bit (r0),act1ve / was device busy?
beq 4b / no, stray interrupt -
bio (r0)+,active / yes, set active to zero
bic (r0)+,active / yes, set active to zero
tst (r2) / test the err(bit is) of dcs
bge 2f / if no error jump to 2f
tst (r0)+ / skip on error

4
sys1.s
View File

@@ -1,7 +1,7 @@
rele = 0.
exit = 1.
fork = 2.
read = 3.
/ read = 3.
write = 4.
open = 5.
close = 6.
@@ -12,7 +12,7 @@ unlink = 10.
exec = 11.
chdir = 12.
time = 13.
mkdir = 14.
/ mkdir = 14.
chmod = 15.
chown = 16.
break = 17.