The MASM Forum Archive 2004 to 2012

Project Support Forums => The GeneSys Development System => Topic started by: PBrennick on July 15, 2006, 03:30:49 PM

Title: The Library
Post by: PBrennick on July 15, 2006, 03:30:49 PM
A link to the project is coming soon.  In the meantime, I am working on the Library portion of the project.  You can help.  Do you have a favorite subroutine that you find performs a function you have not seen in any other Library?  You can add it to the GeneSys Library by posting it here.

What I will need:
The name of the function (this may change but I will always discuss it with you, first).
The code for the function.
A documentation for the function (a brief discription of its purpose).
Your name as you would like it to appear in the source. (Usernames are acceptable for people who do not want their real name used).
You must allow me to include the source in the project, the source for ALL Library code will be listed in the project.

This is your opportunity to contribute to something that will be used around the world, isn't that exciting?
Paul

Title: Re: The Library
Post by: PBrennick on July 15, 2006, 09:44:37 PM
The library has been updated.  Two functions have been added and three have been renamed.  The two versions have been moved to the repository and is no longer an attachment to this topic.  This makes things a whole lot simpler.

DLL Version (http://x86assembly.codegurus.org/dllVersion.zip)
Library Version (http://x86assembly.codegurus.org/GSLib.zip)

This is the current list of functions:
        ClearConsole
        CompareStr
        ConsoleIn
        ConsoleOut
        CopyMem
        CopyString
        CreateBmpFromMem
        GetErrorMessage
        GetScreenHeight
        GetScreenWidth
        LowerCase
        StrLen
        UpperCase
        WriteToMemHeap

How does the list of names look?
Paul
Title: Re: The Library
Post by: Vortex on July 15, 2006, 11:22:15 PM
Good start Paul. I will send tomorrow my CreateBmpFromMem function to be a member of the library.

Paul, would you like to rename the library as GeneSys.lib ?
Title: Re: The Library
Post by: James Ladd on July 15, 2006, 11:30:23 PM

Wow, code already. You guys rock.

Can I ask for a DLL as well as a LIB? I prefer dynamic linking to static.

Rgs, James.
Title: Re: The Library
Post by: PBrennick on July 15, 2006, 11:44:06 PM
James,
Look in tomorrow, if you get the chance, I will have a DLL, then.  I will wait until after Erol makes his submission and then create it.  He is seven hours ahead of me so it will probably be there first thing in my morning which is [GMT-5]

Vortex,
Okay, I will rename the library and the DLL to GeneSys respectively.  Good idea.  The name of the folder in the project will have to have another name as the entire package will be installed into a GeneSys folder so I don't want a path like \GeneSys\GeneSys\GeneSys.lib, the one in the middle needs to change.  Any ideas, anyone?

Paul
Title: Re: The Library
Post by: zooba on July 16, 2006, 12:54:17 AM
GSLIB?

I'm willing to contibute my StringFormat procedure, similar but IMHO cleaner and more appropriate for assembly than C's.

Cheers,

Zooba :U
Title: Re: The Library
Post by: PBrennick on July 16, 2006, 04:48:50 AM
Zooba,
Feel free to contribute.

What I will need:
The name of the function (this may change but I will always discuss it with you, first).
The code for the function.
A documentation for the function (a brief discription of its purpose).
Your name as you would like it to appear in the source. (Usernames are acceptable for people who do not want their real name used).
You must allow me to include the source in the project, the source for ALL Library code will be listed in the project.

Thank you for participating in this project.

Paul
Title: Re: The Library
Post by: zooba on July 16, 2006, 05:41:09 AM
Paul,

Before I contribute it I'd prefer to get a feel for how the library will be structured. There is quite a lot of modification required to use it separately from ASM Runtime and I'd rather see the support functions required (quite a few) provided by others. I'd also prefer to be able to preserve the 'look-and-feel' of the library, rather than having a whole mish-mash of different interfaces, etc.

Cheers,

Zooba :U
Title: Re: The Library
Post by: James Ladd on July 16, 2006, 06:01:19 AM
Guys,

Can I suggest that you use my subversion repository and server for the source so you can work
on it between yourselves and not clobber each others work ?

Subversion is so simple to use and for what you are doing, source / version control is a must.

PM me if you want to know more.

Rgs, James.
Title: Re: The Library
Post by: PBrennick on July 16, 2006, 07:31:54 AM
There is a dll version of the library and a new lib version.  The zip at the start of the topic has been replaced with the new stuff.

Paul
Title: Re: The Library
Post by: Vortex on July 16, 2006, 07:52:58 AM
Hi Paul,

Why not to put GeneSys.lib in the lib folder? It should be together with the import libraries, in my modest opinion.
Title: Re: The Library
Post by: Vortex on July 16, 2006, 10:01:20 AM
Here is my CreateBmpFromMem procedure with a demo.

[attachment deleted by admin]
Title: Re: The Library
Post by: Vortex on July 16, 2006, 10:48:14 AM
There is an easy way to build the DLL. Paul, you can use a simple GeneSys main module without rewriting the library source code :

GeneSys.asm :
.386
.model flat,stdcall
option casemap:none

Include \GeneSys\include\windows.inc
Include \GeneSys\include\kernel32.inc
Include \GeneSys\include\gdi32.inc
Include \GeneSys\include\shell32.inc
Include \GeneSys\include\user32.inc
Include GeneSys.inc

IncludeLib \GeneSys\lib\kernel32.lib
Includelib \GeneSys\lib\gdi32.lib
Includelib \GeneSys\lib\shell32.lib
Includelib \GeneSys\lib\user32.lib

DLL_PROCESS_DETACH equ 0
DLL_PROCESS_ATTACH equ 1

.code

DllEntry proc hInst:HINSTANCE, dReason:DWORD, reserved1:DWORD
    mov eax, dReason
    .if eax == DLL_PROCESS_ATTACH
      xor eax, eax
      inc eax
    .elseif eax == DLL_PROCESS_DETACH
      xor eax, eax
      inc eax
    .endif
    ret
DllEntry Endp

End DllEntry


make.bat :
\GeneSys\bin\ml /c /coff @library.rsp
\GeneSys\bin\ml /c /coff GeneSys.asm
\GeneSys\bin\link /SUBSYSTEM:WINDOWS /DLL /DEF:GeneSys.def GeneSys.obj @library2.rsp


library2.rsp :
conin.obj
conout.obj
copymem.obj
lower.obj
ScreenDim.obj
strlen.obj
upper.obj



[attachment deleted by admin]
Title: Re: The Library
Post by: PBrennick on July 16, 2006, 12:40:35 PM
Vortex,
I will switch to your method,  Late last night, I tried something similar and kept getting export errors.  It was very frustrating and I was just too tired to figure it out.  What would happen is conin always exported correctly but the other seven always failed.  I was using the include command to put the various sources directly into GeneSys.asm, it just would not expand correctly.  Another one of those very frustrating failures of the assembler.  As soon as I manually added the procs, everything all of a sudden worked.  The method I used is not a problem right now but as the library grows, it will become a real problem.  So, once again, you have come to my rescue.  Thank you, my friend.

The lib 'is' copied to the lib directory, you can see this towards the end of make.bat, the dll is not.  I am not sure where to put the created DLL so for the moment, I am leaving it right where it was created.  Should I put the DLL in the root of the \GeneSys folder along with GeneSys.exe (the editor)?

Also, about the editor, Ultrano, elsewhere complained about the spash screen.  While it is true that the way I designed the editor allows the user to remove the splash screen if they don't like it by deleting the DLL (splash.dll) most will not realize this.  Should I just completely remove the spash screen code?

Paul
Title: Re: The Library
Post by: PBrennick on July 16, 2006, 03:15:58 PM
There is a new dll version of the library and a new lib version.  The zip in the second posting at the start of the topic has been replaced with the new stuff.

I apologize for the frequent updates to these two modules.  I want to keep the library up-to-date.  I will try to limit this to only one update a day and once it comes up to speed things will slow down from there.  Thank you for understanding.

Paul
Title: Re: The Library
Post by: Vortex on July 16, 2006, 05:06:06 PM
Hi Paul,

The update looks fine. I think you didn't include CreateBmpFromMem in the DLL. Could you check it?

In my modest opinion, you should put GeneSys.dll in the bin folder. I saw that Pelle puts everytime his C run-time DLL pocrt.dll in the bin folder. I guess this is a good programming practice.

Your splash screen is nice. Maybe, you can put a notification message during the installation of the package to allow the users to remove the dll displaying the splash screen if they wish. This message should instruct the user how to remove or re-install the dll depending on his choice.
Title: Re: The Library
Post by: PBrennick on July 16, 2006, 05:23:01 PM
Vortex,
I forgot to add it to the EXPORT table in the DEF file, I will fix it now.

Okay, it is in there now and the zip has been updated.  Sorry about that.

Paul
Title: Re: The Library
Post by: James Ladd on July 16, 2006, 10:08:49 PM
Guys,

This is a great start to what im sure will be a fine library.

Please can you ensure that with each library function the is a set of test routines to test them?
I know this sounds like a lot more work but it serves many purposes. Like:

1. People can look at a test to see how to use the function
2. People can make a small change and run all the tests to ensure that nothing is broken
    by the change.
3. People can be confident that the function is tested and workable before trying to  use
    it.
4. People can submit new routines but only if they supply the test. This helps you as well.
5. It will save you a lot of time in the future, trust me on this.

I'd suggest the test suite is not part of the core library but a stand-alone exe / library that
loads yours dynamically and tests each routine. Personally I'd go for a single or more exe to test
each function, with the simple batch loop to output pass or fail based on the return code.

The test code is also a good place to put timing / performance measurement code which is also
a plus for such a library.

Yes I practice this myself and this is what I have done for my projects. I just haven posted
this version of the projects yet.

Rgs, James.
Title: Re: The Library
Post by: PBrennick on July 17, 2006, 12:39:14 AM
James,
Some of this has already been done.  I have only had 5 hours sleep since Friday morning as I am scrambling to get the whole project up and running.  I will be posting the entire project tomorrow and then since the majority of the project is static, Vortex and I will have more free time.  He will be working on mixed C and ASM examples and I will be working on demo code and documentation.  Timing stuff may or may not be done, depending on how much time I have day-to-day.

Right now, Erol and I are in firefighting mode, I will be glad when things get to the main thrust of this project, helping others but that isn't going to happen until the project puts in an appearance.

Paul
Title: Re: The Library
Post by: PBrennick on July 19, 2006, 04:42:59 AM
The library has been updated.  Two functions have been added and three have been renamed.  The two versions have been moved to the repository and is no longer an attachment to this topic.  This makes things a whole lot simpler.

DLL Version (http://x86assembly.codegurus.org/dllVersion.zip)
Library Version (http://x86assembly.codegurus.org/GSLib.zip)

This is the current list of functions:
        ClearConsole
        CompareStr
        ConsoleIn
        ConsoleOut
        CopyMem
        CopyString
        CreateBmpFromMem
        GetErrorMessage
        GetScreenHeight
        GetScreenWidth
        LowerCase
        StrLen
        UpperCase
        WriteToMemHeap

How does the list of names look?
Paul
Title: Re: The Library
Post by: Shantanu Gadgil on July 19, 2006, 04:47:35 AM
Hi,
I like the naming convention!  :U :U :U

Any plans of making _ALL_ the function names adhere to a standard pattern (I can see "copymem" in all small)?

Regards,
Shantanu
Title: Re: The Library
Post by: PBrennick on July 19, 2006, 06:17:15 AM
Sorry, I am currently updating the Repository.  The new version of the library has it correctly.  I am updating the GeneSys project right now/ So, in about five minutes the new library stuff will be there.

Paul