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


Forums > C64 Coding > Badass - New 6502 Assembler
2020-06-28 17:47
Sasq

Registered: Apr 2004
Posts: 106
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: 1432
Looks quite nice at first glance!
2020-06-28 19:58
Groepaz

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

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

/Bacchus
2020-06-28 21:04
Sasq

Registered: Apr 2004
Posts: 106
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: 1680
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: 106
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: 1475
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: 1680
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: 1475
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: 1475
Quoting JackAsser
hashbangs are implemented by the exec() routine in the OS..
Until the interpreter in question chokes on a syntax error. :)
 
... 59 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 - 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
Ranthalion75
Jazzcat/Onslaught
Unkle K/Reset Magazi..
Karmic/HVSC/ONS
Black Beard/Abyss, A..
Guests online: 41
Top Demos
1 Coma Light 13  (9.7)
2 Uncensored  (9.7)
3 Edge of Disgrace  (9.7)
4 Comaland 100%  (9.6)
5 Unboxed  (9.6)
6 The Shores of Reflec..  (9.6)
7 Lunatico  (9.5)
8 Remains  (9.5)
9 NGC 1277 100%  (9.5)
10 Wonderland XII  (9.4)
Top onefile Demos
1 Dawnfall V1.1  (9.6)
2 Listen to Your Eyes  (9.6)
3 MD202006 - Get Well ..  (9.6)
4 The Tuneful Eight [u..  (9.5)
5 Smile to the Sky  (9.5)
6 Crystal Gazer  (9.5)
7 Instinct  (9.5)
8 Coro(l)na Nuthouse  (9.5)
9 Rewind  (9.5)
10 Bad Boy  (9.5)
Top Groups
1 PriorArt  (9.6)
2 Performers  (9.5)
3 Booze Design  (9.4)
4 Fossil  (9.4)
5 Censor Design  (9.4)
Top Diskmag Editors
1 hedning  (9.8)
2 Jazzcat  (9.5)
3 Newscopy  (9.4)
4 A Life in Hell  (9.2)
5 Peter  (9.1)

Home - Disclaimer
Copyright © No Name 2001-2020
Page generated in: 0.047 sec.