Ticket #18 (closed defect: fixed)

Opened 5 years ago

Last modified 2 years ago

LEA does not support constant expressions exceeding 32-bits

Reported by: jlawson-yasm@bovine.net Assigned to: peter@tortall.net
Priority: P2 Milestone: 0.3.0
Component: Architecture: x86 Version: other
Severity: normal Keywords:
Cc: peter@tortall.net

Description

NASM allows use of "LEA" expressions that exceed 32-bits and silently wraps 
them for you.  YASM gives an error and refuses to compile when this is done.  
In NASM, this works but YASM this fails with "invalid effective address":

   %define P         0xB7E15163
   %define Q         0x9E3779B9
   lea eax,[eax+P+Q]

Normally YASM seems to try to give a warning for many other types of 
instructions (mov, add, sub, ...).  For example, in NASM this compiles without 
warning, but YASM kindly prints out "warning: value does not fit in 32 bit 
field" which is good.

   %define P         0xB7E15163
   %define Q         0x9E3779B9
   add eax,P+Q

YASM should be consistent and allow the LEA with large constants, but give a 
warning if it wants to.

Attachments

Change History

10/18/03 21:20:53 changed by jlawson-yasm@bovine.net

  • cc set to peter@tortall.net.
Please note that the above was tested with YASM 0.3.0

10/19/03 00:25:15 changed by peter@tortall.net

  • owner changed from mu@tortall.net to peter@tortall.net.
  • component changed from preprocessor: nasm-compatible to architecture: x86.
x86 arch specific, I'll take this one.

10/19/03 00:26:14 changed by peter@tortall.net

  • status changed from new to assigned.
Starting work on this.

10/19/03 01:20:55 changed by jlawson-yasm@bovine.net

  • target_milestone changed from 0.2.0 to 0.3.0.

10/19/03 11:38:38 changed by peter@tortall.net

  • status changed from assigned to resolved.
  • resolution set to fixed.
Fixed in modules/arch/x86/x86expr.c r1.63.

Thanks for the bug report!

Add/Change #18 (LEA does not support constant expressions exceeding 32-bits)