Click to See Complete Forum and Search --> : Little Man Computer program


jav0506
November 30th, 2005, 05:47 PM
Hi, i'm doing a LMC program that outputs the sum of odd values from 1 to 35. For example : 1, 1+3, 1+3+5 ,1+3+5+7, ......etc

I'm having trouble writing the program and this is what i have but there is something wrong can anyone please help? Thanks.

LDA N
ADD SUM
OUT
STA SUM
LDA N
SUB MAX
BRZ ENDLOOP
LDA N
ADD STEP
BRA
ENDLOOP HLT
N DAT OO1
SUM DAT 000
STEP DAT 002
MAX DAT 035

jav0506
November 30th, 2005, 05:51 PM
typo: N DAT 001 not OO1