C++ Arrays to ARM assembly

Hey everyone, I have a question about working with arrays in ARM assembly. Let's say I want to add up the values in the C++ array:
 
int array[4] = {1, 2, 3, 4};

The result would obviously be 10. But how do I take the values in that array and do the same using ARM assembly using:
1
2
3
asm volatile(
      //ARM code goes here
            );

I need to use LDM and STM. How would I go about this? I know how to add up numbers that aren't in an array, but I don't know how to do this using LDM and STM in ARM Assembly.

Any advice is greatly appreciated!
Last edited on
This is a C++ forum.
closed account (48T7M4Gy)
http://www.coranac.com/tonc/text/asm.htm
Topic archived. No new replies allowed.