Hi friends,
Here a simple Masm example using functions from Pelle's C run-time static library crt.lib :
.386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
include \masm32\include\masm32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\masm32.lib
includelib \pellesc\lib\crt.lib ; Pelle's CRT static library
strcat PROTO C :DWORD,:DWORD
strstr PROTO C :DWORD,:DWORD
strchr PROTO C :DWORD,:DWORD
.data
dest db 'strcat example : ',0
db 20 dup(0)
source db 'Hello my friend',13,10,0
string2 db 'friend',0
crlf db 13,10,0
.data?
buffer db 20 dup(?)
.code
start:
invoke strcat,ADDR dest,ADDR source
invoke StdOut,ADDR dest
invoke strstr,ADDR dest,ADDR string2
call print
invoke strchr,ADDR dest,114 ; look for 'r'
call print
invoke ExitProcess,0
print PROC
invoke dw2hex,eax,ADDR buffer
invoke StdOut,ADDR buffer
invoke StdOut,ADDR crlf
ret
print ENDP
END start