Added some more comments to ds.s
This commit is contained in:
+39
-38
@@ -219,14 +219,14 @@ nlinka: 0
|
|||||||
nlinkt: 0
|
nlinkt: 0
|
||||||
|
|
||||||
asters: 0
|
asters: 0
|
||||||
-10
|
-10 " Put -10 into c
|
||||||
dac c
|
dac c
|
||||||
1:
|
1:
|
||||||
law 052
|
law 052 " Print out a "*"
|
||||||
jms putc
|
jms putc
|
||||||
isz c
|
isz c
|
||||||
jmp 1b
|
jmp 1b " and loop back until 10 "*" are printed out
|
||||||
jmp asters i
|
jmp asters i " Leave the routine
|
||||||
|
|
||||||
longout: 0
|
longout: 0
|
||||||
lac statbuf+12 " i
|
lac statbuf+12 " i
|
||||||
@@ -416,38 +416,40 @@ done:
|
|||||||
sys exit
|
sys exit
|
||||||
|
|
||||||
putc: 0
|
putc: 0
|
||||||
and o177
|
and o177 " Keep the lowest 7 bits and save into 2f+1
|
||||||
dac 2f+1
|
dac 2f+1
|
||||||
lac opt
|
lac opt " Save the pointer to the empty buffer
|
||||||
dac 2f
|
dac 2f " position to 2f
|
||||||
add o400000
|
add o400000 " Flip the msb and save back into opt
|
||||||
dac opt
|
dac opt " This also has the effect of incrementing
|
||||||
spa
|
" the opt pointer every second addition!
|
||||||
jmp 1f
|
spa " If the bit was set, we already have one
|
||||||
lac 2f i
|
jmp 1f " character at 2f+1. If no previous character,
|
||||||
|
lac 2f i " merge the old and new character together
|
||||||
xor 2f+1
|
xor 2f+1
|
||||||
jmp 3f
|
jmp 3f " and go to the "save it in buffer" code
|
||||||
1:
|
1:
|
||||||
lac 2f+1
|
lac 2f+1 " Move the character up into the top half
|
||||||
alss 9
|
alss 9
|
||||||
3:
|
3:
|
||||||
dac 2f i
|
dac 2f i " Save the word into the buffer
|
||||||
isz noc
|
isz noc " Add 1 to the char count, never skipping
|
||||||
lac noc
|
lac noc " Have we reached 128 characters, 64 words?
|
||||||
sad d128
|
sad d128
|
||||||
skp
|
skp
|
||||||
jmp putc i
|
jmp putc i " No, so return (more room still in the buffer)
|
||||||
lac fo
|
lac fo " Load fd1 (i.e stdout)
|
||||||
sys write; obuf; 64
|
sys write; obuf; 64 " and write out the 64 words in the buffer
|
||||||
lac iopt
|
lac iopt
|
||||||
dac opt
|
dac opt " Set opt pointing back to base of buffer
|
||||||
dzm noc
|
dzm noc " Set the number of chars in the buffer to 0
|
||||||
jmp putc i
|
jmp putc i " and return
|
||||||
2: 0;0
|
|
||||||
opt: obuf
|
2: 0;0 " Current input and output word pointers
|
||||||
iopt: obuf
|
opt: obuf " Pointer to the output buffer
|
||||||
noc: 0
|
iopt: obuf " Pointer to the output buffer
|
||||||
fo: 1
|
noc: 0 " Number of output characters
|
||||||
|
fo: 1 " Output file descriptor, fd 1 is stdout
|
||||||
|
|
||||||
d1: 1
|
d1: 1
|
||||||
o177: 0177
|
o177: 0177
|
||||||
@@ -459,19 +461,19 @@ d8: 8
|
|||||||
o60: 060
|
o60: 060
|
||||||
o20: 020
|
o20: 020
|
||||||
d501: 501
|
d501: 501
|
||||||
|
" Names of files and directories
|
||||||
dd:
|
dd:
|
||||||
<dd>; 040040; 040040; 040040
|
<dd>; 040040; 040040; 040040 " dd
|
||||||
dotdot:
|
dotdot:
|
||||||
056056; 040040; 040040; 040040
|
056056; 040040; 040040; 040040 " ..
|
||||||
system:
|
system:
|
||||||
<sy>;<st>;<em>; 040040
|
<sy>;<st>;<em>; 040040 " system
|
||||||
scrname:
|
scrname:
|
||||||
<*s>;<rc>;040040;040040
|
<*s>;<rc>;040040;040040 " *src
|
||||||
pass2:
|
pass2:
|
||||||
<i
|
<i " i
|
||||||
pass1:
|
pass1:
|
||||||
<i 012
|
<i 012 " i\n
|
||||||
|
|
||||||
fso: .=.+1
|
fso: .=.+1
|
||||||
fsi: .=.+1
|
fsi: .=.+1
|
||||||
@@ -479,7 +481,7 @@ fsloc: .=.+1
|
|||||||
nfiles: .=.+1
|
nfiles: .=.+1
|
||||||
fflg: .=.+1
|
fflg: .=.+1
|
||||||
buf: .=.+64
|
buf: .=.+64
|
||||||
obuf: .=.+64
|
obuf: .=.+64 " Output buffer
|
||||||
fd: .=.+1
|
fd: .=.+1
|
||||||
filp: .=.+1
|
filp: .=.+1
|
||||||
ddfilp: .=.+1
|
ddfilp: .=.+1
|
||||||
@@ -498,4 +500,3 @@ fsopt: .=.+1
|
|||||||
fsobuf: .=.+64
|
fsobuf: .=.+64
|
||||||
dbuf: .=.+100
|
dbuf: .=.+100
|
||||||
fbuf:
|
fbuf:
|
||||||
|
|
||||||
Reference in New Issue
Block a user