Archived

This topic is now archived and is closed to further replies.

EvilCrap

Asm Scope? !!!!

Recommended Posts

hi in mcv++ inline asm, i can access public variables, but how do i access scoped variables? like... int x = 0;// i can access this void main() { int y = 0; //i cant figure how to access this mov eax, y // dont work: "invalid number of operands" }//main !!!! i think i know where y is (the stack?), but how do i access it?

Share this post


Link to post
Share on other sites
_asm
{
mov eax, [y]
.
.
.
}
that should work.

I believe in MSVC it uses a stack frame so it would
be a local variable probably an offset of ebp. [ebp-4].



Edited by - Jonnie on December 10, 2001 7:25:10 PM

Share this post


Link to post
Share on other sites
thanks man! i knew it was something like that, im so alzheimered (and at 19, too)

Edited by - evilcrap on December 10, 2001 7:26:14 PM

actually, that + lack of brains

how can i get it to work with char* (string) instead of int ?
normally i do

mov eax, offset String

but that obviously isnt working on private strings

thanks!

Edited by - evilcrap on December 10, 2001 9:04:41 PM

Share this post


Link to post
Share on other sites