OpenCores
URL https://opencores.org/ocsvn/m16c5x/m16c5x/trunk

Subversion Repositories m16c5x

[/] [m16c5x/] [trunk/] [Code/] [MPLAB/] [M16C5x_Tst2.lst] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 MichaelA
MPASM  5.50                   M16C5X_TST2.ASM   7-4-2013  11:39:38         PAGE  1
2
 
3
 
4
LOC  OBJECT CODE     LINE SOURCE TEXT
5
  VALUE
6
 
7
                      00001 ;*******************************************************************************
8
                      00002 ; M16C5x_Tst2.ASM
9
                      00003 ;
10
                      00004 ;       This is the source for the test program used to develop the PIC16C5x proce-
11
                      00005 ;       core. It has also been used to test the P16C5x version of the PIC16C5x core.
12
                      00006 ;
13
                      00007 ;       The first instruction of the program is expected to be placed in location 0.
14
                      00008 ;
15
                      00009 ;       The program tests most instructions, but not is a self-checking manner. In-
16
                      00010 ;       spection of the registers is the method used to verify that the cores are
17
                      00011 ;       operating correctly.
18
                      00012 ;
19
                      00013 ;*******************************************************************************
20
                      00014
21
                      00015         LIST P=16F59, R=DEC
22
                      00016
23
                      00017 ;-------------------------------------------------------------------------------
24
                      00018 ;   Set ScratchPadRam here.  If you are using a PIC16C5X device, use:
25
                      00019 ;ScratchPadRam EQU     0x10
26
                      00020 ;   Otherwise, use:
27
                      00021 ;ScratchPadRam EQU     0x20
28
                      00022 ;-------------------------------------------------------------------------------
29
                      00023
30
  0000000A            00024 ScratchPadRam   EQU     0x0A
31
                      00025
32
                      00026 ;-------------------------------------------------------------------------------
33
                      00027 ; Variables
34
                      00028 ;-------------------------------------------------------------------------------
35
                      00029
36
  00000000            00030 INDF                    EQU             0                       ; Indirect Register File Access Location
37
  00000001            00031 Tmr0                    EQU             1                       ; Timer 0
38
  00000002            00032 PCL                             EQU             2                       ; Low Byte Program Counter
39
  00000003            00033 Status                  EQU             3                       ; Processor Status Register
40
  00000004            00034 FSR                             EQU             4                       ; File Select Register
41
  00000005            00035 PortA                   EQU             5                       ; I/O Port A Address
42
  00000006            00036 PortB                   EQU             6                       ; I/O Port B Address
43
  00000007            00037 PortC                   EQU             7                       ; I/O Port C Address
44
                      00038
45
  0000000A            00039 Cntr                    EQU     ScratchPadRam+0
46
  0000000B            00040 MemStart                EQU             ScratchPadRam+1
47
  00000015            00041 Count                   EQU             32-MemStart
48
                      00042
49
  0000000A            00043 DelayLoop               EQU             ScratchPadRam+0
50
                      00044
51
                      00045 ;-------------------------------------------------------------------------------
52
                      00046 ; Set Reset/WDT Vector
53
                      00047 ;-------------------------------------------------------------------------------
54
                      00048
55
07FF                  00049                 ORG     H'7FF'
56
                      00050
57
Message[306]: Crossing page boundary -- ensure page bits are set.
58
07FF   0A00           00051                 GOTO    Start
59
                      00052
60
MPASM  5.50                   M16C5X_TST2.ASM   7-4-2013  11:39:38         PAGE  2
61
 
62
 
63
LOC  OBJECT CODE     LINE SOURCE TEXT
64
  VALUE
65
 
66
                      00053 ;-------------------------------------------------------------------------------
67
                      00054 ; Main Program
68
                      00055 ;-------------------------------------------------------------------------------
69
                      00056
70
0000                  00057                 ORG     H'000'
71
                      00058
72
                      00059 ;-------------------------------------------------------------------------------
