【发布时间】:2010-10-01 13:25:44
【问题描述】:
我想将变量“userstack”的值移动到 ESP 寄存器中,然后绝对跳转到变量“location”中包含的内存地址。 这就是我所拥有的:
// These are the two variables that contains memory addresses
uint32_t location = current_running->LOCATION;
uint32_t userstack = current_running->user_stack;
// And then something like this
__asm__ volatile ("movl userstack, %esp");
__asm__ volatile ("ljmp $0x0000, location");
但是,当我尝试编译时,我得到了错误: “错误:后缀或操作数对 ljmp 无效”和“未定义对 `userstack' 的引用”。
非常感谢任何帮助。
【问题讨论】:
标签: gcc inline-assembly