diff lwasm/insn_gen.c @ 481:62720ac9e28d

Exclude extended indirect from operandsizewarning pragma Constant indirect addressing is only available in "extended" variety (16 bits) so make sure no warning appears when plain extended indirect addressing is used.
author William Astle <lost@l-w.ca>
date Wed, 12 Dec 2018 21:18:20 -0700
parents eac8f5f0867d
children
line wrap: on
line diff
--- a/lwasm/insn_gen.c	Wed Dec 12 21:17:21 2018 -0700
+++ b/lwasm/insn_gen.c	Wed Dec 12 21:18:20 2018 -0700
@@ -322,7 +322,8 @@
 			}
 			else if (l -> lint == 2 && lw_expr_istype(e, lw_expr_type_int) && CURPRAGMA(l, PRAGMA_OPERANDSIZE))
 			{
-				if (l -> pb != 0xAF && l -> pb != 0xB0)
+				// note that W relative and extended indirect must be 16 bits
+				if (l -> pb != 0xAF && l -> pb != 0xB0 && l -> pb != 0x9f)
 				{
 					if ((i >= -128 && i <= 127) || i >= 0xFF80)
 					{