News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Operand size bug

Started by Biterider, April 29, 2022, 05:37:34 AM

Previous topic - Next topic

Biterider

Hi John
Compiling the following instruction, I noticed some strange behavior in 64-bit


test rax, 800000000000000h   => Error A2237: Constant value too large: 800000000000000h
test rax, 8000000000000000h  => compiles fine but to    test rax, 0
test rax, 80000000000000000h  => Error A2237: Constant value too large: 80000000000000000h


Uasm Version 2.55

Biterider

tenkey

More examples:

UASM v2.55, Mar 29 2022, Masm-compatible assembler.

testproject.asm
                                .code
00000000  48A900000000          test rax, -4000000000000000h
00000006  48A900000000          test rax,  8000000000000000h
0000000C  48A900000000          test rax, 0fff0000000000000h
                                end


This is wrong. All of them ought to say "Constant value too large".

jj2007

  int 3
  mov rax, 8000000000000000h ; ok
  test rax, 8000000000000000h ; ok? not really...
;   test rax, 800000000000000h ; not ok
;   test rax, 80000000000000h
;   test rax, 8000000000000h
;   test rax, 800000000000h
;   test rax, 80000000000h
;   test rax, 8000000000h
;   test rax, 800000000h
  test rax, 80000000h
  test rax, 8000000h


CC                        | int3                     |
48:B8 0000000000000080    | mov rax,8000000000000000 |
48:A9 00000000            | test rax,0               |
48:A9 00000080            | test rax,FFFFFFFF8000000 |
48:A9 00000008            | test rax,8000000         |

johnsa

I've noted this on the github issues list for resolution in 2.56 :)

fearless

Noticed today that I am getting this error

Error A2237: Constant value too large: 8000000000000000h
Using 2.56