Little Man Computer - 我正在努力寻找正确答案

Little Man Computer - I'm trying to find the right answer

编写一个 Little Man 程序来接受不定数量的输入值。输出 value 将是最大的输入值。您应该使用值 0 作为标志 输入结束

这是我目前所做的。

INP

STA 优先

BRZ 结束

文胸 WHILE ENDWH HLT

DAT

十个

begin   INP
        BRZ end
        STA input
        SUB max
        BRP nmax
        BRA begin
nmax    LDA input
        STA max
        BRA begin
end     LDA max
        OUT
        HLT
input   DAT
max     DAT