INP STA quant loop LDA number ADD counter OUT STA number LDA counter ADD one STA counter LDA quant SUB counter BRP loop HLT quant DAT counter DAT 1 number DAT 0 one DAT 1