| 1 |
; This test tries to figure out a couple of unknown opcodes. |
| 2 |
incdir "tests" |
| 3 |
include "dsp_base.inc" |
| 4 |
|
| 5 |
// 0x02ca is an unknown opcode found in Zelda ucodes. |
| 6 |
|
| 7 |
// 0x02ca logically shifts (not rotates) the whole ACC0 right by signed 16-bit value AC1.M |
| 8 |
// (So, if AC1.M is negative, it shifts left). |
| 9 |
// We'll call it lsrn, no arguments. |
| 10 |
// 0x02cb is the same opcode, but arithmetic. |
| 11 |
// We'll call it asrn, no arguments. |
| 12 |
|
| 13 |
test_main: |
| 14 |
clr $ACC0 |
| 15 |
clr $ACC1 |
| 16 |
lri $AC0.H, #0 |
| 17 |
lri $AC0.M, #256 |
| 18 |
//neg $ACC0 |
| 19 |
lri $AC0.L, #1 |
| 20 |
lri $AC1.H, #0xFF |
| 21 |
lri $AC1.M, #1 |
| 22 |
lri $AC1.L, #0xFF |
| 23 |
|
| 24 |
call send_back |
| 25 |
|
| 26 |
cw 0x02ca |
| 27 |
|
| 28 |
call send_back |
| 29 |
|
| 30 |
cw 0x02ca |
| 31 |
|
| 32 |
call send_back |
| 33 |
|
| 34 |
cw 0x02ca |
| 35 |
|
| 36 |
call send_back |
| 37 |
|
| 38 |
cw 0x02ca |
| 39 |
|
| 40 |
call send_back |
| 41 |
|
| 42 |
jmp end_of_test |