Parsing fixes for ASC

This commit is contained in:
Leeland Heins 2018-12-19 09:57:12 -06:00 committed by GitHub
parent 5f3789c651
commit 67840c5ad6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions

20
as65.pl
View File

@ -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";
}