Question: my code is getting exception please fix it out.the result should be as in the image include Irvine 3 2 . inc . data promptHigh
my code is getting exception please fix it out.the result should be as in the image
include Irvineinc
data
promptHigh BYTE "Enter the high value of the range:
promptLow BYTE "Enter the low value of the range:
resultMessage BYTE "The generated random number is:
highValInt DWORD
lowValInt DWORD
code
main PROC
; Ask for the high value of the range
mov edx, OFFSET promptHigh
call WriteString
call ReadInt
mov highValInt, eax
; Ask for the low value of the range
mov edx, OFFSET promptLow
call WriteString
call ReadInt
mov lowValInt, eax
; Get the system time as the seed
call GetSystemTime
movzx eax, dx ; Move the lower bits of the system time into EAX
call Randomize ; Use the system time as the seed
; Generate a random number within the usersupplied range
mov ebx, highValInt
mov ecx, lowValInt
call RandomRange
add eax, ecx ; Add the low value to the generated random number
; Display the result
mov edx, OFFSET resultMessage
call WriteString
mov eax, ecx ; Move the random number to EAX before displaying
call WriteInt
exit
main ENDP
end main
Positives are:
Negatives are:
C: Users onsolsourcrepo Project Debug Projectexe process exited
with code
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
