Hi,
You can make a project that is configured to run entirely from RAM. This project contains your flasher code and has a jump vector that points to its _Startup() routine. Build it and make from the .abs file an 'unsigned char array'. Put the array into your main project and call a little asm code that looks like this:
// Copy flasher code to RAM and invoke it
asm
{
SEI // Interrupts OFF
LDX #0 // Initialize loop counter
L1: LDAB flashercode,X // Loop: Get one byte from flasher code
STAB $2000,X // ...and store into RAM
INX // Go to next byte
CPX #$1F00 // 0x1f00 bytes transferred?
BLT L1 // No, continue
LDX #0 // Initialize for indirect jump
JMP [$2000,x] // Invoke flasher code, jump to vector at 0x2000
}
It should be assembly which doesn't need the stack because the stack will surely be overwritten...
With this method you can run big programs (depending only on how much RAM your MCU has). Such as my flasher code, which reads S-records from FAT-formatted compact flash memory cards and re-programs an HCS12XA256...
Hope that helps a little,
pittbull