home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: sparky!uunet!mcsun!Germany.EU.net!mpifr-bonn.mpg.de!specklec.mpifr-bonn.mpg.de!mlelstv
- From: mlelstv@specklec.mpifr-bonn.mpg.de (Michael van Elst)
- Subject: Re: Hey Commodore types
- Message-ID: <1992Jul23.103350.14923@mpifr-bonn.mpg.de>
- Sender: news@mpifr-bonn.mpg.de
- Nntp-Posting-Host: specklec
- Organization: Max-Planck-Institut f"ur Radioastronomie
- References: <paulk.0k1w@terapin.com> <1992Jul14.014115.6212@agora.uucp> <1992Jul14.182841.5792@ultb.isc.rit.edu> <1992Jul15.023355.1552@agora.uucp> <1992Jul15.114615.25849@mpifr-bonn.mpg.de> <1992Jul22.151307.1736@sagpd1>
- Date: Thu, 23 Jul 1992 10:33:50 GMT
- Lines: 36
-
- In <1992Jul22.151307.1736@sagpd1> monty@sagpd1 () writes:
- > I am confused???? You are saying that a function expects a UBYTE so the
- > complier passes an unsigned long???????? and this is correct ?????
-
- > What am I overlooking here, do all amiga compliers always pass longs
- > on the stack???
-
- All system calls do not expect anything on the stack but data gets passed
- in processor registers which are 32bit.
-
- The autodocs tell you that some of the register values are considered
- as UBYTE,UWORD, PLANEPTR or whatever.
-
- The compiler, however generates calls to some stub functions in amiga.lib
- which will pull complete 32bit values from the stack into the correct
- registers and call the system routine.
-
- Under K&R C every integer parameter was pushed as a LONG onto the stack
- anyway. Same for ANSI C if you don't use prototypes. This matches the
- behaviour of the stub routines.
-
- With prototypes however you could end with the compiler pushing words
- or even bytes if the prototype would specify UWORD or UBYTE which is
- of course _not_ what the stub routines await.
-
- If one uses inline library calls with some #pragma construct one could
- argue that the prototypes _can_ specify other types then long (or pointers
- which are also 32bit). But I think that would just lead to confusion
- with uses of amiga.lib.
-
- Regards,
- --
- Michael van Elst
- UUCP: universe!local-cluster!milky-way!sol!earth!uunet!unido!mpirbn!p554mve
- Internet: p554mve@mpirbn.mpifr-bonn.mpg.de
- "A potential Snark may lurk in every tree."
-