[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Interactive Programming - Self-modifying code




Forwarded message:

> From: Brandon Crosby <[email protected]>
> Subject: Re: [LONG, off-topic]] Interactive Programming
> Date: Mon, 20 Oct 1997 10:22:23 -0500 (CDT)

> > As are some perl programmers.  As both a perl programmer and a lisp
> > programer I have never had the need to use self modifing code.  In fact I
> > would consider haveing to use s-m code as a sine that I have made a
> > mistate in my desinge.

Come on, tell us how you really feel...

What if your design specificaly includes self-modifying code for reasons of
execution speed or some recursive efficiency? Glad to know I don't have to
compete with you on those sorts of jobs...thanks.

> PERL is a pretty high-level language... how do you add sub's after
> running the code?

Well I would include all the possible functions I would need and then keep
some sort of array. Each branch point would depend upon the contents of that
array. When the program starts it would use either some default
configuration or perhaps the 'last-state' of the engine on the previous run.
Then as the contents of the array changed the dynamic configuration of the
sub-routines would change.

Another good mechanism is to store addresses in immediate mode, which means
the address is hard-coded. Then dynamicaly change the contents of the address
of that address. I once wrote a machine code utility that cleared large
blocks of RAM 256 byte pages at a time. Each time the code ran it would go
through and incriment the address stored in that address a fixed amount, the
page size, and then jumped back to the beginning of this single loop. Ran
very quickly. I used it to clear video ram faster than the os functions
could.


    ____________________________________________________________________
   |                                                                    |
   |    The financial policy of the welfare state requires that there   |
   |    be no way for the owners of wealth to protect themselves.       |
   |                                                                    |
   |                                       -Alan Greenspan-             |
   |                                                                    | 
   |            _____                             The Armadillo Group   |
   |         ,::////;::-.                           Austin, Tx. USA     |
   |        /:'///// ``::>/|/                     http://www.ssz.com/   |
   |      .',  ||||    `/( e\                                           |
   |  -====~~mm-'`-```-mm --'-                         Jim Choate       |
   |                                                 [email protected]     |
   |                                                  512-451-7087      |
   |____________________________________________________________________|