Author Topic: Oxygen Basic Compliation  (Read 1628 times)

0 Members and 2 Guests are viewing this topic.

Kirk Friend

  • Guest
Oxygen Basic Compliation
« on: June 07, 2018, 02:15:18 AM »
Hello,

I am new here, I stumbled upon Oxygen Basic while searching for a simple language which is compatible with C headers.

While reading through some of the information on the forums regarding the architecture of this compiler I came across the following:

 COMPILING STAGES:


Basic and Macros are converted to Assembly code.
Prologs, epilogs, PE headers and  sections are added.
Assembly code is converted to Oxygen script.
Oxygen script is converted to binary and linked.
The executable binary image is then (optionally  compacted into a PE file.


o2Sema-->o2fini-->o2Assm-->o2Link-->(makeEXE/DLL)

I do not fully understand what is happening here. Is Oxygen Basic converted to x86 assembly using o2Sema, then converted back to Oxygen Basic using o2Assm? Sorry I have a very vague understanding of computer architecture but what I do know is everything is essentially converted to the binary machine code.

An x86 assembler is MASM, would this be used to convert the assembly into a binary executable?

Charles Pegge

  • Guest
Re: Oxygen Basic Compliation
« Reply #1 on: June 07, 2018, 03:10:51 AM »
Hi Kirk, Welcome to our forum.

OxygenBasic is an all-in-one compiler, assembler and linker. It produces machine code which can be executed directly in memory (JIT Just In Time compiling), or incorporated into a PE file (DLL or EXE).

By associating .o2bas files with an o2 compiler, co2.exe, you can compile and execute programs directly without creating an EXE file.

To clarify and simplify the description you quoted:


COMPILING STAGES:

    Basic is converted to Assembly code.

    Assembly code is converted to Oxygen machine script.

    Oxygen machine script is converted to binary code and linked.

    The executable binary image is then used to generate a PE file (optional)


o2tran-->o2Assm-->o2Link-->(makeEXE/DLL)

This description leaves out the messy details, but gives you the basic picture.


Kirk Friend

  • Guest
Re: Oxygen Basic Compliation
« Reply #2 on: June 07, 2018, 04:09:41 AM »
Hi Charles,

Thank you for the clarity.

So Oxygen machine script is similar to Java's bytecode or .NET's CLI?

This is an interesting project, and I can see a lot of work has gone into this. I am a big user of Visual Studio and the VI/VIM plugin so I might look into trying to implement a plugin for Oxygen Basic, if you don't mind.

Charles Pegge

  • Guest
Re: Oxygen Basic Compliation
« Reply #3 on: June 07, 2018, 04:40:33 AM »
o2 machine script is very low level. It is mostly x86 machine code in text form, with embedded symbols for memory alignment, linking jumps, calls and constant data. So it has no resemblance to Java-Byte-Code or CIL.

I am interested to see what is involved in making a plug-in.