Keil™, An ARM® Company

Technical Support

C166: GENERATING INSTRUCTIONS USING CERTAIN ADDRESSING MODES


Information in this article applies to:

  • C166 Version 4.02

QUESTION

Does the compiler generate assembler instructions with the following address modes?

MOV [-Rw],  Rw
MOV    [Rw+],  [Rw]
MOV    [Rw],   [Rw+]
MOV    Rw,     [Rw+]
MOV    [Rw],   [Rw]
CMP    Rw,     [Rw+]
XOR    Rw,     [Rw+]
OR     Rw,     [Rw+]
ADD    Rw,     [Rw+]
SUB    Rw,     [Rw+]

If so, what C instructions/compiler optimizations can be used?

ANSWER

Changing the Memory Model *can* affect the addressing mode used by the compiler, however, the compiler will always generate the instructions necessary to obtain the most efficient method it can.

There is no way to force or coerce the compiler into using specific addressing modes. If it is essential that a particular addressing mode is used, then the only option is to write the assembler by hand.

Last Reviewed: Wednesday, August 03, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure