汇编语言基于X86处理器 课后习题 6.11.2 第十题 奇偶性检查

10. Parity Checking
Data transmission systems and file subsystems often use a form of error detection that relies on
calculating the parity (even or odd) of blocks of data. Your task is to create a procedure that
returns True in the EAX register if the bytes in an array contain even parity, or False if the parity
is odd. In other words, if you count all the bits in the entire array, their count will be even or odd.
Preserve all other register values between calls to the procedure. Write a test program that calls
your procedure twice, each time passing it a pointer to an array and the length of the array. The
procedure’s return value in EAX should be 1 (True) or 0 (False). For test data, create two arrays
containing at least 10 bytes, one having even parity, and another having odd parity.
Tip: Earlier in this chapter, we showed how you can repeatedly apply the XOR instruction to a
sequence of byte values to determine their p

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值