Added assembled examples and a C99 reference implementation

This commit is contained in:
Luxferre
2025-04-23 10:05:29 +03:00
parent 6bc0a916eb
commit 29c84356f9
7 changed files with 403 additions and 0 deletions
+8
View File
@@ -254,6 +254,9 @@ repository, or even by hand (by numbering lines, resolving the labels and
replacing mnemonics with corresponding opcodes). The "Hellorld!" example only
works on the platforms supporting I/O port 1 (character output).
If you just want to test an implementation, assembled MU8 machine code files
(in the plaintext format) are stored in the `examples/assembled` subdirectory.
Reference implementations
-------------------------
@@ -266,6 +269,11 @@ Reference implementations
character input port correctly on desktop OSes but falls back to a simple
stream file read in case the library is not found). Accepts a file name to
preload a MU8 (plain text) machine code program from the OS command line.
* [ISO C99 implementation](mu808.c): supports the entire specification the
same way as the Python implementation, and also makes use of the optimized
`fma()` call that appeared in the C99 standard. Accepts a file name to preload
a MU8 machine code program from the OS command line. Compile the source with:
`cc -std=c99 -O2 -s -lm -o mu808 mu808.c`
### Assembler reference implementations