flat assembler
Message board for the users of flat assembler.

Index > DOS > The standard .com sceleton on fasm?

Author
Thread Post new topic Reply to topic
FASMresearcher



Joined: 28 May 2008
Posts: 24
FASMresearcher 15 Jun 2008, 14:48
Hi, All!
Question is simple.

Must I use the some standard sceleton during writing the FASM .com executable code?
For example:

Code:
.model tiny
.386
org 100h
.code
......
entry_point:


end entry_point    


If not, the commands like:
Code:
push cs
pop  ds
and others...    

Is it necessarily?
And how I can mark the start/end of programm?
Post 15 Jun 2008, 14:48
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20303
Location: In your JS exploiting you and your system
revolution 15 Jun 2008, 14:54
See the example that comes with the fasm download.
Post 15 Jun 2008, 14:54
View user's profile Send private message Visit poster's website Reply with quote
rCX



Joined: 29 Jul 2007
Posts: 172
Location: Maryland, USA
rCX 15 Jun 2008, 15:28
Quote:

Must I use the some standard sceleton during writing the FASM .com executable code?


All you really need is...
Code:
org 100h
;code goes here
    


...but you can also use...
Code:
format binary as "com"  
use16                          ;use 16 bit registers
org 100h
;code goes here
    


As revolution said you should look at the COMDEMO, or LIFE examples that come with fasm. Wink
_________________
"To define Recursion we first need to define Recursion."
Post 15 Jun 2008, 15:28
View user's profile Send private message Reply with quote
FASMresearcher



Joined: 28 May 2008
Posts: 24
FASMresearcher 16 Jun 2008, 08:50
revolution wrote:
See the example that comes with the fasm download.

Great thanks!
Post 16 Jun 2008, 08:50
View user's profile Send private message Reply with quote
FASMresearcher



Joined: 28 May 2008
Posts: 24
FASMresearcher 16 Jun 2008, 08:53
rCX wrote:

...but you can also use...
Code:
format binary as "com"  
use16                          ;use 16 bit registers
org 100h
;code goes here
    


Great thanks!

As revolution said you should look at the COMDEMO, or LIFE examples that come with fasm. Wink
_________________
"To define Recursion we first need to define Recursion."[/quote]
Post 16 Jun 2008, 08:53
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1900
DOS386 16 Jun 2008, 09:54
> .model tiny

Not needed and prohibited Laughing

> .386

Regrettably not supported ... but there are some macros

> org 100h

Required ... or org $0100 Wink

Code:
.code
entry_point:
end entry_point
    


Not needed and prohibited Laughing

Code:
push cs
pop  ds
    


Required for MZ, optional for COM Wink

> And how I can mark the start/end of programm?

Not needed Wink

Code:
; END.
    


Code:
format binary as "COM" ; better than undocumented guesses Wink  
use16                  ; use 16 bit code (default anyway)
org $0100              ; critical       
;code goes here
    


Code:
assume blah:yes
    


Not needed and prohibited Laughing

_________________
Bug Nr.: 12345

Title: Hello World program compiles to 100 KB !!!

Status: Closed: NOT a Bug
Post 16 Jun 2008, 09:54
View user's profile Send private message Reply with quote
wht36



Joined: 18 Sep 2005
Posts: 106
wht36 22 Jun 2009, 14:39
org 100h - because DOS loads .com files at address 100h

bytes 0-FF = program segment prefix = holds command line, environment table pointer, file control blocks, etc. (check HelpPC)
Post 22 Jun 2009, 14:39
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.