2004-10-28 11:37 PM
what is meant by '' @tiny '' instruction
2004-10-28 07:47 PM
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 Ronnie2004-10-28 11:37 PM
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