Tniasm compatible assembler

Page 1/3
| 2 | 3

By Daemos

Prophet (2052)

Daemos's picture

13-10-2018, 21:55

Context of the story is somewhat difficult so please keep the "why do you want to do it" out of the discussion. I am using tniasm because thats what i always use. Its a good assembler, in fact somewhere in the one of the best region imho. However there is a small problem: it is a x86 binary and thats it. It works it does the job but no source no ports nothing. I will not contact the maker because i dont want to bother him with requests of this kind so i am looking for a assembler that complies to the following.

1. Can assemble complicated sources (trust me, this one is difficult)
2. Is open source.

Almost 90% of my computers at home and work are based on arm cpus so i need a assembler that can run on such platform.

To prevent the obvious awnsers:

Yes, i have tried quemu. Too slow assembly takes 15 minutes.
I have tried glass and sjasm and both trow about 1500 errors in my face.

All other suggestions are welcome. I will try anything you suggest.

Login or register to post comments

By Manuel

Ascended (19326)

Manuel's picture

13-10-2018, 22:11

Perhaps these errors can be solved with some simple search and replace...? Probably most have the same origin...

By syn

Prophet (2117)

syn's picture

13-10-2018, 22:48

Are you talking about the old ancient tniasm v0.45 which is free to download or the paid v1.0? Not that it matters much compatibility-wise I guess but 1.0 also offers macros and stuff.

Wouldn't virtual machine or remote desktopping your main dev pc be an option?

By Daemos

Prophet (2052)

Daemos's picture

13-10-2018, 22:56

its about the acient 0.45 version. Have tried remote desktopping but its all inconvenient. On my main machine the exe runs smoothly on wine so no problems there. Its where the ARM cpu kicks in where things get difficult.

By sd_snatcher

Prophet (3646)

sd_snatcher's picture

14-10-2018, 02:39

Maybe sjasm-plus? It's more flexible than sjasm, so it might work.

By Daemos

Prophet (2052)

Daemos's picture

17-09-2020, 21:57

Sjasmplus at least compiles nicely. However compiling my sources gives 20k + errors propably label related oO

By Manuel

Ascended (19326)

Manuel's picture

14-10-2018, 17:23

Look at the errors and see how you can solve them... Maybe glass is the best option, grauw is quite active.

By Vampier

Prophet (2409)

Vampier's picture

14-10-2018, 20:58

TNIAsm1.0 is not an option?

By Daemos

Prophet (2052)

Daemos's picture

16-10-2018, 21:24

After many many manyyyyyy hours of fiddling here is what I came up with:

compile new kernel with binfmt_module. install qemu-i386 with static support. Then create i386 chroot. Transfer libs and wine binaries to main system. ENable binmft

Copy wine prefix to home folder. Start wine cmd and voila! tniasm starts and compiles on arm64. In a whopping 25 seconds hahahaha. Still kinda slow but good enough for me. Takes 53 seconds at my work on a native machine so this is a pretty good result. Thanks for thinking along.

Perhaps one day the makers of this great tool will compile a arm binary who knows for now I can continue on my portable platforms.

By Ped7g

Expert (67)

Ped7g's picture

17-09-2020, 21:57

Daemos wrote:

Sjasmplus at least compiles nicely. However compiling my sources gives 20k + errors propably label related oO

While the syntax of sjasmplus is quite versatile (to my taste actually too much), certainly it can't assemble *any* syntax and the sources may require some adjusting.

But if you can provide me with some small asm example, to see what kind of errors you have with latest sjasmplus (v1.14.2 is now out), I can help you to asses what is just simple syntax sugar solvable by some search/replace or sed, and what is serious blocking issue (and maybe you have even run into regular sjasmplus bug, then it would be welcome contribution to make me aware of it, so I can fix it in next release).

(I understand this is all time consuming process, but no report = no chance for fix, even if I would find eventually some time to look into it)

(edit: I'm not sure if the sources are available somewhere (I think not), so I can't try myself, if they are public, enlighten me with some url and I will take a look)

By Grauw

Ascended (10718)

Grauw's picture

01-11-2019, 14:55

There is no Tniasm compatible assembler except Tniasm, nor is there a Glass compatible assembler except for Glass or a Sjasm compatible assembler except for Sjasm. Same for Gen80, M80, Compass, etc. Each extend the basic assembly syntax with their own unique feature set to provide convenience to the developer at the cost of source portability.

There is no way to create an assembler which one-on-one supports the syntax and features of all other assemblers without turning into a big inconsistent do-everything mess. Also it would generate even more confusion as to what is “the interoperable syntax”, people would e.g. mix Tniasm and Sjasm syntax and as a result you would still have source code that can only be assembled by this particular one.

So the reality is that whenever you move to a different assembler, unless you use only plain interoperable assembly and none of the assembler’s more advanced features, there is some effort involved in porting the source code across. Simply because there is no standard syntax for things like scoped labels, macros, structures, or even expressions.

It can be a bit laborious however by investing some time in getting to understand the assembler feature set and some search / replacing (possibly involving regular expressions) you should get a long way in a couple of hours.

Page 1/3
| 2 | 3