Recent posts

#1
OxygenBasic Examples / Sizeof values Data types
Last post by Frank Brübach - Today at 02:36:15 PM
Perhaps Somebody needs it, sizeof some Data types

Oxygen Basic

' oxygen basic, sizeof values
'
Print SizeOf(Byte) ' returns 1

Type mybar
    a As Integer '4
    b as float '4
    c as long '4
    d As Double '8
    e as ulong '4
    f as short '2
    g as byte '1
    h as char ' 1
    j as int '4
    k as char ' 1
End Type

Dim myfoo As mybar
Print SizeOf(myfoo) ' returns 40
 
Type mybar2
    l as quad '8
    m as dword ' 4
    n as qword ' 8
    o as word ' 2
    p as ubyte ' 1
    q as string ' 4
    r as bstr ' 4
    s as zstring ' 1
    t as wstring '4
    u as bstring ' 4
End Type

Dim myfoo2 As mybar2
Print SizeOf(myfoo2) ' returns 48
#2
General Discussion / Is the brain a computer?
Last post by Charles Pegge - Today at 01:06:07 PM
Sabine Hossenfelder

#3
Code to share / Re: Example Intro and HalProm...
Last post by Frank Brübach - Yesterday at 09:28:56 PM
Hello Chris thx for Feedback..
yes nearly 90 / 92 percent at the Moment are compatible with o2 Code.

Whats the meaning of "luv"?  Lift and Transport?

Regards Frank 
#4
Code to share / Re: Example Intro and HalProm...
Last post by Chris Chancellor - Yesterday at 08:25:23 PM
I would luv the compiler to be a 64bit one.

It looks similar to O2,   can I port O2 codes into Frank Basic ?
Thanxx a lot

#5
General Discussion / Alien Megastructure Candidates...
Last post by Charles Pegge - Yesterday at 12:17:22 PM
Sabine Hossenfelder

#6
OxygenBasic Examples / Re: Msgbox asm
Last post by Frank Brübach - May 30, 2024, 11:56:02 PM
Thanks again Charles and didnt know yet that Show command

Found the solution by another c++ example about asm 64 Bit I was quite near the solution

Oxygen Code
'' -- 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

Now I am calm No more questions today :)
#7
and how to reverse it

Dr Patrick Holford
Dr. John Campbell

#8
OxygenBasic Examples / Re: Msgbox asm
Last post by Charles Pegge - May 30, 2024, 09:16:57 PM
Here's a trade secret:

You can reveal the Assembly code of any piece of Oxygen by using the #show command:

it shows the intermediate code followed by Asm code

int a,b,c
#show {
a=b+c
mbox str(a)
}

The code can also be stored directly into a text file:
int a,b,c
#show  "t.txt" {
a=b+c
mbox str(a)
}
#9
OxygenBasic Examples / Re: Msgbox asm
Last post by Frank Brübach - May 30, 2024, 07:01:23 PM
Hi Charles again..

How I can add correct two numbers in 64 Bit Mode in this msgbox example?  Thx in advance , Frank

' 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

#10
PowerBasic Adventures / Power Basic forum maybe going ...
Last post by Paul Yuen - May 30, 2024, 06:10:22 PM
Hi
Please take a look at https://forum.powerbasic.com/forum/announcements-articles-and-support-faqs/frequently-asked-questions/833672-powerbasic-website-and-forums#post833672

PB forum may be going dark very soon, as there is no management response to members' queries about future
stake of the PB forum.