Google Search

Thursday, October 13, 2011

SUM OF CUBES OF FIRST ‘N’ NUMBERS To write an assembly language program to find sum of cubes of given ‘n’ numbers.


SUM OF CUBES OF FIRST ‘N’ NUMBERS

Aim: -   To write an assembly language program to find sum of cubes of given ‘n’ numbers.

            MOV CL, NUM
            MOV SUM, 00
L1:       MOV AL, CL
            MUL AL
            MUL CL
            ADD AL, SUM
            MOV SUM, AL
            LOOP L1
             END

Result: Sum of cubes of first ‘n’ natural numbers is obtained

0 comments:

Post a Comment