6969 Assembler
An assembler for text, with two variables, a row of memory slots and the console as the places to put it.
CMinusMinus, 2020 · Turing complete: unknown · ●○○ easy · esolangs.org
Tested with 6 known programs · Test method
Run it
The idea
CMinusMinus made 6969 Assembler in 2020, also called 6969 ASS-embler. The goal was a language hard enough that no usable program can be written in it in reasonable time. Every instruction is three capitals and its operands. Data lives in %s for text and %i for numbers, in memory slots made by MEM, or in the program itself as raw text without spaces.
Read the story
MOV does nearly everything. It copies a value into a memory slot or to C*, the console. Jumps go to a line number or to a pointer set with PNT, and CMP sets %i for a conditional jump.
The machine
| Instruction | Does |
|---|---|
MEM n | Make n empty memory slots |
DFS text DFI n | Set %s or %i |
MOV dest::src | Copy src to C* or to a slot M*[n] |
ADD a::b | Set %s to a and b joined |
CMP a=b | Set %i to 1 if true, else 0; also > and < |
PNT name | Mark this line |
JMP n JMP name | Jump to a line or a pointer; with ? only if %i is 1 |
CST x CIN x | Turn x into text in %s, or into a number in %i |
A source is %s, %i, %? for a line of input, M*[n], or raw text, where ^n is a line feed. Lines that start with ; are comments. This implementation leaves out floats and files, so DFF, MAD, MSB, MML, MDV, CFL, FLW and FLR stop with an error.
Example
Two Hello World programs.
Two Hello World programs. Raw text keeps its underscore, and DFS is one of the few places that allows spaces.
A comparison with the input. JMP ?match jumps only when %i is 1, and JMP 8 leaves the seven line program.
Further
Ideas it shows
See also
Also in Jokes
Write your own in Run Convert a program from 6969 Assembler
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: 6969-assembler.
Command line
shib run 6969-assembler -e '; Output text "xyz"
MOV C*::xyz'shib manual 6969-assemblerSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/6969-assembler.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org