Hacker News new | ask | show | jobs
by irregularbowels 66 days ago
I had an assembler class back in the mid-90s at college. I discovered the self-modifying code trick while doing an assignment. The program had the desired output, so I turned it in. The professor, who was head of the department at the time, called me into her office.

Professor: "Your code modifies itself. You can't do that here."

Me: "It runs and prints the output the assignment outlined in its instructions. There is nothing on the assignment that says I can't do what I did."

Professor: "OK, but don't do it again."

The next class she announced that any assignment could not modify its own code. Any submissions that did so would be disqualified.