| |||
| Home > Introduction > ARM architecture v6 support > Example 2 - instructions generated for packed structures | |||
This example shows the different instructions generated for a packed structure when compiling for ARMv6 and earlier architectures.
__packed struct{
char ch;
short sh;
int i;
} foo;
signed char unpack()
{
return (signed char)foo.i;
}
Compiling with --cpu 5 gives:
unpack PROC
STMFD sp!,{r3,lr}
LDR r0,|L1.24|
BL __rt_uread4
MOV r0,r0,LSL #24
MOV r0,r0,ASR #24
LDMFD sp!,{r3,pc}
|L1.24|
DCD ||.bss$2|| + 3
ENDP