Can all Cortex M0/M3 cores do this?
LDRH r0, [0x8001]
This would suggest yes but I don't see anything specific about Cortex-M cores.
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up.Sign up to join this community
1) As the Cortex-M instruction set doc suggests, the construct in your example does not comply with the syntax. The second operand should be a register with optional immediate offset.
2) As the instruction restrictions state, the computed address should be divisible by the number of bytes in the transaction. In your case it's a half word, therefore divisible by two.
3) Generally (for Cortex-M0), this page is stating that:
An aligned access is an operation where a word-aligned address is used for a word, or multiple word access, or where a halfword-aligned address is used for a halfword access. Byte accesses are always aligned. There is no support for unaligned accesses on the Cortex-M0 processor. Any attempt to perform an unaligned memory access operation results in a HardFault exception.