📄 trap_gen.lst
字号:
C:\TIC2XX\C2000\CGTOOLS\BIN\DSPA.EXE -q -v2xx -gs trap_gen.asm -o ..\obj\trap_gen.obj -l ..\temp\trap_gen.lst
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00 Tue May 6 12:41:22 2003
Copyright (c) 1987-1999 Texas Instruments Incorporated
trap_gen.asm PAGE 1
1 ;=====================================================================================
2 ; File name: TRAP_GEN.ASM
3 ;
4 ; Originator: Digital Control Systems Group
5 ; Texas Instruments
6 ;
7 ; Description: This module generates trapezoidal output of adjustable maximum,
8 ; minimum and frequency.
9 ;
10 ;=====================================================================================
11 ; History:
12 ;-------------------------------------------------------------------------------------
13 ; 02-08-2001 Release Rev 1.0
14 ;================================================================================
15 ; Applicability: F240,F241,C242,F243,F24xx. (Peripheral Independent).
16 ;================================================================================
17 ; Routine Name: trapgen_calc Type: C Call
18 ;
19 ; C prototype : void trapgen_calc(struct TRAPGEN *p);
20 ;
21 ; The struct object is defined in the header file "trap_gen.h" as follows:
22 ;
23 ; typedef struct { int trap_delay_cntr; /* Variable: Delay counter (Q0) */
24 ; int trap_dly_max_tmp; /* Variable: Temp maximum delay input (Q0) */
25 ; int trap_timer; /* Variable: Timer (Q15) */
26 ; int trap_max; /* Input: Maximum input (Q15) */
27 ; int trap_max_tmp; /* Variable: Temp maximum input (Q15) */
28 ; int trap_dly_max; /* Input: Maximum delay input (Q0) */
29 ; int trap_min; /* Input: Minimum input (Q15) */
30 ; int trap_min_tmp; /* Variable: Temp mimimum input (Q15) */
31 ; int trap_out_lo; /* Variable: Trapezoidal output (Q31) */
32 ; int trap_out; /* Output: Trapezoidal output (Q31) */
33 ; int (*calc)(); /* Pointer to calculation function */
34 ; } TRAPGEN;
35 ;
36 ;
37 ; Frame Usage Details:
38 ; step | a | b | c | d
39 ;____________|_____________|______________|______________|_____________
40 ; AR0 |trap_8192inv | | |
41 ; AR1 | trap_tmp1 | | |
42 ;
43 ;================================================================================
44 .def _trapgen_calc
45 ;================================================================================
46 0002 __trapgen_calc_framesize .set 0002h
47 ;================================================================================
48 0000 _trapgen_calc:
49 ; Assume
50 0000 8aa0 POPD *+ ; Keep return address
51 0001 80a0 SAR AR0,*+ ; Keep old frame pointer (FP)
52 0002 8180 SAR AR1,* ; Keep old stack pointer (SP)
53 0003 b002 LARK AR0,__trapgen_calc_framesize ; Load AR0 with frame size
54 0004 00e8 LAR AR0,*0+,AR0 ; AR0->FP0 (new FP), ARP=AR0
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00 Tue May 6 12:41:22 2003
Copyright (c) 1987-1999 Texas Instruments Incorporated
trap_gen.asm PAGE 2
55
56 ;================================================================================
57 0005 7c03 SBRK #3 ; ARP=AR0, AR0->FR0-3 (1st argument)
58 ;----------------------------------------------------------------------------------
59 0006 0280 LAR AR2,* ; ARP=AR0, AR0->trap_delay_cntr, AR2->trap_delay_cntr
60 ;----------------------------------------------------------------------------------
61 0007 7803 ADRK #3 ; ARP=AR0, AR0->FR0, AR2->trap_delay_cntr
62 ;----------------------------------------------------------------------------------
63 0008 aea0 SPLK #4,*+ ; FR0 = trap_8192inv = 1/8192 (Q15)
0009 0004
64 ; ARP=AR0, AR0->FR1, AR2->trap_delay_cntr
65 ;----------------------------------------------------------------------------------
66 000a 8b8a MAR *,AR2 ; ARP=AR2, AR0->FR1, AR2->trap_delay_cntr
67 ;----------------------------------------------------------------------------------
68 000b be47 SETC SXM ; Turn sign extension mode on
69 ; ARP=AR2, AR0->FR1, AR2->trap_delay_cntr
70 ;----------------------------------------------------------------------------------
71 000c be43 SETC OVM ; Set overflow mode
72 ; ARP=AR2, AR0->FR1, AR2->trap_delay_cntr
73 ;----------------------------------------------------------------------------------
74 000d bf00 SPM 0 ; Reset product mode
75 ; ARP=AR2, AR0->FR1, AR2->trap_delay_cntr
76 ;----------------------------------------------------------------------------------
77 000e 1080 LACC * ; ACC = trap_delay_cntr (Q0)
78 ; ARP=AR2, AR0->FR1, AR2->trap_delay_cntr
79 ;----------------------------------------------------------------------------------
80 000f b801 ADD #1 ; ACC = trap_delay_cntr + 1 (Q0)
81 ; ARP=AR2, AR0->FR1, AR2->trap_delay_cntr
82 ;----------------------------------------------------------------------------------
83 0010 90a0 SACL *+ ; trap_delay_cntr = trap_delay_cntr + 1 (Q0)
84 ; ARP=AR2, AR0->FR1, AR2->trap_dly_max_tmp
85 ;----------------------------------------------------------------------------------
86 0011 30a0 SUB *+ ; ACC = trap_delay_cntr + 1 - trap_dly_max_tmp (Q0)
87 ; ARP=AR2, AR0->FR1, AR2->trap_timer
88 ;----------------------------------------------------------------------------------
89 0012 e344 BCND TRAP_EXIT,LT ; Branch to TRAP_EXIT if trap_delay_cntr < trap_dly_max_tmp
0013 006f'
90 ; ARP=AR2, AR0->FR1, AR2->trap_timer
91 ;----------------------------------------------------------------------------------
92 0014 1080 LACC * ; ACC = trap_timer (Q15)
93 ; ARP=AR2, AR0->FR1, AR2->trap_timer
94 ;----------------------------------------------------------------------------------
95 0015 b801 ADD #1 ; ACC = trap_timer + 1 (Q15)
96 ; ARP=AR2, AR0->FR1, AR2->trap_timer
97 ;----------------------------------------------------------------------------------
98 0016 bfb0 AND #7FFFh ; Force "wrap" around for positive Q15 number
0017 7fff
99 ; ARP=AR2, AR0->FR1, AR2->trap_timer
100 ;----------------------------------------------------------------------------------
101 0018 9080 SACL * ; trap_timer = trap_timer + 1 (Q15)
102 ; ARP=AR2, AR0->FR1, AR2->trap_timer
103 ;----------------------------------------------------------------------------------
104 0019 1080 LACC * ; ACC = trap_timer (Q15)
105 ; ARP=AR2, AR0->FR1, AR2->trap_timer
TMS320C1x/C2x/C2xx/C5x COFF Assembler Version 7.00 Tue May 6 12:41:22 2003
Copyright (c) 1987-1999 Texas Instruments Incorporated
trap_gen.asm PAGE 3
106 ;----------------------------------------------------------------------------------
107 001a e308 BCND SKIP_UPDATE_MAX, NEQ ; Branch to SKIP_UPDATE_MAX if trap_timer != 0
001b 0022'
108 ; ARP=AR2, AR0->FR1, AR2->trap_timer
109 ;----------------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -