The following examples show the implementation of one’s complement Fletcher-16 checksum used to check code uploaded by the LoadCode command.
Please note that the one’s complement adding implementation does not use a well-known “modulo 255” algorithm that requires more code but it makes use of “carry technique” that unlikely does not avoid one’s complement negative zero value 0xFF.