📄 rampgen.lst
字号:
dspa -l -s -i../include -v2xx -iD:/CCStudio_v3.1/c2400/cgtools/include -g rampgen.asm ../obj\rampgen.obj
TMS320C24xx COFF Assembler Version 7.04 Fri May 04 19:50:40 2007
Copyright (c) 1987-2003 Texas Instruments Incorporated
rampgen.asm PAGE 1
1 ;=====================================================================================
2 ; File name: RAMPGEN.ASM
3 ;
4 ; Originator: Digital Control Systems Group
5 ; Texas Instruments
6 ;
7 ; Description:
8 ; This module generates ramp output of adjustable gain, frequency and dc offset.
9 ;=====================================================================================
10 ; History:
11 ;-------------------------------------------------------------------------------------
12 ; 09-15-2000 Release Rev 1.00
13 ; 01-15-2001 Release Rev 1.10
14 ;================================================================================
15 ; Applicability: F240,F241,C242,F243,F24xx. (Peripheral Independent).
16 ;================================================================================
17 ; Routine Name: rampgen_calc Type: C Callable
18 ;
19 ; C prototype : void rampgen_calc(struct RAMPGEN *p);
20 ;
21 ; The struct object is defined in the header file "rampgen.h" as follows:
22 ;
23 ; typedef struct { int rmp_freq; /* Input: Ramp frequency (Q15) */
24 ; int step_angle_max; /* Parameter: Maximum step angle (Q0) */
25 ; int angle_rg; /* Variable: Step angle (Q0) */
26 ; int rmp_gain; /* Input: Ramp gain (Q15) */
27 ; int rmp_out; /* Output: Ramp signal (Q15) */
28 ; int rmp_offset; /* Input: Ramp offset (Q15) */
29 ; int (*calc)(); /* Pointer to calculation function */
30 ; } RAMPGEN;
31 ;
32 ; Frame Usage Details:
33 ; step | a | b | c | d | e |
34 ;___________|_____________|______________|___________|_________|_________|
35 ; FR0 | rmp_freq_p | step_angle_rg|rmp_out_abs| | |
36 ;
37 ;================================================================================
38 .def _rampgen_calc
39 ;================================================================================
40 0001 __rampgen_calc_framesize .set 0001h
41 ;================================================================================
42 0000 _rampgen_calc:
43 ; Assume
44 0000 8aa0 POPD *+ ; Keep return address
45 0001 80a0 SAR AR0,*+ ; Keep old frame pointer (FP)
46 0002 8180 SAR AR1,* ; Keep old stack pointer (SP)
47 0003 b001 LARK AR0,__rampgen_calc_framesize ; Load AR0 with frame size
48 0004 00e8 LAR AR0,*0+,AR0 ; AR0->FP0 (new FP), ARP=AR0
49
50 ;================================================================================
51 0005 7c03 SBRK #3 ; ARP=AR0, AR0->FR0-3 (1st argument)
52 ;----------------------------------------------------------------------------------
53 0006 0280 LAR AR2,* ; ARP=AR0, AR0->rmp_freq, AR2->rmp_freq
54 ;----------------------------------------------------------------------------------
TMS320C24xx COFF Assembler Version 7.04 Fri May 04 19:50:40 2007
Copyright (c) 1987-2003 Texas Instruments Incorporated
rampgen.asm PAGE 2
55 0007 7803 ADRK #3 ; ARP=AR0, AR0->FR0, AR2->rmp_freq
56 ;----------------------------------------------------------------------------------
57 0008 be47 SETC SXM ; Turn sign extension mode on
58 ; ARP=AR0, AR0->FR0, AR2->rmp_freq
59 ;----------------------------------------------------------------------------------
60 0009 be43 SETC OVM ; Set overflow mode
61 ; ARP=AR0, AR0->FR0, AR2->rmp_freq
62 ;----------------------------------------------------------------------------------
63 000a bf00 SPM 0 ; Reset product mode
64 ; ARP=AR0, AR0->FR0, AR2->rmp_freq
65 ;----------------------------------------------------------------------------------
66 000b 8b8a MAR *,AR2 ; ARP=AR2, AR0->FR0, AR2->rmp_freq
67 ;----------------------------------------------------------------------------------
68 000c 6aa8 LACC *+,16,AR0 ; ACC = rmp_freq (Q15)
69 ; ARP=AR2, AR0->FR0, AR2->step_angle_max, ARP=AR0
70 ;----------------------------------------------------------------------------------
71 000d be00 ABS ; ACC = |rmp_freq| (Q15)
72 ; ARP=AR0, AR0->FR0, AR2->step_angle_max
73 ;----------------------------------------------------------------------------------
74 000e 9880 SACH * ; FR0 = rmp_freq_p = |rmp_freq| (Q15)
75 ; ARP=AR0, AR0->FR0, AR2->step_angle_max
76 ;----------------------------------------------------------------------------------
77 000f 738a LT *,AR2 ; TREG = |rmp_freq| (Q15)
78 ; ARP=AR0, AR0->FR0, AR2->step_angle_max, ARP=AR2
79 ;----------------------------------------------------------------------------------
80 0010 54a8 MPY *+,AR0 ; PREG = |rmp_freq|*step_angle_max (Q15)
81 ; ARP=AR2, AR0->FR0, AR2->angle_rg, ARP=AR0
82 ;----------------------------------------------------------------------------------
83 0011 be03 PAC ; ACC = |rmp_freq|*step_angle_max (Q15)
84 ; ARP=AR0, AR0->FR0, AR2->angle_rg
85 ;----------------------------------------------------------------------------------
86 0012 998a SACH *,1,AR2 ; FR0 = step_angle_rg (Q0)
87 ; ARP=AR0, AR0->FR0, AR2->angle_rg, ARP=AR2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -