Exalang
Jump to navigation
Jump to search
- This article is not detailed enough and needs to be expanded. Please help us by adding some more information.
Exalang a programming language which is the same as ESOPUNK
I used the source code of ESOPUNK, added new features and no more no less.
more about ESOPUNK
Syntax
the syntax is: instruction x1 .. xn
registers
you use them as variables, because there's no variables in the language!
- X : a custom register
- T : also a custom register, but changed by the TEST command. used by TJMP and FJMP commands.
- M : a custom register for communication between exas
- F : When an exa hold a file, it's used to read a value from the held file (like accessing array items by index), each time you read, you read the next value, if you write to it, it will change the current value in the file.
I/O
- #STDI (read only) : read a character from stdin
- #STDO (write only) : write to stdout
- #STDE (write only) : write to stderr
list of instructions
- COPY a b : sets the value of b (register) to the value of a (number / register)
- ADDI a b c : sets register c to a + b
- SUBI a b c : sets register c to a - b
- MULI a b c : sets register c to a * b
- DIVI a b c : sets register c to a / b
- MODI a b c : sets register c to a % b
- MARK label : marks a label that you can jump to via JUMP instruction.
- JUMP label : continue executing the program from label
- TJMP : if T register == 1 then jump to label
- FJMP : if T register == 0 then jump to label
- more instructions + better explanation -> ESOPUNK
links
- Github (source code and interpreter): https://github.com/M-Programer/exalang
- Syntax and commands + ESOPUNK: ESOPUNK