Here is another method, the C source code:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
extern char *szUpper(char *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;
}
Pelle's C compiler, pocc.exe accepts asm source files based on a variant of NASM syntax:
[cpu 486]
[global _szUpper]
[section .text]
[function _szUpper]
_szUpper:
push ebp
mov ebp,esp
mov eax,[EBP+8]
dec eax
@restart:
add eax,1
cmp byte [eax],0
je near @end
cmp byte [eax],97
jb near @restart
cmp byte [eax],122
ja near @restart
sub byte [eax],32
jmp near @restart
@end:
mov eax,dword [ebp+8]
mov esp,ebp
pop ebp
ret