Question
Assembly Language x86 -masm -kip Irvine in visual Studio 2017 Define a 12-element array. Ask the user to input 12 numbers and fill the array.
Assembly Language x86 -masm -kip Irvine in visual Studio 2017
Define a 12-element array. Ask the user to input 12 numbers and fill the array.
Print the array to the screen to show that you correctly filled it. Place a message before it, something like "This is your array: ".
Use a loop to rotate the elements of the array between the 2nd element and the 8th element inclusive. This means that the 2nd element goes to the 3rd position, the 3rd goes to the 4th, the 4th to the 5th, and so on. The last element, 8th, goes to the 2nd position.
The rotation has to be done in the array memory location. Do not copy the elements to any other array and do not create extra variables. It would be a waste of memory. For temporary data, use the CPU registers.
Important: Use the SIZEOF, TYPE, and LENGTHOF operators to make the program as flexible as possible to support the array size and type being changed in the future. If I change the array size in your code to say, 16, your program should still run correctly, rotating the elements between the 2nd and the 8th position. Also important, do not use conditional directives.
Once you have rotated the specified elements, use a loop to print out the array to prove that the array was processed correctly. Also write a message, "Here is the processed array: "
Your program should run like this:
Enter 12 numbers:
1
2
3
4
5
6
7
8
9
10
11
12
The array as it was entered:
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
The processed array is:
+1
+8
+2
+3
+4
+5
+6
+7
+9
+10
+11
+12
Press any key to continue ...
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