21ic电子技术开发论坛 单片机与嵌入式系统 侃单片机论坛 下面的小程序错在那里,
发新帖我要提问
返回列表
打印

下面的小程序错在那里,

[复制链接]
1271|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
CHUANDAOXY|  楼主 | 2007-3-13 14:21 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
#include<reg51.h>
#include<stdio.h>

我想在内部ram里建立数组,连续的指定地址,例如在内部地址0x30-0x35,存进
a,b,c,d,e,f,下面的程序怎末改呢

struct link  {
   struct link idata *next;
  char        code  *text;
};

struct link list idata _at_ 0x40;     /* list at idata 0x40 */
char xdata text[256]   _at_ 0xE000;   /* array at xdata 0xE000 */
int xdata i1           _at_ 0x8000;   /* int at xdata 0x8000 */

void main ( void ) {
  link.next = (void *) 0;
  i1        = 0x1234;
  text [0]  = 'a';
}

相关帖子

沙发
ayb_ice| | 2007-3-13 16:32 | 只看该作者

随便说说

方法有很多,下面是一种.

         #define U8I unsigned char idata

    U8I buf[6] _at_ 0x30;
    U8I *pi;

    pi = (U8I*)0x30;
    pi[0] = 'a';
    pi[1] = 'b';
    pi[2] = 'c';
    pi[3] = 'd';
    pi[4] = 'e';
    pi[5] = 'f';

使用特权

评论回复
板凳
usbmcu| | 2007-3-13 22:43 | 只看该作者

路过

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

843

主题

1029

帖子

4

粉丝
关闭 热门推荐
快速回复 在线客服 返回列表 返回顶部