step 1 to fix ALU_* calls

git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@140 4df02467-bbd4-4a76-a152-e7ce94205b78
This commit is contained in:
marcobaye 2020-05-07 23:32:06 +00:00
parent a4943e1f40
commit 60603c7350
4 changed files with 9 additions and 8 deletions

View File

@ -1566,6 +1566,7 @@ void ALU_int_result(struct number *intresult) // ACCEPT_UNDEFINED
}
if (expression.is_empty)
Throw_error(exception_no_value);
// FIXME - add warning for unneeded "()"
}
@ -1621,14 +1622,14 @@ void ALU_defined_int(struct number *intresult) // no ACCEPT constants?
// Store int value and flags.
// This function allows for one '(' too many. Needed when parsing indirect
// This function allows for "paren" '(' too many. Needed when parsing indirect
// addressing modes where internal indices have to be possible.
// For empty expressions, an error is thrown.
// OPEN_PARENTHESIS: allow
// UNDEFINED: allow
// EMPTY: complain
// FLOAT: convert to int
void ALU_liberal_int(struct expression *expression) // ACCEPT_UNDEFINED | ACCEPT_OPENPARENTHESIS
void ALU_addrmode_int(struct expression *expression, int paren) // ACCEPT_UNDEFINED | ACCEPT_OPENPARENTHESIS
{
struct number *intresult = &expression->number;
@ -1638,7 +1639,7 @@ void ALU_liberal_int(struct expression *expression) // ACCEPT_UNDEFINED | ACCEPT
intresult->val.intval = intresult->val.fpval;
intresult->flags &= ~NUMBER_IS_FLOAT;
}
if (expression->open_parentheses > 1) {
if (expression->open_parentheses > paren) {
expression->open_parentheses = 0;
Throw_error(exception_paren_open);
}
@ -1669,7 +1670,7 @@ void ALU_any_result(struct number *result) // ACCEPT_UNDEFINED | ACCEPT_FLOAT
/* TODO
// stores int value and flags, allowing for one '(' too many (x-indirect addr).
void ALU_liberal_int(struct expression *expression)
void ALU_addrmode_int(struct expression *expression, int paren)
mnemo.c
when parsing addressing mode (except after '#' and '[') needvalue!

View File

@ -70,8 +70,8 @@ extern void ALU_int_result(struct number *intresult);
// stores int value and flags (floats are transformed to int)
// if result was undefined, serious error is thrown
extern void ALU_defined_int(struct number *intresult);
// stores int value and flags, allowing for one '(' too many (x-indirect addr).
extern void ALU_liberal_int(struct expression *expression);
// stores int value and flags, allowing for "paren" '(' too many (x-indirect addr).
extern void ALU_addrmode_int(struct expression *expression, int paren);
// stores value and flags (result may be either int or float)
extern void ALU_any_result(struct number *result);

View File

@ -543,7 +543,7 @@ static int get_argument(struct number *result)
break;
default:
// liberal, to allow for "(...,"
ALU_liberal_int(&expression);
ALU_addrmode_int(&expression, 1);
*result = expression.number;
typesystem_want_addr(result);
// check for indirect addressing

View File

@ -9,7 +9,7 @@
#define RELEASE "0.96.5" // update before release FIXME
#define CODENAME "Fenchurch" // update before release
#define CHANGE_DATE "6 May" // update before release FIXME
#define CHANGE_DATE "8 May" // update before release FIXME
#define CHANGE_YEAR "2020" // update before release
//#define HOME_PAGE "http://home.pages.de/~mac_bacon/smorbrod/acme/"
#define HOME_PAGE "http://sourceforge.net/p/acme-crossass/" // FIXME