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

📄 ps2.lst

📁 PS2 读取键盘数具,非常好的一个软件PCB
💻 LST
📖 第 1 页 / 共 2 页
字号:


HI-TECH Software PICC Macro Assembler V9.60
                                                      Tue Aug 26 16:51:31 2008


     1                           	processor	16F87
     2                           	opt	pw 79
     3                           	psect	text0,local,class=CODE,delta=2
     4                           	psect	text2,local,class=CODE,delta=2
     5                           	psect	text6,local,class=CODE,delta=2
     6                           	psect	text9,local,class=CODE,delta=2
     7  0000                     
     8  0000                     
     9  0000                     
    10  0000                     
    11  0000                     
    12  0000                     
    13  0000                     
    14  0000                     
    15  0000                     
    16  0000                     
    17                           
    18                           	psect	text0
    19  04F3                     _Ps2Delay
    20                           ;ps2.c: 10: void Ps2Delay(void)
    21  04F3  0000               	nop	;#
    22  04F4  0000               	nop	;#
    23                           ;ps2.c: 13: }
    24  04F5  0183               	clrf	3	;select bank 0
    25  04F6  0008               	return	;W free
    26  04F7                     _WaitCLK0
    27                           ;	_cnt assigned to ?a_WaitCLK0+0
    28  0000                     _WaitCLK0$cnt	set	?a_WaitCLK0
    29                           ;ps2.c: 52: unsigned char WaitCLK0(void)
    30  04F7  3088               	movlw	136
    31  04F8  0183               	clrf	3	;select bank 0
    32  04F9  00BE               	movwf	?a_WaitCLK0
    33  04FA  3013               	movlw	19
    34  04FB  00BF               	movwf	?a_WaitCLK0+1
    35  04FC                     l11
    36                           ;ps2.c: 56: {
    37  04FC  1C06               	btfss	6,0
    38  04FD  2D06               	goto	l12
    39                           ;ps2.c: 58: break;
    40  04FE  08BE               	movf	?a_WaitCLK0
    41  04FF  1903               	btfsc	3,2
    42  0500  03BF               	decf	?a_WaitCLK0+1
    43  0501  03BE               	decf	?a_WaitCLK0
    44  0502  083F               	movf	?a_WaitCLK0+1,w
    45  0503  043E               	iorwf	?a_WaitCLK0,w
    46  0504  1D03               	btfss	3,2
    47  0505  2CFC               	goto	l11
    48  0506                     l12
    49                           ;ps2.c: 59: }
    50  0506  083F               	movf	?a_WaitCLK0+1,w
    51  0507  043E               	iorwf	?a_WaitCLK0,w
    52  0508  1903               	btfsc	3,2
    53                           ;ps2.c: 61: return(0);
    54  0509  3400               	retlw	0
    55                           ;ps2.c: 62: else
    56  050A  3401               	retlw	1
    57  050B                     _WaitCLK1
    58                           ;	_cnt assigned to ?a_WaitCLK1+0
    59  0000                     _WaitCLK1$cnt	set	?a_WaitCLK1
    60                           ;ps2.c: 74: unsigned char WaitCLK1(void)
    61  050B  3088               	movlw	136
    62  050C  0183               	clrf	3	;select bank 0
    63  050D  00BE               	movwf	?a_WaitCLK1
    64  050E  3013               	movlw	19
    65  050F  00BF               	movwf	?a_WaitCLK1+1
    66  0510                     l18
    67                           ;ps2.c: 78: {
    68  0510  1806               	btfsc	6,0
    69  0511  2D1A               	goto	l19
    70                           ;ps2.c: 80: break;
    71  0512  08BE               	movf	?a_WaitCLK1
    72  0513  1903               	btfsc	3,2
    73  0514  03BF               	decf	?a_WaitCLK1+1
    74  0515  03BE               	decf	?a_WaitCLK1
    75  0516  083F               	movf	?a_WaitCLK1+1,w
    76  0517  043E               	iorwf	?a_WaitCLK1,w
    77  0518  1D03               	btfss	3,2
    78  0519  2D10               	goto	l18
    79  051A                     l19
    80                           ;ps2.c: 81: }
    81  051A  083F               	movf	?a_WaitCLK1+1,w
    82  051B  043E               	iorwf	?a_WaitCLK1,w
    83  051C  1903               	btfsc	3,2
    84                           ;ps2.c: 83: return(0);
    85  051D  3400               	retlw	0
    86                           ;ps2.c: 84: else
    87  051E  3401               	retlw	1
    88  051F                     _ReadPs2
    89                           ;	_keyval assigned to ?a_ReadPs2+0
    90  0000                     _ReadPs2$keyval	set	?a_ReadPs2
    91                           ;	_cnt assigned to ?a_ReadPs2+1
    92  0000                     _ReadPs2$cnt	set	?a_ReadPs2+1
    93                           ;	_parity assigned to ?a_ReadPs2+2
    94  0000                     _ReadPs2$parity	set	?a_ReadPs2+2
    95                           ;	_temp assigned to ?a_ReadPs2+3
    96  0000                     _ReadPs2$temp	set	?a_ReadPs2+3
    97                           ;ps2.c: 130: unsigned char ReadPs2(void)
    98  051F  0183               	clrf	3	;select bank 0
    99  0520  1806               	btfsc	6,0
   100  0521  3400               	retlw	0
   101  0522  1886               	btfsc	6,1
   102                           ;ps2.c: 137: return(0);
   103  0523  3400               	retlw	0
   104                           ;ps2.c: 140: keyval = 0;
   105  0524  01B9               	clrf	?a_ReadPs2
   106                           ;ps2.c: 141: temp = 0;
   107  0525  01BC               	clrf	?a_ReadPs2+3
   108  0526  01BD               	clrf	?a_ReadPs2+4
   109                           ;ps2.c: 142: parity = 0;
   110  0527  01BB               	clrf	?a_ReadPs2+2
   111                           ;ps2.c: 145: for(cnt=9; cnt>0; cnt--)
   112  0528  3009               	movlw	9
   113  0529  00BA               	movwf	?a_ReadPs2+1
   114  052A                     l34
   115                           ;ps2.c: 146: {
   116  052A  250B               	fcall	_WaitCLK1
   117  052B  3800               	iorlw	0
   118  052C  1903               	btfsc	3,2
   119                           ;ps2.c: 148: return(0);
   120  052D  3400               	retlw	0
   121                           ;ps2.c: 149: if(WaitCLK0()==0)
   122  052E  24F7               	fcall	_WaitCLK0
   123  052F  3800               	iorlw	0
   124  0530  1903               	btfsc	3,2
   125                           ;ps2.c: 150: return(0);
   126  0531  3400               	retlw	0
   127                           ;ps2.c: 151: Ps2Delay();
   128  0532  24F3               	fcall	_Ps2Delay
   129                           ;ps2.c: 152: temp>>= 1;
   130  0533  1003               	bcf	3,0
   131  0534  0CBD               	rrf	?a_ReadPs2+4
   132  0535  0CBC               	rrf	?a_ReadPs2+3
   133                           ;ps2.c: 153: if(RB1)
   134  0536  1C86               	btfss	6,1
   135  0537  2D3C               	goto	l39
   136                           ;ps2.c: 154: {
   137  0538  3001               	movlw	1
   138  0539  04BD               	iorwf	?a_ReadPs2+4
   139                           ;ps2.c: 156: parity++;
   140  053A  0ABB               	incf	?a_ReadPs2+2
   141                           ;ps2.c: 157: }
   142  053B  2D3D               	goto	l40
   143  053C                     l39
   144                           ;ps2.c: 158: else
   145  053C  103D               	bcf	?a_ReadPs2+4,0
   146  053D                     l40
   147  053D  0BBA               	decfsz	?a_ReadPs2+1
   148  053E  2D2A               	goto	l34
   149                           ;ps2.c: 160: }
   150  053F  250B               	fcall	_WaitCLK1
   151  0540  3800               	iorlw	0
   152  0541  1903               	btfsc	3,2
   153                           ;ps2.c: 164: return(0);
   154  0542  3400               	retlw	0
   155                           ;ps2.c: 165: if(WaitCLK0()==0)
   156  0543  24F7               	fcall	_WaitCLK0
   157  0544  3800               	iorlw	0
   158  0545  1903               	btfsc	3,2
   159                           ;ps2.c: 166: return(0);
   160  0546  3400               	retlw	0
   161                           ;ps2.c: 167: Ps2Delay();
   162  0547  24F3               	fcall	_Ps2Delay
   163                           ;ps2.c: 168: if(!RB1)
   164  0548  1C86               	btfss	6,1
   165                           ;ps2.c: 169: return(0);
   166  0549  3400               	retlw	0
   167                           ;ps2.c: 172: if(parity&0x01)
   168  054A  1C3B               	btfss	?a_ReadPs2+2,0
   169  054B  3400               	retlw	0
   170                           ;ps2.c: 173: {
   171  054C  083C               	movf	?a_ReadPs2+3,w
   172  054D  00B9               	movwf	?a_ReadPs2
   173                           ;ps2.c: 175: return(keyval);
   174  054E  0008               	return
   175                           
   176                           	psect	text2
   177  054F                     _D50mS
   178                           ;	_cnt assigned to ?a_D50mS+0
   179  0000                     _D50mS$cnt	set	?a_D50mS
   180                           ;ps2.c: 37: void D50mS(void)
   181  054F  3080               	movlw	128
   182  0550  0183               	clrf	3	;select bank 0
   183  0551  00B6               	movwf	?a_D50mS
   184  0552  3013               	movlw	19
   185  0553  00B7               	movwf	?a_D50mS+1
   186  0554                     l7
   187                           ;ps2.c: 41: {;}
   188  0554  08B6               	movf	?a_D50mS
   189  0555  1903               	btfsc	3,2
   190  0556  03B7               	decf	?a_D50mS+1
   191  0557  03B6               	decf	?a_D50mS
   192  0558  0837               	movf	?a_D50mS+1,w
   193  0559  0436               	iorwf	?a_D50mS,w
   194  055A  1903               	btfsc	3,2
   195  055B  0008               	return
   196  055C  2D54               	goto	l7
   197  055D                     _D20uS
   198                           ;	_cnt assigned to ?a_D20uS+0
   199  0000                     _D20uS$cnt	set	?a_D20uS
   200                           ;ps2.c: 22: void D20uS(void)
   201  055D  3004               	movlw	4
   202  055E  0183               	clrf	3	;select bank 0
   203  055F  00B6               	movwf	?a_D20uS
   204  0560                     l3
   205                           ;ps2.c: 26: {;}
   206  0560  0BB6               	decfsz	?a_D20uS
   207  0561  2D60               	goto	l3
   208                           ;ps2.c: 27: asm("nop"); asm("nop");
   209  0562  0000               	nop	;#
   210  0563  0000               	nop	;#
   211                           ;ps2.c: 28: }
   212  0564  0008               	return	;W free
   213  0565                     _WaitCLK1_INT
   214                           ;	_cnt assigned to ?a_WaitCLK1_INT+0
   215  0000                     _WaitCLK1_INT$cnt	set	?a_WaitCLK1_INT
   216                           ;ps2.c: 96: unsigned char WaitCLK1_INT(void)
   217  0565  3088               	movlw	136
   218  0566  0183               	clrf	3	;select bank 0
   219  0567  00B6               	movwf	?a_WaitCLK1_INT
   220  0568  3013               	movlw	19
   221  0569  00B7               	movwf	?a_WaitCLK1_INT+1
   222  056A                     l25
   223                           ;ps2.c: 100: {
   224  056A  1806               	btfsc	6,0
   225  056B  2D74               	goto	l26
   226                           ;ps2.c: 102: break;
   227  056C  08B6               	movf	?a_WaitCLK1_INT
   228  056D  1903               	btfsc	3,2
   229  056E  03B7               	decf	?a_WaitCLK1_INT+1
   230  056F  03B6               	decf	?a_WaitCLK1_INT
   231  0570  0837               	movf	?a_WaitCLK1_INT+1,w
   232  0571  0436               	iorwf	?a_WaitCLK1_INT,w
   233  0572  1D03               	btfss	3,2
   234  0573  2D6A               	goto	l25
   235  0574                     l26
   236                           ;ps2.c: 103: }
   237  0574  0837               	movf	?a_WaitCLK1_INT+1,w
   238  0575  0436               	iorwf	?a_WaitCLK1_INT,w
   239  0576  1903               	btfsc	3,2
   240                           ;ps2.c: 105: return(0);
   241  0577  3400               	retlw	0
   242                           ;ps2.c: 106: else
   243  0578  3401               	retlw	1
   244  0579                     _SendPs2
   245                           ;	_data assigned to ?a_SendPs2+0
   246  0000                     _SendPs2$data	set	?a_SendPs2
   247                           ;	_cnt assigned to ?a_SendPs2+1
   248  0000                     _SendPs2$cnt	set	?a_SendPs2+1
   249                           ;	_parity assigned to ?a_SendPs2+2
   250  0000                     _SendPs2$parity	set	?a_SendPs2+2
   251                           ;	_temp assigned to ?a_SendPs2+3
   252  0000                     _SendPs2$temp	set	?a_SendPs2+3
   253                           ;_data stored from w
   254  0579  0183               	clrf	3	;select bank 0
   255  057A  00B2               	movwf	?a_SendPs2
   256                           ;ps2.c: 187: unsigned char SendPs2(unsigned cha
      +                          r data)
   257  057B  2565               	fcall	_WaitCLK1_INT
   258  057C  3800               	iorlw	0
   259  057D  1903               	btfsc	3,2
   260                           ;ps2.c: 194: return(0);
   261  057E  3400               	retlw	0
   262                           ;ps2.c: 195: D20uS();D20uS();
   263  057F  255D               	fcall	_D20uS
   264  0580  255D               	fcall	_D20uS
   265                           ;ps2.c: 196: if(!RB0)
   266  0581  1C06               	btfss	6,0
   267                           ;ps2.c: 197: return(0);
   268  0582  3400               	retlw	0
   269                           ;ps2.c: 200: if(!RB1)
   270  0583  1C86               	btfss	6,1
   271                           ;ps2.c: 201: {
   272  0584  3400               	retlw	0
   273                           ;ps2.c: 203: }
   274  0585  1683               	bsf	3,5
   275  0586  1086               	bcf	6,1
   276                           ;ps2.c: 207: TRISB0 = 0;
   277  0587  1006               	bcf	6,0
   278                           ;ps2.c: 208: cnt = 8;
   279  0588  3008               	movlw	8
   280  0589  1283               	bcf	3,5
   281  058A  00B3               	movwf	?a_SendPs2+1
   282                           ;ps2.c: 209: parity = 0;
   283  058B  01B4               	clrf	?a_SendPs2+2
   284                           ;ps2.c: 210: temp = data;
   285  058C  0832               	movf	?a_SendPs2,w
   286  058D  00B5               	movwf	?a_SendPs2+3
   287                           ;ps2.c: 213: RB1 = 0;
   288  058E  1086               	bcf	6,1
   289                           ;ps2.c: 214: D20uS();
   290  058F  255D               	fcall	_D20uS
   291                           ;ps2.c: 215: RB0 = 0;
   292  0590  1006               	bcf	6,0
   293                           ;ps2.c: 216: D20uS();D20uS();
   294  0591  255D               	fcall	_D20uS
   295  0592  255D               	fcall	_D20uS
   296                           ;ps2.c: 217: RB0 = 1;
   297  0593  1406               	bsf	6,0
   298                           ;ps2.c: 218: D20uS();
   299  0594  255D               	fcall	_D20uS
   300                           ;ps2.c: 221: for(; cnt>0; cnt--)
   301  0595                     l50
   302                           ;ps2.c: 222: {
   303  0595  1C35               	btfss	?a_SendPs2+3,0
   304  0596  2D9A               	goto	l53
   305                           ;ps2.c: 224: {
   306  0597  1486               	bsf	6,1
   307                           ;ps2.c: 226: parity++;
   308  0598  0AB4               	incf	?a_SendPs2+2

⌨️ 快捷键说明

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