Hacker News new | ask | show | jobs
by giovannibajo1 1596 days ago
I generally advise against using bass for home-brew development. Bass is not a very well thought out assembler. I've never used it for 65816, but for other architectures like MIPS has some serious design issues that cause invalid code to be silently accepted by default, which is normally a disaster when it gets to debugging.

For MIPS at least, one of the completely wrong design decision has been to map basic register indices to raw numbers. For instance, in bass, this is a valid instruction:

    add 2, 4, 5
which means "add register 4 and 5 together and write the result in register 2". Normally, one would write that line with the register aliases:

    add v0, a0, a1
The problem comes with the fact that MIPS has also a "addi" (add immediate instruction) that you would use like this:

    addi v0, a0, 5
"add the immediate value 5 to a0 and store the result in v0". So I guess the problem is clear: what happens if you instead write:

    add v0, a0, 5
There are two possible reasonable outcomes: either the assembler should reject the above line as invalid, or it should silently convert it to "addi" which is what GNU as does for instance. Instead, with bass, the above is a perfectly valid line which gets assembled to the same of "add v0, a0, a1", which basically silently generates wrong code.

I think bass was a quick hack that overgrew its intended goal. I suggest to use something more mature.

4 comments

Hi. I cannot belive that I actually registered on this page just to write this comment. But I also got the feeling that there had been alot of mist around of bass, and I hope to lift some of it.

So first thing first: There _is_ and community fork. Url had been spammed allready. Yes we are active. To be honest, bass is more active then it probably ever had been before. Next days we will also launch a project page (url: www.basm.dev). And yes .. that near passed away was as least a shock for us. But its also the reason why we took it up.

Now about @giovannibajo1 very valid statement: Yes. Until recently that would had been true. Syntax may, or may not always be optimal. It's too sad that so far no Issue ticket, or Discord Message had reached me about this thoughts. In the end its a community project. All I can say at this point is that the pure assembly syntax is to 100% fluid. You can mix it your own flavor. To be honest I never did MIPS using bass myself. But I would love to chat about "how a clean syntax should looks like".

Feel welcome.

I'm sorry if my comment came across as offensive, it wasn't my intent. I wasn't aware that there was a community fork of bass, and bass used to be pretty abandoned, so I've been advising people against it for quite some time. I'm happy if there's a community willing to reprise development on it.

I will open an issue, and I've joined the discord if you want to discuss about this. I'm happy to help though I've not really used it for years now, but I am happy to at least tell you why I stopped using it so that you can ponder this for future developments.

sounds good :)
Can bass be fixed to remove this design flaw?

Is xkas/asar worse than bass? A lot of SMW-adjacent romhacking tools use xkas/asar which preceded bass (the author discussed at https://news.ycombinator.com/item?id=11720057).

Some alternatives I've come across include macro packs for ca65 to make it assemble for instruction sets it doesn't understand natively, and I hear tass64 has macro packs too.

Unfortunately the author passed away recently. If there is a community fork of bass that would make it easier.
Yes there is a community fork: https://github.com/ARM9/bass
Can you report this issue at https://github.com/ARM9/bass/issues/new? I'm not the best one to forward or rephrase it, having not written MIPS using Bass.
Sure, will do.
I've been very happy with 64tass for 6502 code: http://tass64.sourceforge.net/ - apparently supports 65816 as well.