I am messing around with assembly for the first time, and can’t seem to change the index values of an array. Here’s the method I am working on
int ascending_sort( char arrayOfLetters[], int arraySize )
{
char temp;
__asm
{
//???
}
}
And these are what I tried
mov temp, 'X'
mov al, temp
mov arrayOfLetters[0], al
And this gave me an error C2415: improper operand type
so I tried
mov temp, 'X'
mov al, temp
mov BYTE PTR arrayOfLetters[0], al
This complied, but it didn’t change the array…
The
arrayOfLettersvalue is equivalent to a pointer. So, your assembly code might need to be:In the above code,
edxis loaded with the address ofarrayOfLetters. Then the last instruction stores thealbyte into the address pointed to byedx.