Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!lll-lcc!mordor!styx!ames!cit-vax!elroy!smeagol!usc-oberon!bacall!papa
From: papa@bacall.UUCP (Marco Papa)
Newsgroups: comp.sys.amiga
Subject: Re: MANX bugs with Tasking (the REAL fix)
Message-ID: <2241@bacall.UUCP>
Date: Sun, 28-Dec-86 02:26:02 EST
Article-I.D.: bacall.2241
Posted: Sun Dec 28 02:26:02 1986
Date-Received: Mon, 29-Dec-86 21:43:38 EST
References: <2226@bacall.UUCP> <865@ulowell.UUCP>
Organization: CS&CE Depts, U.S.C., Los Angeles, CA
Lines: 48

> In article <2233@bacall.UUCP> papa@bacall.UUCP (Marco Papa) writes:
> >> > >>Has anybody gotten tasking to work with MANX? [...cut]
> >> > >>-- Marco Papa
> >
> >Phillip Lindsay writes: 
> >> This is a problem related to the A4 register used as a base register, I believe
> >> the problem is apparent in the small-code/data models and not in large code/data
> >> models. (ie. "cc +cd foo.c" will compile using large models) 
> >> 
> >> In the interest of people screaming about Manx and tasks I make the following
> >> re-posting from well!crunch: (I don't think crunch and manx will mind...)
> >> 
> >> AMIGA-MANX-FIX follows
> >

Paul Higginbottom writes:
> 
> This fix wasn't quite right since (at least under 3.30e) the front end
> already contains a geta4() routine and saves a4 off automatically.
> By front end I mean crt0.a68 which is linked in the front of every C
> program written (along with _main.c).
> 
> So, all you need to do is:
> 
> 	geta4();
> 
> as the first thing in your task.
>

I have both 3.20a and 3.30e and Paul fix is definetely right: All in all:

1. If you have MANX 3.20a you need to call sava4() before calling CreateTask
   or Addtask(), and call geta4() as the first instruction of the child task.
   You also have to compile the source from Phil, since this is not available
   in the librariy. 

2. If you have MANX 3.30e or later, you do not have to call sava4(), but still
   have to call geta4() in the subtask.  This time do not include any code,
   since geta4() is included in the library.

Hopefully all of this is going to be well explained in the new MANX 3.40
manual.  Gee, I did not know that I would ahve opened such a can of worms with
my original posting.  Now everybody knows how to do tasks (with 
MANX, Lattice or your favourite compiler).

  -- Marco Papa
     Felsina Software