This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Initialization an array of 24-bit signed integers

Hello, fellows!

Collided with such a task: "Using ARM assembler initialize an array of 16 elements each of one is 24-bit signed integer". We're using STM32 for calculations therefore Thumb2 instructions are only available.

Maybe anybody has an idea of what how that can be implemented?

Parents
  • store the low 16bits with STH.  Then shift the register value so you can store the final 8bits with STB.   Maybe preserve the original register contents.  (that assumes you want code.  I can also interpret the question as wanting to specify data in source code, which would be different and use macros.)

    STM32 includes both CM0 (ARMv6m) and CM3/4(ARMv7m), which have different lists of available instructions, BTW.  ARMv6m only supports a very limited subset of THUMB2 (mostly just THUMB)

Reply
  • store the low 16bits with STH.  Then shift the register value so you can store the final 8bits with STB.   Maybe preserve the original register contents.  (that assumes you want code.  I can also interpret the question as wanting to specify data in source code, which would be different and use macros.)

    STM32 includes both CM0 (ARMv6m) and CM3/4(ARMv7m), which have different lists of available instructions, BTW.  ARMv6m only supports a very limited subset of THUMB2 (mostly just THUMB)

Children