Skip to content

The mod

timofey edited this page Aug 11, 2022 · 12 revisions

some videos

making elevator

mini calculator

rewriting compiller and machine to lua

rewriting some scripts to lua be very hard, but fast

code understanding

instruction has 10 bits of opcode and 3 number for other values

opcode - 5544321111

5 - inp toggle(if inp is on, then use arg1 or arg2 as input value)

4 - val toggle(if val is on, then use arg1 or arg2 as number value instead of register value)

3 - if statement toggle(if statement is on, then use 1 as modes[=, !=, <, <=, >, >=])

2 - other commands(if 2 is on, then 1 works as other commands[0 = wait for input, 1 = sleep reg1, 2 = push, 3 = popi])

1 change mode(if 3 is off, then use self as modes[add, sub, mul, div, exp, and, or, xor, not])

arg1 and arg2 - numbers, what used as args

and ended value going to result

new compiller features

you can connect input to your cpu and use it as register

like this:

COPY INP1 REG1 copy from first input to register1
COPY INP2 REG3 copy from second input to register3

also you can use PUSH and POPI commands

PUSH 1 INP1 push input to stack
PUSH 1 REG2 ush reg2 to stack
POPI 2 REG2 get reg2 from stack to reg2
POPI 1 REG1 get input from stack to reg1