Subleq extra

From Esolang
Jump to navigation Jump to search

subleq_extra is an esolang based on subleq. it has, next to subleq, 5 extra instructions to make it more useable (hence the name extra). the instructions are the following:

instructions

  • SUBLEQ a, b, c - Subtract mem[a] from mem[b]; if result ≤ 0, jump to address c.
  • NAND a, b - Perform a bitwise NAND between mem[A] and mem[B]; result in A.
  • LDSTA addr - swaps mem[addr] with A (load-store combo to reduce instruction size further).
  • WRNG - Writes a random byte (0–255) into A.
  • MUL a, b, c - mem[c] = mem[a] * mem[b]
  • CMPJ a, b, c, d - If mem[c] == mem[d], jump to b; else jump to a.
  • Any other opcode is treated exactly the same as a classic NOP.

it also has memory mapped I/O and HALT you define at the top of the file, the only register is A, for the rest you'll need to use ram values

important: A is for the register, a is just a example value (can be anything, A, a memory adress, a set value, etc)