| |
Sasq
Registered: Apr 2004 Posts: 155 |
Badass - New 6502 Assembler
The last couple of months I've created a new 6502 Assembler called bass (or Badass).
The basic idea is for it to be as advanced as Kickassembler, but with a less complex, more unified syntax.
And it also has unit tests in an internal emulator.
You can find it at https://github.com/sasq64/bass
I've started a tutorial here: http://apone.org/bass/part1.html
Here is an example C64 source http://apone.org/bass/example.asm.html |
|
| |
Frantic
Registered: Mar 2003 Posts: 1627 |
Looks quite nice at first glance! |
| |
chatGPZ
Registered: Dec 2001 Posts: 11114 |
This is really interesting! |
| |
Bacchus
Registered: Jan 2002 Posts: 154 |
Interesting. Will have a look.
/Bacchus |
| |
Sasq
Registered: Apr 2004 Posts: 155 |
Some other things:
* It should be pretty easy to build, you just need a modern C++ compiler and CMake. Windows users can open the directory in VS Code for instance.
* If you're looking to customize the assembler it should also be straight-forward. Look in `meta.cpp` for the definitions of all meta commands and `functions.cpp` for functions. You should be able to add your own by copying the existing ones.
The thing I'm experimenting most with now is how to interact with the emulator. You can for instance call into LUA from 6502 using "brk", and this could be used for proto-typing -- ie to start with LUA code and then re-implement it in 6502 with tests to back it up.
I also modified the X16 Commander emulator to also bind LUA to 6502 in the same way so I can run X16 programs that are partly in LUA.
Unit tests are also good for optimizing, since you get the cycle count as an output, so you can assert that your code does not become slower. |
| |
JackAsser
Registered: Jun 2002 Posts: 1989 |
I must say I'm impressed by your C++ coding style. Really a pleasure to the eye. And also a nice project with a lot of new ideas.
To me personally I always use Eye of the Beholder as a test case in my head; could I port EotB to this assembler? And by the looks of it, no, due to the lack of high level memory management with segments and separate linking and so on. Maybe features to add for someone? |
| |
Sasq
Registered: Apr 2004 Posts: 155 |
I am looking for beta testers, so there is a good chance I will implement any required features for someone actively using it :)
And I am aware that there is functionality missing in memory layout, sections and linking. I am not sure exactly how to make that powerful and simple.
Right now you can for instance do things like this:
!section "extra", sections.main.end
; stuff
!section "main", $801
; more stuff
This will place section "extra" after "main".
... but I realize you need something more advanced. Suggestions are welcome. |
| |
Krill
Registered: Apr 2002 Posts: 2839 |
Some great ideas and modern approaches to old problems.
One thing i've occasionally missed with 6502 assemblers is the possibility to have a hashbang in the first line of an assembly source file.
I like to have small projects (size-restricted demos mostly, or random experiments) in single monolithic files, and avoiding to create a build script or Makefile when getting started on something new would be nice. :) |
| |
JackAsser
Registered: Jun 2002 Posts: 1989 |
Quote: Some great ideas and modern approaches to old problems.
One thing i've occasionally missed with 6502 assemblers is the possibility to have a hashbang in the first line of an assembly source file.
I like to have small projects (size-restricted demos mostly, or random experiments) in single monolithic files, and avoiding to create a build script or Makefile when getting started on something new would be nice. :)
hashbangs are implemented by the exec() routine in the OS.. |
| |
Krill
Registered: Apr 2002 Posts: 2839 |
As for sections and the like, have you checked out 64tass?
This is my current go-to assembler for smaller projects, and seems quite similar in its approaches.
Full-blown separate link stage is ca65's domain, of course, but i usually avoid linker files until they really make things tidier and more managable, which happens rather late for most projects. |
| |
Krill
Registered: Apr 2002 Posts: 2839 |
Quoting JackAsserhashbangs are implemented by the exec() routine in the OS.. Until the interpreter in question chokes on a syntax error. :) |
... 106 posts hidden. Click here to view all posts.... |
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 - Next |