Self modifying code, lambda calculus - Re: ENIAC programming

Paul Koning paulkoning at comcast.net
Thu Sep 17 20:09:29 CDT 2015


> On Sep 17, 2015, at 5:52 PM, Jay Jaeger <cube1 at charter.net> wrote:
> 
> On 9/17/2015 2:27 PM, Paul Koning wrote:
>> 
>>> On Sep 17, 2015, at 2:56 PM, dwight <dkelvey at hotmail.com> wrote:
>>> 
>>> What is the definition of self modifying?
>>> Is it changing an instruction to execute in the thread to be run?
>>> How about adding or subtracting something to be done in an execution
>>> queue?
>> 
>> I'm not sure if there is a universally agreed to definition.
>> 
>> It also matters why the question is asked.  I can think of a couple of answers:
>> 
>> 1. the contents of instruction memory is subject to change.
>> 
>> 2. the contents of instruction memory is subject to change during execution of the program.
>> 
>> 3. individual instructions in a program are changed by the execution of that program.
>> 
>> 4. individual instructions in a program are changed by explicit data manipulation actions of that program.
>> 
>> #1 is true for most computers past and present, because they allow a program to be loaded into memory from external storage.
>> 
>> #2 is true in any program that uses overlays, or if the program is controlled by a debugger that uses "software breakpoints".
> 
> Don't / didn't some machines do/did this by setting an address trap
> register rather than modifying the breakpointed instruction?

Yes, that's why I said "software breakpoints", meaning breakpoints created by replacing the instruction with a break instruction, as opposed to "hardware breakpoints" which use address trap instructions.  Perhaps that's not universal terminology, but it's what GDB calls these things.  

> 
> Also, if the machine had explicit handling of overlays/segments, then
> that part of this becomes identical to #1.  (Burroughs?)

Or it's outside the picture entirely.  I was thinking of virtual address space here.  If you have paging or the like with physically addressed caches, then those are part of #1, yes.

	paul



More information about the cctalk mailing list