Board logo

标题: code warrior hc08 C语言的两个小问题请教[讨论] [打印本页]

作者: liu1234    时间: 2005-7-17 16:10     标题: code warrior hc08 C语言的两个小问题请教[讨论]

看例程在PRM文件中经常有STACKSIZE 0x30,这个堆栈尺寸是怎样计算出来的,一定要用户指定嘛?
#pragma DATA_SEG BUFFER
unsigned char near VarA;
near在这里是什么意思?
作者: liu1234    时间: 2005-7-17 22:45

顶鼎
作者: harbin    时间: 2005-7-18 09:19

堆栈是临时变量、中断、函数调用时用的,根据你的程序自己确定,太少的话会引起程序跑飞。太多的话浪费。
作者: strongchen    时间: 2005-7-18 10:22

可以到这里下载资料,有用户手册,教程和技术笔记(Technical Notes):
http://www.metrowerks.com/MW/Support/dev_resources/Documentation_for_HC08_3.0.htm
作者: liu1234    时间: 2005-7-18 11:16

我指导了
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.




欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0