We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

3 pentits, 25 pentytes

From Esolang
Jump to navigation Jump to search

3 pentits, 25 pentytes is an assembly language invented by Mutasimos (talk) 16:39, 9 July 2026 (UTC) that originally started out as 3 pentits, 5 pentytes. It is inspired by 2 trits, 3 trytes which is inspired by 2 Bits, 1 Byte. A pentit is a base-5 digit and a pentyte is 3 of these pentits.

Opcodes

Only the lower 2 pentits of the entire pentyte are used for opcodes and addresses.

Command (Quinary) Command (Disassembled) What it does
x00 DON Do nothing (a NOP)
x01 PRT <addr> Given an address, Print the pentyte as a character at that address according to the encoding given below.
x02 INC <addr> Given an address, Increment the pentyte at that address. (can wrap)
x03 DEC <addr> Given an address, Decrement the pentyte at that address. (can wrap)
x04 FLP <addr> Given an address, Flip the pentyte at that address by setting each pentit of the pentyte to 4-pentit.
x10 JMP <addr> Unconditionally jump to the given address.
x11 JIZ <then> <addr> If the pentyte at addr is 0, jump to then.
x12 JNZ <then> <addr> If the pentyte at addr is 0, jump to then.
x13 ADD <addr> <val> Add val to the pentyte at addr. (can wrap)
x14 SUB <addr> <val> Subtract val from the pentyte at addr. (can wrap)
x20 MUL <addr> <val> Multiply val with the pentyte at addr. (can wrap)
x21 DIV <addr> <val> Divide val with the pentyte at addr.
x22 JLT <then> <addr> <val> If the pentyte at addr is lesser than val, jump to then.
x23 JGT <then> <addr> <val> If the pentyte at addr is greater than val, jump to then.
x24 JEQ <then> <addr> <val> If the pentyte at addr is equal to val, jump to then.
x44 END Stops the program.

The instruction pointer can wrap around, thus allowing more "complicated" programs. Since the memory is 25 pentytes, you can represent the entire program with just 25 characters. These characters are converted using the encoding to their corresponding pentytes. For example:

aaaaaaaaaaaaaaaaaaaaaaaaa

becomes:

100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100

which, when disassembled, becomes DON 25 times.

Encoding

It is based on ASCII.

\0   -> 000    \x01 -> 001    \x02 -> 002    \x03 -> 003    \x04 -> 004
\x05 -> 010    \x06 -> 011    \x07 -> 012    \x09 -> 013    \x0B -> 014
\x0C -> 020    \x0E -> 021    \x0F -> 022    \x10 -> 023    \x11 -> 024
\x08 -> 030    \x12 -> 031    \x13 -> 032    \x14 -> 033    \x15 -> 034
\n   -> 040    \r   -> 041    \x16 -> 042    \x17 -> 043    \x18 -> 044
a    -> 100    b    -> 101    c    -> 102    d    -> 103    e    -> 104
f    -> 110    g    -> 111    h    -> 112    i    -> 113    j    -> 114
k    -> 120    l    -> 121    m    -> 122    n    -> 123    o    -> 124
p    -> 130    q    -> 131    r    -> 132    s    -> 133    t    -> 134
u    -> 140    v    -> 141    w    -> 142    x    -> 143    y    -> 144
z    -> 200         -> 201    ~    -> 202    @    -> 203    ?    -> 204
!    -> 210    "    -> 211    #    -> 212    $    -> 213    _    -> 214
%    -> 220    &    -> 221    \'   -> 222    (    -> 223    )    -> 224
*    -> 230    +    -> 231    ,    -> 232    -    -> 233    .    -> 234
:    -> 240    ;    -> 241    <    -> 242    =    -> 243    >    -> 244
A    -> 300    B    -> 301    C    -> 302    D    -> 303    E    -> 304
F    -> 310    G    -> 311    H    -> 312    I    -> 313    J    -> 314
K    -> 320    L    -> 321    M    -> 322    N    -> 323    O    -> 324
P    -> 330    Q    -> 331    R    -> 332    S    -> 333    T    -> 334
U    -> 340    V    -> 341    W    -> 342    X    -> 343    Y    -> 344
Z    -> 400    \x19 -> 401    \x1A -> 402    \x1B -> 403    \x1C -> 404
[    -> 410    \\   -> 411    /    -> 412    ]    -> 413    ^    -> 414
0    -> 420    1    -> 421    2    -> 422    3    -> 423    4    -> 424
5    -> 430    6    -> 431    7    -> 432    8    -> 433    9    -> 434
`    -> 440    {    -> 441    |    -> 442    }    -> 443    \x7F -> 444

Note that since 5³ is 125, 3 characters (\x1D, \x1E and \x1F) are not included. For example, to write "ADD 0p44, 0p100" you have to write "iya" where 'i' is 0p113 which gets truncated to 0p13 for the opcode, 'y' is 0p144 which gets truncated to 0p44 for the address and a is 0p100 and it stays 0p100.

Programs

Hi World

brbsbtbubvbwbxbyyHi World

Infinite loop

fa........................

Quine

bacbmjbzyopbbfabyfc.....a

truth-machine

oiy0byfebyy.............0

You may replace the last 0 with a 1 for the other outcome.

Interpreter

The interpreter is here: [1]

See also