Computer Science Assignment 8: Random String Generation, Assembly

Verified

Added on  2022/08/25

|5
|325
|63
Homework Assignment
AI Summary
This assignment solution demonstrates the creation of random strings using assembly language, specifically focusing on the Irvine32 library within the Visual Studio 2019 environment. The solution includes two main parts: the first part outlines the procedure for generating a random string, and the second part provides a driver program that utilizes this procedure. The code leverages functions like `Randomize`, `RandomRange`, `Clrscr`, `WriteChar`, and `Crlf` to generate and display the strings. The program initializes an array to store the generated strings and uses loops to iterate and produce multiple random strings. The solution also includes a bibliography referencing relevant academic papers on assembly programming and random number generation. The program is designed to provide a practical understanding of string manipulation and random number generation within assembly language, providing a valuable resource for students studying computer science.
Document Page
Running head: COMPUTER SCIENCE ASSIGNMENTS
Computer Science Assignments
Name of the Student
Name of the University
Author’s Note
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
1
COMPUTER SCINECE ASSIGNMENTS
Part 1: Procedure for creating Random String
Title Assignment8, Version 1 (Assignment8.asm)
; This program prints random string of capital Letters
INCLUDE Irvine32.inc
strLen= 100
.data
arr DWORD strLen DUP(?)
.code
main PROC
call Randomize
call RandomRange
call Clrscr
mov esi, offset arr
mov ecx, 20
L1:
call GenerateRandomString
Loop L1
call WaitMsg
exit
main ENDP
GenerateRandomString PROC USES ecx
mov ecx, lengthOf arr
L2:
mov eax, 26
call RandomRange
add eax, 65
mov [esi], eax
call WriteChar ; write character
loop L2
call Crlf
ret
GenerateRandomString ENDP
END main
Document Page
2
COMPUTER SCINECE ASSIGNMENTS
Part 2: Driver Program using CreateRandomString
Title Assignment8, Version 1 (Assignment8.asm)
; This program prints random string of capital Letters
INCLUDE Irvine32.inc
strLen=80
.data
arr BYTE strLen DUP(?)
.code
main PROC
call Clrscr
call Randomize
mov esi, offset arr
mov eax, strLen
mov ecx, 20
L1:
call CreateRandomString
Loop L1
call WaitMsg
exit
main ENDP
CreateRandomString PROC USES ecx
mov ecx,eax
Document Page
3
COMPUTER SCINECE ASSIGNMENTS
L2:
mov eax, 26
call RandomRange
add eax, 65
mov [esi], eax
call WriteChar ; write character
loop L2
call Crlf
ret
CreateRandomString ENDP
END main
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
4
COMPUTER SCINECE ASSIGNMENTS
Bibliography
Tešanović, S. and Mitrović, P., 2018. Development of the game Hangman in assembly
programming language. Telfor Journal, 10(2), pp.134-138.
Alam, M., Singh, A., Bhattacharya, S., Pratihar, K. and Mukhopadhyay, D., 2019, November. In-
situ Extraction of Randomness from Computer Architecture Through Hardware Performance
Counters. In International Conference on Smart Card Research and Advanced Applications (pp.
3-19). Springer, Cham.
chevron_up_icon
1 out of 5
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]