ALP to add a series of numbers (16-BIT)
DATA SEGMENT
SERIES DW 1234H, 1378H, 2244H, 2332H, 3223H
COUNT DB 05H
RESULT DW 01H DUP(?)
DATA ENDS
CODE SEGMENT
START: MOV AX, DATA
MOV DS, AX
XOR AX, AX
XOR BX, BX
MOV CL, COUNT
LEA SI, SERIES
LOOP1: MOV BX, [SI]
ADD AX, BX
INC SI
INC SI
INC SI
DEC CL
JNZ LOOP1
LEA DI, RESULT
MOV [DI], AX
MOV AH, 4CH
INT 21H
CODE ENDS
END START
No comments:
Post a Comment