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: 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
 
... 106 posts hidden. Click here to view all posts....
 
2021-04-13 14:39
JackAsser

Registered: Jun 2002
Posts: 2038
See S:T Lars Meeting III - Invite source
2021-04-13 14:42
Krill

Registered: Apr 2002
Posts: 3098
Quoting map
'Some higher-level compiler-like thing' for this problem seems to be invented it seems.
Why yes, that kind of stuff is something like a d64 image tool, in that every coder sooner or later rolls their own custom implementation (and repeats all the mistakes done by others before). :)

But an open and generic tool for that would be nice, and possibly included with an actual assembler.
2021-04-13 14:50
chatGPZ

Registered: Dec 2001
Posts: 11523
yes - and to be useful for the generic case it really needs support by the assembler. and its a quite tricky problem to solve too, similar to jackassers recent pack-code-into-banks challenge :)
2021-04-13 15:25
JackAsser

Registered: Jun 2002
Posts: 2038
Quote: See S:T Lars Meeting III - Invite source

This one tracks register usage and cycles in the speed code in one code base and nops in another timed codebase and merges them while maintaining critical timing.
2021-04-13 15:26
JackAsser

Registered: Jun 2002
Posts: 2038
Quote: yes - and to be useful for the generic case it really needs support by the assembler. and its a quite tricky problem to solve too, similar to jackassers recent pack-code-into-banks challenge :)

Which worked extremely well. I now have a prelinker scripts that digests all .o and .lib files and actually generates the link file for ld65. A prelinker. Freed up alot of space.
2021-04-13 15:37
Krill

Registered: Apr 2002
Posts: 3098
Quoting JackAsser
This one tracks register usage and cycles in the speed code in one code base and nops in another timed codebase and merges them while maintaining critical timing.
Yes, and that kind of stuff would have to be formalised for a generic tool. =)
2021-04-13 15:37
Rex

Registered: Sep 2011
Posts: 14
For borderline pacman I coded a cycle-based code merger in C for merging cycle-exact raster code (opening the side-borders, displaying 9 sprites per rasterline etc.) with BOB-rendering code (rendering pacman and ghosts plus updating changed tiles).

In my case the raster-code has defined "cycle holes" with number of cycles that has to be spent and the BOB-code is split into tiny "atomic" blocks marked with the number of cycles the block uses. The code merger is short and runs on the c64 itself - it fills up the "cycle holes" with BOB-codes and NOP/BIT$EA to ensure the exact number of cycles is produced.

https://gitlab.com/camelot/kickc/-/blob/master/src/test/kc/comp..

This was the specific type of merging I needed for that effect. Other effects will need other types of code merging. Merging code and data will require another completely different merging strategy.

I am not sure that a general solution for the "merging problem" does exist. It would be interesting to see some ideas on what a general solution could look like.
2021-04-13 15:46
Krill

Registered: Apr 2002
Posts: 3098
Quoting Rex
It would be interesting to see some ideas on what a general solution could look like.
I propose... a combined superset of various use-cases and their individual strategies. =)

But i guess the "FPP data"/"NMI handlers" problem would be the easiest to solve first. As in, have some fixed gaps in the code to assemble around.
2021-04-13 15:57
Raistlin

Registered: Mar 2007
Posts: 771
Nice work, Rex - I use something similar in my all-border DYPPs and other such effects ... though I generate everything on PC by having CPP spit out ASM files.

There are some interesting optimizations to be had with this sort of stuff .. for example, where you have a 13 cycle gap and the code you want to insert is just STAs (4 cycles each). Use 12 cycles and you're left with a 1-cycle "problem... so you use 8 cycles instead, "wasting" 4-5. In my code, where possible, I made it such that I could easily waste an additional cycle - so using STA ----, Y for example, ensuring that the indexed write will always cross a page boundary (and therefore eat an extra cycle). Not always possible of course... but well worth it when it is.
2021-04-13 16:06
Krill

Registered: Apr 2002
Posts: 3098
Quoting Raistlin
STA ----, Y for example, ensuring that the indexed write will always cross a page boundary (and therefore eat an extra cycle).
So... formalise as "sta label,_y"? (without index or with y.) :)

(And i believe STA mem16,Y has a cycle count independent of page crossings: always 5.)
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
S.E.S./Crest
Tommy/Noice^DCS
Scrap/Genesis Project
Thunder.Bird/HF/MYD!..
encore
MWR/Visdom
iAN CooG/HVSC
mutetus/Ald ^ Ons
master_hacker
Guests online: 250
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 Wonderland XIV  (9.5)
9 Uncensored  (9.5)
10 Comaland 100%  (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 Crackers
1 Mr. Z  (9.9)
2 OTD  (9.8)
3 Antitrack  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

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