News:

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

Lazy Assembler example

Started by Vortex, May 01, 2005, 02:41:21 PM

Previous topic - Next topic

Vortex

The Lazy Assembler ( LzAsm) is available from:

http://lzasm.hotbox.ru

Quote
LZASM is an x86 assembler for DOS and Windows that handles the TASM (Turbo Assembler) IDEAL mode and produces OMF OBJ files. Support MMX, SSE, SSE2, SSE3 (PNI), 3DNow!Pro instructions.

[attachment deleted by admin]

pbrennick

Hi Vortex,
You seem to know a lot about polib so maybe you can tell me why creating kernel32.lib yields the following:

Quote
POLIB: warning: Symbol 'AddVectoredExceptionHandler' is forwarded to 'NTDLL.RtlAddVectoredExceptionHandler'; assuming it's a function.
POLIB: warning: Symbol 'DecodePointer' is forwarded to 'NTDLL.RtlDecodePointer'; assuming it's a function.
POLIB: warning: Symbol 'DecodeSystemPointer' is forwarded to 'NTDLL.RtlDecodeSystemPointer'; assuming it's a function.
POLIB: warning: Symbol 'DeleteCriticalSection' is forwarded to 'NTDLL.RtlDeleteCriticalSection'; assuming it's a function.
POLIB: warning: Symbol 'EncodePointer' is forwarded to 'NTDLL.RtlEncodePointer'; assuming it's a function.
POLIB: warning: Symbol 'EncodeSystemPointer' is forwarded to 'NTDLL.RtlEncodeSystemPointer'; assuming it's a function.
POLIB: warning: Symbol 'EnterCriticalSection' is forwarded to 'NTDLL.RtlEnterCriticalSection'; assuming it's a function.
POLIB: warning: Symbol 'GetLastError' is forwarded to 'NTDLL.RtlGetLastWin32Error'; assuming it's a function.
POLIB: warning: Symbol 'HeapAlloc' is forwarded to 'NTDLL.RtlAllocateHeap'; assuming it's a function.
POLIB: warning: Symbol 'HeapFree' is forwarded to 'NTDLL.RtlFreeHeap'; assuming it's a function.
POLIB: warning: Symbol 'HeapReAlloc' is forwarded to 'NTDLL.RtlReAllocateHeap'; assuming it's a function.
POLIB: warning: Symbol 'HeapSize' is forwarded to 'NTDLL.RtlSizeHeap'; assuming it's a function.
POLIB: warning: Symbol 'InitializeSListHead' is forwarded to 'NTDLL.RtlInitializeSListHead'; assuming it's a function.
POLIB: warning: Symbol 'InterlockedFlushSList' is forwarded to 'NTDLL.RtlInterlockedFlushSList'; assuming it's a function.
POLIB: warning: Symbol 'InterlockedPopEntrySList' is forwarded to 'NTDLL.RtlInterlockedPopEntrySList'; assuming it's a function.
POLIB: warning: Symbol 'InterlockedPushEntrySList' is forwarded to 'NTDLL.RtlInterlockedPushEntrySList'; assuming it's a function.
POLIB: warning: Symbol 'LeaveCriticalSection' is forwarded to 'NTDLL.RtlLeaveCriticalSection'; assuming it's a function.
POLIB: warning: Symbol 'QueryDepthSList' is forwarded to 'NTDLL.RtlQueryDepthSList'; assuming it's a function.
POLIB: warning: Symbol 'RemoveVectoredExceptionHandler' is forwarded to 'NTDLL.RtlRemoveVectoredExceptionHandler'; assuming it's a function.
POLIB: warning: Symbol 'RestoreLastError' is forwarded to 'NTDLL.RtlRestoreLastWin32Error'; assuming it's a function.
POLIB: warning: Symbol 'RtlCaptureContext' is forwarded to 'NTDLL.RtlCaptureContext'; assuming it's a function.
POLIB: warning: Symbol 'RtlCaptureStackBackTrace' is forwarded to 'NTDLL.RtlCaptureStackBackTrace'; assuming it's a function.
POLIB: warning: Symbol 'RtlFillMemory' is forwarded to 'NTDLL.RtlFillMemory'; assuming it's a function.
POLIB: warning: Symbol 'RtlMoveMemory' is forwarded to 'NTDLL.RtlMoveMemory'; assuming it's a function.
POLIB: warning: Symbol 'RtlUnwind' is forwarded to 'NTDLL.RtlUnwind'; assuming it's a function.
POLIB: warning: Symbol 'RtlZeroMemory' is forwarded to 'NTDLL.RtlZeroMemory'; assuming it's a function.
POLIB: warning: Symbol 'SetCriticalSectionSpinCount' is forwarded to 'NTDLL.RtlSetCriticalSectionSpinCount'; assuming it's a function.
POLIB: warning: Symbol 'SetLastError' is forwarded to 'NTDLL.RtlSetLastWin32Error'; assuming it's a function.
POLIB: warning: Symbol 'TryEnterCriticalSection' is forwarded to 'NTDLL.RtlTryEnterCriticalSection'; assuming it's a function.
POLIB: warning: Symbol 'VerSetConditionMask' is forwarded to 'NTDLL.VerSetConditionMask'; assuming it's a function.

