It is possible to write a program that modifies itself. Specifically, one part of the program can write to addresses where another part of the program (e.g., a different procedure) is stored. Later on, such a program can execute the modified code (e.g., call the modified procedure). Such programs are called self-modifying programs. Consider a self-modifying program that functions as expected when executed on a system with no caches. We'll refer to this system as S1. Another system, called S2, is identical to S1, except that it has separate instruction and data caches. When the program executes on S2, it produces unexpected results, different from the results produced on S1. A) Explain the reason for incorrect execution on S2
B) We want S2, that includes caches, to execute the program correctly, without requiring any changes to the program. How must S2 be changed to ensure correct execution execution of the self-modifying program?