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

📄 fir.txt

📁 TMS320C3X 汇编语言程序编译环境
💻 TXT
字号:

         .globl FIR ; Entry point for execution

         .global start,INIT,BEGIN

         .data
MASK     .word 0FFFFFFFFH
BLK0     .word 0809800H ; 片内1K×32bit RAM块0起始地址
BLK1     .word 0809C00H ; 片内1K×32bit RAM块1起始地址
STCK     .word 0809F00H ; 堆栈起始地址
CTRL     .word 0808000H ; Pointer for peripheral±bus memory map
DMACTL   .word 0000000H ; Init for DMA control (0)
TIM0CTL  .word 0000000H ; Init of timer 0 control (32)
TIM1CTL  .word 0000000H ; Init of timer 1 control (48)
SERGLOB0 .word 0000000H ; Init of serial 0 glbl control (64)
SERPRTX0 .word 0000000H ; Init of serial 0 xmt port control (66)
SERPRTR0 .word 0000000H ; Init of serial 0 rcv port control (67)
SERTIM0  .word 0000000H ; Init of serial 0 timer control (68)
SERGLOB1 .word 0000000H ; Init of serial 1 glbl control (80)
SERPRTX1 .word 0000000H ; Init of serial 1 xmt port control (82)
SERPRTR1 .word 0000000H ; Init of serial 1 rcv port control (83)
SERTIM1  .word 0000000H ; Init of serial 1 timer control (84)
PARINT   .word 0000000H ; Init of parallel interface control (100)
IOINT    .word 0000000H ; Init of I/O interface control (96)


         .sect "vectors"; Named section 
start    .word INIT ; load address INIT to PC
         .space 191 ; Reserved space
INPUT    .WORD INP
OUTPUT   .WORD OUT
         .text
INIT:    LDP 0,DP ; Point the DP register to page 0
         LDI 1800H,ST ; Clear and enable cache, and disable OVM
         LDI @MASK,IE ; Unmask all interrupts
         LDI @BLK0,AR0 ; AR0 points to block 0
         LDI @BLK1,AR1 ; AR1 points to block 1
         LDF 0.0,R0    ; 0 register R0
         RPTS 1023 ; Repeat 1024 times ...
         STF R0,*AR0++(1) ; Zero out location in RAM block 0 and ...
      || STF R0,*AR1++(1) ; Zero out location in RAM block 1
         LDI @CTRL,AR0 ; Load in AR0 the pointer to control registers
	  LDI @DMACTL,R0
	  STI R0,*+AR0(0) ; Init DMA control
	  LDI @TIM0CTL,R0
	  STI R0,*+AR0(32) ; Init timer 0 control
	  LDI @TIM1CTL,R0
	  STI R0,*+AR0(48) ; Init timer 1 control
	  LDI @SERGLOB0,R0
	  STI R0,*+AR0(64) ; Init serial 0 global control
	  LDI @SERPRTX0,R0
	  STI R0,*+AR0(66) ; Init serial 0 xmt control
	  LDI @SERPRTR0,R0
	  STI R0,*+AR0(67) ; Init serial 0 rcv control
	  LDI @SERTIM0,R0
	  STI R0,*+AR0(68) ; Init serial 0 timer control
	  LDI @SERGLOB1,R0
	  STI R0,*+AR0(80) ; Init serial 1 global control
	  LDI @SERPRTX1,R0
	  STI R0,*+AR0(82) ; Init serial 1 xmt control
	  LDI @SERPRTR1,R0
	  STI R0,*+AR0(83) ; Init serial 1 rcv control
	  LDI @SERTIM1,R0
	  STI R0,*+AR0(84) ; Init serial 1 timer control
	  LDI @PARINT,R0
	  STI R0,*+AR0(100) ; Init parallel interface control (C30 only)
	  LDI @IOINT,R0
	  STI R0,*+AR0(96) ; Init I/O interface control
	  LDI @STCK,SP ; Init the stack pointer
         OR  2000H,ST ; Global interrupt enable
   

          LDI 1,R0
          LDI 3,R1
          LDI @INPUT,AR0 
	   ADDI 8,AR0
          LDI @INPUT,AR1     
          ADDI 9,AR1
          LDI 5,RC
          LDI 2,IR0
          RPTS
D_IN:     STF R0,*AR0++(IR0) ;init x[e]  
      ||  STF R1,*AR1++(IR0) ;init x[o]

          LDI @AK,AR1        ;POINTS TO ak
	   LDI @INPUT,AR0     ;POINTS TO X
          LDI @OUTPUT,AR3
	   LDI @AK,AR1
          LDI 21,AR5
	   LDI 0,AR4 
          LDI 9,BK
          LDI 8,RC
          RPTB LOO
          LDF 0.0,R2
          MPYF3 *AR0++(1),*AR1++(1)%,R0
     ||   ADDF3 R0,R2,R2  
LOO:      STF R2,*AR3++
          ADDI 1,AR4 
	   CMPI AR4,AR5
          BLED INLOO
	   NOP
	   NOP 
          BR  $; Branch to itself at the end

        .data
AK	
       .float  0.3
       .float  0.3
       .float  0.3
       .float  0.3
       .float  0.3
       .float  0.3
       .float  0.3
       .float  0.3
       .float  0.3
INP 	.usect "IN",29 ; Memory with input data
OUP    .usect "OUT",21
	.end






⌨️ 快捷键说明

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