汇编语言基于X86处理器 课后习题 6.11.2 第九题 PIN验证

这篇博客介绍了一种用于验证银行客户5位PIN码有效性的汇编语言程序设计方法。程序名为Validate_PIN,接收一个包含5位PIN的字节数组指针,通过两个数组存储最小和最大范围值来检查每个数字是否在有效范围内。如果发现任何数字超出范围,立即返回该数字在PIN中的位置(1到5),否则返回0。博客还提供了测试程序,并建议使用调试器验证或通过图书馆函数显示结果。
摘要由CSDN通过智能技术生成

9. Validating a PIN
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

Your task is to 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 a

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值