Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assembly Program help using Assembly Language for x86 processors - Kip Irvine Fi

ID: 3835249 • Letter: A

Question

Assembly Program help

using Assembly Language for x86 processors - Kip Irvine

Filename: RString.asm

Write a program that uses both procedures

so that the input from the user determines how many times to generate a random string.

Do not generate 1 string and display it over and over. Each string generated should be unique.

Create a procedure (UserInt) that asks for an unsigned integer input (N) from a user.

The procedure must pass this integer back to the calling procedure as an argument (this means in a register).

Create a procedure (RandStr) that generates a string of length L, where L is between 5 and 25, containing random CAPITAL letters. When calling the RandStr procedure, pass the value of N (from UserInt) in ECX, and pass the offset of an array of bytes in EAX. This array will hold the randomly generated string. You may declare an array of the maximum size since you don’t know what the random string length will be. Use an appropriate Irvine library procedure to print each randomly generated string. Use the appropriate Irvine library procedure to require a key press before exiting the program. 1. The output will be shown in the console window with one string per line. 2. You may use any command Chapter 5 and below. 3. Your procedures must be called from main proc. 4. Data local to a procedure must be declared in that procedure, i.e. prompts. If you use local data, you must have a .data and a .code in your procedure. 5. Part of the program will be graded on the basis of program style.

Explanation / Answer

; AddTwo.asm - adds two 32-bit integers.
; Chapter 3 example

.386
.model flat,stdcall
.stack 4096
ExitProcess proto,dwExitCode:dword

.code
main proc
   mov   eax,5              
   add   eax,6              

   invoke ExitProcess,0
main endp
end main
1>------ Build started: Project: Project, Configuration: Debug Win32 ------
1> Assembling ..Project32_VS2015AddTwo.asm...
1> Project.vcxproj -> ...Project32_VS2015DebugProject.exe
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========