problem with asm block in C++

I have problem with sending back new value of parameter in function with asm block inside.
Why I obtain the result as mod 256 (only low byte) ?

#include "StdAfx.h"
// problem with sending back new value parametr
// changed inside function with block asm in C++
// I use Visual Studio Express 2010

using namespace std;
int Atest(int *w);

void main()
{
int zm =123;
Atest(&zm);
// why I obtain zm == 257 mod 256 (only the low byte)
// instead of 257 ???
return;
}
//---------------------
int Atest(int *w)
{
__asm
{
mov EBX, w
mov [EBX], 257
}
}
Topic archived. No new replies allowed.