From 67840c5ad6b11154992e9de1ed50a8039884c0e3 Mon Sep 17 00:00:00 2001 From: Leeland Heins Date: Wed, 19 Dec 2018 09:57:12 -0600 Subject: [PATCH] Parsing fixes for ASC --- as65.pl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/as65.pl b/as65.pl index 6bbf46b..0993aa2 100644 --- a/as65.pl +++ b/as65.pl @@ -1963,6 +1963,26 @@ sub parse_line { $mnemonic = $2; $operand = ''; $comment = $4; + } elsif ($line =~ /^(\S+)\s+([Aa][Ss][Cc])\s+(".+")\s+(;.+)$/) { + $label = $1; + $mnemonic = $2; + $operand = $3; + $comment = $4; + } elsif ($line =~ /^\s+([Aa][Ss][Cc])\s+(".+")\s+(;.+)$/) { + $label = ''; + $mnemonic = $1; + $operand = $2; + $comment = $3; + } elsif ($line =~ /^(\S+)\s+([Aa][Ss][Cc])\s+(".+")\s*$/) { + $label = $1; + $mnemonic = $2; + $operand = $3; + $comment = ''; + } elsif ($line =~ /^\s+([Aa][Ss][Cc])\s+(".+")\s*$/) { + $label = ''; + $mnemonic = $1; + $operand = $2; + $comment = ''; } else { print "SYNTAX ERROR! $lineno : $line\n"; }