answer.
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]
2 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]2 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
Given three dictionaries, associated with the variables, canadian_capitals, mexican_capitals, and us_capitals, that map province
Nookie1986 [14]

Answer:

The Python code to combine the three dictionaries are is given as follows:

  1. canadian_capital = {
  2.    cash: "SOME VALUES",
  3.    assets: "SOME VALUES"
  4. }
  5. mexican_capital = {
  6.    cash: "SOME VALUES",
  7.    assets: "SOME VALUES"
  8. }
  9. us_capital = {
  10.    cash: "SOME VALUES",
  11.    assets: "SOME VALUES"
  12. }
  13. nafta_capital = {
  14.    canadian: canadian_capital,
  15.    mexican : mexican_capital,
  16.    us: us_capital
  17. }

Explanation:

<u>Line 1 - 14 :</u>

Create three Python dictionaries and name them as <em>canadian_capitals, mexican_capital </em>and<em> us_capitals</em>. Please note a Python dictionaries should be enclosed in curly braces { }.  

We just define two samples of relevant keys (<em>cash </em>and <em>asset</em>) in each of the dictionaries. Python dictionary can map a key to a value.

Since we are not given any capital values from the question,  a dummy string "<em>SOME VALUES</em>" is tentatively set as the value for each of the keys.

In practice, we should replace those dummy strings with the real values of capital. The values can be a number, a string, a list and even a nested dictionary.

<u>Line 16 - 20 : </u>

Create one more Python dictionary and name it as <em>nafta_capital</em>.

Since our aim is to combine the three previous dictionaries (<em>canadian_capitals, mexican_capital </em>and <em>us_capitals</em>) and associate it with <em>nafta_capital</em>, we can define three different keys (<em>canadian, mexican </em>and <em>us</em>) in our dictionary nafta_capital.

As mentioned, a value associated with a key can be a nested dictionary. Hence, we just map <em>canadian_capitals, mexican_capital </em>and <em>us_capitals</em> as the value of the keys (<em>canadian, mexican </em>and<em> us</em>) in dictionary<em> nafta_capital,</em> respectively,

By doing so, we have managed to combine three target dictionaries (<em>canadian_capitals, mexican_capital </em>and <em>us_capitals</em> ) into a single dictionary, <em>nafta_capital</em>.

4 0
2 years ago
Which XXX and YYY correctly output the smallest values? Vector user Vals contains integers (which may be positive or negative).
liubo4ka [24]

Answer:

The answer is "minVal - userVals.at(0); /userVals.at(i) < minVal  "

Explanation:

In the question, it uses minVal instead of XXX to hold the very first arra(userVal) element, and rather than YYY you choose a conditional statement to check which integer is lower than minVal to index of loop increment. It changes the value of the minVal if the condition is valid. It's completely different if we talk about another situation.

3 0
1 year ago
When excel follows the order of operations the formula 8 * 3 + 2 equals?
Airida [17]
It follows the normal convention of BODMAS , which is the order of precedence of operations , so the answer equals to 26
3 0
2 years ago
What are threats to computer system
Readme [11.4K]
Theft or vandalism through to natural disasters are physical threats. Non-physical threats target the software and data on the computer systems, Like hackers or just straight up viruses. Also, untrustworthy apps or games can give your computer viruses as well.
3 0
2 years ago
The __________ contains a list of all the resources owned by the library.
Ira Lisetskai [31]

The catalog contains a list of all the resources owned by the library.

- Mabel <3

5 0
2 years ago
Other questions:
  • Why are digital calendars considered to be a convenient way to maintain a study schedule?
    10·2 answers
  • Currently, there are two major techniques used to develop programs and their procedures. name and describe them. html editor key
    11·1 answer
  • The OSHA Workplace Poster 3165 is optional for workplaces.<br> A) True<br> B) False
    13·2 answers
  • You are on vacation and want to see where all the restaurants and trendy shops are in relation to your hotel. You remember there
    15·1 answer
  • A company wants to publish Knowledge articles to its Customer Community. The articles should be organized for easy navigation by
    6·1 answer
  • Given numRows and numColumns, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print
    14·1 answer
  • The ______ network became functional in 1969, linking scientific and academic researchers across the United States. Group of ans
    7·2 answers
  • Write a program that plays a reverse guessing game with the user. The user thinks of a number between 1 and 10, and the computer
    5·1 answer
  • In this challenge, write a function to add two floating point numbers. Determine the integer floor of the sum. The floor is the
    8·1 answer
  • What are the two atomic operations permissible on semaphores?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!