Logo 
Search:

C Programming Forum

Ask Question   UnAnswered
Home » Forum » C Programming       RSS Feeds

I need help in assembly x86,Irvine

  Asked By: Ngoche    Date: Nov 11    Category: C Programming    Views: 651
  

I am counting and adding digits from -17 to 5 i don't know if i did it right or not pls can some one help me pls. Here is my code it is giving me 17 as total.
.data
space byte " ",0
a dword -17
b dword 5
source dword 120 dup(0)
sumof byte "The sum of the source array is ",0
theSum DWORD ?
delta dword ?
.code
main PROC
mov eax,0
mov eax,b
sub eax,a
inc eax
mov delta,eax

mov edx,offset space
mov ecx,120

mov esi,0
l1:

mov eax,delta
call randomrange
inc eax
mov source[esi],eax
inc esi


loop l1
add eax,source[esi]
inc source[esi]
mov source[esi],eax
mov edx,offset sumof
call writestring
call writedec
call crlf
exit

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on I need help in assembly x86,Irvine Or get search suggestion and latest updates.




Tagged: