|
发表于 2010-11-23 08:25:55
|
显示全部楼层
1.jpg为8259中断仿真,但CPU不能接收中断类型号?请高手指导!
//设置中断失量表
void set_int(unsigned char int_no, void * service_proc)
{ _asm
{ push es
xor ax, ax
mov es, ax
mov al, int_no
xor ah, ah
shl ax, 1
shl ax, 1
mov si, ax
mov ax, service_proc
mov es:[si], ax
inc si
inc si
mov bx, cs
mov es:[si], bx
pop es
}
}
//中断处理函数
void _interrupt _far int_8259(void)
{
char i,j,k;
for(k=0; k<5;k++)
{
outp(ADR_273,0x00);
for(i=0; i<120;i++){for(j=0; j<200;j++){}}
outp(ADR_273,0xff);
for(i=0; i<120;i++){for(j=0; j<200;j++){}}
}
outp(ADR_8259A,0x20);//OCW2,send EOI
}
void init_inttab(void)
// 在中断失量表添加40h号中断失量
{ set_int(0x40, (void *)&int_8259);
} |
|