I'm late getting to this, but searchers may find it useful.
I found this slick trick for calculating CCITT CRC16 on the web some time back, and it computes the CRC a BYTE at a time with NO tables, and in this loop on an S08 with a 16MHz bus clock runs at 5uS/byte! That means the whole 8K in 40ms. The whole routine is 80 bytes. Don't ask me how it works, someone with better boolean math skills than mine must've come up with it!
#pragma DATA_SEG __SHORT_SEG MY_ZEROPAGE //Direct-access vars
static uint8_t i;
static union{
struct{
uint8_t hi; //Big endian
uint8_t lo;
} byte;
uint16_t word;
} crc,addr;
#define FLASH_START 0xF000
#define FLASH_END 0xFFAD //Stop before NVTRIM storage
//Compute CRC of upper FLASH
crc.word = 0xFFFF; //Seed
addr.word = FLASH_START - 0x0100; //Start, pre-subtract extra hi-byte inc
do{
__RESET_WATCHDOG(); //Kick the Dog about every ms
++addr.byte.hi;
do{ //Bytewise CRC, about 5uS/byte!
i = *((u8_t *)(addr.word)) ^ crc.byte.hi;
crc.byte.hi = crc.byte.lo;
crc.byte.lo = i;
crc.byte.lo ^= crc.byte.lo >> 4;
crc.byte.hi ^= crc.byte.lo << 4;
crc.word ^= crc.byte.lo << 5;
}while( (addr.word <= FLASH_END) && (++addr.byte.lo != 0) );
//go 256 bytes at a time
}while(addr.word <= FLASH_END); //Until the end
//crc.word better end up zero!
This goes in conjuction with a linker block in the prm file:
CHECKSUM
CHECKSUM_ENTRY METHOD_CRC_CCITT
OF READ_ONLY 0xF000 TO 0xFFAB
INTO READ_ONLY 0xFFAC SIZE 2
UNDEFINED 0xFF
END
END