73
0000   0763           00060 Start                   BTFSS   Status,3        ;; Test PD (STATUS.3), if 1, ~SLEEP restart
74
0001   0A30           00061                 GOTO    SleepRestart    ;; SLEEP restart, continue test program
75
0002   0C07           00062                 MOVLW   0x07            ;; load OPTION
76
0003   0002           00063                 OPTION
77
0004   0040           00064                 CLRW                    ;; clear working register
78
0005   0005           00065                 TRIS    PortA       ;; load W into port control registers
79
0006   0006           00066                 TRIS    PortB
80
0007   0007           00067                 TRIS    PortC
81
                      00068 ;
82
                      00069 ;               GOTO    Next            ;; Test GOTO
83
                      00070 ;
84
0008   0A0A           00071                                 GOTO    Next
85
                      00072 ;
86
0009   0CFF           00073                 MOVLW   0xFF            ;; instruction should be skipped
87
                      00074 ;
88
000A   090D           00075 Next            CALL    Subroutine      ;; Test CALL
89
                      00076
90
000B   0022           00077                 MOVWF   PCL             ;; Test Computed GOTO, Load PCL with W
91
000C   0000           00078                 NOP                     ;; No Operation
92
                      00079
93
000D   080E           00080 Subroutine              RETLW   Subroutine + 1  ;; Test RETLW, return 0x0E in W
94
                      00081
95
000E   0C0B           00082                 MOVLW   MemStart        ;; starting RAM + 1
96
000F   0024           00083                 MOVWF   FSR             ;; indirect address register (FSR)
97
                      00084 ;-------------------------------------------------------------------------------
98
0010   0C15           00085                 MOVLW   Count           ;; internal RAM count - 1
99
0011   002A           00086                 MOVWF   Cntr            ;; loop counter
100
0012   0CAA           00087                 MOVLW   0xAA            ;; zero working register
101
                      00088 ;
102
0013   0020           00089 Loop1                   MOVWF   INDF            ;; clear RAM indirectly
103
0014   02A4           00090                 INCF    FSR,1           ;; increment FSR
104
0015   02EA           00091                 DECFSZ  Cntr,1          ;; decrement loop counter
105
0016   0A13           00092                 GOTO    Loop1           ;; loop until loop counter == 0
106
                      00093 ;
107
0017   0C0B           00094                 MOVLW   MemStart        ;; starting RAM + 1
108
0018   0024           00095                 MOVWF   FSR             ;; reload FSR
109
0019   0CEB           00096                 MOVLW   (256 - Count)   ;; set loop counter to 256 - 23
110
001A   002A           00097                                 MOVWF   Cntr
111
                      00098 ;
112
001B   0260           00099 Loop2                   COMF    INDF,1          ;; Complement Memory Pattern from Loop 1
113
001C   02A4           00100                                 INCF    FSR,1           ;; Increment Indirect Pointer to Memory
114
001D   03EA           00101                 INCFSZ  Cntr,1          ;; increment counter loop until 0
115
001E   0A1B           00102                 GOTO    Loop2           ;; loop
116
                      00103 ;
117
001F   006A           00104                 CLRF    Cntr            ;; Clear Memory Location 0x08
118
                      00105 ;-------------------------------------------------------------------------------
119
MPASM  5.50                   M16C5X_TST2.ASM   7-4-2013  11:39:38         PAGE  3
120
 
121
 
122
LOC  OBJECT CODE     LINE SOURCE TEXT
123
  VALUE
124
 
