【发布时间】:2013-07-08 12:49:48
【问题描述】:
我有一个名为system_handler 的函数,它在func.c 中定义。我需要从另一个汇编程序调用system_handler,方法是将函数的地址传递给寄存器并调用该寄存器。
到目前为止,我已经写了这个:
.extern system_handler ; Is defined in func.c
mov system_handler, %eax
call %eax ; This call is making run time error in emulator
; fatal: Trying to execute code outside RAM or ROM at 0x8b1cec83
在组装 asm 文件时,我收到一条警告:
Warning: indirect call without '*'
使用的编译器和汇编器:i586-gnu-{gcc/as},在 asm 文件中使用 AT&T 格式。
【问题讨论】: