Injecting user defined opcode

Mahmood Naderan via gcc-help
Sun Jun 30 09:09:00 GMT 2019

>Again: what did you *intend* to happen?

I want to analyze cpu behavior upon invalid instruction codes for fault tolerance and similar things or rise custom exceptions if instructions other than what I want are going to be executed by cpu. For example, I want limit the cpu to execute only add instruction when I launch my program. I know that is an extreme and unrealistic way but that is an example to show that I want to limit the instructions executed by cpu.

If I can do that, I expected to get some exceptions from cpu that yeah I fetched an opcode which is outside the circle that you have specified.

for this purpose, I inserted one byte 0x00 and I expect the cpu to fetch that byte and say this sound like an add instruction but there is no second byte for that.


More information about the Gcc-help mailing list