Newsgroups: comp.sys.amiga.programmer,amiga.welmat Path: utzoo!utgpu!cunews!micor!latour!latour!mcr From: mcr@Sandelman.OCUnix.On.Ca (Michael Richardson) Subject: Re: Starting another copy of your own code (was Re: Help! (AmigaDOS CreateProc/LoadSeg) Message-ID: <1991Mar14.203146.20908@Sandelman.OCUnix.On.Ca> Followup-To: comp.sys.amiga.programmer Sender: mcr@Sandelman.OCUnix.On.Ca (Michael Richardson) Organization: Sandelman Software Works, Debugging Department, Ottawa, ON References: <18cb4d63.ARN0b56@swinjm.UUCP> <1991Mar9.170859.4810@Sandelman.OCUnix.On.Ca> <06493.AA06493@babylon.rmt.sub.org> Date: Mon, 11 Mar 1991 01:27:00 GMT In article <06493.AA06493@babylon.rmt.sub.org> cbmvax.commodore.com!cbmehq!babylon!rbabel (Ralph Babel) writes: >In article <1991Mar9.170859.4810@Sandelman.OCUnix.On.Ca>, >mcr@Sandelman.OCUnix.On.Ca (Michael Richardson) writes: > >> Please suggest an alternative to doing this. > >Simply use a function entry that is longword-aligned, e.g. >an assembly language stub after a "CNOP 0,4" or the first >(C-) function in an object module, and convert it to a >seglist: > >void (*pfv)(void); >BPTR sl; > >sl = (BPTR)(((ULONG)pfv >> 2) - 1); Thank you. This had not occured to me, and I'm a little hesistant about it. We shall try this. >> CopyMem(&template, fakelist, sizeof(struct PhonySegList)); >> fakelist->psl_EntryPoint = SlaveStart; > >Sorry, self-modifying code. Even if Leo did it. :-) No dispute about it being not exactly kosher. I had assumed that the first long word (which was NULL, the next pointer) was used in some way. Probably we'll wind up assembling a short assembly program to 'jmp' to the right place rather than depend on the function being first. Actually, we are probably going to pull the two processes into seperate binaries. It will allow a lot more customization. (And a lot more user confusion :-) -- :!mcr!: | The postmaster never | - Pay attention only Michael Richardson | resolves twice. | to _MY_ opinions. - HOME: mcr@sandelman.ocunix.on.ca + Small Ottawa nodes contact me Bell: (613) 237-5629 + about joining ocunix.on.ca! -- :!mcr!: | The postmaster never | So much mail, Michael Richardson | resolves twice. | so little time. HOME: mcr@sandelman.ocunix.on.ca Bell: (613) 237-5629 Small Ottawa nodes contact me about joining ocunix.on.ca!