Re: [cc65] Inserting Assembly Routines

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2002-11-25 19:25:07


Hi!

On Sun, Nov 24, 2002 at 06:50:20PM -0600, Brian Bagnall wrote:
> I'm wondering if there are some docs about inserting assembly into C code
> for cc65.

There are not many docs, but lots of samples: Most of the runtime library is
written in assembler, so just have a look at these files.

> I assume this is possible since ca65 is an assembler, but what's
> the best way to manage assembly code with a C project?

ca65 is not only an assembler, it is in fact one of the best assemblers
around:-) [*]

> I saw something in
> the faq about the .org directive but I assume there's more documentation
> somewhere.

As groepaz already said: Forget about the .org directive, you don't need it. I
would suggest reading "internal.txt" and having a look at a few C functions
from the runtime library.

For shorter routines there is also the option of using inline assembly. The
nice thing about inline assembly is that it enables the programmer to use
knowledge only available to the compiler without further hassle. Examples are
offsets of variables on the stack, offsets of struct fields, C defines and
more. There's a chapter in the compiler doc covering inline assembly.

Regards


        Uz


[*] I had to write this, since I'm the author:-) But it's not only me who
thinks that. You may for example read

        http://members.optusnet.com.au/~linuxpenguin/programming.html

(bottom of page).

-- 
Ullrich von Bassewitz                                  uz_at_musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-11-25 19:25:12 CET