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

📄 canio.lst

📁 带有CAN接口的PIC18系列单片机的CAN BOOTLOADER汇编程序!
💻 LST
📖 第 1 页 / 共 5 页
字号:
0000D2 50??           00601         movf    _bootAddrH, W                   ; Copy the high pointer
0000D4 6EF7           00602         movwf   TBLPTRH
0000D6 6EAA           00603         movwf   EEADRH  
                      00604         
0000D8 50??           00605         movf    _bootAddrL, W                   ; Copy the low pointer
0000DA 6EF6           00606         movwf   TBLPTRL
0000DC 6EA9           00607         movwf   EEADR
                      00608         
0000DE A6??           00609         btfss   MODE_AUTO_INC                   ; Adjust the pointer if auto inc is enabled
0000E0 D???           00610         bra             _SetPointersJp1
                      00611         
0000E2 50??           00612         movf    _bootCount, W                   ; add the count to the pointer
0000E4 26??           00613         addwf   _bootAddrL, F
0000E6 6AE8           00614         clrf    WREG
0000E8 22??           00615         addwfc  _bootAddrH, F
0000EA 22??           00616         addwfc  _bootAddrU, F
                      00617         
0000EC                00618 _SetPointersJp1 
                      00619 ; *********************************************************
                      00620 
                      00621 
                      00622 ; *********************************************************
0000EC                00623 _Decode
0000EC 0E30           00624         movlw   0x30                                    ; Program memory < 0x300000
0000EE 60F3           00625         cpfslt  WREG2
0000F0 D???           00626         bra             _DecodeJp1
                      00627 #ifdef  ALLOW_GET_CMD
                      00628         btfsc   CAN_PG_BIT
                      00629         bra             _PMRead
                      00630 #endif
0000F2 D???           00631         bra             _PMEraseWrite
                      00632         
                      00633                 
0000F4                00634 _DecodeJp1      
0000F4 50F3           00635         movf    WREG2,W                                 ; Config memory = 0x300000
0000F6 0A30           00636         xorlw   0x30
0000F8 E1??           00637         bnz             _DecodeJp2
                      00638 #ifdef  ALLOW_GET_CMD
                      00639         btfsc   CAN_PG_BIT
                      00640         bra             _PMRead
                      00641 #endif
0000FA D???           00642         bra             _CFGWrite
                      00643         
                      00644         
0000FC                00645 _DecodeJp2      
0000FC 50F3           00646         movf    WREG2,W                                 ; EEPROM data = 0xF00000
0000FE 0AF0           00647         xorlw   0xF0
000100 E1??           00648         bnz             _CANMain
                      00649 #ifdef  ALLOW_GET_CMD
MPASM 03.20.08 Intermediate                         CANIO.ASM   2-3-2003  15:42:14         PAGE 16


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

                      00650         btfsc   CAN_PG_BIT
                      00651         bra             _EERead
                      00652 #endif
000102 D???           00653         bra             _EEWrite
                      00654 ; *****************************************************************************
                      00655         
                      00656         
                      00657         
                      00658 ; *****************************************************************************
                      00659 ; Function:     VOID _PMRead()
                      00660 ;                               VOID _PMEraseWrite()
                      00661 ;
                      00662 ; PreCondition: WREG1 and FSR0 must be loaded with the count and address of
                      00663 ;                               the source data.
                      00664 ;
                      00665 ; Input:        None.
                      00666 ;                               
                      00667 ; Output:       None. 
                      00668 ;
                      00669 ; Side 
                      00670 ; Effects:              N/A. 
                      00671 ;
                      00672 ; Stack 
                      00673 ; Requirements: N/A
                      00674 ;
                      00675 ; Overview:     These routines are technically not functions since they will not 
                      00676 ;                               return when called. They have been written in a linear form to 
                      00677 ;                               save space.     Thus 'call' and 'return' instructions are not 
                      00678 ;                               included, but rather they are implied.  
                      00679 ;
                      00680 ;                               These are the program memory read/write functions. Erase is
                      00681 ;                               available through control flags. An automatic erase option
                      00682 ;                               is also available. A write lock indicator is in place to 
                      00683 ;                               insure intentional write operations.
                      00684 ;
                      00685 ;                               Note: write operations must be on 8-byte boundries and 
                      00686 ;                               must be 8 bytes long. Also erase operations can only
                      00687 ;                               occur on 64-byte boundries.
                      00688 ; *****************************************************************************
                      00689 #ifdef  ALLOW_GET_CMD
                      00690 _PMRead:
                      00691         tblrd   *+                                              ; Fill the buffer
                      00692         movff   TABLAT, POSTINC0
                      00693         decfsz  WREG1, F                
                      00694         bra             _PMRead                                 ; Not finished then repeat
                      00695         
                      00696         bra             _CANSendResponce
                      00697 #endif
                      00698 ; *********************************************************
                      00699 
                      00700 ; *********************************************************
000104                00701 _PMEraseWrite:
000104 A4??           00702         btfss   MODE_AUTO_ERASE                 ; Erase if auto erase is requested
MPASM 03.20.08 Intermediate                         CANIO.ASM   2-3-2003  15:42:14         PAGE 17


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

000106 D???           00703         bra             _PMWrite
                      00704 
000108                00705 _PMErase:
000108 50F6           00706         movf    TBLPTRL, W                              ; Check for a valid 64 byte border
00010A 0B3F           00707         andlw   b'00111111'
00010C E1??           00708         bnz             _PMWrite
                      00709 
00010E                00710 _PMEraseJp1
00010E 0E94           00711         movlw   b'10010100'                             ; Setup erase
000110 D???           00712         rcall   _StartWrite                             ; Erase the row
                      00713 
000112                00714 _PMWrite:
000112 B2??           00715         btfsc   MODE_ERASE_ONLY                 ; Don't write if erase only is requested
                      00716 #ifdef  ALLOW_GET_CMD
                      00717         bra             _CANSendAck
                      00718 #else
000114 D???           00719         bra             _CANMain
                      00720 #endif
                      00721 
000116 50F6           00722         movf    TBLPTRL, W                              ; Check for a valid 8 byte border
000118 0B07           00723         andlw   b'00000111'
00011A E1??           00724         bnz             _CANMain        
                      00725         
00011C 0E08           00726         movlw   0x08
00011E 6EF4           00727         movwf   WREG1
                      00728 
000120                00729 _PMWriteLp1
000120 50EE           00730         movf    POSTINC0, W                     ; Load the holding registers
000122 6EF5           00731         movwf   TABLAT
                      00732         
000124 D???           00733         rcall   _UpdateChksum                   ; Adjust the checksum
                      00734 
000126 000D           00735         tblwt   *+                                      
                      00736         
000128 2EF4           00737         decfsz  WREG1, F
00012A D???           00738         bra             _PMWriteLp1
                      00739  
                      00740 #ifdef  MODE_SELF_VERIFY 
00012C 0E08           00741         movlw   0x08
00012E 6EF4           00742         movwf   WREG1
000130                00743 _PMWriteLp2
000130 000A           00744         tblrd   *-                                              ; Point back into the block
000132 50ED           00745         movf    POSTDEC0, W
000134 2EF4           00746         decfsz  WREG1, F
000136 D???           00747         bra             _PMWriteLp2
                      00748 
000138 0E84           00749         movlw   b'10000100'                             ; Setup writes
00013A D???           00750         rcall   _StartWrite                             ; Write the data
                      00751 
00013C 0E08           00752         movlw   0x08
00013E 6EF4           00753         movwf   WREG1
                      00754 
000140                00755 _PMReadBackLp1
MPASM 03.20.08 Intermediate                         CANIO.ASM   2-3-2003  15:42:14         PAGE 18


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

000140 0009           00756         tblrd   *+                                              ; Test the data
000142 50F5           00757         movf    TABLAT, W
000144 18EE           00758         xorwf   POSTINC0, W
000146 A4D8           00759         btfss   STATUS, Z
000148 80??           00760         bsf             ERR_VERIFY
                      00761         
00014A 2EF4           00762         decfsz  WREG1, F                
00014C D???           00763         bra             _PMReadBackLp1                  ; Not finished then repeat
                      00764 
                      00765 #else
                      00766         tblrd   *-                                              ; Point back into the block
                      00767 
                      00768         movlw   b'10000100'                             ; Setup writes
                      00769         rcall   _StartWrite                             ; Write the data
                      00770 
                      00771         tblrd   *+                                              ; Return the pointer position   
                      00772 #endif
                      00773 
                      00774 #ifdef  ALLOW_GET_CMD
                      00775         bra             _CANSendAck
                      00776 #else
00014E D???           00777         bra             _CANMain
                      00778 #endif
                      00779 ; *****************************************************************************
                      00780 
                      00781 
                      00782 
                      00783         
                      00784 ; *****************************************************************************
                      00785 ; Function:     VOID _CFGWrite()
                      00786 ;                               VOID _CFGRead()
                      00787 ;
                      00788 ; PreCondition: WREG1 and F

⌨️ 快捷键说明

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