From efe0502705589f3c0781e893693a6675e77adee0 Mon Sep 17 00:00:00 2001 From: Leeland Heins Date: Thu, 20 Dec 2018 12:50:37 -0600 Subject: [PATCH] Fixed bug in DFB --- as65.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/as65.pl b/as65.pl index 33e21c3..c34fc10 100644 --- a/as65.pl +++ b/as65.pl @@ -897,6 +897,7 @@ sub handle_16_bit_symbol { $opval1 = hex(lc($1)); $opval2 = hex(lc($2)); } else { + $symval =~ s/^\$//; my $opval = sprintf("%04x", $symval); $opval1 = hex(substr($opval, 0, 2)); $opval2 = hex(substr($opval, 2, 2)); @@ -2218,6 +2219,8 @@ if (open($ifh, "<$input_file")) { } elsif ($ucmnemonic =~ /DFB/i) { if ($operand =~ /^%([01]{8})/) { $addr++; + } elsif ($operand =~ /^\$([0-9a-fA-F][0-9a-fA-F])/) { + $addr++; } else { my @symbols = split(',', $operand); my @bytes; @@ -2345,6 +2348,9 @@ if (open($ifh, "<$input_file")) { my $byte = unpack('C', pack("B8", $1)); generate_8($ofh, $addr, $byte, $lineno, $line); $addr++; + } elsif ($operand =~ /^\$([0-9a-fA-F][0-9a-fA-F])/) { + generate_8($ofh, $addr, $1, $lineno, $line); + $addr++; } elsif ($operand =~ /[0-9a-fA-F][0-9a-fA-F],*/) { #my @bytes = split(',', $operand); my @symbols = split(',', $operand);