以下是引用shangdawei在2003-5-20 20:04:41的发言: [quote]以下是引用shangdawei在2003-5-19 20:36:12的发言: [原创] C51 函数的绝对定位?我有一个项目,使用 SST89C58 单片机,有 32 KB Flash ROM, 我想用它来做一个 小小的操作系统, 提供 键盘扫描, LCD 显示, 串口通讯等等。这可能用不到 32 KB 内存。 我想用它来加载 存储在 24C512 的应用程序。我使用 64KB 的 XRAM. 我想把程序加载在64KB 中的 高 32 KB 空间。64KB 中的 低 32 KB 空间用作 XRAM. 64KB 中的 最高 4 KB 空间 用作 I/O . 我想在编制程序的时候,在一块连接。 生成代码之后, 分割存放。操作系统 在片内, 应用程序 在片外 IIC 接口的 EEPROM 当中(可能有多个)。 在系统复位之后,生成一个菜单,根据选择,从相应的IIC 接口的 EEPROM 中加载它到XRAM当中,然后运行它。 现在的问题是:如何让应用程序 代码定位在 08000H 开始呢 ? 如何让操作系统 代码定位在 00000H 开始呢 ? 本系统采用 冯诺依曼体系 , 使用 /PSEN and /RD 信号读取 代码和数据。 恳请各位朋友帮忙解决这个问题。 我打算使用 Keil C51 编制程序。 QUESTION Is there a way to use wildcards in the CODE and XDATA directives in the BL51 linker? ANSWER Yes. In C51 V6.01, wildcard support was added to BL51 for the segment location directives (CODE, XDATA, DATA, and so on). For example: BL51 myfile.obj CODE (?pr?*?myfile (0x100)) ------------------------------------------------------------------------------------- |
参见
-------------------------------------------------------------------------------------
BL51: LOCATING FUNCTIONS AT ASCENDING ADDRESSES
QUESTION
When I link my C51 application I would like to locate the functions in a source module in ascending order starting at a specific address. I know I can use the linker CODE directive to do this for each individual function, but can I do it for all the functions in a module?
ANSWER
No. This is not possible with C51 Version 5. It has been added in C51 V6.01. Refer to BL51: USING WILDCARDS IN SEGMENT NAMES for more information.
-------------------------------------------------------------------------------------
发表时间:2003年5月20日20:06:40