]> git.sur5r.net Git - freertos/blob - Demo/NEC_78K0R_IAR/RegTest.s26
Continue 78K0R development.
[freertos] / Demo / NEC_78K0R_IAR / RegTest.s26
1 ;       FreeRTOS.org V5.1.1 - Copyright (C) 2003-2008 Richard Barry.\r
2 ;\r
3 ;       This file is part of the FreeRTOS.org distribution.\r
4 ;\r
5 ;       FreeRTOS.org is free software; you can redistribute it and/or modify\r
6 ;       it under the terms of the GNU General Public License as published by\r
7 ;       the Free Software Foundation; either version 2 of the License, or\r
8 ;       (at your option) any later version.\r
9 ;\r
10 ;       FreeRTOS.org is distributed in the hope that it will be useful,\r
11 ;       but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12 ;       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13 ;       GNU General Public License for more details.\r
14 ;\r
15 ;       You should have received a copy of the GNU General Public License\r
16 ;       along with FreeRTOS.org; if not, write to the Free Software\r
17 ;       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
18 ;\r
19 ;       A special exception to the GPL can be applied should you wish to distribute\r
20 ;       a combined work that includes FreeRTOS.org, without being obliged to provide\r
21 ;       the source code for any proprietary components.  See the licensing section\r
22 ;       of http://www.FreeRTOS.org for full details of how and when the exception\r
23 ;       can be applied.\r
24 ;\r
25 ;       ***************************************************************************\r
26 ;       See http://www.FreeRTOS.org for documentation, latest information, license\r
27 ;       and contact details.  Please ensure to read the configuration and relevant\r
28 ;       port sections of the online documentation.\r
29 ;       ***************************************************************************\r
30 ;\r
31 ;------------------------------------------------------------------------------\r
32 \r
33 ;------------------------------------------------------------------------------\r
34 \r
35 #if __CORE__ != __78K0R__\r
36         #error "This file is only for 78K0R Devices"\r
37 #endif\r
38 \r
39 ; Functions implemented in this file\r
40 ;------------------------------------------------------------------------------\r
41 \r
42         PUBLIC    vRegTest1\r
43         PUBLIC    vRegTest2\r
44 \r
45 ; Functions used by this file\r
46 ;------------------------------------------------------------------------------\r
47         EXTERN    vRegTestError\r
48 \r
49 ;------------------------------------------------------------------------------\r
50 ;   Fill all the registers with known values, then check that the registers\r
51 ;   contain the expected value.  An incorrect value being indicative of an\r
52 ;   error in the context switch mechanism.\r
53 ;\r
54 ;   Input:  NONE\r
55 ;\r
56 ;   Call:   CALL    vRegTest1\r
57 ;\r
58 ;   Output: NONE\r
59 ;\r
60 ;------------------------------------------------------------------------------\r
61     RSEG CODE:CODE\r
62 vRegTest1:\r
63 \r
64         MOVW    AX, #0x1122\r
65         MOVW    BC, #0x3344\r
66         MOVW    DE, #0x5566\r
67         MOVW    HL, #0x7788\r
68         MOV             CS, #0x01\r
69         MOV             ES, #0x02\r
70 \r
71 loop1:\r
72         BRK\r
73         CMPW    AX, #0x1122\r
74         BZ              +5\r
75         BR              vRegTestError   \r
76         MOVW    AX, BC\r
77         CMPW    AX, #0x3344\r
78         BZ              +5\r
79         BR              vRegTestError   \r
80         MOVW    AX, DE\r
81         CMPW    AX, #0x5566\r
82         BZ              +5\r
83         BR              vRegTestError   \r
84         MOVW    AX, HL  \r
85         CMPW    AX, #0x7788\r
86         BZ              +5\r
87         BR              vRegTestError\r
88         MOV             A, CS\r
89         CMP             A, #0x01\r
90         BZ              +5\r
91         BR              vRegTestError\r
92         MOV             A, ES\r
93         CMP             A, #0x02\r
94         BZ              +5\r
95         BR              vRegTestError\r
96         MOVW    AX, #0x1122\r
97         BR              loop1\r
98 \r
99 \r
100 ;------------------------------------------------------------------------------\r
101 ;   Fill all the registers with known values, then check that the registers\r
102 ;   contain the expected value.  An incorrect value being indicative of an\r
103 ;   error in the context switch mechanism.\r
104 ;\r
105 ;   Input:  NONE\r
106 ;\r
107 ;   Call:   CALL    vRegTest1\r
108 ;\r
109 ;   Output: NONE\r
110 ;\r
111 ;------------------------------------------------------------------------------\r
112     RSEG CODE:CODE\r
113 vRegTest2:\r
114 \r
115         MOVW    AX, #0x99aa\r
116         MOVW    BC, #0xbbcc\r
117         MOVW    DE, #0xddee\r
118         MOVW    HL, #0xff12\r
119         MOV             CS, #0x03\r
120         MOV             ES, #0x04       \r
121 \r
122 loop2:\r
123         CMPW    AX, #0x99aa\r
124         BZ              +5\r
125         BR              vRegTestError   \r
126         MOVW    AX, BC\r
127         CMPW    AX, #0xbbcc\r
128         BZ              +5\r
129         BR              vRegTestError   \r
130         MOVW    AX, DE\r
131         CMPW    AX, #0xddee\r
132         BZ              +5\r
133         BR              vRegTestError   \r
134         MOVW    AX, HL  \r
135         CMPW    AX, #0xff12\r
136         BZ              +5\r
137         BR              vRegTestError\r
138         MOV             A, CS\r
139         CMP             A, #0x03\r
140         BZ              +5\r
141         BR              vRegTestError\r
142         MOV             A, ES\r
143         CMP             A, #0x04\r
144         BZ              +5\r
145         BR              vRegTestError\r
146         MOVW    AX, #0x99aa\r
147         BR              loop2\r
148 \r
149 \r
150         END\r