It would have 8 basic instructions:
- Push a constant
- Drop the top value
- Store a value on the heap
- Read the heap
- Call a subroutine
- Return from a subroutine
- Jump backwards and forwards based on the top stack value
- Perform an operation on the top two stack items, push the result
Quadrant I would hold the program data. Each subroutine would be a row of commands.
Quadrant II would hold the stack. They would be expressed as binary bits, extending upward, with the LSB on the right.
Quadrant III would hold the heap. It would be laid out with one value per row.
Quadrant IV would hold the "Return stack" so when it executes a return instruction it knows how and where to jump back to.
I thought I would implement it in WWEJ3 (hence this being in the OCA board). Here is my first attempt at a read/write arm.
Code: Select all
x = 40, y = 148, rule = WWEJ3
4.36C$4.C34.C$4.C32.C.C$37.C.C$36C.C.C$C34.C.C.C$C32.C.C.C.C$30.D2.C.
C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.F.C.F$33.C.B.C.B$33.G.C.G
.C$33.B.F.B.F$33.C.B.C.B$33.C.C.C.C$33.E.E.E.E$33.B.B.B.B$33.C.C.C.C$
33.C.K.C.K$33.C.B.C.B$33.C.C.C.C$33.C.E.C.E$33.C.B.C.B$33.C.C.C.C$33.
C.E.C.E$33.C.B.C.B$33.C.C.C.C$33.C.K.C.K$33.C.B.C.B$33.C.C.C.C$33.C.C
.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.
C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$
33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.
C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C
.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.
C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$
33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.
C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C
.C.C$33.C.C.C.C$33.C.C.C.C$33.C.F.C.F$33.C.B.C.B$33.C.C.C.C$33.C.F.C.
F$33.C.B.C.B$33.C.C.C.C$33.C.E.C.E$33.C.B.C.B$33.C.C.C.C$33.C.K.C.K$
33.C.B.C.B$33.C.C.C.C$33.C.A.C.A$33.C.B.C.B$33.C.C.C.C$33.C.C.C.C$33.
C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C
.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.
C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$
33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.C.C.C.C$33.
C.F.C.F$33.C.B.C.B$33.G.C.G.C$33.B.F.B.F$33.C.B.C.B$33.C.C.C.C$33.F.F
.F.F$33.B.B.B.B$33.C.C.C.C$33.C.K.C.K$33.C.B.C.B$33.C.C.C.C$33.C.E.C.
E$33.C.B.C.B$33.C.C.C.C$33.C.E.C.E$33.C.B.C.B$33.C.C.C.C$33.C.K.C.K$
33.C.B.C.B$33.C.C.C.C$33.C.C.C.C!
It uses four wires so that it doesn't have to count how far to the left it has moved, and can just wipe the arm out and reset to 0 quickly. The 2nd arm is so it will always produce a return signal and can tell a wire (state 3) or an isolator (state 4) from empty space (state 0).
When I have more ideas I will put them here and anyone else is welcome to contribute as well.