Fixed ln to have three arguments. Use stdout not stderr.
This commit is contained in:
+3
-3
@@ -41,16 +41,16 @@ loop1:
|
|||||||
badfile:
|
badfile:
|
||||||
lac name " Get the pointer to the filename
|
lac name " Get the pointer to the filename
|
||||||
dac 1f " Store it in 1f below
|
dac 1f " Store it in 1f below
|
||||||
lac d8 " Load fd 8 which is stderr
|
lac d1 " Load fd 1 which is stdout
|
||||||
sys write; 1:0; 4 " Write the four words of the filename
|
sys write; 1:0; 4 " Write the four words of the filename
|
||||||
lac d8
|
lac d1
|
||||||
sys write; 1f; 2 " and then write " ?\n"
|
sys write; 1f; 2 " and then write " ?\n"
|
||||||
jmp loop1 " Now try doing the next argument
|
jmp loop1 " Now try doing the next argument
|
||||||
|
|
||||||
1: 040;077012 " String literal: " ?\n"
|
1: 040;077012 " String literal: " ?\n"
|
||||||
|
|
||||||
nofiles:
|
nofiles:
|
||||||
lac d8
|
lac d1
|
||||||
sys write; 1f; 5 " Write "No files\n" to stderr
|
sys write; 1f; 5 " Write "No files\n" to stderr
|
||||||
sys exit " and exit
|
sys exit " and exit
|
||||||
|
|
||||||
|
|||||||
+9
-7
@@ -3,22 +3,24 @@
|
|||||||
main:
|
main:
|
||||||
|
|
||||||
lac 017777 i " Load the pointer pointer in 017777
|
lac 017777 i " Load the pointer pointer in 017777
|
||||||
sad d8 " to see if we have two
|
sad d12 " to see if we have three
|
||||||
jmp nofiles " No arguments, stop now
|
jmp nofiles " Not enough arguments, stop now
|
||||||
lac 017777 " Move five words past the argument word count
|
lac 017777 " Move five words past the argument word count
|
||||||
tad d5 " so that AC points at the first argument
|
tad d5 " so that AC points at the first argument
|
||||||
dac name1 " and save it
|
dac name1 " and save it
|
||||||
tad d4 " Then do the same for the second name
|
tad d4 " Then do the same for the second name
|
||||||
dac name2
|
dac name2
|
||||||
|
tad d4 " and the third name
|
||||||
|
dac name3
|
||||||
|
|
||||||
sys link; name1:0; name2:0 " Link the file
|
sys link; name1:0; name2:0; name3:0 " Link the file
|
||||||
spa
|
spa
|
||||||
jmp badfile " Print out an error on failure
|
jmp badfile " Print out an error on failure
|
||||||
sys exit
|
sys exit
|
||||||
|
|
||||||
|
|
||||||
nofiles:
|
nofiles:
|
||||||
lac d8
|
lac d1
|
||||||
sys write; 1f; 5 " Write "No files\n" to stderr
|
sys write; 1f; 5 " Write "No files\n" to stderr
|
||||||
sys exit " and exit
|
sys exit " and exit
|
||||||
|
|
||||||
@@ -27,9 +29,9 @@ nofiles:
|
|||||||
badfile:
|
badfile:
|
||||||
lac name1 " Get the pointer to the filename
|
lac name1 " Get the pointer to the filename
|
||||||
dac 1f " Store it in 1f below
|
dac 1f " Store it in 1f below
|
||||||
lac d8 " Load fd 8 which is stderr
|
lac d1 " Load fd 1 which is stdout
|
||||||
sys write; 1:0; 4 " Write the four words of the filename
|
sys write; 1:0; 4 " Write the four words of the filename
|
||||||
lac d8
|
lac d1
|
||||||
sys write; 1f; 2 " and then write " ?\n"
|
sys write; 1f; 2 " and then write " ?\n"
|
||||||
sys exit
|
sys exit
|
||||||
|
|
||||||
@@ -38,4 +40,4 @@ badfile:
|
|||||||
d1: 1
|
d1: 1
|
||||||
d4: 4
|
d4: 4
|
||||||
d5: 5
|
d5: 5
|
||||||
d8: 8
|
d12: 12
|
||||||
|
|||||||
+4
-4
@@ -18,8 +18,8 @@ main:
|
|||||||
|
|
||||||
|
|
||||||
nofiles:
|
nofiles:
|
||||||
lac d8
|
lac d1
|
||||||
sys write; 1f; 5 " Write "No files\n" to stderr
|
sys write; 1f; 5 " Write "No files\n" to stdout
|
||||||
sys exit " and exit
|
sys exit " and exit
|
||||||
|
|
||||||
1: <tw>; <o 040; <fi>;<le>;<s 012
|
1: <tw>; <o 040; <fi>;<le>;<s 012
|
||||||
@@ -27,9 +27,9 @@ nofiles:
|
|||||||
badfile:
|
badfile:
|
||||||
lac name1 " Get the pointer to the filename
|
lac name1 " Get the pointer to the filename
|
||||||
dac 1f " Store it in 1f below
|
dac 1f " Store it in 1f below
|
||||||
lac d8 " Load fd 8 which is stderr
|
lac d1 " Load fd 1 which is stdout
|
||||||
sys write; 1:0; 4 " Write the four words of the filename
|
sys write; 1:0; 4 " Write the four words of the filename
|
||||||
lac d8
|
lac d1
|
||||||
sys write; 1f; 2 " and then write " ?\n"
|
sys write; 1f; 2 " and then write " ?\n"
|
||||||
sys exit
|
sys exit
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user