Declare a pointer to a specific address

Technical Note 98587

Architectures:

8051

Component:

compiler

Updated:

2015/11/6 12:32

Introduction

This Technical Note shows examples for IAR Embedded Workbench for 8051 on how to declare a pointer to a specific address.

#define my_xdata (* (char xdata *) 0xXXXX)
/* points at a char object located in XDATA*/

Keywords formula:

#define ptrname (* (char points_at *) valid_address)

/* Declare a static pointer to a specific address */
static int *iptr = (int *)0xXXXX; /* iptr points at 0xXXXX */
*iptr = 35; /* 0xXXXX is assigned a value */

Keywords formula:

static int * ptrname = (int *) valid_address

All Product names are trademarks or registered trademarks of their respective owners.

很抱歉,该页面尚未翻译成中文。

如果您有任何问题,请联系我们的中国团队

We do no longer support Internet Explorer. To get the best experience of iar.com, we recommend upgrading to a modern browser such as Chrome or Edge.