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