29.12.2014 Views

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Compiler</strong>-specific Features<br />

Syntax<br />

void __strt(unsigned int val, volatile void *ptr)<br />

Where:<br />

val<br />

ptr<br />

Is the value to be written to memory.<br />

Points to the address of the data to be written to in memory. To specify<br />

the size of the data to be written, cast the parameter to an appropriate<br />

integral type.<br />

Table 4-11 Access widths supported by the __strt intrinsic<br />

Instruction Size of data loaded C cast<br />

STRBT unsigned byte (char *)<br />

STRHT unsigned halfword (short int *)<br />

STRT word (int *)<br />

Errors<br />

The compiler does not recognize the __strt intrinsic when compiling for a target that<br />

does not support the STRT instruction. The compiler generates either a warning or an<br />

error in this case.<br />

The __strt intrinsic does not support access either to signed data or to doubleword data.<br />

The compiler generates an error if you specify an access width that is not supported.<br />

Example<br />

void foo(void)<br />

{<br />

int loc=0xff;<br />

__strt(0x20, (volatile char *)loc);<br />

}<br />

Compiling this code produces:<br />

||foo|| PROC<br />

MOV<br />

MOV<br />

STRBT<br />

BX<br />

ENDP<br />

r0,#0xff<br />

r1,#0x20<br />

r1,[r0],#0<br />

lr<br />

<strong>ARM</strong> DUI 0348A Copyright © 2007, 2010 <strong>ARM</strong> Limited. All rights reserved. 4-91<br />

Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!