Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a procedure that fills an array of doublewords with N random integers, making sure the values fall within the range j...k, inclusive. When calling

Create a procedure that fills an array of doublewords with N random integers, making sure the values fall within the range j...k, inclusive. When calling the procedure, pass a pointer to the array that will hold the data, pass N, and pass the values of j and K. Preserve all register values between calls to the procedure. Write a test program that calls the procedure twice, using different value for J and K. Verify your result using a debugger.

PLEASE POST A SCREENSHOT OF THE OUTPUT AND SOURCE CODE. THIS IS VISUAL STUDIO 15 MASM IRVINE

Hint :

To fill the array with random values be sure to point to the array like the following. mov esi,OFFSET intArray ; point to the array mov ecx,LENGTHOF intArray ; loop counter

L1: call Random32 ; EAX = random value call WriteInt call Crlf mov [esi],eax add esi,4

; to search for negative values you have to point to the array and do a loop counter again and then you have to compare value to zero and look for negative value. If the result is yes then you will add it to the count like the following:

L2: cmp dword ptr [esi],0 ; compare value to zero jge L3 ; negative value? inc count ; yes: add to count L3: add esi,4 loop L2

mov eax,count call WriteDec call Crlf

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

2. How much time should be allocated to the focus group?

Answered: 1 week ago

Question

1. Where will you recommend that she hold the focus group?

Answered: 1 week ago