mirror of
https://github.com/softwarejanitor/as65.git
synced 2024-11-21 17:32:10 +00:00
Fixes for assembling Michael Packard's code
This commit is contained in:
parent
353839f276
commit
c70485fc8a
37
as65.pl
37
as65.pl
@ -1096,6 +1096,8 @@ sub is_Immediate {
|
||||
# Parse ASCII
|
||||
} elsif ($operand =~ /^#"(.)["]*$/) {
|
||||
return 2;
|
||||
} elsif ($operand =~ /^#'(.)[']*$/) {
|
||||
return 2;
|
||||
# Handle symbols.
|
||||
} elsif ($operand =~ /^#[<>]*\(*([0-9A-Za-z_\.\?:][A-Za-z0-9_\.\?:]*)\)*$/) {
|
||||
return 2;
|
||||
@ -1130,6 +1132,8 @@ sub generate_Immediate {
|
||||
# Parse ASCII
|
||||
} elsif ($operand =~ /^#"(.)["]*$/) {
|
||||
generate_16($ofh, $addr, $opcode, ord($1), $lineno, $line);
|
||||
} elsif ($operand =~ /^#'(.)[']*$/) {
|
||||
generate_16($ofh, $addr, $opcode, ord($1), $lineno, $line);
|
||||
# Handle symbol
|
||||
} elsif ($operand =~ /^#([<>]*)\(*([0-9A-Za-z_\.\?:][A-Za-z0-9_\.\?:]*)\)*/) {
|
||||
handle_8_bit_symbol($ofh, $lineno, $addr, $opcode, $1, $2, undef, undef, $line);
|
||||
@ -2334,6 +2338,30 @@ sub parse_line {
|
||||
$mnemonic = $2;
|
||||
$operand = $3;
|
||||
$comment = $4;
|
||||
# Fix fir LABEL ASC 'text' ; comment
|
||||
} elsif ($line =~ /^(\S+)\s+(\S+)\s+(['].+['])\s*(;.*)$/) {
|
||||
$label = $1;
|
||||
$mnemonic = $2;
|
||||
$operand = $3;
|
||||
$comment = $4;
|
||||
# Fix fir ASC 'text' ; comment
|
||||
} elsif ($line =~ /^\s+(\S+)\s+(['].+['])\s*(;.*)$/) {
|
||||
$label = $1;
|
||||
$mnemonic = $2;
|
||||
$operand = $3;
|
||||
$comment = $4;
|
||||
# Fix fir LABEL ASC 'text'
|
||||
} elsif ($line =~ /^(\S+)\s+(\S+)\s+(['].+['])\s*$/) {
|
||||
$label = $1;
|
||||
$mnemonic = $2;
|
||||
$operand = $3;
|
||||
$comment = '';
|
||||
# Fix fir ASC 'text'
|
||||
} elsif ($line =~ /^\s+(\S+)\s+(['].+['])\s*$/) {
|
||||
$label = '';
|
||||
$mnemonic = $1;
|
||||
$operand = $2;
|
||||
$comment = '';
|
||||
} elsif ($line =~ /^(\S+)\s+(\S+)\s+(\S+)\s*$/) {
|
||||
$label = $1;
|
||||
$mnemonic = $2;
|
||||
@ -2773,6 +2801,9 @@ print ">>>> IN CONDITIONAL\n";
|
||||
} elsif ($operand =~ /^'(.+)'([0-9a-fA-F]*)$/) {
|
||||
$str = $1;
|
||||
$trl = $2;
|
||||
} elsif ($operand =~ /^'(.+)'\s*$/) {
|
||||
$str = $1;
|
||||
$trl = '';
|
||||
}
|
||||
$addr += (length($str) - 1);
|
||||
$addr++ if defined $trl;
|
||||
@ -3378,6 +3409,12 @@ print ">>>> END CONDITIONAL\n";
|
||||
} elsif ($operand =~ /^'(.+)'([0-9a-fA-F]*)$/) {
|
||||
$str = $1;
|
||||
$trl = $2;
|
||||
} elsif ($operand =~ /^'(.+)'\s*$/) {
|
||||
$str = $1;
|
||||
$trl = '';
|
||||
} elsif ($operand =~ /^'(.+)'\s*$/) {
|
||||
$str = $1;
|
||||
$trl = '';
|
||||
} elsif ($operand =~ /^\"(.+)\",([0-9a-fA-F]*)$/) {
|
||||
$str = $1;
|
||||
$trl = $2;
|
||||
|
Loading…
Reference in New Issue
Block a user