📄 rmp_cntl.lst
字号:
dspa -l -s -i../include -v2xx -iD:/CCStudio_v3.1/c2400/cgtools/include -g rmp_cntl.asm ../obj\rmp_cntl.obj
TMS320C24xx COFF Assembler Version 7.04 Fri May 04 19:50:41 2007
Copyright (c) 1987-2003 Texas Instruments Incorporated
rmp_cntl.asm PAGE 1
1 ;=====================================================================================
2 ; File name: RMP_CNTL.ASM
3 ;
4 ; Originator: Digital Control Systems Group
5 ; Texas Instruments
6 ;
7 ; Description:
8 ; This file contains source for the Ramp control function.
9 ;=====================================================================================
10 ; History:
11 ;-------------------------------------------------------------------------------------
12 ; 9-15-2000 Release Rev 1.00
13 ;================================================================================
14 ; Applicability: F240,F241,C242,F243,F24xx. (Peripheral Independent).
15 ;================================================================================
16 ; Routine Name: rmp_cntl_calc Type: C Callable
17 ;
18 ; C prototype : void rmp_cntl_calc(struct RMPCNTL *p);
19 ;
20 ; The struct object is defined in the header file "rmp_cntl.h" as follows:
21 ;
22 ; typedef struct { int target_value; /* Input: Target input (Q15) */
23 ; int rmp_dly_max; /* Parameter: Maximum delay rate */
24 ; int rmp_lo_limit; /* Parameter: Minimum limit (Q15) */
25 ; int rmp_hi_limit; /* Parameter: Maximum limit (Q15) */
26 ; int rmp_delay_cntl; /* Variable: Incremental delay */
27 ; int setpt_value; /* Output: Target output (Q15) */
28 ; int s_eq_t_flg; /* Output: Flag output */
29 ; int (*calc)(); /* Pointer to calculation function */
30 ; } RMPCNTL;
31 ;
32 ; Frame Usage Details:
33 ; step | a | b | c | d
34 ;____________|_____________|______________|______________|_____________
35 ; FR0 | not used | | |
36 ;
37 ;
38 ;
39 ;================================================================================
40 .def _rmp_cntl_calc
41 ;================================================================================
42 0000 __rmp_cntl_calc_framesize .set 0000h
43 ;================================================================================
44 0000 _rmp_cntl_calc:
45 ; Assume
46 0000 8aa0 POPD *+ ; Keep return address
47 0001 80a0 SAR AR0,*+ ; Keep old frame pointer (FP)
48 0002 8180 SAR AR1,* ; Keep old stack pointer (SP)
49 0003 b000 LARK AR0,__rmp_cntl_calc_framesize ; Load AR0 with frame size
50 0004 00e8 LAR AR0,*0+,AR0 ; AR0->FP0 (new FP), ARP=AR0
51
52 ;================================================================================
53 0005 7c03 SBRK #3 ; ARP=AR0, AR0->FR0-3 (1st argument)
54 ;----------------------------------------------------------------------------------
TMS320C24xx COFF Assembler Version 7.04 Fri May 04 19:50:41 2007
Copyright (c) 1987-2003 Texas Instruments Incorporated
rmp_cntl.asm PAGE 2
55 0006 0280 LAR AR2,* ; ARP=AR0, AR0->target_value, AR2->target_value
56 ;----------------------------------------------------------------------------------
57 0007 7803 ADRK #3 ; ARP=AR0, AR0->FR0, AR2->target_value
58 ;----------------------------------------------------------------------------------
59 0008 8b8a MAR *,AR2 ; ARP=AR2, AR0->FR0, AR2->target_value
60 ;----------------------------------------------------------------------------------
61 0009 be47 SETC SXM ; Turn sign extension mode on
62 ; ARP=AR2, AR0->FR0, AR2->target_value
63 ;----------------------------------------------------------------------------------
64 000a be43 SETC OVM ; Set overflow mode
65 ; ARP=AR2, AR0->FR0, AR2->target_value
66 ;----------------------------------------------------------------------------------
67 000b bf00 SPM 0 ; Reset product mode
68 ; ARP=AR2, AR0->FR0, AR2->target_value
69 ;----------------------------------------------------------------------------------
70 000c 1080 LACC * ; ACC = target_value (Q15)
71 ; ARP=AR2, AR0->FR0, AR2->target_value
72 ;----------------------------------------------------------------------------------
73 000d 7805 ADRK #5 ; ARP=AR2, AR0->FR0, AR2->setpt_value
74 ;----------------------------------------------------------------------------------
75 000e 3090 SUB *- ; ACC = target_value - setpt_value (Q15)
76 ; ARP=AR2, AR0->FR0, AR2->rmp_delay_cntl
77 ;----------------------------------------------------------------------------------
78 000f e388 BCND SET_FLG,EQ ; If set point = target
0010 003e'
79 ; Set s_eq_t_flg = 7FFFh then exit
80 ; ARP=AR2, AR0->FR0, AR2->rmp_delay_cntl
81 ;----------------------------------------------------------------------------------
82 0011 1080 LACC * ; ACC = rmp_delay_cntl
83 ; ARP=AR2, AR0->FR0, AR2->rmp_delay_cntl
84 ;----------------------------------------------------------------------------------
85 0012 b801 ADD #1 ; ACC = rmp_delay_cntl + 1
86 ; ARP=AR2, AR0->FR0, AR2->rmp_delay_cntl
87 ;----------------------------------------------------------------------------------
88 0013 9080 SACL * ; rmp_delay_cntl = rmp_delay_cntl + 1
89 ; ARP=AR2, AR0->FR0, AR2->rmp_delay_cntl
90 ;----------------------------------------------------------------------------------
91 0014 7c03 SBRK #3 ; ARP=AR2, AR0->FR0, AR2->rmp_dly_max
92 ;----------------------------------------------------------------------------------
93 0015 3090 SUB *- ; ACC = rmp_delay_cntl + 1 - rmp_dly_max
94 ; ARP=AR2, AR0->FR0, AR2->target_value
95 ;----------------------------------------------------------------------------------
96 0016 e344 BCND SRC_EXIT, LT ; Branch to SRC_EXIT if ACC > 0
0017 003b'
97 ; ARP=AR2, AR0->FR0, AR2->target_value
98 ;----------------------------------------------------------------------------------
99 0018 CHNG_VALUE ; ARP=AR2, AR0->FR0, AR2->target_value
100 ;----------------------------------------------------------------------------------
101 0018 1080 LACC * ; ACC = target_value (Q15)
102 ; ARP=AR2, AR0->FR0, AR2->target_value
103 ;----------------------------------------------------------------------------------
104 0019 7805 ADRK #5 ; ARP=AR2, AR0->FR0, AR2->setpt_value
105 ;----------------------------------------------------------------------------------
106 001a 3080 SUB * ; ACC = target_value - setpt_value (Q15)
TMS320C24xx COFF Assembler Version 7.04 Fri May 04 19:50:41 2007
Copyright (c) 1987-2003 Texas Instruments Incorporated
rmp_cntl.asm PAGE 3
107 ; ARP=AR2, AR0->FR0, AR2->setpt_value
108 ;----------------------------------------------------------------------------------
109 001b e304 BCND INC_VALUE, GT ; Branch to incremental if target_value>setpt_value
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -