title: Local labels in TASM: Symbol already defined
body: <p>I want to use local labels in my procedures to prevent the use of prefixes for common labels in my program. I tried using local labels (@@). According to my book, "The life of a local label extends only forward and back to the next nonlocal label". However, when I try to compile the file, the following error message is returned:</p>
  
  <pre><code>Turbo Assembler  Version 3.1  Copyright (c) 1988, 1992 Borland International
  
  Assembling file:   test.ASM
  **Error** test.ASM(20) Symbol already defined elsewhere: @@EXIT
  **Error** test.ASM(33) Symbol already defined elsewhere: @@EXIT
  Error messages:    2   
  Warning messages:  None
  Passes:            1   
  Remaining memory:  472k
  </code></pre>
  
  <p>Here is the source code:</p>
  
  <pre><code>Data    segment
  Data    ends
  
  Stack1  segment Stack "Stack"
      dw  256 dup(?)
  Stack1  ends
  
  Code    segment
  assume cs:Code, ss:Stack1, ds:Data
  .386
  
  proc1   proc
      ; some code here
      @@exit:
      ret
  proc1   endp
  
  proc2   proc
      ; some code here
      @@exit:
      ret
  proc2   endp
  
  main    proc
      mov ax, Data
      mov ds, ax
  
      @@repeat:
      call    proc1
      call    proc2
      jz  @@repeat
  
      @@exit:
      mov ah, 4Ch
      mov al, 0
      int 21h     
  main    endp
  
  Code    ends
  
  end main
  </code></pre>