flat assembler
Message board for the users of flat assembler.

Index > Linux > fasm2 format error

Author
Thread Post new topic Reply to topic
Chris Leslie



Joined: 19 Oct 2024
Posts: 7
Location: Canberra
Chris Leslie 23 Nov 2025, 01:31
I have downloaded fasm2 and unzipped in a linux terminal. When assembling for x86-64 a simple hello world using fasmg.x64 I get: Error: invalid argument for the format line. I use: format ELF64 executable. What should it be to assemble without error?
Post 23 Nov 2025, 01:31
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8483
Location: Kraków, Poland
Tomasz Grysztar 23 Nov 2025, 08:24
Use fasm2 instead of fasmg.x64. It runs the latter with the necessary headers set up.
Post 23 Nov 2025, 08:24
View user's profile Send private message Visit poster's website Reply with quote
Chris Leslie



Joined: 19 Oct 2024
Posts: 7
Location: Canberra
Chris Leslie 23 Nov 2025, 08:43
./fasm2 hello.asm gives me:
/usr/bin/env: ‘bash\r’: No such file or directory
/usr/bin/env: use -[v]S to pass options in shebang lines
Post 23 Nov 2025, 08:43
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8483
Location: Kraków, Poland
Tomasz Grysztar 23 Nov 2025, 08:55
Please re-download the package. The error you get is caused by incorrect line endings in the fasm2 file ("\r\n" instead of "\n") and I briefly had it broken.
Post 23 Nov 2025, 08:55
View user's profile Send private message Visit poster's website Reply with quote
Chris Leslie



Joined: 19 Oct 2024
Posts: 7
Location: Canberra
Chris Leslie 23 Nov 2025, 21:37
Ah!, tricky. I instead patched the fasm2 file and it now works. Is that the only place with \r's?
Post 23 Nov 2025, 21:37
View user's profile Send private message Send e-mail Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8483
Location: Kraków, Poland
Tomasz Grysztar 23 Nov 2025, 21:44
It's the only place that matters. The assembly source files can have any line breaks, even mixed, and fasm is still going to process them correctly.
Post 23 Nov 2025, 21:44
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.