I need a bit of help to code how to divide a sum of numbers, divided by n numbers put in. For instance, the sum is 10, with 2 numbers, the answer should be 5. But if the sum is 14 and the total input (n numbers) are 3, it should write out 4, ignoring the 2 remainders, og for example, sum equals to 16 and total inputs equal to 3, the output should be 5, ignoring the 1 in remainder. But I don't know how to have these two in one code without interfering with each other. This is my current code
START INP
BRZ SLUTT
ADD sum
STA sum
LDA antall
ADD en
STA antall
BRP START
SLUTT LDA sum
OUT
LDA linjeskift
OTC
OTC
OTC
LDA n
OTC
LDA likhetstegn
OTC
LDA antall
OUT
LDA linjeskift
OTC
OTC
OTC
LDA d
OTC
LDA likhetstegn
OTC
start LDA sum
BRZ slutt
SUB antall
STA sum
LDA resultat
ADD en
STA resultat
BRP start
slutt LDA resultat
OUT
HLT
sum DAT
resultat DAT 0
antall DAT 0
en DAT 1
a DAT 97
d DAT 100
n DAT 110
linjeskift DAT 13
likhetstegn DAT 61