Skip to content

RaviMauryaHootowl/RSOC

Repository files navigation


Logo

R.S.O.C.

A custom built programming language

✔ About The Project

R.S.O.C. is a custom built programming language very similar to a low-level 8085 programming language. This is made using Python and is under development.

Code to generate the fibonacci sequence:

Fibonacci Sequence

🏃‍♂️ Installation & Usage

  1. Clone the repo

    git clone https://github.com/RaviMauryaHootowl/R.S.O.C..git
  2. Enter your code in code.txt file

  3. Run the run.py file

    python run.py

✍ R.S.O.C Tutorial

🤖 Architecture

R.S.O.C. comes with a memory size of 65536 locations and 7 Registers(A-G)
Memory is represented within M() Eg. M(2000H)
This denotes memory location with hex index of 2000
Registers are represented by their letter which ranges from A to G

📃 Instruction Set

  1. SET: Used to set a memory or register from another memory, register or data.
    Eg.
    SET A, B
    SET A, 20
    SET M(2001H), 40
  1. SHOW: Used to print the value of a memory or register.
    Eg.
    SHOW A
    SHOW M(2000H)
  1. SKIP: Empty and Useless line just like your life (jk)
    Eg.
    SKIP
  1. ADD, SUB, MUL, DIV: Performs arithmetics on two numbers and stores into A Register (Accumulator)
    Eg.
    ADD A, B
    ADD C, M(2000H)
    ADD 30, 40
    SUB A, B
    MUL B, C
    DIV C, D
  1. INR/DCR: Used to Increment or Decrement value
    Eg.
    INR A
    DCR M(1000H)
  1. IFG: If greater conditional jump to a label.
    Eg. Here since A is greater than 10 it jumps to jumptag label
    SET A, 20
    IFG A, 10, jumptag
    ...
    ...
    SHOW A : jumptag
  1. IFL, IFE, IFN:
    IFL: If Less
    IFE: If Equal
    IFN: If Not Equal

  2. Pointers: X(A) is used to access the memory location whose memory address is in register A. Eg.

    SET A, 100H
    SET X(A), 20
    ~ This is print 256 as it's decimal value of 100H
    SHOW A
    ~ This will print 20
    SHOW X(A)
  1. Comments: These are represented by ~ (tilde) symbol which is also the logo of R.S.O.C.
    Eg.
    SET A, 20
    ~ This is a comment line
    SHOW A

✨ Sample Programs

Add 2 numbers

About

A simple Programming Language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published