# HG changeset patch # User lost # Date 1244765173 0 # Node ID c8787fad0f9fd05eed72e704a52d51250b72fec1 # Parent 058f181190256866c44530588b80e87e1e8353f8 Added && and || to lwasm diff -r 058f18119025 -r c8787fad0f9f ChangeLog --- a/ChangeLog Thu Jun 11 23:29:15 2009 +0000 +++ b/ChangeLog Fri Jun 12 00:06:13 2009 +0000 @@ -17,6 +17,7 @@ [b] Fixed bug with "include" directive operand parsing [LWASM] [+] Added includebin directive to include the literal contents of a binary file at the current assembly address. [LWASM] +[+] Added || and && as boolean or and boolean and respectively [LWASM] Version 2.4 diff -r 058f18119025 -r c8787fad0f9f lwasm/expr.c --- a/lwasm/expr.c Thu Jun 11 23:29:15 2009 +0000 +++ b/lwasm/expr.c Fri Jun 12 00:06:13 2009 +0000 @@ -626,6 +626,11 @@ { LWASM_OPER_MOD, "%", 150 }, { LWASM_OPER_INTDIV, "\\", 150 }, + // boolean AND/OR + { LWASM_OPER_AND, "&&", 25 }, + { LWASM_OPER_OR, "||", 25 }, + + // bitwise ops { LWASM_OPER_BWAND, "&", 50 }, { LWASM_OPER_BWOR, "|", 50 }, @@ -652,7 +657,7 @@ // expecting an operator here for (opern = 0; operators[opern].opernum != LWASM_OPER_NONE; opern++) { - for (i = 0; (*p)[i] && operators[opern].operstr[i] && (*p[i] == operators[opern].operstr[i]); i++) + for (i = 0; (*p)[i] && operators[opern].operstr[i] && ((*p)[i] == operators[opern].operstr[i]); i++) /* do nothing */ ; if (operators[opern].operstr[i] == '\0') break;