View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0038074||FPC||Compiler||public||2020-11-13 14:46||2020-11-13 21:39|
|Reporter||Antero Hiismäki||Assigned To||Florian|
|Priority||normal||Severity||minor||Reproducibility||have not tried|
|Fixed in Version||3.3.1|
|Summary||0038074: Compiler BUG inline assembly intel immediate 64-bit load to register when requesting 64-bit nasm -compatible output|
mov RAX, $1234567898765432
the compiler loads only the LOW32 bits of the immediate parameter into RAX, ignoring the HIGH32 bits.
|Steps To Reproduce||How to reproduce:|
mov RAX, $1234567898765432
1. Put the Test function above in a program, and compile using the following command line:
ppcrossx64 -Anasmwin64 Test1
2. Look at the generated Test1.s:
; End asmlist al_pure_assembler
The compiler-generated constant -1737075662 converted to HEX is $98765432, totally ignoring the HIGH 32 bits.
The odd thing is that IF you compile direct-to-EXE (bypassing the assembly language output meant for 64-bit nasm assembly),
then the compiler will produce the correct code to load the full 64-bit constant.
But I wanted to write part of my code in objectpascal, and convert that to nasm source code, write more code directly in assembly language and use nasm to combine both into one single 64-bit executable code.
I get the following error message:
Test1.pas(98,60) Error: Assembler x86_64-win64-nasm.exe not found, switching to
does that mean I should copy the nasm.exe as "x86_64-win64-nasm.exe" and put that in the same directory where "ppcrossx64" already exists ?
Not that it really matters in this case, because I don't want to directly compile to EXE anyway, but instead use the freepascal assembly language output as part of input to nasm, and write some other code directly in assembly language and feed the comination to nasm.
|Tags||No tags attached.|
|Fixed in Revision||47413|
> I get the following error message:
> "Assembling test1
> Test1.pas(98,60) Error: Assembler x86_64-win64-nasm.exe not found, switching to
> external assembling"
> does that mean I should copy the nasm.exe as "x86_64-win64-nasm.exe" and put that in the same directory where "ppcrossx64" already exists ?
Per default the compiler looks for <cpu>-<os>-xxx when searching for external utilities (assembler, linker, etc.) and searches these in the compiler directory as well as %PATH%. You can adjust that with the options -XPxxx (binary utility prefix, can be set to empty by simply passing -XP ) and -FDxxx (the directory where utilities are looked for).
|2020-11-13 14:46||Antero Hiismäki||New Issue|
|2020-11-13 14:51||Sven Barth||Note Added: 0126879|
|2020-11-13 21:39||Florian||Assigned To||=> Florian|
|2020-11-13 21:39||Florian||Status||new => resolved|
|2020-11-13 21:39||Florian||Resolution||open => fixed|
|2020-11-13 21:39||Florian||Fixed in Version||=> 3.3.1|
|2020-11-13 21:39||Florian||Fixed in Revision||=> 47413|
|2020-11-13 21:39||Florian||FPCTarget||=> -|