Local labels in vasm motorola assembly

Topics relating to the 68000 CPU in general, not a specific platform.
Post Reply
ryu
Posts: 3
Joined: Sun Aug 18, 2019 9:20 am

Local labels in vasm motorola assembly

Post by ryu » Sun Aug 18, 2019 8:31 pm

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.

User avatar
akuyou
Posts: 563
Joined: Mon Apr 22, 2019 3:19 am
Contact:

Re: Local labels in vasm motorola assembly

Post by akuyou » Sun Aug 18, 2019 9:32 pm

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
	
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

ryu
Posts: 3
Joined: Sun Aug 18, 2019 9:20 am

Re: Local labels in vasm motorola assembly

Post by ryu » Tue Aug 20, 2019 8:47 am

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.

Post Reply

Return to “General 68000 Assembly”