Writing MIPS machine instructions and executing them from C
问题 I'm trying to write some self modifying code in C and MIPS. Since I want to modify the code later on, I'm trying to write actual machine instructions (as opposed to inline assembly) and am trying to execute those instructions. Someone told me that it would be possible to just malloc some memory, write the instructions there, point a C function pointer to it and then jump to it. (I include the example below) I've tried this with my cross compiler (sourcery codebench toolchain) and it doesn't