Thanks,
Paul

roticv

I guess polib just inform you that some of the exports are forward references?

pbrennick

roticv
I can see it is a forward reference.  I guess I just don't understand the 'assuming it is a function' stuff.  It's probably a stupid question, anyway, but thanks for the reply.

Paul

Vortex

Hi Paul,

Just as Victor said, all those warning messages informs the user about forwarded references. The libs created by polib are intented to avoid decorated function names.

pbrennick

Vortex,
Thank you for your reply.  I am still trying to grasp DLLs and I still have a tendency to use them for single procedure calls  (overlay type behavior from my background) which I do know is inefficient.  But this 'decorated names' stuff is greek to me, sorry to show my stupidity.

Paul

AeroASM

Quote from: pbrennick on May 03, 2005, 09:08:32 PM
But this 'decorated names' stuff is greek to me

To avoid function name clashes between (OOP) modules (and so ensure encapsulation) each function name is decorated before compiling for example GlobalAddAtom becomes &&&KERNEL32.DLL??$??GlobalAddAtom?AAGGX.

However these are annoying when interfacing with other languages which do not decorate e.g. asm because you have to work the what the decorated name from compiler listings and ironically decorated names are ugly.

Vortex

Hi Paul,

LzAsm emits non-decorated function names in the object file like Tasm. So, to link the object files with MS Link, you have to use import libraries with non-decorated names. That was the problem to solve. Thanks to Pelle, polib can exract such libraries from DLLs. Also, MS link cares of the object file coversion from OMF to COFF.

Another opportunity should be link to LzAsm OMF object files with the linker from Digital Mars. I will try this one also.

pbrennick

Vortex,
I have Digital Mars in my library.  I never thought to try its linker with asm.  I think I, also, will give it a play just to see what happens.  I like Pelle's stuff, though.

Paul

Vortex

Hi Paul,

The linker from Digital Mars is the best one for OMF object files. This time, I created the import libraries with the DM librarian.
You can find the example rebuilded with the DM tools.

[attachment deleted by admin]

Vortex

Hi Paul,

You can use the non-decorated libraries generated by polib with Masm, the example code uses the stdcall calling convention.

[attachment deleted by admin]

pbrennick

Hi Vortex,
Thank you for the masm32 example.  I prefer to use masm32.  Interestingly enough, thanks to you, I have figured out my problem and it is not what you might expect!  The version of polib.exe that I have been using is to old (10Dec03) and does not support /nound.  Unfortunately, it would not error out (I think it should) but would just issue a warning and since kernel32.dll would generate 18 other warnings, it was not obvious and was easy to miss.  I am glad you included polib.exe with your lzasm example!!  I am going to get the most recent version in a minute.

Paul