我正在为教育目的构建一个内核。 右键我的操作系统启动如下:GRUB -> boot.S -> init.c 在boot.S我要加载中断描述符表。这是我的文件的摘录: # load_idt - Loads the interrupt descriptor table (IDT).
# stack: [esp + 4] the address of the first entry in the ID
我读我的书,它有代码交换功能: 在C: int exchange(int *xp, int y) {
int x = *xp;
*xp = y;
return x;
}
在x86汇编与注释: // xp is at %ebp + 8, y at %ebp + 12
movl 8(%ebp), %edx // get xp
movl (%edx), %eax // get x a
我必须在汇编中编写一个函数来完成以下c代码。 int main(){
int hist[26]={0};
int i;
charHistogram("This is a string", hist);
for (i=0; i<26; i++)
printf("%c:%d ", i+’a’, hist[i]);
printf("\n");
}
return 0;
}
这