[100] | 1 | /* |
---|
| 2 | * Test_018 |
---|
| 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.extbs, l.extbz, l.exths, l.exthz |
---|
| 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 : |
---|
[101] | 21 | l.movhi r1, hi(_tty) |
---|
| 22 | l.ori r1, r1, lo(_tty) |
---|
| 23 | l.sw 4(r1), r1 /* stop address */ |
---|
[100] | 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) |
---|
[101] | 31 | l.sw 4(r1), r0 /* stop address */ |
---|
[100] | 32 | |
---|
| 33 | |
---|
| 34 | /* ---[ 0x100: RESET exception ]----------------------------------------- */ |
---|
| 35 | .org 0x100 |
---|
| 36 | .global _start |
---|
| 37 | _start: |
---|
| 38 | |
---|
| 39 | /**********/ |
---|
| 40 | /* Test 1 */ |
---|
| 41 | /**********/ |
---|
| 42 | l.movhi r1, hi(0x12345678) /* RA */ |
---|
| 43 | l.ori r1, r1, lo(0x12345678) |
---|
| 44 | l.movhi r2, hi(0x00000078) /* RD wait */ |
---|
| 45 | l.ori r2, r2, lo(0x00000078) |
---|
| 46 | |
---|
| 47 | l.extbs r3, r1 |
---|
| 48 | |
---|
| 49 | /* Test result */ |
---|
| 50 | l.sfeq r3, r2 |
---|
| 51 | l.bnf _end_ko |
---|
| 52 | l.nop |
---|
| 53 | |
---|
| 54 | /**********/ |
---|
| 55 | /* Test 2 */ |
---|
| 56 | /**********/ |
---|
| 57 | l.movhi r1, hi(0xdeadbeef) /* RA */ |
---|
| 58 | l.ori r1, r1, lo(0xdeadbeef) |
---|
| 59 | l.movhi r2, hi(0xffffffef) /* RD wait */ |
---|
| 60 | l.ori r2, r2, lo(0xffffffef) |
---|
| 61 | |
---|
| 62 | l.extbs r3, r1 |
---|
| 63 | |
---|
| 64 | /* Test result */ |
---|
| 65 | l.sfeq r3, r2 |
---|
| 66 | l.bnf _end_ko |
---|
| 67 | l.nop |
---|
| 68 | |
---|
| 69 | /**********/ |
---|
| 70 | /* Test 3 */ |
---|
| 71 | /**********/ |
---|
| 72 | l.movhi r1, hi(0x12345678) /* RA */ |
---|
| 73 | l.ori r1, r1, lo(0x12345678) |
---|
| 74 | l.movhi r2, hi(0x00000078) /* RD wait */ |
---|
| 75 | l.ori r2, r2, lo(0x00000078) |
---|
| 76 | |
---|
| 77 | l.extbz r3, r1 |
---|
| 78 | |
---|
| 79 | /* Test result */ |
---|
| 80 | l.sfeq r3, r2 |
---|
| 81 | l.bnf _end_ko |
---|
| 82 | l.nop |
---|
| 83 | |
---|
| 84 | /**********/ |
---|
| 85 | /* Test 4 */ |
---|
| 86 | /**********/ |
---|
| 87 | l.movhi r1, hi(0xdeadbeef) /* RA */ |
---|
| 88 | l.ori r1, r1, lo(0xdeadbeef) |
---|
| 89 | l.movhi r2, hi(0x000000ef) /* RD wait */ |
---|
| 90 | l.ori r2, r2, lo(0x000000ef) |
---|
| 91 | |
---|
| 92 | l.extbz r3, r1 |
---|
| 93 | |
---|
| 94 | /* Test result */ |
---|
| 95 | l.sfeq r3, r2 |
---|
| 96 | l.bnf _end_ko |
---|
| 97 | l.nop |
---|
| 98 | |
---|
| 99 | /**********/ |
---|
| 100 | /* Test 5 */ |
---|
| 101 | /**********/ |
---|
| 102 | l.movhi r1, hi(0x12345678) /* RA */ |
---|
| 103 | l.ori r1, r1, lo(0x12345678) |
---|
| 104 | l.movhi r2, hi(0x00005678) /* RD wait */ |
---|
| 105 | l.ori r2, r2, lo(0x00005678) |
---|
| 106 | |
---|
| 107 | l.exths r3, r1 |
---|
| 108 | |
---|
| 109 | /* Test result */ |
---|
| 110 | l.sfeq r3, r2 |
---|
| 111 | l.bnf _end_ko |
---|
| 112 | l.nop |
---|
| 113 | |
---|
| 114 | /**********/ |
---|
| 115 | /* Test 6 */ |
---|
| 116 | /**********/ |
---|
| 117 | l.movhi r1, hi(0xdeadbeef) /* RA */ |
---|
| 118 | l.ori r1, r1, lo(0xdeadbeef) |
---|
| 119 | l.movhi r2, hi(0xffffbeef) /* RD wait */ |
---|
| 120 | l.ori r2, r2, lo(0xffffbeef) |
---|
| 121 | |
---|
| 122 | l.exths r3, r1 |
---|
| 123 | |
---|
| 124 | /* Test result */ |
---|
| 125 | l.sfeq r3, r2 |
---|
| 126 | l.bnf _end_ko |
---|
| 127 | l.nop |
---|
| 128 | |
---|
| 129 | /**********/ |
---|
| 130 | /* Test 7 */ |
---|
| 131 | /**********/ |
---|
| 132 | l.movhi r1, hi(0x12345678) /* RA */ |
---|
| 133 | l.ori r1, r1, lo(0x12345678) |
---|
| 134 | l.movhi r2, hi(0x00005678) /* RD wait */ |
---|
| 135 | l.ori r2, r2, lo(0x00005678) |
---|
| 136 | |
---|
| 137 | l.exthz r3, r1 |
---|
| 138 | |
---|
| 139 | /* Test result */ |
---|
| 140 | l.sfeq r3, r2 |
---|
| 141 | l.bnf _end_ko |
---|
| 142 | l.nop |
---|
| 143 | |
---|
| 144 | /**********/ |
---|
| 145 | /* Test 8 */ |
---|
| 146 | /**********/ |
---|
| 147 | l.movhi r1, hi(0xdeadbeef) /* RA */ |
---|
| 148 | l.ori r1, r1, lo(0xdeadbeef) |
---|
| 149 | l.movhi r2, hi(0x0000beef) /* RD wait */ |
---|
| 150 | l.ori r2, r2, lo(0x0000beef) |
---|
| 151 | |
---|
| 152 | l.exthz r3, r1 |
---|
| 153 | |
---|
| 154 | /* Test result */ |
---|
| 155 | l.sfeq r3, r2 |
---|
| 156 | l.bnf _end_ko |
---|
| 157 | l.nop |
---|
| 158 | |
---|
| 159 | /**********/ |
---|
| 160 | /* End */ |
---|
| 161 | /**********/ |
---|
| 162 | |
---|
| 163 | l.j _end_ok |
---|
| 164 | l.nop |
---|