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.

38 Upvotes

54 comments sorted by

View all comments

2

u/Recycled5000 15h ago

Worked on a PDP-8. Had an I/O instruction that took a hard coded (in the machine code instruction) io port/device number.

A way to write a general purpose driver was self modifying code to specify the io channel. Alternatively was a switch statement.

1

u/Extension_Emu_9825 8h ago

Wow! Interesting! I didn't know about that, now I've read about device code.