Skip to main content
Visitor II
May 25, 2007
Question

inline assembly Cosmic

  • May 25, 2007
  • 4 replies
  • 1063 views
Posted on May 26, 2007 at 00:00

inline assembly Cosmic

    This topic has been closed for replies.

    4 replies

    jasonnganAuthor
    Visitor II
    May 25, 2007
    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

    }

    jasonnganAuthor
    Visitor II
    May 25, 2007
    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''

    Visitor II
    May 25, 2007
    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)

    jasonnganAuthor
    Visitor II
    May 25, 2007
    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