Giter Site home page Giter Site logo

wandersonsousa / simplang Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 1.35 MB

interpreter for simplang

Home Page: https://simplang.up.railway.app/

PHP 1.42% Hack 3.98% CSS 2.60% JavaScript 88.91% HTML 3.08%
ifpi arquitetura-de-computadores linguagem-simples

simplang's Introduction



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 ✨

Documentation of language instructions

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 :)

Tech

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

Local Installation

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?

Development

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.

License

MIT

Free Software, Hell Yeah!

simplang's People

Contributors

wandersonsousa avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.