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.

TMDS570LS31HDK: Correct assembly syntax

Part Number: TMDS570LS31HDK

Hello,

I'm working on a project with shared data which I'm trying to protect through a mutex.  I was initially doing so by enabling and disabling interrupts, but upon further reading I realized that it's not such an efficient method of doing so, and ARM provides special instructions for atomicity, mainly LDREX, STREX.  In the related thread, there's a post with a link to an ARM application note explaining LDREX and STREX with an example for a mutex.

infocenter.arm.com/.../DHT0008A_arm_synchronization_primitives.pdf

The code snippet I'm looking at is the following:

I don't use assembly very much, but I tried integrating this into my project, unfortunately I am still getting build errors such as illegal symbols, illegal mnemonics, illegal operands... yeah, as you can tell, assembly is not my strong suit.  Could someone help me out please and show me the correct syntax for this code in code composer?

Thanks!

 

  • I don't know ARM assembler syntax well enough to be helpful.  For instance, what is PROC?  Is that some way of starting a function, or a macro?  

    Instead of implementing in assembly, consider implementing it in C, but using ARM compiler intrinsics like __ldrex and __strex.  Intrinsics are similar to function calls, but are (usually) implemented in a single instruction.  Search the ARM compiler manual for the sub-chapter titled ARM Instruction Intrinsics.

    Thanks and regards,

    -George

  • Hi George,
    Just FYI: Yes the PROC (procedure begin) and ENDP (end procedure) are for notifying the ASM compiler about declaration of a function.
    This was commonly used in ancient assemblers since i8086 was released. An easier way is just to give a label of type "FUNC_001:" and later call it.
    BR
    Michail