Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user shad0wfax ! (Registered 2025-06-17) 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: 157
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: 1661
Looks quite nice at first glance!
2020-06-28 19:58
chatGPZ

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

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

/Bacchus
2020-06-28 21:04
Sasq

Registered: Apr 2004
Posts: 157
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: 2038
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: 157
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: 3083
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: 2038
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: 3083
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: 3083
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
bugjam
rime/Fancy Rats
CA$H/TRiAD
Mike
CreaMD/React
REBEL 1/HF
TheRyk/MYD!
jamespurcell
K-reator/CMS/F4CG
Trap/Bonzai
Acidchild/Padua
Didi/Laxity
Alakran_64
Guests online: 251
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Mojo  (9.6)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 Signal Carnival  (9.6)
8 Uncensored  (9.5)
9 Wonderland XIV  (9.5)
10 No Bounds  (9.5)
Top onefile Demos
1 Nine  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.5)
6 Scan and Spin  (9.5)
7 Onscreen 5k  (9.5)
8 Grey  (9.5)
9 Dawnfall V1.1  (9.5)
10 Rainbow Connection  (9.5)
Top Groups
1 Artline Designs  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Performers  (9.3)
5 Censor Design  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Acidchild  (9.7)
4 Cash  (9.6)
5 Violator  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.042 sec.