📄 test2407.asm
字号:
*******************************************************
* TMS320C24xx ANSI C Codegen Version 7.04
*******************************************************
; dspac -v2xx -iD:/CCStudio_v3.1/c2400/cgtools/include test2407.c C:\DOCUME~1\ADMINI~1.GUO\LOCALS~1\Temp\test2407.if
; dspopt NOT RUN
; dspcg -o -v2xx -o C:\DOCUME~1\ADMINI~1.GUO\LOCALS~1\Temp\test2407.if C:\DOCUME~1\ADMINI~1.GUO\LOCALS~1\Temp\test2407.asm C:\DOCUME~1\ADMINI~1.GUO\LOCALS~1\Temp\test2407.tmp
.port
.bss _test,1,1
.bss _Maxer_counter,2,1
.bss _pc_qubai,1
.bss _uiAutoUpPara1,1
.bss _uiAutoUpPara2,1
.bss _uiAutoUpPara3,1
.bss _uiAutoUpPara4,1
.bss _SciRecBuf,30
.bss _key_code,1
.bss _pc_tuixiao,1
.bss _pc_fangbai,1
.bss _ulAutoUpPara,2,1
.bss _read_flag,1
.bss _Maxest_counter,2,1
.bss _uipreangle,1
.bss _Encode_counter,2,1
.bss _outputbuf,1
.bss _pc_impact,1
.bss _ucSq,1
.file "test2407.c"
.file "f2407_c.h"
.globl _portFF0F
.globl _portFFFF
.file "string.h"
.sym _size_t,0,14,13,16
.globl _memchr
.globl _memcmp
.globl _memcpy
.globl _memmove
.globl _memset
.globl _strcat
.globl _strchr
.globl _strcmp
.globl _strcoll
.globl _strcpy
.globl _strcspn
.globl _strerror
.globl _strlen
.globl _strncat
.globl _strncmp
.globl _strncpy
.globl _strpbrk
.globl _strrchr
.globl _strspn
.globl _strstr
.globl _strtok
.globl _strxfrm
.file "stdlib.h"
.sym _wchar_t,0,2,13,16
.globl _atoi
.globl _atol
.globl _atof
.globl _strtod
.globl _strtol
.globl _strtoul
.stag __div_t,32
.member _quot,0,4,8,16
.member _rem,16,4,8,16
.eos
.sym _div_t,0,8,13,32,__div_t
.stag __ldiv_t,64
.member _quot,0,5,8,32
.member _rem,32,5,8,32
.eos
.sym _ldiv_t,0,8,13,64,__ldiv_t
.globl _div
.globl _ldiv
.globl _rand
.globl _srand
.globl _calloc
.globl _free
.globl _malloc
.globl _minit
.globl _realloc
.globl _abort
.globl _exit
.globl _atexit
.globl _abs
.globl _labs
.globl _qsort
.globl _bsearch
.globl _getenv
.file "ioports.h"
.globl __out_port
.globl __outport0
.globl __outport1
.globl __outport2
.globl __outport3
.globl __outport4
.globl __outport5
.globl __outport6
.globl __outport7
.globl __outport8
.globl __outport9
.globl __outport10
.globl __outport11
.globl __outport12
.globl __outport13
.globl __outport14
.globl __outport15
.globl __in_port
.globl __inport0
.globl __inport1
.globl __inport2
.globl __inport3
.globl __inport4
.globl __inport5
.globl __inport6
.globl __inport7
.globl __inport8
.globl __inport9
.globl __inport10
.globl __inport11
.globl __inport12
.globl __inport13
.globl __inport14
.globl __inport15
.file "ctype.h"
.globl __ctypes_
.globl _isalnum
.globl _isalpha
.globl _iscntrl
.globl _isdigit
.globl _isgraph
.globl _islower
.globl _isprint
.globl _ispunct
.globl _isspace
.globl _isupper
.globl _isxdigit
.globl _isascii
.globl _toupper
.globl _tolower
.globl _toascii
.file "test2407.c"
.globl _port2000
.globl _port4000
.globl _ucinput
.globl _ucSq
.globl _SciRecBuf
.globl _read_flag
.globl _uipreangle
.sect ".cinit"
.word 1,_test
.word 0
.sym _test,_test,12,2,16
.globl _test
.globl _uiAutoUpPara1
.globl _uiAutoUpPara2
.globl _uiAutoUpPara3
.globl _uiAutoUpPara4
.globl _Encode_counter
.globl _Maxest_counter
.word 2,_Maxer_counter
.long 0
.sym _Maxer_counter,_Maxer_counter,15,2,32
.globl _Maxer_counter
.globl _ulAutoUpPara
.globl _pc_qubai
.globl _pc_tuixiao
.globl _pc_impact
.globl _pc_fangbai
.globl _key_code
.globl _outputbuf
.globl _cParaNo
.globl _auto_qubai
.globl _autoUp_flag
.globl _uiRecNum
.globl _ReadArr
.globl _Len_RecChar
.globl _UartSent
.text
.sym _disable_int,_disable_int,32,2,0
.globl _disable_int
.func 61
;>>>> void inline disable_int()
******************************************************
* FUNCTION DEF : _disable_int
******************************************************
_disable_int:
POPD *+
SAR AR0,*+
SAR AR1,*
LARK AR0,1
LAR AR0,*0+
.line 3
;>>>> asm(" setc INTM");
setc INTM
.line 4
;>>>> asm(" setc SXM");
setc SXM
EPI0_1:
.line 5
SBRK 2
LAR AR0,*-
PSHD *
RET
.endfunc 65,000000000H,1
.sym _enable_int,_enable_int,32,2,0
.globl _enable_int
.func 67
;>>>> void inline enable_int()
******************************************************
* FUNCTION DEF : _enable_int
******************************************************
_enable_int:
POPD *+
SAR AR0,*+
SAR AR1,*
LARK AR0,1
LAR AR0,*0+
.line 3
;>>>> asm(" clrc INTM");//hehe,the spaces is request!!
clrc INTM
EPI0_2:
.line 4
SBRK 2
LAR AR0,*-
PSHD *
RET
.endfunc 70,000000000H,1
.sym _main,_main,32,2,0
.globl _main
.func 76
;>>>> void main(void)
;>>>> unsigned char wr_flag;
;>>>> unsigned int d_ram,p_ram,t_sci,t_x25650,t_can,i;
;>>>> unsigned int comarr[10];
;>>>> // asm(" setc CNF");
******************************************************
* FUNCTION DEF : _main
******************************************************
_main:
POPD *+
SAR AR0,*+
SAR AR1,*
LARK AR0,20
LAR AR0,*0+,AR3
.sym _wr_flag,1,12,1,16
.sym _d_ram,2,14,1,16
.sym _p_ram,3,14,1,16
.sym _t_sci,4,14,1,16
.sym _t_x25650,5,14,1,16
.sym _t_can,6,14,1,16
.sym _i,7,14,1,16
.sym _comarr,8,62,1,160,,10
.line 8
;>>>> *WDCR = 0x00E8;//看门狗
;>>>> // *SCSR1 = 0x00fd;
LARK AR3,28713
LACK 232
SACL *
.line 10
;>>>> *SCSR1 = 0x004d;//4Xclk SCICLKen EVA en EVB en
LACK 77
SBRK 17
SACL *+
.line 11
;>>>> *SCSR2 = (*SCSR2 | 0x000B) & 0x000F;
LACK 11
OR *
ANDK 15
SACL * ,AR0
.line 12
;>>>> WSGR = 0x01c0;
LACK 448
SACL *
OUT * ,0ffffh,AR3
.line 13
;>>>> *MCRA = 0x0003; //enable SCI TXD & RXD // group A pins
LACK 3
ADRK 119
SACL *
.line 14
;>>>> *MCRA = *MCRA | 0x0018; //enable QEP1 & QEP2
;>>>> // *MCRA = 0x0000;//
LACK 24
OR *
SACL *
.line 16
;>>>> *MCRB = 0xFEDC; // group B pins //
ADRK 2
SPLK #65244,*
.line 17
;>>>> *MCRC = 0x0000; // group C pins //
LACK 0
ADRK 2
SACL * ,AR1
.line 18
;>>>> disable_int();
;>>>> // *IMR = 0x0000;
CALL _disable_int
.line 20
;>>>> *IMR = 0x01; // clear the IMR register //
LARK AR3,4
LACK 1
MAR * ,AR3
SACL *
.line 21
;>>>> *IFR = 0xffff; // clear any pending core interrupts //
;>>>> // enable_int();
ADRK 2
SPLK #65535,* ,AR4
.line 24
;>>>> *WDKEY =0x5555;
LARK AR4,28709
SPLK #21845,*
.line 25
;>>>> *WDKEY =0xaaaa;
SPLK #43690,*
.line 26
;>>>> *PCDATDIR=*PCDATDIR|0x2000; //PC5 is output//
LACK 8192
ADRK 119
OR *
SACL * ,AR0
.line 29
;>>>> OUTPUT = 0xffff;
LACK 65535
SACL *
OUT * ,02000h,AR3
.line 31
;>>>> read_flag = 0;
SBRK 6
LDPK _read_flag
SAR AR3,_read_flag
.line 32
;>>>> Encode_counter = 0 ;
LACK 0
SACL _Encode_counter
SACH _Encode_counter+1
.line 33
;>>>> Maxest_counter = 0;
SACL _Maxest_counter
SACH _Maxest_counter+1
.line 34
;>>>> pc_qubai=0x0;
SACL _pc_qubai
.line 35
;>>>> pc_tuixiao=0x0;
SACL _pc_tuixiao
.line 36
;>>>> pc_impact=0x0;
SACL _pc_impact
.line 37
;>>>> pc_fangbai=0x0;
SACL _pc_fangbai
.line 38
;>>>> outputbuf=0xffff;
SPLK #65535,_outputbuf
.line 39
;>>>> cParaNo = 0xff;
ADRK 255
LDPK _cParaNo
SAR AR3,_cParaNo
.line 40
;>>>> Len_RecChar=0;
LDPK _Len_RecChar
SACL _Len_RecChar
.line 41
;>>>> uiRecNum=0;
LDPK _uiRecNum
SACL _uiRecNum
.line 42
;>>>> auto_qubai=0;
LDPK _auto_qubai
SACL _auto_qubai
.line 43
;>>>> autoUp_flag=1;
SBRK 254
LDPK _autoUp_flag
SAR AR3,_autoUp_flag
.line 44
;>>>> wr_flag=0;
MAR * ,AR2
LARK AR2,1
MAR *0+
SACL *
.line 45
;>>>> for(i=0;i<14;i++)
ADRK 6
SACL *
ZALS *
SUBK 14
BGEZ L2
L1:
.line 47
;>>>> ucinput[i]=0;
;>>>> //------------------//
;>>>> // *PADATDIR=*PADATDIR|0xff00; //PA: is output//
LAC * ,AR0
ADLK _ucinput+0,0
SACL *
LAR AR3,* ,AR3
LACK 0
SACL * ,AR2
.line 45
LAC *
ADDK 1
SACL *
ZALS *
SUBK 14
BLZ L1
L2:
.line 52
;>>>> *PBDATDIR=*PBDATDIR|0xfdff; //IOPB1 is in, others out IOPB4:term
LARK AR3,28826
LACK 65023
MAR * ,AR3
OR *
SACL * ,AR1
.line 54
;>>>> delay(0);
LACK 0
SACL *+
CALL _delay
MAR *-
.line 55
;>>>> uipreangle = (unsigned int)(ReadPara(0x100,8));
LACK 8
SACL *+
LACK 256
SACL *+
CALL _ReadPara
SBRK 2
LDPK _uipreangle
SACL _uipreangle
.line 56
;>>>> delay(0xff);
LACK 255
SACL *+
CALL _delay
MAR *-
.line 57
;>>>> ulAutoUpPara = ReadPara(0x200,8);
LACK 8
SACL *+
LACK 512
SACL *+
CALL _ReadPara
SBRK 2
LDPK _ulAutoUpPara
SACL _ulAutoUpPara
SACH _ulAutoUpPara+1
.line 58
;>>>> uiAutoUpPara4 = (unsigned int)(ulAutoUpPara%100/2);
LACK 100
SACL *+
SACH *+
ZALS _ulAutoUpPara
ADDH _ulAutoUpPara+1
CALL L$$MODU
RSXM
SFR
SACL _uiAutoUpPara4
.line 59
;>>>> ulAutoUpPara = ulAutoUpPara/100;
LACK 100
SACL *+
SACH *+
ZALS _ulAutoUpPara
ADDH _ulAutoUpPara+1
CALL L$$DIVU
SACL _ulAutoUpPara
SACH _ulAutoUpPara+1
.line 60
;>>>> uiAutoUpPara3 = (unsigned int)(ulAutoUpPara%100/2);
LACK 100
SACL *+
SACH *+
ZALS _ulAutoUpPara
ADDH _ulAutoUpPara+1
CALL L$$MODU
RSXM
SFR
SACL _uiAutoUpPara3
.line 61
;>>>> ulAutoUpPara = ulAutoUpPara/100;
LACK 100
SACL *+
SACH *+
ZALS _ulAutoUpPara
ADDH _ulAutoUpPara+1
CALL L$$DIVU
SACL _ulAutoUpPara
SACH _ulAutoUpPara+1
.line 62
;>>>> uiAutoUpPara2 = (unsigned int)(ulAutoUpPara%100/2);
LACK 100
SACL *+
SACH *+
ZALS _ulAutoUpPara
ADDH _ulAutoUpPara+1
CALL L$$MODU
RSXM
SFR
SACL _uiAutoUpPara2
.line 63
;>>>> ulAutoUpPara = ulAutoUpPara/100;
LACK 100
SACL *+
SACH *+
ZALS _ulAutoUpPara
ADDH _ulAutoUpPara+1
CALL L$$DIVU
SACL _ulAutoUpPara
SACH _ulAutoUpPara+1
.line 64
;>>>> uiAutoUpPara1 = (unsigned int)(ulAutoUpPara%100/2);
LACK 100
SACL *+
SACH *+
ZALS _ulAutoUpPara
ADDH _ulAutoUpPara+1
CALL L$$MODU
RSXM
SFR
SACL _uiAutoUpPara1
.line 66
;>>>> sci_init();
CALL _sci_init
.line 67
;>>>> QEPINIT();
;>>>> // test24C16();
;>>>> while(1)
;>>>> // LEDTest(5); //LED TEST 原有//
;>>>> // OUTPUT = 0xffff;
;>>>> //--------------------------------后加
CALL _QEPINIT
L3:
.line 75
;>>>> if (test ==0)
LDPK _test
LAC _test
BNZ L5
.line 77
;>>>> test = 1;
LACK 1
SACL _test
B L6
L5:
.line 79
;>>>> else test = 0;
LACK 0
SACL _test
L6:
.line 81
;>>>> if((Encode_counter & 0xffff) < 0x7fff)
ZALS _Encode_counter
ANDK 65535
MAR * ,AR2
LARK AR2,18
MAR *0+
SACL *+
SACH *-
LT *+
MPYK 1
LPH *
LACK 32767
SPAC
BNC L7
BZ L7
.line 83
;>>>> Maxest_counter = MaxerQep();
;>>>> else
CALL _MaxerQep,AR1
LDPK _Maxest_counter
SACL _Maxest_counter
SACH _Maxest_counter+1
B L8
L7:
.line 87
;>>>> Maxer_counter = 0;
LACK 0
SACL _Maxer_counter
SACH _Maxer_counter+1
L8:
.line 89
;>>>> Encode_counter =(unsigned long) *T2CNT;
LARK AR3,29701
MAR * ,AR3
ZALS * ,AR4
SACL _Encode_counter
SACH _Encode_counter+1
.line 91
;>>>> TERM_L;
;>>>> // OUTPUT = 0xffff;
LARK AR4,28826
LACK 65519
AND *
SACL * ,AR1
.line 95
;>>>> delay(050);
;>>>> // OUTPUT = 0xFDFF;
LACK 40
SACL *+
CALL _delay
MAR *-,AR3
.line 98
;>>>> TERM_H;
LARK AR3,28826
LACK 4112
OR *
SACL *
.line 99
;>>>> DIE_L;
LACK 65531
AND *
SACL * ,AR1
.line 100
;>>>> key_code = ~keyscan();
CALL _keyscan
CMPL
LDPK _key_code
SACL _key_code
.line 102
;>>>> if(ucinput[5]==1 && ucinput[6] == 1)
LDPK _ucinput+5
LAC _ucinput+5
SUBK 1
BNZ L9
LDPK _ucinput+6
LAC _ucinput+6
SUBK 1
BNZ L9
.line 104
;>>>> SetQep(uipreangle);
BLKD _uipreangle+0,*+
CALL _SetQep
MAR *-
.line 105
;>>>> Maxer_counter = 0;
;>>>> //----置限位信号----------------------//
LACK 0
LDPK _Maxer_counter
SACL _Maxer_counter
SACH _Maxer_counter+1
L9:
.line 108
;>>>> ucSq = 0x0;
LACK 0
LDPK _ucSq
SACL _ucSq
.line 109
;>>>> if(ucinput[5] == 1)
LDPK _ucinput+5
LAC _ucinput+5
SUBK 1
BNZ L10
.line 111
;>>>> ucSq = ucSq | 0x01;
;>>>> else
LACK 1
LDPK _ucSq
OR _ucSq
SACL _ucSq
B L11
L10:
.line 115
;>>>> ucSq = ucSq & 0xfe;
LACK 254
LDPK _ucSq
AND _ucSq
SACL _ucSq
L11:
.line 117
;>>>> if(ucinput[6] == 1)
LDPK _ucinput+6
LAC _ucinput+6
SUBK 1
BNZ L12
.line 119
;>>>> ucSq = ucSq | 0x02;
;>>>> else
LACK 2
LDPK _ucSq
OR _ucSq
SACL _ucSq
B L13
L12:
.line 123
;>>>> ucSq = ucSq & 0xfd;
LACK 253
LDPK _ucSq
AND _ucSq
SACL _ucSq
L13:
.line 125
;>>>> if(1==autoUp_flag)
SSXM
LDPK _autoUp_flag
LAC _autoUp_flag
SUBK 1
BNZ L14
.line 126
;>>>> AutoUp();
CALL _AutoUp
L14:
.line 127
;>>>> operation();
CALL _operation
.line 129
;>>>> DspAckSci();
CALL _DspAckSci
.line 130
;>>>> if(cParaNo == 0x40)
;>>>> //重置预 angle
SSXM
LDPK _cParaNo
LAC _cParaNo
SUBK 64
BNZ L15
.line 133
;>>>> EEPROM_LC256(comarr,0x100,0x00A1,8);
LACK 8
SACL *+
LACK 161
SACL *+
LACK 256
SACL *+,AR3
LARK AR3,8
MAR *0+,AR1
SAR AR3,*+
CALL _EEPROM_LC256
SBRK 4
.line 134
;>>>> for(i = 0;i<8;i++)
LACK 0
MAR * ,AR2
LARK AR2,7
MAR *0+
SACL *
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -