flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > feature req: class name in the obj format

Author
Thread Post new topic Reply to topic
BiDark



Joined: 22 Jun 2003
Posts: 109
Location: .th
BiDark 25 Feb 2004, 02:27
Hello Thomasz,

It will be really helful if you could add a feature to specify a class name for a section, like Nasm does. Especially with non-ms linker. Because I'm working on a VxD with Watcom linker. I can't fully control the section over the linker although using a .def file. It did merg a locked code seg and a pageable code seg into the same seg, They are all automatically in AUTO class.
Post 25 Feb 2004, 02:27
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8367
Location: Kraków, Poland
Tomasz Grysztar 25 Feb 2004, 07:13
Post 25 Feb 2004, 07:13
View user's profile Send private message Visit poster's website Reply with quote
BiDark



Joined: 22 Jun 2003
Posts: 109
Location: .th
BiDark 25 Feb 2004, 11:11
Arggh, damn , Im sorry I was missed.
The OW linker is fully compatible with ms omf. Just dig the OW help. Rolling Eyes
Post 25 Feb 2004, 11:11
View user's profile Send private message Reply with quote
Vortex



Joined: 17 Jun 2003
Posts: 318
Vortex 25 Feb 2004, 11:17
Hi BiDark,

Have you any documentation for Watcom linker? I would like to get it.

_________________
Code it... That's all...
Post 25 Feb 2004, 11:17
View user's profile Send private message Visit poster's website Reply with quote
BiDark



Joined: 22 Jun 2003
Posts: 109
Location: .th
BiDark 25 Feb 2004, 11:45
Vortex wrote:

Have you any documentation for Watcom linker? I would like to get it.


Hi Vortex,

You can find the right description for each linker option in the tool.hlp file if you downloaded as a full package (there's not much about creating vxd as I have seen). I don't know which archive file it is reside in if you downloaded as a saparate zip file. But you know, their format is somewhat strage. May be I could help you with the right syntax if you tell me what you are doing with the linker. Smile
Post 25 Feb 2004, 11:45
View user's profile Send private message Reply with quote
Vortex



Joined: 17 Jun 2003
Posts: 318
Vortex 25 Feb 2004, 18:11
Hi BiDark,

To get Watcom linker and other related tools, you can download the file below:

http://openwatcom.mirrors.pair.com/watcom/zips-1.2/cm_core_nt.zip

Is it possible to link Fasm and Masm object files with Watcom linker? Can you give an example?

If I am not mistaken, Watcom linker handles only OMF object code. So, it might be the case of converting COFF to OMF. Digital Mars offers a COFF2OMF tool:

ftp://ftp.digitalmars.com/Digital_Mars_C++/Patch/COFF2OMF.zip

_________________
Code it... That's all...
Post 25 Feb 2004, 18:11
View user's profile Send private message Visit poster's website Reply with quote
BiDark



Joined: 22 Jun 2003
Posts: 109
Location: .th
BiDark 26 Feb 2004, 02:43
Vortex wrote:

Is it possible to link Fasm and Masm object files with Watcom linker? Can you give an example?


Now I realize that class is an internal to the linker. Embarassed

lguide.hlp is the handy linker help file you must have, with detailed (tool.hlp is not much detailed). Right now OW support ms coff too (I don't know since)

For example, suppose you have code below:
Code:
format MS COFF

public main as 'main'

section '.text' code readable executable
main:
        ret
    


here is the linker options I used.

wlink file test.obj name test.exe sys nt opt start=main

file directive is object files you want you link. name directive is output name.
sys is subsystem, nt is console, nt_win is windows. If you want to create the dll add 'sys name dll' to the linker. opt start is how we tell the linker where the entry point is, in this case 'main' is out entry point so opt start=main is used.

Another example:

Code:
format MS COFF

public main as 'main'
extrn '_MessageBoxA@16' as MessageBox

section '.text' code readable executable
main:
        push    20h
        push    cap
        push    msg
        push    0
        call    MessageBox
        ret

section '.data' data readable writeable
        msg db 'Hey',0
        cap db 'All right!',0
    


linked with:

wlink file test.obj name test.exe sys nt_win opt start=main lib user32.lib

lib is library to be used with the linker.
You can find the real description in lguide.hlp help file.
Post 26 Feb 2004, 02:43
View user's profile Send private message Reply with quote
Vortex



Joined: 17 Jun 2003
Posts: 318
Vortex 26 Feb 2004, 10:48
BiDark,

Thanks for your help. If I understand correctly, Watcom linker can process direcltly MS COFF object file? Am I right?

_________________
Code it... That's all...
Post 26 Feb 2004, 10:48
View user's profile Send private message Visit poster's website Reply with quote
BiDark



Joined: 22 Jun 2003
Posts: 109
Location: .th
BiDark 26 Feb 2004, 12:52
Yes, sir...
Post 26 Feb 2004, 12:52
View user's profile Send private message Reply with quote
Vortex



Joined: 17 Jun 2003
Posts: 318
Vortex 26 Feb 2004, 20:53
BiDark,

I tried to use wlink with the options you described; but I got an error message saying "dynamic memory exhausted"

Can you send a small example of using Fasm with wlink? If it's possible,a small zip file containing the example.

_________________
Code it... That's all...
Post 26 Feb 2004, 20:53
View user's profile Send private message Visit poster's website Reply with quote
BiDark



Joined: 22 Jun 2003
Posts: 109
Location: .th
BiDark 27 Feb 2004, 02:40
Use wat.bat to compile.


Last edited by BiDark on 28 Feb 2004, 02:37; edited 1 time in total
Post 27 Feb 2004, 02:40
View user's profile Send private message Reply with quote
Vortex



Joined: 17 Jun 2003
Posts: 318
Vortex 27 Feb 2004, 19:06
Hi BiDark,

Thanks for the example,but I think you forgot to put the wlink.dll file.
I tried to link your example with wlink V1.2, I got error message saying:
Code:
Open Watcom Linker Version 1.2
Portions Copyright (c) 1985-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
Warning! W1107: undefined system name: nt_win
loading object files
searching libraries
Error! E3009: dynamic memory exhausted
    


My O.S is Win Xp Home edition. I guess you are using the latest Watcom linker. BiDark, can you post please the wlink.dll file?

Thanks,

Vortex

_________________
Code it... That's all...
Post 27 Feb 2004, 19:06
View user's profile Send private message Visit poster's website Reply with quote
BiDark



Joined: 22 Jun 2003
Posts: 109
Location: .th
BiDark 28 Feb 2004, 03:19
Oh! you are right.

I think you have been warned becuase you have no linker initialization files (included if you download the full package) and there's no some watcom environment var is defined I guessed.
It have been included in this archive too. Now you have to invoke slightly difference than before. You have to find the right option for 'sys name' in the wlsystem.txt. For example, if you choose 'sys nt_win' to create GUI apps. Just find 'system begin nt_win' in the wlsystem.txt file and the right option for this subsystem is there. Here is what i got for nt_win.

'wlink file test.obj name test.exe format window nt option osname='Windows GUI' opt start=main libpath c:\masm32\lib lib user32,kernel32'
Post 28 Feb 2004, 03:19
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.