QuestionQuestion

Reversing An Array
Create an integer array that is 12 elements long. Use a loop and the ReadInt procedure to fill the array with numbers taken from the keyboard.
Print the array to the screen to show that you correctly filled it. Place a message before it, something like "The array as it was entered: ".
Use a loop with indirect or direct addressing to reverse the array in place. In place means in the same memory location occupied by the array. 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.
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, 8, your program should still run correctly, reversing the first six elements .
Once you have reversed the array use a loop to print out each element to prove that the array is correct. Also write a message, "The processed array is: "
Output any appropriate messages that you feel are needed to make the program clear to the user.
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:
12
11
10
9
8
7
6
5
4
3
2
1

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

INCLUDE Irvine32.inc


.data

msg1 BYTE "Enter 12 numbers: ",0 ; output message
msg2 BYTE "The array as it was entered:",0 ; output message
msg3 BYTE "The processed array is: ",0 ; output message

intarray DWORD 0h, 0h, 0h, 0h,
0h, 0h, 0h, 0h,
0h, 0h, 0h, 0h

.code
main PROC

; read 12 numbers
mov edx,OFFSET msg1 ; load first offset to mgs1 to edx
call WriteString ; print msg1 to screen
call Crlf...

By purchasing this solution you'll be able to access the following files:
Solution.asm.

$33.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Assembly Language Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats