Free software cross-assembler for Commodore 64 [message #44025] |
Thu, 21 March 2013 13:07 |
Luca Saiu
Messages: 3 Registered: March 2013
Karma: 0
|
Junior Member |
|
|
As many of you I have very fond memories of my very first computer, a
Commodore 64. However, living in a culturally backward and isolated
setting as I did, with nobody to teach me and only books on BASIC, I
never had the opportunity of learning 6502 assembly programming back in
the time -- or much complex programming at all, as I can see now in
retrospect. I've written a somewhat personal and sentimental post about
my learning experience of those days in my personal blog, which has
received some positive comments: [1].
I'm a grown man now, a computer scientist. I moved to Paris, one of the
centers of the world. But even if now I work on compilers every day, I
still regret the missed opportunity: from the middle-to-late Eighties to
1993, BASIC V2 was all I had; I never did "the real thing".
And so, for nostalgia and because at some level it seems "right", I've
decided to add the Commodore 64 as one target of GNU epsilon, my
ambitious, modern programming language [2] for which I'm now working on
compiler backends. Even if it's only one sub-project for my spare time
and twenty-five years late, this one glorious hack is the least I owe to
that machine.
I need some tools, first of all a cross-assembler running on Unix
machines; and it must be free software -- because epsilon is part of GNU,
and because that's what I decide. The assembler included in cc65 would
actually qualify, even if compiler doesn't [3], and I'd prefer to avoid
it as a dependency for that reason. Is there some other popular
alternative everybody uses? I've seen a couple projects which might be
usable, even if I suppose some sort of "linking" to also be necessary --
or at least some initialization code. How do I load the code in RAM,
from a disk file? I've seen BASIC code containing just a SYS jumping to
the machine language routine, so I guess that's how. What should I read
to learn more about these details?
And what about I/O, or other library routines? Is there some body of
code I can reuse, or does the ROM already contain everything needed?
What documentation would you recommend to me? I'm not a beginner and I
already know several other assembly languages (for "bigger" processors),
but I'm comparatively ignorant about the Commodore low-level workings.
Thanks for any suggestions.
[1] http://ageinghacker.net/blog/posts/5/
[2] http://www.gnu.org/software/epsilon
[3] http://en.wikipedia.org/wiki/Cc65 , third paragraph as of March 2013
--
Luca Saiu
Home page: http://ageinghacker.net
GNU epsilon: http://www.gnu.org/software/epsilon
Marionnet: http://marionnet.org
|
|
|
|
|
Re: Free software cross-assembler for Commodore 64 [message #44123 is a reply to message #44120] |
Thu, 21 March 2013 18:48 |
BLuRry
Messages: 489 Registered: October 2012
Karma: 0
|
Senior Member |
|
|
On Thursday, March 21, 2013 3:18:39 PM UTC-5, Luca Saiu wrote:
>
> They both work as far as I can tell, but I'm not sure about the
>
> respective features. I think I'll skim the documentation and decide.
Haven't used XA but I really liked the macro support in Acme as well as being able to do conditional assembly and passing in external parameters. If you're looking for an all-around environment you can check out Wudsn, which is written by a pretty cool Atari demoscene coder who is very good at responding to emails. It supports Atari, C64 and Apple emulators also so you can go directly from code -> assemble -> run program in one click. (caveat: I'm biased because Wudsn supports Jace, the Apple emulator I'm responsible for)
>
> Good, thank you. Do you -or anybody else- have any recommendation
>
> about 6502 (and C64) assembly documentation?
>
No, nothing in particular. There are great tutorials on 6502.org, but as for C64 stuff I'm quite a n00b since I'm mostly on the Apple side of the fence (but that's not to say I disrespect the Commodore line, I just know a lot less about it!)
-B
|
|
|
Re: Free software cross-assembler for Commodore 64 [message #44143 is a reply to message #44120] |
Thu, 21 March 2013 19:41 |
Anton Treuenfels
Messages: 105 Registered: December 2011
Karma: 0
|
Senior Member |
|
|
"Luca Saiu" <positron@gnu.org> wrote in message
news:kifpll$b1j$1@dont-email.me...
> Good, thank you. Do you -or anybody else- have any recommendation
> about 6502 (and C64) assembly documentation?
Google Is Your Friend.
You can find many, many C64-specific books here:
http://www.bombjack.org/commodore/books.htm
Browse any that catch your eye. See which ones speak to you.
The Jim Butterfield machine language books are well-thought of. The book
about Speedscript has the assembly source to the popular word processor, so
you can see how a large program is put together (although Speedscript itself
turns out to be not particularly well-written).
- Anton Treuenfels
|
|
|
Re: Free software cross-assembler for Commodore 64 [message #44165 is a reply to message #44025] |
Fri, 22 March 2013 03:12 |
Rami
Messages: 27 Registered: February 2012
Karma: 0
|
Junior Member |
|
|
On Thursday, March 21, 2013 7:07:42 PM UTC+2, Luca Saiu wrote:
>
> I need some tools, first of all a cross-assembler running on Unix
>
> machines; and it must be free software -- because epsilon is part of GNU,
>
> and because that's what I decide. The assembler included in cc65 would
>
> actually qualify, even if compiler doesn't [3], and I'd prefer to avoid
>
> it as a dependency for that reason. Is there some other popular
>
> alternative everybody uses? I've seen a couple projects which might be
>
> usable, even if I suppose some sort of "linking" to also be necessary --
>
> or at least some initialization code. How do I load the code in RAM,
>
> from a disk file? I've seen BASIC code containing just a SYS jumping to
>
> the machine language routine, so I guess that's how. What should I read
>
> to learn more about these details?
>
There is also DASM (http://dasm-dillon.sourceforge.net/). It has sourcecode, GPL license and it compiles in Linux without problems. I cannot say much about the feature-set as I have not been using other assemblers.
|
|
|
Re: Free software cross-assembler for Commodore 64 [message #44225 is a reply to message #44165] |
Fri, 22 March 2013 11:10 |
BLuRry
Messages: 489 Registered: October 2012
Karma: 0
|
Senior Member |
|
|
On Friday, March 22, 2013 2:12:22 AM UTC-5, Rami wrote:
> On Thursday, March 21, 2013 7:07:42 PM UTC+2, Luca Saiu wrote:
>
>>
>
>> I need some tools, first of all a cross-assembler running on Unix
>
>>
>
>> machines; and it must be free software -- because epsilon is part of GNU,
>
>>
>
>> and because that's what I decide. The assembler included in cc65 would
>
>>
>
>> actually qualify, even if compiler doesn't [3], and I'd prefer to avoid
>
>>
>
>> it as a dependency for that reason. Is there some other popular
>
>>
>
>> alternative everybody uses? I've seen a couple projects which might be
>
>>
>
>> usable, even if I suppose some sort of "linking" to also be necessary --
>
>>
>
>> or at least some initialization code. How do I load the code in RAM,
>
>>
>
>> from a disk file? I've seen BASIC code containing just a SYS jumping to
>
>>
>
>> the machine language routine, so I guess that's how. What should I read
>
>>
>
>> to learn more about these details?
>
>>
>
>
>
> There is also DASM (http://dasm-dillon.sourceforge.net/). It has sourcecode, GPL license and it compiles in Linux without problems. I cannot say much about the feature-set as I have not been using other assemblers.
Not sure if DASM supports the "undocumented" opcodes of 6502 but Acme does. Acme also supports 65c02 and 65816 which is why I like it. :-)
-B
|
|
|
Re: Free software cross-assembler for Commodore 64 [message #44227 is a reply to message #44120] |
Fri, 22 March 2013 12:07 |
Anssi Saari
Messages: 329 Registered: January 2012
Karma: 0
|
Senior Member |
|
|
Luca Saiu <positron@gnu.org> writes:
> I've had a quick look at xa (http://www.floodgap.com/retrotech/xa/ ) as
> well, and it looks like another reasonable candidate.
I remember using XA a few years ago. I can't remember for sure what for
exactly but I think I had some assembly source that was in XA format and
wanted to change something and build so easiest was to use the same
assembler as originally used. Or it could be there was a makefile
calling xa since it looks like the assmebler syntax isn't that unusual.
Anyways, no problems and it compiled and ran fine on Solaris/Sparc.
|
|
|
Re: Free software cross-assembler for Commodore 64 [message #44228 is a reply to message #44120] |
Fri, 22 March 2013 12:27 |
dott.Piergiorgio
Messages: 166 Registered: March 2012
Karma: 0
|
Senior Member |
|
|
Il 21/03/2013 21:18, Luca Saiu ha scritto:
> On 2013-03-21 at 19:16, Brendan Robert wrote:
>
>> You'll have to compile it yourself but if you're on *nix I assume that doesn't phase you. ;-)
>
> Not at all; it's written in C, with no dependencies at all. It seems
> nice indeed, and also has recent activity.
>
> I've had a quick look at xa (http://www.floodgap.com/retrotech/xa/ ) as
> well, and it looks like another reasonable candidate.
>
> They both work as far as I can tell, but I'm not sure about the
> respective features. I think I'll skim the documentation and decide.
>
> Good, thank you. Do you -or anybody else- have any recommendation
> about 6502 (and C64) assembly documentation?
building (and sharing in opensource) an .include of equates (CHROUT EQU
$FFD2, BORDER EQU $DO20, you got the point...) and macros.
Best regards from Italy,
dott. Piergiorgio.
|
|
|
Re: Free software cross-assembler for Commodore 64 [message #44230 is a reply to message #44025] |
Fri, 22 March 2013 13:13 |
Groepaz
Messages: 640 Registered: December 2011
Karma: 0
|
Senior Member |
|
|
Luca Saiu wrote:
> I need some tools, first of all a cross-assembler running on Unix
> machines; and it must be free software -- because epsilon is part of GNU,
> and because that's what I decide. The assembler included in cc65 would
> actually qualify, even if compiler doesn't [3], and I'd prefer to avoid
> it as a dependency for that reason.
if you are looking for a decent compiler backend, then i would strongly
recommend ca65 though. nothing else comes even close when it comes to
working with libraries and using a sane linker.
--
http://www.hitmen-console.org http://magicdisk.untergrund.net
http://www.pokefinder.org http://ftp.pokefinder.org
The Christian religion not only was at first attended with miracles, but
even at this day cannot be believed by any reasonable person without one.
<David Hume>
|
|
|
|
Re: Free software cross-assembler for Commodore 64 [message #47071 is a reply to message #44025] |
Fri, 05 April 2013 17:58 |
Luca Saiu
Messages: 3 Registered: March 2013
Karma: 0
|
Junior Member |
|
|
Not very elegant but it would work.
>
> I don't see my skill level as high enough to do soldering on the board, especially now that I have everything but this one problem fixed. But I do know a computer maintenance company that would probably do it for a small fee - that's where I had my PLA replaced with the socket. But I would prefer to try the easier fixes first, if there a
|
|
|
Re: Free software cross-assembler for Commodore 64 [message #210475 is a reply to message #44228] |
Mon, 25 November 2013 09:31 |
Martin 'Martinland' S
Messages: 61 Registered: January 2012
Karma: 0
|
Member |
|
|
Ciao!
On Fri, 22 Mar 2013 17:27:28 +0100, dott.Piergiorgio wrote:
> building (and sharing in opensource) an .include of equates (CHROUT EQU
> $FFD2, BORDER EQU $DO20, you got the point...) and macros.
This does sound intriguing and quite useful!
Can you point me to your collection or is it still under development?
RTS,
ML
READY.
|
|
|