Can you help me to write a lmc program to multiply 2 negatives
(-x)*(-y) = xy?
For example, if you input -5 and -6, it should give you 30.
I have done for x*y=xy
INP
STA FIRST
INP
STA SECOND
LOOP LDA COUNT
ADD ONE
STA COUNT
LDA TOTAL
ADD FIRST
STA TOTAL
LDA SECOND
SUB COUNT
BRZ ENDLOOP
BRA LOOP
ENDLOOP LDA TOTAL
OUT
HLT
ONE DAT 001
COUNT DAT
TOTAL DAT
FIRST DAT
SECOND DAT