Internal assembler wrong interpretation of 64bits numbers
Original Reporter info from Mantis: dji
-
Reporter name:
Original Reporter info from Mantis: dji
- Reporter name:
Description:
nternal asm makes catastrophic errors when 64 bit numbers are used:
(doesn't matter if hexadecimal or decimal numbers are used)
{$asmmode intel}
...
asm
...
and rcx,$000000FF000000FF //64 bits mask value
...
end
is compiled to:
and rcx,$FF //wrong
also
...
and rax,$FFFFFF00FFFFFF00
...
is compiled to:
and rax,$FFFFFFFFFFFFFF00 //wrong
it is obvious compiler use only lower 32 bits with sign extension to make 64 bit number and that is wrong.
Steps to reproduce:
followed code is always compiled to wrong code
{$asmmode intel}
asm
and rcx,$000000FF000000FF //64 bits mask value
end ['rcx'];
Additional information:
It looks like 64 bit literal values are discarded by assembler and only lower 32 bits are used with sign extend to make 64 bit value. It is wrong.