flat assembler
Message board for the users of flat assembler.

Index > Main > CRLF ? newline

Author
Thread Post new topic Reply to topic
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

hi all Wink

What should I accept as a newline ?
Code:
CR + LF
LF + CR
only CR too ?
only LF too ?
    

i have cast a glance into the code of FASM,
Tomasz seems to accept the 4 possibilities..
thank you.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 22 Feb 2010, 22:35
View user's profile Send private message Send e-mail Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Strictly speaking, this should depend on what OS you are on Razz

But as for FASM's purpose and design, tomasz's solution is okay. It probably wouldn't be in something else.
Post 22 Feb 2010, 23:12
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Post 22 Feb 2010, 23:31
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

I looked in the FASM code for windows, and even with this version,
it seems to accept the 4 possibilities.
Curious, no?

Code:
find_concatenated_line:
        lods byte [esi]
     cmp al,0Ah
  je concatenate_lf
   cmp al,0Dh
  je concatenate_cr       
    .......

concatenate_lf:
  lods byte [esi]
     cmp al,0Dh 
 je concatenate_ok <--- LF + CR ok
        dec esi
     jmp concatenate_ok <-- LF ok

concatenate_cr:
  lods byte [esi]
     cmp al,0Ah
  je concatenate_ok <--- CR + LF ok
        dec esi
                              <--- no jump, CR ok
concatenate_ok:
      inc dword [esp] <----------- here newline !
      jmp convert_line_data
    

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 22 Feb 2010, 23:40
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17716
Location: In your JS exploiting you and your system
revolution
I suggest you accept/allow all four possibilities.

No need to limit the flexibility arbitrarily.
Post 22 Feb 2010, 23:41
View user's profile Send private message Visit poster's website Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

thank you LocoDelAssembly,
very interesting article indeed

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 22 Feb 2010, 23:43
View user's profile Send private message Send e-mail Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

Quote:

revolution,

I suggest you accept/allow all four possibilities.
No need to limit the flexibility arbitrarily.

ok but, there is no risk of being too much universal, too much versatile,
and detect ghost newline ?

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 22 Feb 2010, 23:54
View user's profile Send private message Send e-mail Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17716
Location: In your JS exploiting you and your system
revolution
ouadji wrote:
ok but, there is no risk of being too much universal, too much versatile, and detect ghost newline ?
I doubt it.
Post 23 Feb 2010, 00:14
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
vid wrote:
Strictly speaking, this should depend on what OS you are on


Welcome to the hell Evil or Very Mad

Quote:
But as for FASM's purpose and design, tomasz's solution is okay. It probably wouldn't be in something else.


You should "pirate" Tomasz's approach Smile
Post 23 Feb 2010, 04:54
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

my question is about this : clic
my last version became really powerful, but I still have few small details to improve.
I will use Tomasz's approach
I prefer to remain fully compatible with its code.

_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 23 Feb 2010, 08:14
View user's profile Send private message Send e-mail Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
> my question is about this : clic

"clic" = "suggestion /* Comments */ (Nested comments ok)"

Much appreciated, I'll test Smile
Post 23 Feb 2010, 08:37
View user's profile Send private message Reply with quote
ouadji



Joined: 24 Dec 2008
Posts: 1081
Location: Belgium
ouadji

thanks a lot to test it.
If you have any questions about it, ask me.
To place comments with FASM, it's very powerful.
I am currently developing the next version.
There are some flaws to correct.
Optimize and structuring the code ...
better management of "newline" and "end of file" ...
and other little things to improve.
But the version in my last post is already very good.
I'm working, this is in preparation ... soon.

Please, if you test my code, give me your comments,
results and feedback.

Thank you very much Smile


_________________
I am not young enough to know everything (Oscar Wilde)- Image
Post 23 Feb 2010, 22:05
View user's profile Send private message Send e-mail 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 GitHub, YouTube, Twitter.

Website powered by rwasa.