我正在爲教育目的構建一個內核。 右鍵我的操作系統啓動如下: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;
}
這