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

20
as65.pl
View File

@ -1963,6 +1963,26 @@ sub parse_line {
$mnemonic = $2; $mnemonic = $2;
$operand = ''; $operand = '';
$comment = $4; $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 { } else {
print "SYNTAX ERROR! $lineno : $line\n"; print "SYNTAX ERROR! $lineno : $line\n";
} }