'' -- add x64bit example, 30-5-2024 by frank bruebach
'' -- oxygen basic
''
$filename "t1b.exe"
uses rtl64
'
'messagebox 64 bit
'
Declare Function MessageBox Lib "user32.dll" alias "MessageBoxA" (ByVal hwnd As sys, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long
byte val1
byte val2
int result
val1=4
val2=6 '
mov rax, [val1]
add rax, [val2]
mov [result], rax
mov eax, 60
zstring tit[] ="The great world of OxygenBasic..."
zstring msg[]="Hello dear Animal World! " + str(result)
sub rsp,40h
mov r9d, 0
lea r8, tit
lea rdx, msg
mov rcx, 0
call MessageBox
add rsp,40h
'
' ok result 10
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 ' ???
Page created in 0.090 seconds with 10 queries.