[inforoots] bits again

Michael Albaugh m.e.albaugh at gmail.com
Tue Nov 28 08:55:42 PST 2006


On 11/28/06, Hans Neukom <hans.neukom at hispeed.ch> wrote:

> Regarding Niels Ole Finnemann's question on Self Modifying Code:
>
> "If I may add a question I would ask: who then was first referring to or to
> practise Self Modifying code - and on which machine?"
>
> This will depend on how you define "self modifying". If you include under
> such a definition the capability to change the sequence of a stored program
> depending on intermediate calculation results, the ENIAC would be a
> contender in its later life after it had been modified to run a stored
> program using what was called the "ENIAC Converter Code" in early 1948. This
> converter code (instruction set) included conditional jump instructions and
> the means to branch to a subroutine and back.

I think this is one aspect, but not the one he is looking for (if I
may presume).
There is a continuum of at least three steps:

1) A machine with separate program and data storage (e.g. ENIAC
   or Z3) with the ability to branch, possibly also subroutine-call.
   such a machine can modify its behavior, but not (really, IMHO)
   its program.

2) The machine of (1), running a program which is an interpreter,
   thus a "virtual machine". The virtual program may allow capabilities
   of the next two types, but I contend it is that virtual machine,
   not the "bare iron", that is using self-modifying code. I believe
   someone wrote such a program for Z3, but quite recently, and
   running, of course, on a _simulated_ Z3.

3) A machine that can alter parts of its instructions (e.g. VonNeumann's
    machine, never built as far as I know), to affect array reference,
   subroutine call (or more exactly, _return_ :-), etc. Not so interesting
   to me, but a step.

4) A machine that can "write new code", including new tests, new functions,
    etc. This covers most machines from EDSAC through the present, as
   the present machines ar etypically used, but e.g. most non-x86 machines,
   and newer x86, can prohibit the use of this feature to normal programs,
   in the attempt to curb malware. It is this level of machine that enables
   extensible languages without the "virtual machine" interpreter. powerful,
   dangerous, stuff.

  Mike



More information about the inforoots mailing list