Stefan Schnell wrote:... Fbsl_Tiny.exe crashes in 64bit environment. ...
I will take the liberty to state that your declaration does not correspond to reality. At least, I could not reproduce your error report on my platforms.
These are my results under 64-bit Windows 7 for the MsgBox() version of the script with Fbsl_Tiny.exe v3.4.10 and v3.5:
and these ones, for the console version of the same:
And here is the script that I used:
- Code: Select all
' Example implementation of branchless
' integer Abs() in Dynamic Assembler
#AppType Console ' comment out for MsgBox() mode
' Integer values only!
Dim A As Integer = -1234567890
Printf("The absolute value of A (=%d) is %d\n", A, AsmAbs(A)) ' comment out for MsgBox() mode
//MsgBox(NULL, "The absolute value of A which equals " & A & " is " & _ ' uncomment for MsgBox() mode
// AsmAbs(A), "AsmAbs function", 0)
Asm AsmAbs(InValue As Integer) As Integer // DynAsm in v3.5
enter 0, 0
mov eax, [ebp + 8] // InValue instead of [ebp+8] in v3.5
mov edx, eax ' Abs function proper
sar edx, 31 ' compiles to 9 bytes
xor eax, edx ' without branching
sub eax, edx ' so it is very fast
End Asm // DynAsm in v3.5
Failure to run FBSL v3.4.10
Dynamic Assembler in your 64-bit environment may be caused by your DEP (Data Execution Prevention) service being switched on. You must be logged on as Administrator to be able to switch it off prior to executing FBSL v3.4.10
Dynamic Assembler scripts.
Matter is, Dynamic Asembler block sections compiled to machine code are executed outside of FBSL virtual machine's code marked as EXECUTABLE by the GCC compiler at the FBSL source project's compile time. FBSL v3.4.10
does not mark its Asm sections explicitly as EXECUTABLE code on script load so Windows will refuse to run it if DEP is switched on.
OTOH FBSL v3.5
marks its DynAsm and DynC code sections as EXECUTABLE, READABLE, WRITABLE on script load so the execution runs unhindered regardless of current DEP settings on your machine.
So please make sure your DEP is switched off on any 32- or 64-bit XP/Vista/7/8 machine for as long as you continue experimenting with the v3.4.10 environment. If that doesn't help, your x64 installation may simply be broken. I do not know of any other cause why your 64-bit Windows 7 may fail. Anyway, you are the first FBSL user ever to report FBSL's Dynamic Assembler crashes in a 64-bit environment. I am sorry but I am inclined to consider the bug non-existent and to dismiss the whole subject.
As an afterthought, can I also ask you to make a copy of your 32-bit MSVCRT.DLL
from your Windows 7 installation and PM it to me for testing? I have occasionally come across incompatible versions of this library on some locale-specific Windows installations.