Skip to content

Aubergine

Lykrast edited this page Nov 20, 2018 · 1 revision

Aubergine is a language created by Boily in 2008. This details how it is implemented here.

Memory

At the start of execution, program is turned into an array of integers, each cell holding the ASCII code of the corresponding character in the source code.

Instruction pointer is called i and there are two variables called a and b.

Instructions

Instructions are groups of 3 integers, the first one being the instruction and the next two being parameters (first and second).

After an instruction is executed, instruction pointer increases by 3 to go to the next (even if the executed instruction moved it).

If the instruction pointer is moved outside the array (either before or after), execution ends.

Instructions

Character Integer Effect
= 61 Set first parameter to value of second parameter
+ 43 Set first parameter to its current value + value of second parameter
- 45 Set first parameter to its current value - value of second parameter
: 58 If value of second parameter is not 0, set instruction pointer to value of first parameter

Any other instruction number is an error.

Parameters

Character Integer Value
1 49 1, cannot be the first parameter of an instruction
a 97 Value of variable a
b 98 Value of variable b
A 65 Content of cell at position a
B 66 Content of cell at position b
i 105 Value of instruction pointer
o 111 Only useable with = instruction, if first parameter prints value as a character, if second parameter takes a character from standard input and gives its ASCII code

Any other parameter number is an error.

Clone this wiki locally