diff --git a/pages/e11-01 b/pages/e11-01
index f9b30fd..e47e7df 100644
--- a/pages/e11-01
+++ b/pages/e11-01
@@ -1,26 +1,26 @@
/ sh -- command interpreter
mov sp,r5
- mov r5.shel larg / save orig sp in shel larg
- cdpb B(r5),$'- / was this sh calleZd by init or loginx~
+ mov r5,shellarg / save orig sp in shellarg
+ cmpb 8(r5),$'- / was this sh calleZd by init or loginx~
bne 2f / no
- sys intr; O / yes, turn off interrupts
- sys quit; O
+ sys intr; 0 / yes, turn off interrupts
+ sys quit; 0
2:
sys getuid / who is user
tst r0 / is it superuser
bne 2f / no
movb $'#,at / yes, set new prompt symbol
2:
- cmn (r5),$l / tty input?
+ cmp (r5),$1 / tty input?
ble newline / yes, call with '-(or with no command
/ file name)
- clr rO / no, set ttv
+ clr r0 / no, set ttv
sys close / close it
mov 4(r5),0f / get new file name
- sys open; O:..; 0 / open it
+ sys open; 0:..; 0 / open it
bec 1f / branch if no error
jsr r5,error / error in file name
- /: .even
+ : .even
sys exit
1:
clr at / clear prompt character, if reading non-tty
@@ -28,10 +28,10 @@
newline:
tst at / is there a prompt symbol
beq newcom / no
- mov $1,rO / yes
+ mov $1,r0 / yes
sys write; at; 2. / print prompt
newcom:
- mov shellarq,sp /
+ mov shellarg,sp /
mov $parbuf,r3 / initialize command list area
mov $parp,r4 / initialize command list pointers
clr infile / initialize alternate input
@@ -41,10 +41,10 @@ newarg:
jsr pc,blank / squeeze out leading blanks
jsr r5,delim / is new character a ; \n or &
br 2f / yes
- mov r3,-(sp) I no, push arg pointer onto stack
- cmp rO,$'< / new input file?
+ mov r3,-(sp) / no, push arg pointer onto stack
+ cmp r0,$'< / new input file?
bne 1f / no
- mov (sp).infile / yes, save arg pointer
+ mov (sp),infile / yes, save arg pointer
clr (sp) / clear pointer
br 3f
1:
@@ -53,4 +53,3 @@ newarg:
mov (sp),outfile / yes, save arg pointer
clr (sp) / clear pointer
br 3f
-
diff --git a/pages/e11-02 b/pages/e11-02
index 75da1dc..74ccd58 100644
--- a/pages/e11-02
+++ b/pages/e11-02
@@ -1,30 +1,30 @@
newchar:
- cmp $' .r0 / is character a blank
+ cmp $' ,r0 / is character a blank
beq 1f / branch if it is (blank as arg separator)
- cmp $’\n+200,r0 / treat \n preceded by \
+ cmp $'\n+200,r0 / treat \n preceded by \
beq 1f / as blank
jsr pc,putc / put this character in parbuf list
3:
jsr pc,getc / get next character
- jsr r5,delim / is char a : \n or &,
+ jsr r5,delim / is char a ; \n or &,
br 1f / yes
br newchar / no, start new character tests
1:
clrb (r3)+ / end name with \0 when read blank, or
/ delim
- mov (sp)+,(r4)+ / move are ant! to par? location
- bne 1f / if (sp)=O, in file or out file points to arg
- tst -(r4) / so ignore dummy (O), in pointer list
+ mov (sp)+,(r4)+ / move arg ptr to parp location
+ bne 1f / if (sp)=0, in file or out file points to arg
+ tst -(r4) / so ignore dummy (0), in pointer list
1:
- jsr r5,delim / is char a : \n or &.
+ jsr r5,delim / is char a ; \n or &.
br 2f / yes
br newarg / no, start newarg processing
2:
clr (r4) / \n, &, or ; takes to here (end of arg list)
- / after ’dellm’ call
+ / after 'delim' call
mov r0,-(sp) / save delimter in stack
jsr pc,docom / go to exec command in parbuf
- cmpb (sp),$’& / get a new command without wait?
+ cmpb (sp),$'& / get a new command without wait?
beq newcom / yes
tst r1 / was chdir just executed or line ended with
/ ampersand?
@@ -36,7 +36,7 @@ newchar:
cmp r0,r1 / is this my child
bne 1b
2:
- cmp (sp),$’\n / was delimiter a new line
+ cmp (sp),$'\n / was delimiter a new line
beq newline / yes
br newcom / no, pick up next command
docom:
@@ -47,10 +47,9 @@ docom:
1:
jsr r5,chcom; qchdir / is command chdir?
br 2f / command not chdir
- cmp r4,$4 / prepare to exec chdir, 4=aro count x 2
+ cmp r4,$4 / prepare to exec chdir, 4=arg count x 2
beq 3f
jsr r5,error / go to print error
; .even
br 4f
3:
-
diff --git a/pages/e11-03 b/pages/e11-03
index d801cab..0edd429 100644
--- a/pages/e11-03
+++ b/pages/e11-03
@@ -7,10 +7,10 @@
clr r1 / set r1 to zero to dkip wait
rts pc / and return
2:
- jsr r5,chcom: qloqin / is command looin?
- br 2f / not loqin, no to fork
- sys exec; parbuf: parp / exec login
- sys exec; binpb: parp / or /bin/login
+ jsr r5,chcom: qloqin / is command login?
+ br 2f / not loqin, go to fork
+ sys exec; parbuf; parp / exec login
+ sys exec; binpb; parp / or /bin/login
2: / no error return??
sys fork / generate sh child process for command
br newproc / exec command with new process
@@ -20,7 +20,7 @@
jmp newline / and return for next try
1:
mov r0,r1 / save id of child sh
- rts pc / return to “jsr pc, docom“ call in parent sh
+ rts pc / return to "jsr pc, docom" call in parent sh
error:
movb (r5)+,och / pick up diagnostic character
@@ -30,27 +30,27 @@ error:
br error / continue to get characters
1:
inc r5 / inc r5 to point to return
- bic $!,r5 / make it even
+ bic $1,r5 / make it even
clr r0 / set for input
- sys seek;,O; 2 / exit from runcom. skip to end of
+ sys seek; 0; 2 / exit from runcom. skip to end of
/ input file
chcom: / has no effect if tty input
mov (r5)+,r1 / glogin gchdir r1, bump r5
- mov $parbuf,r2 / command address r2 ’login’
+ mov $parbuf,r2 / command address r2 'login'
1:
- movb (r1)+,r0 / is this command ’chdir’
- cmpb (r2)+,r0 / compare command name byte with 'login’
- / or ’chdir’
- bne 1f / doesn’t compare
+ movb (r1)+,r0 / is this command 'chdir'
+ cmpb (r2)+,r0 / compare command name byte with 'login'
+ / or 'chdir'
+ bne 1f / doesn't compare
tst r0 / is this
- one 1b / end of names
+ bne 1b / end of names
tst (r5)+ / yes, bump r5 again to execute login
- / chdir
+ / chdir
1:
rts r5 / no, return to exec command
+
putc:
cmp r0,$'' / single quote?
beq 1f / yes
- cmp r0,$’" / double quote
+ cmp r0,$'" / double quote
beq 1f / yes
-
diff --git a/pages/e11-04 b/pages/e11-04
index bd95278..c75ac40 100644
--- a/pages/e11-04
+++ b/pages/e11-04
@@ -1,14 +1,14 @@
bic $!177,r0 / no, remove 200, if present
movb r0,(r3)+ / store character in parbuf
- rts po
+ rts pc
1:
mov r0,-(sp) / push quote mark onto stack
1:
- jsr pc,getc / get a quoted charactef
- cmp | r0.$’\n / is it end or line
+ jsr pc,getc / get a quoted character
+ cmp r0,$'\n / is it end or line
bne 2f / no
jsr r5,error / yes, indicate missing quote mark
- <"’ imbalance\n\0)>; .even
+ <"' imbalance\n\0)>; .even
jmp newline / ask for new line
2:
cmp r0,(sp) / is this closing quote mark
@@ -18,38 +18,39 @@
br 1b / continue
1:
tst (sp)+ / pop quote mark off stack
- ’ rts bc‘, return
-/ thp‘e new process
+ rts pc / return
+
+/ thp`e new process
+
newproc:
mov infile,0f / move pointer to new file name
- beq lf / branch if no alternate read file given
+ beq 1f / branch if no alternate read file given
tstb *0f
beq 3f / branch if no file name miven
- clr rO / set tty input file name
+ clr r0 / set tty input file name
sys close / close it
sys open; 0:..; 0 / open new input file for reading
bcc 1f / branch if input file ok
3:
jsr r5,error / file not ok, print error
- : .even / this diagnostic
- sys exit / terminate this process and make narent sh
+ ; .even / this diagnostic
+ sys exit / terminate this process and make parent sh
1:
mov outfile,r2 / more pointer to new file name
beq 1f / branch if no alternate write file
- cmpb (r2),$’> / is > at beqinninrg of file name?
- bne 4f / branch if it isn’t
+ cmpb (r2),$'> / is > at beqinninrg of file name?
+ bne 4f / branch if it isn't
inc r2 / yes, increment pointer
mov r2,0f
- svs open; O:..; 1 / open file for writing
+ sys open; 0:..; 1 / open file for writing
bec 3f / if no error
4:
mov r2,0f
sys creat; 0:..; 17 / create new file with this name
- bec 3f / branch it no error
+ bec 3f / branch if no error
2:
jsr r5,error
-