这可能是一个有点奇怪的问题,但我希望有人仍然可以帮助我;)。我想执行一个标准的 C 程序,但是,在程序执行期间的某个时刻,我希望执行一定数量的指令,这些指令存储在本地暂存器 RAM 中。所有进程都可以访问暂存器内存。让我们假设这个本地内存从地址 0x80000000 开始,我将把它集成到下面的 C 代码片段中
int main {
int a=1;
int b=2;
int c=3;
c = a + b;
%goto address 0x80000000 and execute three instructions before continuing
%program execution here
return(0);
}
假设 main 在 0x40000000 加载,程序计数器将经历以下阶段
0x40000000 a=5;
0x40000004 b=2;
0x40000008 c=1;
0x4000000C c=a+b;
0x80000000 first instruction in the local scratch pad
0x80000004 second instruction in the local scratch pad
0x80000008 third instruction in the local scratch pad
0x40000010 return(0);
任何人都知道如何做到这一点?我需要使用汇编程序跳转指令还是有更优雅的东西。
非常感谢,安迪