Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!comp.vuw.ac.nz!windy!srwmcln From: srwmcln@windy.dsir.govt.nz Newsgroups: comp.sys.amiga.programmer Subject: Re: Help! (AmigaDOS CreateProc/LoadSeg) Message-ID: <18856.27dfb380@windy.dsir.govt.nz> Date: 14 Mar 91 17:31:44 GMT References: <63329@eerie.acsu.Buffalo.EDU> <19578@cbmvax.commodore.com> <06417.AA06417@babylon.rmt.sub.org> Organization: DSIR, Wellington, New Zealand Lines: 25 In article <06417.AA06417@babylon.rmt.sub.org>, rbabel@babylon.rmt.sub.org (Ralph Babel) writes: > In article <19578@cbmvax.commodore.com>, > ken@cbmvax.commodore.com (Ken Farinsky - CATS) writes: > >> LoadSeg() needs a BPTR to a seg list, which can be faked >> like: >> >> /* From Mike Sinz AmigaMail example */ >> struct CodeHdr >> { >> ULONG SegSize; /* sizeof(struct CodeHdr) */ >> ULONG NextSeg; /* Must be NULL */ >> UWORD JumpInstr; /* set to 0x4EF9 (a jump instruction) */ >> APTR Function; /* a pointer to the function */ >> } > > I'd call this self-modifying code. > > Ralph This not self modifing code, it is one piece of code CREATING another new codesegement. Such things may cause a little trouble with D and I caching, without help from the OS, but it is not one code segement modifying it's self or another preexisting code segement. Clive.