We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
For the test purpose, I want to insert some machine code in my source code? Is it possible?
Thanks, Simon
This should work:
void RunThisWeirdOpCodeJustForCuriosity(void) { __asm { DB XX ; replace XX, YY with some opcode - e.g. undefined :-) for your MCU DB YY } }
Useful to test the trap while attempting to execute an illegal instruction, e.g.
P.S. Keep 2 instructions there to make code aligned at even addresses of your target - C16x needs it.
Regards, Nikolay.
why do you want to test it?
Hello Nikolay,
Thanks! I want these code to test the illegal instruction trap, it works!!