home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!decwrl!contessa!mwm
- From: mwm@contessa.palo-alto.ca.us (Mike Meyer)
- Subject: Re: including 68000 code in C
- Newsgroups: comp.sys.amiga.programmer
- Distribution: world
- References: <1992Aug25.023906.8962@ccu.umanitoba.ca>
- X-NewsSoftware: Amiga Yarn 3.4, 1992/08/12 15:49:52
- Keywords:
- Summary:
- Message-ID: <mwm.1n8r@contessa.palo-alto.ca.us>
- Date: 26 Aug 92 11:24:15 PST
- Organization: Missionaria Phonibalonica
- Lines: 25
-
- In <1992Aug25.023906.8962@ccu.umanitoba.ca>, umfehr06@ccu.umanitoba.ca (John Fehr) wrote:
- > Is there any way to simply insert 68000 code in your C programs? Say I want to
- > put some in a for loop or something.
-
- Not portably; otherwise your Amiga C compiler would have to be able to
- deal with 8086 assembler. However, most compilers provide some such
- functionality. Under SAS/C, use emit() to insert instructions. Under
- Manx, use #asm. Both of these cripple the optimizer for that function,
- and so should only be used for short functions.
-
- I assume DICE has such functionality, as I've seen Matt use it. I
- don't know how it and the optimizer get along, though. GCC (at least
- with 2.0) should have asm hooks that let you feed the optimizer
- information so it isn't crippled by this process.
-
- I'd avoid this practice if at all possible. If you're doing it for
- speed, encapsulate a large enough chunk into assembler that you can
- call it as a functioon. Be sure and check to see if your compiler
- supports fast calls to asm by passing args in registers, etc.
-
- If you're doing it to do something you can't get to from C, create a
- function that does that, and call it. Again, check to see if your
- compiler supports fast calls to asm.
-
- <mike
-