码迷,mamicode.com
首页 > 其他好文 > 详细

8259DMA interrupt

时间:2014-05-21 08:09:28      阅读:252      评论:0      收藏:0      [点我收藏+]

标签:assembler

SSTACK	SEGMENT STACK
		DW 32 DUP(?)
SSTACK	ENDS
CODE	SEGMENT
		ASSUME CS:CODE
START:	PUSH DS
		MOV AX, 0000H
		MOV DS, AX
		MOV	AX, OFFSET MIR7
		MOV SI, 003CH				;0FH
		MOV [SI], AX
		MOV AX, CS
		MOV SI, 003EH
		MOV [SI], AX
		MOV AX, OFFSET MIR6
		MOV SI, 00001110B*4			;0EH
		MOV [SI], AX
		MOV AX, CS
		MOV SI, 00001110B*4+2
		MOV [SI], AX
		
		CLI
		POP DS
		;INIT THE MAIN
		MOV AL, 11H
		OUT 20H, AL
		MOV AL, 08H
		OUT 21H, AL
		MOV AL, 04H
		OUT 21H, AL
		MOV AL, 01H
		OUT 21H, AL
		MOV AL, 2FH		;00101111B
		OUT 21H, AL
		STI
AA1:	NOP
		JMP AA1
MIR7:	PUSH AX
		STI
		MOV AH, 01H
		MOV AL, '7'
		INT 10H
		MOV AH, 01H
		MOV AL, ' '
		INT 10H
		MOV AL, 20H			;ABLE TO INTERUPTE
		OUT 20H, AL
		POP AX
		IRET
MIR6:	PUSH AX
		STI
		MOV AH, 01H
		MOV AL, '6'
		INT 10H
		MOV AH, 01H
		MOV AL, ' '
		INT 10H
		MOV AL, 20H			;ABLE TO INTERUPTE
		OUT 20H, AL
		POP AX
		IRET
CODE	ENDS
		END START



SSTACK	SEGMENT STACK
		DW 32 DUP(?)
SSTACK	ENDS
CODE	SEGMENT
		ASSUME CS:CODE
START:	PUSH DS
		MOV AX, 0000H
		MOV DS, AX
		MOV	AX, OFFSET MIR7
		MOV SI, 003CH
		MOV [SI], AX
		MOV AX, CS
		MOV SI, 003EH
		MOV [SI], AX
		MOV AX, OFFSET SIR1
		MOV SI, 00C4H
		MOV [SI], AX
		MOV AX, CS
		MOV SI, 00C6H
		MOV [SI], AX
		CLI
		POP DS
		;INIT THE MAIN 8259
		MOV AL, 11H
		OUT 20H, AL
		MOV AL, 08H
		OUT 21H, AL
		MOV AL, 04H
		OUT 21H, AL
		MOV AL, 01H
		OUT 21H, AL
		;INIT THE EXTRA 8259
		MOV AL, 11H
		OUT 0A0H, AL
		MOV AL, 30H
		OUT 0A1H, AL
		MOV AL, 02H
		OUT 0A1H, AL
		MOV AL, 01H
		OUT 0A1H, AL
		MOV AL, 0FDH
		OUT 0A1H, AL
		MOV AL, 6BH
		OUT 21H, AL
		STI
AA1:	NOP
		JMP AA1
MIR7:	PUSH AX
		MOV AX, 014DH
		INT 10H
		MOV AX, 0137H
		INT 10H
		MOV AX, 0120H
		INT 10H
		MOV AL, 20H
		OUT 20H, AL
		POP AX
		IRET
SIR1:	PUSH AX
		MOV AX, 0153H
		INT 10H				;S
		MOV AX, 0131H
		INT 10H				;SHOW THE 1
		MOV AX, 0120H
		INT 10H
		MOV AL, 20H
		OUT 0A0H, AL
		OUT 20H, AL
		POP AX
		IRET
CODE	ENDS
		END START


8259DMA interrupt,布布扣,bubuko.com

8259DMA interrupt

标签:assembler

原文地址:http://blog.csdn.net/svitter/article/details/26404549

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!