.post large { float:left; color: $headerBgColor; font-size:100px; line-height:80px; padding-top:1px; padding-right:5px; }

News and Materials Headline Animator

Sunday, June 6, 2010

program to find the sum of cubes of n numbers

initially we load the si and di registers and we initalize ax and cx registers to zero. we move ax to content of di and move contents of si to cl. the we continue to increment si and move si to al and multiply the current result with al. Then we move contents of si to that of bl and we multiply bl and add the result in ax to that of di and we repeat this till the loop ends

the code can be analyzed as follows

mov si,2000
mov di,4000
mov ax,0
mov cx,0
mov [di],ax
mov cl,[si]
inc si
mov al,[si]
mul al
mov bl,[si]
mul bl
add [di], ax
loop continue
int a5

No comments:

Post a Comment

Popular Posts

News and Materials

Subscribe Now: Feed Icon

Infolinks In Text Ads

Related Posts with Thumbnails

Latest News

Time