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

📄 8661lpt.asl

📁 award bios 源代码,喜欢汇编程序及想研究主板BIOS程序的人可以参考哦.我是费了老大的劲才找到的哦.
💻 ASL
字号:



Device(LPT) 	{			// Legacy printer port
        Name (_HID, EISAID("PNP0400")) 	// PnP ID for ITE8680 LPT Port
        Method (_STA, 0){		// LPT Device Status
                ENFG() 			// Config Mode
                Store (0x03, LDN_) 	// Select PRN Device (LDN_ = 03)

                And(OPT1, 0x2, Local0)

                If (LEqual(Local0, 0x0)) {
                        If (ACTR) {	
                                EXFG()
                                Return(0x0F)
                                }	// Device present and active
                        Else	{
                                If (LOr(IOAH,IOAL)) {
                                        EXFG()

                                        Return(0x0D)
                                        }
                                Else {
                                        EXFG()

                                        Return(0x00)  // code = Device not even Present
                                        }
                                }
                        }
                Else	{
                        EXFG()
                        Return(0x00) 	//Not present
                        }
                } 			// end of _STA method


        Method (_DIS,0)	{ 		// LPT Device Disable
                ENFG()			// Enter Configuration Mode
                Store (0x03, LDN_) 	// Select PRN Device (LDN_ = 03)
                And(OPT1, 0x2, Local0)
                If (LEqual(Local0, 0x0)) {
                Store (Zero, ACTR) 	// Set Activate Reg = 0
                }
                EXFG()
                } 			// 	End of _DIS Method

        Method (_CRS,0) 	{ 		// LPT Current Resources
                Name(BUF5, Buffer ()
                        { 		//13*8 Length of Buffer
                        0x47, 		// IO port descriptor
                        0x01, 		// 16 bit decode
                        0x00, 		// LPT1 @ 0x278h
                        0x00,
                        0x00,
                        0x00,
                        0x00, 		//alignment
                        0x08, 		//number of ports

                        0x22, 		// IRQ Descriptor
                        0x00, 		// IRQ7 (Bit15=IRQ15....Bit0=IRQ0)
                        0x00,

                        0x79, 		// END TAG
                        0x00,
                        } 		// end of Buffer
                ) 			// end _CRS method

                CreateByteField (BUF5, 0x02, IOLO)
                CreateByteField (BUF5, 0x03, IOHI)
                CreateByteField (BUF5, 0x04, IORL) 	// IO Port Low
                CreateByteField (BUF5, 0x05, IORH) 	// IO Port HI
                CreateByteField (BUF5, 0x07, IOLN)
                CreateByteField (BUF5, 0x09, IRQL)

                ENFG()
                Store (0x03, LDN_) 	//Select Logical Device 3 (LPT)

                Store (One,ACTR)
                Store (IOAL, IOLO)	// io, min.
                Store (IOAL, IORL)	// io, max.

                Store (IOAH, IOHI)	// io, min.
                Store (IOAH, IORH)	// io, max.

                If (Lequal(IOLO,0xBC)) {
                        Store (0x04,IOLN)
                        }
                Else	{
                        Store (0x08,IOLN)
                        }

                Store(One,Local0)
                ShiftLeft(Local0,INTR,IRQL) 	// (src, shiftcount, result)

                EXFG()
                Return(BUF5) 		// return BUF3 filled with Current Resources
        } 			// end _CRS method


        Name(_PRS, Buffer()
                { 			//13*8
                0x30, 			// Start Dependent Function

                0x47, 			// IO port descriptor
                0x01, 			// 16 bit decode
                0x78, 			// LPT1 @ 0x378h
                0x03,
                0x78,
                0x03,
                0x00, 			// alignment
                0x08, 			// number of ports

                0x22, 			// IRQ Descriptor
                0xB8, 			// IRQ5, IRQ7(Bit15=IRQ15....Bit0=IRQ0)
                0x00,
                0x30, 			// Start Dependent Function

                0x47, 			// IO port descriptor
                0x01, 			// 16 bit decode
                0x78, 			// LPT1 @ 0x278h
                0x02,
                0x78,
                0x02,
                0x00, 			// alignment
                0x08, 			// number of ports

                0x22, 			// IRQ Descriptor
                0xB8, 			// IRQ5, IRQ7(Bit15=IRQ15....Bit0=IRQ0)
                0x00,
                0x30, 			// Start Dependent Function

                0x47, 			// IO port descriptor
                0x01, 			// 16 bit decode
                0xBC, 			// LPT1 @ 0x3BCh
                0x03,
                0xBC,
                0x03,
                0x00, 			// alignment
                0x04, 			// number of ports

                0x22, 			// IRQ Descriptor
                0xB8, 			// IRQ5, IRQ7(Bit15=IRQ15....Bit0=IRQ0)
                0x00,

                0x38,			// EndDF (optional, readlly)
                0x79, 			// END TAG
                0x00,			// Checksum byte
                } 			// end of Buffer
        ) 				// end _PRS method

        Method (_SRS,1 )	{ 	// LPT Set Resources & Enables the Device

                CreateByteField (Arg0, 0x02, IOLO) 	// IO Port Low
                CreateByteField (Arg0, 0x03, IOHI) 	// IO Port HI
                CreateByteField (Arg0, 0x04, IORL) 	// IO Port Low
                CreateByteField (Arg0, 0x05, IORH) 	// IO Port HI
                CreateByteField (Arg0, 0x09, IRQL) 	// IRQ MASK
                ENFG()

                Store(0x03, LDN_)
                Store(IOLO, IOAL) 	// Write IO Port LOW to dev cfg reg
                Store(IOHI, IOAH)

                FindSetLeftBit(IRQL, Local0)
                Subtract(Local0, 0x01, INTR)
                Store(One, ACTR) 	// Active (ie Enable) the Device
                EXFG()
                } 			// end of _SRS Method
        } 				// end LPT device



