About
In this post, I will briefly cover a simple compiler made for a simple programming language I made. The compiler compiles the MyLang(not the most creative name, but naming things is hard, and I just needed a name) programming language down to the assembly for a simple 8-bit computer I made years ago.
I always wanted to make my own simple programming language and compiler just for fun and learning. Then, a few years ago, I was looking into making a DSL(domain specific language) for a work related project. In the end, I decided to just use C#, compile it with Roslyn compiler APIs and then run the generated assemblies with reflection, because it’s much easier as all the language, compiler and tooling already exist, so you don’t have to make it all yourself.
This inspired my other project the C# Online Compiler, which you can read about more in this post here.
All of this got me further into topics about compilers, languages, debuggers, and language servers. I was initially thinking of making a C compiler, but I then decided it would be nice if I actually made a high-level language that compiles down to the ISA of my custom-built 8-bit computer.
Link to app MyLang Compiler + AsmIDE
Github repo: 8Bit Computer
Old AsmIDE
To make programming the 8-bit computer even easier I decided to make a simple sort of an IDE that can connect to the Arduino programmer and program the computer through it without having to reflash it with every change of the program.
The IDE has three code editors. The last window has the assembly definition where you map your custom machine code for the specific computer you made to your specific custom assembly language you made. Then you can write an assembly program in the first code editor. The machine code will automatically get generated in the middle editor.
On the left, you have the controls column. At the very top, you can establish a COM port connection to the Arduino.
Then you have the option to set your RAM size, RAM word length, and the memory address length. Currently, this is fixed and can’t be changed. I didn’t really need the option for a bigger memory so I skipped implementing this feature(might add it in the future).





