modbus.txt 11.7 KB
; generated by Component: ARM Compiler 5.06 update 6 (build 750) Tool: ArmCC [4d3637]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o.\flash\obj\modbus.o --asm_dir=.\Flash\List\ --list_dir=.\Flash\List\ --depend=.\flash\obj\modbus.d --cpu=Cortex-M4.fp --apcs=interwork -O1 --diag_suppress=9931,870 -I..\..\Libraries\CMSIS\Include -I..\..\Libraries\CMSIS\Device\ST\STM32F4xx\Include -I..\..\Libraries\STM32F4xx_StdPeriph_Driver\inc -I..\..\uCOS-III\uC-CPU -I..\..\uCOS-III\uC-LIB -I..\..\uCOS-III\uCOS-III\Ports -I..\..\uCOS-III\uCOS-III\Source -I..\..\uCOS-III\uC-CPU\ARM-Cortex-M4\RealView -I..\..\uCOS-III\uC-LIB\Ports\ARM-Cortex-M4\RealView -I..\..\uCOS-III\uCOS-III\Ports\ARM-Cortex-M4\Generic\RealView -I..\..\User -I..\..\User\bsp -I..\..\User\bsp\inc -I..\..\User\libapp -I..\..\RL-ARM\Config -I..\..\RL-ARM\Driver -I..\..\RL-ARM\RL-RTX\inc -I..\..\User\bsp\BSP -I..\..\RL-ARM\RL-CAN -I..\..\Libraries\DSP_LIB\Include -I..\..\MODBUS\modbus\rtu -I..\..\MODBUS\BARE\port -I..\..\MODBUS\modbus\include -I..\..\User\bsp\BSP -I..\..\PLC -I..\..\Avoid -I..\..\User\parameter -I..\..\User\LaserMotionCtr -I..\..\User\W5100S -I..\..\User\bsp -I..\..\User\CHASSIS -I..\..\User\CONTROLFUNCTION -I..\..\User\DATAUPDATE -I..\..\User\HARAWARE -I..\..\User\MOTORDRIVER -I..\..\User\NAVAGATION -I..\..\User\PLATFORM -I..\..\User\SENSOR -I.\RTE\_Flash -IC:\Users\YDJ\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Include -IC:\Users\YDJ\AppData\Local\Arm\Packs\Keil\STM32F4xx_DFP\2.13.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include -D__UVISION_VERSION=527 -D_RTE_ -DSTM32F407xx -DUSE_STDPERIPH_DRIVER -DSTM32F40_41xxx -D__RTX -D__FPU_USED=1 --omf_browse=.\flash\obj\modbus.crf ..\..\User\libapp\modbus.c]
                          THUMB

                          AREA ||i.eMBRegCoilsCB||, CODE, READONLY, ALIGN=1

                  eMBRegCoilsCB PROC
