subject

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

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
What statement best describes operating systems? it’s possible for modern computers to function without operating systems. most operating systems are free or very inexpensive. operating systems are managed by the computer’s microprocessor (cpu). operating systems manage the computer’s random access memory (ram).
Answers: 1
question
Computers and Technology, 23.06.2019 12:10
2. fabulously fit offers memberships for$35 per month plus a $50 enrollmentfee. the fitness studio offersmemberships for $40 per month plus a$35 enrollment fee. in how many monthswill the fitness clubs cost the same? what will the cost be?
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Anetwork security application that prevents access between a private and trusted network and other untrusted networks
Answers: 1
question
Computers and Technology, 24.06.2019 05:30
Hey i really need some solving this problem: 1. encrypt this binary string into cipher text: 110000. include in your answer the formula the decoder would use to decrypt your cipher text in the format (coded answer) x n mod (m) = y & 2. decrypt this cipher text into a binary string: 106 you.
Answers: 2
You know the right answer?
ASSEMBLY LANGUAGE Using a loop and indexed addressing, write code that rotates the members of a 32-...
Questions
question
Mathematics, 15.12.2020 20:10
Questions on the website: 13722367