Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Badass - New 6502 Assembler
2020-06-28 17:47
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
2020-06-28 18:03
Frantic

Registered: Mar 2003
Posts: 1627
Looks quite nice at first glance!
2020-06-28 19:58
chatGPZ

Registered: Dec 2001
Posts: 11114
This is really interesting!
2020-06-28 20:29
Bacchus

Registered: Jan 2002
Posts: 154
Interesting. Will have a look.

/Bacchus
2020-06-28 21:04
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.
2020-06-28 21:10
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?
2020-06-28 21:16
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.
2020-06-28 21:20
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. :)
2020-06-28 21:24
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..
2020-06-28 21:24
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.
2020-06-28 21:25
Krill

Registered: Apr 2002
Posts: 2839
Quoting JackAsser
hashbangs 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
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
rexbeng
manganoid/Hokuto Force
CA$H/TRiAD
deetsay
Guests online: 113
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Bromance  (9.6)
10 Memento Mori  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 MWS  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.057 sec.