C251 User's Guide

FIXDRK Compiler Directive

Abbreviation

FD

Arguments

None.

Default

INC DRk,#const instruction is used.

µVision

Options — C251 Compiler — Misc — Additional Options: Enter FIXDRK.

Description

The FIXDRK directive instructs the compiler to replace the INC DRk,#const instruction by an ADD DRk,#const instruction. In the Intel 251SB C-step CPU, the INC DRk,#const does not work correctly. Check the stepping level or contact the silicon vendor to find out if you need to specify FIXDRK.

Example

The following example is a source and code listing of a function which adds a constant value to a variable of type long. This kind of statement is most likely to generate an INC DRk,#const instruction.

.
.
.
stmt  level    source
   1          long  l1;
   2
   3          void incL1 (void)  {
   4   1        l1 += 2;
   5   1      }

Code without FIXDRK directive:

;       FUNCTION incL1 (BEGIN)
                        ; SOURCE LINE # 3
                        ; SOURCE LINE # 4
000000 7E1D00      R  MOV    DR4,l1
000003 0B1D           INC    DR4,#02H
000005 7A1D00      R  MOV    l1,DR4
                        ; SOURCE LINE # 5
000008 22             RET
;       FUNCTION incL1 (END)

Code with FIXDRK directive:

;       FUNCTION incL1 (BEGIN)
                        ; SOURCE LINE # 3
                        ; SOURCE LINE # 4
000000 7E1D00      R  MOV    DR4,l1
000003 2E180002       INC    DR4,#02H ; --> ADD DR4,#2
000007 7A1D00      R  MOV    l1,DR4
                        ; SOURCE LINE # 5
00000A 22             RET
;       FUNCTION incL1 (END)