Six instruction language :)

From Esolang
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.

this is my first one btw
Six instruction language is a language that has 6 instructions. An input stream is absent. It has 3 registers and each are stored as a number from 0 to 15. Register 3 is the output of the program.

Instructions

The following instructions are available. Please heed that the first register is named r1, the second r2, and the third r3.

Six instruction language :)'s instructions:
Instruction What it does
1 Set r1 to n
2 Set r2 to n
3 Set r3 to r1+r2
4 Wipe r3
5 Wipe r1 and r2
6 Invert r1 (set r1 to 15-r)

To pass an argument to the commands 1 and 2, you proceed the command with the following encoder table:

encoding
argument input
0 a
1 b
2 c
3 q
4 w
5 e
6 d
7 f
8 g
9 r
10 t
11 y
12 h
13 i
14 j
15 u

So 1e means to set r1 to 5.

Example Programs:

Addition

1+1:

1b2b3

Output:

2

because 1+1=2

State Inversion

This program sets the value of the first register to five, inverts, and prints it:

1e63

Interpreter

  • Common Lisp implementation of the Six instruction language :) programming language.