[102] | 1 | /* |
---|
| 2 | * Test_027 |
---|
| 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.lhs (l.lhz) |
---|
| 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 | |
---|
| 41 | l.movhi r2, hi(0x1234beef) /* data */ |
---|
| 42 | l.ori r2, r2, lo(0x1234beef) |
---|
| 43 | l.movhi r4, hi(0x00001234) /* data */ |
---|
| 44 | l.ori r4, r4, lo(0x00001234) |
---|
| 45 | l.movhi r5, hi(0xffffbeef) /* data */ |
---|
| 46 | l.ori r5, r5, lo(0xffffbeef) |
---|
| 47 | |
---|
| 48 | /* 0x1234beef |
---|
| 49 | * | | | | |
---|
| 50 | * 0 : 0x12 <---+ | | | |
---|
| 51 | * 1 : 0x34 <-----+ | | |
---|
| 52 | * 2 : 0xbe <-------+ | |
---|
| 53 | * 3 : 0xef <---------+ |
---|
| 54 | */ |
---|
| 55 | |
---|
| 56 | l.sw - 0(r1), r2 |
---|
| 57 | |
---|
| 58 | /* 0x1234 |
---|
| 59 | * ^ ^ |
---|
| 60 | * | | |
---|
| 61 | * 0 : 0x12 --------+ | |
---|
| 62 | * 1 : 0x34 ----------+ |
---|
| 63 | * 2 : 0xbe |
---|
| 64 | * 3 : 0xef |
---|
| 65 | */ |
---|
| 66 | |
---|
| 67 | l.lhs r3, - 0(r1) |
---|
| 68 | l.sfeq r3, r4 |
---|
| 69 | l.bnf _end_ko |
---|
| 70 | l.nop |
---|
| 71 | |
---|
| 72 | /* 0xbeef |
---|
| 73 | * ^ ^ |
---|
| 74 | * | | |
---|
| 75 | * 0 : 0x12 | | |
---|
| 76 | * 1 : 0x34 | | |
---|
| 77 | * 2 : 0xbe --------+ | |
---|
| 78 | * 3 : 0xef ----------+ |
---|
| 79 | */ |
---|
| 80 | |
---|
| 81 | l.lhs r3, + 2(r1) |
---|
| 82 | l.sfeq r3, r5 |
---|
| 83 | l.bnf _end_ko |
---|
| 84 | l.nop |
---|
| 85 | |
---|
| 86 | l.movhi r2, hi(0xdead1981) /* data */ |
---|
| 87 | l.ori r2, r2, lo(0xdead1981) |
---|
| 88 | l.movhi r4, hi(0x0000dead) /* data */ |
---|
| 89 | l.ori r4, r4, lo(0x0000dead) |
---|
| 90 | l.movhi r5, hi(0x00001981) /* data */ |
---|
| 91 | l.ori r5, r5, lo(0x00001981) |
---|
| 92 | |
---|
| 93 | /* 0xdead1981 |
---|
| 94 | * | | | | |
---|
| 95 | * 0 : 0x12 <---+ | | | |
---|
| 96 | * 1 : 0x34 <-----+ | | |
---|
| 97 | * 2 : 0xbe <-------+ | |
---|
| 98 | * 3 : 0xef <---------+ |
---|
| 99 | */ |
---|
| 100 | |
---|
| 101 | l.sw - 0(r1), r2 |
---|
| 102 | |
---|
| 103 | /* 0xdead |
---|
| 104 | * ^ ^ |
---|
| 105 | * | | |
---|
| 106 | * 0 : 0x12 --------+ | |
---|
| 107 | * 1 : 0x34 ----------+ |
---|
| 108 | * 2 : 0xbe |
---|
| 109 | * 3 : 0xef |
---|
| 110 | */ |
---|
| 111 | |
---|
| 112 | l.lhz r3, - 0(r1) |
---|
| 113 | l.sfeq r3, r4 |
---|
| 114 | l.bnf _end_ko |
---|
| 115 | l.nop |
---|
| 116 | |
---|
| 117 | /* 0x1981 |
---|
| 118 | * ^ ^ |
---|
| 119 | * | | |
---|
| 120 | * 0 : 0x12 | | |
---|
| 121 | * 1 : 0x34 | | |
---|
| 122 | * 2 : 0xbe --------+ | |
---|
| 123 | * 3 : 0xef ----------+ |
---|
| 124 | */ |
---|
| 125 | |
---|
| 126 | l.lhz r3, + 2(r1) |
---|
| 127 | l.sfeq r3, r5 |
---|
| 128 | l.bnf _end_ko |
---|
| 129 | l.nop |
---|
| 130 | |
---|
| 131 | /* end test */ |
---|
| 132 | l.j _end_ok |
---|
| 133 | l.nop |
---|