[102] | 1 | /* |
---|
| 2 | * Test_046 |
---|
| 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.sw / l.lws (l.lwz) |
---|
| 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 | l.movhi r1, hi(_stack) /* address */ |
---|
| 39 | l.ori r1, r1, lo(_stack) |
---|
| 40 | |
---|
[106] | 41 | l.movhi r2, hi(0x0000002) /* iteration */ |
---|
| 42 | l.ori r2, r2, lo(0x0000002) |
---|
[102] | 43 | |
---|
| 44 | l.movhi r3, hi(0xdeadbeef) /* data */ |
---|
| 45 | l.ori r3, r3, lo(0xdeadbeef) |
---|
| 46 | |
---|
| 47 | l.and r21, r1, r1 |
---|
| 48 | l.j _loop1_store_test |
---|
| 49 | l.and r22, r0, r0 |
---|
| 50 | _loop1_store_body : |
---|
| 51 | l.sw 0(r21), r3 |
---|
| 52 | l.addi r21, r21, -4 |
---|
| 53 | l.addi r3, r3, 1 |
---|
| 54 | _loop1_store_test : |
---|
| 55 | l.sfeq r22, r2 |
---|
| 56 | l.bnf _loop1_store_body |
---|
| 57 | l.addi r22, r22, 1 |
---|
| 58 | |
---|
| 59 | /* load Zero */ |
---|
| 60 | l.movhi r3, hi(0xdeadbeef) /* data */ |
---|
| 61 | l.ori r3, r3, lo(0xdeadbeef) |
---|
| 62 | |
---|
| 63 | l.and r21, r1, r1 |
---|
| 64 | l.j _loop1_loadz_test |
---|
| 65 | l.and r22, r0, r0 |
---|
| 66 | _loop1_loadz_body : |
---|
| 67 | l.lwz r4, 0(r21) |
---|
| 68 | l.addi r21, r21, -4 |
---|
| 69 | l.sfeq r4, r3 |
---|
| 70 | l.bnf _end_ko |
---|
| 71 | l.addi r3, r3, 1 |
---|
| 72 | _loop1_loadz_test : |
---|
| 73 | l.sfeq r22, r2 |
---|
| 74 | l.bnf _loop1_loadz_body |
---|
| 75 | l.addi r22, r22, 1 |
---|
| 76 | |
---|
| 77 | /* load Signed */ |
---|
| 78 | l.movhi r3, hi(0xdeadbeef) /* data */ |
---|
| 79 | l.ori r3, r3, lo(0xdeadbeef) |
---|
| 80 | |
---|
| 81 | l.and r21, r1, r1 |
---|
| 82 | l.j _loop1_loads_test |
---|
| 83 | l.and r22, r0, r0 |
---|
| 84 | _loop1_loads_body : |
---|
| 85 | l.lws r4, 0(r21) |
---|
| 86 | l.addi r21, r21, -4 |
---|
| 87 | l.sfeq r4, r3 |
---|
| 88 | l.bnf _end_ko |
---|
| 89 | l.addi r3, r3, 1 |
---|
| 90 | _loop1_loads_test : |
---|
| 91 | l.sfeq r22, r2 |
---|
| 92 | l.bnf _loop1_loads_body |
---|
| 93 | l.addi r22, r22, 1 |
---|
| 94 | |
---|
| 95 | l.movhi r3, hi(0x12345678) /* data */ |
---|
| 96 | l.ori r3, r3, lo(0x12345678) |
---|
| 97 | |
---|
| 98 | l.and r21, r1, r1 |
---|
| 99 | l.j _loop2_store_test |
---|
| 100 | l.and r22, r0, r0 |
---|
| 101 | _loop2_store_body : |
---|
| 102 | l.sw 0(r21), r3 |
---|
| 103 | l.addi r21, r21, -4 |
---|
| 104 | l.addi r3, r3, 1 |
---|
| 105 | _loop2_store_test : |
---|
| 106 | l.sfeq r22, r2 |
---|
| 107 | l.bnf _loop2_store_body |
---|
| 108 | l.addi r22, r22, 1 |
---|
| 109 | |
---|
| 110 | /* load Zero */ |
---|
| 111 | l.movhi r3, hi(0x12345678) /* data */ |
---|
| 112 | l.ori r3, r3, lo(0x12345678) |
---|
| 113 | |
---|
| 114 | l.and r21, r1, r1 |
---|
| 115 | l.j _loop2_loadz_test |
---|
| 116 | l.and r22, r0, r0 |
---|
| 117 | _loop2_loadz_body : |
---|
| 118 | l.lwz r4, 0(r21) |
---|
| 119 | l.addi r21, r21, -4 |
---|
| 120 | l.sfeq r4, r3 |
---|
| 121 | l.bnf _end_ko |
---|
| 122 | l.addi r3, r3, 1 |
---|
| 123 | _loop2_loadz_test : |
---|
| 124 | l.sfeq r22, r2 |
---|
| 125 | l.bnf _loop2_loadz_body |
---|
| 126 | l.addi r22, r22, 1 |
---|
| 127 | |
---|
| 128 | /* load Signed */ |
---|
| 129 | l.movhi r3, hi(0x12345678) /* data */ |
---|
| 130 | l.ori r3, r3, lo(0x12345678) |
---|
| 131 | |
---|
| 132 | l.and r21, r1, r1 |
---|
| 133 | l.j _loop2_loads_test |
---|
| 134 | l.and r22, r0, r0 |
---|
| 135 | _loop2_loads_body : |
---|
| 136 | l.lws r4, 0(r21) |
---|
| 137 | l.addi r21, r21, -4 |
---|
| 138 | l.sfeq r4, r3 |
---|
| 139 | l.bnf _end_ko |
---|
| 140 | l.addi r3, r3, 1 |
---|
| 141 | _loop2_loads_test : |
---|
| 142 | l.sfeq r22, r2 |
---|
| 143 | l.bnf _loop2_loads_body |
---|
| 144 | l.addi r22, r22, 1 |
---|
| 145 | |
---|
| 146 | /* end test */ |
---|
| 147 | l.j _end_ok |
---|
| 148 | l.nop |
---|