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
 
... 106 posts hidden. Click here to view all posts....
 
2020-07-25 08:41
Oswald

Registered: Apr 2002
Posts: 5007
indexed labels is nice, lot of guys need that when creating selfmodded speedcode with macros :)
2020-09-16 10:34
Raistlin

Registered: Mar 2007
Posts: 548
I was interested in trying out this assembler .. but .. trying to compile the source, I'm getting some problems..

On Windows, CMake is refusing to generate the compile_commands.json file ....

Anyone know what might be needed to get this compiling on Windows?
2020-09-17 21:12
Sasq

Registered: Apr 2004
Posts: 155
`compile_commands.json` are not needed for building, only for Intellisense features in editors such as Visual Studio Code.
2020-09-17 21:30
Sasq

Registered: Apr 2004
Posts: 155
The `dev` branch is where it's happening BTW.

The following is an example on how you can let the assembler "pre-render" sid register data for faster playback (like the Dane part in Edge of Disgrace):

    !script "../lua/sid.lua"

    data = load("../data/test.sid")
    sid = sid_parse(data)
    
    !section "music", sid.load
music:
    !fill sid.data

%{

    sid_data = nil

    function generate_data()

        map_bank_write(0xd4, 1, function(adr, val)
            if sid_data then
                table.insert(sid_data, adr - 0xd400)
                table.insert(sid_data, val)
            end
        end)

        start_run()
        init = sym("sid.init")
        play = sym("sid.play")
        set_a(0)
        call(init)
        sid_data[#sid_data - 1] = sid_data[#sid_data - 1] | 0x80
        for i=1,15*50 do
            l = #sid_data
            call(play)
            if l ~= #sid_data then
                sid_data[#sid_data - 1] = sid_data[#sid_data - 1] | 0x80
            else
                print("Silent frame")
            end
        end
    end

    function get_sid_data()
        sid_data = {}
        generate_data()
        result = sid_data
        sid_data = nil
        return result
    end
}%

    !text "SID"
sid_data:
    !fill get_sid_data()
2020-09-17 22:28
JackAsser

Registered: Jun 2002
Posts: 1987
Quote: The `dev` branch is where it's happening BTW.

The following is an example on how you can let the assembler "pre-render" sid register data for faster playback (like the Dane part in Edge of Disgrace):

    !script "../lua/sid.lua"

    data = load("../data/test.sid")
    sid = sid_parse(data)
    
    !section "music", sid.load
music:
    !fill sid.data

%{

    sid_data = nil

    function generate_data()

        map_bank_write(0xd4, 1, function(adr, val)
            if sid_data then
                table.insert(sid_data, adr - 0xd400)
                table.insert(sid_data, val)
            end
        end)

        start_run()
        init = sym("sid.init")
        play = sym("sid.play")
        set_a(0)
        call(init)
        sid_data[#sid_data - 1] = sid_data[#sid_data - 1] | 0x80
        for i=1,15*50 do
            l = #sid_data
            call(play)
            if l ~= #sid_data then
                sid_data[#sid_data - 1] = sid_data[#sid_data - 1] | 0x80
            else
                print("Silent frame")
            end
        end
    end

    function get_sid_data()
        sid_data = {}
        generate_data()
        result = sid_data
        sid_data = nil
        return result
    end
}%

    !text "SID"
sid_data:
    !fill get_sid_data()


Hehe, awesome!
2020-09-17 22:36
Mr. SID

Registered: Jan 2003
Posts: 419
Yeah, you can do stuff like that with k2asm and Python too. Some of it is useful and other things are masturbatory coding... :)
2020-09-17 22:40
Sasq

Registered: Apr 2004
Posts: 155
Does k2asm also contain an emulator?
Otherwise I can't see how it can do this.
2020-09-17 23:49
Mr. SID

Registered: Jan 2003
Posts: 419
No, but you can do pretty much anything in Python these days: https://github.com/docmarionum1/py65emu
2020-09-18 22:38
Compyx

Registered: Jan 2005
Posts: 631
Hot damn, there's PLA in play*. An actual mnemonic in a shitload of 'code'.
2020-12-11 16:16
Sasq

Registered: Apr 2004
Posts: 155
I have done several improvements now, including a built in "fantasy" text mode 6502 system.

This allows you to prototype program to run directly in the terminal.

Made a short & ugly screencast about it:

https://youtu.be/g1uuhz7Qupw

Manual is also coming along, and the "hardware" of the text mode system is documented at the end:

http://apone.org/bass/
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
csabanw
eryngi
Dr. Doom/RAD
Exile/Anubis
CA$H/TRiAD
Wayne/Art Ravers
hedning/G★P
Derision/Longshot
Guests online: 306
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 No Bounds  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 Party Elk 2  (9.7)
2 Cubic Dream  (9.6)
3 Copper Booze  (9.5)
4 Rainbow Connection  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Onscreen 5k  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Nostalgia  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Musicians
1 Rob Hubbard  (9.7)
2 Jeroen Tel  (9.7)
3 Mutetus  (9.6)
4 Linus  (9.6)
5 Jammer  (9.6)

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