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.

CCS/MSP430FR6989: Use C Function Parameter in inline Assembler MSP430FR6989

Part Number: MSP430FR6989

Tool/software: Code Composer Studio

Hallo.

I have C Function with two Parameter:

void FunctionTest (uint16_t *const timerName, uint8_t channel)

{

asm("mov.b channel, r13") ; //Value channel in R13

asm("mov.w  timerName, r15") ; //Value timerName in R15

}

I want to write Function Input Parameters in  CPU Register. But I get Errors. How can I get Funktion Parameters in CPU Register in likebel way?

Do you know TI Dokuments that describes handling from MSP430FR6989 C and Assembler and both together and Assembler Commands?

Thanks in Adwance

Alex

  • Al Lev said:
    How can I get Funktion Parameters in CPU Register in likebel way?

    Unfortunately, it is not possible for asm statements to access C variables like timerName and channel.  Please search the MSP430 compiler manual for the sub-chapter titled The __asm Statement.

    Thanks and regards,

    -George

  • Hello George.

    Thanks for the Information. And you don't  know any method or example  to get function Parameter in CPU Register from C Function

    using asm?

    best regards

    Alex

  • Al Lev said:
    you don't  know any method or example  to get function Parameter in CPU Register from C Function

    Not directly.  No.  That said, here are two alternatives to consider.

    One ... Write the function entirely in hand-coded assembly.  For help with that, please search the MSP430 compiler manual for the sub-chapter titled Interfacing C and C++ With Assembly Language.

    Two ... Use compiler intrinsics.  They look and act like function calls.  But no function is called.  Instead, a few assembly instructions are emitted.  In many cases, just one instruction is emitted.  For the list of available intrinsics, please search the MSP430 compiler manual for the sub-chapter titled Using Intrinsics to Access Assembly Language Statements.

    Thanks and regards,

    -George

  • Nothing to add

    regards