Keil Logo

NOFIXDPP Compiler Directive

Abbreviation

NOFD

Arguments

None.

Default

The C166 Compiler assumes the user stack is accessed with the DPP2 register.

µVision

Options — C166 — Misc Controls.

Description

By default, the C166 Compiler assumes the DPP2 register is used for all user stack accesses. The NOFIXDPP directive must be used when the DPPUSE L166 Linker Directive is used to reassign DPP registers. The NOFIXDPP directive instructs the compiler to generate code independent of DPP register contents.

Refer to DPPUSE in the L166 User's Guide for more information about DPPUSE.

Note

  • The NOFIXDPP control is only relevant if you convert the address of a user stack-based object to a far pointer.
Example
C166 SAMPLE.C NOFIXDPP

#pragma NOFD

The following example:

stmt lvl  source
   1      char far *p;
   2
   3      void func (void)  {
   4   1    char array[10];
   5   1
   6   1    p = &array[0];
   7   1  }

demonstrates code generated using the NOFIXDPP directive.

Code Generated
Normally
        ; FUNCTION func (BEGIN)
        ; SOURCE LINE # 3
0000 06F0F6FF      ADD     R0,#0FFF6H

        ; SOURCE LINE # 6
0004 F040          MOV     R4,R0
0006 66F4FF3F      AND     R4,#03FFFH
000A F2F504FE      MOV     R5,DPP2






000E F6F40000 R    MOV     p,R4
0012 F6F50200 R    MOV     p+02H,R5

        ; SOURCE LINE # 7
0016 06F00A00      ADD     R0,#0AH
001A CB00          RET
        ; FUNCTION func (END)

CODE SIZE: 28 Bytes
Code Generated
With NOFIXDPP
        ; FUNCTION func (BEGIN)
        ; SOURCE LINE # 3
0000 06F0F6FF      ADD     R0,#0FFF6H

        ; SOURCE LINE # 6
0004 F040          MOV     R4,R0
0006 E005          MOV     R5,#00H
0008 06F40000 E    ADD     R4,#SOF(?C_NDATABASE)
000C 16F50000 E    ADDC    R5,#?C_NDATABASESEG
0010 0044          ADD     R4,R4
0012 1055          ADDC    R5,R5
0014 0044          ADD     R4,R4
0016 1055          ADDC    R5,R5
0018 7C24          SHR     R4,#02H
001A F6F40000 R    MOV     p,R4
001E F6F50200 R    MOV     p+02H,R5

        ; SOURCE LINE # 7
0022 06F00A00      ADD     R0,#0AH
0026 CB00          RET
        ; FUNCTION func (END)

CODE SIZE: 40 Bytes

Related Knowledgebase Articles

  Arm logo
Important information

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

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.