Hello David, and welcome to the forum.
On this forum, there have been many discussions, and code examples given, pertaining to programming the flash within 9S08 devices, for non-volatile data storage. Such examples should equally apply to the 'QE8 device. I suggest that you use the search engine at the bottom of this page to identify these threads.
During the erase and programming processes, the flash memory becomes inaccessible for some of the time. It is therefore necessary for a portion of the code to be located in RAM. There are two ways of achieving this - using a block of RAM at a fixed location, or using the stack for the RAM based code. The code samples that you will find will be in one category, or the other.
If you do not need to use burst programming mode, the size of the RAM based code can be made significantly smaller.
Regards,
Mac