The 8051 Microcontroller and Embedded

(lily) #1
Department of Computer Scien

ce and Information Engineering

National Cheng Kung University, TAIWAN
HANEL

BCD AND ASCII APPLICATION PROGRAMSChecksum Byte


in ROM(cont’)


‰To calculate the checksum byte of a series of bytes of data


¾Add the bytes together and drop the carries¾Take the 2’s complement of the total sum, and it becomes the last byte of the series


‰To perform the checksum operation, add all the bytes, including the checksum byte


¾The result must be zero¾If it is not zero, one or more bytes of data have been changed

Free download pdf