flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > END directive

Author
Thread Post new topic Reply to topic
SeproMan



Joined: 11 Oct 2009
Posts: 70
Location: Belgium
SeproMan 07 Nov 2010, 14:39
Does FASM have a (pre-processor) directive to divide a source file into 2 parts of which the latter will not be included in the compilation? Other assemblers do this with the "END" directive.

I use the 2nd part of my source files as a repository of all kinds of documentation and code snippets I don't just yet want to throw away. Because it can grow quite large, it's not an option to comment out every single line.
Currently I'm using conditional assembly as a work-around but I find it awkward.

_________________
Real Address Mode.
Post 07 Nov 2010, 14:39
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 07 Nov 2010, 14:48
IIRC ASCII EOF character should work (IMO a stupid DOS legacy)
Post 07 Nov 2010, 14:48
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: 20343
Location: In your JS exploiting you and your system
revolution 07 Nov 2010, 14:52
I didn't think fasm has such a feature. match +,- {...} can also be used to disable things but you need to backslash-escape any internal '}'.

BTW: There are many editors out there that can auto-comment out lines. The editor I use (Notepad2) uses CTRL-Q to comment/uncomment all currently selected lines.
Post 07 Nov 2010, 14:52
View user's profile Send private message Visit poster's website Reply with quote
SeproMan



Joined: 11 Oct 2009
Posts: 70
Location: Belgium
SeproMan 07 Nov 2010, 15:22
vid,

Neat trick! However the editor I'm using (Norton Editor) does not allow the insertion of ASCII symbol 1Ah. Do you know of an editor that does?
Post 07 Nov 2010, 15:22
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 07 Nov 2010, 15:35
for what OS?
Post 07 Nov 2010, 15:35
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
SeproMan



Joined: 11 Oct 2009
Posts: 70
Location: Belgium
SeproMan 07 Nov 2010, 15:43
1. MS-DOS
2. Windows98
Post 07 Nov 2010, 15:43
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 07 Nov 2010, 18:50
Well, both are too old for me to give you answer. My advice is to keep notes in separate file from sources, and to move on to newer OSes.
Post 07 Nov 2010, 18:50
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
SFeLi



Joined: 03 Nov 2004
Posts: 138
SFeLi 08 Nov 2010, 15:03
SeproMan, fasmw works perfectly under 98 and allows insertion of EOF character (Alt+026).
Post 08 Nov 2010, 15:03
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 08 Nov 2010, 15:56
vid wrote:
IIRC ASCII EOF character should work (IMO a stupid DOS legacy)
...
Well, both are too old for me to give you answer. My advice is to keep notes in separate file from sources, and to move on to newer OSes.


DOS Defender, to the rescue!!!

Bah, you young punks and your crazy misconceptions. (Actually vid's only a few years younger than me, heheh, and he's quite smart ... usually. But he's wrong here, his bias is showing.)

Ctrl-Z is a CP/M legacy from when the OS had no idea where the end of the file was. (MS-DOS [originally known as PC-DOS] was originally just a cheaper CP/M clone [API only] for IBM's 16-bit IBM PC 5150 using an Intel 8088 [same as 8086 but cheaper, slower, 8-bit compatible external data bus, I think].) Not even all DOS tools are crippled with this misfeature either. A bigger compatibility issue (besides the silly CRLF vs. LF) is that there are separate binary and text modes ("rb" and "r" in C parlance), which many *nix nerds ignore.

"Too old" is funny, esp. since they are younger than you, vid. (FreeDOS 1.0 came out in 2006, kernel 2039 last year. There are other DOSes too besides MS-DOS, but FreeDOS is more active [barely], AFAICT.) "Move on" to newer OSes is funny too, esp. when you don't even know what hardware he's using or what apps he needs.

There are three ways to enter a Ctrl-Z, nay, four, when using DOS or Win98:

1). edit mytext.txt (note that these don't have to be capital letters)
blahblahblah
Ctrl-P Ctrl-Z
FASM rocks
Alt-F S
Alt-F X

WinXP> type mytext.txt (says "blahblahblah" only!)

2). (at prompt, sometimes works elsewhere) Ctrl-Z
3). (at prompt) F6
4). (at prompt, usually works elsewhere) hold Alt + (numpad) 2 + 6 (0x1A = 26)

My work here is done!

