Why can't I do without a variable?
include E:\masm32\include\masm32rt.inc HeapAlloc PROTO STDCALL :DWORD,:DWORD,:DWORD myfree proto :DWORD .data hmyHeap dd 0 hConsoleOutput DWORD ? adres DWORD ? hMylp1 dd 0 szCALL MACRO sz CALL @F BYTE sz, NULL @@: ENDM .code main: invoke AllocConsole invoke GetStdHandle, STD_OUTPUT_HANDLE mov hConsoleOutput, EAX invoke GetProcessHeap mov hmyHeap,eax invoke HeapAlloc,hmyHeap,HEAP_ZERO_MEMORY,300h mov hMylp1,eax szCALL "string" mov adres, esp push 7 push adres push eax call RtlMoveMemory mov ebx, [hMylp1] invoke WriteConsoleA, hConsoleOutput, ebx, 7, 0, 0 invoke HeapFree,hmyHeap,NULL,hMylp1 ret end main
But if you do this with the messagebox, then everything is OK
всё одно и тоже что и в коде выше ... push 0 push 0 szCALL "string" push 0 call MessageBox
push 7; szCALL "string"; push eax; call
push 7; szCALL "string"; push eax; call
push 7; szCALL "string"; push eax; call
- Mike