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

📄 cls1.lst

📁 82K96E/82M99E开发的USB键盘接收端DEMO程序源码
💻 LST
📖 第 1 页 / 共 2 页
字号:
"File: CLS1.ASM      Holtek Cross-Assembler  Version 2.86      Page 1


   1  0000              include			HT82K96e.inc


   2  0000              include			usbrf.inc	


   3  0000              
   4  0000              
   5  0000              EXTERN			bCMD_INDEX:BIT
   6  0000              extern			bAltkbProtocol	:bit
   7  0000              extern			baltmouseprotocol	:bit
   8  0000              
   9  0000              
  10  0000              extern			TempKBTime		:byte
  11  0000              extern			TempmouseTime	:byte	
  12  0000              extern			TempKBTime_L	:byte	
  13  0000              extern			TempmouseTime_L	:byte
  14  0000              
  15  0000              extern			fifo_type		:byte	
  16  0000              extern			FIFO_Request	:byte
  17  0000              extern			fifo_wIndexl	:byte
  18  0000              extern			FIFO_wIndexH 	:byte
  19  0000              extern			FIFO_wValueL 	:byte
  20  0000              extern			FIFO_wValueH	:byte
  21  0000              extern			FIFO_wLengthH	:byte
  22  0000              extern			FIFO_wLengthL	:byte
  23  0000              
  24  0000              extern			INT_temp2		:byte
  25  0000              extern			FIFO_OUT1		:byte
  26  0000              extern			FIFO_SendLen	:byte
  27  0000              extern			ReportkbTime	:byte
  28  0000              extern			ReportMouseTime	:byte
  29  0000              extern			
  30  0000              
  31  0000              
  32  0000              extern			movekeyboarddata	:near
  33  0000              Extern			ExitExt				:near
  34  0000              EXTERN			ToStallPipe0		:NEAR
  35  0000              EXTERN			SendFIFOOut			:NEAR
  36  0000              EXTERN			SendHandshake		:NEAR
  37  0000              ;extern			moveacpidata		:near
  38  0000              ;extern			moveMultidata		:near
  39  0000              
  40  0000              TEMP			EQU			INT_TEMP2
  41  0000              
  42  0000              CLS1			.SECTION  AT 		1d0h	'code'		;1cbH  'code'
  43  0000              
  44  0000              ;----- Class-Specific request -----------------------------------------------
  45  0000              
  46  0000              
  47  0000              SetProtocol:	;
  48  0000                              ;Not Check bmRequestType direction because wLength = 0
  49  0000                              ;SZ      FIFO_Type.@Setup_D    	;Host to device ?
  50  0000                              ;JMP		ToStallPipe0           ;No: to stall
  51  0000                              
  52  0000  0700     E                  MOV     A,FIFO_wLengthL       	;Length = 0
  53  0001  0300     E  				ADD		A,FIFO_wLengthH
  54  0002  390A        				SNZ		Z	
  55  0003  2800     E                  JMP		ToStallPipe0            ;No: to stall
