Using Codewarrior (CW) to program MC68HC908GP32 I noted several "*** illegal opcode" into assembled files (as displayed into CW debug assembly window). The same I noted with the HC08 demo projects of CW. Why this? If the source files are correct, where do they all come from?
Are you certain that the 'illegal opcode' values are in code, and not data structures or variable values?
I have only (1) function in my projects for 908 / 9S08 controllers that intentionally contains an illegal opcode - I use it to force a CPU reset (and thus a system reset) under software control if things get into an invalid or unrecoverable state. My processor initialization is setup so an illegal opcode exception causes the system reset.
Otherwise I don't know why such would be in the code of the project, unless the disassembler was misinterpreting data for for instructions, or had gotten out of synch with what processor it is connected with.