mirror of
https://github.com/softwarejanitor/as65.git
synced 2024-12-28 17:30:11 +00:00
Fixed parsing bug
This commit is contained in:
parent
35940077f5
commit
394479783e
10
as65.pl
10
as65.pl
@ -1975,6 +1975,11 @@ sub parse_line {
|
||||
$mnemonic = $1;
|
||||
$operand = '';
|
||||
$comment = $2;
|
||||
} elsif ($line =~ /^(\S+)\s+(\S+)\s+(;.+)$/) {
|
||||
$label = $1;
|
||||
$mnemonic = $2;
|
||||
$operand = '';
|
||||
$comment = $4;
|
||||
} else {
|
||||
print "SYNTAX ERROR! $lineno : $line\n";
|
||||
}
|
||||
@ -2065,6 +2070,8 @@ if (open($ifh, "<$input_file")) {
|
||||
$symbol =~ s/:$//;
|
||||
print "%%%% Saving Symbol $symbol $operand\n" if $verbose;
|
||||
$symbols{$symbol} = $operand;
|
||||
} elsif ($ucmnemonic eq 'OBJ') {
|
||||
# Just ignore this
|
||||
# Mnemonic Addressing mode Form Opcode Size Timing
|
||||
} elsif (defined $mnemonics{$ucmnemonic}) {
|
||||
my $foundit = 0;
|
||||
@ -2140,9 +2147,10 @@ if (open($ifh, "<$input_file")) {
|
||||
|
||||
my $ucmnemonic = uc($mnemonic);
|
||||
|
||||
# Skip ORG and EQU on pass 2.
|
||||
# Skip ORG, EQU and OBJ on pass 2.
|
||||
next if $ucmnemonic =~ /ORG/i;
|
||||
next if $ucmnemonic =~ /EQU|\.EQ/i;
|
||||
next if $ucmnemonic =~ /OBJ/i;
|
||||
|
||||
if (defined $mnemonics{$ucmnemonic}) {
|
||||
my $foundit = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user