Hello,
The HC908QB8 device has ROM base routines available for erasing and programming flash. You will probably want to use these because it simplifies the coding. The 'QB8 device is specifically covered by AN2635.
To clarify Peg's response, the first forum link refers to 9S08 devices, which require a different process. Whereas, the second forum link applies to HC908GP32 device that does not have the in-built ROM routines. Similarly with AN2183.
Some other application notes, that refer to use of the ROM routines, to add to the list -
AN2504
AN2874
Regards,
Mac