| 1 |
incdir "tests" |
| 2 |
include "dsp_base.inc" |
| 3 |
|
| 4 |
test_main: |
| 5 |
; Test what happens various values are written to every register |
| 6 |
LRI $ar0, #0xffff |
| 7 |
CALL set_all_regs |
| 8 |
CALL send_back |
| 9 |
|
| 10 |
LRI $ar0, #0x0000 |
| 11 |
CALL set_all_regs |
| 12 |
CALL send_back |
| 13 |
|
| 14 |
LRI $ar0, #0x007f |
| 15 |
CALL set_all_regs |
| 16 |
CALL send_back |
| 17 |
|
| 18 |
LRI $ar0, #0x0080 |
| 19 |
CALL set_all_regs |
| 20 |
CALL send_back |
| 21 |
|
| 22 |
LRI $ar0, #0x0100 |
| 23 |
CALL set_all_regs |
| 24 |
CALL send_back |
| 25 |
|
| 26 |
; We're done, DO NOT DELETE THIS LINE |
| 27 |
JMP end_of_test |
| 28 |
|
| 29 |
; Copy $ar0 to all other registers |
| 30 |
set_all_regs: |
| 31 |
SET16 |
| 32 |
MRR $ar1, $ar0 |
| 33 |
MRR $ar2, $ar0 |
| 34 |
MRR $ar3, $ar0 |
| 35 |
MRR $ix0, $ar0 |
| 36 |
MRR $ix1, $ar0 |
| 37 |
MRR $ix2, $ar0 |
| 38 |
MRR $ix3, $ar0 |
| 39 |
MRR $wr0, $ar0 |
| 40 |
MRR $wr1, $ar0 |
| 41 |
MRR $wr2, $ar0 |
| 42 |
MRR $wr3, $ar0 |
| 43 |
; Don't write to the stacks; returning from this function breaks otherwise |
| 44 |
; They don't show up in DSPSpy anyways |
| 45 |
;MRR $st0, $ar0 |
| 46 |
;MRR $st1, $ar0 |
| 47 |
;MRR $st2, $ar0 |
| 48 |
;MRR $st3, $ar0 |
| 49 |
MRR $ac0.h, $ar0 |
| 50 |
MRR $ac1.h, $ar0 |
| 51 |
MRR $cr, $ar0 |
| 52 |
; Wait to set $sr, as it can change the way stores work |
| 53 |
MRR $prod.l, $ar0 |
| 54 |
MRR $prod.m1, $ar0 |
| 55 |
MRR $prod.h, $ar0 |
| 56 |
MRR $prod.m2, $ar0 |
| 57 |
MRR $ax0.l, $ar0 |
| 58 |
MRR $ax1.l, $ar0 |
| 59 |
MRR $ax0.h, $ar0 |
| 60 |
MRR $ax1.h, $ar0 |
| 61 |
MRR $ac0.l, $ar0 |
| 62 |
MRR $ac1.l, $ar0 |
| 63 |
MRR $ac0.m, $ar0 |
| 64 |
MRR $ac1.m, $ar0 |
| 65 |
MRR $sr, $ar0 |
| 66 |
RET |