Simplang is an online pseudo-code execution environment that simulates a machine language.
- Enter the code in the editor
- See changes in memory and register on the side
- ✨Magic ✨
Before starting, we need to define some considerations regarding simplang's simulated runtime environment: 1° The environment has a memory with 100 cells available. 2° The environment has only 1 register. 3° The language only accepts one instruction per line, any further instruction will be ignored by the interpreter.
Character map: N = cell position in memory, I = any integer.
That's all, now let's go:
- load N - loads a value from memory into the register
- add N - adds the value of N to the value in the register
- sub N - subtracts the value of N from the value in the register
- div N - divides the value of N by the value in the register
- mul N - multiplies the value of N with the value in the register
- addi I - adds the integer I to the value in the register
- subi I - subtracts the integer I from the value in the register
- divi I - divides the integer I by the value in the register
- muli I - multiplies the integer I with the value in the register
- store N - saves the current value of the register in memory at N
Use these instructions, add a little logic, and you'll see how things work under the hood :)
Simplang uses these technologies:
- PHP - The entire server and engine were made with this beauty
- Javascript - DOM changes and communication with the engine by ajax
- Bootstrap - Styling of screen components
If you want to run Simplang in your local environment, just download the project and add it to the PHP server on your machine, after that, just access the index.php file, simple, right?
Would you like to contribute?
One way is to send us an issue with a suggestion for the environment.
The other is sending us a pull-request with your own code modification:
Clone the repository on your php server
git clone https://github.com/wandersonsousa/simplang.git
Now, just add your modifications, and send a pull-request to the project.
MIT
Free Software, Hell Yeah!