The MASM Forum Archive 2004 to 2012

Miscellaneous Forums => The Orphanage => Topic started by: Magnum on January 31, 2011, 02:15:48 AM

Title: Library info
Post by: Magnum on January 31, 2011, 02:15:48 AM
This will be in the future.

I am looking for information for writing a library module.

I found this.

\masm32\bin\ml /c /coff *.asm
\masm32\bin\lib *.obj /out:masm32.lib

Below is a sample template for writing a library module, its produced by a plug in DLL in MASM32.

Regards,

hutch@pbq.com.au

; #############################################################

      .386                      ; force 32 bit code
      .model flat, stdcall      ; memory model & calling convention
      option casemap :none      ; case sensitive

      ; --------------------------------
      ; Include any needed INCLUDE files
      ; --------------------------------
      ; include \masm32\include\windows.inc
      ; include \masm32\include\gdi32.inc
      ; include \masm32\include\user32.inc
      ; include \masm32\include\masm32.inc

      ; ---------------------------------------------------------
      ; Write the prototype for the procedure name below ensuring
      ; that the parameter count & size match and put it in your
      ; library include file.
      ; ---------------------------------------------------------

      ; AsmModule PROTO :DWORD,:DWORD etc.....

    .code

; #############################################################

AsmModule proc par1:DWORD,par2:DWORD etc.....

    ; Write you code here

    ret

AsmModule endp

; #############################################################

end
Title: Re: Library info
Post by: dedndave on January 31, 2011, 03:45:13 AM
a while back, i wanted an example static library, so i wrote one

http://www.masm32.com/board/index.php?topic=15480.msg126841#msg126841

notice - the static folder has to be in \masm32\examples because of the paths
e.g. all the files will be in \masm32\examples\static
Title: Re: Library info
Post by: Magnum on January 31, 2011, 03:58:10 AM
Thanks.

Title: Re: Library info
Post by: japheth on January 31, 2011, 07:49:15 AM
Quote from: Magnum on January 31, 2011, 02:15:48 AM
Below is a sample template for writing a library module, its produced by a plug in DLL in MASM32.

What?

Isn't a "library module" just an object module which has been put into a "library"?

Why is anybody supposed to need a "plug in DLL" for this?
Title: Re: Library info
Post by: MichaelW on January 31, 2011, 08:06:22 AM
The plugin creates the template from user-supplied parameters. The template that Andy posted does not have everything.
Title: Re: Library info
Post by: Magnum on January 31, 2011, 12:40:34 PM
I think Hutch's message that I posted was dated 2005.