Re: [cc65] ca65 for stand-alone asm projects

From: Marc 'BlackJack' Rintsch <marc1rintsch.de>
Date: 2010-11-03 21:48:13
On Wednesday 03 November 2010, Agent Friday wrote:
> On Wed, Nov 3, 2010 at 2:16 AM, Per Olofsson <magervalp@gmail.com> 
wrote:
> > As Ullrich said, ca65 is not a C64 assembler
>
> Sure, but do most users (or potential users) develop for multiple
> platforms, and is that their primary concern?

Maybe not but IMO it is a concern of Uz to provide a toolchain that 
makes as few special cases for particular platforms as possible in the 
tools themselves while still allowing flexible configurations for all 
kinds of 6510 system.

> > . . .using a single assembler source goes against the whole
> > point of having a linker.
>
> So, is the point of having a linker is to make things complicated,
> or is it to skillfully combine the various elements of your project
> into a usable final product?  If all I have is a bit of code in a
> single file, should I go to a different tool?  Keeping simple things
> simple is an important principle in software design.

But not to the point of dumbing them down so they can't do the more 
complicated stuff.  Another principle is to try to code reusable, more 
generic tools.  That said, it seems not *that* complicated to assemble 
a single assembler source for the C64.  Source code::

	.word *+2	; start address
	
	lda #<hello_txt
	ldy #>hello_txt
	jsr $ab1e
	rts
 hello_txt:
	.asciiz	"HELLO"

How to compile that code into a single binary that loads to $1000::

 cl65 --start-addr 0x0ffe -t none -o test.prg test2.s

I see just two drawbacks here:

  1. You have to manually subtract 2 from the start address  given on 
the command line to compensate for the load address.
  2. The charset translation from ASCII to PETSCII is not in effect with 
target `none`.  That's why I wrote "HELLO" in upper case.

For the second one it might be useful to have a pseudo opcode to select 
a whole built-in translation table in the source code.

> So that's my motivation...  I don't mean to criticize or expect
> everyone to see things my way, just hopefully understand my concern. 
>  :-) Documentation will fill the gap for the most part, so I'm
> starting there.

That "technique" above *is* documented under the headline `Porting 
sources from other assemblers <http://www.cc65.org/doc/ca65-17.html>`_ 
in the ca65 documentation.

Ciao,
	Marc 'BlackJack' Rintsch
-- 
Hi! I'm a .signature virus!
Copy me into your ~/.signature to help me spread!

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Wed Nov 3 21:33:25 2010

This archive was generated by hypermail 2.1.8 : 2010-11-03 21:33:28 CET