125
0020   00EA           00106                                 DECF    Cntr,1          ;; Decrement Memory Location 0x08
126
0021   01CA           00107                 ADDWF   Cntr,0          ;; Add Memory Location 0x08 to W, Store in W
127
0022   00AA           00108                 SUBWF   Cntr,1          ;; Subtract Memory Location 0x08
128
0023   036A           00109                 RLF     Cntr,1          ;; Rotate Memory Location 0x08
129
0024   032A           00110                 RRF     Cntr,1          ;; Rotate Memory Location
130
0025   0C69           00111                 MOVLW   0x69            ;; Load W with test pattern: W <= 0x69
131
0026   002A           00112                 MOVWF   (MemStart - 1)    ;; Initialize Memory with test pattern
132
0027   03AA           00113                 SWAPF   Cntr,1          ;; Test SWAPF: (0x08) <= 0x96
133
0028   012A           00114                 IORWF   Cntr,1          ;; Test IORWF: (0x08) <= 0x69 | 0x96
134
0029   016A           00115                 ANDWF   Cntr,1          ;; Test ANDWF: (0x08) <= 0x69 & 0xFF
135
002A   01AA           00116                 XORWF   Cntr,1          ;; Test XORWF: (0x08) <= 0x69 ^ 0x69
136
Message[305]: Using default destination of 1 (file).
137
002B   026A           00117                 COMF    Cntr            ;; Test COMF:  (0x08) <= ~0x00
138
002C   0D96           00118                 IORLW   0x96            ;; Test IORLW:      W <= 0x69 | 0x96
139
002D   0E69           00119                 ANDLW   0x69            ;; Test ANDLW:      W <= 0xFF & 0x69
140
002E   0F69           00120                 XORLW   0x69            ;; Test XORLW:      W <= 0x69 ^ 0x69
141
                      00121 ;                SLEEP                  ;; Stop Execution of test program: HALT
142
002F   0A40           00122                                 GOTO    PortTst
143
                      00123 ;-------------------------------------------------------------------------------
144
0030   0004           00124 SleepRestart    CLRWDT                  ;; Detected SLEEP restart, Clr WDT to reset PD
145
0031   0663           00125                 BTFSC   Status,3        ;; Check STATUS.3, skip if ~PD clear
146
0032   0A34           00126                 GOTO    Continue        ;; ~PD is set, CLRWDT cleared PD
147
0033   0A33           00127 ErrorLoop       GOTO    ErrorLoop   ;; ERROR: hold here on error
148
                      00128 ;
149
0034   0C10           00129 Continue                MOVLW   0x10            ;; Load FSR with non-banked RAM address
150
0035   0024           00130                 MOVWF   FSR             ;; Initialize FSR for Bit Processor Tests
151
0036   0060           00131                 CLRF    INDF            ;; Clear non-banked RAM location using INDF
152
0037   0503           00132                 BSF     Status,0        ;; Set   STATUS.0 (C) bit
153
0038   0423           00133                 BCF     Status,1        ;; Clear STATUS.1 (DC) bit
154
0039   0443           00134                 BCF     Status,2        ;; Clear STATUS.2 (Z) bit
155
003A   0203           00135                 MOVF    Status,0        ;; Load W with STATUS
156
003B   0300           00136                 RRF     INDF,0          ;; Rotate Right RAM location: C <= 0,      W <= 0x80
157
003C   0340           00137                 RLF     INDF,0          ;; Rotate Left  RAM location: C <= 0, (INDF) <= 0x00
158
003D   0020           00138                 MOVWF   INDF            ;; Write result back to RAM: (INDF) <= 0x80
159
003E   0021           00139                 MOVWF   Tmr0            ;; Write to TMR0, clear Prescaler
160
003F   0A00           00140                 GOTO    Start           ;; Restart Program
161
                      00141 ;-------------------------------------------------------------------------------
162
                      00142 ;PortTst
163
                      00143 ;
164
                      00144 ;                MOVLW   0xAA           ;; Load W with 0xAA
165
                      00145 ;                MOVWF   PortA          ;; WE_PortA
166
                      00146 ;                MOVWF   PortB          ;; WE_PortB
167
                      00147 ;                MOVWF   PortC          ;; WE_PortC
168
                      00148 ;                MOVF    PortA,0        ;; RE_PortA
169
                      00149 ;                MOVF    PortB,0        ;; RE_PortB
