In ARM architecture, what is the size in bytes of a halfword access?
Think about the term 'halfword' as half of a word size in ARM.
A halfword in ARM architecture is 2 bytes because a full word is 4 bytes. Halfword means half of a word.
What is the size of a word access in ARM architecture?
Recall that ARM is a 32-bit architecture in many common implementations.
A word in ARM architecture is 4 bytes (32 bits). This is the standard size for word access.
Consider a 32-bit word stored at address 0x1000 in ARM memory. If you perform a byte access at address 0x1002, which byte of the word are you accessing?
Remember that addresses increase by 1 for each byte, and the word starts at 0x1000.
The word at 0x1000 has bytes at 0x1000 (byte 0), 0x1001 (byte 1), 0x1002 (byte 2), and 0x1003 (byte 3). So address 0x1002 accesses the third byte.
In ARM architecture, what happens if you perform a halfword access at an odd address (e.g., 0x1003)?
Think about ARM's alignment rules for halfword and word accesses.
ARM requires halfword accesses to be aligned to even addresses. Accessing a halfword at an odd address causes an alignment fault or exception.
You have an ARM instruction that loads a word from memory address 0x2004. How many bytes are read from memory, and what is the address range accessed?
Recall the size of a word and how addresses increment per byte.
A word in ARM is 4 bytes. Starting at address 0x2004, the bytes accessed are 0x2004, 0x2005, 0x2006, and 0x2007.
