adam-mcdaniel / sage

A programming language that's wise beyond its bytes!🌱🌿🪴
https://adam-mcdaniel.net/sage-website
MIT License
437 stars 15 forks source link

WIP: Added to assembly language, tests, and an interpreter #1

Closed adam-mcdaniel closed 2 years ago

adam-mcdaniel commented 2 years ago
  1. Simplified the assembly language to use more broad instructions with more generalized purposes (merged Store and Push, and Load and Pop, for example).
  2. Added tests to prevent any possible breaking changes in the assembly language conventions or virtual machine.
  3. Added a virtual machine interpreter (which can be attached to any input or output device) to test the assembled output code (virtual machine code) of the assembly language against sample output.
  4. Changed the calling conventions of the assembly language. Now frame pointers aren't stored on the stack: they are given their own stack directly after the registers. This way, the values Pushed and Popped from the main stack (arguments to functions and etc) can be manipulated more easily. Now, functions need only pop all their arguments off the stack and leave their return value before exiting.