Question

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

Write this code using x86 assembly language using the irvine32 library

0 0
Add a comment Improve this question Transcribed image text
Answer #1

ANSWER:

INCLUDE Irvine32.inc Space 32 data strl BYTE Enter the number of count for array elements,o str2 BYTE The elements of arraсаїї Crlf ;save the count in SizeofArray mov SizeofArray,eax ;inserts first set of random integers in an array pass the addre;pass the address of array mov esi,OFFSET myArray ;pass the count of elements mov ecx,SizeofArray ;pass the value of j mov eb;initialize for generating unique integers call Randomize Labell ;save value of k in eax mov eax,edx ;Subtract value of j froret fillArray ENDP display PROCEDR USES esi ecx edx mov edx, OFFSET str2 ;write the string str2 call WriteString call Crlf ;sput a space саїї WriteChar point to the next element of array inc esi continue the process of traversal loop Labell ret displ

THANKS.
I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)

Add a comment
Know the answer?
Add Answer to:
Write this code using x86 assembly language using the irvine32 library
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • computer organization Write this code using x86 assembly language using the irvine32 library 10) In write a procedure that swaps to different values (Do NOT use the XCHG instruction). (7pts )...

    computer organization Write this code using x86 assembly language using the irvine32 library 10) In write a procedure that swaps to different values (Do NOT use the XCHG instruction). (7pts ) 10) In write a procedure that swaps to different values (Do NOT use the XCHG instruction). (7pts )

  • Assembly Language For x86 Processors 7th edition When you write programs to solve the programming exercises,...

    Assembly Language For x86 Processors 7th edition When you write programs to solve the programming exercises, use multiple procedures when possible. Follow the style and naming conventions used in this book. Use explanatory comments in your programs at the beginning of each procedure and next to nontrivial statements. Random Strings Create a procedure that generates a random string of length L, containing all capital letters. When calling the procedure, pass the value of L in EAX, and pass a pointer...

  • Use Assembly (Masm and Irvine32 library) to write a complete program that: 1. Asks the user...

    Use Assembly (Masm and Irvine32 library) to write a complete program that: 1. Asks the user to enter 2 numbers. Assume that the user enters unsigned 32-bit integers only. 2. Displays the product of the two numbers. Assume that the result will never be larger than 32 bits. 3. This process will continue till the user enters 0 for both inputs. You can’t use mul instruction in your program: You need to use shifting and addition only. Your program must...

  • this is assembly language for x-86 processors using microsoft visual studio Create a procedure named FindThrees...

    this is assembly language for x-86 processors using microsoft visual studio Create a procedure named FindThrees that returns 1 if an array has three consecutive values of 3 somewhere in the array. Otherwise, return 0. The procedure’s input parameter list contains a pointer to the array and the array’s size. Use the PROC directive with a parameter list when declaring the procedure. Preserve all registers (except EAX) that are modified by the procedure. Write a test program that calls FindThrees...

  • Validating a PIN

    1.      Validating a PINBanks use a Personal Identification Number to uniquely identify each customer. Let us assume that our bank has a specified range of acceptable values for each digit in its customer’s 5-digit PINs. The table shown below contains the acceptable ranges, where the digits are numbered from left to right in the PIN. Then we can see that the PIN 52413 is valid. But the PIN 43534 is invalid because the first digit is out of range. Similarly,...

  • Validating a PIN

    1.      Validating a PINBanks use a Personal Identification Number to uniquely identify each customer. Let us assume that our bank has a specified range of acceptable values for each digit in its customer’s 5-digit PINs. The table shown below contains the acceptable ranges, where the digits are numbered from left to right in the PIN. Then we can see that the PIN 52413 is valid. But the PIN 43534 is invalid because the first digit is out of range. Similarly,...

  • Assembly Language Program Help Write a procedure named CountNearMatches that receives pointers to two arrays of...

    Assembly Language Program Help Write a procedure named CountNearMatches that receives pointers to two arrays of signed doublewords, a parameter that indicates the length of the two arrays, and a parameter that indicates the maximum allowed difference (called diff) between any two matching elements. For each element x(i) in the first array, if the difference between it and the corresponding y(i) in the second array is less than or equal to diff, increment a count. At the end, return a...

  • Code written in NASM Function called findLargest Write a function called findLargest that receives two parameters:...

    Code written in NASM Function called findLargest Write a function called findLargest that receives two parameters: an unsigned doubleword array and the length of the array. The function must return the value of the largest array member in eax. Preserve all registers (except eax) that are modified by the function. Write a test program in main that calls findLargest three times, each call using a different array with different lengths. Function called countHits Write a function called named countHits that...

  • Need to write a MIPS assembly program that finds the minimum and maximum and sum of...

    Need to write a MIPS assembly program that finds the minimum and maximum and sum of a stored array. It also finds the locations of the minimum and maximum. The interaction between the main program and the function is solely through the stack. The function stores $ra immediately after being called and restores $ra before returning to main. The main program reserves a static C like array (index starts from 0) of 10 elements and initializes it. The maximum should...

  • Write common assembly language (RISC) programs to a) sum the first n elements of an array...

    Write common assembly language (RISC) programs to a) sum the first n elements of an array A, and b) compute r = ab for unsigned integers a and b. Each program will consist of a driver and a subprogram. The drivers will 1) read one or more values from the keyboard, 2) call the subprogram, and 3) print a result. The subprograms must not: ● store into memory, ● use registers $1 – $9, or ● make system calls

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT