EASy68K
http://www.easy68k.com/EASy68Kforum/

local labels
http://www.easy68k.com/EASy68Kforum/viewtopic.php?f=9&t=342
Page 1 of 1

Author:  cpsumner [ Sun Feb 18, 2007 11:07 pm ]
Post subject:  local labels

I would like to be able to use local labels as follows:

Code:
foo     moveq.l #5,D0
        moveq.l #$a5,D1
        lea     buffer,A0
.loop   move.b  D1,(A0)+
        dbra    D0,.loop


where local labels are preceded with a "." and are only valid in between global labels.

alternatively, as follows:

Code:
foo     moveq.l #5,D0
        moveq.l #$a5,D1
        lea     buffer,A0
1$      move.b  D1,(A0)+
        dbra    D0,1$

Author:  profkelly [ Mon Feb 19, 2007 4:32 am ]
Post subject: 

Since EASy68K supports structured assembly there is really no need for local labels. Another thread on this board is discussing the DBcc branch and how it should be handled in structured code. http://www.easy68k.com/EASy68Kforum/viewtopic.php?t=337

Author:  Thorham [ Thu May 07, 2009 3:30 pm ]
Post subject: 

profkelly wrote:
Since EASy68K supports structured assembly there is really no need for local labels. Another thread on this board is discussing the DBcc branch and how it should be handled in structured code. http://www.easy68k.com/EASy68Kforum/viewtopic.php?t=337
Now I know I only really program in 68k on my Amiga with AsmOne, but IMHO it's a bad idea to have to replace local labels with high level commands. They're nice if people want to use them, but because they're not assembler, not everyone will want to use them. For this reason, implementing local lables might not be a bad idea.

Author:  profkelly [ Thu May 07, 2009 4:23 pm ]
Post subject: 

Structured assembly has always been a part of 68000 assembly programming. The structured assembly statements in EASy68K are modeled after those included in the original Motorola 68000 Structured Assembler. Any 68000 assemblers that do not include them are deviating from the standard.

Author:  Thorham [ Thu May 07, 2009 7:56 pm ]
Post subject: 

Hehe, I didn't know that, cool :) However, it doesn't change the fact that not everyone likes to use them (me included :o). Most people in the Amiga 680x0 coding scene have probably always written everything by hand (as far as I can guess), and I've actually never seen any Amiga related 680x0 code that has higher level directives in it.

My personal opinion is that it's actually a bad idea to include higher level directives in 680x0 assemblers. This opinion is completely subjective, of course, except for perhaps an educational reason: People should first learn how to do everything by hand without making a mess of things. When they know how to write proper code without higher level directives, they can start to use them.

Another problem may be that those directives might not always be compiled to the most optimum code, witch might be a problem when writing tight loops that have to run on actual hardware. I must admit that I don't have any facts, because I've never used those directives, and don't even know if my favorite Amiga assembler actually supports them (highly unlikely).

Anyway, seeing how it's probably reasonably easy to implement local labels, why not?

Author:  profkelly [ Mon May 25, 2009 12:55 pm ]
Post subject: 

I have local labels working. The final details may change before release. Currently if a label begins with an underscore it is treated as a local label. The assembler generates a unique global name by appending the local label to the previous global label name. Simple name mangling is done by replacing the underscore with a colon in the symbol table to prevent duplicate label errors with user created labels.

Author:  Thorham [ Mon Jun 01, 2009 10:20 pm ]
Post subject: 

Thanks alot :thumbup: This really helps with keeping code clean. Great. It would be nice if they could start with a point. Looks best, IMHO.

Thanks again.

Author:  profkelly [ Tue Jun 02, 2009 1:05 am ]
Post subject: 

Thorham wrote:
It would be nice if they could start with a point. Looks best, IMHO.

I tried that first but EASy68K uses .L to force long addressing.
Code:
    move.b  stuff.L,d0

Using a point to start local labels confused the parser. I'm going to take a look at the parser code and see if it is easy to change. If not I'll probably stick with underscore or something.

Author:  profkelly [ Tue Jun 02, 2009 7:15 pm ]
Post subject: 

Available in v4.7.0

Local labels begin with a dot '.'

Author:  Thorham [ Mon Jun 29, 2009 7:38 pm ]
Post subject: 

Profkelly, thank you very much, it's appreciated :thumbup:

Author:  RyanFaeScotland [ Wed Jul 17, 2019 9:40 pm ]
Post subject:  Re: local labels

That's me using this feature as well, thanks for pushing for it Thorham and thanks for implementing it Prof. Kelly.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/