导航: 老古网老古论坛XMOS公共讨论区XMOS开源项目区单片机程序设计嵌入式系统广告区域
→送你一点C51编译控制的资料

* 1602: C51编程:请教老古!!

   寄存器 
寄存器发表的帖子 

 送你一点C51编译控制的资料
Example
C51 testfile.c SYMBOLS CODE DEBUG

#pragma SYMBOLS CODE DEBUG

In the above examples, SYMBOLS, CODE, and DEBUG are all control directives.
testfile.c is the source file to be compiled.
NOTE
The syntax is the same for the command line and the #pragma directive.
Multiple options, however, may be specified on the #pragma line.
Typically, each control directive may be specified only once at the beginning of
a source file. If a directive is specified more than once, the compiler 
generates a
fatal error and aborts compilation. Directives that may be specified more than
once are so noted in the following sections.
Directive Categories
Control directives can be divided into three groups: source controls, object
controls, and listing controls.
 Source controls define macros on the command line and determine the name
of the file to be compiled.
 Object controls affect the form and content of the generated object module
(*.OBJ). These directives allow you to specify the optimizing level or
include debugging information in the object file.
 Listing controls govern various aspects of the listing file (*.LST), in
particular its format and specific content.
Keil Software — Cx51 Compiler User’s Guide 23

The following table is an alphabetical list of the control directives. 
Unterlined
characters denote the abbreviation of the directive.
Directive Class Description
AREGS,
NOAREGS
Object Enable or disable absolute register (ARn) addressing.
ASM, ENDASM Object Marks the beginning and the end of an inline assembly block.
BROWSE † Object Enable generation of browser information.
CODE † Listing Add an assembly listing to the listing file.
COMPACT † Object Select COMPACT memory model.
COND,
NOCOND †
Listing Include or exclude source lines skipped from the preprocessor.
DEBUG † Object Include debugging information in the object file.
DEFINE Source Define preprocessor names in the Cx51 invocation line.
DISABLE Object Disables interrupts for the duration of a function.
EJECT Listing Inserts a form feed character into the listing file.
FLOATFUZZY Object Specify number of bits rounded during floating compare.
INCDIR, ID † Source Specify additional path names for include files.
INTERVAL † Object Specify the interval for interrupt vectors for SIECO chips.
INTPROMOTE,
NOINTPROMOTE †
Object Enable or disable ANSI integer promotion.
INTVECTOR,
NOINTVECTOR †
Object Specify base address for interrupt vectors or disable vectors.
LARGE † Object Select LARGE memory model.
LISTINCLUDE Listing Display contents of include files in the listing file.
MAXARGS † Object Specify size of variable argument lists.
MOD517,
NOMOD517
Object Enable or disable code to support the additional hardware
features of the 80C517 and derivatives.
MODA2,
NOMODA2
Object Enable or disable dual DPTR register support for Atmel 82x8252
and variants.
MODDP2,
NOMODDP2
Object Enable or disable dual DPTR register support for Dallas
Semiconductor 320, 520, 530, 550 and variants.
MODP2,
NOMODP2
Object Enable or disable dual DPTR register support for Philips and
Temic derivatives.
NOAMAKE † Object Disable information records for AutoMAKE.
NOEXTEND † Source Disable Cx51 extensions to ANSI C.
OBJECT,
NOOBJECT †
Object Enable object file and optionally specify name or suppress the
object file.
OBJECTEXTEND † Object Include additional variable type information in the 
object file.
ONEREGBANK Object Assume that only registerbank 0 is used in interrupt code.
OMF2 † Object Generate OMF2 output file format.
OPTIMIZE Object Specify the level of optimization performed by the compiler.
24 Chapter 2. Compiling with Cx51
2
Directive Class Description
ORDER † Object Variables are allocated in the order in which they appear in the
source file.
PAGELENGTH † Listing Specify number of rows on the page.
PAGEWIDTH † Listing Specify number of columns on the page.
PREPRINT † Listing Produce a preprocessor listing file where all macros are
expanded.
PRINT, NOPRINT † Listing Specify a name for the listing file or disable the 
listing file.
REGFILE † Object Specify a register definition file for global register 
optimization.
REGISTERBANK Object Select the register bank that is used for absolute register
accesses.
REGPARMS,
NOREGPARMS
Object Enable or disable register parameter passing.
RET_PSTK †,
RET_XSTK †
Object Use reentrant stack for saving return addresses.
ROM † Object Control generation of AJMP/ACALL instructions.
SAVE,
RESTORE
Object Saves and restores settings for AREGS, REGPARMS and
OPTIMIZE directives.
SMALL † Object Select SMALL memory model. (Default.)
SRC † Object Create an assembler source file instead of an object module.
STRING † Object Locate implicit string constants to xdata or far memory.
SYMBOLS † Listing Include a list of all symbols used within the module in the 
listing
file.
VARBANKING † Object Use library set for variable banking support.
WARNINGLEVEL † Listing Selects the level of Warning detection.
† These directives may be specified only once on the command line or at the 
beginning of a source
file using in the #pragma statement. They may not be used more than once in a 
source file.
具体的讲就是在程序中加:
#pragma SRC 
用C51编译一遍后去掉该行将编译输出的SRC文件再用ASM51编译一边


发表时间:2001年10月10日10:31:00

  
回复该帖

本主题共有 10 帖,分页:>>>>>该主题的所有内容[10]条

 *树形目录 只列出部分跟帖的标题以及简单的摘要信息 该主题的部分跟帖如下:

  1766.[详细]这个在C51BBS中不是已讨论过了吗?
摘要:利用预编译命令ASM 和SRC 不就可以了吗?......(23字)
- [monkey][2048次] 2001年10月16日

[上一篇帖子]:建议:收到。分析原理图分析不出问题。而是你要写一个测试程序:P2口0x0fffh-0x7fffh时对
[下一篇帖子]:硬件:请教老古:帮个忙?我把问题给你发过去了,你帮我再看看?!谢谢!