changeset 226:c8787fad0f9f

Added && and || to lwasm
author lost
date Fri, 12 Jun 2009 00:06:13 +0000
parents 058f18119025
children 4c60c3a09597
files ChangeLog lwasm/expr.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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
 
--- 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;