Path: utzoo!utgpu!watmath!clyde!att!ucbvax!hplabs!pyramid!cbmvax!jesup From: jesup@cbmvax.UUCP (Randell Jesup) Newsgroups: comp.sys.amiga Subject: Re: Bug in 1.3 ChangeTaskPri Message-ID: <5408@cbmvax.UUCP> Date: 2 Dec 88 19:27:17 GMT References: <5758@louie.udel.EDU> Reply-To: jesup@cbmvax.UUCP (Randell Jesup) Organization: Commodore Technology, West Chester, PA Lines: 42 In article <5758@louie.udel.EDU> iphwk%MTSUNIX1.BITNET@cunyvm.cuny.edu (Bill Kinnersley) writes: >INITIAL ENVIRONMENT > > d0 - amount of global area currently in use > d1-d4 - up to 4 parameters. Further parameters can be passed on > the stack > d5-d7 - unused > a1 - base of the current BCPL stack frame > a2 - pointer to the BCPL Global Vector > a3 - return address of the caller > a4 - entry address > a5 - pointer to a "caller" service routine > a6 - pointer to a "returner" service routine > a7 - stack for temporaries > > This register environment is available to any application >program. However if you're programming in C, the startup code supplied >by your linker generally ignores the initial register contents and >eventually they get overwritten. > >The parameters passed by the CLI to an application are: > d0 - length of command line > a0 - APTR to command line >The command itself may be found in the CLI->cli_Command field. Two items >are available on the stack: pointers to the top and the bottom of the >stack that was allocated. URK! Do NOT take advantage of these things (which I do NOT guarantee to be correct) if you want your programs to work in the future! These are side effects of the current BCPL CLI, and may not be the same for any future CLI, or even current shells. My shell, for one, does NOT set up everything you mentioned! Even WB startups are likely to be different! The _only_ things you should rely on are d0 = length of command line, a0 = CPTR to command line, and a7 = stack pointer. Unless you LIKE BCPL, don't try to tie our hands in removing it! -- You've heard of CATS? Well, I'm a member of DOGS: Developers Of Great Software. Randell Jesup, Commodore Engineering {uunet|rutgers|allegra}!cbmvax!jesup