🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #1740

Re: CreatePort() help

#1740
From: Michael Sinz - CATS
Date: Thu, 19 Oct 1989 20:02
49 lines
2423 bytes
In article <1448@ultb.UUCP> gxr2848@ultb.UUCP (G.X. Roberts ) writes:
>
>  Hi Netland,
>	I have a question for all you fellow techies.  I would like to
>    create my own MsgPort via the Exec.  However, I want to do it in assembler
>    I know that the CreatePort() function exists, but only in the link
>    library. (ie. it's not a REAL rom routine.)  So, I am trying to get
>    its equivalent.  I am currently doing something like the following:
>
>     1) Allocate a hunk of memory MP_SIZE big.

This works best if you make sure it is MEMF_PUBLIC | MEMF_CLEAR

>
>     2) set the LN_NAME to point to my name.

If your program exits without removing the port, is important to allocate
memory for and copy the name.

>     3) set the LN_PRI to 0

You also need to allocate a signal (if you are to be able to signal the
task on receipt of a message.

If you use signals you need to set the mp_Flags to PA_SIGNAL
If you do not use signals you will need to set it to PA_IGNORE

You also need to set ln_Type to NT_MSGPORT.

You need to set the mp_SigTask to your task structure.  (A pointer)

Now you can AddPort()   Note that if your port is not to be public
(that is for other tasks to find) it would be best to just do a
NewList() of the mp_MsgList (the message list header for the port)

>
>     4) Call AddPort()
>

[deteted rest]


/----------------------------------------------------------------------\
|      /// Michael Sinz -- CATS/Amiga Software Engineer                |
|     ///  PHONE 215-431-9422  UUCP ( uunet | rutgers ) !cbmvax!mks    |
|    ///                                                               |
|\\\///          When people are free to do as they please,            |
| \XX/                they usually imitate each other.                 |
\----------------------------------------------------------------------/
Technical Details
Message-ID: <8225@cbmvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!wuarchive!brutus.cs.uiuc.edu!lll-winken!uunet!cbmvax!mks
References: <1448@ultb.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!wuarchive!brutus.cs.uiuc.edu!lll-winken!uunet!cbmvax!mks
From: mks@cbmvax.UUCP (Michael Sinz - CATS)
Newsgroups: comp.sys.amiga.tech
Subject: Re: CreatePort() help
Keywords: CreatePort() asm help!
Message-ID: <8225@cbmvax.UUCP>
Date: 19 Oct 89 20:02:27 GMT
References: <1448@ultb.UUCP>
Reply-To: mks@cbmvax.UUCP (Michael Sinz - CATS)
Distribution: comp
Organization: Commodore Technology, West Chester, PA
Lines: 49