Awesome subleq machine simulator made for a challenge in DogeScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md

README.md

subleq-simulator-dogescript

Awesome subleq machine simulator made for a challenge in DogeScript:

shh THIS IS A SUBLEQ TURING-COMPLETE MACHINE

very mem is new Array with 0x2000
very instruction
very Aaddr
very Baddr
very Jaddr
very sub

shh INITIALIZE A SUBLEQ PROGRAM HERE (THIS EXAMPLE HAS TWO INSTRUCTIONS ONLY TO TERMINATE EXECUTION)
mem[0] is 1;
mem[1] is 0x01FFF;

much very ip = 0; ip < 0x2000; ip = sub <= 0 ? Jaddr + ip : ip + 1
    instruction is mem[ip];
    Aaddr is (instruction & 0x07FFC000000) >> 26;
    Baddr is (instruction & 0x03FFE000) >> 13;
    Jaddr is instruction & 0x01FFF;
    sub is mem[Baddr + ip] - mem[Aaddr + ip];
    mem[Baddr + ip] = sub;
wow

plz alert with 'terminated'