Write a subroutine called PIN_CHECK to check if a PIN number entered by a user i
ID: 3802313 • Letter: W
Question
Write a subroutine called PIN_CHECK to check if a PIN number entered by a user is among a list of valid PINs. PIN stands for Personal Identification Number. PINs can take values from 00000 to 65, 535. The valid PINs are stored in an array of words and the first word has the total number of PINs, each PIN is stored in a word, and Y points at the beginning of the array, as indicated in the figure. The five digits of the PIN entered by the user are stored in 5 consecutive bytes, where register X points at the beginning address. First, the subroutine should convert the PIN's 5 digits to a decimal number as follows: digit #5 times 10000 + digit #4 times 1000 + digit #3 times 100+ digit #2 times 10 + digit#1. For example, the PIN's digits 5, 2, 3, 6, and 1 are converted to 5 times 10000 + 2 times 1000 + 3 times 100 + 6 times 10 + 1 = 52361. The subroutine should return 00 in register B if the PIN is not found otherwise it returns FF in B B should also have EE if the PIN's decimal value is greater than 65535.Explanation / Answer
When you take money out of an ATM using a debit or credit card, you need to enter a PIN to prove that you're authorized to make the withdrawal. The PIN serves as a secondary form of verification (anybody could have possession of the card, but only you should know the PIN that works with the card). In many cases, your PIN is a four-digit number, such as 1234 (obviously you’d want to use a PIN that is harder to guess).
You might also need to use a PIN to use your debit or credit card at a retailer. Again, the PIN proves that you are authorized to use the card. In the United States, chip-enabled cards sometimes require a PIN at checkout, but a signature is more common. In other countries, entering a PIN is the norm – and some cards issued in the US are not compatible with those payment systems (so check with your bank before you take your card out of the country).
Aside from PINs you set up with your bank our credit union, almost any organization you work with might ask you to establish a PIN. The concept is similar: this is a secret code that verifies your identity. For example, you might need a PIN to:
Student Loans
In the past, PINs were an important part of your application for federal student loans. After 2015, PINs were replaced with FSA IDs, which are more secure.
PIN Security
Because PINs protect sensitive information (and your cash), you’ll want to use a PIN that is difficult to guess. Avoid including the following items in your PIN:
Longer PINs are safer than shorter PINs because there are more ways to mix the numbers together. For example, if you use a four digit PIN, you can come up with 10,000 variations (starting with 0000, 0001, 0002, and so on). With a six-digit PIN, there are one million potential codes, so it’s much more difficult for thieves and computer programs to successfully guess your PIN.
Anytime you have the option, go with a longer PIN.
Most security systems lock your account (at least temporarily) after three unsuccessful attempts. This gives you and your bank a chance to figure out what’s going on, and it keeps progress painfully slow for anybody trying to guess your PIN.
Keep it Secret, but Accessible
Because the PIN authorizes you (or whoever knows it) to access sensitive information, it's essential to keep the number secret. Protect it, and never write it on your ATM or debit card – thieves know to look for 4 digit codes written on the back of stolen cards.
When you enter your PIN at an ATM or cash register, cover the keypad with your free hand so that nobody can see what you type in. Hidden cameras are sometimes installed at ATMs and other devices for recording PINs. If you want to be extra safe, touch some of the other keys (which aren’t part of your PIN), which can help thwart heat-sensitive cameras and other tactics.
PINs can be hard to remember – especially if you’ve got a stack of debit cards. This creates a challenging situation: good security is more difficult to stick with. As a result, you may be tempted to take shortcuts (like re-using the same PIN or using numbers from your birthday). Fortunately, there are several tricks that make it easy to store PINs safely (while making them easy to access or remember). For a list of ideas, see Secrets of Great PIN Numbers.
If you don’t know your PIN, you might still need to get it from your financial institution. In many cases, you do not get to choose your initial PIN – it will be mailed to you separately (in case your card is stolen from the mail). You’ll generally have the option to change your PIN, and you might be required to do so.
However, some banks allow you to choose your PIN yourself as your card is printed.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.