Create a procedure named ValidatePIN that receives a pointer to an array of bytes containing a 5-digit PIN from your main proc. You are required to use the four byte arrays samplePin_1, samplePin_2,samplePin_3 and samplePin_4 declared below.
Use the two arrays (minVals and maxVals) declared below to hold the minimum and maximum range values, and use these arrays to validate each digit of the PIN that was passed to the proc ValidatePIN. If any digit is found to be outside its valid range,immediatey return the digit's position (between 1 and 5) in the EAX register to the main proc. The main proc should then display a message like "digit 3 is invalid". If the entire PIN is valid, return 0 in EAX and display "PIN is valid".
Preserve all other register values between calls to the ValidatePIN procedure. Your main proc should call Validate_PIN at least four times, using both valid and invalid byte arrays. By running the program in a debugger,verify that the return value in EAX after each procedure call is valid and use one of Irvine's library procesures to display "Valid" or "Invalid" on the console after each procedure call. Use this table to validate the ranges:
Digit Number Range
1 5 to 9
2 2 to 5
3 4 to 8
4 1 to 4
5 3 to 6
minVals byte 5,2,4,1,3 ; globally visible
maxVals byte 9,5,8,4,6 ; globally visible
samplePin_1 byte 6,3,4,4,3
samplePin_2 byte 5,2,3,2,4
samplePin_3 byte 5,2,4,5,3
samplePin_4 byte 1,3,4,4,3
Required minimum 1 page