Summation of square value up to n in assembly language


;Alamgir, CSE, JUST
;1^2+2^2+3^2+4^2+---------

MOV Cx, 10 ; 10 is your n value
MOV bx, 00

myloop:   
MOV Ax, Cx
MUL Ax
ADD Ax, bx
MOV bx, Ax
LOOP myloop

No comments:

Post a Comment