]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/RegTest.s43
Update version number in preparation for maintenance release.
[freertos] / FreeRTOS / Demo / MSP430X_MSP430F5438_IAR / RegTest.s43
1 /*\r
2     FreeRTOS V9.0.1 - Copyright (C) 2017 Real Time Engineers Ltd.\r
3     All rights reserved\r
4 \r
5     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
6 \r
7     This file is part of the FreeRTOS distribution.\r
8 \r
9     FreeRTOS is free software; you can redistribute it and/or modify it under\r
10     the terms of the GNU General Public License (version 2) as published by the\r
11     Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
12 \r
13     ***************************************************************************\r
14     >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
15     >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
16     >>!   obliged to provide the source code for proprietary components     !<<\r
17     >>!   outside of the FreeRTOS kernel.                                   !<<\r
18     ***************************************************************************\r
19 \r
20     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
21     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
22     FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
23     link: http://www.freertos.org/a00114.html\r
24 \r
25     ***************************************************************************\r
26      *                                                                       *\r
27      *    FreeRTOS provides completely free yet professionally developed,    *\r
28      *    robust, strictly quality controlled, supported, and cross          *\r
29      *    platform software that is more than just the market leader, it     *\r
30      *    is the industry's de facto standard.                               *\r
31      *                                                                       *\r
32      *    Help yourself get started quickly while simultaneously helping     *\r
33      *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
34      *    tutorial book, reference manual, or both:                          *\r
35      *    http://www.FreeRTOS.org/Documentation                              *\r
36      *                                                                       *\r
37     ***************************************************************************\r
38 \r
39     http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
40     the FAQ page "My application does not run, what could be wrong?".  Have you\r
41     defined configASSERT()?\r
42 \r
43     http://www.FreeRTOS.org/support - In return for receiving this top quality\r
44     embedded software for free we request you assist our global community by\r
45     participating in the support forum.\r
46 \r
47     http://www.FreeRTOS.org/training - Investing in training allows your team to\r
48     be as productive as possible as early as possible.  Now you can receive\r
49     FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
50     Ltd, and the world's leading authority on the world's leading RTOS.\r
51 \r
52     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
53     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
54     compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
55 \r
56     http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
57     Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
58 \r
59     http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
60     Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
61     licenses offer ticketed support, indemnification and commercial middleware.\r
62 \r
63     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
64     engineered and independently SIL3 certified version for use in safety and\r
65     mission critical applications that require provable dependability.\r
66 \r
67     1 tab == 4 spaces!\r
68 */\r
69 #include "msp430.h"\r
70 #include "FreeRTOSConfig.h"\r
71 #include "data_model.h"\r
72 \r
73 /*\r
74  * The definition of the "register test" tasks, as described at the top of\r
75  * main.c\r
76  */\r
77 \r
78 \r
79 \r
80         IMPORT usRegTest1Counter\r
81         IMPORT usRegTest2Counter\r
82         IMPORT vPortYield\r
83         \r
84         EXPORT vRegTest1Task\r
85         EXPORT vRegTest2Task\r
86 \r
87         RSEG CODE\r
88         \r
89         EVEN\r
90 \r
91 vRegTest1Task:\r
92 \r
93         /* Fill each general purpose register with a known value. */\r
94         mov_x   #0x4444, r4\r
95         mov_x   #0x5555, r5\r
96         mov_x   #0x6666, r6\r
97         mov_x   #0x7777, r7\r
98         mov_x   #0x8888, r8\r
99         mov_x   #0x9999, r9\r
100         mov_x   #0xaaaa, r10\r
101         mov_x   #0xbbbb, r11\r
102         mov_x   #0xcccc, r12\r
103         mov_x   #0xdddd, r13\r
104         mov_x   #0xeeee, r14\r
105         mov_x   #0xffff, r15\r
106         \r
107 prvRegTest1Loop:\r
108 \r
109         /* Test each general purpose register to check that it still contains the\r
110         expected known value, jumping to vRegTest1Error if any register contains\r
111         an unexpected value. */\r
112         cmp_x   #0x4444, r4\r
113         jne             vRegTest1Error\r
114         cmp_x   #0x5555, r5\r
115         jne             vRegTest1Error\r
116         cmp_x   #0x6666, r6\r
117         jne             vRegTest1Error\r
118         cmp_x   #0x7777, r7\r
119         jne             vRegTest1Error\r
120         cmp_x   #0x8888, r8\r
121         jne             vRegTest1Error\r
122         cmp_x   #0x9999, r9\r
123         jne             vRegTest1Error\r
124         cmp_x   #0xaaaa, r10\r
125         jne             vRegTest1Error\r
126         cmp_x   #0xbbbb, r11\r
127         jne             vRegTest1Error\r
128         cmp_x   #0xcccc, r12\r
129         jne             vRegTest1Error\r
130         cmp_x   #0xdddd, r13\r
131         jne             vRegTest1Error\r
132         cmp_x   #0xeeee, r14\r
133         jne             vRegTest1Error\r
134         cmp_x   #0xffff, r15\r
135         jne             vRegTest1Error\r
136         \r
137         /* This task is still running without jumping to vRegTest1Error, so increment\r
138         the loop counter so the check task knows the task is running error free. */\r
139         incx.w  &usRegTest1Counter\r
140         \r
141         /* Loop again, performing the same tests. */\r
142         jmp             prvRegTest1Loop\r
143         nop\r
144 \r
145         \r
146         EVEN\r
147         \r
148 vRegTest1Error:\r
149         jmp vRegTest1Error\r
150         nop\r
151         \r
152 /*-----------------------------------------------------------*/\r
153 \r
154 /* See the comments in vRegTest1Task.  This task is the same, it just uses\r
155 different values in its registers. */\r
156 vRegTest2Task:\r
157 \r
158         mov_x   #0x4441, r4\r
159         mov_x   #0x5551, r5\r
160         mov_x   #0x6661, r6\r
161         mov_x   #0x7771, r7\r
162         mov_x   #0x8881, r8\r
163         mov_x   #0x9991, r9\r
164         mov_x   #0xaaa1, r10\r
165         mov_x   #0xbbb1, r11\r
166         mov_x   #0xccc1, r12\r
167         mov_x   #0xddd1, r13\r
168         mov_x   #0xeee1, r14\r
169         mov_x   #0xfff1, r15\r
170         \r
171 prvRegTest2Loop:\r
172 \r
173         cmp_x   #0x4441, r4\r
174         jne             vRegTest2Error\r
175         cmp_x   #0x5551, r5\r
176         jne             vRegTest2Error\r
177         cmp_x   #0x6661, r6\r
178         jne             vRegTest2Error\r
179         cmp_x   #0x7771, r7\r
180         jne             vRegTest2Error\r
181         cmp_x   #0x8881, r8\r
182         jne             vRegTest2Error\r
183         cmp_x   #0x9991, r9\r
184         jne             vRegTest2Error\r
185         cmp_x   #0xaaa1, r10\r
186         jne             vRegTest2Error\r
187         cmp_x   #0xbbb1, r11\r
188         jne             vRegTest2Error\r
189         cmp_x   #0xccc1, r12\r
190         jne             vRegTest2Error\r
191         cmp_x   #0xddd1, r13\r
192         jne             vRegTest2Error\r
193         cmp_x   #0xeee1, r14\r
194         jne             vRegTest2Error\r
195         cmp_x   #0xfff1, r15\r
196         jne             vRegTest2Error\r
197         \r
198         /* Also perform a manual yield, just to increase the scope of the test. */\r
199         calla   #vPortYield\r
200         \r
201         incx.w  &usRegTest2Counter\r
202         jmp             prvRegTest2Loop\r
203         nop\r
204 \r
205         \r
206 vRegTest2Error:\r
207         jmp vRegTest2Error\r
208         nop\r
209 /*-----------------------------------------------------------*/\r
210 \r
211                 \r
212         END\r
213                 \r