Question: Using MASM ( x 8 6 Assembly Language ) : For the following procedure: calcAverageLowHighTemps, the user is getting an error when attempting to return
Using MASM x Assembly Language:
For the following procedure: calcAverageLowHighTemps, the user is getting an error when attempting to return to main at the next call step. User attempted to calibrate EBP indexes to make sure the correct amount of bytes are returned; however, the error persists. Please advise where the code appears to be misaligned.
;calcAverageLowHighTemps parameters
PUSH OFFSET dailyLows
PUSH OFFSET dailyHighs
PUSH averageLow
PUSH averageHigh
CALL calcAverageLowHighTemps
;procedure to calculate the average temperatures
calcAverageLowHighTemps PROC
PUSH EBP
MOV EBP, ESP
MOV ESI, EBP
MOV EDI, EBP
MOV ECX, DAYSMEASURED
MOV EAX,
calculateAvgLow:
MOV EBX, DAYSMEASURED
ADD EAX, ESI
ADD ESI,
LOOP calculateAvgLow
MOV EDX,
DIV EBX
MOV EDI EAX
POP ECX
POP EDI
POP ESI
POP EBP
stagingParamsAvgHigh:
MOV EBP, ESP
MOV ESI, EBP
MOV EDI, EBP
MOV ECX, DAYSMEASURED
calculateAvgHigh:
MOV EBX, DAYSMEASURED
ADD EAX, ESI
ADD ESI,
LOOP calculateAvgHigh
MOV EDX,
DIV EBX
MOV EDI EAX
POP ECX
POP EDI
POP ESI
RET
calcAverageLowHighTemps ENDP
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
