Write a function that search an item in the array -ubmission (1) data array DWORD 1@h,20h, 30h, 40h, 50h sample DWORD 50h Write a function that search an item in the array The .data section contains two items – "array" and "sample" .code • You have to write a procedure that search "sample" in the "array". If the item is found return the item using EAX register, otherwise, return -1 using EAX register. You can pass the parameters using registers Push the register arguments at the beginning of the procedure. And pop them at the end of the procedure. Detail documentation of the procedure is in the next slide

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section7.4: Arrays As Arguments
Problem 7E: (Statistics) Write a program that includes two functions named calcavg() and variance(). The...
icon
Related questions
Question
Assembly language
• Write a function that search an item in the array
Submission (1)
• Write a function that search an item in the array
• The .data section contains two items – "array" and "sample"
data
array DWORD 1@h,20h, 30h, 40h, 50h
sample DWORD 50h
.code
You have to write a procedure that search "sample" in the "array".
If the item is found return the item using EAX register, otherwise, return -1 using
EAX register.
• You can pass the parameters using registers
Push the register arguments at the beginning of the procedure. A
pop them at
the end of the procedure.
• Detail documentation of the procedure is in the next slide
; This Procedure search a given item in a given array
; Receives: EBX, ESI, ECX, EDX content as input.
EBX contains the item we want to search on the array
ESI contains the address of the first item in the array
ECX contains the number of items in the array
EDX contains the size of each item in the array
Returns
: EAX,
If the item found in the array, EAX stores the item we
are searching
Otherwise, EAX contains -1
; Requires: Nothing
;-
Search PROC
; implement the procedure
ret
Search ENDP
Transcribed Image Text:• Write a function that search an item in the array Submission (1) • Write a function that search an item in the array • The .data section contains two items – "array" and "sample" data array DWORD 1@h,20h, 30h, 40h, 50h sample DWORD 50h .code You have to write a procedure that search "sample" in the "array". If the item is found return the item using EAX register, otherwise, return -1 using EAX register. • You can pass the parameters using registers Push the register arguments at the beginning of the procedure. A pop them at the end of the procedure. • Detail documentation of the procedure is in the next slide ; This Procedure search a given item in a given array ; Receives: EBX, ESI, ECX, EDX content as input. EBX contains the item we want to search on the array ESI contains the address of the first item in the array ECX contains the number of items in the array EDX contains the size of each item in the array Returns : EAX, If the item found in the array, EAX stores the item we are searching Otherwise, EAX contains -1 ; Requires: Nothing ;- Search PROC ; implement the procedure ret Search ENDP
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,