diff --git a/examples/self_modify_code/self_modify_code.c b/examples/self_modify_code/self_modify_code.c index 40f0940764fa2271ea64fedc95946857a2d70df5..bad54d8a01f208ee999f0f42b1d9366022e16154 100644 --- a/examples/self_modify_code/self_modify_code.c +++ b/examples/self_modify_code/self_modify_code.c @@ -22,6 +22,7 @@ uint32_t ReadCSRSelfModify( uint16_t whichcsr ) // instructions in this way. Otherwise, the compiler will try // to optimize the code and inline the assembly int something where // our global handle into assembly code becomes meaningless. + // Annoyingly, it has to contain at least one instruction :( asm volatile( "nop" ); // 000026f3 is csrrs a3, 0x000, x0; So, we modify it, placing the