cancel
Showing results for 
Search instead for 
Did you mean: 

inline assembly Cosmic

jasonngan
Associate II
Posted on May 26, 2007 at 00:00

inline assembly Cosmic

4 REPLIES 4
jasonngan
Associate II
Posted on May 25, 2007 at 02:45

I am converting the inline assembly from Metrowerks to Cosmic.

When i compile the following code, the compiler has error massage, bad addressing mode.

how could i modify the code ,please?

void abc()

{

unsigned char free_byte;

#asm

_free_byte :equ abc$L

#endasm

#asm

DEC _free_byte

#endasm

}

jasonngan
Associate II
Posted on May 25, 2007 at 04:34

Sorry for I did not mention where occur error in source code!

The error occur at ''DEC _free_byte''

luca239955_st
Associate III
Posted on May 25, 2007 at 05:31

there's no access to local objects with inline assembler in Cosmic.

If you explain clearly what you are trying to achieve, it's very likely that there's a way to do it properly in C.

Regards,

Luca (Cosmic)

jasonngan
Associate II
Posted on May 26, 2007 at 00:00

Thank you for your help! Because I have to convert the source code from Metrowerks to Cosmic. The inline assembly under Metrowerks calls the local objects. The objects must be in local object because of the ram limitation. :D