I worked out the bug with the command-line arguments, I was overwriting

017777, oops. I've added more comments to wktcat.s (renamed from
simplecat.s). Now we need to find out how the real PDP-7 Unix
does command line arguments.
This commit is contained in:
Warren Toomey
2016-02-26 21:26:44 +10:00
parent 8f8cc64d10
commit 536de9ea56
2 changed files with 120 additions and 1 deletions
+3 -1
View File
@@ -33,6 +33,8 @@ die("Usage: $0 [-d] a.outfile [arg1 arg2 ...]\n") if ( @ARGV < 1 );
# and simulate it
load_code( shift(@ARGV) );
set_arguments(@ARGV);
#dump_memory();
#exit(0);
simulate();
exit(0);
@@ -105,7 +107,7 @@ sub set_arguments {
}
# Count the number of words to store each string and its pointer
my $wordcount=1; # 1 as we count the NULL pointer at end of array
my $wordcount=2; # 2 as we count the NULL pointer at end of array
my $argcount= @ARGV;
foreach my $arg (@ARGV) {
# +1 before /2 to allow for the NUL character at end of string