Skip to content
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.

amaank404/sas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Abandoned!

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.

LOGO Image

SAS (Small and Simple) 😄

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.

Features 🌟

  • 32-bit architecture 📟
  • Easy to use 🎉
  • Less than 25 instructions to grasp 📃
  • Easy to debug 🐛
  • Fast and extensible emulator ⚡

Compiler/Decompiler

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

CLI 💻

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.

Compiler Compilation Flags 🎌

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 ⚠️

Running the tests

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 .

Specs 📒

To basically learn about SAS, please look into specs. They contain every detail. Even a reference

Licensing 📄

LICENSED UNDER MIT LICENSE. LOOK AT LICENSE FILE FOR MORE DETAILS

About

A Simple 32-bit CPU architecture to play with

Resources

License

Stars

Watchers

Forks

Packages

No packages published