8 step stack 3bits with trailing zero
8 io latch
one serial port
32 instruction memory 5bits
15khz

one serial port with four instructions
start    start/restart process            010000
stop     stop running process             010001
reset    clear code memory                011111
insert   put one instruction and forward  1xxxxx

list instruction 5bits (all used value on stack is droped and result is pushed)

0x00-0x07 00000->00111  push 0-7    push an octal number into stack
0x08      01000         pop         remove topmost value from stack
0x09      01001         dupe        duplicate topmost value on stack
0x0A      01010         xchg        swap two topmost value on stack

0x20      10000         and         logical and on two topmost stack value
0x21      10001         or          logical or on two topmost stack value
0x22      10010         not         logical not on topmost stack value
0x23      10011         xor         logical xor on two topmost stack value

0x24      10100         shl         bitwise left shift topmost value time on the second topmost value
0x25      10101         shr         bitwise right shift topmost value time on the second topmost value
0x26      10110         add         mathematical addition on two topmost stack value
0x27      10111         sub         mathematical substaction on two topmost stack value

0x30      11000         set         set io numbered by topmost stack value true
0x31      11001         reset       set io numbered by topmost stack value false
0x32      11010         read        read io numbered by topmost stack value, 0 if false, 7 if true
0x33      11011         wait        idle until io numbered by topmost stack value is set to true

0x0F      01111         retz        return if top is zero
0x0E      01110         clear       empty stack
0x0D      01101         retnz       return if top not zero

#####################################################
test traffic light
 _   _
/a\ /d\    15 sec timer pulse at port 7
|b| |e|    a b c d e f are mapped on port 0->5
\c/ \f/

e-c-a+f+ wait
a-b+ wait
b-f-d+c+ wait
d-e+ wait

4 reset
2 reset
0 set
5 set
7 wait
0 reset
1 set
7 wait
1 reset
5 reset
3 set
2 set
7 wait
2 reset
4 set
7 wait
0 retz

17 instruction
#####################################################
a+b+b-c-  single stroke autoreturn cylinder

a => 0
b => 1
a0 => 2
b0 => 3
a1 => 4
b1 => 5

0 set
4 wait
1 set
5 wait
1 reset
3 wait
0 reset
2 wait
0 retz

9 instruction
######################################################
10 pin, one for each button

first five  pin 0-4 of first spu
second five pin 0-4 of second spu

pin 5 of both mean door closed pulse

pin 6 of first and second spu are joined authorise

pin 7 of both controler are unlocker, two unlock signal required

for a code like 25731367

first spu:
2 wait
6 set
6 reset
6 wait
3 wait
1 wait
3 wait
6 set
7 set
5 wait
7 reset
retz

second spu:
6 wait
3 wait
6 set
6 reset
6 wait
2 wait
3 wait
7 set
5 wait
7 reset
retz

###################################################