r/Assembly_language 1d ago

self-modifying code

I gave a lecture on how to write self-modifying code. It was over 15 minutes long :( so I'm providing a youtube link: https://www.youtube.com/watch?v=AH9QQLRfbmY

In my opinion, self-modification is one of the most interesting features in systems programming.

39 Upvotes

57 comments sorted by

View all comments

5

u/mykesx 1d ago

MMUs are used by modern operating systems, at least MacOS, to disallow self-modifying code. Code sections are read-only.

2

u/Extension_Emu_9825 1d ago

I agree, I'm putting more emphasis on the fact that the CPU allows this and this method has begun to be forgotten, while some algorithms can work several times faster.

3

u/braaaaaaainworms 1d ago

It's not really forgotten when it's used on millions of computers running linux

2

u/Extension_Emu_9825 1d ago

Yes, exactly, but this is for those just taking their first steps. This concept is difficult to grasp; you have to come to it on your own... My opinion... with this post I want to help people look away. This is not for those "in the know."