How to make invoke without creating a variable that in the future I no longer useful?

.486 .model flat, stdcall option casemap :none __UNICODE__ equ 1 include C:\masm32\include\windows.inc include C:\masm32\include\masm32.inc include C:\masm32\include\user32.inc include C:\masm32\include\kernel32.inc include C:\masm32\include\msvcrt.inc include C:\masm32\macros\macros.asm includelib C:\masm32\lib\masm32.lib includelib C:\masm32\lib\user32.lib includelib C:\masm32\lib\msvcrt.lib includelib C:\masm32\lib\kernel32.lib uselib masm32, comctl32, ws2_32 Main PROTO .data x dd ? y dd 6 n dd ? m dd 5 saida2 db "x = %d",0 ;Вот её бы хотелось бы убрать .code start: invoke Main invoke ExitProcess,0 Main proc push ebx mov ebx, n inc n .while m != ebx pop ebx mov eax, x add eax, y mov x, eax mov eax, x invoke crt_printf, offset saida2, dword ptr n ;Внимание add esp,2*8 push ebx mov ebx, n inc n .endw Main endp end start 

And I would like to like this

 .486 .model flat, stdcall option casemap :none __UNICODE__ equ 1 include C:\masm32\include\windows.inc include C:\masm32\include\masm32.inc include C:\masm32\include\user32.inc include C:\masm32\include\kernel32.inc include C:\masm32\include\msvcrt.inc include C:\masm32\macros\macros.asm includelib C:\masm32\lib\masm32.lib includelib C:\masm32\lib\user32.lib includelib C:\masm32\lib\msvcrt.lib includelib C:\masm32\lib\kernel32.lib uselib masm32, comctl32, ws2_32 Main PROTO .data x dd ? y dd 6 n dd ? m dd 5 .code start: invoke Main invoke ExitProcess,0 Main proc push ebx mov ebx, n inc n .while m != ebx pop ebx mov eax, x add eax, y mov x, eax mov eax, x invoke crt_printf, ("repeat = %d",0), dword ptr n ;Внимание add esp,2*8 push ebx mov ebx, n inc n .endw Main endp end start 
  • Write your own macro, which will create a link and fill in the code itself. - nick_n_a

1 answer 1

You can, for example, place a string in dynamic memory, and fill it by character. And then delete it. Or on the stack. This, however, will be a lot more code than it is now, so I wouldn’t recommend bothering too much.