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 03:30
Jessie has received a contract to build a real-time application for a baker. however, the baker doesn't want to invest too much money. his only requirement is that he wants the customers to know which cupcakes are available at what time and in what quantity. so his core requirement is that the details of product should be in real time. what platform can jessie use to develop this application?
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Spoons are designed to be used for: spring hammering. applying body filler. identifying high and low spots. sanding highly formed areas.
Answers: 3
question
Computers and Technology, 23.06.2019 21:30
Examine the list below. which factors positively affect lifetime income? check all that apply.
Answers: 1
question
Computers and Technology, 24.06.2019 09:50
Create a string list. 2. use console.readline() to collect values of firstname, lastname, street, city, state, zip, save them to list. 3. write a simple linq statement, call method uppercasewords() to change first letter to uppercase. 4. create a foreach statment to display the information. public static string uppercasewords(string value) { char[] array = value.tochararray(); if (array.length > = 1) { if (char.islower(array[0])) { array[0] = char.toupper(array[0]); } } for (int i = 1; i < array.length; i++) { if (array[i - 1] == ' ') { if (char.islower(array[i])) { array[i] = char.toupper(array[i]); } } } return new string(array);
Answers: 3
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, 07.05.2020 09:57
question
Mathematics, 07.05.2020 09:57
question
Mathematics, 07.05.2020 09:57
Questions on the website: 13722367