Listing 2 Eliminates special-case checksum handling

#define EPROM_SIZE 0x10000

unsigned char volatile *eprom;
unsigned char      sum;

for (eprom = 0; eprom < (EPROM_SIZE - 1); ++eprom)
{
    sum += *eprom;
}

*eprom = sum;  /* RAM based debugging support */

if (*eprom != sum)
{
    /* Failed diagnostics */
}

    /* Continue with other code */

/* End of File */