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

144

Chapter 5. 8051 Derivatives

 

 

Arithmetic Accelerator

The Cx51 compiler uses the 32-bit and 16-bit arithmetic operations of the DS80C390, DS80C400 and DS5240 to improve performance of a number of math-intensive operations. C language programs execute considerably faster when using either of these CPUs.

Use the following suggestions to help guarantee that only one thread of execution uses the arithmetic processor:

Use the MODDA directive to compile functions which are guaranteed to execute only in the main program or functions used by one interrupt service routine, but not both.

Compile all remaining functions with the NOMODDA directive.

5

Keil Software — Cx51 Compiler User’s Guide

145

 

 

Infineon C517, C509, 80C537, and

Variants

The Infineon C517, C517A, and C509 perform high-speed 32-bit and 16-bit arithmetic operations which improve of many int, long, and float operations.

The C517, C517A, C509, and C515C provide 8 data pointers that may be used to increase the speed of memory to memory operations.

The MOD517 directive instructs the Cx51compiler to generate code that utilizes these advanced features.

Data Pointers

The Infineon C515C, C517, C517A, and C509 provide 8 data pointers which may be used to speed-up memory access. Using multiple data pointers can improve the execution of library functions such as: memcpy, memmove, memcmp, strcpy, and strcmp. The 8 data pointers of the C515C, C517, C517 and C509 may also reduce the stack load of interrupt functions.

The Cx51 compiler uses only 2 of the 8 data pointers at a time. In order to keep

5

the stack load in the interrupt routines low, Cx51 switches to 2 unused data

pointers when switching the register bank. The contents of the register DPSEL are saved on the stack and a new pair of data pointers is selected. Saving the data pointers on the stack is no longer required.

If an interrupt routine does not switch to another register bank (for example, the function is declared without the using attribute), the data pointers must be saved on the stack (using 4 bytes of stack space). To keep the size of the stack as small as possible, use the MOD517(NODP8) directive to compile the interrupt routine and the functions it calls. This generates code for the interrupt using only one data pointer and only 2 bytes of stack space.

146

Chapter 5. 8051 Derivatives

 

 

High-speed Arithmetic

The Cx51 compiler uses the 32-bit and 16-bit arithmetic operations of the C517, C517A, and C509 to improve performance of a number of math-intensive operations. C language programs execute considerably faster when using either of these CPUs.

Use the following suggestions to help guarantee that only one thread of execution uses the arithmetic processor:

Use the MOD517 directive to compile functions which are guaranteed to execute only in the main program or functions used by one interrupt service routine, but not both.

Compile all remaining functions with the MOD517(NOAU) directive.

Library Routines

The extra features of the C517, C517A, and C509 are used in several library routines to enhance performance. These routines are listed below and are described in detail in “Chapter 8. Library Reference” on page 209.

5

acos517

log10517

sqrt517

asin517

log517

sscanf517

 

atan517

printf517

strtod517

 

atof517

scanf517

tan517

 

cos517

sin517

 

 

exp517

sprintf517

 

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