Skip to main content
Visitor II
October 29, 2004
Question

what is meant by '' @tiny '' instruction

  • October 29, 2004
  • 2 replies
  • 717 views
Posted on October 29, 2004 at 08:37

what is meant by '' @tiny '' instruction

    This topic has been closed for replies.

    2 replies

    raunaqueAuthor
    Visitor II
    October 29, 2004
    Posted on October 29, 2004 at 04:47

    Hi

    i knew to firmware writing . i want to know what does the statement

    @tiny means.

    suppose i define

    #define abc @tiny

    what does this statement actually do ?

    Thanks in Advance

    Ronnie

    Visitor II
    October 29, 2004
    Posted on October 29, 2004 at 08:37

    Hi Ronnie,

    in the Cosmic Compiler the @tiny modifier forces a variable to be explicitely allocated in zero page. In the compiled assembler code this variable will then be addressed in short addressing mode. See also C Cross Compiler User's Guide for ST7 (Cosmic), chapter 3 at Placing DataObjects in Short Range Memory (page 3-13ff).

    - Example:

    @tiny char c_tiny; /* short addressing mode */

    @near char b_near; /* long addressing mode */

    ....

    c_tiny = b_near;

    ....

    b_near = c_tiny;

    ....

    -> Resulting assembler code:

    ....

    F107 c60123 LD A,b_near

    F10a b7C1 LD c_tiny,A

    ....

    F11e b6C1 LD A,c_tiny

    F120 c70123 LD b_near,A

    The @tiny modifier helps you in optimizing your resulting code, especially if you are using bit operations.

    The Metrowerks Compiler uses #pragma directives instead.

    With your #define statement the compiler only substitutes the term @tiny for abc in your program.

    Hope it helps and good luck

    WoRo