Question: Write a program that generates and displays 20 random strings, each consisting of 10 capital letters {A,Z}. Use a byte array to hold the string

Write a program that generates and displays 20 random strings, each consisting of 10 capital letters {A,Z}. Use a byte array to hold the string of random characters and then call procedure WriteString to print it to the console. Each of the 20 random strings should appear on a separate line of the console.

You are required to create a procedure as outlined below and call it 20 times from your main procedure. The procedure should use on EDI to reference the string. i.e., it should not use the name of the byte array. Also, all I/O should be done in the main procedure, not the one shown below

; ------------------------------------------------------------------------------------------------------

Generates a single random string of uppercase letters

Receives: EDI = string offset

ECX = string length

Returns a random string of uppercase letters in the string

; ------------------------------------------------------------------------------------------------------

makeRandomString PROC

Remember to avoid magic numbers in your code use symbolic constants.

Turn in a copy of your source code and a screenshot showing the 20 random strings that you generated.

Hints:

Generate a random number between 0 and 25, and add it to A.

Dont forget about null (0) bytes at the end of a string.

Dont forget to save/restore any registers that you use in procedure makeRandomString.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!