Skip to main content
Knowledgebase
Home
Renesas Electronics America - Knowledgebase

Do word instructions determined automatically or must be specified?

Latest Updated:12/01/2011

Question:

The instruction length differs depending on whether saddrp1 or saddrp2 is used with the MOVW saddrp, #word instructions, but it is determined automatically or must it be specified?

Answer:

If nothing is specified, processing as saddrp1 (longer instruction) is performed.
If you expect a short instruction as saddrp2, perform symbol definition after specifying saddrp2 by operand as the relocation attribute when declaring "DSEG" for data definition.

   area1        DSEG       saddrp2
   data1:       DS         2
                 :
                 :
                CSEG
                 :
                MOVW        data1,#0H

When the above is described, this MOVW instruction becomes a short instruction.
For details, refer to the DSEG section under quasi directives in the Language User's Manual.

Suitable Products