05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Application Level Memory Model<br />

A3.1 Address space<br />

The <strong>ARM</strong> architecture uses a single, flat address space of 2 32 8-bit bytes. Byte addresses are treated as<br />

unsigned numbers, running from 0 to 2 32 - 1. The address space is also regarded as:<br />

2 30 32-bit words:<br />

— the address of each word is word-aligned, meaning that the address is divisible by 4 <strong>and</strong> the<br />

last two bits of the address are 0b00<br />

— the word at word-aligned address A consists of the four bytes with addresses A, A+1, A+2 <strong>and</strong><br />

A+3.<br />

2 31 16-bit halfwords:<br />

— the address of each halfword is halfword-aligned, meaning that the address is divisible by 2<br />

<strong>and</strong> the last bit of the address is 0<br />

— the halfword at halfword-aligned address A consists of the two bytes with addresses A <strong>and</strong><br />

A+1.<br />

In some situations the <strong>ARM</strong> architecture supports accesses to halfwords <strong>and</strong> words that are not aligned to<br />

the appropriate access size, see Alignment support on page A3-4.<br />

Normally, address calculations are performed using ordinary integer instructions. This means that the<br />

address wraps around if the calculation overflows or underflows the address space. Another way of<br />

describing this is that any address calculation is reduced modulo 2 32 .<br />

A3.1.1 Address incrementing <strong>and</strong> address space overflow<br />

When a processor performs normal sequential execution of instructions, it effectively calculates:<br />

(address_of_current_instruction) + (size_of_executed_instruction)<br />

after each instruction to determine which instruction to execute next.<br />

Note<br />

The size of the executed instruction depends on the current instruction set, <strong>and</strong> might depend on the<br />

instruction executed.<br />

If this address calculation overflows the top of the address space, the result is UNPREDICTABLE. In other<br />

words, a program must not rely on sequential execution of the instruction at address 0x00000000 after the<br />

instruction at address:<br />

0xFFFFFFFC, when a 4-byte instruction is executed<br />

0xFFFFFFFE, when a 2-byte instruction is executed<br />

0xFFFFFFFF, when a single byte instruction is executed.<br />

A3-2 Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DDI 0406B

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

Saved successfully!

Ooh no, something went wrong!