TITLE "Program to add 2-words numbers"
.MODEL small; this defines the memory model
.STACK 100 ; define a stack segment of 100 bytes
.Data ; this is the data segmentll
.Code ;this is the code segment
MOV AX,6000H ;ASCII segment
MOV DS,AX
mov cx,0fffH
mov SI,0000h
addwords:
mov AX,[SI]
mov BX,[SI+2]
add Ax,[SI + 4]
adc BX,[SI+6]
add SI,0008h
cmp SI,CX
jl addwords
mov DI,1020H
mov [DI],ax
mov [DI + 2],bx
mov ah,4cH ; Exit to DOS function
int 21h
end