⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pic.inc

📁 TestOS - 带简单GUI的DOS扩展OS// 源代码// ASM// 英文
💻 INC
字号:
;=========================================================;
; pic                                            11/12/03 ;
;---------------------------------------------------------;
; DOS EXTREME OS V0.01                                    ;
; by Craig Bamford.                                       ;
;                                                         ;
; Remapping the pics.                                     ;                          
;=========================================================;

 remap_pic:
        cli
        mov  al,0x11			                  ; put both 8259s in init mode
	out  0x20,al
	out  0xA0,al

	mov  al,0x20			                  ; remap pic irq0-irq7 -> int 0x20-27
	out  0x21,al

	mov  al,0x28
	out  0xA1,al			                  ; remap pic irq8-irq15 -> int 0x28-30

	mov  al,4                                         ; icw3 pic1(master)
	out  0x21,al                                      ; bit 2=1: irq2 is the slave

	mov  al,2                                         ; icw3 pic2
	out  0xA1,al                                      ; bit 1=1: slave id is 2

	mov  al,1                                         ; icw4 to both controllers
	out  0x21,al                                      ; bit 0=1: 8086 mode
	out  0xA1,al
       
        cli
        mov  al,255                                       ; mask all irqs
        out  0xa1,al
        out  0x21,al
        ret

unmask_irqs:
        mov  al,0                                         ; unmask irq's 
        out  0xA1,al
        out  0x21,al
        sti
        ret

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -