BIITI
Assembler names on a Forth machine, and not one of them does what it says.
DolphyWind, 2024 · Turing complete: yes · ●●○ moderate · esolangs.org
Tested with 4 known programs · Test method
Run it
The idea
DolphyWind made BIITI in 2024, after 8086 assembly and Forth. The name stands for Beauty Is In The Implementation. A program is a list of lines that look like assembler, but the specification warns that its 21 commands do not do what you think. MOV pushes, ADD duplicates, MUL compares, SUB jumps and JE prints.
The machine
A stack of values, each a string, a whole number or a float. ACC holds one more value and starts at 0. CMP holds the last comparison, which is Less, Equal, Greater or NoCmp. Lines are numbered from 1.
| Command | Does |
|---|---|
MOV x | Push a string or a number |
JNE | Drop the top |
JL JG JLE CMP | Sum, difference, product, ratio of the second and the top; JL also joins strings |
MUL | Compare the second with the top into CMP |
SUB n | Jump to line n |
JGE PRINT RTR | Skip the next line on Equal, on Less or Greater, on Greater |
POP DUP PUSH | Skip the next line on Greater or Equal, on Less, on Less or Equal |
JMP DIV | Pop into ACC; push ACC |
JE | Pop and print |
ADD | Duplicate |
ROT | Read a line of input |
INDEX | Rotate the top three, so the top goes third |
READ | Push the character of a string at an index |
Example
The truth machine reads its input, prints it and compares it with 1.
The truth machine reads its input, prints it and compares it with 1. PRINT skips the jump back when the two differ, so on 0 the program runs off its end. On 1 SUB 2 sends it back to the duplicate on line 2, and it prints 1 forever. Counted from 0, line 2 would be the print, and the duplicate after it would find an empty stack.
The counter keeps its limit in ACC and counts from 0 up to it. RTR skips the jump back once the count has passed the limit. The empty fourth line is where SUB 4 lands.
Patterns it teaches
- Stack machines: a Forth stack under assembler names.
- Hostile design: every familiar name means something else.
Further
See also
Stack-based
Write your own in Run Convert a program from BIITI
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: biiti.
Command line
shib run biiti -e 'MOV "Hello World!\n"
JE'shib manual biitiSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/biiti.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org