Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assembly Language Program Write a procedure named CountMatches that receives poi

ID: 3769371 • Letter: A

Question

Assembly Language Program

Write a procedure named CountMatches that receives points to two arrays of signed double- words, and a third parameter that indicates the length of the two arrays. For each element x(i) in the rst array, if the corresponding y(i) in the second array is equal, increment a count. At the end, return a count of the number of matching array elements in EAX and display it. Write a test program that calls your procedure and passes pointers to two different pairs of arrays. Use the INVOKE statement to call your procedure and pass stack parameters. Create a PROTO declaration for Count- Matches. Save and restore any registers (other than EAX) changed by your procedure.

Explanation / Answer

main PROC
section   .text
    global _start
_start:              
    mov   edx,len   
    mov   ecx,msg  
    mov   ebx,1     
    mov   eax,4    
    int   0x80     
  
    mov   eax,1    
    int   0x80
  

section   .data
msg db 'AShish', 0xa
len equ $ - msg
INVOKE ExitProcess

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote