NO

Author Topic: Using Pelle's C run-time library with Masm  (Read 6433 times)

Online Vortex

  • Member
  • *
  • Posts: 801
    • http://www.vortex.masmcode.com
Using Pelle's C run-time library with Masm
« on: September 11, 2005, 12:58:54 PM »
Hi friends,

Here a simple Masm example using functions from Pelle's C run-time static library crt.lib :
Code: [Select]

.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
Code it... That's all...

tomlau

  • Guest
Using Pelle's C run-time library with Masm
« Reply #1 on: October 26, 2006, 08:17:44 AM »
Great done, vortex!
I know you on the fasm forum, hoho.

Online Vortex

  • Member
  • *
  • Posts: 801
    • http://www.vortex.masmcode.com
Using Pelle's C run-time library with Masm
« Reply #2 on: October 26, 2006, 07:17:04 PM »
tomlau,

Thanks for your kind words. Yes, I am a member of Fasm forum.
Code it... That's all...

Grincheux

  • Guest
Re: Using Pelle's C run-time library with Masm
« Reply #3 on: October 19, 2008, 05:58:17 PM »
And of the Masm forum too