Fixed bug in EQU processing

This commit is contained in:
Leeland Heins 2018-12-18 07:35:45 -06:00 committed by GitHub
parent 74ea8cfaa4
commit 802a189b14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

12
as65.pl
View File

@ -1587,12 +1587,12 @@ sub generate_Indirect_Zero_Page_X {
# STA (Zpg),Y 91
sub is_Indirect_Zero_Page_Y {
my ($operand, $lineno) = @_;
if ($operand =~ /^\(\$([0-9a-fA-F][0-9a-fA-F])\),[Yy]/) {
if ($operand =~ /^\(\$([0-9a-fA-F][0-9a-fA-F])\),[Yy]$/) {
return 2;
} elsif ($operand =~ /^\((\d+)\),[Yy]/) {
return 0 if $1 > 255;
return 2;
} elsif ($operand =~ /^\(([A-Za-z\.][A-Za-z0-9_\.]+)\),[Yy]/) {
} elsif ($operand =~ /^\(([A-Za-z\.][A-Za-z0-9_\.]+)\),[Yy]$/) {
# Not Indirect Zero Page,Y if the symbol is not 8 bits.
my $symval = $symbols{$1};
if (defined $symval) {
@ -2054,13 +2054,7 @@ if (open($ifh, "<$input_file")) {
my $symbol = $label;
$symbol =~ s/:$//;
print "%%%% Saving Symbol $symbol $operand\n" if $verbose;
if ($operand =~ /^\$([0-8a-fA-F]+)$/) {
$symbols{$symbol} = sprintf("\$%04x", hex(lc($1)));
} elsif ($operand =~ /^\$(\d+)$/) {
$symbols{$symbol} = sprintf("%d", $1);
} else {
$symbols{$symbol} = $operand;
}
$symbols{$symbol} = $operand;
# Mnemonic Addressing mode Form Opcode Size Timing
} elsif (defined $mnemonics{$ucmnemonic}) {
my $foundit = 0;