flat assembler
Message board for the users of flat assembler.

Index > Main > Fasm help needed! Please!

Author
Thread Post new topic Reply to topic
M. NosJam



Joined: 05 Dec 2004
Posts: 2
M. NosJam 05 Dec 2004, 08:32
Am currently using Fasm in Dos to write some small programs. I have run into
a few things, that forces me to ask for help. on a few things, since it appears that I am a moronic novice trying to learn something new. And would appreciate any answers or assistance from those with more expertise than me.

1st problem. Without specifying format directive which outputs to a .exe file, at compile time all programs show under debug, dissassemble at address cs:100 as if there is a default or implied 'org 100' in the source file, which there is not. Yet, when using the 'format MZ' directive adds 32 more bytes to the compiled file size. Guess my question is why?

2nd problem. Without the format directive none of my programs' error messages ever display on invalid keypresses. Disassembly under debug shows that though text is included in the exe file, it is always the pointer to the data is always off by 256 bytes, while program works as it should on all valid key presses. Which makes no sense, whether 'mov dx, text' or 'mov dx,[text] is used or even the 'segment text'(<-- results in 'illegal instruction' error) is used. besides the 'format directive' why does it matter?

3rd problem. Have read the manual, and wondered if there is one for Fasm
with a little more information as to proper syntax use of Fasm's directives and idiosyncrocies of which I am yet unaware of?

Have tried a few suggested recommendations given to others, to no avail
so am looking forward to all or any replies
Post 05 Dec 2004, 08:32
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 05 Dec 2004, 15:45
howdy

M. NosJam wrote:

1st problem. Without specifying format directive which outputs to a .exe file, at compile time all programs show under debug, dissassemble at address cs:100 as if there is a default or implied 'org 100' in the source file, which there is not. Yet, when using the 'format MZ' directive adds 32 more bytes to the compiled file size. Guess my question is why?

because exe files have headers, in addition to machine code, which is used by the os. search for some header descriptions, there are many, and different in most os-es.

M. NosJam wrote:

2nd problem. Without the format directive none of my programs' error messages ever display on invalid keypresses. Disassembly under debug shows that though text is included in the exe file, it is always the pointer to the data is always off by 256 bytes, while program works as it should on all valid key presses. Which makes no sense, whether 'mov dx, text' or 'mov dx,[text] is used or even the 'segment text'(<-- results in 'illegal instruction' error) is used. besides the 'format directive' why does it matter?

because when you write "org 256" you are telling the compiler to organize offsets to +256 byte Smile

M. NosJam wrote:

3rd problem. Have read the manual, and wondered if there is one for Fasm
with a little more information as to proper syntax use of Fasm's directives and idiosyncrocies of which I am yet unaware of?

well, maeby more info will be included soon.

M. NosJam wrote:

Have tried a few suggested recommendations given to others, to no avail
so am looking forward to all or any replies

so more problems?
Post 05 Dec 2004, 15:45
View user's profile Send private message Visit poster's website Reply with quote
M. NosJam



Joined: 05 Dec 2004
Posts: 2
M. NosJam 07 Dec 2004, 00:32
Hey! Matrix!

Appreciate the quick response! Am I to presume then without the 'format' directive in the source file, that at compile time Fasm defaults to an 'implied' org directive? And is something I should be aware of?
Post 07 Dec 2004, 00:32
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.