News for hackers. Stuff that matters.
Re:Upcoming Book: Compiling to Assembly from Scratch by msla on Friday March 13, 2020 @04:03PM (#22570420)
From a pedagogical standpoint, it's a shame we've effectively lost self-modifying code. It's a very good way to show students that everything the computer does is driven by data, and the only difference between "code" and "data" is interpretation; this is the heart of the stored-program computer, as opposed to things like plugboard systems or adding machines, where the instructions were in hardware and were, therefore, a different kind of thing from the data.

It's also a good introduction to pipelines and caches, when some bright spark tries to modify the next instruction and it "doesn't take" in the way the student expects.

Re:Upcoming Book: Compiling to Assembly from Scratch by chrisseaton on Friday March 13, 2020 @04:20PM (#22570563)
> we've effectively lost self-modifying code

Why do you think we've lost it? You can still write self-modifying code today. You may need to change permissions on the pages if you have a system that doesn't allow both execution and writing at the same time, but that's easy.