flat assembler
Message board for the users of flat assembler.

flat assembler > Heap > Anyone of you tried out YASM ?

Author
Thread Post new topic Reply to topic
kalambong



Joined: 08 Nov 2008
Posts: 165
Call me slo-mo or something, just found it.

http://www.tortall.net/projects/yasm/

Anyone tried it before?
Post 21 Dec 2009, 23:52
View user's profile Send private message Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2468
Location: Bucharest, Romania
I doubt any other assembler is as powerful as FASM in macros.

_________________
Previously known as The_Grey_Beast
Post 22 Dec 2009, 00:07
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7108
Location: Slovakia
As for me, FASM is better in its syntax specialities (not all of them, but most), and YASM is better as being for "serious" stuff (it is portable, doesn't use much custom stuff, has command-line params ...).

Syntax-wise, it is copy of NASM. In past it had 64-bit support as extra, but NASM already has it for quite some time. I would still use YASM though. It is a nice one IMO, best today for anything serious.

But note that my info can be year or two behind.
Post 22 Dec 2009, 00:32
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2468
Location: Bucharest, Romania
What do you mean by "portable"? That it runs on other operating systems? Or that it can be run from an USB drive or other removable drive?

FASM fulfills both. Confused

FASM is:

1) fast
2) powerful
3) clean syntax (with the exception of too many '\\\\' in complex macros, but those aren't likely to be possible in other assemblers)


what do you mean by "serious"?
Post 22 Dec 2009, 00:52
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16664
Location: In your JS exploiting you and your system
Yeah vid, define "serious".


Last edited by revolution on 22 Dec 2009, 01:06; edited 1 time in total
Post 22 Dec 2009, 00:54
View user's profile Send private message Visit poster's website Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2468
Location: Bucharest, Romania
oh the stuff in parantheses? how are command line arguments 'serious'? Command line arguments for what? defining constants?

yeah it's very hard to put that in the start of the main source instead of the command line. Rolling Eyes
Post 22 Dec 2009, 01:01
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7108
Location: Slovakia
Quote:
What do you mean by "portable"? That it runs on other operating systems?

That it can be ported to machines/OSes that don't support 32-bit x86 code.

Quote:
3) clean syntax

There is serious lacking of something like preprocessor #ifdef.

Quote:
Yeah vid, define "serious".

Command-line params, not being self-compilable, being written in HLL and hence portable, being similar in feature set to most other language so that you can learn it faster, having all the features (debug symbols, listing, ...) without requiring handful of extra tools ... such things.

I don't say that I dislike how FASM solves these things. I like its elegant minimalistic approach. But it really isn't good for what asm is needed 99% times... writing handful of leaf procedures to be used within big project.
Post 22 Dec 2009, 11:38
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: 16664
Location: In your JS exploiting you and your system
This is scary:
Q8: Why doesn't Yasm error out on invalid or typoed opcodes like innt3?

A8: A quirk of the NASM compatible syntax is single identifiers on a line that aren't registers or instructions become labels. You can track these down easily by adding -Worphan-labels to your command line.
And why is this scary?

Because it is a gotcha.

I remember some time ago I used an assembler for the Z80 that had the same "feature". And I had this line:

somelabel; mov a,b

It assembled just fine without any error. But the resulting program crashed. The problem is hard to spot and it took me almost the whole morning to finally discover what was wrong. The label was begin defined but the following instruction was not assembled. You see the colon (:) and semi-colon (;) look very similar and are on the same key on the keyboard. And in case anyone hasn't spotted the error yet, there is a semi-colon following the label name. The assembler happily assumes all unknown text strings are labels, which is a major design problem IMO.


Last edited by revolution on 22 Dec 2009, 23:04; edited 2 times in total
Post 22 Dec 2009, 13:06
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8284
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
heard of it but hasnt try it.
Post 22 Dec 2009, 14:13
View user's profile Send private message Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2468
Location: Bucharest, Romania
vid wrote:
That it can be ported to machines/OSes that don't support 32-bit x86 code.
I don't see the point. asm is x86 anyway.

vid wrote:
There is serious lacking of something like preprocessor #ifdef.
Confused
Code:
define SOMECONSTANT 1

match =1,SOMECONSTANT
{
  display 'wow, it worked!'
}    


on the other hand... which assembler has a powerful directive like match? such powerful multi-pass capabilities? load, store directives? etc etc... Wink

vid wrote:
I don't say that I dislike how FASM solves these things. I like its elegant minimalistic approach. But it really isn't good for what asm is needed 99% times... writing handful of leaf procedures to be used within big project.
I disagree, I think FASM is the most powerful assembler, not minimalistic. Razz

_________________
Previously known as The_Grey_Beast
Post 22 Dec 2009, 22:53
View user's profile Send private message Reply with quote
rCX



Joined: 29 Jul 2007
Posts: 166
Location: Maryland, USA
revolution wrote:
It assembled just fine without any error. But the resulting program crashed. The problem is hard to spot and it took me almost the whole morning to finally discover what was wrong. The label was begin defined but the following instruction was not assembled. You see the colon (:) and semi-colon (;) look very similar and are on the same key on the keyboard. And in case anyone hasn't spotted the error yet, there is a semi-colon following the label name. The assembler happily assumes all unknown text strings are labels, which is a major design problem IMO.


