Initialise ams and optionally register an exit handler AMS_INITEH
eh = int (given)
status = int * (given and returned)
Register with msp, obtain the command queue for incoming messages, then create the queues used for this task sending messages to itself.
Finally set up the signal handler if so requested.