flat assembler
Message board for the users of flat assembler.

Index > Main > Is it normal?

Author
Thread Post new topic Reply to topic
Necromancer13.13



Joined: 20 Apr 2008
Posts: 15
Location: Ukraine
Necromancer13.13 26 Aug 2008, 17:37
I'm trying to assemble this:

Code:
format COFF
start:
        mov     ah,9
        mov     dx,mess
        int     21h
        mov     ah,10h
        int     16h
        int     20h
        mess    db 'Hello World!',0Dh,0Ah,'$'
    


But I get : mov dx,mess: invalid use of symbol.
and When I add "org 100h" then there is no error.
Is it normal that fasm doesn't assemble it without org 100h?

_________________
FASM Rules!
Post 26 Aug 2008, 17:37
View user's profile Send private message MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 26 Aug 2008, 17:50
TFM wrote:
2.4.3 Common Object File Format

To select Common Object File Format, use format COFF or format MS COFF directive whether you want to create classic or Microsoft's COFF file. The default code setting for this format is 32-bit. To create the file in Microsoft's COFF format for the x86-64 architecture, use format MS64 COFF setting, in such case long mode code is generated by default.


By using EDX instead of DX also solves the problem but, is this really a DOS program? Why are you using COFF instead of direct COM or MZ?
Post 26 Aug 2008, 17:50
View user's profile Send private message Reply with quote
Necromancer13.13



Joined: 20 Apr 2008
Posts: 15
Location: Ukraine
Necromancer13.13 26 Aug 2008, 17:56
I just try to get binary file like COM file but without org 100h
Post 26 Aug 2008, 17:56
View user's profile Send private message MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 26 Aug 2008, 18:02
COFF is not binary, it is an intermediate format intended for a linker to read.
Post 26 Aug 2008, 18:02
View user's profile Send private message Visit poster's website Reply with quote
Necromancer13.13



Joined: 20 Apr 2008
Posts: 15
Location: Ukraine
Necromancer13.13 26 Aug 2008, 18:12
Oh.. I wanted to say that I want to get the COFF file and than link it with LINKER to binary.. is it possible? Smile
Post 26 Aug 2008, 18:12
View user's profile Send private message MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 26 Aug 2008, 18:15
Why not just use "format binary"?
Post 26 Aug 2008, 18:15
View user's profile Send private message Visit poster's website Reply with quote
asmcoder



Joined: 02 Jun 2008
Posts: 784
asmcoder 26 Aug 2008, 18:29
[content deleted]


Last edited by asmcoder on 14 Aug 2009, 14:56; edited 1 time in total
Post 26 Aug 2008, 18:29
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 26 Aug 2008, 18:30
asmcoder wrote:
what is linker?
Have I introduced you to my website yet?
Post 26 Aug 2008, 18:30
View user's profile Send private message Visit poster's website Reply with quote
Necromancer13.13



Joined: 20 Apr 2008
Posts: 15
Location: Ukraine
Necromancer13.13 26 Aug 2008, 19:31
Quote:
Why not just use "format binary"?

Because I think, that it's better to use object files when writing a big project.

Quote:
what is linker?

Hm... I don't know what linker can do it... May be ld86, LINK16 or Unilink.
Post 26 Aug 2008, 19:31
View user's profile Send private message MSN Messenger ICQ Number Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
edfed 26 Aug 2008, 19:39
a linker is something (prehistoric) useless.
fasm does it transparently.
Post 26 Aug 2008, 19:39
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 26 Aug 2008, 19:44
Necromancer13.13 wrote:
Quote:
Why not just use "format binary"?

Because I think, that it's better to use object files when writing a big project.
If you are mixing tools (like C & assembly) then a linker is usually needed. But just using the size of the project would seem to be a bad metric to use to decide upon using a linker. Any extra step that may not be needed could be a waste of effort. A better metric might be whether it is needed. Wink
Post 26 Aug 2008, 19:44
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 27 Aug 2008, 05:56
Quote:
If you are mixing tools (like C & assembly) then a linker is usually needed. But just using the size of the project would seem to be a bad metric to use to decide upon using a linker. Any extra step that may not be needed could be a waste of effort. A better metric might be whether it is needed.

Ever tried recompiling 2MB C code after every small change?
Post 27 Aug 2008, 05:56
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 27 Aug 2008, 07:40
vid wrote:
Quote:
If you are mixing tools (like C & assembly) then a linker is usually needed. But just using the size of the project would seem to be a bad metric to use to decide upon using a linker. Any extra step that may not be needed could be a waste of effort. A better metric might be whether it is needed.

Ever tried recompiling 2MB C code after every small change?
One presumes it takes a long time. If so then that can fit into the needed category. I don't see the problem.
Post 27 Aug 2008, 07:40
View user's profile Send private message Visit poster's website 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.