entree INP BRZ out0 SUB one BRZ e1 SUB one BRZ e2 BRA entree see-out LDA sortie OUT LDA zero STO sortie BRA entree out0 LDA zero OUT BRA entree e1 LDA state BRZ out0 LDA zero STO state BRA see-out e2 LDA sortie ADD one STO sortie LDA state SUB three BRZ e2d LDA state ADD one STO state BRA out0 e2d LDA zero STO state LDA sortie ADD one BRA see-out state DAT 0 sortie DAT 0 zero DAT 0 one DAT 1 two DAT 2 three DAT 3