;;;107    eMBErrorCode
;;;108    eMBRegCoilsCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNCoils, eMBRegisterMode eMode )
000000  2000              MOVS     r0,#0
;;;109    {
;;;110    	eMBErrorCode    eStatus = MB_ENOERR;
;;;111    //	int             iRegIndex;
;;;112    
;;;113    
;;;114    //	if((usAddress >= REG_HOLDING_START)&&\
;;;115    //		((usAddress+usNCoils) <= (REG_HOLDING_START + REG_HOLDING_NREGS)))
;;;116    //	{
;;;117    //		iRegIndex = (int)(usAddress - usRegHoldingStart);
;;;118    //		switch(eMode)
;;;119    //		{                                       
;;;120    //			case MB_REG_READ://¶Á MB_REG_READ = 0
;;;121    //        while(usNCoils > 0)
;;;122    //				{
;;;123    // 					*pucRegBuffer++ = (u8)(usRegHoldingBuf[iRegIndex] >> 8);            
;;;124    // 					*pucRegBuffer++ = (u8)(usRegHoldingBuf[iRegIndex] & 0xFF); 
;;;125    //          iRegIndex++;
;;;126    //          usNCoils--;					
;;;127    //				}                            
;;;128    //        break;
;;;129    //			case MB_REG_WRITE://д MB_REG_WRITE = 1
;;;130    //				while(usNCoils > 0)
;;;131    //				{         
;;;132    // 					usRegHoldingBuf[iRegIndex] = *pucRegBuffer++ << 8;
;;;133    //           usRegHoldingBuf[iRegIndex] |= *pucRegBuffer++;
;;;134    //          iRegIndex++;
;;;135    //          usNCoils--;
;;;136    //        }				
;;;137    //			}
;;;138    //	}
;;;139    //	else//´íÎó
;;;140    //	{
;;;141    //		eStatus = MB_ENOREG;
;;;142    //	}	
;;;143    //	
;;;144    	return eStatus;
;;;145    }
000002  4770              BX       lr
;;;146    /****************************************************************************
                          ENDP


                          AREA ||i.eMBRegDiscreteCB||, CODE, READONLY, ALIGN=1

                  eMBRegDiscreteCB PROC
;;;155    eMBErrorCode
;;;156    eMBRegDiscreteCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNDiscrete )
000000  2001              MOVS     r0,#1
;;;157    {
;;;158    //    ( void )pucRegBuffer;
;;;159    //    ( void )usAddress;
;;;160    //    ( void )usNDiscrete;
;;;161        return MB_ENOREG;
;;;162    }
000002  4770              BX       lr
                          ENDP


                          AREA ||i.eMBRegHoldingCB||, CODE, READONLY, ALIGN=2

                  eMBRegHoldingCB PROC
;;;52     eMBErrorCode
;;;53     eMBRegHoldingCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs, eMBRegisterMode eMode )
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;54     {
000004  4605              MOV      r5,r0
000006  4614              MOV      r4,r2
;;;55     	eMBErrorCode    eStatus = MB_ENOERR;
000008  2700              MOVS     r7,#0
;;;56     	int             iRegIndex;
;;;57         u16 *PRT=(u16*)pucRegBuffer;
;;;58     
;;;59     	if((usAddress >= REG_HOLDING_START)&&
00000a  1908              ADDS     r0,r1,r4
00000c  f5b06f7a          CMP      r0,#0xfa0
000010  d822              BHI      |L3.88|
;;;60     		((usAddress+usNRegs) <= (REG_HOLDING_START + REG_HOLDING_NREGS)))
;;;61     	{
;;;62     		iRegIndex = (int)(usAddress - usRegHoldingStart);
000012  4813              LDR      r0,|L3.96|
000014  8840              LDRH     r0,[r0,#2]  ; usRegHoldingStart
000016  1a0e              SUBS     r6,r1,r0
;;;63     		switch(eMode)
;;;64     		{                                       
;;;65     			case MB_REG_READ://¶Á MB_REG_READ = 0
;;;66             while(usNRegs > 0)
;;;67     				{
;;;68                         *PRT++ = __REV16(usRegHoldingBuf[iRegIndex++]);
000018  f8df8048          LDR      r8,|L3.100|
00001c  b163              CBZ      r3,|L3.56|
00001e  2b01              CMP      r3,#1                 ;63
000020  d11b              BNE      |L3.90|
000022  e016              B        |L3.82|
                  |L3.36|
000024  4630              MOV      r0,r6
000026  1c76              ADDS     r6,r6,#1
000028  f8380010          LDRH     r0,[r8,r0,LSL #1]
00002c  f7fffffe          BL       __asm___8_modbus_c_38e931c6____REV16
000030  f8250b02          STRH     r0,[r5],#2
;;;69     					//*pucRegBuffer++ = (u8)(usRegHoldingBuf[iRegIndex] >> 8);            
;;;70     					//*pucRegBuffer++ = (u8)(usRegHoldingBuf[iRegIndex] & 0xFF); 
;;;71                         //iRegIndex++;
;;;72                         usNRegs--;					
000034  1e64              SUBS     r4,r4,#1
000036  b2a4              UXTH     r4,r4
                  |L3.56|
000038  2c00              CMP      r4,#0                 ;66
00003a  d1f3              BNE      |L3.36|
00003c  e00d              B        |L3.90|
                  |L3.62|
;;;73     				}                            
;;;74             break;
;;;75     			case MB_REG_WRITE://д MB_REG_WRITE = 0
;;;76     				while(usNRegs > 0)
;;;77     				{     
;;;78                         usRegHoldingBuf[iRegIndex++] = __REV16(*PRT++);                    
00003e  f8350b02          LDRH     r0,[r5],#2
000042  f7fffffe          BL       __asm___8_modbus_c_38e931c6____REV16
000046  4631              MOV      r1,r6
000048  1c76              ADDS     r6,r6,#1
00004a  f8280011          STRH     r0,[r8,r1,LSL #1]
;;;79     					//usRegHoldingBuf[iRegIndex] = *pucRegBuffer++ << 8;
;;;80                        // usRegHoldingBuf[iRegIndex] |= *pucRegBuffer++;
;;;81                         //iRegIndex++;
;;;82                         usNRegs--;
00004e  1e64              SUBS     r4,r4,#1
000050  b2a4              UXTH     r4,r4
                  |L3.82|
000052  2c00              CMP      r4,#0                 ;76
000054  d1f3              BNE      |L3.62|
000056  e000              B        |L3.90|
                  |L3.88|
;;;83                     }				
;;;84             }
;;;85     	}
;;;86     	else//´íÎó
;;;87     	{
;;;88     		eStatus = MB_ENOREG;
000058  2701              MOVS     r7,#1
                  |L3.90|
;;;89     	}	
;;;90     	
;;;91     	return eStatus;
00005a  4638              MOV      r0,r7
;;;92     }
00005c  e8bd81f0          POP      {r4-r8,pc}
;;;93     
                          ENDP

                  |L3.96|
                          DCD      ||.data||
                  |L3.100|
                          DCD      ||area_number.7||

                          AREA ||i.eMBRegInputCB||, CODE, READONLY, ALIGN=2

                  eMBRegInputCB PROC
;;;11     eMBErrorCode
;;;12     eMBRegInputCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT usNRegs )
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;13     {
000004  4605              MOV      r5,r0
000006  4614              MOV      r4,r2
;;;14         eMBErrorCode    eStatus = MB_ENOERR;
000008  2700              MOVS     r7,#0
;;;15         int             iRegIndex;
;;;16         u16 *PRT=(u16*)pucRegBuffer;
;;;17         
;;;18         if( ( usAddress >= REG_INPUT_START )
00000a  1908              ADDS     r0,r1,r4
00000c  2832              CMP      r0,#0x32
00000e  d812              BHI      |L4.54|
;;;19             && ( usAddress + usNRegs <= REG_INPUT_START + REG_INPUT_NREGS ) )
;;;20         {
;;;21             iRegIndex = ( int )( usAddress - usRegInputStart );
000010  480b              LDR      r0,|L4.64|
000012  8800              LDRH     r0,[r0,#0]  ; usRegInputStart
000014  1a0e              SUBS     r6,r1,r0
;;;22             while( usNRegs > 0 )
;;;23             {
;;;24                    *PRT++ = __REV16(usRegHoldingBuf[iRegIndex++]);
000016  f8df802c          LDR      r8,|L4.68|
00001a  e009              B        |L4.48|
                  |L4.28|
00001c  4630              MOV      r0,r6
00001e  1c76              ADDS     r6,r6,#1
000020  f8380010          LDRH     r0,[r8,r0,LSL #1]
000024  f7fffffe          BL       __asm___8_modbus_c_38e931c6____REV16
000028  f8250b02          STRH     r0,[r5],#2
;;;25              //   *pucRegBuffer++ = ( UCHAR )( usRegInputBuf[iRegIndex] >> 8 );
;;;26               //  *pucRegBuffer++ = ( UCHAR )( usRegInputBuf[iRegIndex] & 0xFF );
;;;27               //  iRegIndex++;
;;;28                 usNRegs--;
00002c  1e64              SUBS     r4,r4,#1
00002e  b2a4              UXTH     r4,r4
                  |L4.48|
000030  2c00              CMP      r4,#0                 ;22
000032  d1f3              BNE      |L4.28|
000034  e000              B        |L4.56|
                  |L4.54|
;;;29             }
;;;30         }
;;;31         else
;;;32         {
;;;33             eStatus = MB_ENOREG;
000036  2701              MOVS     r7,#1
                  |L4.56|
;;;34         }
;;;35     
;;;36         return eStatus;
000038  4638              MOV      r0,r7
;;;37     }
00003a  e8bd81f0          POP      {r4-r8,pc}
;;;38     
                          ENDP

00003e  0000              DCW      0x0000
                  |L4.64|
                          DCD      ||.data||
                  |L4.68|
                          DCD      ||area_number.7||

                          AREA ||.bss||, DATA, NOINIT, ALIGN=1

                  usRegInputBuf
                          %        100

                          AREA ||area_number.7||, DATA, NOINIT, ALIGN=1

                          EXPORTAS ||area_number.7||, ||.bss||
                  usRegHoldingBuf
                          %        8000

                          AREA ||.data||, DATA, ALIGN=1

                  usRegInputStart
000000  0000              DCW      0x0000
                  usRegHoldingStart
000002  0000              DCW      0x0000

;*** Start embedded assembler ***

#line 1 "..\\..\\User\\libapp\\modbus.c"
	AREA ||.rev16_text||, CODE
	THUMB
	EXPORT |__asm___8_modbus_c_38e931c6____REV16|
#line 129 "..\\..\\Libraries\\CMSIS\\Include\\core_cmInstr.h"
|__asm___8_modbus_c_38e931c6____REV16| PROC
#line 130

 rev16 r0, r0
 bx lr
	ENDP
	AREA ||.revsh_text||, CODE
	THUMB
	EXPORT |__asm___8_modbus_c_38e931c6____REVSH|
#line 144
|__asm___8_modbus_c_38e931c6____REVSH| PROC
#line 145

 revsh r0, r0
 bx lr
	ENDP
	AREA ||.rrx_text||, CODE
	THUMB
	EXPORT |__asm___8_modbus_c_38e931c6____RRX|
#line 300
|__asm___8_modbus_c_38e931c6____RRX| PROC
#line 301

 rrx r0, r0
 bx lr
	ENDP

;*** End   embedded assembler ***