News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Library info

Started by Magnum, January 31, 2011, 02:15:48 AM

Previous topic - Next topic

Magnum

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
Have a great day,
                         Andy

dedndave

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

Magnum

Have a great day,
                         Andy

japheth

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?

MichaelW

The plugin creates the template from user-supplied parameters. The template that Andy posted does not have everything.
eschew obfuscation

Magnum

I think Hutch's message that I posted was dated 2005.

Have a great day,
                         Andy