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

📄 monitor.asm

📁 Texas-Instrument C2000 Series DSP example programs
💻 ASM
📖 第 1 页 / 共 2 页
字号:
	SUB	* 
	SACL	* 
	LAR	AR6,* ,AR1
***	-----------------------g17:
***	-----------------------g48:
L48:
*** 170	-----------------------    sendstr_PMEM(" ");
	.line	122
	LRLK	AR3,SL2
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-,AR6
*** 169	-----------------------    if ( --L$3 != -1 ) goto g48;
	.line	121
	BANZ	L48,*-,AR1
L18:
***	-----------------------g18:
*** 171	-----------------------    sendstr_DMEM(&str);
	.line	123
	MAR	* ,AR3
	LARK	AR3,14
	MAR	*0+,AR1
	SAR	AR3,*+
	CALL	_sendstr_DMEM
	MAR	*-
*** 173	-----------------------    if ( SCI_Getc() == (-1) ) goto g10;
	.line	125
	CALL	_SCI_Getc
	SSXM
	SUBK	-1
	BZ	L10
*** 173	-----------------------    goto g37;
	B	L37
L19:
***	-----------------------g19:
*** 99	-----------------------    clrscr();
	.line	51
	CALL	_clrscr,AR1
*** 100	-----------------------    sendstr_PMEM("\rInput from ADC1, ADC2, QEP: 000000 000000 000000");
	.line	52
	LRLK	AR3,SL5
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-
L21:
***	-----------------------g21:
*** 103	-----------------------    sendstr_PMEM("\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
	.line	55
	LRLK	AR3,SL4
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-
*** 104	-----------------------    sendstr_PMEM("\b\b\b\b\b\b\b");
	.line	56
	LRLK	AR3,SL6
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-,AR3
*** 109	-----------------------    *(unsigned*)0x7032 &= 0xff81u;
	.line	61
	LARK	AR3,28722
	LACK	65409
	AND	* 
	SACL	* 
*** 109	-----------------------    *(unsigned*)0x7032 |= 0x5bu;
	LACK	91
	OR	* 
	SACL	* 
L23:
***	-----------------------g23:
*** 110	-----------------------    if ( !(*(unsigned*)0x7032&0x100) ) goto g23;
	.line	62
	LARK	AR3,28722
	BIT	* ,7
	BBZ	L23
*** 110	-----------------------    Y$2 = *(unsigned*)0x7036;
	ADRK	4
	LAC	* ,AR2
	LARK	AR2,2
	MAR	*0+
	SACL	* ,AR3
*** 110	-----------------------    Y$3 = *(unsigned*)0x7038;
	ADRK	2
	LAC	* ,AR2
	MAR	*+
	SACL	* ,AR3
*** 110	-----------------------    *(unsigned*)0x7032 |= 0x100u;
	SBRK	6
	LACK	256
	OR	* 
	SACL	* ,AR2
*** 111	-----------------------    val[0] = (int)((unsigned)Y$2-0x8000u)*2;
	.line	63
	MAR	*-
	LAC	* ,AR0
	ADLK	65535,15
	SACL	* 
	LAC	* ,1,AR2
	ADRK	32
	SACL	* 
*** 112	-----------------------    val[1] = (int)((unsigned)Y$3+32468u)*2;
	.line	64
	SBRK	31
	LAC	* ,AR0
	ADDK	32468
	SACL	* 
	LAC	* ,1,AR1
	SACL	* 
	LAC	* ,AR2
	ADRK	32
	SACL	* ,AR1
*** 118	-----------------------    val[2] = QEP_GetIncr();
	.line	70
	CALL	_QEP_GetIncr
	SACL	* 
	LAC	* ,AR2
	LARK	AR2,36
	MAR	*0+
	SACL	* ,AR3
*** 126	-----------------------    ltoa((long)val[0], &str);
	.line	78
	LARK	AR3,14
	MAR	*0+,AR1
	SAR	AR3,*+,AR2
	SSXM
	SBRK	2
	LAC	* ,AR1
	SACL	*+
	SACH	*+
	CALL	_ltoa
	SBRK	3
*** 127	-----------------------    if ( (i = strlen(&str)) >= 7 ) goto g28;
	.line	79
	MAR	* ,AR3
	LARK	AR3,14
	MAR	*0+,AR1
	SAR	AR3,*+
	CALL	_strlen
	MAR	*-,AR0
	SACL	* 
	LAR	AR5,* 
	SAR	AR5,*
	SSXM
	LAC	* 
	SUBK	7
	BGEZ	L28
***  	-----------------------    L$4 = 6-i;
	SAR	AR5,*
	LACK	6
	SUB	* 
	SACL	* 
	LAR	AR6,* ,AR1
***	-----------------------g27:
***	-----------------------g47:
L47:
*** 128	-----------------------    sendstr_PMEM(" ");
	.line	80
	LRLK	AR3,SL2
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-,AR6
*** 127	-----------------------    if ( --L$4 != -1 ) goto g47;
	.line	79
	BANZ	L47,*-,AR1
L28:
***	-----------------------g28:
*** 129	-----------------------    sendstr_DMEM(&str);
	.line	81
	MAR	* ,AR3
	LARK	AR3,14
	MAR	*0+,AR1
	SAR	AR3,*+
	CALL	_sendstr_DMEM
	MAR	*-,AR3
*** 131	-----------------------    ltoa((long)val[1], &str);
	.line	83
	LARK	AR3,14
	MAR	*0+,AR1
	SAR	AR3,*+,AR2
	SSXM
	LARK	AR2,35
	MAR	*0+
	LAC	* ,AR1
	SACL	*+
	SACH	*+
	CALL	_ltoa
	SBRK	3
*** 132	-----------------------    if ( (i = strlen(&str)) >= 7 ) goto g32;
	.line	84
	MAR	* ,AR3
	LARK	AR3,14
	MAR	*0+,AR1
	SAR	AR3,*+
	CALL	_strlen
	MAR	*-,AR0
	SACL	* 
	LAR	AR5,* 
	SAR	AR5,*
	SSXM
	LAC	* 
	SUBK	7
	BGEZ	L32
***  	-----------------------    L$5 = 6-i;
	SAR	AR5,*
	LACK	6
	SUB	* 
	SACL	* 
	LAR	AR6,* ,AR1
***	-----------------------g31:
***	-----------------------g46:
L46:
*** 133	-----------------------    sendstr_PMEM(" ");
	.line	85
	LRLK	AR3,SL2
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-,AR6
*** 132	-----------------------    if ( --L$5 != -1 ) goto g46;
	.line	84
	BANZ	L46,*-,AR1
L32:
***	-----------------------g32:
*** 134	-----------------------    sendstr_DMEM(&str);
	.line	86
	MAR	* ,AR3
	LARK	AR3,14
	MAR	*0+,AR1
	SAR	AR3,*+
	CALL	_sendstr_DMEM
	MAR	*-,AR3
*** 136	-----------------------    ltoa((unsigned long)val[2], &str);
	.line	88
	LARK	AR3,14
	MAR	*0+,AR1
	SAR	AR3,*+,AR2
	SSXM
	LARK	AR2,36
	MAR	*0+
	LAC	* ,AR1
	SACL	*+
	SACH	*+
	CALL	_ltoa
	SBRK	3
*** 137	-----------------------    if ( (i = strlen(&str)) >= 7 ) goto g36;
	.line	89
	MAR	* ,AR3
	LARK	AR3,14
	MAR	*0+,AR1
	SAR	AR3,*+
	CALL	_strlen
	MAR	*-,AR0
	SACL	* 
	LAR	AR5,* 
	SAR	AR5,*
	SSXM
	LAC	* 
	SUBK	7
	BGEZ	L36
***  	-----------------------    L$6 = 6-i;
	SAR	AR5,*
	LACK	6
	SUB	* 
	SACL	* 
	LAR	AR6,* ,AR1
***	-----------------------g35:
***	-----------------------g45:
L45:
*** 138	-----------------------    sendstr_PMEM(" ");
	.line	90
	LRLK	AR3,SL2
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-,AR6
*** 137	-----------------------    if ( --L$6 != -1 ) goto g45;
	.line	89
	BANZ	L45,*-,AR1
L36:
***	-----------------------g36:
*** 139	-----------------------    sendstr_DMEM(&str);
	.line	91
	MAR	* ,AR3
	LARK	AR3,14
	MAR	*0+,AR1
	SAR	AR3,*+
	CALL	_sendstr_DMEM
	MAR	*-
*** 142	-----------------------    if ( SCI_Getc() == (-1) ) goto g21;
	.line	94
	CALL	_SCI_Getc
	SSXM
	SUBK	-1
	BZ	L21
L37:
L38:
***	-----------------------g37:
***	-----------------------g38:
*** 67	-----------------------    clrscr();
	.line	19
	CALL	_clrscr,AR1
*** 68	-----------------------    sendstr_PMEM("\r\r\rTMS320F240 SIN/COS Incremental Encoder Test Software 1.0\r");
	.line	20
	LRLK	AR3,SL7
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-
*** 69	-----------------------    sendstr_PMEM("\rMain Menu\r");
	.line	21
	LRLK	AR3,SL8
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-
*** 74	-----------------------    sendstr_PMEM("\r\t1) Encoder Initialization");
	.line	26
	LRLK	AR3,SL9
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-
*** 75	-----------------------    sendstr_PMEM("\r\t2) ADC1,2 & QEP Test");
	.line	27
	LRLK	AR3,SL10
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-
*** 76	-----------------------    sendstr_PMEM("\r\t3) Print Encoder Increment & Phase");
	.line	28
	LRLK	AR3,SL11
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-
*** 77	-----------------------    sendstr_PMEM("\r\t4) Print Position (1/1000 Degrees)");
	.line	29
	LRLK	AR3,SL12
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-
*** 78	-----------------------    sendstr_PMEM("\r\r Press '1'..'4'. Please make your choice. \r");
	.line	30
	LRLK	AR3,SL13
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-
L40:
***	-----------------------g40:
*** 80	-----------------------    if ( (c = SCI_Getc()) < 49 || c > 54 ) goto g40;
	.line	32
	CALL	_SCI_Getc,AR1
	MAR	* ,AR2
	LARK	AR2,3
	MAR	*0+
	SACL	* ,AR1
	SUBK	49
	BLZ	L40
	SSXM
	MAR	* ,AR2
	LAC	* ,AR1
	SUBK	54
	BGZ	L40
*** 81	-----------------------    switch ( c ) {...};
	.line	33
	MAR	* ,AR2
	LAC	* 
	SUBK	49
	BZ	L42
	SUBK	1
	BZ	L19
	SUBK	1
	BZ	L8
	SUBK	1
	BZ	L1
	B	L38
L42:
***	-----------------------g42:
*** 86	-----------------------    Encoder_Init(8192u);
	.line	38
	MAR	* ,AR1
	LACK	8192
	SACL	*+
	CALL	_Encoder_Init
	MAR	*-
*** 88	-----------------------    sendstr_PMEM("\r\r");
	.line	40
	LRLK	AR3,SL14
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-
*** 89	-----------------------    sendstr_PMEM(" +--------------------+\r");
	.line	41
	LRLK	AR3,SL15
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-
*** 90	-----------------------    sendstr_PMEM(" | Encoder setup done |\r");
	.line	42
	LRLK	AR3,SL16
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-
*** 91	-----------------------    sendstr_PMEM(" +--------------------+\r");
	.line	43
	LRLK	AR3,SL15
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-
*** 92	-----------------------    sendstr_PMEM(" >> Press any key to confirm\r");
	.line	44
	LRLK	AR3,SL17
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-
L44:
***	-----------------------g44:
*** 93	-----------------------    if ( kbhit() && (c = getch()) ) goto g38;
	.line	45
	CALL	_kbhit,AR1
	BZ	LL3
	CALL	_getch
	MAR	* ,AR0
	SACL	* 
	LAR	AR5,* ,AR5
	BANZ	L38,*
LL3:
*** 93	-----------------------    goto g44;
	MAR	* ,AR1
	B	L44
;	<restore register vars>
	.endfunc	216,0000000c0H,41

	.sym	_Encoder_MSG,_Encoder_MSG,32,2,0
	.globl	_Encoder_MSG

	.func	222
;>>>> 	void  Encoder_MSG(void)
******************************************************
* FUNCTION DEF : _Encoder_MSG
******************************************************
_Encoder_MSG:
	POPD	*+

*** 224	-----------------------    clrscr();
	.line	3
;>>>> 	   clrscr();
	CALL	_clrscr
*** 225	-----------------------    sendstr_PMEM("\r\r");
	.line	4
;>>>> 	   sendstr_PMEM("\r\r");                 
	LRLK	AR3,SL14
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-
*** 226	-----------------------    sendstr_PMEM(" +----------------------------------------------+\r");
	.line	5
;>>>> 	   sendstr_PMEM(" +----------------------------------------------+\r");
	LRLK	AR3,SL18
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-
*** 227	-----------------------    sendstr_PMEM(" | S L O W L Y  Turn Encoder for Sychronization |\r");
	.line	6
;>>>> 	   sendstr_PMEM(" | S L O W L Y  Turn Encoder for Sychronization |\r");
	LRLK	AR3,SL19
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-
*** 228	-----------------------    sendstr_PMEM(" +----------------------------------------------+\r");
	.line	7
;>>>> 	   sendstr_PMEM(" +----------------------------------------------+\r");
	LRLK	AR3,SL18
	SAR	AR3,*+
	CALL	_sendstr_PMEM
	MAR	*-
***  	-----------------------    return;
EPI0_2:
	.line	8
	SBRK	1
	PSHD	*
	RET

	.endfunc	229,000000000H,1
******************************************************
* DEFINE STRING CONSTANTS                            *
******************************************************
	.sect	".const"
SL0:	.byte	13,"Angle (1/1000 * Degrees): 000000000",0
SL1:	.byte	8,8,8,8,8,8,8,8,8,8,0
SL2:	.byte	" ",0
SL3:	.byte	13,"SIN/COS Q-Encoder, Increments, Phase: 000000 000000",0
SL4:	.byte	8,8,8,8,8,8,8,8,8,8,8,8,8,8,0
SL5:	.byte	13,"Input from ADC1, ADC2, QEP: 000000 000000 000000",0
SL6:	.byte	8,8,8,8,8,8,8,0
SL7:	.byte	13,13,13,"TMS320F240 SIN/COS Incremental Encoder Test Softwa"
	.byte	"re 1.0",13,0
SL8:	.byte	13,"Main Menu",13,0
SL9:	.byte	13,9,"1) Encoder Initialization",0
SL10:	.byte	13,9,"2) ADC1,2 & QEP Test",0
SL11:	.byte	13,9,"3) Print Encoder Increment & Phase",0
SL12:	.byte	13,9,"4) Print Position (1/1000 Degrees)",0
SL13:	.byte	13,13," Press '1'..'4'. Please make your choice. ",13,0
SL14:	.byte	13,13,0
SL15:	.byte	" +--------------------+",13,0
SL16:	.byte	" | Encoder setup done |",13,0
SL17:	.byte	" >> Press any key to confirm",13,0
SL18:	.byte	" +----------------------------------------------+",13,0
SL19:	.byte	" | S L O W L Y  Turn Encoder for Sychronization |",13,0
*************************************************
* DEFINE FLOATING POINT CONSTANTS               *
*************************************************
	.text
FL0:	.float	7.45058059692383e-9
FL1:	.float	3.6e5
*****************************************************
* UNDEFINED REFERENCES                              *
*****************************************************
	.global	F$$ULTOF
	.global	F$$MUL
	.global	F$$FTOL
	.global	_ltoa
	.global	_strlen
	.end

⌨️ 快捷键说明

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