我正在用 Y86 编写一个程序,但我的代码行设置堆栈和基指针时不断收到错误“找不到标签”。我的代码是:
.pos 0
init:
irmovl Stack, %esp //Set up stack pointer
irmovl Stack, %ebp //Set up base pointer
call main //call main program
halt //Terminate program
这是它在我的笔记中的显示方式,但是当我尝试编译时,我得到了
Error on line 8: Can't find label
Line 8, Byte 0x0006: irmovl stack, %esp //Set up stack pointer
Error on line 9: Can't find label
Line 9, Byte 0x000c: irmovl stack, %ebp //Set up base pointer
我尝试将 .pos 0 行放在 init 函数中(我认为它可能会有所帮助)以及简单地将 init: 行放在一起,但我仍然遇到同样的问题。