2009-06-21 11:46:27 +00:00
|
|
|
; This test tries to figure out a couple of unknown opcodes.
|
|
|
|
incdir "tests"
|
|
|
|
include "dsp_base.inc"
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2009-06-21 11:46:27 +00:00
|
|
|
// 0x02ca is an unknown opcode found in Zelda ucodes.
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2009-06-21 11:46:27 +00:00
|
|
|
// 0x02ca logically shifts (not rotates) the whole ACC0 right by signed 16-bit value AC1.M
|
|
|
|
// (So, if AC1.M is negative, it shifts left).
|
|
|
|
// We'll call it lsrn, no arguments.
|
|
|
|
// 0x02cb is the same opcode, but arithmetic.
|
|
|
|
// We'll call it asrn, no arguments.
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2021-08-15 22:26:03 +00:00
|
|
|
test_main:
|
2009-06-21 11:46:27 +00:00
|
|
|
clr $ACC0
|
|
|
|
clr $ACC1
|
|
|
|
lri $AC0.H, #0
|
|
|
|
lri $AC0.M, #256
|
|
|
|
//neg $ACC0
|
|
|
|
lri $AC0.L, #1
|
|
|
|
lri $AC1.H, #0xFF
|
|
|
|
lri $AC1.M, #1
|
|
|
|
lri $AC1.L, #0xFF
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2009-06-21 11:46:27 +00:00
|
|
|
call send_back
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2009-06-21 11:46:27 +00:00
|
|
|
cw 0x02ca
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2009-06-21 11:46:27 +00:00
|
|
|
call send_back
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2009-06-21 11:46:27 +00:00
|
|
|
cw 0x02ca
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2009-06-21 11:46:27 +00:00
|
|
|
call send_back
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2009-06-21 11:46:27 +00:00
|
|
|
cw 0x02ca
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2009-06-21 11:46:27 +00:00
|
|
|
call send_back
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2009-06-21 11:46:27 +00:00
|
|
|
cw 0x02ca
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2009-06-21 11:46:27 +00:00
|
|
|
call send_back
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2009-06-21 11:46:27 +00:00
|
|
|
jmp end_of_test
|