Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For Assembly Language x86: I have the following code: which currently outputs : I would like to modify this so instead of printing out the
For Assembly Language x86:
I have the following code:
which currently outputs :
I would like to modify this so instead of printing out the first number of the array at the bottom, It will allow someone to pick which number they would like to output.
The output would look like:
Enter a number: 9
enter a number: 8
enter a number: 7
enter a number: 6
Pick which array number between 0-3 would you like to output:
2
8 ;// since they picked 2, it outputs the 2nd number that they entered.
.data ;// write your data in this section 13 14 15 16 17 18 19 20 21 myArray WORD 4 DUP(?) prompt BYTE "Enter a number" ,0ah, dh, 0 prompt2 BYTE" pick a number within the array between 0-3 to output that number", 0ah, Odh, 0 .code // write your program here main proc mov eax, 0 mov edx, OFFSET prompt call Writestring call ReadInt mov myArray[o SIZEOF WORD], ax 23 24 25 26 27 28 29 30 31 32 call Writestring call ReadInt mov myArray[1*SIZEOF WORD], ax call Writestring call ReadInt mov myArray[2 * SIZEOF WORD1, ax 34 35 36 37 38 39 40 41 42 43 call Writestring call ReadInt mov myArray[3 * SIZEOF WORD], ax mov ax, myArray[0*SIZEOF WORD] call WriteDec call Crlf invoke ExitProcess,0 45 main endpStep 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