Question
Write the code to add rhe two randomly generated numbers aboce and output the following message, where #N1, #N2, and #sum are the first and
Write the code to add rhe two randomly generated numbers aboce and output the following message, where #N1, #N2, and #sum are the first and second random numbers and its respective sum. Confirm the random bumbers and the sum is correct.
;--------------------------------------------
include c:\asmio\asm32.inc
includelib c:\asmio\asm32.lib
includelib c:\asmio\user32.lib
includelib c:\asmio\kernel32.lib
.const
NULL equ 0
min equ 1
max equ 100
.data?
rnumb dword ?
.data
msg1 byte "A random number from ", NULL
msg2 byte " to ", NULL
msg3 byte " is: ", NULL
.code
main proc
call Randomize
call Random32
call writeDec
call crlf
move eax, max
call RandomRange
add eax, min
call WriteDec
call crlf
mov edx, OFFSET msg1
call WriteString
mov eax, min
call WriteDec
mov edx, OFFSET msg2
call WriteString
mov eax, max
call WriteDec
mov edx, OFFSET msg3
call WriteString
ret 0
main endp
end main
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started