QuestionQuestion

1. Create a DWORD integer array that is 20 elements long.
2. The first loop: Ask the user to enter 19 numbers to fill the first 19 positions of the array.
3. The second loop: Add all 19 numbers and place the sum in the last position of the array.
4. The third loop: Reverse the first half of the array.
5. The fourth loop: Use a loop to display the array, to show that the first half was, indeed, reversed. Also, that you correctly summed the first 19 numbers. As with step 1, the loop has to access the array from the first element to the last and display the numbers stored in memory. Use a message that reads "The array after the first half was reversed is: "

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

;// .386
;// .model flat,stdcall
;// .stack 4096
ExitProcess proto,dwExitCode:dword

.data ;// write your data in this section

prompt BYTE "Please enter 19 numbers" , 0dh, 0ah, 0 ;user prompt
msg BYTE "The array after the first half was reversed is:" , 0dh, 0ah, 0 ;final message
len DWORD 20 ;variable for length of array
array DWORD 20 DUP(?) ;makes space for 20 integers

.code ;// write your program here
main proc

mov edx, OFFSET prompt ;move prompt to edx
call writestring ;print the prompt

mov ecx, 19 ;set ecx to 19
mov edx, OFFSET array ;move array address to edx
L1:
call readdec ;read next element
mov [edx], eax ;store it to the array
add edx, 4 ;increment...
$25.00 for this solution

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