I used to have that problem as well, before I switched to fasm...
Post 23 Dec 2009, 01:17
View user's profile Send private message Reply with quote
kalambong



Joined: 08 Nov 2008
Posts: 165
After read your message I went back there and read up everything.

They are at 0.8 right now and looks like they have ironed out a lot of bugs, and according to the milestone table, they have like 1 bug left.

I will give it a spin. But of course, I continue to use FASM. Very Happy

vid wrote:
As for me, FASM is better in its syntax specialities (not all of them, but most), and YASM is better as being for "serious" stuff (it is portable, doesn't use much custom stuff, has command-line params ...).

Syntax-wise, it is copy of NASM. In past it had 64-bit support as extra, but NASM already has it for quite some time. I would still use YASM though. It is a nice one IMO, best today for anything serious.

But note that my info can be year or two behind.
Post 23 Dec 2009, 02:33
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1904
> Anyone of you tried out YASM ?

NO. I've been aware of it for years but as long as FASM is not that broken and Tomasz is not that unresponsive to my bug reports Rolling Eyes

Aaand, I don't want to get in touch with DGJPP for compiling my assembler Idea

_________________
Bug Nr.: 12345

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

Status: Closed: NOT a Bug
Post 23 Dec 2009, 07:05
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7108
Location: Slovakia
Borsuc wrote:
vid wrote:
That it can be ported to machines/OSes that don't support 32-bit x86 code.
I don't see the point. asm is x86 anyway.

Fact that you are writing code FOR x86-32/64 machine/OS shouldn't limit you to write that code ON x86-32 machine/OS.

Quote:
vid wrote:
There is serious lacking of something like preprocessor #ifdef.
Confused
Code:
define SOMECONSTANT 1

match =1,SOMECONSTANT
{
  display 'wow, it worked!'
}    

Apart from ugly syntax, try to think about how many things can't be commented that way, and how many things have to be written differently in order to work inside such block.

Quote:
on the other hand... which assembler has a powerful directive like match? such powerful multi-pass capabilities? load, store directives? etc etc... Wink

None I know of, I like these about FASM.

vid wrote:
I disagree, I think FASM is the most powerful assembler, not minimalistic. Razz

I think FASM is both very (most?) powerful and has minimalistic design.

Quote:
I've been aware of it for years but as long as FASM is not that broken and Tomasz is not that unresponsive to my bug reports

Weird, I remember having no problem in communication with its author.

Quote:
This is scary:

Oh yeah, that is extremely annoying. I have hit that bug even in the few YASM demos I wrote for FASMLIB aeons ago.

Unfortunatelly YASM is really hard on NASM compatibility. I'd prefer it to fix the most idiotic things, and only be 100% compatible when told to.
Post 23 Dec 2009, 12:33
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: 16664
Location: In your JS exploiting you and your system
And even more scary is that the "-Worphan-labels" option won't catch it (the problem) because it (my example above) is a real label.

Actually since YASM is so intent upon NASM support then why not just use NASM? What does YASM provide above what NASM has?
Post 23 Dec 2009, 12:41
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7108
Location: Slovakia
Quote:
Actually since YASM is so intent upon NASM support then why not just use NASM?

AFAIK NASM was dead at the moment, for quite some time, until ressurected somewhat later

Quote:
What does YASM provide above what NASM has?

of what I remember... clearer codebase (hence also libyasm), some extra options, nicer license
Post 23 Dec 2009, 12:53
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2468
Location: Bucharest, Romania
vid wrote:
Fact that you are writing code FOR x86-32/64 machine/OS shouldn't limit you to write that code ON x86-32 machine/OS.
Don't you think such situations are extremely rare? Plus I'm sure there are virtual machines -- those would be needed to test your code or debug it anyway.

What other architectures are you thinking about for x86 development, is this really needed anyway (and an arch who does not have virtual machines). Not to mention, it's not convenient to not be able to test your code...

vid wrote:
Apart from ugly syntax, try to think about how many things can't be commented that way, and how many things have to be written differently in order to work inside such block.
What do you mean ugly syntax?

Code:
if SOMECONSTANT = 1

match =1, SOMECONSTANT    
what's 'ugly' there? It's just the word 'match' compared to 'if' or 'ifdef', and =1 before the constant name (and a comma). Poor excuse for not "having" such capability. Razz

(of course, if you don't like the '{ }' brackets but prefer 'endif' or something, that's personal taste... I like both, but prefer { } as it's used in C's main syntax, not preprocessor).

I actually came from NASM camp before FASM (some years ago) and I've been very happy with the switch on many many levels -- yeah NASM was dead/revived but is YASM different? I see it strikes as being compatible with NASM...

_________________
Previously known as The_Grey_Beast
Post 23 Dec 2009, 16:40
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1904
vid wrote:
Fact that you are writing code FOR x86-32/64 machine/OS shouldn't limit you to write that code ON x86-32 machine/OS.


Confused

> I see it strikes as being compatible with NASM...

+ GAS ATT&T syntax + TASM ideal mode - OMF support
Post 23 Dec 2009, 16:59
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 can attach files in this forum
You can download files in this forum


Copyright © 1999-2019, Tomasz Grysztar.

Powered by rwasa.