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

📄 vhzprof.lst

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

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

       1            ;=====================================================================================
       2            ; File name:        VHZPROF.ASM                       
       3            ;                    
       4            ; Originator:   Digital Control Systems Group
       5            ;                       Texas Instruments
       6            ;
       7            ; Description:                                 
       8            ; This file contains source for the Volt-Hz profile compute function.
       9            ;=====================================================================================
      10            ; History:
      11            ;-------------------------------------------------------------------------------------
      12            ; 9-15-2000     Release Rev 1.0
      13            ;================================================================================
      14            ; Applicability: F240,F241,C242,F243,F24xx.  (Peripheral Independant).
      15            ;
      16            ;
      17            ;================================================================================
      18            ; Routine Name: Volt Hz Profile Calculator.        Routine Type: C Callable
      19            ;
      20            ; Description:
      21            ;  
      22            ;  
      23            ;  C prototype : int Vhz_Profile_Calculate (VHZPROFILE_DATA *p)
      24            ;================================================================================
      25            ; History     Created Dec 29, 1999.
      26            ;
      27            ; Definition of VHPROFILE:
      28            ; struct VHZPROFILE_DATA { int fin,fmin,fmax,slope,vmax,vmin,vout,
      29            ;                          (int (*)(int))Vhz_Profile_Calculate };
      30            ;================================================================================                       
      31            
      32                            .def        _Vhz_Profile_Calculate
      33            ;================================================================================
      34 0000       _Vhz_Profile_Calculate:
      35            
      36      0001  __Vhz_Profile_Calculate_framesize .set 0001h
      37            ;================================================================================
      38 0000 8aa0                       POPD        *+
      39 0001 80a0                  SAR        AR0,*+
      40 0002 8180                  SAR        AR1,*
      41 0003 b001                  LARK        AR0,__Vhz_Profile_Calculate_framesize
      42 0004 00e8                  LAR        AR0,*0+,AR0
      43            
      44            ;================================================================================
      45 0005 7c03                  SBRK        #3        ; Point AR0 to the first argument.
      46                                            ; This is a pointer to the Vhz_profile_data.
      47            ;--------------------------------------------------------------------------------
      48 0006 0280                  LAR        AR2,*        ; get the pointer in AR2.
      49            ;--------------------------------------------------------------------------------
      50 0007 7803                  ADRK        #3        ; Restore frame pointer to FR0.
      51            ;--------------------------------------------------------------------------------
      52 0008 8b8a                  MAR        *,AR2   ; ARP=AR2
      53            ;--------------------------------------------------------------------------------
      54 0009 10a0                  LACC        *+        ; get fin in acc.
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00  Tue May  6 12:41:12 2003
Copyright (c) 1987-1999  Texas Instruments Incorporated 
vhzprof.asm                                                          PAGE    2

      55            ;--------------------------------------------------------------------------------
      56 000a 3090                  SUB        *-        ; subtract. ACC=fin-fmin
      57                                            ; also AR2 now points back to fin.
      58                                            ; ACC=fin-fmax.
      59                                            ; This should be +ve. If -ve, or zero saturate!
      60            ;--------------------------------------------------------------------------------
      61 000b e3cc                  BCND        __VHZPRCALC_min_sat,LEQ
         000c 0021' 
      62            ;--------------------------------------------------------------------------------
      63 000d 1080                  LACC        *        ; get fin in acc.
      64            ;--------------------------------------------------------------------------------
      65 000e 7802                  ADRK        #2        ; point to fmax.
      66            ;--------------------------------------------------------------------------------
      67 000f 3080                  SUB        *        ; subtract. ACC=fin-fmax.
      68                                            ; This should NOT be +ve. If +ve saturate!
      69                                            ; also AR2 now points to fmax.
      70            ;--------------------------------------------------------------------------------
      71 0010 e304                  BCND        __VHZPRCALC_max_sat,GT
         0011 0026' 
      72            ;--------------------------------------------------------------------------------
      73            ; Normal compute.
      74            ;--------------------------------------------------------------------------------
      75                            ; AR2 now points to fmax.
      76            ;--------------------------------------------------------------------------------                
      77 0012 8ba0                  MAR        *+        ; point AR2 to slope.
      78 0013 7390                  LT        *-        ; load slope in TREG and point AR2 back to fmax
      79            ;--------------------------------------------------------------------------------
      80 0014 7c02                  SBRK        #2        ; AR2 now points to fin.
      81            ;--------------------------------------------------------------------------------
      82 0015 10a0                  LACC        *+        ; load fin
      83                                            ; AR2 now points to fmin.
      84            ;--------------------------------------------------------------------------------
      85 0016 3088                  SUB        *,AR0        ; ACC=fin-fmin
      86                                            ; AR2 now points to fmin.
      87                                            ; ARP=AR0
      88            ;--------------------------------------------------------------------------------
      89            ;             ; TREG contains slope.
      90                            
      91 0017 9080                  SACL        *        ; store (fin-fmin) in FR0.
      92 0018 548a                  MPY         *,AR2        ; PREG= slope *(fin-fmin).
      93            
      94                        ; slope is in Q12. So product reg = Q12*Q15=Q27.
      95                        ; i.e product register is S S I2 I1 I0 . F26 ===== F0.
      96                        ; so a LEFT shift of 4 bits will put it in Q31, and then pick
      97                        ; ACCH for Q15.
      98                    
      99 0019 bf02                  SPM        2        ; Set product mode for LEFT shift of 4 bits.
     100 001a be03                  PAC        
     101 001b bf00                  SPM        0         ; Restore compiler SPM mode requirement.
     102            
     103            ;--------------------------------------------------------------------------------
     104                        ; AR2 now points to fmin.                
     105            ;--------------------------------------------------------------------------------
     106 001c 7804                  ADRK        #4        ; point to Vmin.
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00  Tue May  6 12:41:12 2003
Copyright (c) 1987-1999  Texas Instruments Incorporated 
vhzprof.asm                                                          PAGE    3

     107            ;--------------------------------------------------------------------------------
     108 001d 61a0                  ADDH        *+        ; add Vmin to product and point to Vout.
     109            ;--------------------------------------------------------------------------------
     110 001e 9889                  SACH        *,AR1        ; store Vout=Vmin+slope*(fin-fmin).
     111                                            ; also ARP=AR1 in preparation for exit.
     112            ;--------------------------------------------------------------------------------
     113 001f 7980                  B        __Vhz_profile_calculate_exit        
         0020 002c' 
     114            ;--------------------------------------------------------------------------------
     115            
     116 0021       __VHZPRCALC_min_sat:
     117            
     118                    ; If we are here it means the input freq < f_minimum and so we put out
     119                    ; vout=vmin.
     120                    ; AR2 is pointing to fin after subtraction.                
     121            
     122            
     123 0021 7805                  ADRK        #5        ; point AR2 to Vmin
     124            ;--------------------------------------------------------------------------------
     125 0022 10a0                  LACC        *+        ; Load Vmin, 
     126                                            ; also increment the pointer to pt to Vout
     127            ;--------------------------------------------------------------------------------
     128 0023 9089                  SACL        *,AR1        ; store Vout.
     129                                            ; also ARP=AR1 in preparation for exit.
     130            ;--------------------------------------------------------------------------------                
     131 0024 7980                  B        __Vhz_profile_calculate_exit        
         0025 002c' 
     132            ;--------------------------------------------------------------------------------
     133 0026       __VHZPRCALC_max_sat:
     134            
     135                    ; If we are here it means the input freq > f_maxand so we put out
     136                    ; vout=vmax.
     137                    ; AR2 is pointing to fmax after subtraction.                
     138            
     139 0026 7802                  ADRK        #2        ; point AR2 to Vmax
     140            ;--------------------------------------------------------------------------------
     141 0027 1080                  LACC        *        ; Load Vmin, 
     142            ;--------------------------------------------------------------------------------
     143 0028 7802                  ADRK        #2        ; also increment the pointer to pt to Vout
     144            ;--------------------------------------------------------------------------------
     145 0029 9089                  SACL        *,AR1        ; store Vout.
     146                                            ; also ARP=AR1 in preparation for exit.
     147            ;--------------------------------------------------------------------------------                
     148 002a 7980                  B        __Vhz_profile_calculate_exit        
         002b 002c' 
     149            ;--------------------------------------------------------------------------------
     150 002c       __Vhz_profile_calculate_exit:
     151 002c 7c02                  SBRK        #(__Vhz_Profile_Calculate_framesize+1)
     152 002d 0090                  LAR        AR0,*-
     153 002e 7680                  PSHD        *
     154 002f ef00                  RET
     155            
     156            

 No Errors,  No Warnings

⌨️ 快捷键说明

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