(... flies away ...)
Post 08 Nov 2010, 15:56
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 08 Nov 2010, 19:38
rugxulo wrote:
Ctrl-Z is a CP/M legacy from when the OS had no idea where the end of the file was. (MS-DOS [originally known as PC-DOS] was originally just a cheaper CP/M clone [API only] for IBM's 16-bit IBM PC 5150 using an Intel 8088 [same as 8086 but cheaper, slower, 8-bit compatible external data bus, I think].) Not even all DOS tools are crippled with this misfeature either.

Touche, but I meant direct ancestor, which for FASM was DOS (or maybe the Tomasz's own OS?).

Quote:
A bigger compatibility issue (besides the silly CRLF vs. LF) is that there are separate binary and text modes ("rb" and "r" in C parlance), which many *nix nerds ignore.

libc stream I/O under text mode does anything else than CRLF<->LF translation (on Win)? Funny, I never thought it would obey ASCII control chars.

Quote:
"Too old" is funny, esp. since they are younger than you, vid. (FreeDOS 1.0 came out in 2006, kernel 2039 last year. There are other DOSes too besides MS-DOS, but FreeDOS is more active [barely], AFAICT.) "Move on" to newer OSes is funny too, esp. when you don't even know what hardware he's using or what apps he needs.

Too old, because (like almost everyone) I stopped using them aeons ago. I did my share of DOS and Win9X development too, but I simply don't remember what editors I used did on those chars.


Last edited by vid on 09 Nov 2010, 09:29; edited 1 time in total
Post 08 Nov 2010, 19:38
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 08 Nov 2010, 20:15
vid wrote:

Quote:
A bigger compatibility issue (besides the silly CRLF vs. LF) is that there are separate binary and text modes ("rb" and "r" in C parlance), which many *nix nerds ignore.

libc stream I/O under text mode does anything else than CRLF<->LF translation (on Win)? Funny, I never thought it would obey ASCII control chars.


First of all, there is no "it", there are several. And no, I don't think it does, just saying ... it's yet another stumbling block for *nix-only purists.

Quote:

Quote:
"Too old" is funny, esp. since they are younger than you, vid. (FreeDOS 1.0 came out in 2006, kernel 2039 last year. There are other DOSes too besides MS-DOS, but FreeDOS is more active [barely], AFAICT.) "Move on" to newer OSes is funny too, esp. when you don't even know what hardware he's using or what apps he needs.

Too old, because (like almost everyone) I stopped using them aeons ago. I did my share of DOS and Win9X development too, but I simply don't remember what editors I used did on those chars.


It wasn't that long ago! Only since 2006 did MS (and Firefox) drop Win9x support. And only since a year or two did Cygwin dump Win9x (and only then for better Unicode support). It wasn't truly that long ago, at least in my mind, when you were coding para512, your ss.com Sudoku solver, DOS tutorial, etc. But I guess you think it's not "cool" enough anymore. I'm not saying never use other stuff, just remember that some useful things can still be done on "old" hardware / software / etc.

P.S. Your quote didn't work, left a bunch of crud in your post. Wink
Post 08 Nov 2010, 20:15
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 09 Nov 2010, 09:35
rugxulo wrote:
It wasn't that long ago! Only since 2006 did MS (and Firefox) drop Win9x support. And only since a year or two did Cygwin dump Win9x (and only then for better Unicode support). It wasn't truly that long ago, at least in my mind, when you were coding para512, your ss.com Sudoku solver, DOS tutorial, etc. But I guess you think it's not "cool" enough anymore. I'm not saying never use other stuff, just remember that some useful things can still be done on "old" hardware / software / etc.

para512 IMO was quite cool, ss.com wasn't, but both were developed (relatively) long after I stopped Win9X. I don't even remember that DOS tutorial, so that might have been during Win9X times.

By chance, right today I am giving 2nd part of "intruduction to x86 machine code and assembly" talk at local geek meeting. Starting teaching Asm in DOS real mode is something that I consider a bad decision today, due to need to understand concepts no longer utilized outside ring0 development (segments mostly). "Flat" world of 32-bit Windows / Linux usermode assembly is so much easier to understand for newb.

Quote:
P.S. Your quote didn't work, left a bunch of crud in your post. Wink

Fixed, thanks for warning.
Post 09 Nov 2010, 09:35
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number 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.