ASSEMBLY FOR LOOP help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

ASSEMBLY FOR LOOP help

.386 .MODEL FLAT .STACK 4096 .DATA ARRAY DB 5 DUP(1,2,3,4,5) .CODE MAIN PROC LEA SI,ARRAY MOV CX,5 START: ADD AX,[ESI] INC SI LOOP START INT 20h So the purpose Is to sum all the numbers of the Array together , but the loop its not working why? And of there Is any other errore , please Tell me Thanks...

16th Feb 2021, 10:06 PM
Hammad Yaqub
Hammad Yaqub - avatar
1 Answer
+ 1
Assuming the code start at the START label, its probably cause you didn't instantiate any value to the CX register, so it start at Zero.
18th Feb 2021, 12:12 PM
aviad59
aviad59 - avatar