I need help with making my program produce the correct output.
I am currently working with this code:
INP
STA NUMBER
SUB DIVISOR
BRP VERIFY
BRA CHECK
LOOP STA NUMBER
LDA RESULT
ADD ONE
STA RESULT
VERIFY LDA NUMBER
SUB DIVISOR
BRP LOOP
LDA RESULT
ODD LDA ONE
STA RESULT
EVEN LDA 60
STA RESULT
CHECK LDA RESULT
BRP ODD
BRZ EVEN
OUT
HLT
NUMBER DAT
DIVISOR DAT 2
ONE DAT 1
RESULT DAT 0
When I run the code above on little man computer simulator, it just loops and loops and prints no output. What I wanted to do is divide the inputted number into two and check if it has a remainder. If it has a remainder, then it is an odd number, else it is an even number. I know that the code has errors but I can't pinpoint where the problem lies, maybe you can help me with it. Thanks in advance!