]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad_IAR_CCS/IAR_Only/RegTest.s43
Update to MIT licensed FreeRTOS V10.0.0 - see https://www.freertos.org/History.txt
[freertos] / FreeRTOS / Demo / MSP430X_MSP430FR5969_LaunchPad_IAR_CCS / IAR_Only / RegTest.s43
1 /*\r
2  * FreeRTOS Kernel V10.0.0\r
3  * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
4  *\r
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
6  * this software and associated documentation files (the "Software"), to deal in\r
7  * the Software without restriction, including without limitation the rights to\r
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
9  * the Software, and to permit persons to whom the Software is furnished to do so,\r
10  * subject to the following conditions:\r
11  *\r
12  * The above copyright notice and this permission notice shall be included in all\r
13  * copies or substantial portions of the Software. If you wish to use our Amazon\r
14  * FreeRTOS name, please do so in a fair use way that does not cause confusion.\r
15  *\r
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
18  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
19  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
20  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
21  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
22  *\r
23  * http://www.FreeRTOS.org\r
24  * http://aws.amazon.com/freertos\r
25  *\r
26  * 1 tab == 4 spaces!\r
27  */\r
28 #include "msp430.h"\r
29 #include "FreeRTOSConfig.h"\r
30 #include "data_model.h"\r
31 \r
32 /*\r
33  * The definition of the "register test" tasks, as described at the top of\r
34  * main.c\r
35  */\r
36 \r
37 \r
38 \r
39         IMPORT usRegTest1LoopCounter\r
40         IMPORT usRegTest2LoopCounter\r
41         IMPORT vPortYield\r
42 \r
43         EXPORT vRegTest1Implementation\r
44         EXPORT vRegTest2Implementation\r
45 \r
46         RSEG CODE\r
47 \r
48         EVEN\r
49 \r
50 vRegTest1Implementation:\r
51 \r
52         /* Fill each general purpose register with a known value. */\r
53         mov_x   #0x4444, r4\r
54         mov_x   #0x5555, r5\r
55         mov_x   #0x6666, r6\r
56         mov_x   #0x7777, r7\r
57         mov_x   #0x8888, r8\r
58         mov_x   #0x9999, r9\r
59         mov_x   #0xaaaa, r10\r
60         mov_x   #0xbbbb, r11\r
61         mov_x   #0xcccc, r12\r
62         mov_x   #0xdddd, r13\r
63         mov_x   #0xeeee, r14\r
64         mov_x   #0xffff, r15\r
65 \r
66 prvRegTest1Loop:\r
67 \r
68         /* Test each general purpose register to check that it still contains the\r
69         expected known value, jumping to vRegTest1Error if any register contains\r
70         an unexpected value. */\r
71         cmp_x   #0x4444, r4\r
72         jne             vRegTest1Error\r
73         cmp_x   #0x5555, r5\r
74         jne             vRegTest1Error\r
75         cmp_x   #0x6666, r6\r
76         jne             vRegTest1Error\r
77         cmp_x   #0x7777, r7\r
78         jne             vRegTest1Error\r
79         cmp_x   #0x8888, r8\r
80         jne             vRegTest1Error\r
81         cmp_x   #0x9999, r9\r
82         jne             vRegTest1Error\r
83         cmp_x   #0xaaaa, r10\r
84         jne             vRegTest1Error\r
85         cmp_x   #0xbbbb, r11\r
86         jne             vRegTest1Error\r
87         cmp_x   #0xcccc, r12\r
88         jne             vRegTest1Error\r
89         cmp_x   #0xdddd, r13\r
90         jne             vRegTest1Error\r
91         cmp_x   #0xeeee, r14\r
92         jne             vRegTest1Error\r
93         cmp_x   #0xffff, r15\r
94         jne             vRegTest1Error\r
95 \r
96         /* This task is still running without jumping to vRegTest1Error, so increment\r
97         the loop counter so the check task knows the task is running error free. */\r
98         incx.w  &usRegTest1LoopCounter\r
99 \r
100         /* Loop again, performing the same tests. */\r
101         jmp             prvRegTest1Loop\r
102         nop\r
103 \r
104 \r
105         EVEN\r
106 \r
107 vRegTest1Error:\r
108         jmp vRegTest1Error\r
109         nop\r
110 \r
111 /*-----------------------------------------------------------*/\r
112 \r
113 /* See the comments in vRegTest1Implementation.  This task is the same, it just uses\r
114 different values in its registers. */\r
115 vRegTest2Implementation:\r
116 \r
117         mov_x   #0x4441, r4\r
118         mov_x   #0x5551, r5\r
119         mov_x   #0x6661, r6\r
120         mov_x   #0x7771, r7\r
121         mov_x   #0x8881, r8\r
122         mov_x   #0x9991, r9\r
123         mov_x   #0xaaa1, r10\r
124         mov_x   #0xbbb1, r11\r
125         mov_x   #0xccc1, r12\r
126         mov_x   #0xddd1, r13\r
127         mov_x   #0xeee1, r14\r
128         mov_x   #0xfff1, r15\r
129 \r
130 prvRegTest2Loop:\r
131 \r
132         cmp_x   #0x4441, r4\r
133         jne             vRegTest2Error\r
134         cmp_x   #0x5551, r5\r
135         jne             vRegTest2Error\r
136         cmp_x   #0x6661, r6\r
137         jne             vRegTest2Error\r
138         cmp_x   #0x7771, r7\r
139         jne             vRegTest2Error\r
140         cmp_x   #0x8881, r8\r
141         jne             vRegTest2Error\r
142         cmp_x   #0x9991, r9\r
143         jne             vRegTest2Error\r
144         cmp_x   #0xaaa1, r10\r
145         jne             vRegTest2Error\r
146         cmp_x   #0xbbb1, r11\r
147         jne             vRegTest2Error\r
148         cmp_x   #0xccc1, r12\r
149         jne             vRegTest2Error\r
150         cmp_x   #0xddd1, r13\r
151         jne             vRegTest2Error\r
152         cmp_x   #0xeee1, r14\r
153         jne             vRegTest2Error\r
154         cmp_x   #0xfff1, r15\r
155         jne             vRegTest2Error\r
156 \r
157         /* Also perform a manual yield, just to increase the scope of the test. */\r
158         calla   #vPortYield\r
159 \r
160         incx.w  &usRegTest2LoopCounter\r
161         jmp             prvRegTest2Loop\r
162         nop\r
163 \r
164 \r
165 vRegTest2Error:\r
166         jmp vRegTest2Error\r
167         nop\r
168 /*-----------------------------------------------------------*/\r
169 \r
170 \r
171         END\r
172 \r