Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/15/03 18:53
Read: times


 
#43497 - Is there a non-unique label directive?
Is there a way to use non-unique labels in 8051 assembly? I checked the Metalink Asm51 manual and it doesn't look like it, but I didn't really understand some of the macro information.

Let me explain where I am coming from. I wrote a program in assembly for a class some time ago that was for the Motorola 68000. I recall that the assembler allowed special label directives - the labels did not have to be unique. I think the assembler would choose the closest generic label for branching instructions, something like this:

1$ <assembly commands...>
CJNE A,#0,1$
2$ <assembly commands...>
CJNE A,#0,2$
1$ <assembly commands...>
CJNE A,#0,1$

The previous example would be effectively assembled as if it were like this:

LABEL1: <assembly commands...>
CJNE A,#0,LABEL1
LABEL2: <assembly commands...>
CJNE A,#0,LABEL2
LABEL3: <assembly commands...>
CJNE A,#0,LABEL3

The nice thing about it was that every label didn't have to be unique in the code.

Can this be done for the 8051?

Any input is appreciated.

- Lee

List of 10 messages in thread
TopicAuthorDate
Is there a non-unique label directive?            01/01/70 00:00      
   RE: Is there a non-unique label directive?            01/01/70 00:00      
      RE: Is there a non-unique label directive?            01/01/70 00:00      
         RE: Is there a non-unique label directive?            01/01/70 00:00      
            Use of a non-unique label directive?            01/01/70 00:00      
               Reason to use non-unique label            01/01/70 00:00      
               RE: Use of a non-unique label directive?            01/01/70 00:00      
                  RE: Use of a non-unique label directive?            01/01/70 00:00      
                     RE: Use of a non-unique label directive?            01/01/70 00:00      
         RE: Is there a non-unique:Erik            01/01/70 00:00      

Back to Subject List