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

Subversion Repositories minirisc

[/] [minirisc/] [trunk/] [scode/] [sanity1.asm] - Blame information for rev 7

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 lampret
;/////////////////////////////////////////////////////////////////////
2
;////                                                             ////
3
;////  Mini-RISC-1                                                ////
4
;////  Compliance Test 1                                          ////
5
;////  Tests Ports                                                ////
6
;////                                                             ////
7
;////  Author: Rudolf Usselmann                                   ////
8
;////          russelmann@hotmail.com                             ////
9
;////                                                             ////
10
;/////////////////////////////////////////////////////////////////////
11
;////                                                             ////
12
;//// Copyright (C) 2000 Rudolf Usselmann                         ////
13
;////                    russelmann@hotmail.com                   ////
14
;////                                                             ////
15
;//// This source file may be used and distributed without        ////
16
;//// restriction provided that this copyright statement is not   ////
17
;//// removed from the file and that any derivative work contains ////
18
;//// the original copyright notice and the associated disclaimer.////
19
;////                                                             ////
20
;//// THIS SOURCE FILE IS PROVIDED "AS IS" AND WITHOUT ANY        ////
21
;//// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT           ////
22
;//// LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND   ////
23
;//// FITNESS FOR A PARTICULAR PURPOSE.                           ////
24
;////                                                             ////
25
;/////////////////////////////////////////////////////////////////////
26
 
27
        list    p=16c57
28
        #include p16c5x.inc
29
 
30
 
31
main    ; Main code entry
32
        ; Port IO Test
33
        ; All ports have a Pull up resistor
34
 
35
        ; Tristate all ports
36
        clrw
37
        movwf   PORTA
38
        movwf   PORTB
39
        movwf   PORTC
40
        xorlw   0xff
41
        tris    PORTA
42
        tris    PORTB
43
        tris    PORTC
44
 
45
        ; Now check that porta is 0xff
46
        btfss   PORTA,0
47
        goto    lerr
48
        btfss   PORTA,1
49
        goto    lerr
50
        btfss   PORTA,2
51
        goto    lerr
52
        btfss   PORTA,3
53
        goto    lerr
54
        btfss   PORTA,4
55
        goto    lerr
56
        btfss   PORTA,5
57
        goto    lerr
58
        btfss   PORTA,6
59
        goto    lerr
60
        btfss   PORTA,7
61
        goto    lerr
62
 
63
 
64
        ; Now check that portb is 0xff
65
        btfss   PORTB,0
66
        goto    lerr
67
        btfss   PORTB,1
68
        goto    lerr
69
        btfss   PORTB,2
70
        goto    lerr
71
        btfss   PORTB,3
72
        goto    lerr
73
        btfss   PORTB,4
74
        goto    lerr
75
        btfss   PORTB,5
76
        goto    lerr
77
        btfss   PORTB,6
78
        goto    lerr
79
        btfss   PORTB,7
80
        goto    lerr
81
 
82
        ; Now check that portc is 0xff
83
        btfss   PORTC,0
84
        goto    lerr
85
        btfss   PORTC,1
86
        goto    lerr
87
        btfss   PORTC,2
88
        goto    lerr
89
        btfss   PORTC,3
90
        goto    lerr
91
        btfss   PORTC,4
92
        goto    lerr
93
        btfss   PORTC,5
94
        goto    lerr
95
        btfss   PORTA,6
96
        goto    lerr
97
        btfss   PORTC,7
98
        goto    lerr
99
 
100
 
101
 
102
        ; Enable all ports
103
        clrw
104
        tris    PORTA
105
        tris    PORTB
106
        tris    PORTC
107
 
108
        ; Drive them all 0xaa
109
        clrw
110
        xorlw   0xaa
111
        movwf   PORTA
112
        movwf   PORTB
113
        movwf   PORTC
114
 
115
        ; Now check that porta is 0xaa
116
        btfsc   PORTA,0
117
        goto    lerr
118
        btfss   PORTA,1
119
        goto    lerr
120
        btfsc   PORTA,2
121
        goto    lerr
122
        btfss   PORTA,3
123
        goto    lerr
124
        btfsc   PORTA,4
125
        goto    lerr
126
        btfss   PORTA,5
127
        goto    lerr
128
        btfsc   PORTA,6
129
        goto    lerr
130
        btfss   PORTA,7
131
        goto    lerr
132
 
133
        ; Now check that portb is 0xaa
134
        btfsc   PORTB,0
135
        goto    lerr
136
        btfss   PORTB,1
137
        goto    lerr
138
        btfsc   PORTB,2
139
        goto    lerr
140
        btfss   PORTB,3
141
        goto    lerr
142
        btfsc   PORTB,4
143
        goto    lerr
144
        btfss   PORTB,5
145
        goto    lerr
146
        btfsc   PORTB,6
147
        goto    lerr
148
        btfss   PORTB,7
149
        goto    lerr
150
 
151
        ; Now check that portc is 0xaa
152
        btfsc   PORTC,0
153
        goto    lerr
154
        btfss   PORTC,1
155
        goto    lerr
156
        btfsc   PORTC,2
157
        goto    lerr
158
        btfss   PORTC,3
159
        goto    lerr
160
        btfsc   PORTC,4
161
        goto    lerr
162
        btfss   PORTC,5
163
        goto    lerr
164
        btfsc   PORTC,6
165
        goto    lerr
166
        btfss   PORTC,7
167
        goto    lerr
168
 
169
        ; Drive them all 0x55
170
        clrw
171
        xorlw   0x55
172
        movwf   PORTA
173
        movwf   PORTB
174
        movwf   PORTC
175
 
176
        ; Now check that porta is 0x55
177
        btfss   PORTA,0
178
        goto    lerr
179
        btfsc   PORTA,1
180
        goto    lerr
181
        btfss   PORTA,2
182
        goto    lerr
183
        btfsc   PORTA,3
184
        goto    lerr
185
        btfss   PORTA,4
186
        goto    lerr
187
        btfsc   PORTA,5
188
        goto    lerr
189
        btfss   PORTA,6
190
        goto    lerr
191
        btfsc   PORTA,7
192
        goto    lerr
193
 
194
        ; Now check that portb is 0x55
195
        btfss   PORTB,0
196
        goto    lerr
197
        btfsc   PORTB,1
198
        goto    lerr
199
        btfss   PORTB,2
200
        goto    lerr
201
        btfsc   PORTB,3
202
        goto    lerr
203
        btfss   PORTB,4
204
        goto    lerr
205
        btfsc   PORTB,5
206
        goto    lerr
207
        btfss   PORTB,6
208
        goto    lerr
209
        btfsc   PORTB,7
210
        goto    lerr
211
 
212
        ; Now check that portc is 0x55
213
        btfss   PORTC,0
214
        goto    lerr
215
        btfsc   PORTC,1
216
        goto    lerr
217
        btfss   PORTC,2
218
        goto    lerr
219
        btfsc   PORTC,3
220
        goto    lerr
221
        btfss   PORTC,4
222
        goto    lerr
223
        btfsc   PORTC,5
224
        goto    lerr
225
        btfss   PORTC,6
226
        goto    lerr
227
        btfsc   PORTC,7
228
        goto    lerr
229
 
230
        nop
231
        nop
232
        nop
233
        nop
234
 
235
good                    ; Loop in good on success
236
        goto    good
237
        nop
238
        nop
239
        nop
240
        nop
241
 
242
lerr                    ; Loop in lerr on failure
243
        goto    lerr
244
        nop
245
        nop
246
        nop
247
        nop
248
 
249
   END
250
 

powered by: WebSVN 2.1.0

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