PATCH Solution
BACKWARDS GATE
PATCH inverted branch

gate=jnz
Accepted keysOPEN
Editable slots1
Rulenonzero
Walkthrough
The accept gate is wired backwards: this build turns away the real key and waves bad keys through. Only the marked branch (the gate) is yours to change. Set it so a correct key clears the gate and the rest bounce, then TEST.
A guard that jumps to the reject label has to fire on the MISMATCH, not the match. Read what the gate branch does to a key that is already correct, and pick the branch that turns the others away.
Valid Patch Combos
- gate=jnz
Reject Battery
- OPEM
- OPEX
- OPE
- OPENN
- AAAA
Editable Slot Options
- gate: jz, jnz, jg, jl
Broken Listing
; BACKWARDS GATE: PATCH job. The accept gate is wired backwards: this build
; turns away the real key "OPEN" and waves bad keys through. Only the final gate
; branch (label "gate") is yours to edit. Every other line is frozen, including
; the verdict (mov r0,1 / bad / ret), so you cannot just force the result: you
; have to set the branch so a correct key clears the gate and the rest bounce.
;
; The check: length 4, then bytes must spell O P E N (0x4F 0x50 0x45 0x4E).
; r0 = 1 on accept; rule: nonzero. SHIPPED gate is "jz bad" (jumps on the MATCH,
; so it rejects the one key it should accept). The fix is "jnz bad".
len r2
cmp r2, 4
jnz bad ; length must be 4
mov r7, 0
ldb r0, [r7]
cmp r0, 0x4F ; 'O'
jnz bad
mov r7, 1
ldb r0, [r7]
cmp r0, 0x50 ; 'P'
jnz bad
mov r7, 2
ldb r0, [r7]
cmp r0, 0x45 ; 'E'
jnz bad
mov r7, 3
ldb r0, [r7]
cmp r0, 0x4E ; 'N'
gate: jz bad ; SHIPPED BROKEN: branches on the match -> fix to jnz
mov r0, 1
ret
bad: mov r0, 0
ret