News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Compiler

Started by Buek, July 12, 2016, 02:11:58 AM

Previous topic - Next topic

Buek

I have written a compiler which takes Pascal (Oberon-07) as input language and produces JWASM compatible assembly code (MASM probably also works). The resulting ASM file can then be assembled and linked into a working EXE file from within the compiler interface. I have found this compiler very effective to produce windows applications. The program appears to be quite stable which is supported by the fact that the compiler compiles itself, including the Windows interface. The compiler is about 6500 lines of code split into five separately compiled modules (excluding code imported from several service modules which I have written for the project).

I wonder whether there is any interest out there in the MASM community for a program of this kind. If so, please let me know and I will gladly make the program available.

With best regards,

Buek

jj2007

That sounds interesting indeed :t

I don't have experience in Pascal, but my favourite Basic dialect (Gfa) has many Pascal elements, I was told, so I am curious to see your project.

Biterider

Hi
Pascal was my first coding language  ;)
I'm really interested to see your implementation.

Biterider

Buek

Attached I am uploading the ObAsm compiler file with examples. Please carefully read the ReadMe.TXT file. I would be grateful for any feedback on the usefulness of my program if possible. Should there be any questions, please let me know as well.

Best regards,

Buek

anta40

I'm fascinated by Wirthian compilers (Pascal, Modula, Oberon etc)  :t
Is the compiler source itself available?


HSE

Hi Buek!

I'm still trying to understand how the program work.

The interface is still very primitive: have a negative position, it's no posible to resize it, and lateral panels are fixed (I see only the border, first 4 columns).

The general idea sounds great. Thanks
Equations in Assembly: SmplMath

Buek

I agree, the interface is rather simple. The main objective was to write a compiler, not to write a nice interface. I realize however that other people may use hardware that is different from my own and obviously that causes a problem in your case. I will look into this and come up with a solution. Thanks for the feedback.

Buek

Quote from: HSE on July 12, 2016, 10:51:03 PM
Hi Buek!

I'm still trying to understand how the program work.

The interface is still very primitive: have a negative position, it's no posible to resize it, and lateral panels are fixed (I see only the border, first 4 columns).

The general idea sounds great. Thanks

I have corrected the resizing problem. The WS_OVERLAPPEDWINDOW* = 0CF0000H constant was set to the wrong value in module WinUser. I am now working on a way to resize the Tab controls in the main window. Has anyone an idea how to do this?

The recompiled version of ObAsm is attached.

HSE

Hi Buek!

There is a good example:
   \masm32\examples\exampl03\splitter
Equations in Assembly: SmplMath

Buek

Quote from: HSE on July 14, 2016, 10:52:15 PM
Hi Buek!

There is a good example:
   \masm32\examples\exampl03\splitter

This looks useful. I will try to make it work in my program.

Regards Buek

HSE

Finally I build Fern  :t

There is some errors compiling ObAsm, another suggestion is to put some description of the errors.

Thanks
Equations in Assembly: SmplMath

Buek

Quote from: HSE on July 16, 2016, 12:56:37 AM
Finally I build Fern  :t

There is some errors compiling ObAsm, another suggestion is to put some description of the errors.

Thanks

Can you describe the errors which you are getting? Are there compile errors, assembly errors or does the linker have problems?

Thanks, Buek

Buek

Quote from: HSE on July 16, 2016, 12:56:37 AM
Finally I build Fern  :t

There is some errors compiling ObAsm, another suggestion is to put some description of the errors.

Thanks

On second thought, please note that you cannot compile ObAsm with ObAsm.exe. The reason is simple: ObAsm. exe is an open file which invokes the linker to link all the obj files into a new version of ObAsm.exe. In order to do so, the ObAsm.exe file needs to be deleted first and then be replaced by the new version. This is of course impossible because ObAsm.exe is still open. Therefore just rename ObAsm.MOD into something else such as ObAsm1.MOD and change the first line in ObAsm1.MOD into "MODULE* ObAsm1;" and the recompile and link the new ObAsm1.MOD. Recompiling a compiler with itself is of course a very special case which normally is not encountered.

Buek

Quote from: Buek on July 16, 2016, 11:45:55 AM
Quote from: HSE on July 16, 2016, 12:56:37 AM
Finally I build Fern  :t

There is some errors compiling ObAsm, another suggestion is to put some description of the errors.

Thanks

On second thought, please note that you cannot compile ObAsm with ObAsm.exe. The reason is simple: ObAsm. exe is an open file which invokes the linker to link all the obj files into a new version of ObAsm.exe. In order to do so, the ObAsm.exe file needs to be deleted first and then be replaced by the new version. This is of course impossible because ObAsm.exe is still open. Therefore just rename ObAsm.MOD into something else such as ObAsm1.MOD and change the first line in ObAsm1.MOD into "MODULE* ObAsm1;" and the recompile and link the new ObAsm1.MOD. Recompiling a compiler with itself is of course a very special case which normally is not encountered.

I have in the meantime added resizing features to the interface as suggested. I have not been able to test the new version extensively but it seems to work.

HSE

I was trying to make what you do!

I change exe name before compile. Messages were at compiling time, popups show 2 , 3 or 11 (I think). But now there is no popups and I see messages in lateral panel.

Thanks.
Equations in Assembly: SmplMath