Hi czerny,
Bitbeisser is right. You should avoid multiple __asm prefixes. A single __asm {} block is much easy to type and read :
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
char *szUpper(char *text)
{
__asm{
mov ecx,1
mov eax,text
sub eax,ecx
@repeat:
add eax,ecx
cmp BYTE PTR [eax],0
je @end
cmp BYTE PTR [eax],97
jb @repeat
cmp BYTE PTR [eax],122
ja @repeat
sub BYTE PTR [eax],32
jmp @repeat
@end:
}
return text;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow)
{
char msg[]="inline assembly programming";
MessageBox(0,szUpper(msg),"Hello!",MB_OK);
return 0;
}