Program To Shifting The Elements in An Array in Assembly Language Using Visual Studio PDF
Program To Shifting The Elements in An Array in Assembly Language Using Visual Studio PDF
Program to Shifting the Elements in an Array in Assembly Language using Visual Studio
Programming Tutorials
SUBSCRIBE
Chapter 3
Problem # 8:
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 first position. For
example, the array [10,20,30,40] would be transformed into
[40,10,20,30].
Solution:
.386
.model flat,stdcall
.stack 4096
.data
array DWORD 10,20,30,40
lastElement DWORD ?
.code
main PROC
http://csprogrammingtutorial.blogspot.com/2018/02/program-shifting-elements-in-array-in-assembly.html 1/4
12/9/2018 8. Program to Shifting the Elements in an Array in Assembly Language using Visual Studio
Programming Tutorials
;Get first element address in ESI
SUBSCRIBE
MOV ESI, OFFSET array
L2:
MOV EAX, [ESI]
LOOP L2
INVOKE ExitProcess,0
main ENDP
END main
Let me know in the comment sec on if you have any ques on.
Previous Post:
Program to Copy a String in Reverse Order in Assembly Language using Visual Studio
Next Post:
http://csprogrammingtutorial.blogspot.com/2018/02/program-shifting-elements-in-array-in-assembly.html 2/4