.data array DWORD 10h,20h, 30h, 40h, 50h sample DWORD 50h .code • Write a function that search an item in the array The .data section contains two items – "array" and "sample" You have to write a...


.386


.model flat, stdcall


.stack 4096


ExitProcess PROTO, dwExitCode:DWORD


.data



.code



INVOKE ExitProcess,0


main ENDP


END main


.data<br>array DWORD 10h,20h, 30h, 40h, 50h<br>sample DWORD 50h<br>.code<br>• Write a function that search an item in the array<br>The .data section contains two items –

Extracted text: .data array DWORD 10h,20h, 30h, 40h, 50h sample DWORD 50h .code • Write a function that search an item in the array The .data section contains two items – "array" and "sample" 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 ; 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 Skeleton code for the procedure Search PROC ; save a copy of the registers except eax in the stack ; Implement Search here ; re-store the items from the stack ret Search ENDP

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here