Hello.

I was wondering how exactly you handle pointers in assembly.

Here's the C++ equivalent of what I'm trying to do.

[PHP]
char buffer[100] = {0};

cin >> buffer;
if( *((char*)buffer+1) != 0 )
{
cout << buffer;
}
[/PHP]

I'm basically taking the second element of buffer using a cast and a dereference operator.

I was trying different things before but it wasn't working out so well.

Here's what I was trying

[PHP]
.data
buffer db 100 DUP(0);

.code
start:

invoke StdIn,addr buffer,100 ; same as cin.get

mov eax,offset buffer
mov ebx,[eax+1]
cmp ebx,0
je _Somewhere

end start
[/PHP]

That's not the full code but I hope you get what I'm trying to do. I want to take the address of buffer, add 1 to it, store the single byte value into ebx and compare. I'm trying to access the second element of 'buffer' through pointers.

If the method I'm using or thinking of is wrong, notify me please. Or if there are other/easier methods, an brief explanation would be nice.

If there is a method that doesn't involve pointers ( I don't understand what pointers are in assembly yet ) it would be okay to post it but I'm trying to understand how pointers work in assembly.

Thank you.