News:

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

How to build a library

Started by jj2007, July 10, 2008, 08:48:02 AM

Previous topic - Next topic

jdoe

Quote from: jj2007 on July 11, 2008, 11:28:07 PM
I am currently working on a way to put the whole library in one fat source, and then press a button to build and test it. It works already but it's still in a beta state.

As hutch stated previoulsy, it's better to have a module for each procedures in your library. This way your are sure that each of them are aligned on a 16 bytes address (makes custom alignment easier).




hutch--

 :bg

Tread carefully here.


You can replace the lines
Code:
dir /b libm*.asm > ml.rsp          : create a response file for ML.EXE
\masm32\bin\ml /c /coff @ml.rsp
with 1 line
Code:
\masm32\bin\ml /c /coff libm*.asm


ML 6.14 and 6.15 handle *.asm correctly but 7.0, 7.1 and 8.0 have broken wildcard support but still support the response file format.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

jdoe

Quote from: hutch-- on July 12, 2008, 01:25:13 AM
:bg

Tread carefully here.


You can replace the lines
Code:
dir /b libm*.asm > ml.rsp          : create a response file for ML.EXE
\masm32\bin\ml /c /coff @ml.rsp
with 1 line
Code:
\masm32\bin\ml /c /coff libm*.asm


ML 6.14 and 6.15 handle *.asm correctly but 7.0, 7.1 and 8.0 have broken wildcard support but still support the response file format.


Exactly why my batch file will take care of all MASM versions.

:bdg


jj2007

Quote from: jdoe on July 11, 2008, 11:57:51 PM
As hutch stated previoulsy, it's better to have a module for each procedures in your library. This way your are sure that each of them are aligned on a 16 bytes address (makes custom alignment easier).

Quote from: hutch-- on July 12, 2008, 01:25:13 AM
:bg

Tread carefully here.

ML 6.14 and 6.15 handle *.asm correctly but 7.0, 7.1 and 8.0 have broken wildcard support but still support the response file format.

Me always treading carefully and aligning properly :bg
Here is my response file. With a bit of imagination, you can guess that I planned for up to 676 modules, hehe :P

C:\Masm32\RichMasm\libtmpAA.asm
C:\Masm32\RichMasm\libtmpAB.asm
C:\Masm32\RichMasm\libtmpAC.asm
C:\Masm32\RichMasm\libtmpAD.asm

The main reason that I want my modules in one fat source is that it makes it easier to find errors and inconsistencies, and to fix things with a "Replace all". Imagine Hutch fumbles with Masm32 V11.0 and suddenly a variable used in all your 676 modules is politically incorrect...

hutch--

 :bg

JJ,

Why limit your creativity, use a name like "bitmap12345678h" and have the whole DWORD range.  :P
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

jj2007

Quote from: hutch-- on July 12, 2008, 08:19:34 AM
Why limit your creativity, use a name like "bitmap12345678h" and have the whole DWORD range.  :P

I see you have ambitious plans for version 11 :cheekygreen:

PBrennick

jj,
Hutch is an ambitious man.  :P

About the flat file, read up about granularity. It will explain why it is a bad idea. Alignment issues can make even a properly optimized procedure run dead slow because of issues with 'fetch.' What I do is put all the procedures in their own file and load them all into an MDI editor such as TextPad. Using an editor such as that you can do global search and replace of all documents, etc.

-- Paul
The GeneSys Project is available from:
The Repository or My crappy website

jj2007

Quote from: PBrennick on July 12, 2008, 01:37:03 PM
About the flat file, ...

Paul, my flat file is in RTF format and has delimiters between module boundaries. When I press the magic button, it exports all modules (including a TestTheLibrary.asm) as plain text *.asm files. The response file above was generated during that process. So no granularity problems whatsoever, for ml and link this is exactly what they expect.

Vortex

jj2007,

What is your tool to maintain your procedures? You mentioned that by hitting a button, the procedures are exported.

jj2007

#24
Quote from: Vortex on July 12, 2008, 05:59:12 PM
jj2007,

What is your tool to maintain your procedures? You mentioned that by hitting a button, the procedures are exported.

RichMasm - see attached beta. Extract to the root of your Masm32 folder with "use folder names". Then drag
\masm32\RichMasm\MultiLib.asc
over
\masm32\RichMasm\RichMasm.exe
and hit F6. It is more a demo of how a library is being set up than anything else.

Note the delimiter between library modules is LibMod (EDIT: not NxtLib), and it must be a bookmark. To achieve this, either copy a LibMod line, or type LibMod, select it with a double-click, then press Control D as if it was a bookmark in your browser.


[attachment deleted by admin]

jj2007

Is it normal that building a library takes ages? The example posted above takes almost 4 seconds...