Google

Oct 18, 2008

Program to perfrom sum of elements in an array

Program to perform sum of elements in an array
Following is the assembly language program to find the sum of elements in a given array. This code is for 16-bit addition with 64 stack size.

Code:

MOV AX,@DATA ; Load AX with data
MOV DS,AX ; Load DX with AX
MOV ALPBCD ; Load AL with N1
MOV BL,AL ; load BL with AL
AND AL, OFH ; AND AL with OF H
MOV UBCD2,AL; Load N3 with AL
AND BL, OFOH
MOV CX,0004 ; Load CX with 0004
ROR BL,CL Rotate right BL,CL times
MOVE N2,BL
INT 3


Related links

all experts
bytes
wiki

No comments: