Bitfuckery

From Esolang
Jump to navigation Jump to search
Bitfuckery
Paradigm(s) imperative
Designed by Mysti Kethen/Xarthan
Appeared in 2024
Memory system Cell-based
Dimensions one-dimensional
Computational class Turing complete
Reference implementation Unimplemented
File extension(s) .bitfuckery

This page is still a work in progress!!!


Bitfuckery operates using a single bitwise instruction for all computations. All code is written in hexadecimal and any attempts to not write Bitfuckery in hexadecimal will result in being forced to read my bit manipulation java code.

Language overview

Standard Bitfuckery operates on an array of 2^16 cells one byte in size. The code is self-modifying to allow for indirect addressing. Data and code are stored in the same memory GLHF

The program MUST start with 0x00 counting up to 0xFF. If this condition is not met the bee movie script will be printed to the console and execution will halt.

The program counter starts at 0x000100 and increments by 3 every step.

registers are denoted with &" " and memory addresses are denoted with *" "

Command Alias (? is replaced with an argument in hexadecimal) Description
0btttt,0rrr,xxxx,xxxx,xxxx,xxxx BIT(?, ?)[????] (second argument must be in the range of 0x0 to 0x7 inclusive) performs a bitwise operation on &a and &b with a truth table defined in "t" and a rotate by "r" bits and puts the result into &c. If result is not zero jump to *"x"
0b&a&b,10&c,xxxx,xxxx,xxxx,xxxx ARG(?, ?)[????] (second argument must be in the range of 0x8 to 0xb inclusive) set registers to be used for bitwise operations and jump to *"x" unconditionally
0b--&a,1110,xxxx,xxxx,xxxx,xxxx READ(?, 0xe)[????] read from memory at *"x" to &"a"
0b--&a,1111,xxxx,xxxx,xxxx,xxxx STOR(?, 0xe)[????] write from &"a" to memory at *"x"
0b1111,1111,1111,1111,1111,1110 DUMP(fffffe) dumps memory to console (can be used for memory-mapped I/O)
0b1111,1111,1111,1111,1111,1111 RICK(ffffff) prints the lyrics to Rick Astley's "Never Gonna Give You Up" to the console and halts execution

Memory-mapped I/O starts at 0x8000 with 256 bytes for input ending at 0x80FF inclusive and 256 bytes for output stating at 0x8100 and ending at 0x81FF inclusive. Dumping memory to console causes memory-mapped output to be sent to an output device (must be capable of playing Bad Apple).