加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vectors.pl 989 Bytes
一键复制 编辑 原始数据 按行查看 历史
rsc 提交于 2009-05-31 01:00 . sync with c; .text is implied
#!/usr/bin/perl -w
# Generate vectors.S, the trap/interrupt entry points.
# There has to be one entry point per interrupt number
# since otherwise there's no way for trap() to discover
# the interrupt number.
print "# generated by vectors.pl - do not edit\n";
print "# handlers\n";
print ".globl alltraps\n";
for(my $i = 0; $i < 256; $i++){
print ".globl vector$i\n";
print "vector$i:\n";
if(!($i == 8 || ($i >= 10 && $i <= 14) || $i == 17)){
print " pushl \$0\n";
}
print " pushl \$$i\n";
print " jmp alltraps\n";
}
print "\n# vector table\n";
print ".data\n";
print ".globl vectors\n";
print "vectors:\n";
for(my $i = 0; $i < 256; $i++){
print " .long vector$i\n";
}
# sample output:
# # handlers
# .globl alltraps
# .globl vector0
# vector0:
# pushl $0
# pushl $0
# jmp alltraps
# ...
#
# # vector table
# .data
# .globl vectors
# vectors:
# .long vector0
# .long vector1
# .long vector2
# ...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化