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.

Compiler/TMS320F28335: Is atomic code when inline assembly using \n ?

Part Number: TMS320F28335


Tool/software: TI C/C++ Compiler

Hello,

I'm writing an inline assembly using the __asm statement.


As in the example below, It was written as \n as in the example below and checked in debugging mode.

__asm ("PUSH RPC \n"
              ...

"MOVL ACC, * -SP [2]");


I checked the breakpoint in that asm and ran the line with the "step into" command.

As a result, it was executed at once until the last line. =>(MOVL ACC, * -SP [2] ");

Can i think of this result in atomic code?
Atomic code is code that runs to the end when executed.

I'm wondering if the context switch occurs when an interrupt comes in the middle of the assembly code belonging to "..."

Thanks, Regards

Han

  • Han SeungJae said:
    Can i think of this result in atomic code?

    No.  An interrupt can occur after any instruction in this multi-line asm statement.

    Han SeungJae said:

    ran the line with the "step into" command.

    As a result, it was executed at once until the last line

    So far as the debugger is concerned, an asm statement is equivalent to a C statement.  It is common for a single C statement to map to multiple assembly instructions.  When you step into that C statement, execution stops just after the last of those multiple instructions.

    Thanks and regards,

    -George