ALP to SUM THE NUMBERS FROM 1-100

ALP to SUM THE NUMBERS FROM 1-100

title SUM THE NUMBERS FROM 1-100
dosseg
.model small
.stack 100H
.code
main proc
mov ax, 0
mov cx, 10h ; loop count=10
BACK: add ax, cx ; add two numbers
loop BACK ; repeat until cx=0
mov ax, 4c00h ; return to DOS
int 21h
main endp
end main

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top