64 bit thread

BlitzMax Forums/BlitzMax Programming/64 bit thread

BinaryBurst(Posted 2016) [#1]
Is there a way of having a 64bit assembly written function imported(using extern/endextern) in a normal 32bit blitz app and then used to create a thread from that function?


GW(Posted 2016) [#2]
No.
you can try using BlitzmaxNG which is a port of Blitzmax that can compile 64bit executables.
http://www.bmx-ng.com/main/


BinaryBurst(Posted 2016) [#3]
Tried this:

"main.bmx"
Import "a.s"

Extern 
	Function f()="f"
EndExtern	


"a.s"
format ms coff 

section "code" code

Public f as "_f"
f: 

	ret


Output:
Building main
[ 47%] Compiling:a.s
C:/Users/Antrax/Desktop/asd/a.s: Assembler messages:
C:/Users/Antrax/Desktop/asd/a.s:1: Error: no such instruction: `format ms coff'
C:/Users/Antrax/Desktop/asd/a.s:3: Error: no such instruction: `section "code"code'
C:/Users/Antrax/Desktop/asd/a.s:5: Error: no such instruction: `public f as "_f"'
Build Error: failed to compile C:/Users/Antrax/Desktop/asd/a.s
Process complete




col(Posted 2016) [#4]
NG uses the gcc compiler toolset so you need to write assembler to the appropriate syntax. Googling for the same version of gcc that NG is compiling with, ie 'gcc version as manual', would be best.

Test.bmx
Strict

Import "test.s"

Extern"c"
	Function func()
EndExtern

Print func()


test.s

.globl func

func:
	mov $20,%rax
	ret


you can also change the syntax with the appropriate compiler switches..
.intel_syntax noprefix
.globl func

func:
	mov rax,30
	ret



BinaryBurst(Posted 2016) [#5]
awesome thanks :)