This Program Prints the sum of a series, of a number which is input by the user.
TITLE PUCHTAA
.MODEL SMALL
.STACK 100H
.DATA
INTRO DB 0AH, 0DH, 07H, 09H, "THIS PROGRAM PRINTS THE SUM OF SERIES$"
MSG DB 0AH, 0DH, "ENTER A NUMBER: $"
NEWLINE DB 0AH, 0DH, "$"
DOAGAIN DB 0AH, 0DH, "DO AGAIN? Y FOR YES ELSE FOR NO: $"
.CODE
MAIN:
MOVAX, @DATA
MOVDS, AXLEADX, INTRO
MOVAH, 09H
INT 21H
NUMBER:
LEADX, MSG
MOVAH, 09H
INT 21H
MOVAH, 01H
INT 21H
SUBAL, 30H
CMPAL, 09H
JG NUMBER
MOVBL, ALMOVBH, ALPUSHBXCMPAL, 00H
JE RESULT
AGAIN:
DECBLADDBH, BLCMPBL, 00H
JG AGAIN
MOVAH, 00H
MOVAL, BHMOVBL, 0AH
DIVBLMOVBX, AXPOPCX
RESULT:
LEADX, NEWLINE
MOVAH, 09H
INT 21H
MOVCH, 00H
DISPLAY:
MOVDL,CHADDDL, 30H
MOVAH, 02H
INT 21H
MOVDL, '+'MOVAH, 02H
INT 21H
INCCHCMPCH, CLJLE DISPLAY
MOVDL, 08H
MOVAH, 02H
INT 21H
MOVDL, '='MOVAH, 02H
INT 21H
MOVDL,BLADDDL, 30H
MOVAH, 02H
INT 21H
MOVDL, BHADDDL, 30H
MOVAH, 02H
INT 21H
LEADX, DOAGAIN
MOVAH, 09H
INT 21H
MOVAH, 01H
INT 21H
ORAL, 20H
CMPAL, 'y'JE NUMBER
MOVAH, 4CH
INT 21H
END MAIN