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
dlinn [17]
3 years ago
8

Suppose you are given three data items that indicate a starting index in a list, an array of characters, and an array of link in

dex. You are to write a program that traverses the links and locates the characters in their correct sequence. For each characters you locate, copy it to a new array. Suppose you used the following sample data, and assumed the arrays use zero-based indexes:
start = 1
chars: H A C E B D F G
links: 0 4 5 6 2 3 7 0
Then the values copied (in order) to the output array would be A,B,C,D,E,F,G,H. Declare the chraracter array are a type BYTE, and to make the problem more interesting, declare the links array type DWORD.
Computers and Technology
1 answer:
Artemon [7]3 years ago
7 0

Answer:

see explaination

Explanation:

INCLUDE Irvine32.inc

;declare the variables

SPACE = 32

startIndex = 1

.data

statement BYTE "The correct sequence of array: ",0

; declare the chars('H','A','C','E','B','D','F','G')

chars BYTE 48h,41h,43h,45h,42h,44h,46h,47h

sizeOfArray = ($ - chars)

links DWORD 0,4,5,6,2,3,7,0

outputArray BYTE sizeOfArray DUP(?)

.code

main PROC

; assign starting index

mov eax,startIndex

; assign offset of array chars

mov ebx,OFFSET chars

; assign the size of the array

mov ecx, sizeOfArray

; assign the offset of array links

mov edi,OFFSET links

; assign the offset of new array

mov esi,OFFSET outputArray

; call the traverseLink procedure

call traverseLink

; display the characters of new array

mov edx,OFFSET statement

call writeString

; assign the offset of new array

mov esi,OFFSET outputArray

; assign the size of the array

mov ecx, sizeOfArray

; call the procedure printArray to print the ordered array

call printArray

exit

main ENDP

traverseLink PROC

forLoop:

; get the character at index eax

mov dl,[ebx+eax]

; assign it to new array

mov [esi] , dl

; get the value at the next index

mov eax,[edi+eax*4]

; goto next location of new array

inc esi

; repeat until ecx=0

loop forLoop

ret

traverseLink ENDP

printArray PROC

forLoop:

; get the character at index eax

mov al,[esi]

; print the character

call WriteChar

; increament esi to get next character

inc esi

; print the space character

mov al,SPACE

call WriteChar

loop forLoop

call Crlf

ret

printArray ENDP

END main

You might be interested in
Addressing is an added feature on the Internet, and is not required for proper operation of the Internet, as packet switching is
Irina18 [472]

Answer:

True

Explanation:

The statement is true. Packet switching is a method that groups the data and transmit it over the digital network. It is basis for communication in the computer. When the two host decides to communicate the network creates a control function and data is transmitted. Addressing is an added and is not mandatory for the operations of the internet as packet switching.

7 0
3 years ago
____________________________ and _________________________ are 2 negative impacts of the internet on businesses.
Bogdan [553]

Answer:

i no you its me remember and the answer is b.

Explanation:

7 0
3 years ago
Write a summary about web cams and give me imformation about it
Nataly [62]
Web Cams are usually used to catch secret footage that is later posted all over the internet.  As you can see, on the internet you watch so many videos with that involve someone alone. How do people film and get the person caught on camera? Web Cam. Webcams are also used to see whoever is at your door or simply if anyone is trying to break into your home. For example, there is the ring. The ring is the product that is used to see if your home is in danger or not. It's a webcam that is installed all through your house.
 This is a short little essay to tell you about webcams. Hopefully, I help and you get a great grade! :)
4 0
4 years ago
What was the attitude of the U.S. Senate towards the Treaty of Versailles, and why did they have that attitude?​
Arte-miy333 [17]

Answer:

in 1919 the Senate rejected the Treaty of Versailles, which formally ended World War I, in part because President Woodrow Wilson had failed to take senators' objections to the agreement into consideration. They have made the French treaty subject to the authority of the League, which is not to be tolerated. hope it helps in someway ig idk

Explanation:

8 0
3 years ago
A computer has __ IP address(es). <br><br><br> A. Many <br> B. One
zaharov [31]

Answer:

A computer has one IP address(es).

One

Explanation:

Have a great day!

7 0
3 years ago
Other questions:
  • Why is it important for a Support Agent to understand and follow their company’s standardized case lifecycle roadmap? (Select 2)
    12·1 answer
  • Using the physical mail analogy, what part of an address on an envelope is most like the ip address?
    8·1 answer
  • What is working with others to find a mutually agreeable outcome?
    5·1 answer
  • What are some good invention names for an air filter?
    14·1 answer
  • The act of deliberately accessing computer systems and networks without authorization is generally known as _____.
    5·1 answer
  • What is a command-line interactive scripting environment that provides the commands for almost any management task in a Windows
    9·1 answer
  • What is the function of a breadcrumb trail in a website?
    13·1 answer
  • Derek is creating an animation for his class project. What is the first step Derek should follow while creating the animation?
    11·2 answers
  • How to write my name in binary code ? Rivas
    7·2 answers
  • What does a computer monitor look like when struck really hard?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!