⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 init-c26.asm

📁 DSP常用例程
💻 ASM
字号:
;
;  file: d:\fft2x\INIT-c26.ASM is the initialisation for 512 point fft 320c26
;
;  Update: 10. July 90 / Manfred Christ / Texas Instruments - Freising
;
         .mmregs
         .def    N,divid
         .sect "vectors"
         B       INIT,*,AR0
         .sect   "init"
;
         .bss    NN,1             ; number of fft-points
         .bss    DATAADD,1        ; START ADDRESS OF DATA
         .bss    DATA2,1          ; DATA+2
         .bss    DATA4,1          ; DATA+4
         .bss    DATA6,1          ; DATA+6
         .bss    DATA8,1          ; DATA+8
         .bss    DATA16,1         ; DATA+16
TABINIT: .word   N,DATA,DATA+2,DATA+4,DATA+6,DATA+8,DATA+16

; stage 3 and 4 costants
SINES4   .set    TWID1            ; start of sine in stage 4
         .word   5A82h                  ; cos(45)=sin(45)
         .word   SINES4,SINES4+4
         .bss    cos45,1          ; sine/cosine in stage 3
         .bss    sin4,1           ; start of sine in stage    4
         .bss    cos4,1           ; start of cosine in stage  4

         .def    STAGE5,SINES5
SINES5   .set    SINES4+11        ; start of sine in stage 5
         .word   DATA+32,SINES5,SINES5+8
         .bss    DATA32,1         ; DATA+32
         .bss    sin5,1           ; start of sine in stage    5
         .bss    cos5,1           ; start of cosine in stage  5

         .def    STAGE6,SINES6
SINES6   .set    SINES5+23        ; start of sine in stage 6
         .word   DATA+64,SINES6,SINES6+16
         .bss    DATA64,1         ; DATA+64
         .bss    sin6,1           ; start of sine in stage    6
         .bss    cos6,1           ; start of cosine in stage  6

         .def    STAGE7,SINES7
SINES7   .set    SINES6+47        ; start of sine in stage 7
         .word   DATA+128,SINES7,SINES7+32
         .bss    DATA128,1        ; DATA+128
         .bss    sin7,1           ; start of sine in stage    7
         .bss    cos7,1           ; start of cosine in stage  7

         .def    STAGE8,SINES8
SINES8   .set    SINES7+95        ; start of sine in stage 8
         .word   DATA+256,SINES8,SINES8+64
         .bss    DATA256,1        ; DATA+256
         .bss    sin8,1           ; start of sine in stage    8
         .bss    cos8,1           ; start of cosine in stage  8

         .def    STAGE9,SINES9
SINES9   .set    TWID2            ; start of sine in stage 9
         .word   DATA+512,SINES9,SINES9+128,256
         .bss    DATA512,1        ; DATA+512
         .bss    sin9,1           ; start of sine in stage    9
         .bss    cos9,1           ; start of cosine in stage  9
         .bss    v256,1           ; value=256

TABEND:  .set    $
;
;  Temp variables
;
         .bss    sine,1           ; sine value
         .bss    cosine,1         ; cosine value
         .bss    TEMP,2           ; used for temporary numbers
;
INIT:    LDP     #0              ; use only B2 and mmregs for direct addressing
         SPM     0               ; no shift from PREG to ALU
         ROVM                    ; disable overflowmode
         SSXM                    ; enable sign extension mode
;
; INIT Block B2
;
         LAR     AR0,#NN         ; arp is already pointing to ar0
         LACC    #TABINIT
         RPT     #TABEND-TABINIT
         TBLR    *+
;
; INIT TWIDDLE FACTORS
;
         LAR     AR0,#TWID1      ; arp is already pointing to ar0
         LACC    #TWIDSTRT
         LAR     ar1,#16eh       ; 16fh values
TWIDL1   tblr    *+,ar1          ; transfer a word
         addk    1               ; accu =+1
         banz    TWIDL1,*-,ar0
;
         LAR     ar1,#TWIDLEN-16eh ; values
         LAR     AR0,#TWID2      ; arp is already pointing to ar0
TWIDL2   tblr    *+,ar1          ; transfer a word
         addk    1               ; accu =+1
         banz    TWIDL2,*-,ar0
;
; EXECUTE THE FFT
;
         LAR     AR5,#TEMP       ; pointer to 2 temp register
         CALL    FFT,*,AR3       ; ARP=AR3 FOR MACRO COMBO
;
WAIT     B       WAIT            ; THE SIMULATOR STOPS HERE
;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -