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