Banks use a Personal Identification Number (PIN) to uniquely identify each customer. Let us assume that our bank has a specified range of acceptable values for each digit in its customers' 5-digit PINs. The table shown below contains the acceptable ranges, where digits are numbered from left to right in the PIN. Then we can see that the PIN 52413 is valid. But the PIN 43534 is invalid because the first digit is out of range. Similarly, 64535 is invalid because of its last digit. Digit Number Range 1 5 to 9 2 2 to 5 3 4 to 8 4 1 to 4 5 3 to 6 Create a procedure named Validate_PIN that receives a pointer to an array of byte containing a 5-digit PIN. Declare two arrays to hold the minimum and maximum range values, and use these arrays to validate each digit of the PIN that was passed to the procedure. If any digit is found to be outside its valid range, immediately return the digit's position (between 1 and 5) in the EAX register. If the entire PIN is valid, return 0 in EAX. Preserve all other register values between calls to the procedure. Write a test program that calls Validate_PIN at least four times, using both valid and invalid byte arrays. Display "Valid" or "Invalid" on the console after each procedure call.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

not a quiz or test but homework

Banks use a Personal Identification Number (PIN) to uniquely identify each customer.
Let us assume that our bank has a specified range of acceptable values for each digit
in its customers' 5-digit PINs. The table shown below contains the acceptable ranges,
where digits are numbered from left to right in the PIN. Then we can see that the
PIN 52413 is valid. But the PIN 43534 is invalid because the first digit is out of
range. Similarly, 64535 is invalid because of its last digit.
Digit
Number
Range
1
5 to 9
2
2 to 5
3
4 to 8
4
1 to 4
5
3 to 6
Create a procedure named Validate_PIN that receives a pointer to an array of byte
containing a 5-digit PIN.
Declare two arrays to hold the minimum and maximum range values, and use these
arrays to validate each digit of the PIN that was passed to the procedure.
If any digit is found to be outside its valid range, immediately return the digit's
position (between 1 and 5) in the EAX register.
If the entire PIN is valid, return 0 in EAX.
Preserve all other register values between calls to the procedure.
Write a test program that calls Validate_PIN at least four times, using both valid and
invalid byte arrays.
Display "Valid" or "Invalid" on the console after each procedure call.
Transcribed Image Text:Banks use a Personal Identification Number (PIN) to uniquely identify each customer. Let us assume that our bank has a specified range of acceptable values for each digit in its customers' 5-digit PINs. The table shown below contains the acceptable ranges, where digits are numbered from left to right in the PIN. Then we can see that the PIN 52413 is valid. But the PIN 43534 is invalid because the first digit is out of range. Similarly, 64535 is invalid because of its last digit. Digit Number Range 1 5 to 9 2 2 to 5 3 4 to 8 4 1 to 4 5 3 to 6 Create a procedure named Validate_PIN that receives a pointer to an array of byte containing a 5-digit PIN. Declare two arrays to hold the minimum and maximum range values, and use these arrays to validate each digit of the PIN that was passed to the procedure. If any digit is found to be outside its valid range, immediately return the digit's position (between 1 and 5) in the EAX register. If the entire PIN is valid, return 0 in EAX. Preserve all other register values between calls to the procedure. Write a test program that calls Validate_PIN at least four times, using both valid and invalid byte arrays. Display "Valid" or "Invalid" on the console after each procedure call.
Expert Solution
steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY