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

📄 i2c.lst

📁 在cypress晶片上實驗讀取ps2 keyboard按鍵後顯示在lcd上,同時利用I2C寫入EEPROM
💻 LST
📖 第 1 页 / 共 4 页
字号:


HI-TECH Software PICC Macro Assembler V8.05PL1
Serial number: HCPIC-80329                            Thu Jul 19 15:11:23 2007

Licensed to: BOSS
     1                           	processor	16F873A
     2                           	opt	pw 79
     3                           	psect	__Z80329RS_,global,delta=1
     4                           	psect	text10,local,class=CODE,delta=2
     5                           	psect	text12,local,class=CODE,delta=2
     6                           	psect	text13,local,class=CODE,delta=2
     7                           	psect	text15,local,class=CODE,delta=2
     8                           	psect	temp,global,ovrld,class=BANK0,space=1,de
      +                          lta=1
     9  0000                     
    10  0000                     
    11  0000                     
    12  0000                     
    13  0000                     
    14  0000                     
    15  0000                     
    16  0000                     
    17  0000                     
    18  0000                     
    19                           
    20                           	psect	__Z80329RS_
    21  00A0                     
    22  00A0                     
    23                           
    24                           	psect	text10
    25  0370                     _i2c_GetString
    26                           ;	_str assigned to ?a_i2c_GetString+0
    27  0000                     _i2c_GetString$str	set	?a_i2c_GetString
    28                           ;	_byte assigned to ?a_i2c_GetString+1
    29  0000                     _i2c_GetString$byte	set	?a_i2c_GetString+1
    30                           ;_str stored from w
    31  0370  0183               	clrf	3	;select bank 0
    32  0371  00C3               	movwf	?a_i2c_GetString
    33                           ;i2c.c: 228: int byte;
    34  0372  2B89               	goto	l75
    35  0373                     l76
    36                           ;i2c.c: 231: {
    37  0373  0343               	decf	?_i2c_GetString,w
    38  0374  118A  2597  118A   	fcall	_i2c_GetByte
    39  0377  0856               	movf	btemp,w
    40  0378  00C4               	movwf	?a_i2c_GetString+1
    41  0379  0857               	movf	btemp+1,w
    42  037A  00C5               	movwf	?a_i2c_GetString+2
    43  037B  0A44               	incf	?a_i2c_GetString+1,w
    44  037C  1903               	btfsc	3,2
    45  037D  0A45               	incf	?a_i2c_GetString+2,w
    46  037E  1D03               	btfss	3,2
    47  037F  2B82               	goto	l78
    48                           ;i2c.c: 233: return number;
    49  0380  0843               	movf	?_i2c_GetString,w
    50  0381  0008               	return
    51  0382                     l78
    52                           ;i2c.c: 235: *str = (unsigned char)byte;
    53  0382  0843               	movf	?a_i2c_GetString,w
    54  0383  0084               	movwf	4
    55  0384  1383               	bcf	3,7
    56  0385  0844               	movf	?a_i2c_GetString+1,w
    57  0386  0080               	movwf	0
    58                           ;i2c.c: 236: str++;
    59  0387  0AC3               	incf	?a_i2c_GetString
    60                           ;i2c.c: 237: number--;
    61  0388  03C3               	decf	?_i2c_GetString
    62  0389                     l75
    63                           ;i2c.c: 238: }
    64  0389  1283               	bcf	3,5
    65  038A  1303               	bcf	3,6	;carry unused
    66  038B  08C3               	movf	?_i2c_GetString
    67  038C  1903               	btfsc	3,2
    68                           ;i2c.c: 240: return 0;
    69  038D  3400               	retlw	0
    70  038E  2B73               	goto	l76
    71                           
    72                           	psect	text12
    73                           ;i2c.c: 265: unsigned char
    74                           ;i2c.c: 266: i2c_WaitForSCL(void)
    75                           ;i2c.c: 267: {
    76  0487                     _i2c_WaitForSCL
    77                           ;	__dcnt assigned to ?a_i2c_WaitForSCL+0
    78  0000                     _i2c_WaitForSCL$_dcnt	set	?a_i2c_WaitForSCL
    79                           ;i2c.c: 269: if(!RC1)
    80  0487  0183               	clrf	3	;select bank 0
    81  0488  1887               	btfsc	7,1
    82  0489  3400               	retlw	0
    83                           ;i2c.c: 270: {
    84  048A  300A               	movlw	10
    85  048B  00C3               	movwf	?a_i2c_WaitForSCL
    86  048C                     l85
    87  048C  0BC3               	decfsz	?a_i2c_WaitForSCL
    88  048D  2C8C               	goto	l85
    89                           ;i2c.c: 273: if(!RC1)
    90  048E  1C87               	btfss	7,1
    91                           ;i2c.c: 274: return !0;
    92  048F  3401               	retlw	1
    93                           ;i2c.c: 276: return 0;
    94  0490  3400               	retlw	0
    95                           ;i2c.c: 63: unsigned char
    96                           ;i2c.c: 64: i2c_SendByte(unsigned char byte)
    97                           ;i2c.c: 65: {
    98  0491                     _i2c_SendByte
    99                           ;	_byte assigned to ?a_i2c_SendByte+0
   100  0000                     _i2c_SendByte$byte	set	?a_i2c_SendByte
   101                           ;	_i assigned to ?a_i2c_SendByte+1
   102  0000                     _i2c_SendByte$i	set	?a_i2c_SendByte+1
   103                           ;	__dcnt assigned to ?a_i2c_SendByte+2
   104  0000                     _i2c_SendByte$_dcnt	set	?a_i2c_SendByte+2
   105                           ;	__dcnt assigned to ?a_i2c_SendByte+2
   106  0000                     _i2c_SendByte$_dcnt	set	?a_i2c_SendByte+2
   107                           ;_byte stored from w
   108  0491  0183               	clrf	3	;select bank 0
   109  0492  00C3               	movwf	?a_i2c_SendByte
   110                           ;i2c.c: 66: signed char i;
   111  0493  3007               	movlw	7
   112  0494  00C4               	movwf	?a_i2c_SendByte+1
   113  0495                     l22
   114                           ;i2c.c: 69: {
   115                           ;i2c.c: 70: RC1 = 0; TRISC1 = 0;
   116  0495  1087               	bcf	7,1
   117  0496  1683               	bsf	3,5
   118  0497  1087               	bcf	7,1
   119                           ;i2c.c: 73: TRISC0 = ((byte>>i)&0x01);
   120  0498  1283               	bcf	3,5
   121  0499  0843               	movf	?a_i2c_SendByte,w
   122  049A  00D6               	movwf	btemp
   123  049B  0844               	movf	?a_i2c_SendByte+1,w
   124  049C  00D7               	movwf	btemp+1
   125  049D  0AD7               	incf	btemp+1
   126  049E  2CA1               	goto	u74
   127  049F                     u75
   128  049F  1003               	bcf	3,0
   129  04A0  0CD6               	rrf	btemp
   130  04A1                     u74
   131  04A1  0BD7               	decfsz	btemp+1
   132  04A2  2C9F               	goto	u75
   133  04A3  0856               	movf	btemp,w
   134  04A4  00D6               	movwf	btemp
   135  04A5  0C56               	rrf	btemp,w
   136  04A6  1683               	bsf	3,5
   137  04A7  1C03               	btfss	3,0
   138  04A8  2CAB               	goto	L2
   139  04A9  1407               	bsf	7,0
   140  04AA  2CAC               	goto	u94
   141  04AB                     L2
   142  04AB  1007               	bcf	7,0
   143  04AC                     u94
   144                           ;i2c.c: 74: if ((byte>>i)&0x01) {
   145  04AC  1283               	bcf	3,5
   146  04AD  1303               	bcf	3,6	;carry unused
   147  04AE  0843               	movf	?a_i2c_SendByte,w
   148  04AF  00D6               	movwf	btemp
   149  04B0  0844               	movf	?a_i2c_SendByte+1,w
   150  04B1  00D7               	movwf	btemp+1
   151  04B2  0AD7               	incf	btemp+1
   152  04B3  2CB6               	goto	u104
   153  04B4                     u105
   154  04B4  1003               	bcf	3,0
   155  04B5  0CD6               	rrf	btemp
   156  04B6                     u104
   157  04B6  0BD7               	decfsz	btemp+1
   158  04B7  2CB4               	goto	u105
   159  04B8  0856               	movf	btemp,w
   160  04B9  00D6               	movwf	btemp
   161  04BA  1C56               	btfss	btemp,0
   162  04BB  2CBE               	goto	l25
   163                           ;i2c.c: 75: RC0 = 1; TRISC0 = 0;
   164  04BC  1407               	bsf	7,0
   165  04BD  2CBF               	goto	L1
   166                           ;i2c.c: 76: }else {
   167  04BE                     l25
   168                           ;i2c.c: 77: RC0 = 0; TRISC0 = 0;
   169  04BE  1007               	bcf	7,0
   170  04BF                     L1
   171  04BF  1683               	bsf	3,5
   172  04C0  1007               	bcf	7,0
   173                           ;i2c.c: 78: }
   174                           ;i2c.c: 79: { unsigned char _dcnt; _dcnt = (1)*
      +                          ((20*1000L)/(12*1000L)); while(--_dcnt != 0) co
      +                          ntinue; };
   175  04C1  1283               	bcf	3,5
   176  04C2  01C5               	clrf	?a_i2c_SendByte+2
   177  04C3  0AC5               	incf	?a_i2c_SendByte+2
   178  04C4                     l28
   179  04C4  0BC5               	decfsz	?a_i2c_SendByte+2
   180  04C5  2CC4               	goto	l28
   181                           ;i2c.c: 80: TRISC1 = 1;
   182  04C6  1683               	bsf	3,5
   183  04C7  1487               	bsf	7,1
   184                           ;i2c.c: 82: if(i2c_WaitForSCL())
   185  04C8  2487               	fcall	_i2c_WaitForSCL
   186  04C9  3800               	iorlw	0
   187  04CA  1D03               	btfss	3,2
   188                           ;i2c.c: 83: return !0;
   189  04CB  3401               	retlw	1
   190                           ;i2c.c: 85: { unsigned char _dcnt; _dcnt = (4)*
      +                          ((20*1000L)/(12*1000L)); while(--_dcnt != 0) co
      +                          ntinue; };
   191  04CC  3004               	movlw	4
   192  04CD  00C5               	movwf	?a_i2c_SendByte+2
   193  04CE                     l32
   194  04CE  0BC5               	decfsz	?a_i2c_SendByte+2
   195  04CF  2CCE               	goto	l32
   196                           ;i2c.c: 86: }
   197  04D0  03C4               	decf	?a_i2c_SendByte+1
   198  04D1  1BC4               	btfsc	?a_i2c_SendByte+1,7
   199                           ;i2c.c: 88: return 0;
   200  04D2  3400               	retlw	0
   201  04D3  2C95               	goto	l22
   202                           ;i2c.c: 106: signed char
   203                           ;i2c.c: 107: i2c_ReadAcknowledge(void)
   204                           ;i2c.c: 108: {
   205  04D4                     _i2c_ReadAcknowledge
   206                           ;	_ack assigned to ?a_i2c_ReadAcknowledge+0
   207  0000                     _i2c_ReadAcknowledge$ack	set	?a_i2c_ReadAcknowl
      +                          edge
   208                           ;	__dcnt assigned to ?a_i2c_ReadAcknowledge+1
   209  0000                     _i2c_ReadAcknowledge$_dcnt	set	?a_i2c_ReadAckno
      +                          wledge+1
   210                           ;	__dcnt assigned to ?a_i2c_ReadAcknowledge+1
   211  0000                     _i2c_ReadAcknowledge$_dcnt	set	?a_i2c_ReadAckno
      +                          wledge+1
   212                           ;i2c.c: 109: unsigned char ack;
   213  04D4  0183               	clrf	3	;select bank 0
   214  04D5  1087               	bcf	7,1
   215  04D6  1683               	bsf	3,5
   216  04D7  1087               	bcf	7,1
   217                           ;i2c.c: 112: TRISC0 = 1;
   218  04D8  1407               	bsf	7,0
   219                           ;i2c.c: 113: { unsigned char _dcnt; _dcnt = (2)
      +                          *((20*1000L)/(12*1000L)); while(--_dcnt != 0) c
      +                          ontinue; };
   220  04D9  3002               	movlw	2
   221  04DA  1283               	bcf	3,5
   222  04DB  00C4               	movwf	?a_i2c_ReadAcknowledge+1
   223  04DC                     l36
   224  04DC  0BC4               	decfsz	?a_i2c_ReadAcknowledge+1
   225  04DD  2CDC               	goto	l36
   226                           ;i2c.c: 114: TRISC1 = 1;
   227  04DE  1683               	bsf	3,5
   228  04DF  1487               	bsf	7,1
   229                           ;i2c.c: 115: { unsigned char _dcnt; _dcnt = (1)
      +                          *((20*1000L)/(12*1000L)); while(--_dcnt != 0) c
      +                          ontinue; };
   230  04E0  1283               	bcf	3,5
   231  04E1  01C4               	clrf	?a_i2c_ReadAcknowledge+1
   232  04E2  0AC4               	incf	?a_i2c_ReadAcknowledge+1
   233  04E3                     l40
   234  04E3  0BC4               	decfsz	?a_i2c_ReadAcknowledge+1
   235  04E4  2CE3               	goto	l40
   236                           ;i2c.c: 116: ack = RC0;
   237  04E5  3000               	movlw	0
   238  04E6  1807               	btfsc	7,0
   239  04E7  3001               	movlw	1
   240  04E8  00C3               	movwf	?a_i2c_ReadAcknowledge
   241                           ;i2c.c: 119: if(i2c_WaitForSCL())
   242  04E9  2487               	fcall	_i2c_WaitForSCL
   243  04EA  3800               	iorlw	0
   244  04EB  1D03               	btfss	3,2

⌨️ 快捷键说明

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