Author Topic: Immediate too large  (Read 592 times)

Biterider

  • Member
  • ***
  • Posts: 383
  • ObjAsm32 + ObjAsm64 = ObjAsm
    • ObjAsm
Immediate too large
« on: February 17, 2019, 03:00:41 AM »
Hi
It seems that UASM 2.47 in 64 bit mode accepts such a line

Code: [Select]
mov PPP, 01122334455667788h

00007FF6B8582BA2 48 C7 05 D3 91 00 00 88 77 66 55 mov         qword ptr [PPP (07FF6B858BD80h)],55667788h 

without warning that the value is too large, but an error is issued when passing an offset.

I think that this behavior is not intended ...

Biterider

johnsa

  • Member
  • ****
  • Posts: 791
    • Uasm
Re: Immediate too large
« Reply #1 on: February 18, 2019, 12:13:38 AM »
Hi,

Added a fix for this. It's been hanging around a long time in the parser!

2.48 packages and github branch updated.

John

Biterider

  • Member
  • ***
  • Posts: 383
  • ObjAsm32 + ObjAsm64 = ObjAsm
    • ObjAsm
Re: Immediate too large
« Reply #2 on: February 18, 2019, 01:15:57 AM »
Thank you

Mikl__

  • Member
  • ****
  • Posts: 763
Re: Immediate too large
« Reply #3 on: February 18, 2019, 02:01:44 AM »
Hi, Biterider!
Code: [Select]
mov rax, 01122334455667788h
mov PPP, rax

Biterider

  • Member
  • ***
  • Posts: 383
  • ObjAsm32 + ObjAsm64 = ObjAsm
    • ObjAsm
Re: Immediate too large
« Reply #4 on: February 18, 2019, 02:19:54 AM »
Hi Mikl__
Thanks, I know. The 64 bit architecture don't let you do that directly, so you are forced to load first a register and then transfer the content to the memory location, like you showed in your post.
The point here is that UASM don't warn you that it truncates the value of the immediate. Using a reference it shows you a nice error message  :biggrin: .

Biterider