Open stefnotch opened 3 years ago
Some quick notes regarding the Micro16 grammar (as far as I can tell)
instruction; instruction; instruction; instruction; ...
AC <- lsh(~MBR); MAR <- 1; rd; goto 139
instruction = rd | wr |
(register <-)? math |
(if (Z|N))? goto number
math = shift(arithmetic) | arithmetic
shift = lsh | rsh
arithmetic = register | unaryop register | register binaryop register
unaryop = ~
binaryop = + | &
and then we need to do a whole lotta extra validations (e.g. cannot write to register -1)
Defining an isomorphism is probably impossible, since
RDWR MS
0 0 = ""
1 0 = "" (warning?)
0 1 = wr
1 1 = rd
Maybe we can ask for a language grammar from the source? 🤔
Here is a pretty interesting Micro16 compiler, I guess it might be worthwhile1 to work on that one and compile it to webassembly
https://github.com/zero9178/Micro16C
[1] Worthwhile for anyone who still has TGI