Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!harpo!ihnp4!inuxc!pur-ee!uiucdcs!uicsl!preece From: preece@uicsl.UUCP Newsgroups: net.lang Subject: Re: Self-modifying code - (nf) Message-ID: <4931@uiucdcs.UUCP> Date: Mon, 16-Jan-84 22:53:32 EST Article-I.D.: uiucdcs.4931 Posted: Mon Jan 16 22:53:32 1984 Date-Received: Wed, 18-Jan-84 06:34:54 EST Lines: 19 #R:fortune:-215700:uicsl:6200007:000:794 uicsl!preece Jan 16 08:21:00 1984 As with most programming tricks, there is nothing that says that self-modifying code HAS to be obscure or hard to understand or even unstructured. The principaly rule must simply be: You must make clear to the reader exactly what you are doing. in the case of self-modifying code this would mean (1) using an appropriate mechanism and (2) providing comments specifying exactly when the modification takes place, what the modification does, and where the code is that performs the modification. In assembly language it would also be nice, where speed permits, to stick an Ascii constant (skipped over in the program flow) at the appropriate place so that the run-time effect is clearly marked (for the benefit of those debugging without source code). scott preece ihnp4!uiucdcs!uicsl!preece