Keil Logo Arm Logo

C166 User's Guide

Optimum C16x Code

The default settings of the C166 Compiler generate optimum code for 80C166 devices. If you use devices with the extended C16x or XC16x instruction sets, the following suggestions will help you create smaller, faster programs.

  • If you are writing a program for C16x derivatives, make sure you use the MOD167 directive to enable the C16x instruction set.
  • If you are writing a program for XC16x derivatives, make sure you use the MODV2 directive to enable the XC16x instruction set.
  • If your application has large data-memory requirements use the XLARGE, HLARGE, or HCOMPACT memory models instead of LARGE or COMPACT. The XLARGE, HLARGE, and HCOMPACT memory models are more efficient and generate better code than LARGE or COMPACT. Using HLARGE or HCOMPACT simplifies debugging since 14-bit far pointers are not used in these memory models.
  • You can improve interrupt functions by using the NODPPSAVE compiler directive. Use this directive only if you do not change the DPP registers in your code. The C166 Compiler and the run-time libraries for the C167 do not change these registers.
  • Make certain that assembler code or libraries you use do not change the DPP registers. Refer to the NODPPSAVE compiler directive for more information.
  • You may extend the space for near objects (NDATA and NCONST) up to 64KB by using the NOFIXDPP compiler directive with the DPPUSE linker directive.

arm-logo-small

Keil logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.