Skip to content

naens/plm

Repository files navigation

A PL/M Project

Description

This project is still very early in development. The goal is to write a parser and a code generator for the PL/M programming language.

I would like to make it compatible with both CP/M 2.2 and CCP/M-86 3.1 because they lack a good enough PL/M compiler.

For now I use the PLMX compiler but perhaps will continue with Intel PL/M-80. It had some weird problems with jumping to the right location at the beginning of the execution. So I think when it will be solved I will continue with Intel PL/M-80.

Documentation

There documentation generated from the source code will be stored here: https://naens.github.io/plm/.

It’s still a work in progress, so for the moment it will be rather empty.

Goals

There are several goal for this project:

  • To have an open source and maintained compiler for the PL/M progamming language that works on CP/M 2.2, CCP/M-86 3.1, DOS, and Linux.
  • Another goal is to adapt and be able to compile CCP/M-86 using only itself as the operating system. And then, perhaps to port it to 386, 486, and perhaps other architectures.

Features

Language

As for the language, I’d like to make it compatible with PL/M-86 as much as possible and totally compatible with PL/M-80. I will also try to replicate its code generation. But at first it will be without any optimization. Then when it will be more mature, I will add some which were used in the original compilers.

Targets

As for the targets, I will make it compile to different targets. It’s important to be able to generate compilers to targets based on the compilation options.

Of course the priority targets for me will be Z80 and 8086 assembly languages. I’m not sure it’s worth compiling directly to machine code, so for now for simplicity these will be the targets.

If it will support multiple targets, it wouldn’t be difficult to add other targets, for example LLVM ir, so now it would suddenly run on Linux! I would be great, wouldn’t it?

Development environment

I am developing the project on DOSBox-X. I tried developing under CP/M using Intel PL/M-80 and another compiler called PLMX, but both had a very serious limitation that the length of the identifiers was limited to 5 or 6 character. Fortunately PL/M-86 allows identifiers of length 31. The assembler I will probably use to create binaries from assembly code, ZSM4 accepts identifiers of 12 character, which will be for now the limit. At least it’s much better than 6.

The editor I use is the CP/M-80 ED.COM editor. I use it with the emulator called Z80MU. Unfortunately I don’t have a version of ED that works under DOS.

How to compile

The build program I use is wmake, which is distributed with OpenWatcom. There is a makefile in the project directory that has all the necessary rules to build the program

Executing wmake builds the whole project. You can also specify the individual targets, for example wmake cons.obj will only build the cons module.

Support

If you want to help the project, you can do it on Patreon: https://www.patreon.com/simpleprogrammingcodes.

About

Read source code and generate code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published