Can someone PLEASE help me with this question, I have tried 50 variations and not one works, you can email me at robert12503@gmail.com since I may not be able to log back in to this. Question: WRITE A PROGRAM THAT DOES THE FOLLOWING:
A. CREATES AND PRINTS OUT 100 RANDOM NUMBERS FROM -10 TO 0
B. PUTS THEM IN AN ARRAY NAMED SOURCE
C. PRINTS OUT SOURCE

I CANT GET IT TO WORK HERE IS MY MOST RECENT code:

TITLE          (Doubleloopr.asm)
;
 

INCLUDE Irvine32.inc

.data



source DWORD 100 DUP (?)
count dword 100


.code
  main PROC

mov ecx, count

call randomize

FillArray:
mov eax, 11
call randomrange
sub eax, 10
call writeint
mov source, eax
add esi, 4
call crlf


loop fillarray

PrintArray:
mov esi, OFFSET Source
mov eax,
call writeint
add esi, 4
mov eax,
call writeint
mov eax, 50
call delay
Loop PrintArray

call dumpregs


 
exit
       
main ENDP
END main
Posted on 2011-11-25 20:33:25 by robert12503
Ask yourself this question:


...
PrintArray:
mov esi, OFFSET Source
...


What is the point of doing this inside the loop? In your earlier "fillarray"...


...
mov source, eax
add esi, 4
...


What would you expect this to do?

Good luck with variation 51. You're quite close!

Best,
Frank

Posted on 2011-11-26 06:23:18 by fbkotler