4.7.40.  __strt

This intrinsic inserts an assembly language instruction of the form STR{size}T into the instruction stream generated by the compiler. It enables you to store data to memory in your C or C++ code using an STRT instruction.

Syntax

void __strt(unsigned int val, volatile void *ptr)

Where:

val

Is the value to be written to memory.

ptr

Points to the address of the data to be written to in memory. To specify the size of the data to be written, cast the parameter to an appropriate integral type.

Table 4.11. Access widths supported by the __strt intrinsic

InstructionSize of data loadedC cast
STRBTunsigned byte(char *)
STRHTunsigned halfword(short int *)
STRTword(int *)

Errors

The compiler does not recognize the __strt intrinsic when compiling for a target that does not support the STRT instruction. The compiler generates either a warning or an error in this case.

The __strt intrinsic does not support access either to signed data or to doubleword data. The compiler generates an error if you specify an access width that is not supported.

Example

void foo(void)
{
    int loc=0xff;
    __strt(0x20, (volatile char *)loc);
}

Compiling this code produces:

||foo|| PROC
    MOV      r0,#0xff
    MOV      r1,#0x20
    STRBT    r1,[r0],#0
    BX       lr
    ENDP

See also

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential