Sometimes you need to code some procedure in a clarion program with
access to low-level operations or management of structures or similar issues,
for which clarion is not the best tool.
In addition, the code generated by the clarion compiler is not very good.
In the past I have used procedures coded in c and assembly for that purpose.
However, the latter has a syntax that is really inconvenient, in addition
to have stayed in the past. RichClaCode’s post mentions some assembler posts that are mine.
In the case of c, neither can any procedure be put in place without many modifications needed.
Of course there are other alternatives, such as using a dll, using com, etc.
However, looking for another possibility I found that there are products that generate objects in OMF like clarion, in particular the Digital Mars compilers, which includes C, C++, D, and assembler; are freely available and appear to be of good quality and even the sources are available.
As a first step I coded a parser of the OMF objects to see how far there were and I found that there is quite a lot of compatibility and, in short, I managed to insert procedures compiled with the digital mars compiler into a clarion program with good results.
I looked at those compilers, in particular if they worked with ARM cpu’s as this could provide a route to generating native code apps instead of going through frameworks like Facebooks Anyscreen.
I see in their forums some people have tried to get the Mars compiler to work compiling code for ARM cpu’s but generally it doesnt look they have been successful.
However in this clarionlive, BobZ had mentioned the possibility of moving away from a topspeed compiler to something else as there are other compilers (that point was much earlier than the link below), like Laurens questions at this link. https://youtu.be/5OmUAUcJSrw?t=3256
I had a look at the OMF format, but is this the only format that runs on 8086/amd64 cpu’s as I couldnt find anything online to suggest there are other formats and if Arm uses the OMF format?
For generating code for ARM cpu’s I would look in other places. I did some coding for the ARM but at the moment i don’t remember the compiler I used, perhaps Keil.
There are others compiler for ARM, some free, including I think VStudio community. Generating code for the ARM has its complications, because of the diverse architectures.
Regarding the OMF format, there are several compilers that can generate OMF objects; but for linking an object in clarion you need two things:
a) the records generated in the OMF object must be digestible by the clarion linker, or that you can modify the object to a compatible one; and
b) keep the ABI rules; this is easier if you code low level procedures, perhaps in asm; That is the case I was trying to solve.
Watcom also can generate OMF, also you can with MASM, including de latest editions (I think that even coding inside VS; you can generate your proc, test it using the VS debugger and later recompile the source and get the OMF object).
I haven’t tested all this options.
I haven’t watch the Clarion Live video that you mention, but I will.
regards
another point: you said “if Arm uses the OMF format”. That format is only the format of the output of the compiler that goes to the linker for creating an exe.
Does not depend on the processor that will run your code.
I’m thinking along the lines of using the templates to generate code and then call the respective compiler. I’ve been working slowly on a language translator with the aim of taking any code in any language and translate it to another.
The first stage is getting it to add debugview code to a clarion source file or template file automatically and seamlessly, so output can be monitored easily. Thats working roughly, but its not one click automatically seamless yet and there is a lot of regex involved to parse the lines of code.