Código: Seleccionar todo
proc DGlobalAlloc,cantidad
sub esp,[cantidad]
mov eax,esp
ret
endp
ejemplo de su uso:
Código: Seleccionar todo
include 'win32ax.inc'
.data
palabra db 'Drinky94',0
longitud dd ?
.code
start:
stdcall Len,palabra
mov [longitud],ecx
stdcall DGlobalAlloc,1024
push eax
invoke wsprintfA,eax,"%d",[longitud]
pop eax
invoke MessageBox,0,eax,0,MB_OK
leave
ret
proc Len,Cadena
mov eax,[Cadena]
mov ecx,-1
bucle:
inc ecx
cmp byte[eax+ecx],0
jne bucle
ret
endp
proc DGlobalAlloc,cantidad
sub esp,[cantidad]
mov eax,esp
ret
endp
.end start
Espero que les sea util.
salu2!