Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MASM Hex Question: Can you please explain why the answer to number 21 is answer choice C? Thanks! ; code fragment V Use this information
MASM Hex Question: Can you please explain why the answer to number 21 is answer choice C? Thanks!
; code fragment V Use this information and the code at the right to answer questions # 20-21. mov edx, OFFSET string mov ecx , MAXSIZE dec ecx call Readstring mov ecx, eax ; number of Given the following declarations for an IA-32 processor MAXSIZE 10 data ; digits entered ;initialize val string BYTE MAXSIZE DUP (?) mov val,0 mov esi, OFFSET string cld DWORD? val The ReadString procedure accepts the address of the memory destination in edx, and the maximum number of characters to read in ecx. ReadString stores the user's input characters in the memory destination, and the actual number of characters in eax. The ASCII code for character '0' is 48 Suppose that the user enters the string "5738" (without the quotes) when the ReadString procedure is called. top: mov eax, 0 lodsb sub eax,48 mov ebx, eaix moveax, val mov edx,10 mul edx add eax,ebx movVal,eax loop top 20. (3 pts) What is displayed? done mov eax, va.l cali Wr1teDec 21 What is stored in memory at val? A. 0x5 0x7 0x3 0x8 B. 0x8 0x3 0x7 0x5 C. 0x6A 0x16 0x0 0x0 D. 0x0 0x0 0x16 0x6A E. none of the above ; code fragment V Use this information and the code at the right to answer questions # 20-21. mov edx, OFFSET string mov ecx , MAXSIZE dec ecx call Readstring mov ecx, eax ; number of Given the following declarations for an IA-32 processor MAXSIZE 10 data ; digits entered ;initialize val string BYTE MAXSIZE DUP (?) mov val,0 mov esi, OFFSET string cld DWORD? val The ReadString procedure accepts the address of the memory destination in edx, and the maximum number of characters to read in ecx. ReadString stores the user's input characters in the memory destination, and the actual number of characters in eax. The ASCII code for character '0' is 48 Suppose that the user enters the string "5738" (without the quotes) when the ReadString procedure is called. top: mov eax, 0 lodsb sub eax,48 mov ebx, eaix moveax, val mov edx,10 mul edx add eax,ebx movVal,eax loop top 20. (3 pts) What is displayed? done mov eax, va.l cali Wr1teDec 21 What is stored in memory at val? A. 0x5 0x7 0x3 0x8 B. 0x8 0x3 0x7 0x5 C. 0x6A 0x16 0x0 0x0 D. 0x0 0x0 0x16 0x6A E. none of the above
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started