mirror of
https://github.com/softwarejanitor/as65.git
synced 2024-11-24 20:32:54 +00:00
Bug fixes
This commit is contained in:
parent
89ea245915
commit
9900d41517
20
as65.pl
20
as65.pl
@ -1101,10 +1101,7 @@ sub generate_Zero_Page_X {
|
|||||||
my ($addr, $operand, $opcode, $ofh, $lineno) = @_;
|
my ($addr, $operand, $opcode, $ofh, $lineno) = @_;
|
||||||
# Parse hex
|
# Parse hex
|
||||||
if ($operand =~ /^\$([0-9a-fA-F][0-9a-fA-F]),[Xx]$/) {
|
if ($operand =~ /^\$([0-9a-fA-F][0-9a-fA-F]),[Xx]$/) {
|
||||||
my $opval = $1;
|
my $opval = hex(lc($1));
|
||||||
if ($operand =~ /^\$/) {
|
|
||||||
$opval = hex(lc($1));
|
|
||||||
}
|
|
||||||
generate_16($ofh, $addr, $opcode, $opval);
|
generate_16($ofh, $addr, $opcode, $opval);
|
||||||
# Parse decimal
|
# Parse decimal
|
||||||
} elsif ($operand =~ /^(\d+),[Xx]$/) {
|
} elsif ($operand =~ /^(\d+),[Xx]$/) {
|
||||||
@ -1172,10 +1169,7 @@ sub generate_Zero_Page_Y {
|
|||||||
my ($addr, $operand, $opcode, $ofh, $lineno) = @_;
|
my ($addr, $operand, $opcode, $ofh, $lineno) = @_;
|
||||||
# Parse hex
|
# Parse hex
|
||||||
if ($operand =~ /^\$(\[0-9a-fA-F][0-9a-fA-F]),[Yy]/) {
|
if ($operand =~ /^\$(\[0-9a-fA-F][0-9a-fA-F]),[Yy]/) {
|
||||||
my $opval = $1;
|
my $opval = hex(lc($1));
|
||||||
if ($operand =~ /^\$/) {
|
|
||||||
$opval = hex(lc($1));
|
|
||||||
}
|
|
||||||
generate_16($ofh, $addr, $opcode, $opval);
|
generate_16($ofh, $addr, $opcode, $opval);
|
||||||
# Parse decimal
|
# Parse decimal
|
||||||
} elsif ($operand =~ /^(\d+),[Yy]/) {
|
} elsif ($operand =~ /^(\d+),[Yy]/) {
|
||||||
@ -1560,10 +1554,9 @@ sub is_Indirect_Zero_Page_X {
|
|||||||
|
|
||||||
sub generate_Indirect_Zero_Page_X {
|
sub generate_Indirect_Zero_Page_X {
|
||||||
my ($addr, $operand, $opcode, $ofh, $lineno) = @_;
|
my ($addr, $operand, $opcode, $ofh, $lineno) = @_;
|
||||||
my $opval = '';
|
|
||||||
# Parse hex
|
# Parse hex
|
||||||
if ($operand =~ /^\(\$([0-9a-fA-f][0-9a-fA-f])\),[Xx]/) {
|
if ($operand =~ /^\(\$([0-9a-fA-f][0-9a-fA-f])\),[Xx]/) {
|
||||||
$opval = hex(lc($1));
|
my $opval = hex(lc($1));
|
||||||
generate_16($ofh, $addr, $opcode, $opval);
|
generate_16($ofh, $addr, $opcode, $opval);
|
||||||
# Parse decimal
|
# Parse decimal
|
||||||
} elsif ($operand =~ /^\((\d+)\),[Xx]/) {
|
} elsif ($operand =~ /^\((\d+)\),[Xx]/) {
|
||||||
@ -1594,7 +1587,7 @@ sub generate_Indirect_Zero_Page_X {
|
|||||||
# STA (Zpg),Y 91
|
# STA (Zpg),Y 91
|
||||||
sub is_Indirect_Zero_Page_Y {
|
sub is_Indirect_Zero_Page_Y {
|
||||||
my ($operand, $lineno) = @_;
|
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;
|
return 2;
|
||||||
} elsif ($operand =~ /^\((\d+)\),[Yy]/) {
|
} elsif ($operand =~ /^\((\d+)\),[Yy]/) {
|
||||||
return 0 if $1 > 255;
|
return 0 if $1 > 255;
|
||||||
@ -1636,10 +1629,7 @@ sub generate_Indirect_Zero_Page_Y {
|
|||||||
my ($addr, $operand, $opcode, $ofh, $lineno) = @_;
|
my ($addr, $operand, $opcode, $ofh, $lineno) = @_;
|
||||||
# Parse hex
|
# Parse hex
|
||||||
if ($operand =~ /^\(\$([0-9a-fA-F][0-9a-fA-F])\),[Yy]$/) {
|
if ($operand =~ /^\(\$([0-9a-fA-F][0-9a-fA-F])\),[Yy]$/) {
|
||||||
my $opval = $1;
|
my $opval = hex(lc($1));
|
||||||
if ($operand =~ /^\$/) {
|
|
||||||
$opval = hex(lc($1));
|
|
||||||
}
|
|
||||||
generate_16($ofh, $addr, $opcode, $opval);
|
generate_16($ofh, $addr, $opcode, $opval);
|
||||||
# Parse decimal
|
# Parse decimal
|
||||||
} elsif ($operand =~ /^\((\d+)\),[Yy]$/) {
|
} elsif ($operand =~ /^\((\d+)\),[Yy]$/) {
|
||||||
|
Loading…
Reference in New Issue
Block a user