From mboxrd@z Thu Jan 1 00:00:00 1970 From: jon@fourwinds.com (Jon Steinhart) Date: Fri, 24 Nov 2017 13:50:17 -0800 Subject: [TUHS] Harvard and Von Neumann Architectures and Unix In-Reply-To: <20171124214342.A4A8818C0D0@mercury.lcs.mit.edu> References: <20171124214342.A4A8818C0D0@mercury.lcs.mit.edu> Message-ID: <201711242150.vAOLoHCg026295@darkstar.fourwinds.com> Noel Chiappa writes: > The thing is that self-modifying code is pretty much an artifact of the dawn > of computers, before the economics of gates moved from that of tubes, to > transistors, and also before people understood how important good support for > subroutines was. (This latter is a reference to how Whirlwind did subroutines, > with self-modifying code.) Once people had index registers, and lots of > registers in general, self-modifying code (except for a few small, special > hacks like bootstraps which had to fit in tiny spaces) became as dead as the > dodo. > > It's just a Bad Idea. The one practical and Good Idea place for self-modifying code that I encountered was the software implementation of floating-point for 516-TSS runnning on the Honeywell 516. Our code modified the count in the shift instructions for normalization. Any other approach would have involved looping. Granted, an instruction set that took the shift count from a separate register would have made this unnecessary but that's not what the 516 had. Jon