微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > keil使用详解

keil使用详解

时间:11-09 来源:互联网 点击:

d after processor reset.;; To translate this file use A51 with the following invocation:;; A51 STARTUP.A51;; To link the modified STARTUP.OBJ file to your application use the following; L51 invocation:;; L51 , STARTUP.OBJ ;;------------------------------------------------------------------------------;; User-defined Power-On Initialization of Memory;; With the following EQU statements the initialization of memory; at processor reset can be defined:;; ; the absolute start-address of IDATA memory is always 0IDATALEN EQU 80H ; the length of IDATA memory in bytes.;XDATASTART EQU 0H ; the absolute start-address of XDATA memoryXDATALEN EQU 0H ; the length of XDATA memory in bytes.;PDATASTART EQU 0H ; the absolute start-address of PDATA memoryPDATALEN EQU 0H ; the length of PDATA memory in bytes.;; Notes: The IDATA space overlaps physically the DATA and BIT areas of the; 8051 CPU. At minimum the memory space occupied from the C51 ; run-time routines must be set to zero.;------------------------------------------------------------------------------;; Reentrant Stack Initilization;; The following EQU statements define the stack pointer for reentrant; functions and initialized it:;; Stack Space for reentrant functions in the SMALL model.IBPSTACK EQU 0 ; set to 1 if small reentrant is used.IBPSTACKTOP EQU 0FFH+1 ; set top of stack to highest location+1.;; Stack Space for reentrant functions in the LARGE model. XBPSTACK EQU 0 ; set to 1 if large reentrant is used.XBPSTACKTOP EQU 0FFFFH+1; set top of stack to highest location+1.;; Stack Space for reentrant functions in the COMPACT model. PBPSTACK EQU 0 ; set to 1 if compact reentrant is used.PBPSTACKTOP EQU 0FFFFH+1; set top of stack to highest location+1.;;------------------------------------------------------------------------------;; Page Definition for Using the Compact Model with 64 KByte xdata RAM;; The following EQU statements define the xdata page used for pdata; variables. The EQU PPAGE must conform with the PPAGE control used; in the linker invocation.;PPAGEENABLE EQU 0 ; set to 1 if pdata object are used.PPAGE EQU 0 ; define PPAGE number.;;------------------------------------------------------------------------------

3. 标准输入输出文件

putchar.cputchar.c是一个低级字符输出子程,开发人员可修改后应用到自己的硬件系统上,例如向CLD或LEN输出字符。缺省:putchar.c是向串口输出一个字符XON|XOFF是流控标志,换行符“/*n”自动转化为回车/换行“/r/n”。getkey.cgetkey函数是一个低级字符输入子程,该程序可用到自己硬件系统,如矩阵键盘输入中,缺省时通过串口输入字符。

4. 其它文件

还包括对Watch-Dog有独特功能的INIT.A51函数以及对8×C751适用的函数,可参考源代码。

第四节 段名协定与程序优化

1. 段名协定(Segment Naming Conventions)

C51编译器生成的目标文件存放于许多段中,这些段是代码空间或数据空间的一些单元,一个段可以是可重定位的,也可以是绝对段,每一个可重定位的段都有一个类型和名字,C51段名有以下规定:每个段名包括前缀与模块名两部分,前缀表示存储类型,模块名则是被编译的模块的名字,例如:?CO?main1 :表示main1模块中的代码段中的常数部分?PR?function1?module 表module模块中函数function1的可执行段,具体规定参阅手册。

2. 程序优化

C51编译器是一个具有优化功能的编译器,它共提供六级优化功能。确保生成目标代码的最高效率(代码最少,运行速度最快)。具体六级优化的内容可参考帮助。在C51中提供以下编译控制指令控制代码优化:OPTIMIZE(SJXE):尽量采用子程序,使程序代码减少。NOAREGS:不使用绝对寄存器访问,程序代码与寄存器段独立。NOREGPARMS:参数传递总是在局部数据段实现,程序代码与低版本C51兼容。OPTIMIZE(SIZE)AK OPTIMIZE(speed)提供6级优化功能,缺省为: OPTIMIZE(6,SPEED)。

第五章 Keil C51库函数参考

C51强大功能及其高效率的重要体

上一篇:ARM汇编指令详解1
下一篇:STM32常见错误

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top