[102] | 1 | /* |
---|
| 2 | * Test_031 |
---|
| 3 | * |
---|
| 4 | * end_ko : infinite_loop |
---|
| 5 | * end_ok : Write in R1 the stop address and stop an data |
---|
| 6 | * The store in the destination of an jump |
---|
| 7 | * start : Test l.mulu |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | .file "crt0.s" |
---|
| 11 | /* |
---|
| 12 | .section .vector |
---|
| 13 | */ |
---|
| 14 | .section .text |
---|
| 15 | .align 4 |
---|
| 16 | |
---|
| 17 | /* ---[ 0x0 : Print a error ]------------------------------------------- */ |
---|
| 18 | |
---|
| 19 | .org 0x0 |
---|
| 20 | _end_ko : |
---|
| 21 | l.movhi r1, hi(_tty) |
---|
| 22 | l.ori r1, r1, lo(_tty) |
---|
| 23 | l.sw 4(r1), r1 /* stop address */ |
---|
| 24 | _infinite_loop : |
---|
| 25 | l.j _infinite_loop |
---|
| 26 | l.nop |
---|
| 27 | |
---|
| 28 | _end_ok : |
---|
| 29 | l.movhi r1, hi(_tty) |
---|
| 30 | l.ori r1, r1, lo(_tty) |
---|
| 31 | l.sw 4(r1), r0 /* stop address */ |
---|
| 32 | |
---|
| 33 | |
---|
| 34 | /* ---[ 0x100: RESET exception ]----------------------------------------- */ |
---|
| 35 | .org 0x100 |
---|
| 36 | .global _start |
---|
| 37 | _start: |
---|
| 38 | /* |
---|
| 39 | A (r1) B (r2) - D (r3 wait) OV CY (SR = r6, mask SR = r5) |
---|
| 40 | (r4) (r7) |
---|
| 41 | 1) 0x00000000 0x00000000 - 0x00000000 0 0 |
---|
| 42 | 2) 0x12345678 0x00000001 - 0x12345678 0 0 |
---|
| 43 | 3) 0x00000025 0x000064ab - 0x000e8cb7 0 0 |
---|
| 44 | 4) 0x0000083b 0x000007bd - 0x003fb08f ? ? (0x00000000003fb08f) |
---|
| 45 | 5) 0x0000083b 0xfffff843 - 0xffc04f71 ? ? (0x0000083affc04f71) |
---|
| 46 | 6) 0xfffff7c5 0x000007bd - 0xffc04f71 ? ? (0x000007bcffc04f71) |
---|
| 47 | 7) 0xfffff7c5 0xfffff843 - 0x003fb08f ? ? (0xfffff008003fb08f) |
---|
| 48 | 8) 0x017e9157 0x00d5ce37 - 0x18883bb1 ? ? (0x00013f8318883bb1) |
---|
| 49 | 9) 0x017e9157 0xff2a31c9 - 0xe777c44f ? ? (0x017d51d3e777c44f) |
---|
| 50 | 10) 0xfe816ea9 0x00d5ce37 - 0xe777c44f ? ? (0x00d48eb3e777c44f) |
---|
| 51 | 11) 0xfe816ea9 0xff2a31c9 - 0x18883bb1 ? ? (0xfdacdff518883bb1) |
---|
| 52 | */ |
---|
| 53 | |
---|
| 54 | /* Mask to read OV (SR[11]), CY (SR[10]) and not F (SR[9]) */ |
---|
| 55 | l.movhi r5, hi(0x00000c00) |
---|
| 56 | l.ori r5, r5, lo(0x00000c00) |
---|
| 57 | |
---|
| 58 | /**********/ |
---|
| 59 | /* Test 1 */ |
---|
| 60 | /**********/ |
---|
| 61 | l.movhi r1, hi(0x00000000) /* RA */ |
---|
| 62 | l.ori r1, r1, lo(0x00000000) |
---|
| 63 | l.movhi r2, hi(0x00000000) /* RB */ |
---|
| 64 | l.ori r2, r2, lo(0x00000000) |
---|
| 65 | l.movhi r3, hi(0x00000000) /* RD wait */ |
---|
| 66 | l.ori r3, r3, lo(0x00000000) |
---|
| 67 | l.movhi r6, hi(0x00000000) /* SR wait */ |
---|
| 68 | l.ori r6, r6, lo(0x00000000) |
---|
| 69 | |
---|
| 70 | l.mulu r4, r1, r2 |
---|
| 71 | |
---|
| 72 | /* Test flag */ |
---|
| 73 | l.mfspr r7, r0, 17 |
---|
| 74 | l.and r7, r7, r5 |
---|
| 75 | |
---|
| 76 | l.sfeq r6, r7 |
---|
| 77 | l.bnf _end_ko |
---|
| 78 | l.nop |
---|
| 79 | |
---|
| 80 | /* Test result */ |
---|
| 81 | l.sfeq r3, r4 |
---|
| 82 | l.bnf _end_ko |
---|
| 83 | l.nop |
---|
| 84 | |
---|
| 85 | /**********/ |
---|
| 86 | /* Test 2 */ |
---|
| 87 | /**********/ |
---|
| 88 | l.movhi r1, hi(0x12345678) /* RA */ |
---|
| 89 | l.ori r1, r1, lo(0x12345678) |
---|
| 90 | l.movhi r2, hi(0x00000001) /* RB */ |
---|
| 91 | l.ori r2, r2, lo(0x00000001) |
---|
| 92 | l.movhi r3, hi(0x12345678) /* RD wait */ |
---|
| 93 | l.ori r3, r3, lo(0x12345678) |
---|
| 94 | l.movhi r6, hi(0x00000000) /* SR wait */ |
---|
| 95 | l.ori r6, r6, lo(0x00000000) |
---|
| 96 | |
---|
| 97 | l.mulu r4, r1, r2 |
---|
| 98 | |
---|
| 99 | /* Test flag */ |
---|
| 100 | l.mfspr r7, r0, 17 |
---|
| 101 | l.and r7, r7, r5 |
---|
| 102 | |
---|
| 103 | l.sfeq r6, r7 |
---|
| 104 | l.bnf _end_ko |
---|
| 105 | l.nop |
---|
| 106 | |
---|
| 107 | /* Test result */ |
---|
| 108 | l.sfeq r3, r4 |
---|
| 109 | l.bnf _end_ko |
---|
| 110 | l.nop |
---|
| 111 | |
---|
| 112 | /**********/ |
---|
| 113 | /* Test 3 */ |
---|
| 114 | /**********/ |
---|
| 115 | l.movhi r1, hi(0x00000025) /* RA */ |
---|
| 116 | l.ori r1, r1, lo(0x00000025) |
---|
| 117 | l.movhi r2, hi(0x000064ab) /* RB */ |
---|
| 118 | l.ori r2, r2, lo(0x000064ab) |
---|
| 119 | l.movhi r3, hi(0x000e8cb7) /* RD wait */ |
---|
| 120 | l.ori r3, r3, lo(0x000e8cb7) |
---|
| 121 | l.movhi r6, hi(0x00000000) /* SR wait */ |
---|
| 122 | l.ori r6, r6, lo(0x00000000) |
---|
| 123 | |
---|
| 124 | l.mulu r4, r1, r2 |
---|
| 125 | |
---|
| 126 | /* Test flag */ |
---|
| 127 | l.mfspr r7, r0, 17 |
---|
| 128 | l.and r7, r7, r5 |
---|
| 129 | |
---|
| 130 | l.sfeq r6, r7 |
---|
| 131 | l.bnf _end_ko |
---|
| 132 | l.nop |
---|
| 133 | |
---|
| 134 | /* Test result */ |
---|
| 135 | l.sfeq r3, r4 |
---|
| 136 | l.bnf _end_ko |
---|
| 137 | l.nop |
---|
| 138 | |
---|
| 139 | /**********/ |
---|
| 140 | /* Test 4 */ |
---|
| 141 | /**********/ |
---|
| 142 | l.movhi r1, hi(0x0000083b) /* RA */ |
---|
| 143 | l.ori r1, r1, lo(0x0000083b) |
---|
| 144 | l.movhi r2, hi(0x000007bd) /* RB */ |
---|
| 145 | l.ori r2, r2, lo(0x000007bd) |
---|
| 146 | l.movhi r3, hi(0x003fb08f) /* RD wait */ |
---|
| 147 | l.ori r3, r3, lo(0x003fb08f) |
---|
| 148 | l.movhi r6, hi(0x00000000) /* SR wait */ |
---|
| 149 | l.ori r6, r6, lo(0x00000000) |
---|
| 150 | |
---|
| 151 | l.mulu r4, r1, r2 |
---|
| 152 | |
---|
| 153 | /* Test flag */ |
---|
| 154 | /* |
---|
| 155 | l.mfspr r7, r0, 17 |
---|
| 156 | l.and r7, r7, r5 |
---|
| 157 | |
---|
| 158 | l.sfeq r6, r7 |
---|
| 159 | l.bnf _end_ko |
---|
| 160 | l.nop |
---|
| 161 | */ |
---|
| 162 | |
---|
| 163 | /* Test result */ |
---|
| 164 | l.sfeq r3, r4 |
---|
| 165 | l.bnf _end_ko |
---|
| 166 | l.nop |
---|
| 167 | |
---|
| 168 | /**********/ |
---|
| 169 | /* Test 5 */ |
---|
| 170 | /**********/ |
---|
| 171 | l.movhi r1, hi(0x0000083b) /* RA */ |
---|
| 172 | l.ori r1, r1, lo(0x0000083b) |
---|
| 173 | l.movhi r2, hi(0xfffff843) /* RB */ |
---|
| 174 | l.ori r2, r2, lo(0xfffff843) |
---|
| 175 | l.movhi r3, hi(0xffc04f71) /* RD wait */ |
---|
| 176 | l.ori r3, r3, lo(0xffc04f71) |
---|
| 177 | l.movhi r6, hi(0x00000000) /* SR wait */ |
---|
| 178 | l.ori r6, r6, lo(0x00000000) |
---|
| 179 | |
---|
| 180 | l.mulu r4, r1, r2 |
---|
| 181 | |
---|
| 182 | /* Test flag */ |
---|
| 183 | /* |
---|
| 184 | l.mfspr r7, r0, 17 |
---|
| 185 | l.and r7, r7, r5 |
---|
| 186 | |
---|
| 187 | l.sfeq r6, r7 |
---|
| 188 | l.bnf _end_ko |
---|
| 189 | l.nop |
---|
| 190 | */ |
---|
| 191 | |
---|
| 192 | /* Test result */ |
---|
| 193 | l.sfeq r3, r4 |
---|
| 194 | l.bnf _end_ko |
---|
| 195 | l.nop |
---|
| 196 | |
---|
| 197 | /**********/ |
---|
| 198 | /* Test 6 */ |
---|
| 199 | /**********/ |
---|
| 200 | l.movhi r1, hi(0xfffff7c5) /* RA */ |
---|
| 201 | l.ori r1, r1, lo(0xfffff7c5) |
---|
| 202 | l.movhi r2, hi(0x000007bd) /* RB */ |
---|
| 203 | l.ori r2, r2, lo(0x000007bd) |
---|
| 204 | l.movhi r3, hi(0xffc04f71) /* RD wait */ |
---|
| 205 | l.ori r3, r3, lo(0xffc04f71) |
---|
| 206 | l.movhi r6, hi(0x00000000) /* SR wait */ |
---|
| 207 | l.ori r6, r6, lo(0x00000000) |
---|
| 208 | |
---|
| 209 | l.mulu r4, r1, r2 |
---|
| 210 | |
---|
| 211 | /* Test flag */ |
---|
| 212 | /* |
---|
| 213 | l.mfspr r7, r0, 17 |
---|
| 214 | l.and r7, r7, r5 |
---|
| 215 | |
---|
| 216 | l.sfeq r6, r7 |
---|
| 217 | l.bnf _end_ko |
---|
| 218 | l.nop |
---|
| 219 | */ |
---|
| 220 | |
---|
| 221 | /* Test result */ |
---|
| 222 | l.sfeq r3, r4 |
---|
| 223 | l.bnf _end_ko |
---|
| 224 | l.nop |
---|
| 225 | |
---|
| 226 | /**********/ |
---|
| 227 | /* Test 7 */ |
---|
| 228 | /**********/ |
---|
| 229 | l.movhi r1, hi(0xfffff7c5) /* RA */ |
---|
| 230 | l.ori r1, r1, lo(0xfffff7c5) |
---|
| 231 | l.movhi r2, hi(0xfffff843) /* RB */ |
---|
| 232 | l.ori r2, r2, lo(0xfffff843) |
---|
| 233 | l.movhi r3, hi(0x003fb08f) /* RD wait */ |
---|
| 234 | l.ori r3, r3, lo(0x003fb08f) |
---|
| 235 | l.movhi r6, hi(0x00000000) /* SR wait */ |
---|
| 236 | l.ori r6, r6, lo(0x00000000) |
---|
| 237 | |
---|
| 238 | l.mulu r4, r1, r2 |
---|
| 239 | |
---|
| 240 | /* Test flag */ |
---|
| 241 | /* |
---|
| 242 | l.mfspr r7, r0, 17 |
---|
| 243 | l.and r7, r7, r5 |
---|
| 244 | |
---|
| 245 | l.sfeq r6, r7 |
---|
| 246 | l.bnf _end_ko |
---|
| 247 | l.nop |
---|
| 248 | */ |
---|
| 249 | |
---|
| 250 | /* Test result */ |
---|
| 251 | l.sfeq r3, r4 |
---|
| 252 | l.bnf _end_ko |
---|
| 253 | l.nop |
---|
| 254 | |
---|
| 255 | /**********/ |
---|
| 256 | /* Test 8 */ |
---|
| 257 | /**********/ |
---|
| 258 | l.movhi r1, hi(0x017e9157) /* RA */ |
---|
| 259 | l.ori r1, r1, lo(0x017e9157) |
---|
| 260 | l.movhi r2, hi(0x00d5ce37) /* RB */ |
---|
| 261 | l.ori r2, r2, lo(0x00d5ce37) |
---|
| 262 | l.movhi r3, hi(0x18883bb1) /* RD wait */ |
---|
| 263 | l.ori r3, r3, lo(0x18883bb1) |
---|
| 264 | l.movhi r6, hi(0x00000000) /* SR wait */ |
---|
| 265 | l.ori r6, r6, lo(0x00000000) |
---|
| 266 | |
---|
| 267 | l.mulu r4, r1, r2 |
---|
| 268 | |
---|
| 269 | /* Test flag */ |
---|
| 270 | /* |
---|
| 271 | l.mfspr r7, r0, 17 |
---|
| 272 | l.and r7, r7, r5 |
---|
| 273 | |
---|
| 274 | l.sfeq r6, r7 |
---|
| 275 | l.bnf _end_ko |
---|
| 276 | l.nop |
---|
| 277 | */ |
---|
| 278 | |
---|
| 279 | /* Test result */ |
---|
| 280 | l.sfeq r3, r4 |
---|
| 281 | l.bnf _end_ko |
---|
| 282 | l.nop |
---|
| 283 | |
---|
| 284 | /**********/ |
---|
| 285 | /* Test 9 */ |
---|
| 286 | /**********/ |
---|
| 287 | l.movhi r1, hi(0x017e9157) /* RA */ |
---|
| 288 | l.ori r1, r1, lo(0x017e9157) |
---|
| 289 | l.movhi r2, hi(0xff2a31c9) /* RB */ |
---|
| 290 | l.ori r2, r2, lo(0xff2a31c9) |
---|
| 291 | l.movhi r3, hi(0xe777c44f) /* RD wait */ |
---|
| 292 | l.ori r3, r3, lo(0xe777c44f) |
---|
| 293 | l.movhi r6, hi(0x00000000) /* SR wait */ |
---|
| 294 | l.ori r6, r6, lo(0x00000000) |
---|
| 295 | |
---|
| 296 | l.mulu r4, r1, r2 |
---|
| 297 | |
---|
| 298 | /* Test flag */ |
---|
| 299 | /* |
---|
| 300 | l.mfspr r7, r0, 17 |
---|
| 301 | l.and r7, r7, r5 |
---|
| 302 | |
---|
| 303 | l.sfeq r6, r7 |
---|
| 304 | l.bnf _end_ko |
---|
| 305 | l.nop |
---|
| 306 | */ |
---|
| 307 | |
---|
| 308 | /* Test result */ |
---|
| 309 | l.sfeq r3, r4 |
---|
| 310 | l.bnf _end_ko |
---|
| 311 | l.nop |
---|
| 312 | |
---|
| 313 | /**********/ |
---|
| 314 | /* Test 10*/ |
---|
| 315 | /**********/ |
---|
| 316 | l.movhi r1, hi(0xfe816ea9) /* RA */ |
---|
| 317 | l.ori r1, r1, lo(0xfe816ea9) |
---|
| 318 | l.movhi r2, hi(0x00d5ce37) /* RB */ |
---|
| 319 | l.ori r2, r2, lo(0x00d5ce37) |
---|
| 320 | l.movhi r3, hi(0xe777c44f) /* RD wait */ |
---|
| 321 | l.ori r3, r3, lo(0xe777c44f) |
---|
| 322 | l.movhi r6, hi(0x00000000) /* SR wait */ |
---|
| 323 | l.ori r6, r6, lo(0x00000000) |
---|
| 324 | |
---|
| 325 | l.mulu r4, r1, r2 |
---|
| 326 | |
---|
| 327 | /* Test flag */ |
---|
| 328 | /* |
---|
| 329 | l.mfspr r7, r0, 17 |
---|
| 330 | l.and r7, r7, r5 |
---|
| 331 | |
---|
| 332 | l.sfeq r6, r7 |
---|
| 333 | l.bnf _end_ko |
---|
| 334 | l.nop |
---|
| 335 | */ |
---|
| 336 | |
---|
| 337 | /* Test result */ |
---|
| 338 | l.sfeq r3, r4 |
---|
| 339 | l.bnf _end_ko |
---|
| 340 | l.nop |
---|
| 341 | |
---|
| 342 | /**********/ |
---|
| 343 | /* Test 11*/ |
---|
| 344 | /**********/ |
---|
| 345 | l.movhi r1, hi(0xfe816ea9) /* RA */ |
---|
| 346 | l.ori r1, r1, lo(0xfe816ea9) |
---|
| 347 | l.movhi r2, hi(0xff2a31c9) /* RB */ |
---|
| 348 | l.ori r2, r2, lo(0xff2a31c9) |
---|
| 349 | l.movhi r3, hi(0x18883bb1) /* RD wait */ |
---|
| 350 | l.ori r3, r3, lo(0x18883bb1) |
---|
| 351 | l.movhi r6, hi(0x00000000) /* SR wait */ |
---|
| 352 | l.ori r6, r6, lo(0x00000000) |
---|
| 353 | |
---|
| 354 | l.mulu r4, r1, r2 |
---|
| 355 | |
---|
| 356 | /* Test flag */ |
---|
| 357 | /* |
---|
| 358 | l.mfspr r7, r0, 17 |
---|
| 359 | l.and r7, r7, r5 |
---|
| 360 | |
---|
| 361 | l.sfeq r6, r7 |
---|
| 362 | l.bnf _end_ko |
---|
| 363 | l.nop |
---|
| 364 | */ |
---|
| 365 | |
---|
| 366 | /* Test result */ |
---|
| 367 | l.sfeq r3, r4 |
---|
| 368 | l.bnf _end_ko |
---|
| 369 | l.nop |
---|
| 370 | |
---|
| 371 | /* end test */ |
---|
| 372 | l.j _end_ok |
---|
| 373 | l.nop |
---|