170
                      00150 ;                MOVF    PortC,0        ;; RE_PortC
171
                      00151 ;                COMF    PortA,1    ;; Complement PortA
172
                      00152 ;                COMF    PortB,1    ;; Complement PortB
173
                      00153 ;                COMF    PortC,1    ;; Complement PortC
174
                      00154 ;                CLRF    PortA          ;; Clear PortA
175
                      00155 ;                CLRF    PortB          ;; Clear PortB
176
                      00156 ;                CLRF    PortC          ;; Clear PortC
177
                      00157 ;                CLRW                   ;; zero working register
178
MPASM  5.50                   M16C5X_TST2.ASM   7-4-2013  11:39:38         PAGE  4
179
 
180
 
181
LOC  OBJECT CODE     LINE SOURCE TEXT
182
  VALUE
183
 
184
                      00158 ;
185
                      00159 ;
186
0040   00EC           00160 PortTst                 DECF    0x0C,1
187
0041   020C           00161                                 MOVF    0x0C,0
188
0042   0025           00162                                 MOVWF   PortA
189
                      00163 ;
190
0043   0945           00164                                 CALL    Delay
191
                      00165 ;
192
0044   0A40           00166                                 GOTO    PortTst
193
                      00167
194
                      00168 ;
195
                      00169 ;       Delay Subroutine
196
                      00170 ;
197
0045   0000           00171 Delay                   NOP
198
                      00172 ;
199
0046   0CEE           00173                                 MOVLW   0xEE
200
0047   002A           00174                                 MOVWF   0x0A
201
0048   0C01           00175                                 MOVLW   0x01
202
0049   002B           00176                                 MOVWF   0x0B
203
                      00177 ;
204
004A   02EA           00178 DelayLp                 DECFSZ  0x0A,1          ;; Decrement Delay Low
205
004B   0A4A           00179                                 GOTO    DelayLp
206
004C   0004           00180                                 CLRWDT                          ;; Tickle WDT
207
004D   02EB           00181                                 DECFSZ  0x0B,1          ;; Decrement Delay High
208
004E   0A4A           00182                                 GOTO    DelayLp
209
                      00183 ;
210
004F   0800           00184                                 RETLW   0x00
211
                      00185 ;-------------------------------------------------------------------------------
212
                      00186                                 END
213
MPASM  5.50                   M16C5X_TST2.ASM   7-4-2013  11:39:38         PAGE  5
214
 
215
 
216
SYMBOL TABLE
217
  LABEL                             VALUE
218
 
219
Cntr                              0000000A
220
Continue                          00000034
221
Count                             00000015
222
Delay                             00000045
223
DelayLoop                         0000000A
224
DelayLp                           0000004A
225
ErrorLoop                         00000033
226
FSR                               00000004
227
INDF                              00000000
228
Loop1                             00000013
229
Loop2                             0000001B
230
MemStart                          0000000B
231
Next                              0000000A
232
PCL                               00000002
233
PortA                             00000005
234
PortB                             00000006
235
PortC                             00000007
236
PortTst                           00000040
237
ScratchPadRam                     0000000A
238
SleepRestart                      00000030
239
Start                             00000000
240
Status                            00000003
241
Subroutine                        0000000D
242
Tmr0                              00000001
243
__16F59                           00000001
244
__DEBUG                           1
245
 
246
 
247
MEMORY USAGE MAP ('X' = Used,  '-' = Unused)
248
 
249
0000 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
250
0040 : XXXXXXXXXXXXXXXX ---------------- ---------------- ----------------
251
07C0 : ---------------- ---------------- ---------------- ---------------X
252
 
253
All other memory blocks unused.
254
 
255
Program Memory Words Used:    81
256
Program Memory Words Free:  1967
257
 
258
 
259
Errors   :     0
260
Warnings :     0 reported,     0 suppressed
261
Messages :     2 reported,     0 suppressed
262
 
263
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.