[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cc65 / ca65: how to interface C and assembly?



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