This project has been abandoned, you are free to use the specs as you wish :P but the compiler and emulator are not guarenteed to work.
Sas is a cpu architecture that was just created for emulators and other such stuff. It is for fun and for learning basic assembly language. You can look at specs for more information.
- 32-bit architecture 📟
- Easy to use 🎉
- Less than 25 instructions to grasp 📃
- Easy to debug 🐛
- Fast and extensible emulator ⚡
The compiler is itself written in nim and the code is organized using modules. Your main interest should be at module sas/toolchain/parser. To compile a source file. You should follow the following series in order. The result of one to the other in chain:
parseAsm
resolveIncludeDirectives
compile
And to decompile you can use the following function
decompile
To convert debuginfo from table to string. There are exported functions that are originally located in sas/toolchain/debuginfo.
fromTextDebugInfo
toTextDebugInfo
This compiler also provides a commandline interface. First, build the main
binary by using nimble -d:release build
. This should build the sas binary
which you can invoke by ./sas --help
. The CLI interface is full featured.
The compiler has some flags that alter the output binary.
Flag | Effect |
---|---|
-d:release |
Makes the compiler very fast ⚡ |
--mm:orc --deepcopy:on |
Makes the compiler even faster ⚡⚡ |
-d:hideWarnings |
Resulting compiler will never have any warnings enabled |
This project comes with a test suite, any contributions made require a test to be
written, as of now these work by using the tool testament
. To run these tests
you can run the following command:
testament cat .
To basically learn about SAS, please look into specs. They contain every detail. Even a reference
LICENSED UNDER MIT LICENSE. LOOK AT LICENSE FILE FOR MORE DETAILS