can you show me the screen shot of this code please .JUst the screen shot INCLUDE Irvine32.inc
can you show me the screen shot of this code please .JUst the screen shot INCLUDE Irvine32.inc
Chapter8: Arrays
Section: Chapter Questions
Problem 9PE
Related questions
Question
2. can you show me the screen shot of this code please .JUst the screen shot
INCLUDE Irvine32.inc
strLen EQU 10 ; Declare a constant for the length of the array
.data
arr BYTE strLen DUP(?) ; Define the array of bytes
.code
main PROC
call Clrscr
mov esi, OFFSET arr
mov ecx, 20 ; Call GenerateRandomString 20 times
L1:
push ecx ; Save ecx on the stack
call GenerateRandomString
pop ecx ; Restore ecx from the stack
call Crlf
loop L1
call WaitMsg
exit
main ENDP
GenerateRandomString PROC USES ebx ecx esi
; Save registers on the stack
push ebx
push esi
push ecx
; Get length of string
mov ecx, lengthOf arr
; Get pointer to string
mov esi, offset arr
; Generate random string
mov ebx, esi ; Store starting address of string
mov eax, 'A' ; Start with ASCII code for 'A'
L2:
call RandomRange ; Get random number between 0 and 25
add eax, 'A' ; Convert to capital letter ASCII code
mov [esi], al ; Store character in string
inc esi ; Move to next byte in string
loop L2
; Null-terminate the string
mov byte ptr [esi], 0
; Restore registers from the stack and return
pop ecx
pop esi
pop ebx
ret
GenerateRandomString ENDP
END main
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 3 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning