Welcome, Guest. Please login or register.

Author Topic: wb program init in assembler  (Read 5288 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show all replies
Re: wb program init in assembler
« on: March 03, 2003, 02:10:25 PM »
If your task is launched from WB you *MUST* read WBMessage first. And before you exit you reply to this message in Forbid() state.

In short (using pseudo-C) it goes like this:

start:
  wbmsg = NULL;

  task = FindTask(NULL)

 if (task->pr_CLI == 0 )
 {
   WaitPort(&task->pr_MsgPort);
  wbmsg = GetMsg(&task->pr_MsgPort);
 }

 ; your code here

 if ( wbmsg != NULL )
 {
   Forbid();
  ReplyMsg(wbmsg);
 }
 return return_code;

My Amigas: A500, Mac Mini and PowerBook