;sum of integers from M to N, inclusive ;looping M-N+1 from M thru N ; for i=M to N ; sum += i ;N in B ;i in C, starts with M ;sum in D, starts with M JMP Start DW 4 ;M DW 7 ;N DW 0 ;sum Start: MOV CX,[1003] ;get M MOV DX,CX ;DX is sum=M MOV BX,[1005] ;get N Loop: INC CX ;i++ ADD DX,CX ;sum+=i CMP BX,CX ;N-i JNZ Loop ;if i