Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ASSEMBLY LANGUAGE Using a loop and indexed addressing, write code that rotates the members of a 32-bit integer array forward one position. The value at

ASSEMBLY LANGUAGE

Using a loop and indexed addressing, write code that rotates the members of a 32-bit integer array forward one position. The value at the end of the array must wrap around to the ?rst position. For example, the array [10,20,30,40] would be transformed into [40,10,20,30].

This is what I got but I need to display the array before and after the rotation something like Array before Rotation: x x x x , Array after rotation: x x x x and also need to input the 4 numbers with the keyboard

.386 .model flat,stdcall .stack 4096 ExitProcess PROTO, dwExitCode:DWORD .data array DWORD 10,20,30,40 arrayType DWORD TYPE array newArray DWORD LENGTHOF array DUP(?) lastElement DWORD ? .code main PROC ;Get first element address in ESI MOV ESI, OFFSET array ;Get address of next element in EDI MOV EDI, OFFSET newArray ADD EDI, TYPE newArray ;set loop count into ecx mov ECX, LENGTHOF array L2: MOV EAX, [ESI] MOV [EDI], EAX ADD ESI, TYPE array ADD EDI, TYPE array LOOP L2 ;set last element from array in newArray first position MOV EDI,OFFSET newArray MOV EAX, [ESI] MOV [EDI], EAX INVOKE ExitProcess,0 main ENDP END main

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions

Question

Who will implement and maintain the project after launch?

Answered: 1 week ago

Question

analyze aesthetic enhancing design rules.

Answered: 1 week ago

Question

apply communication design concepts into creative projects.

Answered: 1 week ago