ARM - Where does a memory address number actually point to - the top of the address or the bottom?

0

I was reading up on the LDRB/STRB instructions in ARM and was wondering whether the memory address (as in, the full 32-bit number with which you would refer to an address - not a label or variable created with DEFW) points to the top of a memory address, or the bottom.

I'll talk about the 32 bits in each address like levels of a shelf. To my understanding the memory space is like a huge bookshelf, from ground to ceiling with billions of levels, while each level can hold a single book (a bit of data).

Memory addresses in ARM are 32 bits in size, so 32 levels high. Assuming the bottom shelf is number 0 and the top is 0xFFFFFFFF, do the 32-bit long numbers which we use to refer to a memory address (a group of 32 shelf levels) point to the top shelf in that group, or the bottom one?

While this question arose when I was learning more about the implementation of the LDRB and STRB instructions, I figured the question was more theory related since it discusses the structure of the memory more than anything else. If I mistagged it mods feel free to remove the tags or change them. Thanks in advance for any help!

assembly
arm
theory
asked on Stack Overflow Jan 11, 2019 by user43712

1 Answer

2

You seem to be thinking memory is bit addressable on ARM. In fact it is byte addressable so each address points at one byte of memory. If you consider larger operands (half words, words) then the address is the start, that is the bottom in your terms. A word operand would occupy address+0, address+1, address+2 and address+3.

answered on Stack Overflow Jan 11, 2019 by Jester

User contributions licensed under CC BY-SA 3.0