]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RL78_RL78G13_Promo_Board_IAR/RegTest.s87
Update version number to V8.0.0 (without the release candidate number).
[freertos] / FreeRTOS / Demo / RL78_RL78G13_Promo_Board_IAR / RegTest.s87
1 ;/*\r
2 ;    FreeRTOS V8.0.0 - Copyright (C) 2014 Real Time Engineers Ltd.\r
3 ;       \r
4 ;\r
5 ;    ***************************************************************************\r
6 ;     *                                                                       *\r
7 ;     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
8 ;     *    Complete, revised, and edited pdf reference manuals are also       *\r
9 ;     *    available.                                                         *\r
10 ;     *                                                                       *\r
11 ;     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
12 ;     *    ensuring you get running as quickly as possible and with an        *\r
13 ;     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
14 ;     *    the FreeRTOS project to continue with its mission of providing     *\r
15 ;     *    professional grade, cross platform, de facto standard solutions    *\r
16 ;     *    for microcontrollers - completely free of charge!                  *\r
17 ;     *                                                                       *\r
18 ;     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
19 ;     *                                                                       *\r
20 ;     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
21 ;     *                                                                       *\r
22 ;    ***************************************************************************\r
23 ;\r
24 ;\r
25 ;    This file is part of the FreeRTOS distribution.\r
26 ;\r
27 ;    FreeRTOS is free software; you can redistribute it and/or modify it under\r
28 ;    the terms of the GNU General Public License (version 2) as published by the\r
29 ;    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
30 ;    >>>NOTE<<< The modification to the GPL is included to allow you to\r
31 ;    distribute a combined work that includes FreeRTOS without being obliged to\r
32 ;    provide the source code for proprietary components outside of the FreeRTOS\r
33 ;    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
34 ;    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
35 ;    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
36 ;    more details. You should have received a copy of the GNU General Public\r
37 ;    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
38 ;    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
39 ;    by writing to Richard Barry, contact details for whom are available on the\r
40 ;    FreeRTOS WEB site.\r
41 ;\r
42 ;    1 tab == 4 spaces!\r
43 ;\r
44 ;    http://www.FreeRTOS.org - Documentation, latest information, license and\r
45 ;    contact details.\r
46 ;\r
47 ;    http://www.SafeRTOS.com - A version that is certified for use in safety\r
48 ;    critical systems.\r
49 ;\r
50 ;    http://www.OpenRTOS.com - Commercial support, development, porting,\r
51 ;    licensing and training services.\r
52 ;*/\r
53 \r
54 \r
55 ;\r
56 ; This file defines the RegTest tasks as described at the top of main.c\r
57 ;\r
58 \r
59 ;------------------------------------------------------------------------------\r
60 \r
61 #if __CORE__ != __RL78_1__\r
62         #error "This file is only for RL78 Devices"\r
63 #endif\r
64 \r
65 ; Functions implemented in this file\r
66 ;------------------------------------------------------------------------------\r
67 \r
68         PUBLIC    vRegTest1\r
69         PUBLIC    vRegTest2\r
70 \r
71 ; Functions used by this file\r
72 ;------------------------------------------------------------------------------\r
73         EXTERN    vRegTestError\r
74 \r
75 ;------------------------------------------------------------------------------\r
76 ;   Fill all the registers with known values, then check that the registers\r
77 ;   contain the expected value.  An incorrect value being indicative of an\r
78 ;   error in the context switch mechanism.\r
79 ;\r
80 ;   Input:  NONE\r
81 ;\r
82 ;   Call:   Created as a task.\r
83 ;\r
84 ;   Output: NONE\r
85 ;\r
86 ;------------------------------------------------------------------------------\r
87     RSEG CODE:CODE\r
88 vRegTest1:\r
89 \r
90         ; First fill the registers.\r
91         MOVW    AX, #0x1122\r
92         MOVW    BC, #0x3344\r
93         MOVW    DE, #0x5566\r
94         MOVW    HL, #0x7788\r
95         MOV             CS, #0x01\r
96         \r
97 #if __DATA_MODEL__ == __DATA_MODEL_FAR__\r
98 \r
99         ; ES is not saved or restored when using the near memory model so only\r
100         ; test it when using the far model.\r
101         MOV             ES, #0x02\r
102         \r
103 #endif\r
104 \r
105 loop1:\r
106 \r
107         ; Continuously check that the register values remain at their expected\r
108         ; values.  The BRK is to test the yield.  This task runs at low priority\r
109         ; so will also regularly get preempted.\r
110         BRK\r
111 \r
112         ; Compare with the expected value.\r
113         CMPW    AX, #0x1122\r
114         BZ              +5\r
115 \r
116         ; Jump over the branch to vRegTestError() if the register contained the\r
117         ; expected value - otherwise flag an error by executing vRegTestError().\r
118         BR              vRegTestError   \r
119 \r
120         ; Repeat for all the registers.\r
121         MOVW    AX, BC\r
122         CMPW    AX, #0x3344\r
123         BZ              +5\r
124         BR              vRegTestError   \r
125         MOVW    AX, DE\r
126         CMPW    AX, #0x5566\r
127         BZ              +5\r
128         BR              vRegTestError   \r
129         MOVW    AX, HL  \r
130         CMPW    AX, #0x7788\r
131         BZ              +5\r
132         BR              vRegTestError\r
133         MOV             A, CS\r
134         CMP             A, #0x01\r
135         BZ              +5\r
136         BR              vRegTestError\r
137 \r
138 #if __DATA_MODEL__ == __DATA_MODEL_FAR__\r
139 \r
140         ; ES is not saved or restored when using the near memory model so only\r
141         ; test it when using the far model.\r
142         MOV             A, ES\r
143         CMP             A, #0x02\r
144         BZ              +5\r
145         BR              vRegTestError\r
146 \r
147 #endif\r
148 \r
149         MOVW    AX, #0x1122\r
150         BR              loop1\r
151 \r
152 \r
153 ;------------------------------------------------------------------------------\r
154 ;   Fill all the registers with known values, then check that the registers\r
155 ;   contain the expected value.  An incorrect value being indicative of an\r
156 ;   error in the context switch mechanism.\r
157 ;\r
158 ;   Input:  NONE\r
159 ;\r
160 ;   Call:   Created as a task.\r
161 ;\r
162 ;   Output: NONE\r
163 ;\r
164 ;------------------------------------------------------------------------------\r
165     RSEG CODE:CODE\r
166 vRegTest2:\r
167 \r
168         MOVW    AX, #0x99aa\r
169         MOVW    BC, #0xbbcc\r
170         MOVW    DE, #0xddee\r
171         MOVW    HL, #0xff12\r
172         MOV             CS, #0x03\r
173 \r
174 #if __DATA_MODEL__ == __DATA_MODEL_FAR__\r
175 \r
176         MOV             ES, #0x04       \r
177 \r
178 #endif\r
179 \r
180 loop2:\r
181         CMPW    AX, #0x99aa\r
182         BZ              +5\r
183         BR              vRegTestError   \r
184         MOVW    AX, BC\r
185         CMPW    AX, #0xbbcc\r
186         BZ              +5\r
187         BR              vRegTestError   \r
188         MOVW    AX, DE\r
189         CMPW    AX, #0xddee\r
190         BZ              +5\r
191         BR              vRegTestError   \r
192         MOVW    AX, HL  \r
193         CMPW    AX, #0xff12\r
194         BZ              +5\r
195         BR              vRegTestError\r
196         MOV             A, CS\r
197         CMP             A, #0x03\r
198         BZ              +5\r
199         BR              vRegTestError\r
200 \r
201 #if __DATA_MODEL__ == __DATA_MODEL_FAR__\r
202 \r
203         MOV             A, ES\r
204         CMP             A, #0x04\r
205         BZ              +5\r
206         BR              vRegTestError\r
207 \r
208 #endif\r
209 \r
210         MOVW    AX, #0x99aa\r
211         BR              loop2\r
212 \r
213 \r
214         END\r