Author Topic: Operand size bug  (Read 357 times)

Biterider

  • Member
  • ****
  • Posts: 896
  • ObjAsm Developer
    • ObjAsm
Operand size bug
« on: April 29, 2022, 05:37:34 AM »
Hi John
Compiling the following instruction, I noticed some strange behavior in 64-bit

Code: [Select]
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
« Last Edit: April 29, 2022, 06:58:30 PM by Biterider »

tenkey

  • Regular Member
  • *
  • Posts: 47
Re: Operand size bug
« Reply #1 on: April 29, 2022, 04:12:17 PM »
More examples:

Code: [Select]
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

  • Member
  • *****
  • Posts: 12471
  • Assembler is fun ;-)
    • MasmBasic
Re: Operand size bug
« Reply #2 on: April 29, 2022, 05:13:56 PM »
Code: [Select]
  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

Code: [Select]
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

  • Member
  • ****
  • Posts: 868
    • Uasm
Re: Operand size bug
« Reply #3 on: May 01, 2022, 05:58:54 AM »
I've noted this on the github issues list for resolution in 2.56 :)