home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!smurf.sub.org!easix!dino.dinoco.de!quax.GUN.de!peti.GUN.de!simons
- From: simons@peti.GUN.de (Peter Simons)
- Message-ID: <5f1.ANN@peti.GUN.de>
- Date: Thu, 10 Dec 1992 01:17:02 CET
- Organization: * Private Amiga Site Bonn - Member of Individual Network e.V. *
- Newsgroups: comp.sys.amiga.programmer
- Distribution: world
- Subject: Re: Using CreateNewProc()
- References: <1992Dec4.182142.11861@cci632.cci.com>
- X-Newsreader: Ann 0.10
- Lines: 76
-
- In article <1992Dec4.182142.11861@cci632.cci.com>,
- den@cci632.cci.com (Dennis J. Buttery) writes:
-
- > I am writing a program that needs to be able to spawn child processes
- > asynchronously. I have been attempting to use LoadSeg() and CreateNewProc()
- > to accomplish this with no luck. I have followed examples in the RKM's for
- > using these functions, but can't seem to get it to work properly. [...]
- >
- > Can anyone explain how this is supposed to work, or maybe provide some
- > example code if possible?!?!?
-
- Okay, here comes some example code in assembly-language. Of course you have
- to add the right include-files, but I can't say from memory which ones the
- codes needs, because I have them all preassembled in one file. :-)
-
- I hope it hepls... Peter
-
- ;--------------------------------- cut here -------------------------------
- START: lea dosname(PC),a1
- moveq #KICKVERSION,d0
- move.l ($4).W,a6
- jsr _LVOOpenLibrary(a6)
- tst.l d0
- beq.s .exit
- move.l d0,a6
-
- lea file(PC),a0
- move.l a0,d1
- jsr _LVOLoadSeg(a6)
- lea CreateProcTagList(PC),a2
- move.l d0,4(a2)
- beq.s .CloseDosLib
-
- jsr _LVOOutput(a6)
- move.l d0,12(a2)
- beq.s .CloseDosLib
- lea parameters(PC),a0
- move.l a0,20(a2)
- lea procname(PC),a0
- move.l a0,28(a2)
- move.l a0,36(a2)
-
- move.l a2,d1
- jsr _LVOCreateNewProc(a6)
-
- .CloseDosLib move.l a6,a1
- move.l ($4).W,a6
- jsr _LVOCloseLibrary(a6)
-
- .exit moveq #0,d0
- rts
-
-
- dosname dc.b "dos.library",0
- file dc.b "C:DME",0
- parameters dc.b "INCLUDES:Dos/Dostags.i",0
- procname dc.b "Dillon's Editor-Process",0
-
- CNOP 0,4
- CreateProcTagList:
- dc.l NP_Seglist,0
- dc.l NP_Output,0
- dc.l NP_Arguments,0
- dc.l NP_Name,0
- dc.l NP_CommandName,0
- dc.l NP_CloseOutput,DOSFALSE
- dc.l NP_Cli,DOSTRUE
- dc.l NP_FreeSeglist,DOSTRUE
- dc.l TAG_DONE
- ;--------------------------------- cut here -------------------------------
-
- --
- ____ ____ ____
- /___ /__ /\ / / INTERNET: simons@peti.GUN.de
- ____//___ / \/ / FIDONET: 2:242/7.25
- to you by Peter Simons VOICE: 0228 / 746061
-