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

📄 parmem.lst

📁 代码保护功能处于持续发展中。Microchip 承诺将不断改进产品的代码保护功能。任何试图破坏Microchip 代码保护功能的行为均可视 为违反了《数字器件千年版权法案(Digital Mille
💻 LST
📖 第 1 页 / 共 2 页
字号:
MPASM 03.70.01 Released                            PARMEM.ASM   3-28-2006  23:02:59         PAGE  1


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

                      00001 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                      00002 ;
                      00003 ;       PARMEM.ASM      MPB     Ver:1.0         6-9-05
                      00004 ;...............................................................
                      00005 ;
                      00006 ;       Parallel memory system
                      00007 ;       Status: Complete
                      00008 ;
                      00009 ;       PIC 16F877 operates with expansion memory RAM 
                      00010 ;       = 2 x 62256 32kb
                      00011 ;       Control bits = Port B
                      00012 ;       Data bus = Port C
                      00013 ;       Address Bus = Port D 
                      00014 ;       
                      00015 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                      00016 
                      00017         PROCESSOR 16F877        ; define MPU
2007   3731           00018         __CONFIG 0x3731         ; XT clock
                      00019 
                      00020 ;       LABEL EQUATES   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                      00021 
                      00022         INCLUDE "P16F877.INC"   ; Standard register labels 
                      00001         LIST
                      00002 ; P16F877.INC  Standard Header File, Version 1.00    Microchip Technology, Inc.
                      00373         LIST
                      00023 
  00000006            00024 ConReg  EQU     06      ; Port B = Control Register 
  00000007            00025 DatReg  EQU     07      ; Port C = Data Register
  00000008            00026 AddReg  EQU     08      ; Port D = Address Register
                      00027 
  00000020            00028 HiAdd   EQU     20      ; High address store
                      00029 
  00000000            00030 CLK0    EQU     0       ; RAM0 address buffer clock
  00000001            00031 CLK1    EQU     1       ; RAM1 address buffer clock
  00000002            00032 SelRAM  EQU     2       ; RAM select bit
  00000003            00033 ResHi   EQU     3       ; High address reset bit
  00000004            00034 WritEn  EQU     4       ; Write enable bit
  00000005            00035 OutEn0  EQU     5       ; Output enable bit RAM0
  00000006            00036 OutEn1  EQU     6       ; Output enable bit RAM1
  00000007            00037 LED     EQU     7       ; Memory error indicator
                      00038 
                      00039 
                      00040 
                      00041 ; Initialise ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                      00042 
0000                  00043         ORG     0               ; Place machine code 
0000   0000           00044         NOP                     ; Required for ICD mode
                      00045 
0001   1683 1303      00046         BANKSEL TRISB           ; Select bank 1 
Message[302]: Register in operand not in bank 0.  Ensure that bank bits are correct.
0003   0186           00047         CLRF    TRISB           ; Control output bits
Message[302]: Register in operand not in bank 0.  Ensure that bank bits are correct.
0004   0187           00048         CLRF    TRISC           ; Data bus initially output
MPASM 03.70.01 Released                            PARMEM.ASM   3-28-2006  23:02:59         PAGE  2


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

Message[302]: Register in operand not in bank 0.  Ensure that bank bits are correct.
0005   0188           00049         CLRF    TRISD           ; Address bus output
                      00050 
0006   1283 1303      00051         BANKSEL AddReg          ; Select bank 0
0008   0187           00052         CLRF    DatReg          ; Clear outputs initially
0009   0188           00053         CLRF    AddReg          ; Clear outputs initially
                      00054 
000A   1006           00055         BCF     ConReg,CLK0     ; RAM0 address buffer clock
000B   1086           00056         BCF     ConReg,CLK1     ; RAM1 address buffer clock
000C   1106           00057         BCF     ConReg,SelRAM   ; Select RAM0 initially
000D   1186           00058         BCF     ConReg,ResHi    ; Reset high address latches
000E   1686           00059         BSF     ConReg,OutEn0   ; Disable output enable RAM0
000F   1706           00060         BSF     ConReg,OutEn1   ; Disable output enable RAM1
0010   1606           00061         BSF     ConReg,WritEn   ; Disable write enable bit
0011   1386           00062         BCF     ConReg,LED      ; Switch of error indicator
                      00063 
                      00064 
                      00065 
                      00066 ; MAIN LOOP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       
                      00067 
0012   2015           00068 start   CALL    write           ; test write to memory
0013   201F           00069         CALL    read            ; test read from memory
0014   0063           00070         SLEEP                   ; shut down
                      00071 
                      00072 
                      00073 ; Write checkerboard pattern to both RAMs ;;;;;;;;;;;;;;;;;;;;;;;
                      00074 
0015   1586           00075 write   BSF     ConReg,ResHi    ; Enable address latches
                      00076 
0016   3055           00077 nexwrt  MOVLW   055             ; checkerboard test data
0017   0087           00078         MOVWF   DatReg          ; output on data bus
0018   2035           00079         CALL    store           ; and write to RAM
                      00080                 
0019   30AA           00081         MOVLW   0AA             ; checkerboard test data
001A   0087           00082         MOVWF   DatReg          ; output on data bus
001B   2035           00083         CALL    store           ; and write to RAM
                      00084 
001C   1D86           00085         BTFSS   ConReg,ResHi    ; all done?
001D   0008           00086         RETURN                  ; yes - quit
001E   2816           00087         GOTO    nexwrt          ; no - next byte pair
                      00088 
                      00089 
                      00090 ; Check data stored ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                      00091 
001F   0000           00092 read    NOP                     ; required for label
0020   1683 1303      00093         BANKSEL TRISC           ; select bank 1
0022   30FF           00094         MOVLW   0FF             ; all inputs..
Message[302]: Register in operand not in bank 0.  Ensure that bank bits are correct.
0023   0087           00095         MOVWF   TRISC           ; ..at Port C   
                      00096 
0024   1283 1303      00097         BANKSEL ConReg          ; select default bank 0
0026   1586           00098         BSF     ConReg,ResHi    ; Enable address latches
                      00099 
MPASM 03.70.01 Released                            PARMEM.ASM   3-28-2006  23:02:59         PAGE  3


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

0027   1106           00100         BCF     ConReg,SelRAM   ; select RAM0
0028   1286           00101         BCF     ConReg,OutEn0   ; set RAM0 for output
0029   202E           00102         CALL    nexred          ; check data in RAM0
                      00103 
002A   1506           00104         BSF     ConReg,SelRAM   ; select RAM0
002B   1306           00105         BCF     ConReg,OutEn1   ; set RAM0 for output
002C   202E           00106         CALL    nexred          ; check data in RAM0
                      00107 
002D   0008           00108         RETURN                  ; all done
                      00109 
                      00110 
                      00111 ; Load test data and check data ................................
                      00112 
002E   3055           00113 nexred  MOVLW   055             ; load even data byte
002F   203F           00114         CALL    test            ; check data
0030   30AA           00115         MOVLW   0AA             ; load odd data byte
0031   203F           00116         CALL    test            ; check data
                      00117         
0032   1D86           00118         BTFSS   ConReg,ResHi    ; all done?
0033   0008           00119         RETURN                  ; yes - quit
0034   282E           00120         GOTO    nexred          ; no - next byte pair
                      00121 
                      00122 
                      00123 ; Write data to RAM .............................................
                      00124 
0035   1106           00125 store   BCF     ConReg,SelRAM   ; no - Select RAM0
0036   1206           00126         BCF     ConReg,WritEn   ; negative pulse ..
0037   1606           00127         BSF     ConReg,WritEn   
                      00128 
0038   1506           00129         BSF     ConReg,SelRAM   ; Select RAM1
0039   1206           00130         BCF     ConReg,WritEn   ; negative pulse ..
003A   1606           00131         BSF     ConReg,WritEn   ; ..write bit
                      00132 
Message[305]: Using default destination of 1 (file).
003B   0A88           00133         INCF    AddReg          ; next address
003C   1903           00134         BTFSC   STATUS,Z        ; last address?
003D   2047           00135         CALL    inchi           ; yes - increment high address
003E   0008           00136         RETURN                  ; no - next byte
                      00137 
                      00138 
                      00139 ; Test memory data ..............................................
                      00140 
003F   0887           00141 test    MOVF    DatReg,F        ; read data
0040   0207           00142         SUBWF   DatReg,W        ; compare data
0041   1D03           00143         BTFSS   STATUS,Z        ; same?
0042   1786           00144         BSF     ConReg,LED      ; no - switch on LED
                      00145 
Message[305]: Using default destination of 1 (file).
0043   0A88           00146         INCF    AddReg          ; yes - next address
0044   1903           00147         BTFSC   STATUS,Z        ; last address in block?
0045   2047           00148         CALL    inchi           ; yes - increment high address
0046   0008           00149         RETURN                  ; no - continue
                      00150 
MPASM 03.70.01 Released                            PARMEM.ASM   3-28-2006  23:02:59         PAGE  4


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

                      00151 
                      00152 ; Select next block of RAM ......................................
                      00153 
Message[305]: Using default destination of 1 (file).
0047   0AA0           00154 inchi   INCF    HiAdd           ; next block
0048   1903           00155         BTFSC   STATUS,Z        ; all done?
0049   2852           00156         GOTO    alldon          ; yes
                      00157 
004A   0820           00158         MOVF    HiAdd,W         ; no - load high address
004B   0088           00159         MOVWF   AddReg          ; output it
                      00160 
004C   1406           00161         BSF     ConReg,CLK0     ; clock it into latches
004D   1486           00162         BSF     ConReg,CLK1             
004E   1006           00163         BCF     ConReg,CLK0
004F   1086           00164         BCF     ConReg,CLK1
                      00165 
0050   0188           00166         CLRF    AddReg          ; reset low address to zero
0051   0008           00167         RETURN                  ; block done
                      00168 
0052   1186           00169 alldon  BCF     ConReg,ResHi    ; reset address latches
0053   0008           00170         RETURN                  ; all blocks done
                      00171 
                      00172         END     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MPASM 03.70.01 Released                            PARMEM.ASM   3-28-2006  23:02:59         PAGE  5


SYMBOL TABLE
  LABEL                             VALUE 

ACKDT                             00000005
ACKEN                             00000004
ACKSTAT                           00000006
ADCON0                            0000001F
ADCON1                            0000009F
ADCS0                             00000006
ADCS1                             00000007
ADDEN                             00000003
ADFM                              00000007
ADIE                              00000006
ADIF                              00000006
ADON                              00000000
ADRESH                            0000001E
ADRESL                            0000009E
AddReg                            00000008
BCLIE                             00000003
BCLIF                             00000003
BF                                00000000
BRGH                              00000002
C                                 00000000
CCP1CON                           00000017
CCP1IE                            00000002
CCP1IF                            00000002
CCP1M0                            00000000
CCP1M1                            00000001
CCP1M2                            00000002
CCP1M3                            00000003
CCP1X                             00000005
CCP1Y                             00000004
CCP2CON                           0000001D
CCP2IE                            00000000
CCP2IF                            00000000
CCP2M0                            00000000
CCP2M1                            00000001
CCP2M2                            00000002
CCP2M3                            00000003
CCP2X                             00000005
CCP2Y                             00000004
CCPR1H                            00000016
CCPR1L                            00000015
CCPR2H                            0000001C
CCPR2L                            0000001B
CHS0                              00000003
CHS1                              00000004
CHS2                              00000005
CKE                               00000006
CKP                               00000004
CLK0                              00000000

⌨️ 快捷键说明

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