I have studied that it is possible to write values in code memory during the execution time in A51.But when tried the test gets failed.If possible what is the actual procedure to do it?
"If possible" As Hans-Bernhard has explained, it isn't. "what is the actual procedure to do it?" That would depend on your particular hardware configuration, and/or the particular 8051 derivative you are using.