首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

code warrior hc08 C语言的两个小问题请教[讨论]

code warrior hc08 C语言的两个小问题请教[讨论]

看例程在PRM文件中经常有STACKSIZE 0x30,这个堆栈尺寸是怎样计算出来的,一定要用户指定嘛?
#pragma DATA_SEG BUFFER
unsigned char near VarA;
near在这里是什么意思?
liu1234就是我,欢迎访问我的博客http://www.mcublog.com/blog.asp?name=liu1234
顶鼎
liu1234就是我,欢迎访问我的博客http://www.mcublog.com/blog.asp?name=liu1234
堆栈是临时变量、中断、函数调用时用的,根据你的程序自己确定,太少的话会引起程序跑飞。太多的话浪费。
可以到这里下载资料,有用户手册,教程和技术笔记(Technical Notes):
http://www.metrowerks.com/MW/Support/dev_resources/Documentation_for_HC08_3.0.htm
海纳百川  有容乃大
我指导了
L1201: No stack defined
[DISABLE, INFORMATION, WARNING, ERROR]
Description
The PRM file does not contains any stack definition. In that case it is the programmer responsibility to initialize the stack pointer inside of his application code. The stack can be defined in the PRM file in one of the following way: Trough the STACKTOP command in the PRM file. Trough the STACKSIZE command in the PRM file. Trough the specification of the section .stack in the PLACEMENT block.
Example
^
WARNING: No stack defined
LINK  fibo.abs
NAMES fibo.o startup.o END

SEGMENTS
   MY_RAM = READ_WRITE 0x800 TO 0x80F;
   MY_ROM = READ_ONLY 0x810 TO 0xAFF;
END
PLACEMENT
   .text     INTO MY_ROM;
   .data     INTO MY_RAM;
END
/* Set reset vector on _Startup */
VECTOR ADDRESS 0xFFFE _Startup


Tips
Define the stack in one of the three way specified above. Note: If the customer initializes the stack pointer inside of his source code, the initialization from the linker will be overwritten.
liu1234就是我,欢迎访问我的博客http://www.mcublog.com/blog.asp?name=liu1234
返回列表