The @ acts like * in C; that is, it dereferences a pointer.
Bill
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video
Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
Reply by xtra...@yahoo.co.uk●February 15, 20082008-02-15
Dear all,
I am new to the group, In the part of my project(using TMS320VC33), I would
like to implement Sine function using lookup table in Assembly language.
the C source for sine function using lookup table is as follows:
************************************
signed int Sin(unsigned int phase)
{
const static S16 sin_table[66] {
0,804,1608,2410,3212,4011,4808,5602,
6393,7179,7962,8739,9512,10278,11039,11793,
12539,13279,14010,14732,15446,16151,16846,17530,
18204,18868,19519,20159,20787,21403,22005,22594,
23170,23731,24279,24811,25329,25832,26319,26790,
27245,27683,28105,28510,28898,29268,29621,29956,
30273,30571,30852,31113,31356,31580,31785,31971,
32137,32285,32412,32521,32609,32678,32728,32757,
32767,32757
};
return s0;
}
***************************
which is working fine.
I am trying to implement "C" source code(Sin function using lookup table) in
to TMS320VC33 Assembly language.
In the part of my implementation I was trying to access a table like below,
which was in a file as "sintb360.asm".
*******************************************
;Module definitions for external reference.
.def SINTAB_360
;==========================================================================;-------------------
; Sine look-up table
; No. Entries : 256
; Angle Range : 360 deg
; Number format : Q15 with range -1 < N < +1
;-------------------
.sect ".text"
my part of implementation is as follows,
;***********************************************************************;
;* *;
;* File Name : qsinlt.asm *;
;***********************************************************************;
.def _qsinlt
.global SINTAB_360
_qsinlt
PUSH AR3
LDIU SP,AR3
ADDI 3h,SP
LDIU 7fffh,R0
AND *-AR3(2),R0
STI R0,*+AR3(2)
LDIU 4000h,R0
TSTB *+AR3(2),R0
BZ L3
LDIU *+AR3(2),R0
SUBRI 8000h,R0
STI R0,*+AR3(2)
L3 LDIU *-AR3(2),R0
LSH -8,R0
STI R0,*+AR3(3)
LDI @SINTAB_360,AR0 <--------
LDIU *+AR3(3),IR0
LDIU *+AR0(IR0),R0
STI R0,*+AR3
LDIU *-AR3,R1
LDIU *AR3,AR3
SUBI 5h,SP
BU R1
But, the problem is I am not able to access the address of memory location of
Table, SINTAB_360 ( as shown in arrow)in AR0 register.When i try to read the
Index IR0, let us IR0P, element, AR0(IR0) is not displaying correct value while
debugging.
Is any one body can provide better solution, and solving this problem for
implementing this sin function using lookup table in Assembly language.
your help will greatly appreciated.
waiting for your messages and help,
regards,
Pydiraju
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video
Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467