[net.micro.cbm] C64 Macro Assembler Question

jjp@mtuni.UUCP (John Pittas) (10/07/86)

I was recently attempting to use the macro capabilities
of the Commodore 64 Assembler and could not get it to
work.  Every time I tried to assemble the code I got a
"Duplicate Symbol" error message.  Perhaps someone can
tell me what I was doing wrong.  Here's what I tried (this
was to be a macro to print a string terminated by a null):

	.MAC PRINT
	LDY #0
?2	LDA ?1,Y
	CMP #0
	BEQ ?3
	JSR $FFD2
	INY
	JMP ?2
?3	.MND

	PRINT TEXT
TEXT	.BYTE 'THIS IS A TEST',$0D,0

I tried numerous variations of this, and every time got
the DUPLICATE SYMBOL error message with the little arrow
pointing at the word PRINT in the PRINT TEXT line.
What am I doing wrong?  HELP!!!!  Thanks in advance.

John Pittas			...!inhp4!mtuni!jjp
ATTIS, Middletown, NJ		(201)957-2305

fred@cbmvax.cbm.UUCP (Fred Bowen) (10/08/86)

> I was recently attempting to use the macro capabilities
> of the Commodore 64 Assembler and could not get it to work.
...
> 	.MAC PRINT
> 	LDY #0
> ?2	LDA ?1,Y
> 	CMP #0
> 	BEQ ?3
> 	JSR $FFD2
> 	INY
> 	JMP ?2
> ?3	.MND
> 
> 	PRINT TEXT
> TEXT	.BYTE 'THIS IS A TEST',$0D,0

This example assembles fine.  You either have a very old version of the
assembler or there is a problem in some other part of your program. The
version I used is C64101 V080282.  Be sure the macro definition of PRINT
occurs _before_ any other use of the symbol PRINT, else the error you
mentioned will pop up as it should.
-- 
Fred Bowen			uucp:	{ihnp4|seismo|caip}!cbmvax!fred
				arpa:	cbmvax!fred@seismo.CSS.GOV
				tele:	215 431-9100

Commodore Electronics, Ltd.,  1200 Wilson Drive,  West Chester,  PA,  19380