[comp.sys.amiga.tech] Help spawning a simple task

nsw@cord.UUCP (Neil Weinstock) (12/27/88)

Expires:
References: <644@cord.UUCP> <7070@batcomputer.tn.cornell.edu>
Sender:
Reply-To: nsw@cord.UUCP (Neil Weinstock)
Followup-To: 
Distribution: usa
Organization: The Flying Squid Patrol
Keywords: 

In article <7070@batcomputer.tn.cornell.edu> riley@tcgould.tn.cornell.edu (Daniel S. Riley) writes:
>In article <644@cord.UUCP> nsw@cord.UUCP (Neil Weinstock) writes:
>>I've been unsuccessfully trying to spawn a task.  As soon as I call AddTask()
>>I get a visit from the Guru.  I have been using the RKM (volume I, page 17)
[ ... ]
>First, remember that the usual Manx startup code is not run before your
>entry point.  None of the registers will be setup the way you expect,
>particularly a4, so you have to compile with absolute addressing, or
>else somehow get a4 setup with the right base address (I'm a little vague
>here because I'm a Lattice user...sorry).  Remember, this is an entire
>separate task you're setting up, with very little inherited from the 
>parent.

Bingo.  In fact, the Manx geta4() call turned out to be the fix (thanks Ali!).

"When all else fails, read the man(x)ual."

>Second, Tasks cannot call DOS routines.  Only processes can.  Delay()
                                                               ^^^^^^^
>is a DOS routine, so your call to Delay() in EntryPoint() is definite
 ^^^^^^^^^^^^^^^^

Wow, I had no idea, and confirmed by the RKM no less.  What's Delay() doing
in dos.library?

+ .- -- .. --. .- .-. ..- .-.. . ... .- -- .. --. .- .-. ..- .-.. . ... +
| Neil Weinstock | att!cord!nsw     | "One man's garbage is another     |
| AT&T Bell Labs | nsw@cord.att.com | man's prune danish." - Harv Laser |
+ .- -- .. --. .- .-. ..- .-.. . ... .- -- .. --. .- .-. ..- .-.. . ... +

andy@cbmvax.UUCP (Andy Finkel) (12/30/88)

In article <645@cord.UUCP> nsw@cord.UUCP (Neil Weinstock) writes:
>
>Wow, I had no idea, and confirmed by the RKM no less.  What's Delay() doing
>in dos.library?
>

Delay() is just a call on the timer.device.  You can call the timer.device
itself from a task to get the same effect.

-- 
andy finkel		{uunet|rutgers|amiga}!cbmvax!andy
Commodore-Amiga, Inc.

"Possibly this is a new usage of the word 'compatible' with which
 I was previously unfamiliar"

Any expressed opinions are mine; but feel free to share.
I disclaim all responsibilities, all shapes, all sizes, all colors.