Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program is supposed to be in assembly language. Please use basic MASM only. Create a procedure that fills an array of doublewords with N

This program is supposed to be in assembly language. Please use basic MASM only.

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 values for j and k. Verify your results using a debugger.

Change the following code to fulfil the requirements.

INCLUDE Irvine32.inc ARRAYSIZE = 50 .data buffer SDWORD ARRAYSIZE DUP(0) .code main PROC call Randomize ;part 1 - fill array with random numbers mov ecx, ARRAYSIZE mov esi, OFFSET buffer L1: call Random32 mov [esi], eax add esi, TYPE buffer loop L1 ;part 2 - loop through the array, display each value, count negative numbers mov esi, OFFSET buffer mov ecx, ARRAYSIZE L2: mov eax, [esi] cmp eax, 0 jge @F inc counter @@: call WriteInt call Crlf add esi, TYPE buffer loop L2 exit main ENDP END main

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

Practical Database Programming With Visual Basic.NET

Authors: Ying Bai

1st Edition

0521712351, 978-0521712354

More Books

Students also viewed these Databases questions