Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!rice!uupsi!sunic!cs.umu.se!dvljrt From: dvljrt@cs.umu.se (Joakim Rosqvist) Newsgroups: comp.sys.amiga.programmer Subject: Self modifying code Message-ID: <1991May28.120630.10150@cs.umu.se> Date: 28 May 91 12:06:30 GMT References: <5005@orbit.cts.com> Sender: news@cs.umu.se (News Administrator) Organization: Dep. of Info.Proc, Umea Univ., Sweden Lines: 25 Ok, I have heard before that you should not use self modifying code. Can anybody give a good reason for this, besides it being bad programming pratice. I just got the RKM manuals and they only stated "for compatibilty with 010/020/030 etc. don't use selfmodifying code" Could it be that data written to an address that is also in cachememory will update the memory, but not the cache? Consider for instance that I would like to write a fast completely unwinded linedrawing routine and wrote code for drawing one pixel. Then when the program start, I would allocate memory for 320 such routines and putting 320 copies of my routine there. Would this be considered as selfmodifying code, and therefore forbidden? If so, compare it to when the OS is loading a program that contains non-PC relative references to itself which will have to be rewritten depending on the address the code was loaded to. /$DR.HEX$ -------------------------------------------- Email to: dvljrt@cs.umu.se 2 Windows on the screen? Oh no, not me. I just Logout & Go.