Device(ECP) {
        Name (_HID, EISAID("PNP0401")) 	// PnP ID for ITE8680 ECP Port
        Method (_STA, 0){ 		// ECP Device Status
                ENFG()
                Store(0x03, LDN_) 	// Select LDN_ #3 (LPT)

                And(OPT1, 0x2, Local0)

                If (LEqual(Local0, 0x2)) {
                        If (ACTR) {	
                                EXFG()
                                Return(0x0F)
                                }	// Device present and active
                        Else	{
                                If (LOr(IOAH,IOAL)) {
                                        EXFG()

                                        Return(0x0D)
                                        }
                                Else {
                                        EXFG()

                                        Return(0x00)  // code = Device not even Present
                                        }
                                }
                        }
                Else	{
                        EXFG()
                        Return(0x00) 	//Not present
                        }
                } 			// end of _STA method

        Method (_DIS,0) { 		// ECP Device Disable
                ENFG()
                Store (0x03,LDN_) 	// Select PRN Device (LDN_ = 03)
                Store (Zero, ACTR) 	// Set Activate Reg = 0
                EXFG()
                } 			// end of _DIS method

        Method (_CRS,0) 	{ 		// EPP Current Resources
                Name(BUF6, Buffer()
                        { 		// 16*8
                        0x47, 		// IO port descriptor
                        0x01, 		// 16 bit decode
                        0x00, 		// LPT1 @ 0x278h
                        0x00,
                        0x00,
                        0x00,
                        0x00, 		// alignment
                        0x00, 		// number of ports

                        0x47, 		// IO port descriptor
                        0x01, 		// 16 bit decode
                        0x00,
                        0x00,
                        0x00,
                        0x00,
                        0x00, 		// alignment
                        0x00, 		// number of ports

                        0x22, 		// IRQ Descriptor
                        0x00, 		// IRQ7 (Bit15=IRQ15....Bit0=IRQ0)
                        0x00,

                        0x2A, 		// DMA Descriptor
                        0x00, 		// DMA3 (Bit7=DMA7....Bit0=DMA0)
                        0x00, 		// 8-bit, not a Bus Master, compatibility mode chn speed

                        0x79, 		// end tag
                        0x00,
                        }
                )

                CreateByteField (BUF6, 0x02, IOLO)
                CreateByteField (BUF6, 0x03, IOHI)
                CreateByteField (BUF6, 0x04, IORL) 	// IO Port Low
                CreateByteField (BUF6, 0x05, IORH) 	// IO Port HI
                CreateByteField (BUF6, 0x07, IOLN)
                CreateByteField (BUF6, 0x0A, IOEL)
                CreateByteField (BUF6, 0x0B, IOEH)
                CreateByteField (BUF6, 0x0C, IOML) 	// IO Port Low
                CreateByteField (BUF6, 0x0D, IOMH) 	// IO Port HI
                CreateByteField (BUF6, 0x0F, IOHN)
                CreateByteField (BUF6, 0x11, IRQL)
                CreateByteField (BUF6, 0x14, DMAC)

                ENFG()
                Store (0x03, LDN_) 	// Select Logical Device 3 (LPT)
                Store (One, ACTR)
                Store (IOAL, IOLO)	// io, min.
                Store (IOAL, IORL)	// io, max.

                Store (IOAL, IOEL)	// io, min.
                Store (IOAL, IOML)	// io, max.

                Store (IOAH, IOHI)	// io, min.
                Store (IOAH, IORH)	// io, max.

                Store (IOAH, Local3)
                Or (Local3, 0x04, Local3)// Write IO Port High to dev cfg buffer
                Store (Local3, IOEH)
                Store (Local3, IOMH)

                If (Lequal(IOLO,0xBC)) {
                        Store (0x04,IOLN)
                        Store (0x04,IOHN)
                        }
                Else	{
                        Store (0x08,IOLN)
                        Store (0x04,IOHN)
                        }


                Store(One,Local0)
                ShiftLeft(Local0,INTR,IRQL) 	// (src, shiftcount, result)

                Store(One,Local0)
                ShiftLeft(Local0,DMCH,DMAC)

                EXFG()
                Return(BUF6) 		// return BUF6 filled with Current Resources
        } 				// end _CRS method
        
        Name(_PRS, Buffer()
                {			// 16*8
                0x30,

                0x47,
                0x01,
                0x78,
                0x03,
                0x78,
                0x03,
                0x00,
                0x08,

                0x47,
                0x01,
                0x78,
                0x07,
                0x78,
                0x07,
                0x00,
                0x04,

                0x22,
                0xB8,
                0x00,
                
                0x2A,
                0x0B,
                0x00,
                
                0x30,

                0x47,
                0x01,
                0x78,
                0x02,
                0x78,
                0x02,
                0x00,
                0x08,

                0x47,
                0x01,
                0x78,
                0x06,
                0x78,
                0x06,
                0x00,
                0x04,

                0x22,
                0xB8,
                0x00,

                0x2A,
                0x0B,
                0x00,
                
                0x30,

                0x47,
                0x01,
                0xBC,
                0x03,
                0xBC,
                0x03,
                0x00,
                0x04,

                0x47,
                0x01,
                0xBC,
                0x07,
                0xBC,
                0x07,
                0x00,
                0x04,

                0x22,
                0xB8,
                0x00,

                0x2A,
                0x0B,
                0x00,
                
                0x38,

                0x79,
                0x00,
                } 			// end Buffer
        ) 				// end _PRS method		

        Method (_SRS,1 ) 	{ 		// ECP Set Resources & ENABLES the Device

                CreateByteField (ARG0, 0x02, IOLO) 	// IO Port Low
                CreateByteField (ARG0, 0x03, IOHI) 	// IO Port HI
                CreateByteField (ARG0, 0x11, IRQL)
                CreateByteField (ARG0, 0x14, DMAC) 	// DMA Channel to assign
                ENFG()

                Store(0x03, LDN_) 	// Select LDN_ #3 (LPT)
                Store(One, ACTR) 	// Active (ie Enable) the Device
                Store(IOLO, IOAL) 	// Write IO Port LOW to dev cfg reg
                Store(IOLO, IOBL)
                Store(IOHI, IOAH)
                add(IOHI, 0x04, IOBH)

                FindSetLeftBit(IRQL, Local0)
                Subtract(Local0, 0x01, INTR)

                FindSetLeftBit(DMAC, Local1)	
                Subtract(Local1, 0x01, DMCH)	

                EXFG()
                } 			// end of _SRS method
        } 				// end ECP device



⌨️ 快捷键说明

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