diff --git a/src/alu.c b/src/alu.c index 332593d..e2f2cc6 100644 --- a/src/alu.c +++ b/src/alu.c @@ -1,5 +1,5 @@ // ACME - a crossassembler for producing 6502/65c02/65816/65ce02 code. -// Copyright (C) 1998-2017 Marco Baye +// Copyright (C) 1998-2019 Marco Baye // Have a look at "acme.c" for further info // // Arithmetic/logic unit @@ -12,6 +12,7 @@ // give a warning). // 31 May 2014 Added "0b" binary number prefix as alternative to "%". // 28 Apr 2015 Added symbol name output to "value not defined" error. +// 1 Feb 2019 Prepared to make "honor leading zeroes" optionally later on. #include "alu.h" #include #include // only for fp support @@ -25,6 +26,8 @@ #include "symbol.h" #include "tree.h" +#define honor_leading_zeroes 1 // FIXME - make a CLI argument for this + // constants @@ -421,13 +424,15 @@ static void parse_binary_value(void) // Now GotByte = "%" or "b" } } while (go_on); // set force bits - if (digits > 8) { - if (digits > 16) { - if (value < 65536) - flags |= MVALUE_FORCE24; - } else { - if (value < 256) - flags |= MVALUE_FORCE16; + if (honor_leading_zeroes) { + if (digits > 8) { + if (digits > 16) { + if (value < 65536) + flags |= MVALUE_FORCE24; + } else { + if (value < 256) + flags |= MVALUE_FORCE16; + } } } PUSH_INTOPERAND(value, flags, 0); @@ -465,13 +470,15 @@ static void parse_hexadecimal_value(void) // Now GotByte = "$" or "x" } } while (go_on); // set force bits - if (digits > 2) { - if (digits > 4) { - if (value < 65536) - flags |= MVALUE_FORCE24; - } else { - if (value < 256) - flags |= MVALUE_FORCE16; + if (honor_leading_zeroes) { + if (digits > 2) { + if (digits > 4) { + if (value < 65536) + flags |= MVALUE_FORCE24; + } else { + if (value < 256) + flags |= MVALUE_FORCE16; + } } } PUSH_INTOPERAND(value, flags, 0); @@ -558,13 +565,15 @@ static void parse_octal_value(void) // Now GotByte = "&" GetByte(); } // set force bits - if (digits > 3) { - if (digits > 6) { - if (value < 65536) - flags |= MVALUE_FORCE24; - } else { - if (value < 256) - flags |= MVALUE_FORCE16; + if (honor_leading_zeroes) { + if (digits > 3) { + if (digits > 6) { + if (value < 65536) + flags |= MVALUE_FORCE24; + } else { + if (value < 256) + flags |= MVALUE_FORCE16; + } } } PUSH_INTOPERAND(value, flags, 0); diff --git a/src/flow.c b/src/flow.c index 345c4c2..bcf8e4c 100644 --- a/src/flow.c +++ b/src/flow.c @@ -1,5 +1,5 @@ // ACME - a crossassembler for producing 6502/65c02/65816/65ce02 code. -// Copyright (C) 1998-2017 Marco Baye +// Copyright (C) 1998-2019 Marco Baye // Have a look at "acme.c" for further info // // Flow control stuff (loops, conditional assembly etc.) @@ -224,6 +224,7 @@ void flow_parse_block_else_block(int parse_first) // parse a whole source code file void flow_parse_and_close_file(FILE *fd, const char *filename) { + //TODO - check for bogus/malformed BOM and ignore! // be verbose if (config.process_verbosity > 2) printf("Parsing source file '%s'\n", filename); diff --git a/src/version.h b/src/version.h index 24eac16..182a92b 100644 --- a/src/version.h +++ b/src/version.h @@ -1,5 +1,5 @@ // ACME - a crossassembler for producing 6502/65c02/65816/65ce02 code. -// Copyright (C) 1998-2017 Marco Baye +// Copyright (C) 1998-2019 Marco Baye // Have a look at "acme.c" for further info // // version info @@ -9,8 +9,8 @@ #define RELEASE "0.96.4" // update before release FIXME #define CODENAME "Fenchurch" // update before release -#define CHANGE_DATE "22 Dec" // update before release FIXME -#define CHANGE_YEAR "2017" // update before release +#define CHANGE_DATE "1 Feb " // update before release FIXME +#define CHANGE_YEAR "2019" // update before release //#define HOME_PAGE "http://home.pages.de/~mac_bacon/smorbrod/acme/" #define HOME_PAGE "http://sourceforge.net/p/acme-crossass/" // FIXME