Inline assembly reading contents of an array

Hi everyone

I need to read an array which I have already placed values into and add the contents of the the array together.

I am assuming it would work in a similar way to how you write to the array, would someone be able to give me some ideas on how to do this?

Thanks for your time.
Hi,

I assume that you mean adding all array values to give a total
which you would do using code something like this

1
2
3
4
5
6
7
8
9
10
11
12
13

int   addArray(int* array1,int lengthOfArray)
{
    int total = 0;

    for (int i=0;i<lengthOfArray;i++)
    {
        total += array1[i];
    }

    return(total);
}


Not sure why the subject 'Inline Assembly' was used, but for this purpose
I definetly would use c++

but if you need it in assembler post back and ill try to come up with something

Shredded
Thanks Shredded, when I said inline assembler I meant assembly code done within c++ ( _asm)

I have now solved my problem, but thank you for taking the time to reply to me; much appreciated.
Topic archived. No new replies allowed.