[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cc65 / ca65: how to interface C and assembly?
- Subject: Re: cc65 / ca65: how to interface C and assembly?
- From: Oliver Schmidt <ol.sc@web.de>
- Date: Sun, 11 Dec 2005 12:39:03 +0100
- Newsgroups: comp.sys.apple2
- Organization: 1&1 Internet AG
- References: <4395b60d$0$9636$9b4e6d93@newsread2.arcor-online.net> <dn51pv$r7h$1@moppi.musoftware.de> <43961c5c$0$9651$9b4e6d93@newsread2.arcor-online.net>
- Xref: g2news1.google.com comp.sys.apple2:7341
Hi,
>> A second reason is that
>> the inline assembler code is processed by the the optimizer, ...
>Being processed by the optimizer pretty much rules out using inline
>assembly I fear, ...
Not really. cc65 supports a pragma to control optimization on a
function level granularity. Something like this works nicely and is
used successfully i.e. in the Contiki sources.
#pragma optimize(push, off)
void foo(void)
{
asm("...");
asm("...");
}
#pragma optimize(pop)
Best, Oliver