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
dlinn [17]
1 year 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]1 year 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
Identify the articulation site that allows us to nod our head ""yes"".
Luden [163]

Answer:

Occipital bone-atlas

Explanation:

The occipital bone is a bone that covers the back of your head; an area called the occiput. The occipital bone is the only bone in your head that connects with your cervical spine (neck).  The occipital bone surrounds a large opening known as the foramen magnum.

The foramen magnum allows key nerves and vascular structures passage between the brain and spine. Namely, it is what the spinal cord passes through to enter the skull. The brainstem also passes through this opening.

The foramen magnum also allows 2 key blood vessels traversing through the cervical spine, called the vertebral arteries, to enter the inner skull and supply blood to the brain

8 0
2 years ago
The fact that the speed of a vehicle is lower than the prescribed limits shall relieve the driver from the duty to decrease spee
blsea [12.9K]

Explanation:

the answer is false ........

4 0
2 years ago
Read 2 more answers
A data scientist is writing a Machine Learning (ML) algorithm using a large data set.
Olenka [21]

The product of the data scientist, who writes a Machine Learning (ML) algorithm using a large data set, is called a data-driven model.

A data-driven model generates insights and increases the efficiency of decision-making.

This implies that decisions are made based on the insights that the model by the Machine Learning algorithm produces.

Thus, Machine Learning algorithm or code helps entities to make insightful business decisions to increase efficiency and effectiveness.

Learn more about Machine Learning here at brainly.com/question/23738591

4 0
2 years ago
As an information user you should be skeptical of
Sati [7]
I should be skeptical of the credibility of sources that I have during the gathering. Be cautious and make sure that data comes of from trusted specialized sources. Trusted sources can be easily identified for their popularity on certain fields. Determine the purpose of the site and the data it contains.
5 0
2 years ago
Two devices are connected to the Internet and communicating with one another. A squirrel chews through one of the wires in the n
bearhunter [10]

Answer:

Fault-Tolerance

Explanation:

Fault tolerance refers to the ability of a system (computer, network, cloud cluster, etc.) to continue operating without interruption when one or more of its components fail.

5 0
2 years ago
Other questions:
  • Ajay wants to read a brief overview about early settlers in the United States. Which type of online text source should he most l
    9·2 answers
  • The alternative to encapsulating security protocol (esp) is _________.
    10·1 answer
  • A queueing system has four crews with three members each. The number of "servers" is:
    5·2 answers
  • Describe the basic features of the relational data model and discuss their importance to the end user and the designer. Describe
    9·1 answer
  • Write a loop that counts the number of space characters in a string. Recall that the space character is represented as ' '.
    11·1 answer
  • With respect to the general classes of computers, a ________ is the most expensive and most powerful kind of computer, which is
    7·1 answer
  • 12) Suppose you wanted a subroutine to return to an address that was 3 bytes higher in memory than the return address currently
    11·1 answer
  • Assume you have a variable, budget, that is associated with a positive integer. Assume you have another variable, shopping_list,
    11·1 answer
  • Assume that machines A and B are on the same network 10.3.2.0/24. Machine A sends out spoofed packets, and Machine B tries to sn
    14·1 answer
  • (Java) Which of the following code segments correctly declare a Strings and gives it a value of "fortran".
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!