“Lotg” (originally standing for “Language of the Gods”) is a pseudocode I developed during my first year at the Technion. I wanted to develop such a code with a minimal set of instructions. Initially it had eight instructions, but I was able to reduce it to five. I believe it is Turing-complete. Here is an explanation of it.
Lotg is defined on a memory in which there is a cell associated with every integral number (positive, negative and zero), and every cell can contain one integral value. The cells will be marked as m[i] where i is the index of the cell. There are two registers - “pointer” and “register” which will be marked as r and p.
The following instructions are defined:
Using these instructions one can define the following macros:
p = -10**100 # Essentially a number that should not concern us. m[p] = r ; r = 0 p = j p = m[p] p = m[p] r += p p = i p = m[p] m[p] = r ; r = 0
p = -10**100 m[p] = r; r = 0 p = j p = m[p] p = m[p] r += p p = i p = m[p] p = m[p] r += p p = i p = m[p] m[p] = r ; r = 0
p = -10**100 m[p] = r ; r = 0 p = -j r += p p = i p = m[p] r += p p = i(end) if r > 0 jump p p = 1 r += p p = i(after) if r > 0 jump p p = -10**100 m[p] = r ; r = 0 p = 1 r += p p = i(end) if r > 0 jump p after: [BLOCK] end: