int a,b,c
#show {
a=b+c
mbox str(a)
}
int a,b,c
#show "t.txt" {
a=b+c
mbox str(a)
}
' 64 bit x86
'
$ FileName "test64add2number.exe"
#include "$\inc\RTL64.inc"
byte val1
byte val2
int result
val1=4
val2=6 '
'' mov eax,val1
'' mov eax,val2 ''multiply eax by ebx "
'' mul val1 'ebx
'' mov result,eax
'------------------ //
mov rax,rdi
add rax, val2
'add val1 'rax,
mov rdi,val1
mov result,rax
'------------------ //
zstring tit[]="64Bit OxygenBasic"
zstring msg[]="Hello dear Animal World! " + str(result)
'' oxygen 64 bit
''
sub rsp,40h
mov r9, 0
lea r8, tit
lea rdx, msg
mov rcx, 0
call messagebox
add rsp, 40h
''
'' output: Hello dear Animal World! 24
type aStruct
a as long
b as zstring
end type
function one_add(long a,b) as long
dim st as aStruct
st.a = 5
st.b = "Thor"
return a+b
end function
function two_add(long a,b) as long
dim st as aStruct
st.a = 5
st.b = "Thor"
return st.a+str(st.b)
end function
print "one_add: " + one_add(2,4) ' result 6
print "two_add: " + two_add(2,4) ' result 50 ' ???
'' -- halProment Basic 64 bit test, 26-5-24, 29-05-24, by frank bruebch
'' -- you must compile this example with menu compile/quickrun produces an exe file
''
$ FileName "test64-2.exe"
#include "$\inc\pro64.inc" ''
Declare Function MessageBox Lib "user32.dll" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Sys
byte val1
byte val2
int result
val1=4
val2=6 '
'mov eax,val1
mov eax,val2 ''multiply (or add) eax by ebx "
'mul val1 'ebx
add eax,5 '' here add 5
mov result,eax
zstring tit[]="HalProment Basic 64 bit"
zstring msg[]="Hello dear Animal World! " + str(result)
'' halProment Basic 64 bit
''
sub rsp,40h
mov r9, 0
lea r8, tit
lea rdx, msg
mov rcx, 0
call messagebox
add rsp, 40h
''
''
'' output: Hello dear Animal World! 11 (add) ' 24 (multiply)
''
#ifdef mode64bit
#print "Producing 64-bit code output"
print "Producing 64-bit code output"
#else
#print "Producing 32-bit code output"
#endif
'' result: "Producing 64-bit code output" ' all ok :-)
Page created in 0.125 seconds with 11 queries.