Recent posts

#1
OxygenBasic Examples / Re: Oxygen 32 or 64 Bit?
Last post by Charles Pegge - Today at 12:45:47 PM
Hi Frank,

mode32bit and mode64bit:
these are set from rtl32.inc and rtl64.inc respectively

#ifdef mode64bit
...
#else
...
#endif

The MessageBox example looks correct for 64bit calling
#2
OxygenBasic Examples / Re: Oxygen 32 or 64 Bit?
Last post by Frank Brübach - Today at 12:32:59 PM
Hey Charles

Can you Tell me If this is a valuable 64 Bit Code example? If Not have you another oxygen example?

$ FileName "test64abcd.exe"
#include "$\inc\RTL64.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 ''resd 1
   
    val1=4
    val2=6 '

     mov eax,val1 
     mov eax,val2  ''multiply eax by ebx  "
     mul val1 'ebx 
     mov result,eax

zstring tit[]="64Bit OxygenBasic"
zstring msg[]="Hello dear Animal World! " + str(result)

'' oxygen 64 bit
''
sub  rsp,40h ''32
mov  r9,  0       
lea  r8,  tit   
lea  rdx, msg   
mov  rcx, 0
call messagebox       
add  rsp, 40h ''32
'' oxygen 64 bit
''
'' output: Hello dear Animal World! 24


#3
OxygenBasic Examples / Oxygen 32 or 64 Bit?
Last post by Frank Brübach - Today at 12:16:57 PM
Good morning,

Have a question how I can detect If its compiled in 32 or 64 Bit?

'' how I can detect if it's 32 bit or 64 bit
'' oxygen basic
''
#if defined( __FB_64BIT__ ) '' ?? ( __OXYGEN_64BIT__ )
#print "Producing 64-bit code output"
#else
#print "Producing 32-bit code output"
#endif

print "ok"

#4
OxygenBasic / Re: Hide exec process
Last post by Nicola - Today at 01:00:59 AM
Hi Charles,
That sounds like a great idea to me. In this way we can use the various possibilities available.
Thank you.
#5
OMG this one is even better ...  ;D  ;D  ;D  ;D

#6
..i don't like it very much  ;D

 

#7
OxygenBasic / Re: Hide exec process
Last post by Charles Pegge - Yesterday at 05:29:02 PM
I could add a default flags param:

  'process flags:
  %CREATE_NEW_CONSOLE 0x00000010
  %CREATE_NO_WINDOW 0x08000000
  'etc
  '
  function Exec(string c, int wait=0, flags=0) as int
  ===================================================
  STARTUPINFO infs
  PROCESS_INFORMATION infp
  CreateProcess null,c,0,0,0,flags,0,0,@infs,@infp
  if wait
    WaitForMultipleObjects 1,@infp.hthread,1,-1
  end if
  GetExitCodeProcess(infp.hProcess,@function)
  CloseHandle infp.hProcess
  CloseHandle infp.hThread
  return 0
  end function


  function QuExec(string c,d,f, int wait=0,flags=0) as int
  ========================================================
    return Exec(qu+c+qu+" "+d+" "+qu+f+qu, wait,flags)
  end function
 

  function DOS(string s, int wait=0,flags=0)
  ==========================================
  string c
  if s then
    c="cmd.exe /c "+s
  else
    c="cmd.exe"
  end if
  Exec c, wait,flags
  end function
#8
OxygenBasic / Re: Hide exec process
Last post by Nicola - Yesterday at 03:27:18 PM
Charles,
could you put EXECHIDE in sysutil?
and also a DOShide?
#9
OxygenBasic Examples / Re: Asm multiplication
Last post by Frank Brübach - May 25, 2024, 08:54:18 PM
Found the solution :)
Wanted only to make this example for using a Powerbasic a Like Style with Message Box and a result of two values Here multiplication

Oxygen basic

' multiplication of two values
'
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 Long



' 1) '- multiply go asm ------------------- //     
'

byte val1
byte val2
int result ''resd 1
   
    val1=4
    val2=6 '

     mov eax,val1 
     mov eax,val2  ''multiply eax by ebx  "
     mul val1 'ebx 
     mov result,eax

     
'print "the result of val1*val2 is " + str(result) '24


zstring tit[] = " PowerBASIC"
string msg[] = " hello my powerbasic friends " + str(result)

push 2 ' 0
addr eax,tit
push eax
addr eax,msg
push eax
addr eax,result
push 0

call MessageBox
mov eax, msg

#10
OxygenBasic Examples / Re: Asm multiplication
Last post by Frank Brübach - May 25, 2024, 08:08:19 PM
Hello...

New question How I  can add the result of multiplication to the call Message Box Line so result get shown in Message Box too?


' multiplication of two values
'
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 Long

zstring tit[] = " PowerBASIC"
zstring msg[] = " hello my powerbasic friends"

byte val1
byte val2
int result ''resd 1
   
    val1=4
    val2=6 '

' 1) '- multiply go asm ------------------- //     
'
mov eax,val1 
mov eax,val2  ''multiply eax by ebx  "
mul val1 'ebx 
mov result,eax

'- multiply go asm ------------------- //

'
' 2) how I can add the result of "mov result,eax" to the Call MessageBox  ?
'------------ messagebox go ---------- //
'32bit asm
push 2 ' 0 '2
addr eax,tit
push eax
addr eax,msg
push eax
push 0
call MessageBox ' here should be the result of multiply mov result,eax

'------------ messagebox go ---------- //

print "the result of val1*val2 is " + str(result) '24