using assembly language
Counting Nearly Matching Elements
Write a procedure named CountNearMatches that receives pointers totwo arrays of signed doublewords, a parameter that indicates thelength of the two arrays, and a parameter that indicates themaximum allowed difference (called diff) between any two matchingelements. For each element x(i) in the ﬁrst array, if thedifference between it and the corresponding y(i) in the secondarray is less than or equal to diff, increment a count. At the end,return a count of the number of nearly matching array elements inEAX. Display this value.
Write a test program that calls CountNearMatches and passespointers
to two different pairs of arrays. Use the INVOKE statement to callyour procedure and pass stack
parameters. Create a PROTO declaration for CountMatches. Save andrestore any registers (other than EAX) changed by yourprocedure.
Answer to using assembly language Counting Nearly Matching Elements Write a procedure named CountNearMatches that receives pointer…