STM8 Data @near @tiny definition

Source: Internet
Author: User

always can't remember this: STM8 STVD under

Near equals 51 xdata.

tiny equals 51 of Idata

http://www.waveshare.net/article/STM8-3-1-10.htm

How to assign a variable to a specified address

Example:
unsigned char temp_a@0x00; Defines an unsigned variable temp_a, forcing its address to 0x00
unsigned char temp_b@0x100; Defines an unsigned variable temp_b, forcing its address to be 0x100
@tiny unsigned char temp_c; Defines an unsigned variable temp_c, which is automatically assigned an address by the compiler in RAM with an address less than 0x100
@near unsigned char temp_d; Defines the unsigned variable temp_d, which is automatically assigned an address by the compiler in RAM with an address greater than 0xFF
Alternatively, a pseudo-directive "pragma" can be used to define a function or variable into a specified section, for example:
#pragma section [name]//define the uninitialized variable defined below into the. Name
Unsigned Char data1;
Unsigned int data2;
...... (any variable that needs to be defined in the. Name section)
......
#pragma section []//Return to the normal section.
Note: pragma pseudo-directives can be used to locate functions, initialize variables, or uninitialized variables. The three are distinguished by different parentheses.
(name): Code
[Name]: Uninitialized variable
{Name}: Initialize variable

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.