Day 25 - Clock Signal

Copies in code from Day 23 with new out command. This is a little rougher than Day 23 due to infinite loop nature of the default program. Therefore, I recommend you enter i === 29 for the Break On conditional.

Op codes

cpy x y

cpy x ycopies x (either an integer or the value of a register) into register y.

inc x

inc x increases the value of register x by one.

dec x

dec x decreases the value of register x by one.

jnz x y

jnz x y jumps to an instruction y away (positive means forward; negative means backward), but only if x is not zero.

tgl x

tgl x toggles the instruction x away (pointing at instructions like jnz does: positive means forward; negative means backward):

out x

out x transmits x (either an integer or the value of a register) as the next value for the clock signal.

Interactive Application 💻