1 Bit, a quarter byte

From Esolang
Jump to navigation Jump to search

1 Bit, a quarter byte is an assembly language for a 1-bit CPU, made by User:None1. With 1/4 byte of memory, this machine could store 2 instructions.

Commands

Command Name Meaning
0 END END. Print the entire memory as bits and end the program.
1 INT INverT. Invert the other bit.

The instruction pointer can wrap around, thus allowing more "complicated" programs.

Examples

All possible programs

00 -> 00
01 -> 01
10 -> 01
11 -> 10

Quine

00

Another one:

01

Interpreter in Python

print({"00":"00","01":"01","10":"01","11":"10"}[input()])