From f46777b272fa99a25fa24a0b6ba5c018a2156913 Mon Sep 17 00:00:00 2001 From: Warren Toomey Date: Wed, 24 Feb 2016 11:15:47 +1000 Subject: [PATCH] Added code to output the final machine code in octal. Parse the 'i' argument to instructions that indicate indirect mode. --- tools/as7 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tools/as7 b/tools/as7 index 17ee942..841f61f 100755 --- a/tools/as7 +++ b/tools/as7 @@ -39,6 +39,13 @@ foreach my $file (@ARGV) { parse_file($file); } +# Now print out the contents of memory +for my $i ( 0 .. $#Mem ) { + if (defined($Mem[$i])) { + printf("%06o: %06o\n", $i, $Mem[$i]); + } +} + exit(0); # Open and parse the given file @@ -277,21 +284,25 @@ sub parse_expression { 'mmse' => 0707644, ); - # Split the expression into two words separated by whitespace - my ( $word1, $word2 ) = split( /\s+/, $expression ); - printf( "o>%s%s%s%s%s