Skip to content
/ mya16 Public

Custom Assembly dialect for custom cpu architecture

Notifications You must be signed in to change notification settings

Muph0/mya16

Repository files navigation

mya16

Custom cpu architecture with a compiler.
(circuit files are located in cpu/ directory)

How to compile assembly:

You have to use the mp16.exe compiler. If you want to see the sources, take a look inside of the sources/ directory.
If you have your assembly spread to multiple files, target the root one.

mp16.exe path/to/my/root_file.mya16

Compiler will build all the source files into one *.bin16 file.

NOTE: The language for the compiler is a small subset of Intel x86 assembly mixed with some C-like preprocessors I made up. There is no documentation of it so I encourage you to take a look at the os.mya16 and bios.mya16 files as an example.

How to execute binary files:

You have following options
A) Run Logisim simulation

  1. You need to have Logisim installed
  2. You have to download the cpu schematic and open it up in Logisim
  3. When inside logisim with the schematic loaded, you have to load the *.bin16 file into the ram. (R-click the ram -> Load contents... -> select the file)
  4. Then you just start the clock (Ctrl-K) and press the button labeled I/O
  5. In order to use your keyboard as an input, you need to click the keyboard IC.

B) Run the interpreter
If you are too lazy to run Logisim every time you alter the sources, you can use the mp16_interpreter.exe. It executes the *.bin16 files the same way as the cpu simulation in Logisim would.

mp16_interpreter.exe path/to/my/compiled_file.bin16

NOTE: In order to run the interpreter, the compiler (mp16.exe) needs to be located in the same directory.

Example programs

All of the example programs are bundled to one binary, os.bin16.

About

Custom Assembly dialect for custom cpu architecture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages