Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
50
Добавлен:
14.04.2015
Размер:
1.37 Mб
Скачать

Keil Software — Cx51 Compiler User’s Guide

17

 

 

Chapter 2. Compiling with the Cx51 Compiler

This chapter explains how to compile C source files and discusses the compiler control directives. These directives allow you to:

 

Direct the Cx51 compiler to generate a listing file

2

 

Control the amount of information included in the object file

 

Specify optimization level and memory models

 

 

 

 

 

 

 

NOTE

 

 

 

 

Typically you will use the Cx51 compiler within the µVision2 IDE. For more

 

 

information on using the µVision2 IDE, refer to the User’s Guide “Getting

 

 

Started with µVision2 and C51”.

 

 

Environment Variables

 

 

If you run the Cx51 compiler within the µVision2 IDE, you need no additional

 

 

settings on your computer. If you want to run the Cx51 compiler and utilities

 

 

from the command prompt, you must manually create the following environment

 

 

variables.

 

 

 

 

 

 

 

 

 

Variable

Path

Environment Variable specifies …

 

 

PATH

\C51\BIN

path of the C51 and CX51 executable programs.

 

 

TMP

 

path to use for temporary files generated by the compiler. If the

 

 

 

 

specified path does not exist, the compiler generates an error and

 

 

 

 

aborts compilation.

 

 

C51INC

\C51\INC

path to the folder for Cx51 include files.

 

 

C51LIB

\C51\LIB

path to the folder for Cx51 library files.

 

For Windows NT, Windows 2000 and Windows XP these environment variables are entered under Control Panel – System – Advanced – Environment Variables.

For Windows 95, Windows 98 and Windows ME the settings are placed in AUTOEXEC.BAT using the following commands:

PATH=C:\KEIL\C51\BIN;%PATH%

SET TMP=D:\

Соседние файлы в папке HLP