adapted the emulated sample into compiler. to increase readability,
externalized complex injected code pieces into text files. some cleanup.