"File: CLS1.ASM      Holtek Cross-Assembler  Version 2.86      Page 2

  56  0004                           
  57  0004  1080     E                  SZ      FIFO_wValueH          	;wValueH = 0 ?
  58  0005  2800     E                  JMP		ToStallPipe0            ;No: to stall
  59  0006              
  60  0006              
  61  0006              
  62  0006  0700     E  				mov		a,fifo_wIndexL
  63  0007  0C00        				xor		a,0
  64  0008  3D0A        				sz		z
  65  0009  29DE        				jmp		interface_1_set_protocol
  66  000A              
  67  000A  0C01        				xor		a,1 xor 0
  68  000B  3D0A        				sz		z
  69  000C  29E2        				jmp		interface_2_set_protocol
  70  000D  2800     E                  JMP		ToStallPipe0            ;No: to stall
  71  000E              
  72  000E              
  73  000E              interface_1_set_protocol:
  74  000E  3400     E  				clr		bAltkbProtocol
  75  000F  1080     E  				sz		FIFO_wValueL
  76  0010  3000     E  				set		bAltkbProtocol
  77  0011              
  78  0011              
  79  0011  2800     E                  JMP     SendHandshake           ;send handshake flag
  80  0012              
  81  0012              
  82  0012              interface_2_set_protocol:
  83  0012              
  84  0012  3400     E  				clr		baltmouseprotocol
  85  0013  1080     E  				sz		FIFO_wValueL
  86  0014  3000     E  				set		baltmouseprotocol
  87  0015              
  88  0015  2800     E                  JMP     SendHandshake           ;send handshake flag
  89  0016              
  90  0016              ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  91  0016              GetProtocol:
  92  0016                              ;Check bmRequestType direction
  93  0016  3800     E                  SNZ     FIFO_Type.@Setup_D    	;Device to host ?
  94  0017  2800     E                  JMP		ToStallPipe0            ;No: to stall
  95  0018              
  96  0018  1080     E                  SZ		FIFO_wValueL         	;default = 0 ?
  97  0019  2800     E  				JMP		ToStallPipe0
  98  001A  1080     E  				SZ		FIFO_wValueH
  99  001B  2800     E                  JMP		ToStallPipe0            ;No: to stall
 100  001C                              
 101  001C  1080     E  				SZ      FIFO_wLengthH         	;Length = 0
 102  001D  2800     E                  JMP		ToStallPipe0            ;No: to stall
 103  001E  0700     E                  MOV     A,FIFO_wLengthL       	;Length = 1 ?
 104  001F  0C01                        XOR     A,01H                   ;
 105  0020  390A                        SNZ     Z                       ;
 106  0021  2800     E                  JMP		ToStallPipe0            ;No: to stall
 107  0022              
 108  0022              
 109  0022  0700     E  				mov		a,fifo_wIndexL
 110  0023  0C00        				xor		a,0
 111  0024  3D0A        				sz		z
 112  0025  29FA        				jmp		interface_1_get_protocol
 113  0026              
 114  0026  0C01        				xor		a,1 xor 0
 115  0027  3D0A        				sz		z
"File: CLS1.ASM      Holtek Cross-Assembler  Version 2.86      Page 3

 116  0028  29FE        				jmp		interface_2_get_protocol
 117  0029  2800     E                  JMP		ToStallPipe0            ;No: to stall
 118  002A              
 119  002A              
 120  002A              interface_1_get_protocol:
 121  002A  1F05        				clr		acc
 122  002B  3C00     E  				sz		bAltkbProtocol
 123  002C  3005        				set		acc.0
 124  002D  2A4A        				jmp		ReportVL
 125  002E              
 126  002E              
 127  002E              
 128  002E              interface_2_get_protocol:
 129  002E              
 130  002E  1F05        				clr		acc
 131  002F  3C00     E  				sz		baltmouseprotocol
 132  0030  3005        				set		acc.0
 133  0031  2A4A        				jmp		ReportVL
 134  0032              
 135  0032              
 136  0032              ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 137  0032              SetIdle:
 138  0032              ;maybe need support
 139  0032  1080     E                 	sz		FIFO_wLengthL         ;Length = 0
 140  0033  2800     E  				jmp		Tostallpipe0
 141  0034  1080     E  				sz		FIFO_wLengthH
 142  0035  2800     E                  JMP		ToStallPipe0            ;No: to stall
 143  0036                              							
 144  0036  1F00     E  				clr		TempKBTime
 145  0037  1F00     E  				clr		TempmouseTime
 146  0038  1F00     E  				clr		TempKBTime_L
 147  0039  1F00     E  				clr		TempmouseTime_L
 148  003A              	
 149  003A  0F00     E  				MOV		A,offset ReportkbTime
 150  003B  1080     E  				SZ		FIFO_wIndexL			;0-KB,	1-Mouse
 151  003C  2800     E                  JMP		ToStallPipe0 
 152  003D              write_idle_rate:
 153  003D  0081        				MOV		MP0,A			
 154  003E  0700     E                	MOV     A,FIFO_wValueH          ;Get particular report time
 155  003F  0080                      	MOV     R0,A              		;
 156  0040              
 157  0040                 ;Set particular report flag
 158  0040  2800     E                 	JMP     SendHandshake          	;send handshake flag
 159  0041              
 160  0041              ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 161  0041              GetIdle:		;Report_ID=0, 
 162  0041                              ;Check bmRequestType direction

⌨️ 快捷键说明

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