Re: [cc65]Asm in CC65

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2001-01-08 08:59:26


Good morning!

On Sun, Jan 07, 2001 at 06:35:30PM -0500, troy silvey wrote:
> Ok that makes sense now. But when I use the following definition,
> the compiler tells me I have too many characters.....
> #define	CLS()	__asm__("/tjsr/t$e544");	//C64 clear
> screen routine//

You have to use backslashes, not forward slashes. "\t" is a tab, "/t" is the
string "/t", so the assembler gets an invalid line and complains.

> In the html docs you have a longer literal string in one of the funtion
> calls.
> #define hi(x) (__AX__=(x),asm("\ttxa\n\tldx\t#$00",__AX__)
> Is there a difference, or am I still doing something wrong?

You may use __asm__ statements that span several lines. In this case I'm
embedding a newline ("\n") into the string that is output into the assembler
source. The header and trailer statements in this line are for the compiler.
The first one loads the macro argument into the A and X registers, so it may
be used by the following assembler code, the last one tells the compiler that
the statement has a value and that this value is again in the A and X
registers.

See the ctype.h header file for more macros of this type.

Regards


	Uz


--
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 : 2001-12-14 22:05:38 CET