Close

AscetiCore ⋅ Memory

jock-tannerJock Tanner wrote 02/23/2021 at 03:11 • 1 min read • Like

Memory is an array of cells, each of which holds an 8-bit byte, so terms “byte” and “cell” can be used interchangeably.

Each byte can be accessed by its unique 16-bit index, which is called “memory address”, “virtual address”, or simply “address”. Any address can be effectively represented by a word. One word can have 216=65536 or 64K unique values. You might have assumed that the CPU’s ability to address data is limited to 64K bytes, but it’s not so. The overlaying addressing mechanism (paging) is explained in more details in section “Virtual memory”.

Words are stored in two consecutive bytes of memory. In this case, higher, or most significant, part of the address is located in the byte with a larger address. These scheme is known as little-endian addressing, or, generally, endianness. CPU’s endianness is also applied to memory addresses stored in memory cells.

A data word can have either even or odd address. In the latter case, the access may require two consecutive bus cycles and thus be slower, so aligning word data on word boundaries in memory is not required, but can be recommended in most cases.

Like

Discussions