Friday, July 14, 2017

8086 Programming

How to add numbers stored in consecutive memory?

TITLE ADD THE DATA OF TABLE
.MODEL SMALL
.STACK 32
.DATA

TABLE DW 1234H,4563H,7944H,1234H
SUM DW ?
.CODE
MAIN PROC FAR
MOV AX,@DATA
MOV DS,AX

MOV CX,04H
MOV SI,OFFSET TABLE
MOV AX,0000H
L1:ADD AX,[SI]
INC SI
INC SI
DEC CX
JNZ L1


MOV AX,4C00H
INT 21H
MAIN ENDP
END MAIN

0 comments:

Post a Comment