the-honk/school/a-level/Y13 2021-2023/LMC/LMC Higher or Lower.txt

30 lines
No EOL
278 B
Text

INP
STA toGuess
loop INP
STA guess
LDA toGuess
SUB guess
BRZ equal
BRP small
BRA big
small LDA higher
OUT
BRA loop
big LDA lower
OUT
BRA loop
equal LDA win
OUT
HLT
toGuess DAT
guess DAT
higher DAT 1
lower DAT 0
win DAT 9