我想在我的程序中使用本地标签来防止在我的程序中使用公共标签的前缀。我尝试使用本地标签 (@@)。根据我的书,“本地标签的生命周期只会向前和向后延伸到下一个非本地标签”。但是,当我尝试编译文件时,会返回以下错误消息:
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
这是源代码:
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