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
quester [9]
4 years ago
6

Write a program that uses the variables below and MOV instructions to copy the value from bigEndian to littleEndian, reversing t

he order of the bytes. The number's 32 - bit value is understood to be 12345678 hexadecimal.
Computers and Technology
1 answer:
pashok25 [27]4 years ago
7 0
<h3><u>A program for the variables below and MOV instructions to copy the value from bigEndian to littleEndian, reversing the order of the bytes</u></h3>

; Program Name:  bigEndian to LittleEndian

.386

.model flat,stdcall

.stack 4096

ExitProcess PROTO, dwExitCode:DWORD

.data

bigEndian BYTE 12h,34h,56h,78h

littleEndian DWORD ?

; Program Name:  bigEndian to LittleEndian

.code main PROC

mov al, [bigEndian+3] ; this would swap 78h and 12h

mov ah, [bigEndian]

mov [bigEndian], al

mov [bigEndian+3], ah

mov al, [bigEndian+2] ;This would swap 56h and 34h

mov ah, [bigEndian+1]

mov [bigEndian+1], al

mov [bigEndian+2], ah

mov eax, DWORD PTR bigEndian ; This would move reverse ordered bytes

mov littleEndian, eax ;This would move reverse ordered bytes

invoke ExitProcess, 0

main ENDP

END main

<u>Explanation:</u>

The OFFSET operators are not allowed to access the bytes. All we can use the function MOV. After we will need to swap the bytes around manually. We can't able to move the data from memory to memory, we are forced to use an 8-bit register as a buffer to temporarily hold the data.

We can access each byte of bigEndian individually by using offsets bigEndian+0 -> bigEndian+3, but considering we declared littleEndian after bigEndian, memory was allocated for littleEndian just after bigEndian.

It means if we move offsets bigEndian+4 -> bigEndian+7 we can directly access littleEndian using small 8-bit increments.

You might be interested in
1. What is the difference between background sound and nat sound
OleMash [197]

Answer:

Well the background sound is the sound of course in the background and the nat sound is the curremt sound

Explanation:

6 0
2 years ago
John just bought a used iPad from a friend who had lost the charging cable. John notices that the cable is like the charging cab
7nadin3 [17]

Answer:

an iphone charger

Explanation:

5 0
4 years ago
Complete the printtictactoe function with char parameters horizchar and vertchar that prints a tic-tac-toe board with the charac
lora16 [44]
Void printtictactoe(char horizchar, char vertchar)
{
int i,j;
int scale = 5;

for(j=0; j<3; j++) {
   for (i = 0; i < scale; i++)
      printf("%*c%*c\n", scale+1, vertchar, scale+1, vertchar);
      if (j < 2) 
         for (i = 0; i < (scale * 3)+2; i++)
             printf("%c", horizchar);
             printf("\n");
    }
}

I left out many braces because of the layout issues with this website. There is a scale factor you can set to the desired size of the board cells!
3 0
3 years ago
The interprets the data while it is in RAM​
Katena32 [7]

Answer:

The input interprets the data while it is in RAM.

Explanation:

5 0
3 years ago
If you were at the front of a long line of people, stepped onto a chair and took a
WINSTONCH [101]
They are closer to the people and they work than a senior management
7 0
3 years ago
Other questions:
  • Suppose that a program performs an intermixed sequence of (stack) push and pop operations. The push operations put the integers
    9·1 answer
  • Its false because I got it wrong
    5·1 answer
  • How to screen shot on a computer
    14·2 answers
  • What is an activity that can help you enhance the appearance of your computer’s desktop?
    12·2 answers
  • Software engineers typically use UML as a principle means of explaining design. UML stands for:
    12·1 answer
  • These statements describe a network server.
    5·1 answer
  • Write a number guessing game. The game should have a default 1-100 picking system. Have the user guess the number the computer p
    12·1 answer
  • News writers get story leads from____.
    8·1 answer
  • 1.
    15·1 answer
  • Answer pls pls pls pls ​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!