Question: - - - - - - - - - - - - - - - - - - - - - - - - -

------------------------------------------------------------------------------------------------------------------
;Name: generateTemperatures
;{parameters: tempArray (reference,output)}
;MIN_TEMP, MAX_TEMP, DAYS_MEASURED, TEMPS_PER_DAY will be used as globals within this procedure.
;Randomly generate temperatures within the range and stores them in tempArray
;preconditions:
;postconditions:
;receives:
;returns: tempArray
;------------------------------------------------------------------------------------------------------------------
generateTemperatures PROC
PUSHAD
PUSH EBP
MOV EBP, ESP
; [EBP+12]=address of ARRAYSIZE
; [EBP+8]=address of OFFSET tempArray
; [EBP+4]=return address
; [EBP]=old ebp
MOV EDI, [EBP+8]
MOV EBX, [EBP+12]
MOV ECX, 1
_generateLoop:
MOV EAX, ECX
MUL EAX
CALL RandomRange
MOV [EDI],EAX
ADD EDI, 4
INC ECX
CMP ECX, EBX
JBE _generateLoop
POP EBP
POPAD
RET 8
generateTemperatures ENDP
this procedure not working and I keep getting the attached error. how can I fix it to function correctly ?
(i)Microsoft Visual Studio Debug Console
Welcome to Chaotic Temperature Statistics -Programmed by Nicole
This program generates a series of temperature readings, X per day for Y days, depending on constants, and performs some basic statistics on them: daily high and low and average high and low temps. It then prints these results, with descriptive titles.
C: \CS271\Project 5\Debug\Project.exe (process 10268)exited with code -1073741819(0xc0000005).Press any key to close this window ...

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!