Original Post
Let us pretend that we have a program that is able to create new code while it is being executed. The question I have is how would you get the newly generated code to acctually execute? My best guess would be to load the new code into a block of memory and use assembly to jump to that memory location. I would also guess that it would need to only try to run small self contained blocks of code at one time. How could branching code be handled since you do not know which block of code to generate until it is acctually run? How would you go about jumping back into the main program once each block has finished? Thanks in advance, and I hope this all makes sense :D