1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Fiesta28 [93]
3 years ago
8

Using a loop and indexed addressing, write assembly language code that rotates the members of a 32-bit integer array forward one

position. The value at the end of the array must wrap to the first position. For example, the array [10, 20, 30, 40] would be transformed into [40, 10, 20, 30]
Computers and Technology
1 answer:
AveGali [126]3 years ago
7 0

Answer:

Here is the code which will rotate the array.

*************************************************************************

.386

.model flat,stdcall

.stack 4096

ExitProcess PROTO, dwExitCode:DWORD

section .data

array DWORD 10,20,30,40 ; Initialising the array  

arrayType DWORD TYPE array

newArray DWORD LENGTHOF array DUP(?)

lastElement DWORD ?

.code

main PROC

 

   ;First Element will be moved to register ESI

   mov ESI, OFFSET array

   ;Next Array Element in EDI

   mov EDI, OFFSET newArray  

   ADD EDI, TYPE newArray

   ;Loop Counter set into register ECX

   mov ECX, LENGTHOF array

L2:

   mov EAX, [ESI]

   mov [EDI], EAX

   ADD ESI, TYPE array

   ADD EDI, TYPE array

   LOOP L2

   ; following will set the last element of array into first position of newArray

   mov EDI,OFFSET newArray

   mov EAX, [ESI]

   mov [EDI], EAX

INVOKE ExitProcess,0

main ENDP

END main

Explanation:

<em>.386 - It will enable assembly of non privileged instruction for 80386 processor. </em>

<em>.model flat, stdcall - It will explain about which memory to use.  </em>

<em>.stack 4096 - It is used to inform assembler to reserver 4096 bytes of uninitialised memory. </em>

<em>.code is a code section. </em>

<em>section .data is used to declare initialized data.</em>

<em>DWORD is a type specified with 4 bytes address. </em>

<em>EAX, EDI, ESI, ECX are Registers </em>

<em>mov- It will move data from one register to another. </em>

<em>ADD- Add two values. </em>

You might be interested in
What is the process or technique of "making something that allows" human beings to share their knowledge, perform a task, or ful
Mashcka [7]

Answer:Technology

Explanation: it can be define as process or technique of making something that allows human beings to share their knowledge, perform a task or fulfill a function

-tool or invention that, once created and used, is intended to solve a problem or improve on past understandings of how to do something.

7 0
3 years ago
Could it be there will be nothing like lost forever documents with programs like backupdocs.com?
katen-ka-za [31]

Answer:

Yes

Explanation:

The programs like backupdocs.com help us in storing the lost forever documents like driving license, ration card, social security number, etc., and in case they are lost you need not worry as the backup is there on the backupdocs.com. You can hence, get your lost forever documents from the backupdocs.com in case you have lost them. Hence, the fact put forward by the above question is certainly true. And backupdocs.com is a real advantage for us hence.

4 0
3 years ago
The modulus ( % ) actually gives you the ___________ of an integer division problem.
Svetlanka [38]
The answer is (e) sum
7 0
4 years ago
The Windows Group Policy feature provides __________ that govern the way Windows operates in enterprise environments. a. a centr
WITCHER [35]

Answer:

a.

Explanation:

The Windows Group Policy feature provides a centralized set of rules that govern the way Windows operates in enterprise environments. The Windows Group Policy is found in every single Microsoft Windows operating system, and fully controls the working environment of user accounts and computer accounts. This feature allows the user to manually make restrictions and changes such as blocking access to certain sections of the Windows control panel or setting a specific website as the home page for every account on the network.

4 0
3 years ago
1. What year was the Entertainment Software Rating Board created?
Aloiza [94]
I think its B ir look on safari
3 0
3 years ago
Other questions:
  • Simon wants to use an invoice template created by Office.com. The first step after selecting the File tab is to select
    14·1 answer
  • One metric ton is approximately 2,205 pounds.
    6·1 answer
  • The political spectrum spans from Communism on the extreme left to __________ on the extreme right. /8178757/1f6bdbf3?utm_source
    6·2 answers
  • Here is over 40pts as Promised? :)<br> Who invented the Lamborghini?
    12·2 answers
  • Your company collects and stores security camera footage. Within the first 30 days, footage is processed regularly for threat de
    10·1 answer
  • Are scripted languages easier or more difficult to port than programming languages? Why?
    6·1 answer
  • Items that represent features of smartphones apps
    12·1 answer
  • Find the domain and range of Y=x^3-9/x-3​
    14·1 answer
  • nder a Huffman encoding ofnsymbols with frequenciesf1, f2, . . . , fn, what is the longest a codewordcould possibly be
    13·1 answer
  • True or False? Popular sites are always mean accurate
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!