- Using DSP instructions?
- 13 Sep 2015 03:09:16 pm
- Last edited by TeamFX on 20 Sep 2015 05:34:18 am; edited 1 time in total
DSP stands for Digital Signal Processing and DSP instructions are pretty powerful.
DSP can be enabled by writing 1 to bit 12 of SR (status register). If you don't do this, you'll get an "Illegal Code Err" message. X/Y memory is located at addresses 0xE5007000..0xE5008FFF (X) and 0xE5017000..0xE5018FFF (Y).
Yet, DSP support is not very useful at the moment:
- the GCC compiler doesn't generate any SH DSP instructions
- the IDA disassembler does not recognize them
- the Casio calculator OS is not using them
- the Casio SDKs do not provide a DSP library
Renesas' assemblers support it, but without any decent library functions, this is not very useful.
What does DSP assembly code look like?
Code:
These instructions don't do anything useful here but as you can see: There are 32-bit instructions and some of them take three arguments!
DSP can be enabled by writing 1 to bit 12 of SR (status register). If you don't do this, you'll get an "Illegal Code Err" message. X/Y memory is located at addresses 0xE5007000..0xE5008FFF (X) and 0xE5017000..0xE5018FFF (Y).
Yet, DSP support is not very useful at the moment:
- the GCC compiler doesn't generate any SH DSP instructions
- the IDA disassembler does not recognize them
- the Casio calculator OS is not using them
- the Casio SDKs do not provide a DSP library
Renesas' assemblers support it, but without any decent library functions, this is not very useful.
What does DSP assembly code look like?
Code:
.DATA.W h'82FF ; setrc #h'FF
.DATA.W h'0052 ; stc mod, r0
.DATA.W h'016A ; sts dsr, r1
.DATA.W h'416A ; lds r1, dsr
.DATA.L h'F800B107 ; padd x0, y0, a0
.DATA.L h'F800F90C ; pcopy y0, m0
.DATA.L h'F8008D0A ; pclr y0
.DATA.L h'F800ED07 ; plds a0, mach
These instructions don't do anything useful here but as you can see: There are 32-bit instructions and some of them take three arguments!