This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F6775A: ASSEMBLY

Part Number: MSP430F6775A

Tool/software:

Hi,

I would like to ask whether, when I use those intrinsic functions and compile the program, the instructions may differ. I have noticed in my program that it does not matter whether there is a small data model or a restricted data model; the instructions are as follows: no MOVEX instruction as seen in the description picture, just one MOVEA and then two MOV.W for _data20_read_long, which is slightly different from the previous description where MOVEX is used. When ordinary pointers are used, the change is noticeable. In the restricted model, MOVEX.W is used, which I assume allows the use of a 20-bit address. When I switch to the small model, MOV.W instruction is used, which causes only a 16-bit address to be used, I assume. I would like to know whether it will change somehow when I use the _data20_read_long or write intrinsics in accessing the 20-bit address, even when the model changes to small, because when ordinary pointers are used, it does and also why there is no MOVEX instruction used.

 

 

  •  Modern assemblers will sometimes replace instructions with equivalent ones with shorter encodings. (mov @Rx for mov 0(Rx) for example) Sometimes referred to as relaxation. The linker can be guilty of this as well.

    As for the lack of a movx, the shorter mov instruction is used because it can do the job. The description of the addressing modes is very clear on the full register width being used for register indirect and indexed modes even when extended instructions aren't being used.

  • Okay. How may linker affect the final instruction used ?

  • From the man page for ld:

    "On some platforms, the --relax option performs global optimizations that become possible when the linker resolves addressing in the program, such as relaxing address modes and synthesizing new instructions in the output object file."

**Attention** This is a public forum