flat assembler
Message board for the users of flat assembler.

Index > Non-x86 architectures > FASMARM alternatives?

Author
Thread Post new topic Reply to topic
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen
I enjoy FASMARM being based on fasm but I wonder if there are any other ARM assemblers with advanced macro language? I tried to find some but without success.
Post 29 Apr 2020, 09:21
View user's profile Send private message Visit poster's website Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 600
Location: Russian Federation, Sochi
ProMiNick
What dislike in fasmarm? bugs? unavailability of compiling for IOS due to absence of Macho support?

What about GNU assembler?
Post 29 Apr 2020, 10:40
View user's profile Send private message Send e-mail Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen
I've just started with ARM asm. I'm coming from the x86 world where many different assemblers are available.

As I understand it, Arm Holdings dictates ARM assembler syntax that is crazy IMO. So I'm trying to understand the state of the art of ARM assemblers.

MachO support would be good but not necessary. ELF64 support is required.

As far as I know, GAS is very limited when it comes to its macro capabilities.
Post 30 Apr 2020, 08:04
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7802
Location: Kraków, Poland
Tomasz Grysztar
There is an aarch64 add-on for fasmg (made by tthsqe), but so far no instruction set packages have been written for other flavors of ARM. But now that fasmg is further powered by CALM, it might be worth it to pursue these directions (the aforementioned aarch64 headers were made before CALM was available, so they are written using just macros and therefore might be a bit slow). I admit I was reluctant to attempt writing such packages myself, as I feel I have too much Intel-syntax-related bias to understand well what might be expected in the ARM world. Although one could say that if I made something with such bias, it could become an interesting alternative for other people coming from x86 world, like you.

One advantage of fasmg approach is that when architectures are implemented with headers sets, it is possible to tweak them if needed, and the syntax is more malleable in general. Also, for example, there is a Mach-O formatter for fasmg, and making it with fasmg was so much more comfortable that I gave up any plans of implementing it into fasm 1.
Post 30 Apr 2020, 08:42
View user's profile Send private message Visit poster's website Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen
It's good to know there's the add-on and that CALM is available for fasmg. However, I don't have enough time to add support for ARMv7 to fasmg.

It would be great if you could add a small chapter to fasmg user's manual about compatibility between fasm and fasmq: is it possible to assemble my fasm source code with fasmg? It seems it's not, right? There's the Migration from fasm to fasmg post but it's too technical.
Post 30 Apr 2020, 11:30
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7802
Location: Kraków, Poland
Tomasz Grysztar
MazeGen wrote:
It would be great if you could add a small chapter to fasmg user's manual about compatibility between fasm and fasmq: is it possible to assemble my fasm source code with fasmg? It seems it's not, right? There's the Migration from fasm to fasmg post but it's too technical.
There is a common subset of fasm and fasmg language that allows some of the sources to be assembled with both, but such sources are mostly a simple script-like ones, limited to directives like DB, LOAD/STORE, REPEAT/WHILE, IF and numeric computations (see my early post comparing fasmg with fasm, from the time when fasmg was still a brand new thing).

However, there is also a set of compatibility headers, which implement fasm-compatible x86 instruction sets, FORMAT directive will all the formats that fasm had (but also some additional ones, like Mach-O or x32 ELF), @@ labels, some of the standard fasm's macros (like STRUCT) and fasm-like Windows headers. This set is what the migration guide mentions, and it allows to assemble many of the Windows programs with little to no changes (because including compatibility headers like "win32a.inc" automatically adds things like x86 instructions and FORMAT directive).
Post 30 Apr 2020, 11:41
View user's profile Send private message Visit poster's website Reply with quote
donn



Joined: 05 Mar 2010
Posts: 199
donn
Believe there are two armasms, not sure about their macro capabilities:
Microsoft
arm

I think the former works with Visual Studio, but I can't see it. I'm not very familiar with arm assembly, so I can't compare/contrast their features.
Post 30 Apr 2020, 15:52
View user's profile Send private message Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen
The official arm assembler seems to have very limited macro language (this page is linked from here).

And the Microsoft arm assembler looks like it's similar to the offical one with tweaks and mods.
Post 01 May 2020, 10:32
View user's profile Send private message Visit poster's website Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 3056
Location: vpcmipstrm
bitRAKE
I'm fairly certain GNU AS has macros - just from reading GMP source code. It's unusual to say the least, imho. Many other compilers forward to AS, so I've been thinking about getting more familiar with it myself.

_________________
¯\(°_o)/¯ unlicense.org
Post 02 May 2020, 02:17
View user's profile Send private message Visit poster's website Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 730
tthsqe
I have been out of the loop for a while. So calm is part of fasmg? Can we compile all x86 code (including avx 256 instructions) with fasmg+calm? And it faster than the original fasmg?
I would be willing to get those aarch64 includes calmified if that is indeed the way to go.
Post 02 May 2020, 13:31
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7802
Location: Kraków, Poland
Tomasz Grysztar
tthsqe wrote:
I have been out of the loop for a while. So calm is part of fasmg? Can we compile all x86 code (including avx 256 instructions) with fasmg+calm? And it faster than the original fasmg?
Yes. On the initial wave of enthusiasm after I implemented CALM I converted most of the time-consuming macros, like x86 parsing/encoding (up to AVX-512), relocation generation in various formatters, checksum computing in PE, and so on. Most of the things I assemble go about 6 times faster than with old macro implementations. Also, it is possible to gain from CALM without rewriting everything, and replacing just a couple of key macros - like what I did initially with x86. On the other hand, going with CALM from scratch could perhaps allow to push things even further. I'm still considering writing a "fasm 2" as a CALM-based module designed from scratch, which could be even faster than current x86 implementation (which still uses the same architecture as the original macros, it just has CALM replacements for most of them).

The repository has most of the things converted now, although I did not have enough momentum to convert the "invoke" macros, which could likely also gain much from CALM.

If you need to learn more about how it works, you should start with the new chapter of the manual dedicated to CALM, then there is also an added section at the end of the overview document which covers specifically converting an existing macros to CALM.
Post 02 May 2020, 14:32
View user's profile Send private message Visit poster's website Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 837
Location: Belarus
DimonSoft
tthsqe wrote:
I have been out of the loop for a while.

<OffTop>This phrase is so loop’y from programmer’s point of view.</OffTop>
Post 03 May 2020, 21:21
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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.