little man computer mnemonics code example
Example: multiply two numbers assembly lmc
INP
STA R0
INP
STA R1
LOOP LDA R1
BRZ END
SUB ONE
STA R1
LDA RES
ADD R0
STA RES
BRA LOOP
END LDA RES
OUT
// Temporary storage
R1 DAT
R0 DAT
RES DAT
// Constants
ONE DAT 1