[100] | 1 | /* |
---|
| 2 | * Test_012 |
---|
| 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.addic |
---|
| 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 | A (r1) B (I) - D (r3 wait)CY OV (SR = r6, mask SR = r5) |
---|
| 40 | (r4) (r7) |
---|
| 41 | 1) 0x00000000 0x0000 - 0x00000000 0 0 |
---|
| 42 | 2) 0x14011959 0x1959 - 0x140132b2 0 0 |
---|
| 43 | 3) 0xebfee6a7 0xe6a7 - 0xebfecd4e 1 0 |
---|
| 44 | 4) 0xebfee6a7 0x1959 - 0xebff0001 0 0 |
---|
| 45 | 5) 0x14011959 0xe6a7 - 0x14010000 1 0 |
---|
| 46 | 6) 0x87654321 0xabcd - 0x8764eeef 1 0 |
---|
| 47 | 7) 0x7fffffff 0x5432 - 0x80005432 0 1 |
---|
| 48 | */ |
---|
| 49 | |
---|
| 50 | /* Mask to read OV (SR[11]), CY (SR[10]) and not F (SR[9]) */ |
---|
| 51 | l.movhi r5, hi(0x00000c00) |
---|
| 52 | l.ori r5, r5, lo(0x00000c00) |
---|
| 53 | |
---|
| 54 | /**********/ |
---|
| 55 | /* Test 1 */ |
---|
| 56 | /**********/ |
---|
| 57 | l.movhi r1, hi(0x00000000) /* RA */ |
---|
| 58 | l.ori r1, r1, lo(0x00000000) |
---|
| 59 | l.movhi r3, hi(0x00000000) /* RD wait */ |
---|
| 60 | l.ori r3, r3, lo(0x00000000) |
---|
| 61 | l.movhi r6, hi(0x00000000) /* SR wait */ |
---|
| 62 | l.ori r6, r6, lo(0x00000000) |
---|
| 63 | |
---|
| 64 | l.addic r4, r1, 0x0000 |
---|
| 65 | |
---|
| 66 | /* Test flag */ |
---|
| 67 | l.mfspr r7, r0, 17 |
---|
| 68 | l.and r7, r7, r5 |
---|
| 69 | |
---|
| 70 | l.sfeq r6, r7 |
---|
| 71 | l.bnf _end_ko |
---|
| 72 | l.nop |
---|
| 73 | |
---|
| 74 | /* Test result */ |
---|
| 75 | l.sfeq r3, r4 |
---|
| 76 | l.bnf _end_ko |
---|
| 77 | l.nop |
---|
| 78 | |
---|
| 79 | /**********/ |
---|
| 80 | /* Test 2 */ |
---|
| 81 | /**********/ |
---|
| 82 | l.movhi r1, hi(0x14011959) /* RA */ |
---|
| 83 | l.ori r1, r1, lo(0x14011959) |
---|
| 84 | l.movhi r3, hi(0x140132b2) /* RD wait */ |
---|
| 85 | l.ori r3, r3, lo(0x140132b2) |
---|
| 86 | l.movhi r6, hi(0x00000000) /* SR wait */ |
---|
| 87 | l.ori r6, r6, lo(0x00000000) |
---|
| 88 | |
---|
| 89 | l.addic r4, r1, 0x1959 |
---|
| 90 | |
---|
| 91 | /* Test flag */ |
---|
| 92 | l.mfspr r7, r0, 17 |
---|
| 93 | l.and r7, r7, r5 |
---|
| 94 | |
---|
| 95 | l.sfeq r6, r7 |
---|
| 96 | l.bnf _end_ko |
---|
| 97 | l.nop |
---|
| 98 | |
---|
| 99 | /* Test result */ |
---|
| 100 | l.sfeq r3, r4 |
---|
| 101 | l.bnf _end_ko |
---|
| 102 | l.nop |
---|
| 103 | |
---|
| 104 | /**********/ |
---|
| 105 | /* Test 3 */ |
---|
| 106 | /**********/ |
---|
| 107 | l.movhi r1, hi(0xebfee6a7) /* RA */ |
---|
| 108 | l.ori r1, r1, lo(0xebfee6a7) |
---|
| 109 | l.movhi r3, hi(0xebfecd4e) /* RD wait */ |
---|
| 110 | l.ori r3, r3, lo(0xebfecd4e) |
---|
| 111 | l.movhi r6, hi(0x00000400) /* SR wait */ |
---|
| 112 | l.ori r6, r6, lo(0x00000400) |
---|
| 113 | |
---|
| 114 | l.addic r4, r1, 0xe6a7 |
---|
| 115 | |
---|
| 116 | /* Test flag */ |
---|
| 117 | l.mfspr r7, r0, 17 |
---|
| 118 | l.and r7, r7, r5 |
---|
| 119 | |
---|
| 120 | l.sfeq r6, r7 |
---|
| 121 | l.bnf _end_ko |
---|
| 122 | l.nop |
---|
| 123 | |
---|
| 124 | /* Test result */ |
---|
| 125 | l.sfeq r3, r4 |
---|
| 126 | l.bnf _end_ko |
---|
| 127 | l.nop |
---|
| 128 | |
---|
| 129 | /**********/ |
---|
| 130 | /* Test 4 */ |
---|
| 131 | /**********/ |
---|
| 132 | l.movhi r1, hi(0xebfee6a7) /* RA */ |
---|
| 133 | l.ori r1, r1, lo(0xebfee6a7) |
---|
| 134 | l.movhi r3, hi(0xebff0001) /* RD wait */ |
---|
| 135 | l.ori r3, r3, lo(0xebff0001) |
---|
| 136 | l.movhi r6, hi(0x00000000) /* SR wait */ |
---|
| 137 | l.ori r6, r6, lo(0x00000000) |
---|
| 138 | |
---|
| 139 | l.addic r4, r1, 0x1959 |
---|
| 140 | |
---|
| 141 | /* Test flag */ |
---|
| 142 | l.mfspr r7, r0, 17 |
---|
| 143 | l.and r7, r7, r5 |
---|
| 144 | |
---|
| 145 | l.sfeq r6, r7 |
---|
| 146 | l.bnf _end_ko |
---|
| 147 | l.nop |
---|
| 148 | |
---|
| 149 | /* Test result */ |
---|
| 150 | l.sfeq r3, r4 |
---|
| 151 | l.bnf _end_ko |
---|
| 152 | l.nop |
---|
| 153 | |
---|
| 154 | /**********/ |
---|
| 155 | /* Test 5 */ |
---|
| 156 | /**********/ |
---|
| 157 | l.movhi r1, hi(0x14011959) /* RA */ |
---|
| 158 | l.ori r1, r1, lo(0x14011959) |
---|
| 159 | l.movhi r3, hi(0x14010000) /* RD wait */ |
---|
| 160 | l.ori r3, r3, lo(0x14010000) |
---|
| 161 | l.movhi r6, hi(0x00000400) /* SR wait */ |
---|
| 162 | l.ori r6, r6, lo(0x00000400) |
---|
| 163 | |
---|
| 164 | l.addic r4, r1, 0xe6a7 |
---|
| 165 | |
---|
| 166 | /* Test flag */ |
---|
| 167 | l.mfspr r7, r0, 17 |
---|
| 168 | l.and r7, r7, r5 |
---|
| 169 | |
---|
| 170 | l.sfeq r6, r7 |
---|
| 171 | l.bnf _end_ko |
---|
| 172 | l.nop |
---|
| 173 | |
---|
| 174 | /* Test result */ |
---|
| 175 | l.sfeq r3, r4 |
---|
| 176 | l.bnf _end_ko |
---|
| 177 | l.nop |
---|
| 178 | |
---|
| 179 | /**********/ |
---|
| 180 | /* Test 6 */ |
---|
| 181 | /**********/ |
---|
| 182 | l.movhi r1, hi(0x87654321) /* RA */ |
---|
| 183 | l.ori r1, r1, lo(0x87654321) |
---|
| 184 | l.movhi r3, hi(0x8764eeef) /* RD wait */ |
---|
| 185 | l.ori r3, r3, lo(0x8764eeef) |
---|
| 186 | l.movhi r6, hi(0x00000400) /* SR wait */ |
---|
| 187 | l.ori r6, r6, lo(0x00000400) |
---|
| 188 | |
---|
| 189 | l.addic r4, r1, 0xabcd |
---|
| 190 | |
---|
| 191 | /* Test flag */ |
---|
| 192 | l.mfspr r7, r0, 17 |
---|
| 193 | l.and r7, r7, r5 |
---|
| 194 | |
---|
| 195 | l.sfeq r6, r7 |
---|
| 196 | l.bnf _end_ko |
---|
| 197 | l.nop |
---|
| 198 | |
---|
| 199 | /* Test result */ |
---|
| 200 | l.sfeq r3, r4 |
---|
| 201 | l.bnf _end_ko |
---|
| 202 | l.nop |
---|
| 203 | |
---|
| 204 | /**********/ |
---|
| 205 | /* Test 7 */ |
---|
| 206 | /**********/ |
---|
| 207 | l.movhi r1, hi(0x7fffffff) /* RA */ |
---|
| 208 | l.ori r1, r1, lo(0x7fffffff) |
---|
| 209 | l.movhi r3, hi(0x80005432) /* RD wait */ |
---|
| 210 | l.ori r3, r3, lo(0x80005432) |
---|
| 211 | l.movhi r6, hi(0x00000800) /* SR wait */ |
---|
| 212 | l.ori r6, r6, lo(0x00000800) |
---|
| 213 | |
---|
| 214 | l.addic r4, r1, 0x5432 |
---|
| 215 | |
---|
| 216 | /* Test flag */ |
---|
| 217 | l.mfspr r7, r0, 17 |
---|
| 218 | l.and r7, r7, r5 |
---|
| 219 | |
---|
| 220 | l.sfeq r6, r7 |
---|
| 221 | l.bnf _end_ko |
---|
| 222 | l.nop |
---|
| 223 | |
---|
| 224 | /* Test result */ |
---|
| 225 | l.sfeq r3, r4 |
---|
| 226 | l.bnf _end_ko |
---|
| 227 | l.nop |
---|
| 228 | |
---|
| 229 | /**********/ |
---|
| 230 | /* End */ |
---|
| 231 | /**********/ |
---|
| 232 | |
---|
| 233 | l.j _end_ok |
---|
| 234 | l.nop |
---|