home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / amiga / programm / 17252 < prev    next >
Encoding:
Internet Message Format  |  1992-12-11  |  3.1 KB

  1. 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
  2. From: simons@peti.GUN.de (Peter Simons)
  3. Message-ID: <5f1.ANN@peti.GUN.de>
  4. Date: Thu, 10 Dec 1992 01:17:02 CET
  5. Organization: * Private Amiga Site Bonn - Member of Individual Network e.V. *
  6. Newsgroups: comp.sys.amiga.programmer
  7. Distribution: world
  8. Subject: Re: Using CreateNewProc()
  9. References: <1992Dec4.182142.11861@cci632.cci.com>
  10. X-Newsreader: Ann 0.10
  11. Lines: 76
  12.  
  13. In article <1992Dec4.182142.11861@cci632.cci.com>,
  14.         den@cci632.cci.com (Dennis J. Buttery) writes:
  15.  
  16.  >    I am writing a program that needs to be able to spawn child processes
  17.  > asynchronously.  I have been attempting to use LoadSeg() and CreateNewProc()
  18.  > to accomplish this with no luck.  I have followed examples in the RKM's for
  19.  > using these functions, but can't seem to get it to work properly. [...]
  20.  >
  21.  >    Can anyone explain how this is supposed to work, or maybe provide some
  22.  > example code if possible?!?!?
  23.  
  24. Okay, here comes some example code in assembly-language. Of course you have
  25. to add the right include-files, but I can't say from memory which ones the
  26. codes needs, because I have them all preassembled in one file. :-)
  27.  
  28. I hope it hepls... Peter
  29.  
  30. ;--------------------------------- cut here -------------------------------
  31. START:          lea     dosname(PC),a1
  32.                 moveq   #KICKVERSION,d0
  33.                 move.l  ($4).W,a6
  34.                 jsr     _LVOOpenLibrary(a6)
  35.                 tst.l   d0
  36.                 beq.s   .exit
  37.                 move.l  d0,a6
  38.  
  39.                 lea     file(PC),a0
  40.                 move.l  a0,d1
  41.                 jsr     _LVOLoadSeg(a6)
  42.                 lea     CreateProcTagList(PC),a2
  43.                 move.l  d0,4(a2)
  44.                 beq.s   .CloseDosLib
  45.  
  46.                 jsr     _LVOOutput(a6)
  47.                 move.l  d0,12(a2)
  48.                 beq.s   .CloseDosLib
  49.                 lea     parameters(PC),a0
  50.                 move.l  a0,20(a2)
  51.                 lea     procname(PC),a0
  52.                 move.l  a0,28(a2)
  53.                 move.l  a0,36(a2)
  54.  
  55.                 move.l  a2,d1
  56.                 jsr     _LVOCreateNewProc(a6)
  57.  
  58. .CloseDosLib    move.l  a6,a1
  59.                 move.l  ($4).W,a6
  60.                 jsr     _LVOCloseLibrary(a6)
  61.  
  62. .exit           moveq   #0,d0
  63.                 rts
  64.  
  65.  
  66. dosname         dc.b    "dos.library",0
  67. file            dc.b    "C:DME",0
  68. parameters      dc.b    "INCLUDES:Dos/Dostags.i",0
  69. procname        dc.b    "Dillon's Editor-Process",0
  70.  
  71.                 CNOP 0,4
  72. CreateProcTagList:
  73.                 dc.l    NP_Seglist,0
  74.                 dc.l    NP_Output,0
  75.                 dc.l    NP_Arguments,0
  76.                 dc.l    NP_Name,0
  77.                 dc.l    NP_CommandName,0
  78.                 dc.l    NP_CloseOutput,DOSFALSE
  79.                 dc.l    NP_Cli,DOSTRUE
  80.                 dc.l    NP_FreeSeglist,DOSTRUE
  81.                 dc.l    TAG_DONE
  82. ;--------------------------------- cut here -------------------------------
  83.  
  84. --
  85.               ____ ____      ____
  86.              /___ /__  /\  /  /    INTERNET: simons@peti.GUN.de
  87.             ____//___ /  \/  /      FIDONET: 2:242/7.25
  88.            to you by Peter Simons     VOICE: 0228 / 746061
  89.