I've been reviewing Oxygen Basic the last couple of days,
on the hope that I can create a plugin for JPSoftware's TCC.EXE
Ref: https://jpsoft.com/
When TCC.EXE was a 32-bit application,
I wrote my plugins using PowerBasic 8 for Windows.
As TCC.EXE is now a 64-bit application,
and PowerBasic is still 32-bit,
I purchased PureBasic to develop 64-bit plugins for TCC.EXE
The first plugin that I converted from 32-bit PowerBasic
to 64-bit PureBasic
was my plugin that allowed the reading of .DBF files.
Ref: https://www.jpsoft.com/forums/threads/64-bit-plugin-development-using-purebasic.10988/
The second 64-bit plugin I developed for TCC.EXE
allowed me to run VBScript files and functions,
fixing the problems that the TCC Script Command had.
Ref: https://jpsoft.com/forums/threads/script-and-getobject.10696/post-60212
Ref: https://jpsoft.com/forums/threads/activescript-for-vbscript.11353/
Ref: https://jpsoft.com/help/script.htm
I would like to develop a plugin that will include Oxygen Basic.
My first step involves getting 64-bit PureBasic to work with the oxygen.dll file.
I note that oxygen.dll is a 32-bit dll,
Quoteoxygen.dll: PE32 executable (DLL) (GUI) Intel 80386, for MS Windows, UPX compressed
which contains the following exports;
QuoteMicrosoft (R) COFF/PE Dumper Version 14.34.31937.0
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file oxygen.dll
File Type: DLL
Section contains the following exports for oxygen.dll
00000000 characteristics
0 time date stamp
0.00 version
1 ordinal base
16 number of functions
16 number of names
ordinal hint RVA name
1 0 00076910 o2_abst
2 1 00076780 o2_basic
3 2 000753B0 o2_buf
4 3 00076980 o2_errno
5 4 000769D0 o2_error
6 5 00075600 o2_exec
7 6 00075360 o2_len
8 7 000754B0 o2_lib
9 8 000756B0 o2_link
10 9 00075330 o2_mode
11 A 00075300 o2_pathcall
12 B 000768C0 o2_prep
13 C 000761B0 o2_stats
14 D 000752D0 o2_varcall
15 E 00076A40 o2_version
16 F 00076870 o2_view
Summary
29E000 UPX0
1F000 UPX1
1000 UPX2
I need a 64-bit version of oxygen.dll in order to work with 64-bit PureBasic.
Is there a 64-bit version of oxygen.dll?
How can I create a 64-bit version of oxygen.dll?
I am nowhere near an expert programmer as others on the forum,
so constructive suggestions and corrections would be appreciated.
Regards,
Joe
Hi Joe,
you can produce both 32 and 64bit DLLS with the 32bit o2 compiler. But we don't have a stable 64bit self-compiling o2 yet. You would only need this if you were using Oxygen as a sub-system at run-time in your application. Do you really need this?
This is a want, not a need.
Having an Oxygen plugin for TCC would make Oxygen an embedded/internal interpreter,
similar to the TCC Lua embedded/internal interpreter.
Ref: https://jpsoft.com/help/lua.htm
...or like my ActiveScript plugin,
which allows me to run my VBScript code.
Ref: https://jpsoft.com/forums/threads/activescript-for-vbscript.11353/
My goal of having Oxygen as an embedded/internal interpreter in TCC
is not to have Oxygen produce .EXEs or .DLLs,
but simply to compile and execute directly in memory.
Developing an Oxygen plugin would allow me to integrate it with TCC via the TCC SDK.
Ref: https://jpsoft.com/all-downloads/plugins-take-command.html
This would essentialy allow the use of Oxygen as a sub-system of TCC at run-time.
It would be similar to how Oxygen has been integrated
with ThinBasic and PowerBasic,
that is,
my plugin would be able to read an Oxygen Source Code file,
and then execute it in memory.
Thus, I first need to have Oxygen integrate with the 64-bit PureBasic,
and then I would use 64-bit PureBasic to develop my 64-bit plugin for TCC.
Ref: http://www.jose.it-berater.org/smfforum/index.php?topic=4638.msg17900#msg17900
Again, this is a want, not a need.
Regards,
Joe
I am not sure that i understand whole hype around plugins you want
i made 64bit .dll in o2 for one java based language called Dragon lang and work well.
o2 is normally invoked using co2.exe in a new separate process. So the 32/64 bitness does not matter. You can see how it is done in tools/ Oxide.o2bas and Peroxide.o2bas which both use inc\sysutil.inc exec
Exec(sd+"\co2.exe "+f,0) 'assume co2 path
from sysutil.inc
function Exec(string c, int wait=0) as int
==========================================
STARTUPINFO infs
PROCESS_INFORMATION infp
CreateProcess null,c,0,0,0,0,0,0,@infs,@infp
if wait
WaitForMultipleObjects 1,@infp.hthread,1,-1
end if
GetExitCodeProcess(infp.hProcess,@function)
CloseHandle infp.hProcess
CloseHandle infp.hThread
end function
That requires co2.exe to be installed on the users system, correct?
That defeats the purpose of creating an Oxygen Plugin for TCC,
as it would require co2.exe,
an external,
to compile and execute the .o2bas file.
Take for example, this ThinBasic code, HelloWorld.tbasic;uses "oxygen"
dim as string src
src="
print "Hello World!"
"
o2_basic src
if o2_errno then
msgbox 0,o2_error
stop
else
o2_exec
end if
No external co2.exe is required to compile and execute that code.
I would like to do the same thing, except do this under 64-bit PureBasic.
Once I am able to do this with 64-bit PureBasic,
I can then use 64-bit PureBasic to develop a 64-bit plugin for TCC,
that would have Oxygen embedded into the sub-system of TCC at run-time.
Regards,
Joe
But there is hidden code: the thinBasic_Oxygen.dll module to mediate between thinBasic and o2. It is rather similar to co2, though it can also share variables and support function calls directly. Is this what you intend to do?
Quote from: Charles Pegge on February 21, 2023, 12:45:11 AM
But there is hidden code: the thinBasic_Oxygen.dll module to mediate between thinBasic and o2. It is rather similar to co2, though it can also share variables and support function calls directly. Is this what you intend to do?
Indeed.
Although, I do not need the ability to create .EXE or .DLL files.
All I want to do is to be able to execute an .o2bas file from 64-bit PureBasic, and get the results back from the execution.
Something along this theoretical example 64-bit PureBasic code;
If OpenLibrary(0, "Oxygen.dll")
thestring = "result=10+20"
oAddr = CallFunction(0, "o2_basic", @"thestring")
'and/or instead of thestring, an .o2bas file
'Use o2_exec to execute thestring, and return the result
oExec = CallFunction(0, "o2_exec", oAddr)
'Get the result, which should be 30, and store it in oString
'Not sure how this would be accomplished.
If OpenConsole()
PrintN(oString)
EndIf
Else
PrintN("Error opening oxygen.dll")
EndIf
Regards,
Joe
Charles .
I think that he means on o2 compile function
hmm but i am not sure , i have PureBasic (old version)
maybe i can try PB code ...
I think it is possible with the current o2/co2 using shared-memory for data passing between processes, but ideally a 64bit o2 would be the best solution. Time is the problem. Are you in a hurry, Joe?
Indeed, a 64-bit oxygen.dll would be the best solution.
No big hurry, no big rush.
Thankyou for your assistance.
Regards,
Joe
Rex Conn has been, and is, the owner of JP Software.
I've been using his software since the 1980s, when it was called 4Dos.
More about Rex Conn at https://www.linkedin.com/in/rexconn
Or, if you want, you can converse with him on the forums
Ref: https://jpsoft.com/forums/
or via email support@jpsoft.com
Joe
If anyone is interested in the 4DOS Source Code,
before it became TakeCommandConsole (TCC.EXE) for Windows,
it is available from;
https://4dos.info/sources.htm
I think that Rex Conn released the source code for 4DOS back around 2004,
but I cannot remember for sure.
Luchezar Georgiev took over after that,
and took 4DOS from version 7.50 to version 8.00
Joe
Ok, good to know. He should just put his name on the WEB-Site.
To me generally the program sounds useful for System Administration.