dasm-assembler / dasm

Macro assembler with support for several 8-bit microprocessors

Home Page:https://dasm-assembler.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error (?) with dynamic labels

neilsf opened this issue · comments

BIG THANKS for maintaining DASM, my favourite assembler!

I'm trying to use dynamic labels as they would be extremely useful in my project. However I might be misunderstanding something. Here's my code:

	PROCESSOR 6502
	
	ORG $c000
	
	MAC import
"IMPORT_",{1} SET 1
	ENDM
	
	import "IROUTINE"
	jsr ROUTINE_NAME
	rts
	
	IFCONST IMPORT_IROUTINE
ROUTINE_NAME SUBROUTINE
	lda #$00	
	sta $d020	
	rts	
	ENDIF

I would expect the label IMPORT_IROUTINE to be dynamically created, however I get this error:

char = '{' 123 (-1: 0)
char = '}' 125 (-1: 49)
char = '{' 123 (-1: 0)
char = '}' 125 (-1: 49)
--- Unresolved Symbol List
ROUTINE_NAME             0000 ????         (R )
IMPORT_IROUTINE          0000 ????         (R )
SET                      0000 ????         (R )
--- 3 Unresolved Symbols

/tmp/x.asm (6): error: Illegal character '{1} SET 1'.
/tmp/x.asm (6): error: Illegal character '} SET 1'.
/tmp/x.asm (6): error: Syntax Error '{1} SET 1'.

Fatal assembly error: Source is not resolvable.

Can you please help finding out why it fails. Many thanks.

You simply have to write IMPORT_{1} SET 1

That works, thanks. I thought the comma syntax was the preferred way. Thanks again.