どのボタンが押されたかを確認し、関数と比較する必要があります。たとえば、ボタン 0($01) が押された場合、プログラムはそれを OP の 3 と比較し、両方の条件が true の場合、プログラムは再び開始 (init) されます。そうでない場合、条件の 1 つが false の場合、プログラムはループします。サブルーチンを再度実行します。現時点では何もしません。ボタンの押下を比較する必要がありますが、そうではないようです。これまでのところ、私はこれを行ってきました:
;$01 == XOR button, $02 == NOR button, $04 == OR button, $08 == NAND button, $10 == AND button
button_pressed:
in temp2, PIND
xor_pressed:
cpi OP,3
cpi temp2, $01
brne button_pressed
rjmp init
nor_pressed:
cpi OP,4
cpi temp2,$02
brne button_pressed
rjmp init
or_pressed:
cpi OP,0
;cpi temp2,$04
brne button_pressed
rjmp init
nand_pressed:
cpi OP,2
cpi temp2,$08
brne button_pressed
rjmp init
and_pressed:
cpi OP,1
cpi temp2,$10
brne button_pressed
rjmp init