Skip to content

Instantly share code, notes, and snippets.

@gigaherz
Created November 5, 2015 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gigaherz/a242455f913f4044cf78 to your computer and use it in GitHub Desktop.
Save gigaherz/a242455f913f4044cf78 to your computer and use it in GitHub Desktop.
The Minecraft Redstone-inspired Pseudo-language
Registers and ports
--------------------
R0.. R15 Redstone lines, each a 16 bit SIGNED register, but the value is shifted every instruction
If the top bit is 0, it shifts down,
If thetop bit is 1, it shifts up
C0..15 Cauldrons, respectively pre-filled with "(1<<n)-1"
Instructions
-------------
INV Rd, Rs Negates the bits from source into destination
SUB Rd, Rs Writes the difference between the destination and the source (Rd=Rd-Rs)
REP Rd[, Rs], d Writes the value from source into destination, (1<<d) instructions later (d = 1..4)
CMP Rd, Cs Reads the input from the "cauldron" bus and writes it into the destination
... need something for flow control. "pistons" to change the active instruction? maybe?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment