From Esolang
Jump to navigation Jump to search

Base64 lang is a simple esolang made by User:1048576.

We have 1 register val with default 0, and a sequence of length 512(start is a_0).

A command is two characters(12 bits when decoding in Base64 encoding):

[control(3bits)] [addr(9bits)]

(A is short for a_(addr in binary))

control meaning
000 val <- A
001 A <- val
010 A <- !(A and val)
011 if val, then jump to before A-th command running
100 Halt
101 input a bit from stdin, then save it in A


Cat program:


Explanation: when it writes in binary, it looks at follows:

000 000000001 # Set val to 0
001 000000000 # Set a_0 to val(0)
010 000000000 # Set a_0 to (a_0 and val), which is 1
000 000000000 # set val to a_0(1)
011 000000000 # jump to before the first command running, so it is a cat program.