comparison 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
comparison
equal deleted inserted replaced
480:ceed9fb3a362 481:62720ac9e28d
320 if (i < -128 || i > 127) 320 if (i < -128 || i > 127)
321 lwasm_register_error(as, l, E_BYTE_OVERFLOW); 321 lwasm_register_error(as, l, E_BYTE_OVERFLOW);
322 } 322 }
323 else if (l -> lint == 2 && lw_expr_istype(e, lw_expr_type_int) && CURPRAGMA(l, PRAGMA_OPERANDSIZE)) 323 else if (l -> lint == 2 && lw_expr_istype(e, lw_expr_type_int) && CURPRAGMA(l, PRAGMA_OPERANDSIZE))
324 { 324 {
325 if (l -> pb != 0xAF && l -> pb != 0xB0) 325 // note that W relative and extended indirect must be 16 bits
326 if (l -> pb != 0xAF && l -> pb != 0xB0 && l -> pb != 0x9f)
326 { 327 {
327 if ((i >= -128 && i <= 127) || i >= 0xFF80) 328 if ((i >= -128 && i <= 127) || i >= 0xFF80)
328 { 329 {
329 lwasm_register_error(as, l, W_OPERAND_SIZE); 330 lwasm_register_error(as, l, W_OPERAND_SIZE);
330 331