mirror of
https://github.com/softwarejanitor/as65.git
synced 2024-11-21 17:32:10 +00:00
Fix a bug for Accumulator mode identification.
This commit is contained in:
parent
fbccd70b5b
commit
d6c2f4d123
17
as65.pl
17
as65.pl
@ -1176,6 +1176,10 @@ sub generate_Immediate {
|
||||
# TSB Zpg 04
|
||||
sub is_Zero_Page {
|
||||
my ($operand, $lineno) = @_;
|
||||
|
||||
# Don't mistake Accumulator mode for instructions like LSR.
|
||||
return 0 if $operand =~ /^[Aa]$/;
|
||||
|
||||
# Parse hex
|
||||
if ($operand =~ /^\$[0-9a-fA-F]{0,1}[0-9a-fA-F]$/) {
|
||||
return 2;
|
||||
@ -1279,6 +1283,10 @@ sub generate_Zero_Page {
|
||||
# STZ Zpg,X 74
|
||||
sub is_Zero_Page_X {
|
||||
my ($operand, $lineno) = @_;
|
||||
|
||||
# Don't mistake Accumulator mode for instructions like LSR.
|
||||
return 0 if $operand =~ /^[Aa]$/;
|
||||
|
||||
# Parse hex
|
||||
if ($operand =~ /^\$[0-9a-fA-F]{0,1}[0-9a-fA-F],[Xx]$/) {
|
||||
return 2;
|
||||
@ -1477,6 +1485,10 @@ sub generate_Zero_Page_Y {
|
||||
# TSB Abs 0C
|
||||
sub is_Absolute {
|
||||
my ($operand, $lineno) = @_;
|
||||
|
||||
# Don't mistake Accumulator mode for instructions like LSR.
|
||||
return 0 if $operand =~ /^[Aa]$/;
|
||||
|
||||
# Parse hex
|
||||
if ($operand =~ /^\$[0-9a-fA-F]{0,1}[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]$/) {
|
||||
return 2;
|
||||
@ -1688,6 +1700,10 @@ sub generate_Indirect_Absolute_X {
|
||||
# STZ Abs,X 9E
|
||||
sub is_Absolute_X {
|
||||
my ($operand, $lineno) = @_;
|
||||
|
||||
# Don't mistake Accumulator mode for instructions like LSR.
|
||||
return 0 if $operand =~ /^[Aa]$/;
|
||||
|
||||
# Parse hex
|
||||
if ($operand =~ /^\$[0-9a-fA-F]{0,1}[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F],[Xx]$/) {
|
||||
return 2;
|
||||
@ -2292,6 +2308,7 @@ sub generate_Implied {
|
||||
# ROR A 6A
|
||||
sub is_Accumulator {
|
||||
my ($operand, $lineno) = @_;
|
||||
|
||||
if ($operand =~ /^[Aa]$/ || $operand eq '') {
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user