Page 1 of 1

Local labels in vasm motorola assembly

Posted: Sun Aug 18, 2019 8:31 pm
by ryu
Are local labels supported by vasm with motorola syntax? I'm thinking what other assemblers support with @ prefixes or numerical labels.

The vasm documentation says local labels are prefixed with ".", but this example

Code: Select all

.mylabel:
	move.l d0,d1
	dbra d2,.mylabel
	.
	.
	.
.mylabel:
	move.l d0,d1
	dbra d2,.mylabel
causes the assembler to complain that the label .mylabel has been defined already.

Re: Local labels in vasm motorola assembly

Posted: Sun Aug 18, 2019 9:32 pm
by akuyou
Personally I don't use local labels in my code, because Winape didn't support them, so I tend to avoid them,
but the code below seems to work with MOT and VASM

I think there needs to be a 'non local label' before the second use of the label, if I remove the 'locallabel12' label I get an error

Code: Select all

	move.w #2,d2
.loop
	move.b #'A',d0
	jsr PrintChar
	dbra d2,.loop 
	
	move.w #2,d2
locallabel12:

.loop
	move.b #'B',d0
	jsr PrintChar
	dbra d2,.loop
	

Re: Local labels in vasm motorola assembly

Posted: Tue Aug 20, 2019 8:47 am
by ryu
Thanks! I completely forgot to test that case since something along the lines was mentioned in the VASM docs.

So it seems flexible local labels are out of the question with my setup. Would have been neat to have but it's not a dealbreaker.