flat assembler
Message board for the users of flat assembler.

Index > DOS > a advice for the Fasm complier--The obj format for DOS

Author
Thread Post new topic Reply to topic
Kevin_Zheng



Joined: 04 Jul 2003
Posts: 125
Location: China
Kevin_Zheng
Dear privalov:
The fasm complier is a excellent complier. But I think that you maybe support the obj format for DOS. The obj format have been supported on the Win32, why don't suppored on the DOS? Because I have joined a large project and the project needed another external modules. If the fasm suppored the obj format , It will fitting the large project.

Think you.
Wink
Post 04 Jul 2003, 11:57
View user's profile Send private message MSN Messenger Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7734
Location: Kraków, Poland
Tomasz Grysztar
There are linkers for DOS that accept COFF format and this is now the only solution - I was considering adding OMF support, but it would be very hard with the "flat" architecture of fasm.
Post 09 Jul 2003, 20:20
View user's profile Send private message Visit poster's website Reply with quote
Kevin_Zheng



Joined: 04 Jul 2003
Posts: 125
Location: China
Kevin_Zheng
Dear privalov:
I have writed a program for DOS that used COFF format . Please used the build.bat for linked it.
In the first, using the fasm complier for getting a COFF OBJ module, Then used the blink.exe linked it .
Thanks you big helping.
Smile
Code:
FORMAT  MS COFF
section '.text' code readable executable
        USE16        
 public _Start

 _Start:
        call    near   @f      
@@:
        pop     ebx
        mov     eax,@b
        sub     ebx,eax                 ;Calculate the Loaded Address
        mov     ah,9
        mov     edx,hello
        add     edx,ebx                 ;Get the Runtime Adddress
        int     21H
        mov     ax,4c00H
        int     21H


section '.data' data readable writeable
        hello   db      'MS COFF OBJ Format for DOS Demo Program',0DH,0AH
                db      'Hello, The FASM World!',0DH,0AH
                db      'Designer:Kevin Zheng 2003/07/16','$'

    
Post 16 Jul 2003, 14:58
View user's profile Send private message MSN Messenger Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7734
Location: Kraków, Poland
Tomasz Grysztar
There was a problem with your attachment, please post it again.

BTW: for DOS programs you'll probably have to use "format COFF" variant instead of "format MS COFF", but it may depend on what linker are you using. The most important difference is in dealing with calls to procedures in other objects - the Microsoft COFF uses in that case relocations which are not compatible with original COFF format.
Post 16 Jul 2003, 17:20
View user's profile Send private message Visit poster's website Reply with quote
Kevin_Zheng



Joined: 04 Jul 2003
Posts: 125
Location: China
Kevin_Zheng
Dear privalov:
Thanks your advice. I have modified it and repost it.


Description:
Download
Filename: doscoff.zip
Filesize: 34.06 KB
Downloaded: 323 Time(s)

Post 17 Jul 2003, 09:43
View user's profile Send private message MSN Messenger Reply with quote
Vortex



Joined: 17 Jun 2003
Posts: 318
Vortex
Kevin_Zheng,

Thanks for your nice example.
Where can I find a manual for blink?

Regards,

Vortex

_________________
Code it... That's all...
Post 17 Jul 2003, 11:37
View user's profile Send private message Visit poster's website Reply with quote
Kevin_Zheng



Joined: 04 Jul 2003
Posts: 125
Location: China
Kevin_Zheng
Dear Vortex:

The blink.exe is downloaded from the belowing network address:
http://edenos.myrice.com/.
The author of the blink.exe is a China. The language is a problem.
And others, I haven't found another COFF linker for DOS enviroment.
So you maybe found it.
Best Regards.
Post 17 Jul 2003, 14:35
View user's profile Send private message MSN Messenger Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7734
Location: Kraków, Poland
Tomasz Grysztar
DJGPP uses COFF format natively (compiles programs for DPMI), there's also a DOS version of binutils, which has built-in support for COFF files.
Post 17 Jul 2003, 14:56
View user's profile Send private message Visit poster's website Reply with quote
Vortex



Joined: 17 Jun 2003
Posts: 318
Vortex
Hi Kevin_Zheng,

Your commandline:
Code:
blink /b161000 doscoff.obj,doscoff.exe
    


So,how you found the 161000 value? Is it an experimental result?

Have a look at Wuschel's DOS extender,it can be helpfull for you:

http://michael.tippach.bei.t-online.de/wdosx/

Thanks,

Vortex

_________________
Code it... That's all...
Post 17 Jul 2003, 18:04
View user's profile Send private message Visit poster's website Reply with quote
Kevin_Zheng



Joined: 04 Jul 2003
Posts: 125
Location: China
Kevin_Zheng
Dear Vortex:
Please see the helpping of blink.exe .

"blink /b16100 doscoff.obj,doscoff.exe " It means the 16-bit segment and base address on the 100H.
<<User Help screen
Blink 1.04 by swordhui
Support OMF and COFF format. also support OMF+COFF !
Usage: Blink [options] objfiles,binName,MapName,libNames
Options:
/b16XXXX Specify base address of 16-bit segment.
/b32XXXXXXXX Specify base address of 32-bit segment.
/c Case sensitivity on symbol.
/r Generate relocation file(.rlc).
Sample:
blink /b167C00 /b3210000 test1+test2,test.bin,,lib+lib2

And Others, DJGPP and wdosx linker needed extra DPMI memory manager. But I don't liked the extra memory manager, Because I hoped my program worked freely , the TSR memory manager will affort some compatiblity err and it's maximum ability that only supported 16M memory. I have writed a subroutine that used for enter protected mode and adjusted the CPU mode is BIG real mode, so I directly accessed 4GB memory. in the future, I will added a routine for supported Intel CPU PAE mode. It's supported the 64G memroy. I think that it is the best for using memory method on the DOS enviroment.
So I only needed a linker that support 16 bit segments mixed 32 bit segments and supported a pure dos MZ file. It means doen't needed extra TSR memroy manager.
Thanks your helping.
Post 18 Jul 2003, 12:53
View user's profile Send private message MSN Messenger 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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.