Reputation: 105
I have a question yesterday I made a test to get value from a pointer like this is it correct?. It seems that it works fine.
char *test ="abcdef";
_asm{
mov ebx, test
mov al, byte ptr ds:[ebx]; element at 0
mov al, byte ptr ds:[ebx + 1]; element at 1...
mov al, byte ptr ds:[ebx + x]; element at x...
}
Upvotes: 1
Views: 1139
Reputation: 993085
Yes, that is correct. A pointer is just an address, and you're using an indirect addressing mode through ebx
to access what the pointer points to.
Upvotes: 4