《操作系统》的实验代码。
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

29 lines
643 B

#include <stdio.h>
int
main(void) {
printf("# handler\n");
printf(".text\n");
printf(".globl __alltraps\n");
int i;
for (i = 0; i < 256; i ++) {
printf(".globl vector%d\n", i);
printf("vector%d:\n", i);
if ((i < 8 || i > 14) && i != 17) {
printf(" pushl $0\n");
}
printf(" pushl $%d\n", i);
printf(" jmp __alltraps\n");
}
printf("\n");
printf("# vector table\n");
printf(".data\n");
printf(".globl __vectors\n");
printf("__vectors:\n");
for (i = 0; i < 256; i ++) {
printf(" .long vector%d\n", i);
}
return 0;
}