| |||
| Home > Compiler-specific Features > __ldrt intrinsic | |||
This intrinsic inserts an assembly language instruction of
the form LDR{size}T into the instruction stream generated
by the compiler. It enables you to load data from memory in your C
or C++ code using an LDRT instruction.
unsigned int __ldrt(const volatile void *ptr)
Where:
The compiler does not recognize the __ldrt intrinsic
when compiling for a target that does not support the LDRT instruction.
The compiler generates either a warning or an error in this case.
The __ldrt intrinsic does not support
access to doubleword data. The compiler generates an error if you
specify an access width that is not supported.
int foo(void)
{
int loc = 0xff;
return __ldrt((const volatile int *)loc);
}
Compiling this code with the default options produces:
||foo|| PROC MOV r0,#0xff LDRBT r1,[r0],#0 MOV r2,#0x100 LDRBT r0,[r2],#0 ORR r0,r1,r0,LSL #8 BX lr ENDP
LDR and STR, unprivileged in the ARM Assembler Reference.