Some small changes in source, no change in functionality.

git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@104 4df02467-bbd4-4a76-a152-e7ce94205b78
This commit is contained in:
marcobaye 2019-02-01 11:23:28 +00:00
parent fb81d868d6
commit 99d866e2e8
3 changed files with 36 additions and 26 deletions

View File

@ -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 <stdlib.h>
#include <math.h> // 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);

View File

@ -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);

View File

@ -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