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

📄 q15toq0.lst

📁 TI的digital motor control lib的源代码。了解TI的编程规范
💻 LST
字号:
C:\TIC2XX\C2000\CGTOOLS\BIN\DSPA.EXE -q -v2xx -gs q15toq0.asm -o ..\obj\q15toq0.obj -l ..\temp\q15toq0.lst 

TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00  Tue May  6 12:41:09 2003
Copyright (c) 1987-1999  Texas Instruments Incorporated 
q15toq0.asm                                                          PAGE    1

       1            ;=====================================================================================
       2            ; File name:        Q15TOQ0.ASM                    
       3            ;                    
       4            ; Originator:   Digital Control Systems Group
       5            ;                       Texas Instruments
       6            ;
       7            ; Description:                                 
       8            ; Convert Q15 number to the Q0 number by the following formular:
       9            ;                  Q0 = Q15*scaler 
      10            ; where scaler is the Q0 number.
      11            ;=====================================================================================
      12            ; History:
      13            ;-------------------------------------------------------------------------------------
      14            ; 9-15-2000     Release Rev 1.0
      15            ;================================================================================
      16            ; Applicability: F240,F241,C242,F243,F24xx.  (Peripheral Independent).
      17            ;================================================================================
      18            ; Routine Name: Q Converter                            Routine Type: C Callable
      19            ;
      20            ;
      21            ;  C prototype : int q15toq0(int q15,int scale);  
      22            ;================================================================================
      23            ;
      24            ;        Frame Usage Details:
      25            ;     step   |      a      |      b       |      c      |     d     
      26            ;____________|_____________|______________|_____________|_____________
      27            ;     FR0        |   scaler    |      q0      |             |     
      28            ;
      29            ;================================================================================
      30                            .def        _q15toq0
      31            ;================================================================================
      32      0001  __q15toq0_framesize     .set 0001h
      33            ;================================================================================
      34 0000       _q15toq0:            
      35 0000 8aa0          POPD    *+                                                                      ; Keep return address
      36 0001 80a0          SAR     AR0,*+                                                          ; Keep old frame pointer (FP)
      37 0002 8180          SAR     AR1,*                                                           ; Keep old stack pointer (SP)
      38 0003 b001          LARK    AR0,__q15toq0_framesize                         ; Load AR0 with frame size      
      39 0004 00e8          LAR     AR0,*0+,AR0                                                     ; AR0->FP0 (new FP), ARP=AR0
      40            ;================================================================================
      41 0005 7c03          SBRK    #3              ; ARP=AR0, AR0->FR0-3 (1st argument)    
      42            ;----------------------------------------------------------------------------------
      43 0006 be47                  SETC    SXM             ; Turn sign extension mode on
      44                                                            ; ARP=AR0, AR0->q15
      45            ;----------------------------------------------------------------------------------
      46 0007 be43                  SETC    OVM             ; Set overflow mode
      47                                                            ; ARP=AR0, AR0->q15
      48            ;----------------------------------------------------------------------------------
      49 0008 bf00                  SPM     0       ; Reset product mode
      50                                                    ; ARP=AR0, AR0->q15 
      51            ;----------------------------------------------------------------------------------
      52 0009 7390                  LT      *-              ; TREG = q15
      53                                                            ; ARP=AR0, AR0->scaler                  
      54            ;----------------------------------------------------------------------------------
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00  Tue May  6 12:41:09 2003
Copyright (c) 1987-1999  Texas Instruments Incorporated 
q15toq0.asm                                                          PAGE    2

      55 000a 10a0          LACC    *+              ; ACC = scaler 
      56                                                    ; ARP=AR0, AR0->q15
      57            ;----------------------------------------------------------------------------------
      58 000b 7803                  ADRK    #3      ; ARP=AR0, AR0->FR0
      59            ;----------------------------------------------------------------------------------
      60 000c 9080          SACL    *       ; FR0 = scaler
      61                                                    ; ARP=AR0, AR0->FR0 
      62            ;----------------------------------------------------------------------------------
      63 000d 5480          MPY     *       ; PREG = q15*scaler  (Q15)
      64                                                    ; ARP=AR0, AR0->FR0
      65            ;----------------------------------------------------------------------------------
      66 000e be03                  PAC                             ; ACC = q15*scaler  (Q15)
      67                                                    ; ARP=AR0, AR0->FR0
      68            ;----------------------------------------------------------------------------------
      69 000f be09          SFL                             ; ACC = q15*scaler  (Q16)
      70                                                    ; ARP=AR0, AR0->FR0
      71            ;----------------------------------------------------------------------------------             
      72 0010 9880          SACH    *               ; FR0 = q0 = q15*scaler  (Q0)
      73                                                    ; ARP=AR0, AR0->FR0
      74            ;----------------------------------------------------------------------------------
      75 0011 6989                  LACL    *,AR1   ; ACC = q0 = q15*scaler  (Q0)
      76                                                            ; ARP=AR0, AR0->FR0, ARP=AR1            
      77            ;----------------------------------------------------------------------------------
      78 0012       _q15toq0_exit:
      79                    ;MAR     *,AR1   ; can be removed if this condition is met on
      80                    ;                ; every path to this code. (i.e., ARP=AR1 here)
      81            
      82 0012 be42          CLRC    OVM
      83 0013 be46          CLRC    SXM
      84            
      85 0014 7c02          SBRK    #(__q15toq0_framesize+1)
      86 0015 0090          LAR     AR0,*-
      87 0016 7680          PSHD    *
      88                    
      89 0017 ef00          RET
      90                   
      91            
      92            
      93            

 No Errors,  No Warnings

⌨️ 快捷键说明

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