我如何在 ASM 中与 main 一起使用过程?
How do I use procedures alongside main in ASM?
我是一名学生,目前正在学习汇编语言的基础知识。我遇到了程序将内部过程调用标记为未定义符号 (A2006) 的问题。同时调用包含的库工作得很好。
在网上查了这个问题后,我只看到有人在外部调用时遇到问题,因为他们忘记在包含文件中使用 put 了。至于过程本身,我看到人们以两种不同的方式设置它们,并且都给我未定义的错误。
INCLUDE whatever
.data
.code
main proc
coding
CALL procedurefromwhatever ;this works just fine
CALL name ;this is the part that returns the A2006 undefined error
CALL name_proc ;this doesn't work either
exit
main ENDP
end main
name proc
coding
ret
name ENDP
name_proc:
coding
ret
name ENDP
end main
行应该关闭整个文档,所以把它移到底部(第二个name ENDP
之后),文档在错误的地方关闭,所以程序不会属于代码段,无法识别:
INCLUDE whatever
.data
.code
main proc
coding
CALL procedurefromwhatever ;this works just fine
CALL name ;this is the part that returns the A2006 undefined error
CALL name_proc ;this doesn't work either
exit
main ENDP
;end main ◄■■■ WRONG PLACE. MUST BE AT THE BOTTOM.
name proc
coding
ret
name ENDP
name_proc:
coding
ret
name ENDP
end main ;◄■■■ RIGHT HERE!!!
我是一名学生,目前正在学习汇编语言的基础知识。我遇到了程序将内部过程调用标记为未定义符号 (A2006) 的问题。同时调用包含的库工作得很好。
在网上查了这个问题后,我只看到有人在外部调用时遇到问题,因为他们忘记在包含文件中使用 put 了。至于过程本身,我看到人们以两种不同的方式设置它们,并且都给我未定义的错误。
INCLUDE whatever
.data
.code
main proc
coding
CALL procedurefromwhatever ;this works just fine
CALL name ;this is the part that returns the A2006 undefined error
CALL name_proc ;this doesn't work either
exit
main ENDP
end main
name proc
coding
ret
name ENDP
name_proc:
coding
ret
name ENDP
end main
行应该关闭整个文档,所以把它移到底部(第二个name ENDP
之后),文档在错误的地方关闭,所以程序不会属于代码段,无法识别:
INCLUDE whatever
.data
.code
main proc
coding
CALL procedurefromwhatever ;this works just fine
CALL name ;this is the part that returns the A2006 undefined error
CALL name_proc ;this doesn't work either
exit
main ENDP
;end main ◄■■■ WRONG PLACE. MUST BE AT THE BOTTOM.
name proc
coding
ret
name ENDP
name_proc:
coding
ret
name ENDP
end main ;◄■■■ RIGHT HERE!!!