diff --git a/src/cmd/cat.s b/src/cmd/cat.s index 76b8d45..12a08e3 100644 --- a/src/cmd/cat.s +++ b/src/cmd/cat.s @@ -41,16 +41,16 @@ loop1: badfile: lac name " Get the pointer to the filename 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 - lac d8 + lac d1 sys write; 1f; 2 " and then write " ?\n" jmp loop1 " Now try doing the next argument 1: 040;077012 " String literal: " ?\n" nofiles: - lac d8 + lac d1 sys write; 1f; 5 " Write "No files\n" to stderr sys exit " and exit diff --git a/src/other/wktln.s b/src/other/wktln.s index 3fdcc91..e0d441a 100644 --- a/src/other/wktln.s +++ b/src/other/wktln.s @@ -3,22 +3,24 @@ main: lac 017777 i " Load the pointer pointer in 017777 - sad d8 " to see if we have two - jmp nofiles " No arguments, stop now + sad d12 " to see if we have three + jmp nofiles " Not enough arguments, stop now lac 017777 " Move five words past the argument word count tad d5 " so that AC points at the first argument dac name1 " and save it tad d4 " Then do the same for the second name 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 jmp badfile " Print out an error on failure sys exit nofiles: - lac d8 + lac d1 sys write; 1f; 5 " Write "No files\n" to stderr sys exit " and exit @@ -27,9 +29,9 @@ nofiles: badfile: lac name1 " Get the pointer to the filename 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 - lac d8 + lac d1 sys write; 1f; 2 " and then write " ?\n" sys exit @@ -38,4 +40,4 @@ badfile: d1: 1 d4: 4 d5: 5 -d8: 8 +d12: 12 diff --git a/src/other/wktmv.s b/src/other/wktmv.s index 56d443e..08e8f5d 100644 --- a/src/other/wktmv.s +++ b/src/other/wktmv.s @@ -18,8 +18,8 @@ main: nofiles: - lac d8 - sys write; 1f; 5 " Write "No files\n" to stderr + lac d1 + sys write; 1f; 5 " Write "No files\n" to stdout sys exit " and exit 1: ; ;;