#18 (LEA does not support constant expressions exceeding 32-bits) – The Yasm Modular Assembler Project

Ticket #18 (closed defect: fixed)

Opened 5 years ago

Last modified 3 years ago

LEA does not support constant expressions exceeding 32-bits

Reported by: jlawson-yasm@… Owned by: peter@…
Priority: P2 Milestone: 0.3.0
Component: Architecture: x86 Version: other
Severity: normal Keywords:
Cc: peter@…

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

comment:1 Changed 5 years ago by jlawson-yasm@…

  • cc peter@… added
Please note that the above was tested with YASM 0.3.0

comment:2 Changed 5 years ago by peter@…

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

comment:3 Changed 5 years ago by peter@…

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

comment:4 Changed 5 years ago by jlawson-yasm@…

  • target_milestone changed from 0.2.0 to 0.3.0

comment:5 Changed 5 years ago by peter@…

  • 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)

Author



Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.