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
 
... 59 posts hidden. Click here to view all posts....
 
2020-06-29 10:34
Frantic

Registered: Mar 2003
Posts: 1432
Sounds good I think. Regarding "* ReadOnly - Intended to go into ROM. Assembler could warn if self modifying code is used" it would of course also be important to allow self-modifying code to be assembled to ROM segments, since one would typically copy at least some code from ROM to RAM at runtime, and that code may involve self-modification etc.
2020-06-29 13:32
Golara

Registered: Jan 2018
Posts: 206
big + for c++ I'll definitely check it out
2020-06-29 13:33
JackAsser

Registered: Jun 2002
Posts: 1680
Yes frasse, that is a common use case. I have pure rom segments, i have ram segments (stored on rom) and i have bss-segments (pure ram, nothing stored)
2020-06-29 13:36
Krill

Registered: Apr 2002
Posts: 1475
Quoting Frantic
Sounds good I think. Regarding "* ReadOnly - Intended to go into ROM. Assembler could warn if self modifying code is used" it would of course also be important to allow self-modifying code to be assembled to ROM segments, since one would typically copy at least some code from ROM to RAM at runtime, and that code may involve self-modification etc.
Wouldn't that be a RAM segment that is loaded/assembled to ROM? I.e., a segment with different load and run addresses.
2020-06-29 13:43
Frantic

Registered: Mar 2003
Posts: 1432
Yes, that's what I tried to say. What Jackasser said, basically.
2020-06-29 13:57
Sasq

Registered: Apr 2004
Posts: 106
Well if it's intended for RAM, don't tag it as "Read Only" :)

The terms here can be a bit confusing though.

So if I understand correctly:

load_address is where the section is expected to end up in memory. It is used for checking overlap, and is normally specified directly by the developer. It defines the initial PC (run_address)

run_address is normally the same as load_address, but if the developer changes the PC inside a section, they will not align any more. run_address is something the developer needs to keep track of "manually".

file_offset normally needs to be specified for cart images, where the output is not a simple linear mapping to RAM.
2020-06-29 14:47
Frantic

Registered: Mar 2003
Posts: 1432
Yes, the terms are a bit slippery. So, no matter if I use the terms correctly or not, what I meant was this:

If we distinguish between a segment (a larger unit) and a section (several sections of code can be contained in a segment), a segment which is generally intended for ROM and should be read only, may still contain one section of code which contains something that should be executed in C64 RAM or drive RAM and may contain self-modifying code.

!segment ROM_BANK1, $8000-$A000, READ_ONLY { ;a "segment"

[some read only stuff that can't use self-modifying code etc]

!section NAME_OF_SECTION, relativepc=$0800 { ;a "section" inside the segment

[some stuff that is intended to be copied "manually" from the ROM to $0800 in RAM. This should be able to override the READ ONLY restriction that otherwise applies to the segment that contains this section.]
}

[some more read only stuff that can't use self-modifying code etc]

}

Maybe there is some entirely different and better way to solve this. I just wanted to explain in more detail what I meant.
2020-06-29 16:23
Golara

Registered: Jan 2018
Posts: 206
I know this is tool from coder for a coder, but still you could have released built binaries for people that can't into modern software compilationing

I made it :P Statically linked, so it should work on everything

windows 64bit (compiled with mingw on linux): https://mega.nz/file/2gYXFaBA#MftkFZhFnAdm4fKJ7WCZ4sq3ULVemKlXr..
linux 64bit https://mega.nz/file/2gYXFaBA#MftkFZhFnAdm4fKJ7WCZ4sq3ULVemKlXr..
2020-06-29 16:41
Sasq

Registered: Apr 2004
Posts: 106
@Golara: There are Windows releases on the git-page, built using MSVC.

Binaries for Linux is usually not a good idea.
And for most people it is just "clone" and "make" and you are done.
2020-06-29 16:45
Sasq

Registered: Apr 2004
Posts: 106
@Frantic: I am hoping to avoid multiple levels with both segments and section because it complicates things...

For that particular case you can either mark the section as not ReadOnly and live without the extra checking. But better probably to add support for changing also the ReadOnly state on the fly, like the PC.

I'm wondering if there are other cases that are harder to handle with only one level of sections. Can you think of a situation where you really need the parent/child relationship ?
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 - 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
hqn/Silicon Ltd
McMeatLoaf
Guests online: 38
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 Organizers
1 Tim  (10)
2 cTrix  (10)
3 Retroluzzer  (10)
4 Burglar  (9.9)
5 Sixx  (9.9)

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