《8259中断程序代码.docx》由会员分享,可在线阅读,更多相关《8259中断程序代码.docx(11页珍藏版)》请在优知文库上搜索。
1、程序1T08259 0 EQU OFOOOHIO8259_1 EQU OFOOlH_STACK SEGMENT STACKDW 100 DUP (?)_STACK ENDS_DATA SEGMENT WORD PUBLlC DATA,_DATA ENDSCODE SEGMENTASSUME CS: CODE, DS:_DATA, SS:_STACKSTART: MOV AX, _DATAMOV DS, AXMOV ES, AXNOPCALL Init8259CALL WriIntverAl: CMP CX, OOOHJNZ A2CLIA3:JMP $A2:STIJMP AlInit8259 P
2、ROC NEARMOV DX, T08259 OMOV AL, 13HOUT DX, ALMOV DX, I08259_lMOV AL, 08HOUT DX, ALMOV AL, 09HOUT DX, ALMOV AL, OFEHRETInit8259 ENDPWrilntver PROC NEARPUSH ESMOV AX, OMOV ES, AXMOV DI,02HLEA AX, INT_OMOV ES:DI,AXADD DI, 2MOV ES:DI,AXPOP ESRETWriIntver ENDPINT O: INC CXMOV DX,I08259_0OUT DX, ALIRETCOD
3、E ENDSEND START程序2I08259_0 EQU OFOOOHI08259_l EQU OFOOlH_STACK SEGMENT STACKDW 100 (?)_STACK ENDS_DATA SEGMENT WORD PUBLIC, DATA,_DATA ENDSCODE SEGMENTASSUME CS:CODE, DS:_DATA, SS:,STACK START: MOV AX, _DATAMOV DS, AXMOV ES, AXNoPCALL Init8259CALL WriIntverMOV SI,3000HMOV DI,6000HAl: STIJMP AlInit82
4、59 PROC NEARMOV DX, T08259 OMOV AL, 13HOUT DX, ALMOV DX, I08259_lMOV AL, 08HOUT DX, ALMOV AL, 09HOUT DX, ALMOV AL, 7EHRETInit8259 ENDPWrilntver PROC NEARPUSH ESMOV AX, OMOV ES, AXMOV DI, 20HLEA AX, INT_OMOV ES:DI,AXADD DI, 2MOV AX, CSMOV ES:DI,AXMOV DI, 3CHLEA AX, INT_7MOV ES:DT,AXADD DI, 2MOV ES:DI,AXPOP ESRET WriIntver ENDPINT_O: MOV AX, 02H MOV SI,AXSTIMOV AX, OlHMOV SI, AXMOV DX, 108259 O MOV AL, 20HOUT DX, ALIRETINT_7: MOV AX, 02H MOV DI,AXSTIMOV AX, OlHMOV DI,AXMOV DX, I08259_0 MOV AL,20HOUT DX, ALIRETCODE ENDSEND START