Lazarus
Free Pascal => General => Topic started by: avk on November 07, 2019, 08:04:21 am
Title:
[SOLVED]Built-in assembler
Post by:
avk
on
November 07, 2019, 08:04:21 am
It looks like a bug, attempt to compile this code:
Code: Pascal
[Select]
[+]
[-]
{$asmmode intel}
procedure
doasm
;
begin
asm
test rax
,
$8000000000000000
end
;
end
;
reports an error:
Code: Text
[Select]
[+]
[-]
... Error: Asm: signed dword value exceeds bounds -9223372036854775808
Title:
Re: Built-in assembler
Post by:
zamronypj
on
November 07, 2019, 08:33:39 am
According to TEST instruction documentation
https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf
TEST RAX, imm32
So it accepts immediate value 32 bit operand. To test with 64 bit immediate value, CMIIW, I think you need to copy 64bit immediate value to 64bit register first
Code: ASM
[Select]
[+]
[-]
mov
rcx
,
$
8000000000000000
test
rax
,
rcx
Title:
Re: Built-in assembler
Post by:
avk
on
November 07, 2019, 08:49:27 am
Thank you very much.
TinyPortal
© 2005-2018