###############################################################################
#                                                                             #
# IAR 8051 C/C++ Compiler V7.30B/W32                    12/Jun/2010  16:11:23 #
# Copyright 2004-2007 IAR Systems. All rights reserved.                       #
#                                                                             #
#    Core               =  plain                                              #
#    Code model         =  banked                                             #
#    Data model         =  large                                              #
#    Calling convention =  xdata reentrant                                    #
#    Constant location  =  data                                               #
#    Dptr setup         =  1,16                                               #
#    Source file        =  C:\Texas Instruments\ZStack-1.4.3-1.2.1\Components #
#                          \stack\zdo\ZDObject.c                              #
#    Command line       =  -f "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projec #
#                          ts\zstack\Samples\Location\CC2430DB\..\..\..\Tools #
#                          \CC2430DB\f8wRouter.cfg" (-DCPU32MHZ               #
#                          -DFORCE_MAC_NEAR -DROOT=__near_func                #
#                          -DMAC_CFG_APP_PENDING_QUEUE=TRUE -DRTR_NWK         #
#                          -DBLINK_LEDS "-DCONST=const __code"                #
#                          -DGENERIC=__generic) -f "C:\Texas                  #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\Tools\CC2430DB\f8w #
#                          Config.cfg" (-DSECURE=1 -DDEFAULT_CHANLIST=0x04000 #
#                          000 -DZDAPP_CONFIG_PAN_ID=0x00FF                   #
#                          -DNWK_START_DELAY=100 -DEXTENDED_JOINING_RANDOM_MA #
#                          SK=0x007F -DBEACON_REQUEST_DELAY=100               #
#                          -DBEACON_REQ_DELAY_MASK=0x00FF                     #
#                          -DROUTE_EXPIRY_TIME=30 -DAPSC_ACK_WAIT_DURATION_PO #
#                          LLED=3000 -DNWK_INDIRECT_MSG_TIMEOUT=7             #
#                          -DMAX_RREQ_ENTRIES=10 -DAPSC_MAX_FRAME_RETRIES=3   #
#                          -DNWK_MAX_DATA_RETRIES=2                           #
#                          -DMAX_POLL_FAILURE_RETRIES=2 -DMAX_BCAST=9         #
#                          -DAPS_MAX_GROUPS=16 -DMAX_RTG_ENTRIES=20           #
#                          -DNWK_MAX_BINDING_ENTRIES=10                       #
#                          -DMAX_BINDING_CLUSTER_IDS=5 "-DDEFAULT_KEY={0x02,  #
#                          0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x00,    #
#                          0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D}"         #
#                          -DRFD_RCVC_ALWAYS_ON=FALSE -DPOLL_RATE=1000        #
#                          -DQUEUED_POLL_RATE=100 -DRESPONSE_POLL_RATE=100)   #
#                          -DREJOIN_POLL_RATE=440 "C:\Texas                   #
#                          Instruments\ZStack-1.4.3-1.2.1\Components\stack\zd #
#                          o\ZDObject.c" -D CC2430EB -D LOCATION_REFNODE -D   #
#                          xNV_RESTORE -D ZTOOL_P1 -D MT_TASK -D              #
#                          POWER_SAVING -D HAL_UART_BIG_TX_BUF=1 -D           #
#                          SPI_MGR_DEFAULT_MAX_TX_BUFF=1024 -D                #
#                          SPI_MGR_DEFAULT_OVERFLOW=1 -lC "C:\Texas           #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\RefNode\List\" -lA          #
#                          "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projects\ #
#                          zstack\Samples\Location\CC2430DB\RefNode\List\"    #
#                          --diag_suppress Pe001,Pa010 --diag_remark pe550    #
#                          -o "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projec #
#                          ts\zstack\Samples\Location\CC2430DB\RefNode\Obj\"  #
#                          -e --require_prototypes -z9 --no_code_motion       #
#                          --debug --core=plain --dptr=16,1                   #
#                          --data_model=large --code_model=banked             #
#                          --calling_convention=xdata_reentrant               #
#                          --place_constants=data --nr_virtual_regs 8 -I      #
#                          "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projects\ #
#                          zstack\Samples\Location\CC2430DB\" -I "C:\Texas    #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\SOURCE\" -I "C:\Texas    #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\ZMAIN\TI2430DB\"   #
#                          -I "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projec #
#                          ts\zstack\Samples\Location\CC2430DB\..\..\..\..\.. #
#                          \COMPONENTS\MT\" -I "C:\Texas                      #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\H #
#                          AL\INCLUDE\" -I "C:\Texas                          #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\H #
#                          AL\TARGET\CC2430BB\" -I "C:\Texas                  #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\O #
#                          SAL\MCU\CCSOC\" -I "C:\Texas                       #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\O #
#                          SAL\INCLUDE\" -I "C:\Texas                         #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\S #
#                          TACK\AF\" -I "C:\Texas Instruments\ZStack-1.4.3-1. #
#                          2.1\Projects\zstack\Samples\Location\CC2430DB\..\. #
#                          .\..\..\..\COMPONENTS\STACK\NWK\" -I "C:\Texas     #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\S #
#                          TACK\SEC\" -I "C:\Texas Instruments\ZStack-1.4.3-1 #
#                          .2.1\Projects\zstack\Samples\Location\CC2430DB\..\ #
#                          ..\..\..\..\COMPONENTS\STACK\SYS\" -I "C:\Texas    #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\S #
#                          TACK\ZDO\" -I "C:\Texas Instruments\ZStack-1.4.3-1 #
#                          .2.1\Projects\zstack\Samples\Location\CC2430DB\..\ #
#                          ..\..\..\..\COMPONENTS\ZMAC\F8W\" -I "C:\Texas     #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\Z #
#                          MAC\" -I "C:\Texas Instruments\ZStack-1.4.3-1.2.1\ #
#                          Projects\zstack\Samples\Location\CC2430DB\..\..\.. #
#                          \..\..\COMPONENTS\SERVICES\SADDR\" -I "C:\Texas    #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\S #
#                          ERVICES\SDATA\" -I "C:\Texas                       #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\M #
#                          AC\INCLUDE\" -I "C:\Texas                          #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\M #
#                          AC\HIGH_LEVEL\" -I "C:\Texas                       #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\M #
#                          AC\LOW_LEVEL\SRF03\" -I "C:\Texas                  #
#                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sam #
#                          ples\Location\CC2430DB\..\..\..\..\..\COMPONENTS\M #
#                          AC\LOW_LEVEL\SRF03\SINGLE_CHIP\" -I "C:\Program    #
#                          Files\IAR Systems\Embedded Workbench 4.0           #
#                          Evaluation version\8051\INC\" -I "C:\Program       #
#                          Files\IAR Systems\Embedded Workbench 4.0           #
#                          Evaluation version\8051\INC\CLIB\"                 #
#    List file          =  C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projects\z #
#                          stack\Samples\Location\CC2430DB\RefNode\List\ZDObj #
#                          ect.lst                                            #
#    Object file        =  C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projects\z #
#                          stack\Samples\Location\CC2430DB\RefNode\Obj\ZDObje #
#                          ct.r51                                             #
#                                                                             #
#                                                                             #
###############################################################################

C:\Texas Instruments\ZStack-1.4.3-1.2.1\Components\stack\zdo\ZDObject.c
      1          /**************************************************************************************************
      2            Filename:       ZDObject.c
      3            Revised:        $Date: 2007-11-27 10:58:37 -0800 (Tue, 27 Nov 2007) $
      4            Revision:       $Revision: 15969 $
      5          
      6            Description:    This is the Zigbee Device Object.
      7          
      8          
      9            Copyright 2004-2007 Texas Instruments Incorporated. All rights reserved.
     10          
     11            IMPORTANT: Your use of this Software is limited to those specific rights
     12            granted under the terms of a software license agreement between the user
     13            who downloaded the software, his/her employer (which must be your employer)
     14            and Texas Instruments Incorporated (the "License").  You may not use this
     15            Software unless you agree to abide by the terms of the License. The License
     16            limits your use, and you acknowledge, that the Software may not be modified,
     17            copied or distributed unless embedded on a Texas Instruments microcontroller
     18            or used solely and exclusively in conjunction with a Texas Instruments radio
     19            frequency transceiver, which is integrated into your product.  Other than for
     20            the foregoing purpose, you may not use, reproduce, copy, prepare derivative
     21            works of, modify, distribute, perform, display or sell this Software and/or
     22            its documentation for any purpose.
     23          
     24            YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
     25            PROVIDED “AS IS?WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
     26            INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
     27            NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
     28            TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
     29            NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
     30            LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
     31            INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
     32            OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
     33            OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
     34            (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
     35          
     36            Should you have any questions regarding your right to use this Software,
     37            contact Texas Instruments Incorporated at www.TI.com.
     38          **************************************************************************************************/
     39          
     40          /*********************************************************************
     41           * INCLUDES
     42           */
     43          #include "ZComdef.h"
     44          #include "OSAL.h"
     45          #include "OSAL_Nv.h"
     46          #include "rtg.h"
     47          #include "NLMEDE.h"
     48          #include "nwk_globals.h"
     49          #include "APS.h"
     50          #include "APSMEDE.h"
     51          #include "AssocList.h"
     52          #include "BindingTable.h"
     53          #include "AddrMgr.h"
     54          #include "AF.h"
     55          #include "ZDObject.h"
     56          #include "ZDProfile.h"
     57          #include "ZDConfig.h"
     58          #include "ZDSecMgr.h"
     59          #include "ZDApp.h"
     60          #include "nwk_util.h"   // NLME_IsAddressBroadcast()
     61          #include "ZGlobals.h"
     62          
     63          #if defined( LCD_SUPPORTED )
     64            #include "OnBoard.h"
     65          #include "lcd128_64.h"
     66          #endif
     67          
     68          /* HAL */
     69          //#include "hal_lcd.h"
     70          
     71          
     72          /*********************************************************************
     73           * MACROS
     74           */
     75          
     76          /*********************************************************************
     77           * CONSTANTS
     78           */
     79          // NLME Stub Implementations
     80          #define ZDO_ProcessMgmtPermitJoinTimeout NLME_PermitJoiningTimeout
     81          
     82          // Status fields used by ZDO_ProcessMgmtRtgReq
     83          #define ZDO_MGMT_RTG_ENTRY_ACTIVE             0x00
     84          #define ZDO_MGMT_RTG_ENTRY_DISCOVERY_UNDERWAY 0x01
     85          #define ZDO_MGMT_RTG_ENTRY_DISCOVERY_FAILED   0x02
     86          #define ZDO_MGMT_RTG_ENTRY_INACTIVE           0x03
     87          
     88          #if !defined( CACHE_EP_MAX )
     89            #define CACHE_EP_MAX  15
     90          #endif
     91          
     92          /*********************************************************************
     93           * TYPEDEFS
     94           */
     95          #if defined ( REFLECTOR )
     96          typedef struct
     97          {
     98            byte SrcTransSeq;
     99            zAddrType_t SrcAddr;
    100            uint16 LocalCoordinator;
    101            byte epIntf;
    102            uint16 ProfileID;
    103            byte numInClusters;
    104            uint16 *inClusters;
    105            byte numOutClusters;
    106            uint16 *outClusters;
    107            byte SecurityUse;
    108            byte status;
    109          } ZDO_EDBind_t;
    110          #endif // defined ( REFLECTOR )
    111          
    112          #if defined ( ZDO_COORDINATOR )
    113          enum
    114          {
    115            ZDMATCH_INIT,           // Initialized
    116            ZDMATCH_WAIT_REQ,       // Received first request, waiting for second
    117            ZDMATCH_SENDING_BINDS   // Received both requests, sending unbind/binds
    118          };
    119          
    120          enum
    121          {
    122            ZDMATCH_SENDING_NOT,
    123            ZDMATCH_SENDING_UNBIND,
    124            ZDMATCH_SENDING_BIND
    125          };
    126          #endif
    127          
    128          /*********************************************************************
    129           * GLOBAL VARIABLES
    130           */
    131          #if defined ( ZDO_COORDINATOR )
    132            ZDMatchEndDeviceBind_t *matchED = (ZDMatchEndDeviceBind_t *)NULL;
    133          #endif
    134          
    135          /*********************************************************************
    136           * EXTERNAL VARIABLES
    137           */
    138          
    139          /*********************************************************************
    140           * EXTERNAL FUNCTIONS
    141           */
    142          
    143          /*********************************************************************
    144           * LOCAL VARIABLES
    145           */

   \                                 In  segment XDATA_Z, align 1, keep-with-next
    146          static uint16 ZDOBuildBuf[26];  // temp area to build data without allocation
   \                     ZDOBuildBuf:
   \   000000                DS 52
   \   000034                REQUIRE __INIT_XDATA_Z
    147          
    148          #if defined ( REFLECTOR )
    149          static ZDO_EDBind_t *ZDO_EDBind;     // Null when not used
    150          #endif
    151          
    152          #if defined ( MANAGED_SCAN )
    153            uint32 managedScanNextChannel = 0;
    154            uint32 managedScanChannelMask = 0;
    155            uint8  managedScanTimesPerChannel = 0;
    156          #endif
    157          
    158          /*********************************************************************
    159           * LOCAL FUNCTIONS
    160           */
    161          static void ZDODeviceSetup( void );
    162          #if defined ( MANAGED_SCAN )
    163            static void ZDOManagedScan_Next( void );
    164          #endif
    165          #if defined ( REFLECTOR )
    166            static void ZDO_RemoveEndDeviceBind( void );
    167            static void ZDO_SendEDBindRsp( byte TransSeq, zAddrType_t *dstAddr, byte Status, byte secUse );
    168          #endif
    169          #if defined ( ZDO_COORDINATOR )
    170            static byte ZDO_CompareClusterLists( byte numList1, uint16 *list1,
    171                                          byte numList2, uint16 *list2, uint16 *pMatches );
    172          #endif
    173          #if defined ( ZDO_COORDINATOR )
    174            static void ZDO_RemoveMatchMemory( void );
    175            static uint8 ZDO_CopyMatchInfo( ZDEndDeviceBind_t *destReq, ZDEndDeviceBind_t *srcReq );
    176            static void ZDO_EndDeviceBindMatchTimeoutCB( void );
    177          #endif
    178          uint8 *ZDO_ConvertOTAClusters( uint8 cnt, uint8 *inBuf, uint16 *outList );
    179          
    180          /*********************************************************************
    181           * @fn          ZDO_Init
    182           *
    183           * @brief       ZDObject and ZDProfile initialization.
    184           *
    185           * @param       none
    186           *
    187           * @return      none
    188           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    189          void ZDO_Init( void )
   \                     ZDO_Init:
    190          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 0
    191            // Initialize ZD items
    192            #if defined ( REFLECTOR )
    193            ZDO_EDBind = NULL;
    194            #endif
    195          
    196            // Setup the device - type of device to create.
    197            ZDODeviceSetup();
   \   000004                ; Setup parameters for call to function NLME_DeviceJoiningInit
   \   000004   12....       LCALL   ??NLME_DeviceJoiningInit?relay
    198          }
   \   000007                REQUIRE ?Subroutine118
   \   000007                ; // Fall through to label ?Subroutine118

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine118:
   \   000000   D083         POP     DPH
   \   000002   D082         POP     DPL
   \   000004   02....       LJMP    ?BRET
    199          
    200          #if defined ( MANAGED_SCAN )
    201          /*********************************************************************
    202           * @fn      ZDOManagedScan_Next()
    203           *
    204           * @brief   Setup a managed scan.
    205           *
    206           * @param   none
    207           *
    208           * @return  none
    209           */
    210          static void ZDOManagedScan_Next( void )
    211          {
    212            // Is it the first time
    213            if ( managedScanNextChannel == 0 && managedScanTimesPerChannel == 0 )
    214            {
    215              // Setup the defaults
    216              managedScanNextChannel  = 1;
    217          
    218              while( managedScanNextChannel && (zgDefaultChannelList & managedScanNextChannel) == 0 )
    219                managedScanNextChannel <<= 1;
    220          
    221              managedScanChannelMask = managedScanNextChannel;
    222              managedScanTimesPerChannel = MANAGEDSCAN_TIMES_PRE_CHANNEL;
    223            }
    224            else
    225            {
    226              // Do we need to go to the next channel
    227              if ( managedScanTimesPerChannel == 0 )
    228              {
    229                // Find next active channel
    230                managedScanChannelMask  = managedScanNextChannel;
    231                managedScanTimesPerChannel = MANAGEDSCAN_TIMES_PRE_CHANNEL;
    232              }
    233              else
    234              {
    235                managedScanTimesPerChannel--;
    236          
    237                if ( managedScanTimesPerChannel == 0 )
    238                {
    239                  managedScanNextChannel  <<= 1;
    240                  while( managedScanNextChannel && (zgDefaultChannelList & managedScanNextChannel) == 0 )
    241                    managedScanNextChannel <<= 1;
    242          
    243                  if ( managedScanNextChannel == 0 )
    244                    zdoDiscCounter  = NUM_DISC_ATTEMPTS + 1; // Stop
    245                }
    246              }
    247            }
    248          }
    249          #endif // MANAGED_SCAN
    250          
    251          /*********************************************************************
    252           * @fn      ZDODeviceSetup()
    253           *
    254           * @brief   Call set functions depending on the type of device compiled.
    255           *
    256           * @param   none
    257           *
    258           * @return  none
    259           */
    260          static void ZDODeviceSetup( void )
    261          {
    262          #if defined( ZDO_COORDINATOR )
    263            NLME_CoordinatorInit();
    264          #endif
    265          
    266          #if defined ( REFLECTOR )
    267            #if defined ( ZDO_COORDINATOR )
    268              APS_ReflectorInit( APS_REFLECTOR_PUBLIC );
    269            #else
    270              APS_ReflectorInit( APS_REFLECTOR_PRIVATE );
    271            #endif
    272          #endif
    273          
    274          #if !defined( ZDO_COORDINATOR ) || defined( SOFT_START )
    275            NLME_DeviceJoiningInit();
    276          #endif
    277          }
    278          
    279          /*********************************************************************
    280           * @fn          ZDO_StartDevice
    281           *
    282           * @brief       This function starts a device in a network.
    283           *
    284           * @param       logicalType     - Device type to start
    285           *              startMode       - indicates mode of device startup
    286           *              beaconOrder     - indicates time betwen beacons
    287           *              superframeOrder - indicates length of active superframe
    288           *
    289           * @return      none
    290           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    291          void ZDO_StartDevice( byte logicalType, devStartModes_t startMode, byte beaconOrder, byte superframeOrder )
   \                     ZDO_StartDevice:
    292          {
   \   000000   74F4         MOV     A,#-0xc
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 12
   \   000005                ; Auto size: 11
   \   000005   74F5         MOV     A,#-0xb
   \   000007   12....       LCALL   ?ALLOC_XSTACK8
    293            ZStatus_t ret;
    294          
    295            ret = ZUnsupportedMode;
    296          
    297          #if defined(ZDO_COORDINATOR)
    298            if ( logicalType == NODETYPE_COORDINATOR )
    299            {
    300              if ( startMode == MODE_HARD )
    301              {
    302                devState = DEV_COORD_STARTING;
    303                ret = NLME_NetworkFormationRequest( zgConfigPANID, zgDefaultChannelList,
    304                                                    zgDefaultStartingScanDuration, beaconOrder,
    305                                                    superframeOrder, false );
    306              }
    307              else if ( startMode == MODE_RESUME )
    308              {
    309                // Just start the coordinator
    310                devState = DEV_COORD_STARTING;
    311                ret = NLME_StartRouterRequest( beaconOrder, beaconOrder, false );
    312              }
    313              else
    314              {
    315          #if defined( LCD_SUPPORTED )
    316                //HalLcdWriteScreen( "StartDevice ERR", "MODE unknown" );
    317                ClearScreen();
    318                Print8(HAL_LCD_LINE_1,10,"StartDevice ERR",1);
    319                Print8(HAL_LCD_LINE_2,10,"MODE unknown",1);
    320          #endif
    321              }
    322            }
    323          #endif  // !ZDO_COORDINATOR
    324          
    325          //#if !defined ( ZDO_COORDINATOR ) || defined( SOFT_START )
    326            if ( logicalType == NODETYPE_ROUTER || logicalType == NODETYPE_DEVICE )
   \   00000A   7401         MOV     A,#0x1
   \   00000C   69           XRL     A,R1
   \   00000D   6005         JZ      ??ZDO_StartDevice_0
   \   00000F   7402         MOV     A,#0x2
   \   000011   69           XRL     A,R1
   \   000012   707C         JNZ     ??ZDO_StartDevice_1
    327            {
    328              if ( (startMode == MODE_JOIN) || (startMode == MODE_REJOIN) )
   \                     ??ZDO_StartDevice_0:
   \   000014   EA           MOV     A,R2
   \   000015   6005         JZ      ??ZDO_StartDevice_2
   \   000017   7403         MOV     A,#0x3
   \   000019   6A           XRL     A,R2
   \   00001A   7015         JNZ     ??ZDO_StartDevice_3
    329              {
    330                devState = DEV_NWK_DISC;
   \                     ??ZDO_StartDevice_2:
   \   00001C   7402         MOV     A,#0x2
   \   00001E   12....       LCALL   ?Subroutine18 & 0xFFFF
    331          
    332            #if defined( MANAGED_SCAN )
    333                ZDOManagedScan_Next();
    334                ret = NLME_NetworkDiscoveryRequest( managedScanChannelMask, BEACON_ORDER_15_MSEC );
    335            #else
    336                ret = NLME_NetworkDiscoveryRequest( zgDefaultChannelList, zgDefaultStartingScanDuration );
   \                     ??CrossCallReturnLabel_30:
   \   000021   12....       LCALL   ?L_MOV_X
   \   000024   AA..         MOV     R2,?V0 + 0
   \   000026   AB..         MOV     R3,?V0 + 1
   \   000028   AC..         MOV     R4,?V0 + 2
   \   00002A   AD..         MOV     R5,?V0 + 3
   \   00002C   12....       LCALL   ??NLME_NetworkDiscoveryRequest?relay
   \   00002F   805A         SJMP    ??ZDO_StartDevice_4
    337            #endif
    338              }
    339              else if ( startMode == MODE_RESUME )
   \                     ??ZDO_StartDevice_3:
   \   000031   7401         MOV     A,#0x1
   \   000033   6A           XRL     A,R2
   \   000034   705A         JNZ     ??ZDO_StartDevice_1
    340              {
    341                if ( logicalType == NODETYPE_ROUTER )
   \   000036   7401         MOV     A,#0x1
   \   000038   69           XRL     A,R1
   \   000039   703D         JNZ     ??ZDO_StartDevice_5
    342                {
    343                  ZMacScanCnf_t scanCnf;
    344                  devState = DEV_NWK_ORPHAN;
   \   00003B   740A         MOV     A,#0xa
   \   00003D   90....       MOV     DPTR,#devState
   \   000040   F0           MOVX    @DPTR,A
    345          
    346                  /* if router and nvram is available, fake successful orphan scan */
    347                  scanCnf.hdr.Status = ZSUCCESS;
   \   000041   7401         MOV     A,#0x1
   \   000043   12....       LCALL   ?XSTACK_DISP0_8
   \   000046   E4           CLR     A
   \   000047   F0           MOVX    @DPTR,A
    348                  scanCnf.ScanType = ZMAC_ORPHAN_SCAN;
   \   000048   7402         MOV     A,#0x2
   \   00004A   12....       LCALL   ?XSTACK_DISP0_8
   \   00004D   7403         MOV     A,#0x3
   \   00004F   F0           MOVX    @DPTR,A
    349                  scanCnf.UnscannedChannels = 0;
   \   000050   90....       MOV     DPTR,#__Constant_0
   \   000053   78..         MOV     R0,#?V0 + 0
   \   000055   12....       LCALL   ?L_MOV_X
   \   000058   7404         MOV     A,#0x4
   \   00005A   12....       LCALL   ?XSTACK_DISP0_8
   \   00005D   78..         MOV     R0,#?V0 + 0
   \   00005F   12....       LCALL   ?L_MOV_TO_X
    350                  scanCnf.ResultListSize = 0;
   \   000062   7408         MOV     A,#0x8
   \   000064   12....       LCALL   ?XSTACK_DISP0_8
   \   000067   E4           CLR     A
   \   000068   F0           MOVX    @DPTR,A
    351                  nwk_ScanJoiningOrphan(&scanCnf);
   \   000069                ; Setup parameters for call to function nwk_ScanJoiningOrphan
   \   000069   85..82       MOV     DPL,?XSP + 0
   \   00006C   85..83       MOV     DPH,?XSP + 1
   \   00006F   AA82         MOV     R2,DPL
   \   000071   AB83         MOV     R3,DPH
   \   000073   12....       LCALL   ??nwk_ScanJoiningOrphan?relay
    352          
    353                  ret = ZSuccess;
   \   000076   8028         SJMP    ??ZDO_StartDevice_6
    354                }
    355                else
    356                {
    357                  devState = DEV_NWK_ORPHAN;
   \                     ??ZDO_StartDevice_5:
   \   000078   740A         MOV     A,#0xa
   \   00007A   12....       LCALL   ?Subroutine18 & 0xFFFF
    358                  ret = NLME_OrphanJoinRequest( zgDefaultChannelList,
    359                                                zgDefaultStartingScanDuration );
   \                     ??CrossCallReturnLabel_31:
   \   00007D   12....       LCALL   ?L_MOV_X
   \   000080   AA..         MOV     R2,?V0 + 0
   \   000082   AB..         MOV     R3,?V0 + 1
   \   000084   AC..         MOV     R4,?V0 + 2
   \   000086   AD..         MOV     R5,?V0 + 3
   \   000088   12....       LCALL   ??NLME_OrphanJoinRequest?relay
   \                     ??ZDO_StartDevice_4:
   \   00008B   E9           MOV     A,R1
   \   00008C   FA           MOV     R2,A
    360                }
    361              }
    362              else
    363              {
    364          #if defined( LCD_SUPPORTED )
    365               // HalLcdWriteScreen( "StartDevice ERR", "MODE unknown" );
    366                Print8(HAL_LCD_LINE_1,10,"StartDevice ERR",1);
    367                Print8(HAL_LCD_LINE_2,10,"MODE unknown",1);
    368          #endif
    369              }
    370            }
    371          //#endif  //!ZDO COORDINATOR || SOFT_START
    372          
    373            if ( ret != ZSuccess )
   \   00008D   EA           MOV     A,R2
   \   00008E   6010         JZ      ??ZDO_StartDevice_6
    374              osal_start_timerEx(ZDAppTaskID, ZDO_NETWORK_INIT, NWK_RETRY_DELAY );
   \                     ??ZDO_StartDevice_1:
   \   000090                ; Setup parameters for call to function osal_start_timerEx
   \   000090   7CE8         MOV     R4,#-0x18
   \   000092   7D03         MOV     R5,#0x3
   \   000094   7A01         MOV     R2,#0x1
   \   000096   7B00         MOV     R3,#0x0
   \   000098   90....       MOV     DPTR,#ZDAppTaskID
   \   00009B   E0           MOVX    A,@DPTR
   \   00009C   F9           MOV     R1,A
   \   00009D   12....       LCALL   ??osal_start_timerEx?relay
    375          }
   \                     ??ZDO_StartDevice_6:
   \   0000A0   740B         MOV     A,#0xb
   \   0000A2   80..         SJMP    ?Subroutine119

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine18:
   \   000000   90....       MOV     DPTR,#devState
   \   000003   F0           MOVX    @DPTR,A
   \   000004                ; Setup parameters for call to function NLME_NetworkDiscoveryRequest
   \   000004                ; Setup parameters for call to function NLME_OrphanJoinRequest
   \   000004   90....       MOV     DPTR,#zgDefaultStartingScanDuration
   \   000007   E0           MOVX    A,@DPTR
   \   000008   F9           MOV     R1,A
   \   000009   90....       MOV     DPTR,#zgDefaultChannelList
   \   00000C   78..         MOV     R0,#?V0 + 0
   \   00000E   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine119:
   \   000000   12....       LCALL   ?DEALLOC_XSTACK8
   \                     ??Subroutine119_0:
   \   000003   7F04         MOV     R7,#0x4
   \   000005   02....       LJMP    ?BANKED_LEAVE_XDATA
    376          
    377          /*********************************************************************
    378           * @fn      ZDO_UpdateNwkStatus()
    379           *
    380           * @brief
    381           *
    382           *   This function will send an update message to each registered
    383           *   application endpoint/interface about a network status change.
    384           *
    385           * @param   none
    386           *
    387           * @return  none
    388           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    389          void ZDO_UpdateNwkStatus( devStates_t state )
   \                     ZDO_UpdateNwkStatus:
    390          {
   \   000000   74F4         MOV     A,#-0xc
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 12
   \   000005                ; Auto size: 0
   \   000005   89..         MOV     ?V0 + 0,R1
    391            // Endpoint/Interface descriptor list.
    392            epList_t *epDesc = epList;
   \   000007   90....       MOV     DPTR,#epList
   \   00000A   12....       LCALL   ??Subroutine56_0 & 0xFFFF
    393            byte bufLen = sizeof(osal_event_hdr_t);
    394            osal_event_hdr_t *msgPtr;
    395          
    396            ZDAppNwkAddr.addr.shortAddr = NLME_GetShortAddr();
   \                     ??CrossCallReturnLabel_108:
   \   00000D                ; Setup parameters for call to function NLME_GetShortAddr
   \   00000D   12....       LCALL   ??NLME_GetShortAddr?relay
   \   000010   90....       MOV     DPTR,#ZDAppNwkAddr
   \   000013   12....       LCALL   ?Subroutine26 & 0xFFFF
    397            (void)NLME_GetExtAddr();  // Load the saveExtAddr pointer.
   \                     ??CrossCallReturnLabel_47:
   \   000016                ; Setup parameters for call to function NLME_GetExtAddr
   \   000016   12....       LCALL   ??NLME_GetExtAddr?relay
   \   000019   802F         SJMP    ??CrossCallReturnLabel_109
    398          
    399            while ( epDesc )
    400            {
    401              if ( epDesc->epDesc->endPoint != ZDO_EP )
   \                     ??ZDO_UpdateNwkStatus_0:
   \   00001B   8E82         MOV     DPL,R6
   \   00001D   8F83         MOV     DPH,R7
   \   00001F   12....       LCALL   ?Subroutine36 & 0xFFFF
   \                     ??CrossCallReturnLabel_76:
   \   000022   601A         JZ      ??CrossCallReturnLabel_72
    402              {
    403                msgPtr = (osal_event_hdr_t *)osal_msg_allocate( bufLen );
   \   000024                ; Setup parameters for call to function osal_msg_allocate
   \   000024   7A02         MOV     R2,#0x2
   \   000026   7B00         MOV     R3,#0x0
   \   000028   12....       LCALL   ??osal_msg_allocate?relay
    404                if ( msgPtr )
   \   00002B   EA           MOV     A,R2
   \   00002C   7001         JNZ     ??ZDO_UpdateNwkStatus_1
   \   00002E   EB           MOV     A,R3
   \                     ??ZDO_UpdateNwkStatus_1:
   \   00002F   600D         JZ      ??CrossCallReturnLabel_72
    405                {
    406                  msgPtr->event = ZDO_STATE_CHANGE; // Command ID
   \   000031   74D1         MOV     A,#-0x2f
   \   000033   8A82         MOV     DPL,R2
   \   000035   8B83         MOV     DPH,R3
   \   000037   F0           MOVX    @DPTR,A
    407                  msgPtr->status = (byte)state;
   \   000038   12....       LCALL   ?Subroutine89 & 0xFFFF
    408          
    409                  osal_msg_send( *(epDesc->epDesc->task_id), (byte *)msgPtr );
   \                     ??CrossCallReturnLabel_319:
   \   00003B   12....       LCALL   ?Subroutine34 & 0xFFFF
    410                }
    411              }
    412              epDesc = epDesc->nextDesc;
   \                     ??CrossCallReturnLabel_72:
   \   00003E   8E82         MOV     DPL,R6
   \   000040   8F83         MOV     DPH,R7
   \   000042   A3           INC     DPTR
   \   000043   A3           INC     DPTR
   \   000044   A3           INC     DPTR
   \   000045   A3           INC     DPTR
   \   000046   A3           INC     DPTR
   \   000047   12....       LCALL   ??Subroutine56_0 & 0xFFFF
    413            }
   \                     ??CrossCallReturnLabel_109:
   \   00004A   EE           MOV     A,R6
   \   00004B   7001         JNZ     ??ZDO_UpdateNwkStatus_2
   \   00004D   EF           MOV     A,R7
   \                     ??ZDO_UpdateNwkStatus_2:
   \   00004E   70CB         JNZ     ??ZDO_UpdateNwkStatus_0
    414          }
   \   000050   80..         SJMP    ??Subroutine119_0

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine26:
   \   000000   EA           MOV     A,R2
   \                     ??Subroutine26_0:
   \   000001   F0           MOVX    @DPTR,A
   \   000002   A3           INC     DPTR
   \   000003   EB           MOV     A,R3
   \   000004   F0           MOVX    @DPTR,A
   \   000005   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine56:
   \   000000   F583         MOV     DPH,A
   \                     ??Subroutine56_0:
   \   000002   E0           MOVX    A,@DPTR
   \   000003   FE           MOV     R6,A
   \   000004   A3           INC     DPTR
   \   000005   E0           MOVX    A,@DPTR
   \   000006   FF           MOV     R7,A
   \   000007   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine105:
   \   000000   E0           MOVX    A,@DPTR
   \   000001   F8           MOV     R0,A
   \                     ??Subroutine105_0:
   \   000002   A3           INC     DPTR
   \                     ??Subroutine105_1:
   \   000003   E0           MOVX    A,@DPTR
   \   000004   F583         MOV     DPH,A
   \   000006   8882         MOV     DPL,R0
   \   000008   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine36:
   \   000000   12....       LCALL   ?Subroutine104 & 0xFFFF
   \                     ??CrossCallReturnLabel_221:
   \   000003   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine104:
   \   000000   E0           MOVX    A,@DPTR
   \                     ??Subroutine104_0:
   \   000001   F8           MOV     R0,A
   \   000002   A3           INC     DPTR
   \   000003   E0           MOVX    A,@DPTR
   \   000004   F583         MOV     DPH,A
   \   000006   8882         MOV     DPL,R0
   \   000008   E0           MOVX    A,@DPTR
   \   000009   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine34:
   \   000000   12....       LCALL   ?Subroutine105 & 0xFFFF
   \                     ??CrossCallReturnLabel_224:
   \   000003   A3           INC     DPTR
   \   000004   12....       LCALL   ?Subroutine104 & 0xFFFF
   \                     ??CrossCallReturnLabel_220:
   \   000007   F9           MOV     R1,A
   \   000008   12....       LCALL   ??osal_msg_send?relay
   \   00000B   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine130:
   \   000000   8E82         MOV     DPL,R6
   \   000002   8F83         MOV     DPH,R7
   \   000004   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine89:
   \   000000   A3           INC     DPTR
   \   000001   E5..         MOV     A,?V0 + 0
   \                     ??Subroutine89_0:
   \   000003   F0           MOVX    @DPTR,A
   \   000004                ; Setup parameters for call to function osal_msg_send
   \   000004                ; Setup parameters for call to function osal_memcpy
   \   000004   02....       LJMP    ?Subroutine130 & 0xFFFF
    415          
    416          #if defined ( REFLECTOR )
    417          /*********************************************************************
    418           * @fn          ZDO_RemoveEndDeviceBind
    419           *
    420           * @brief       Remove the end device bind
    421           *
    422           * @param  none
    423           *
    424           * @return      none
    425           */
    426          static void ZDO_RemoveEndDeviceBind( void )
    427          {
    428            if ( ZDO_EDBind )
    429            {
    430              // Free the RAM
    431              if ( ZDO_EDBind->inClusters )
    432                osal_mem_free( ZDO_EDBind->inClusters );
    433              if ( ZDO_EDBind->outClusters )
    434                osal_mem_free( ZDO_EDBind->outClusters );
    435              osal_mem_free( ZDO_EDBind );
    436              ZDO_EDBind = NULL;
    437            }
    438          }
    439          #endif // REFLECTOR
    440          
    441          #if defined ( REFLECTOR )
    442          /*********************************************************************
    443           * @fn          ZDO_RemoveEndDeviceBind
    444           *
    445           * @brief       Remove the end device bind
    446           *
    447           * @param  none
    448           *
    449           * @return      none
    450           */
    451          static void ZDO_SendEDBindRsp( byte TransSeq, zAddrType_t *dstAddr, byte Status, byte secUse )
    452          {
    453            ZDP_EndDeviceBindRsp( TransSeq, dstAddr, Status, secUse );
    454          
    455          #if defined(LCD_SUPPORTED )
    456           // HalLcdWriteString( "End Device Bind", HAL_LCD_LINE_1 );
    457            //Print6(HAL_LCD_LINE_1,10,"End Device Bind",1);
    458            Print8(HAL_LCD_LINE_1,10,"End Device Bind",1);
    459            if ( Status == ZDP_SUCCESS )
    460              //HalLcdWriteString( "Success Sent", HAL_LCD_LINE_2 );
    461              Print8(HAL_LCD_LINE_2,10,"Success Sent",1);
    462            else
    463             // HalLcdWriteString( "Timeout", HAL_LCD_LINE_2 );
    464              Print8(HAL_LCD_LINE_2,10,"Timeout",1);
    465          #endif
    466          
    467          }
    468          #endif // REFLECTOR
    469          
    470          #if defined ( ZDO_COORDINATOR )
    471          /*********************************************************************
    472           * @fn          ZDO_CompareClusterLists
    473           *
    474           * @brief       Compare one list to another list
    475           *
    476           * @param       numList1 - number of items in list 1
    477           * @param       list1 - first list of cluster IDs
    478           * @param       numList2 - number of items in list 2
    479           * @param       list2 - second list of cluster IDs
    480           * @param       pMatches - buffer to put matches
    481           *
    482           * @return      number of matches
    483           */
    484          static byte ZDO_CompareClusterLists( byte numList1, uint16 *list1,
    485                                    byte numList2, uint16 *list2, uint16 *pMatches )
    486          {
    487            byte x, y;
    488            uint16 z;
    489            byte numMatches = 0;
    490          
    491            // Check the first in against the seconds out
    492            for ( x = 0; x < numList1; x++ )
    493            {
    494              for ( y = 0; y < numList2; y++ )
    495              {
    496                z = list2[y];
    497                if ( list1[x] == z )
    498                  pMatches[numMatches++] = z;
    499              }
    500            }
    501          
    502            return ( numMatches );
    503          }
    504          #endif // ZDO_COORDINATOR
    505          
    506          
    507          /*********************************************************************
    508           * Utility functions
    509           */
    510          
    511          /*********************************************************************
    512           * @fn          ZDO_CompareByteLists
    513           *
    514           * @brief       Compares two lists for matches.
    515           *
    516           * @param       ACnt  - number of entries in list A
    517           * @param       AList  - List A
    518           * @param       BCnt  - number of entries in list B
    519           * @param       BList  - List B
    520           *
    521           * @return      true if a match is found
    522           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    523          byte ZDO_AnyClusterMatches( byte ACnt, uint16 *AList, byte BCnt, uint16 *BList )
   \                     ZDO_AnyClusterMatches:
    524          {
   \   000000   74F4         MOV     A,#-0xc
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 12
   \   000005                ; Auto size: 0
   \   000005   89..         MOV     ?V0 + 0,R1
   \   000007   8C..         MOV     ?V0 + 1,R4
   \   000009   740C         MOV     A,#0xc
   \   00000B   12....       LCALL   ?XSTACK_DISP0_8
   \   00000E   12....       LCALL   ?Subroutine103 & 0xFFFF
    525            byte x, y;
    526          
    527            for ( x = 0; x < ACnt; x++ )
   \                     ??CrossCallReturnLabel_215:
   \   000011   75..00       MOV     ?V0 + 3,#0x0
   \   000014   8002         SJMP    ??ZDO_AnyClusterMatches_0
   \                     ??ZDO_AnyClusterMatches_1:
   \   000016   05..         INC     ?V0 + 3
   \                     ??ZDO_AnyClusterMatches_0:
   \   000018   E5..         MOV     A,?V0 + 3
   \   00001A   C3           CLR     C
   \   00001B   95..         SUBB    A,?V0 + 0
   \   00001D   503C         JNC     ??ZDO_AnyClusterMatches_2
    528            {
    529              for ( y = 0; y < BCnt; y++ )
   \   00001F   75..00       MOV     ?V0 + 2,#0x0
   \   000022   8002         SJMP    ??ZDO_AnyClusterMatches_3
   \                     ??ZDO_AnyClusterMatches_4:
   \   000024   05..         INC     ?V0 + 2
   \                     ??ZDO_AnyClusterMatches_3:
   \   000026   E5..         MOV     A,?V0 + 2
   \   000028   C3           CLR     C
   \   000029   95..         SUBB    A,?V0 + 1
   \   00002B   50E9         JNC     ??ZDO_AnyClusterMatches_1
    530              {
    531                if ( AList[x] == BList[y] )
   \   00002D   E5..         MOV     A,?V0 + 3
   \   00002F   C3           CLR     C
   \   000030   33           RLC     A
   \   000031   FC           MOV     R4,A
   \   000032   E4           CLR     A
   \   000033   33           RLC     A
   \   000034   FD           MOV     R5,A
   \   000035   EA           MOV     A,R2
   \   000036   2C           ADD     A,R4
   \   000037   F582         MOV     DPL,A
   \   000039   EB           MOV     A,R3
   \   00003A   3D           ADDC    A,R5
   \   00003B   12....       LCALL   ?Subroutine56 & 0xFFFF
   \                     ??CrossCallReturnLabel_110:
   \   00003E   E5..         MOV     A,?V0 + 2
   \   000040   C3           CLR     C
   \   000041   33           RLC     A
   \   000042   FC           MOV     R4,A
   \   000043   E4           CLR     A
   \   000044   33           RLC     A
   \   000045   FD           MOV     R5,A
   \   000046   E8           MOV     A,R0
   \   000047   2C           ADD     A,R4
   \   000048   F582         MOV     DPL,A
   \   00004A   E9           MOV     A,R1
   \   00004B   3D           ADDC    A,R5
   \   00004C   F583         MOV     DPH,A
   \   00004E   E0           MOVX    A,@DPTR
   \   00004F   6E           XRL     A,R6
   \   000050   7003         JNZ     ??ZDO_AnyClusterMatches_5
   \   000052   A3           INC     DPTR
   \   000053   E0           MOVX    A,@DPTR
   \   000054   6F           XRL     A,R7
   \                     ??ZDO_AnyClusterMatches_5:
   \   000055   70CD         JNZ     ??ZDO_AnyClusterMatches_4
    532                {
    533                  return true;
   \   000057   7901         MOV     R1,#0x1
   \   000059   8002         SJMP    ??ZDO_AnyClusterMatches_6
    534                }
    535              }
    536            }
    537          
    538            return false;
   \                     ??ZDO_AnyClusterMatches_2:
   \   00005B   7900         MOV     R1,#0x0
   \                     ??ZDO_AnyClusterMatches_6:
   \   00005D   80..         SJMP    ??Subroutine119_0
    539          }

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine103:
   \   000000   E0           MOVX    A,@DPTR
   \   000001   F8           MOV     R0,A
   \   000002   A3           INC     DPTR
   \   000003   E0           MOVX    A,@DPTR
   \   000004   F9           MOV     R1,A
   \   000005   22           RET
    540          
    541          /*********************************************************************
    542           * Callback functions from ZDProfile
    543           */
    544          
    545          /*********************************************************************
    546           * @fn          ZDO_ProcessNodeDescReq
    547           *
    548           * @brief       This function processes and responds to the
    549           *              Node_Desc_req message.
    550           *
    551           * @param       inMsg - incoming message
    552           *
    553           * @return      none
    554           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    555          void ZDO_ProcessNodeDescReq( zdoIncomingMsg_t *inMsg )
   \                     ZDO_ProcessNodeDescReq:
    556          {
   \   000000   74F6         MOV     A,#-0xa
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 10
   \   000005                ; Auto size: 0
   \   000005   12....       LCALL   ?Subroutine35 & 0xFFFF
    557            uint16 aoi = BUILD_UINT16( inMsg->asdu[0], inMsg->asdu[1] );
    558            NodeDescriptorFormat_t *desc = NULL;
    559          
    560            if ( aoi == ZDAppNwkAddr.addr.shortAddr )
   \                     ??CrossCallReturnLabel_74:
   \   000008   7003         JNZ     ??ZDO_ProcessNodeDescReq_0
   \   00000A   A3           INC     DPTR
   \   00000B   E0           MOVX    A,@DPTR
   \   00000C   6D           XRL     A,R5
   \                     ??ZDO_ProcessNodeDescReq_0:
   \   00000D   7017         JNZ     ??ZDO_ProcessNodeDescReq_1
    561            {
    562              desc = &ZDO_Config_Node_Descriptor;
    563            }
    564          
    565            if ( desc != NULL )
    566            {
    567              ZDP_NodeDescMsg( inMsg, aoi, desc );
   \   00000F                ; Setup parameters for call to function ZDP_NodeDescMsg
   \   00000F   75....       MOV     ?V0 + 0,#(ZDO_Config_Node_Descriptor & 0xff)
   \   000012   75....       MOV     ?V0 + 1,#((ZDO_Config_Node_Descriptor >> 8) & 0xff)
   \   000015   78..         MOV     R0,#?V0 + 0
   \   000017   12....       LCALL   ?PUSH_XSTACK_I_TWO
   \   00001A   EE           MOV     A,R6
   \   00001B   FA           MOV     R2,A
   \   00001C   12....       LCALL   ??ZDP_NodeDescMsg?relay
   \   00001F   7402         MOV     A,#0x2
   \   000021   12....       LCALL   ?DEALLOC_XSTACK8
   \   000024   801A         SJMP    ??ZDO_ProcessNodeDescReq_2
    568            }
    569            else
    570            {
    571              ZDP_GenericRsp( inMsg->TransSeq, &(inMsg->srcAddr),
    572                        ZDP_INVALID_REQTYPE, aoi, Node_Desc_rsp, inMsg->SecurityUse );
   \                     ??ZDO_ProcessNodeDescReq_1:
   \   000026                ; Setup parameters for call to function ZDP_GenericRsp
   \   000026   75..02       MOV     ?V0 + 0,#0x2
   \   000029   75..80       MOV     ?V0 + 1,#-0x80
   \   00002C   78..         MOV     R0,#?V0 + 0
   \   00002E   12....       LCALL   ?PUSH_XSTACK_I_TWO
   \   000031   8C..         MOV     ?V0 + 0,R4
   \   000033   8D..         MOV     ?V0 + 1,R5
   \   000035   78..         MOV     R0,#?V0 + 0
   \   000037   12....       LCALL   ?PUSH_XSTACK_I_TWO
   \   00003A   12....       LCALL   ?Subroutine31 & 0xFFFF
   \                     ??CrossCallReturnLabel_63:
   \   00003D   12....       LCALL   ?DEALLOC_XSTACK8
    573            }
    574          }
   \                     ??ZDO_ProcessNodeDescReq_2:
   \   000040   80..         SJMP    ??Subroutine132_0

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine132:
   \   000000   F0           MOVX    @DPTR,A
   \                     ??Subroutine132_0:
   \   000001   7F02         MOV     R7,#0x2
   \   000003   02....       LJMP    ?BANKED_LEAVE_XDATA

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine35:
   \   000000   EA           MOV     A,R2
   \   000001   FE           MOV     R6,A
   \   000002   EB           MOV     A,R3
   \   000003   FF           MOV     R7,A
   \   000004   12....       LCALL   ?Subroutine106 & 0xFFFF
   \                     ??CrossCallReturnLabel_230:
   \   000007   12....       LCALL   ?Subroutine102 & 0xFFFF
   \                     ??CrossCallReturnLabel_318:
   \   00000A   12....       LCALL   ?Subroutine121 & 0xFFFF
   \                     ??CrossCallReturnLabel_266:
   \   00000D   FC           MOV     R4,A
   \   00000E   E9           MOV     A,R1
   \   00000F   FD           MOV     R5,A
   \   000010   90....       MOV     DPTR,#ZDAppNwkAddr
   \   000013   E0           MOVX    A,@DPTR
   \   000014   6C           XRL     A,R4
   \   000015   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine102:
   \   000000   3400         ADDC    A,#0x0
   \   000002   F583         MOV     DPH,A
   \   000004   E0           MOVX    A,@DPTR
   \                     ??Subroutine102_0:
   \   000005   F8           MOV     R0,A
   \   000006   A3           INC     DPTR
   \   000007   E0           MOVX    A,@DPTR
   \   000008   F9           MOV     R1,A
   \   000009                REQUIRE ?Subroutine129
   \   000009                ; // Fall through to label ?Subroutine129

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine129:
   \   000000   8882         MOV     DPL,R0
   \   000002   8983         MOV     DPH,R1
   \   000004   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine31:
   \   000000   EE           MOV     A,R6
   \   000001   240E         ADD     A,#0xe
   \   000003   12....       LCALL   ?Subroutine108 & 0xFFFF
   \                     ??CrossCallReturnLabel_233:
   \   000006   FD           MOV     R5,A
   \   000007   7C80         MOV     R4,#-0x80
   \   000009   EE           MOV     A,R6
   \   00000A   2402         ADD     A,#0x2
   \   00000C   FA           MOV     R2,A
   \   00000D   EF           MOV     A,R7
   \   00000E   3400         ADDC    A,#0x0
   \   000010   FB           MOV     R3,A
   \   000011   EE           MOV     A,R6
   \   000012   240F         ADD     A,#0xf
   \   000014   12....       LCALL   ?Subroutine108 & 0xFFFF
   \                     ??CrossCallReturnLabel_234:
   \   000017   F9           MOV     R1,A
   \   000018   12....       LCALL   ??ZDP_GenericRsp?relay
   \   00001B   7404         MOV     A,#0x4
   \   00001D   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine108:
   \   000000   F582         MOV     DPL,A
   \   000002   EF           MOV     A,R7
   \                     ??Subroutine108_0:
   \   000003   3400         ADDC    A,#0x0
   \   000005   F583         MOV     DPH,A
   \   000007   E0           MOVX    A,@DPTR
   \   000008   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine106:
   \   000000   EE           MOV     A,R6
   \   000001   2411         ADD     A,#0x11
   \   000003   F582         MOV     DPL,A
   \   000005   EF           MOV     A,R7
   \   000006   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine121:
   \   000000   E0           MOVX    A,@DPTR
   \   000001   FA           MOV     R2,A
   \   000002   A3           INC     DPTR
   \   000003   E0           MOVX    A,@DPTR
   \   000004   F9           MOV     R1,A
   \   000005   EA           MOV     A,R2
   \   000006   22           RET
    575          
    576          /*********************************************************************
    577           * @fn          ZDO_ProcessPowerDescReq
    578           *
    579           * @brief       This function processes and responds to the
    580           *              Node_Power_req message.
    581           *
    582           * @param       inMsg  - incoming request
    583           *
    584           * @return      none
    585           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    586          void ZDO_ProcessPowerDescReq( zdoIncomingMsg_t *inMsg )
   \                     ZDO_ProcessPowerDescReq:
    587          {
   \   000000   74F6         MOV     A,#-0xa
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 10
   \   000005                ; Auto size: 0
   \   000005   12....       LCALL   ?Subroutine35 & 0xFFFF
    588            uint16 aoi = BUILD_UINT16( inMsg->asdu[0], inMsg->asdu[1] );
    589            NodePowerDescriptorFormat_t *desc = NULL;
    590          
    591            if ( aoi == ZDAppNwkAddr.addr.shortAddr )
   \                     ??CrossCallReturnLabel_75:
   \   000008   7003         JNZ     ??ZDO_ProcessPowerDescReq_0
   \   00000A   A3           INC     DPTR
   \   00000B   E0           MOVX    A,@DPTR
   \   00000C   6D           XRL     A,R5
   \                     ??ZDO_ProcessPowerDescReq_0:
   \   00000D   7017         JNZ     ??ZDO_ProcessPowerDescReq_1
    592            {
    593              desc = &ZDO_Config_Power_Descriptor;
    594            }
    595          
    596            if ( desc != NULL )
    597            {
    598              ZDP_PowerDescMsg( inMsg, aoi, desc );
   \   00000F                ; Setup parameters for call to function ZDP_PowerDescMsg
   \   00000F   75....       MOV     ?V0 + 0,#(ZDO_Config_Power_Descriptor & 0xff)
   \   000012   75....       MOV     ?V0 + 1,#((ZDO_Config_Power_Descriptor >> 8) & 0xff)
   \   000015   78..         MOV     R0,#?V0 + 0
   \   000017   12....       LCALL   ?PUSH_XSTACK_I_TWO
   \   00001A   EE           MOV     A,R6
   \   00001B   FA           MOV     R2,A
   \   00001C   12....       LCALL   ??ZDP_PowerDescMsg?relay
   \   00001F   7402         MOV     A,#0x2
   \   000021   12....       LCALL   ?DEALLOC_XSTACK8
   \   000024   801A         SJMP    ??ZDO_ProcessPowerDescReq_2
    599            }
    600            else
    601            {
    602              ZDP_GenericRsp( inMsg->TransSeq, &(inMsg->srcAddr),
    603                        ZDP_INVALID_REQTYPE, aoi, Power_Desc_rsp, inMsg->SecurityUse );
   \                     ??ZDO_ProcessPowerDescReq_1:
   \   000026                ; Setup parameters for call to function ZDP_GenericRsp
   \   000026   75..03       MOV     ?V0 + 0,#0x3
   \   000029   75..80       MOV     ?V0 + 1,#-0x80
   \   00002C   78..         MOV     R0,#?V0 + 0
   \   00002E   12....       LCALL   ?PUSH_XSTACK_I_TWO
   \   000031   8C..         MOV     ?V0 + 0,R4
   \   000033   8D..         MOV     ?V0 + 1,R5
   \   000035   78..         MOV     R0,#?V0 + 0
   \   000037   12....       LCALL   ?PUSH_XSTACK_I_TWO
   \   00003A   12....       LCALL   ?Subroutine31 & 0xFFFF
   \                     ??CrossCallReturnLabel_64:
   \   00003D   12....       LCALL   ?DEALLOC_XSTACK8
    604            }
    605          }
   \                     ??ZDO_ProcessPowerDescReq_2:
   \   000040   80..         SJMP    ??Subroutine132_0
    606          
    607          /*********************************************************************
    608           * @fn          ZDO_ProcessSimpleDescReq
    609           *
    610           * @brief       This function processes and responds to the
    611           *              Simple_Desc_req message.
    612           *
    613           * @param       inMsg - incoming message (request)
    614           *
    615           * @return      none
    616           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    617          void ZDO_ProcessSimpleDescReq( zdoIncomingMsg_t *inMsg )
   \                     ZDO_ProcessSimpleDescReq:
    618          {
   \   000000   74F6         MOV     A,#-0xa
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 10
   \   000005                ; Auto size: 2
   \   000005   74FE         MOV     A,#-0x2
   \   000007   12....       LCALL   ?ALLOC_XSTACK8
   \   00000A   EA           MOV     A,R2
   \   00000B   FE           MOV     R6,A
   \   00000C   EB           MOV     A,R3
   \   00000D   FF           MOV     R7,A
    619            SimpleDescriptionFormat_t *sDesc = NULL;
   \   00000E   85..82       MOV     DPL,?XSP + 0
   \   000011   85..83       MOV     DPH,?XSP + 1
   \   000014   E4           CLR     A
   \   000015   F0           MOVX    @DPTR,A
   \   000016   A3           INC     DPTR
   \   000017   F0           MOVX    @DPTR,A
    620            uint16 aoi = BUILD_UINT16( inMsg->asdu[0], inMsg->asdu[1] );
   \   000018   12....       LCALL   ?Subroutine106 & 0xFFFF
   \                     ??CrossCallReturnLabel_227:
   \   00001B   12....       LCALL   ??Subroutine44_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_92:
   \   00001E   FC           MOV     R4,A
   \   00001F   A3           INC     DPTR
   \   000020   E0           MOVX    A,@DPTR
   \   000021   FB           MOV     R3,A
   \   000022   E4           CLR     A
   \   000023   2C           ADD     A,R4
   \   000024   FA           MOV     R2,A
    621            byte endPoint = inMsg->asdu[2];
   \   000025   8882         MOV     DPL,R0
   \   000027   8983         MOV     DPH,R1
   \   000029   A3           INC     DPTR
   \   00002A   A3           INC     DPTR
   \   00002B   E0           MOVX    A,@DPTR
   \   00002C   F9           MOV     R1,A
    622            byte free = false;
   \   00002D   75..00       MOV     ?V0 + 0,#0x0
    623            byte stat = ZDP_SUCCESS;
   \   000030   75..00       MOV     ?V0 + 1,#0x0
    624          
    625            if ( (endPoint == ZDO_EP) || (endPoint > MAX_ENDPOINTS) )
   \   000033   6004         JZ      ??ZDO_ProcessSimpleDescReq_0
   \   000035   94F1         SUBB    A,#-0xf
   \   000037   4005         JC      ??ZDO_ProcessSimpleDescReq_1
    626            {
    627              stat = ZDP_INVALID_EP;
   \                     ??ZDO_ProcessSimpleDescReq_0:
   \   000039   75..82       MOV     ?V0 + 1,#-0x7e
   \   00003C   8031         SJMP    ??ZDO_ProcessSimpleDescReq_2
    628            }
    629            else if ( aoi == ZDAppNwkAddr.addr.shortAddr )
   \                     ??ZDO_ProcessSimpleDescReq_1:
   \   00003E   90....       MOV     DPTR,#ZDAppNwkAddr
   \   000041   E0           MOVX    A,@DPTR
   \   000042   6A           XRL     A,R2
   \   000043   7003         JNZ     ??ZDO_ProcessSimpleDescReq_3
   \   000045   A3           INC     DPTR
   \   000046   E0           MOVX    A,@DPTR
   \   000047   6B           XRL     A,R3
   \                     ??ZDO_ProcessSimpleDescReq_3:
   \   000048   7022         JNZ     ??ZDO_ProcessSimpleDescReq_4
    630            {
    631              free = afFindSimpleDesc( &sDesc, endPoint );
   \   00004A                ; Setup parameters for call to function afFindSimpleDesc
   \   00004A   85..82       MOV     DPL,?XSP + 0
   \   00004D   85..83       MOV     DPH,?XSP + 1
   \   000050   AA82         MOV     R2,DPL
   \   000052   AB83         MOV     R3,DPH
   \   000054   12....       LCALL   ??afFindSimpleDesc?relay
   \   000057   E9           MOV     A,R1
   \   000058   F5..         MOV     ?V0 + 0,A
    632              if ( sDesc == NULL )
   \   00005A   85..82       MOV     DPL,?XSP + 0
   \   00005D   85..83       MOV     DPH,?XSP + 1
   \   000060   E0           MOVX    A,@DPTR
   \   000061   7002         JNZ     ??ZDO_ProcessSimpleDescReq_5
   \   000063   A3           INC     DPTR
   \   000064   E0           MOVX    A,@DPTR
   \                     ??ZDO_ProcessSimpleDescReq_5:
   \   000065   7008         JNZ     ??ZDO_ProcessSimpleDescReq_2
    633              {
    634                stat = ZDP_NOT_ACTIVE;
   \   000067   75..83       MOV     ?V0 + 1,#-0x7d
   \   00006A   8003         SJMP    ??ZDO_ProcessSimpleDescReq_2
    635              }
    636            }
    637            else
    638            {
    639          #if defined ( RTR_NWK )
    640              stat = ZDP_DEVICE_NOT_FOUND;
   \                     ??ZDO_ProcessSimpleDescReq_4:
   \   00006C   75..81       MOV     ?V0 + 1,#-0x7f
    641          #else
    642              stat = ZDP_INVALID_REQTYPE;
    643          #endif
    644            }
    645          
    646            ZDP_SimpleDescMsg( inMsg, stat, sDesc );
   \                     ??ZDO_ProcessSimpleDescReq_2:
   \   00006F                ; Setup parameters for call to function ZDP_SimpleDescMsg
   \   00006F   85..82       MOV     DPL,?XSP + 0
   \   000072   85..83       MOV     DPH,?XSP + 1
   \   000075   E0           MOVX    A,@DPTR
   \   000076   FC           MOV     R4,A
   \   000077   A3           INC     DPTR
   \   000078   E0           MOVX    A,@DPTR
   \   000079   FD           MOV     R5,A
   \   00007A   A9..         MOV     R1,?V0 + 1
   \   00007C   EE           MOV     A,R6
   \   00007D   FA           MOV     R2,A
   \   00007E   EF           MOV     A,R7
   \   00007F   FB           MOV     R3,A
   \   000080   12....       LCALL   ??ZDP_SimpleDescMsg?relay
    647          
    648            if ( free )
   \   000083   E5..         MOV     A,?V0 + 0
   \   000085   6009         JZ      ??CrossCallReturnLabel_65
    649            {
    650              osal_mem_free( sDesc );
   \   000087                ; Setup parameters for call to function osal_mem_free
   \   000087   85..82       MOV     DPL,?XSP + 0
   \   00008A   85..83       MOV     DPH,?XSP + 1
   \   00008D   12....       LCALL   ?Subroutine32 & 0xFFFF
    651            }
    652          }
   \                     ??CrossCallReturnLabel_65:
   \   000090   7402         MOV     A,#0x2
   \   000092   12....       LCALL   ?DEALLOC_XSTACK8
   \   000095   02....       LJMP    ??Subroutine132_0 & 0xFFFF

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine44:
   \   000000   12....       LCALL   ?Subroutine107 & 0xFFFF
   \                     ??Subroutine44_0:
   \   000003   12....       LCALL   ?Subroutine102 & 0xFFFF
   \                     ??CrossCallReturnLabel_314:
   \   000006   E0           MOVX    A,@DPTR
   \   000007   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine32:
   \   000000   12....       LCALL   ?Subroutine97 & 0xFFFF
   \                     ??CrossCallReturnLabel_208:
   \   000003   12....       LCALL   ??osal_mem_free?relay
   \   000006   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine97:
   \   000000   E0           MOVX    A,@DPTR
   \   000001   FA           MOV     R2,A
   \   000002   A3           INC     DPTR
   \   000003   E0           MOVX    A,@DPTR
   \   000004   FB           MOV     R3,A
   \   000005   22           RET
    653          
    654          /*********************************************************************
    655           * @fn          ZDO_ProcessActiveEPReq
    656           *
    657           * @brief       This function processes and responds to the
    658           *              Active_EP_req message.
    659           *
    660           * @param       inMsg  - incoming message (request)
    661           *
    662           * @return      none
    663           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    664          void ZDO_ProcessActiveEPReq( zdoIncomingMsg_t *inMsg )
   \                     ZDO_ProcessActiveEPReq:
    665          {
   \   000000   74F2         MOV     A,#-0xe
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 14
   \   000005                ; Auto size: 0
   \   000005   8A..         MOV     ?V0 + 4,R2
   \   000007   8B..         MOV     ?V0 + 5,R3
    666            byte cnt = 0;
   \   000009   75..00       MOV     ?V0 + 0,#0x0
    667            uint16 aoi;
    668            byte stat = ZDP_SUCCESS;
   \   00000C   75..00       MOV     ?V0 + 1,#0x0
    669          
    670            aoi = BUILD_UINT16( inMsg->asdu[0], inMsg->asdu[1] );
   \   00000F   12....       LCALL   ?Subroutine44 & 0xFFFF
   \                     ??CrossCallReturnLabel_93:
   \   000012   FA           MOV     R2,A
   \   000013   A3           INC     DPTR
   \   000014   E0           MOVX    A,@DPTR
   \   000015   F9           MOV     R1,A
   \   000016   EA           MOV     A,R2
   \   000017   FE           MOV     R6,A
   \   000018   E9           MOV     A,R1
   \   000019   FF           MOV     R7,A
    671          
    672            if ( aoi == NLME_GetShortAddr() )
   \   00001A                ; Setup parameters for call to function NLME_GetShortAddr
   \   00001A   12....       LCALL   ??NLME_GetShortAddr?relay
   \   00001D   EA           MOV     A,R2
   \   00001E   6E           XRL     A,R6
   \   00001F   7002         JNZ     ??ZDO_ProcessActiveEPReq_0
   \   000021   EB           MOV     A,R3
   \   000022   6F           XRL     A,R7
   \                     ??ZDO_ProcessActiveEPReq_0:
   \   000023   7012         JNZ     ??ZDO_ProcessActiveEPReq_1
    673            {
    674              cnt = afNumEndPoints() - 1;  // -1 for ZDO endpoint descriptor
   \   000025                ; Setup parameters for call to function afNumEndPoints
   \   000025   12....       LCALL   ??afNumEndPoints?relay
   \   000028   E9           MOV     A,R1
   \   000029   14           DEC     A
   \   00002A   F5..         MOV     ?V0 + 0,A
    675              afEndPoints( (uint8 *)ZDOBuildBuf, true );
   \   00002C                ; Setup parameters for call to function afEndPoints
   \   00002C   7901         MOV     R1,#0x1
   \   00002E   7A..         MOV     R2,#(ZDOBuildBuf & 0xff)
   \   000030   7B..         MOV     R3,#((ZDOBuildBuf >> 8) & 0xff)
   \   000032   12....       LCALL   ??afEndPoints?relay
   \   000035   8003         SJMP    ??ZDO_ProcessActiveEPReq_2
    676            }
    677            else
    678            {
    679              stat = ZDP_INVALID_REQTYPE;
   \                     ??ZDO_ProcessActiveEPReq_1:
   \   000037   75..80       MOV     ?V0 + 1,#-0x80
    680            }
    681          
    682            ZDP_ActiveEPRsp( inMsg->TransSeq, &(inMsg->srcAddr), stat,
    683                            aoi, cnt, (uint8 *)ZDOBuildBuf, inMsg->SecurityUse );
   \                     ??ZDO_ProcessActiveEPReq_2:
   \   00003A                ; Setup parameters for call to function ZDP_EPRsp
   \   00003A   E5..         MOV     A,?V0 + 4
   \   00003C   240E         ADD     A,#0xe
   \   00003E   F582         MOV     DPL,A
   \   000040   E5..         MOV     A,?V0 + 5
   \   000042   12....       LCALL   ??Subroutine58_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_114:
   \   000045   12....       LCALL   ?PUSH_XSTACK_I_ONE
   \   000048   75....       MOV     ?V0 + 2,#(ZDOBuildBuf & 0xff)
   \   00004B   75....       MOV     ?V0 + 3,#((ZDOBuildBuf >> 8) & 0xff)
   \   00004E   78..         MOV     R0,#?V0 + 2
   \   000050   12....       LCALL   ?PUSH_XSTACK_I_TWO
   \   000053   78..         MOV     R0,#?V0 + 0
   \   000055   12....       LCALL   ?PUSH_XSTACK_I_ONE
   \   000058   8E..         MOV     ?V0 + 2,R6
   \   00005A   8F..         MOV     ?V0 + 3,R7
   \   00005C   78..         MOV     R0,#?V0 + 2
   \   00005E   12....       LCALL   ?PUSH_XSTACK_I_TWO
   \   000061   E5..         MOV     A,?V0 + 1
   \   000063   F5..         MOV     ?V0 + 0,A
   \   000065   78..         MOV     R0,#?V0 + 0
   \   000067   12....       LCALL   ?PUSH_XSTACK_I_ONE
   \   00006A   E5..         MOV     A,?V0 + 4
   \   00006C   2402         ADD     A,#0x2
   \   00006E   FC           MOV     R4,A
   \   00006F   E5..         MOV     A,?V0 + 5
   \   000071   3400         ADDC    A,#0x0
   \   000073   FD           MOV     R5,A
   \   000074   E5..         MOV     A,?V0 + 4
   \   000076   240F         ADD     A,#0xf
   \   000078   F582         MOV     DPL,A
   \   00007A   E5..         MOV     A,?V0 + 5
   \   00007C   12....       LCALL   ??Subroutine70_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_136:
   \   00007F   F9           MOV     R1,A
   \   000080   7A05         MOV     R2,#0x5
   \   000082   7B80         MOV     R3,#-0x80
   \   000084   12....       LCALL   ??ZDP_EPRsp?relay
   \   000087   7407         MOV     A,#0x7
   \   000089   12....       LCALL   ?DEALLOC_XSTACK8
    684          }
   \   00008C   02....       LJMP    ?Subroutine133 & 0xFFFF

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine70:
   \   000000   E5..         MOV     A,?V0 + 0
   \   000002   240C         ADD     A,#0xc
   \   000004   F582         MOV     DPL,A
   \   000006   E5..         MOV     A,?V0 + 1
   \                     ??Subroutine70_0:
   \   000008   12....       LCALL   ??Subroutine108_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_237:
   \   00000B   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine58:
   \   000000   EE           MOV     A,R6
   \   000001   2414         ADD     A,#0x14
   \   000003   F582         MOV     DPL,A
   \   000005   EF           MOV     A,R7
   \                     ??Subroutine58_0:
   \   000006   12....       LCALL   ??Subroutine108_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_235:
   \   000009   F5..         MOV     ?V0 + 2,A
   \   00000B   78..         MOV     R0,#?V0 + 2
   \   00000D   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine133:
   \   000000   7F06         MOV     R7,#0x6
   \   000002   02....       LJMP    ?BANKED_LEAVE_XDATA

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine107:
   \   000000   EA           MOV     A,R2
   \   000001   2411         ADD     A,#0x11
   \   000003   F582         MOV     DPL,A
   \   000005   EB           MOV     A,R3
   \   000006   22           RET
    685          
    686          /*********************************************************************
    687           * @fn          ZDO_ConvertOTAClusters
    688           *
    689           * @brief       This function will convert the over-the-air cluster list
    690           *              format to an internal format.
    691           *
    692           * @param       inMsg  - incoming message (request)
    693           *
    694           * @return      pointer to incremented inBuf
    695           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    696          uint8 *ZDO_ConvertOTAClusters( uint8 cnt, uint8 *inBuf, uint16 *outList )
   \                     ZDO_ConvertOTAClusters:
    697          {
   \   000000   74F5         MOV     A,#-0xb
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 11
   \   000005                ; Auto size: 0
   \   000005   E9           MOV     A,R1
   \   000006   FE           MOV     R6,A
    698            uint8 x;
    699            for ( x = 0; x < cnt; x++ )
   \   000007   7F00         MOV     R7,#0x0
   \   000009   8029         SJMP    ??ZDO_ConvertOTAClusters_0
    700            {
    701              // convert ota format to internal
    702              outList[x] = BUILD_UINT16( inBuf[0], inBuf[1] );
   \                     ??ZDO_ConvertOTAClusters_1:
   \   00000B   8A82         MOV     DPL,R2
   \   00000D   8B83         MOV     DPH,R3
   \   00000F   E0           MOVX    A,@DPTR
   \   000010   F5..         MOV     ?V0 + 0,A
   \   000012   A3           INC     DPTR
   \   000013   E0           MOVX    A,@DPTR
   \   000014   F9           MOV     R1,A
   \   000015   E4           CLR     A
   \   000016   25..         ADD     A,?V0 + 0
   \   000018   E9           MOV     A,R1
   \   000019   F5..         MOV     ?V0 + 1,A
   \   00001B   EF           MOV     A,R7
   \   00001C   33           RLC     A
   \   00001D   F8           MOV     R0,A
   \   00001E   E4           CLR     A
   \   00001F   33           RLC     A
   \   000020   F9           MOV     R1,A
   \   000021   EC           MOV     A,R4
   \   000022   28           ADD     A,R0
   \   000023   F582         MOV     DPL,A
   \   000025   ED           MOV     A,R5
   \   000026   39           ADDC    A,R1
   \   000027   F583         MOV     DPH,A
   \   000029   E5..         MOV     A,?V0 + 0
   \   00002B   F0           MOVX    @DPTR,A
   \   00002C   A3           INC     DPTR
   \   00002D   E5..         MOV     A,?V0 + 1
   \   00002F   F0           MOVX    @DPTR,A
    703              inBuf += sizeof( uint16 );
   \   000030   12....       LCALL   ?Subroutine80 & 0xFFFF
    704            }
   \                     ??CrossCallReturnLabel_270:
   \   000033   0F           INC     R7
   \                     ??ZDO_ConvertOTAClusters_0:
   \   000034   EF           MOV     A,R7
   \   000035   C3           CLR     C
   \   000036   9E           SUBB    A,R6
   \   000037   40D2         JC      ??ZDO_ConvertOTAClusters_1
    705            return ( inBuf );
   \   000039   7F03         MOV     R7,#0x3
   \   00003B   02....       LJMP    ?BANKED_LEAVE_XDATA
    706          }

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine80:
   \   000000   EA           MOV     A,R2
   \   000001   2402         ADD     A,#0x2
   \   000003                REQUIRE ?Subroutine122
   \   000003                ; // Fall through to label ?Subroutine122

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine122:
   \   000000   0A           INC     R2
   \   000001   0A           INC     R2
   \   000002   EB           MOV     A,R3
   \   000003   3400         ADDC    A,#0x0
   \   000005   FB           MOV     R3,A
   \   000006   22           RET
    707          
    708          /*********************************************************************
    709           * @fn          ZDO_ProcessMatchDescReq
    710           *
    711           * @brief       This function processes and responds to the
    712           *              Match_Desc_req message.
    713           *
    714           * @param       inMsg  - incoming message (request)
    715           *
    716           * @return      none
    717           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    718          void ZDO_ProcessMatchDescReq( zdoIncomingMsg_t *inMsg )
   \                     ZDO_ProcessMatchDescReq:
    719          {
   \   000000   74F0         MOV     A,#-0x10
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 16
   \   000005                ; Auto size: 11
   \   000005   74F5         MOV     A,#-0xb
   \   000007   12....       LCALL   ?ALLOC_XSTACK8
   \   00000A   7405         MOV     A,#0x5
   \   00000C   12....       LCALL   ?XSTACK_DISP0_8
   \   00000F   12....       LCALL   ?Subroutine26 & 0xFFFF
    720            uint8 epCnt = 0;
   \                     ??CrossCallReturnLabel_48:
   \   000012   7404         MOV     A,#0x4
   \   000014   12....       LCALL   ?XSTACK_DISP0_8
   \   000017   E4           CLR     A
   \   000018   F0           MOVX    @DPTR,A
    721            uint8 numInClusters;
    722            uint16 *inClusters = NULL;
   \   000019   7407         MOV     A,#0x7
   \   00001B   12....       LCALL   ?XSTACK_DISP0_8
   \   00001E   E4           CLR     A
   \   00001F   F0           MOVX    @DPTR,A
   \   000020   A3           INC     DPTR
   \   000021   F0           MOVX    @DPTR,A
    723            uint8 numOutClusters;
    724            uint16 *outClusters = NULL;
   \   000022   7409         MOV     A,#0x9
   \   000024   12....       LCALL   ?XSTACK_DISP0_8
   \   000027   E4           CLR     A
   \   000028   F0           MOVX    @DPTR,A
   \   000029   A3           INC     DPTR
   \   00002A   F0           MOVX    @DPTR,A
    725            epList_t *epDesc;
    726            SimpleDescriptionFormat_t *sDesc = NULL;
    727            uint8 allocated;
    728            uint8 *msg;
    729            uint16 aoi;
    730            uint16 profileID;
    731          
    732            // Parse the incoming message
    733            msg = inMsg->asdu;
   \   00002B   7405         MOV     A,#0x5
   \   00002D   12....       LCALL   ?XSTACK_DISP0_8
   \   000030   E0           MOVX    A,@DPTR
   \   000031   2411         ADD     A,#0x11
   \   000033   12....       LCALL   ?Subroutine52 & 0xFFFF
   \                     ??CrossCallReturnLabel_104:
   \   000036   A3           INC     DPTR
   \   000037   E0           MOVX    A,@DPTR
   \   000038   F5..         MOV     ?V0 + 3,A
    734            aoi = BUILD_UINT16( msg[0], msg[1] );
   \   00003A   85..82       MOV     DPL,?V0 + 2
   \   00003D   F583         MOV     DPH,A
   \   00003F   12....       LCALL   ?Subroutine59 & 0xFFFF
   \                     ??CrossCallReturnLabel_118:
   \   000042   F5..         MOV     ?V0 + 0,A
   \   000044   E9           MOV     A,R1
   \   000045   F5..         MOV     ?V0 + 1,A
    735            profileID = BUILD_UINT16( msg[2], msg[3] );
   \   000047   85..82       MOV     DPL,?V0 + 2
   \   00004A   85..83       MOV     DPH,?V0 + 3
   \   00004D   A3           INC     DPTR
   \   00004E   A3           INC     DPTR
   \   00004F   E0           MOVX    A,@DPTR
   \   000050   FA           MOV     R2,A
   \   000051   85..82       MOV     DPL,?V0 + 2
   \   000054   85..83       MOV     DPH,?V0 + 3
   \   000057   A3           INC     DPTR
   \   000058   A3           INC     DPTR
   \   000059   A3           INC     DPTR
   \   00005A   E0           MOVX    A,@DPTR
   \   00005B   F9           MOV     R1,A
   \   00005C   EA           MOV     A,R2
   \   00005D   FE           MOV     R6,A
   \   00005E   E9           MOV     A,R1
   \   00005F   FF           MOV     R7,A
    736            msg += 4;
   \   000060   E5..         MOV     A,?V0 + 2
   \   000062   2404         ADD     A,#0x4
   \   000064   F5..         MOV     ?V0 + 2,A
   \   000066   E5..         MOV     A,?V0 + 3
   \   000068   3400         ADDC    A,#0x0
   \   00006A   F5..         MOV     ?V0 + 3,A
    737          
    738            if ( ADDR_BCAST_NOT_ME == NLME_IsAddressBroadcast(aoi) )
   \   00006C                ; Setup parameters for call to function NLME_IsAddressBroadcast
   \   00006C   AA..         MOV     R2,?V0 + 0
   \   00006E   AB..         MOV     R3,?V0 + 1
   \   000070   12....       LCALL   ??NLME_IsAddressBroadcast?relay
   \   000073   E9           MOV     A,R1
   \   000074   6401         XRL     A,#0x1
   \   000076   703D         JNZ     ??ZDO_ProcessMatchDescReq_0
    739            {
    740              ZDP_MatchDescRsp( inMsg->TransSeq, &(inMsg->srcAddr), ZDP_INVALID_REQTYPE,
    741                                    ZDAppNwkAddr.addr.shortAddr, 0, NULL, inMsg->SecurityUse );
   \                     ??ZDO_ProcessMatchDescReq_1:
   \   000078                ; Setup parameters for call to function ZDP_EPRsp
   \   000078   7405         MOV     A,#0x5
   \   00007A   12....       LCALL   ?XSTACK_DISP0_8
   \   00007D   12....       LCALL   ?Subroutine41 & 0xFFFF
   \                     ??CrossCallReturnLabel_84:
   \   000080   12....       LCALL   ?PUSH_XSTACK_I_ONE
   \   000083   75..00       MOV     ?V0 + 0,#0x0
   \   000086   75..00       MOV     ?V0 + 1,#0x0
   \   000089   78..         MOV     R0,#?V0 + 0
   \   00008B   12....       LCALL   ?PUSH_XSTACK_I_TWO
   \   00008E   78..         MOV     R0,#?V0 + 0
   \   000090   12....       LCALL   ?PUSH_XSTACK_I_ONE
   \   000093   90....       MOV     DPTR,#ZDAppNwkAddr
   \   000096   12....       LCALL   ?PUSH_XSTACK8_X_TWO
   \   000099   75..80       MOV     ?V0 + 0,#-0x80
   \   00009C   78..         MOV     R0,#?V0 + 0
   \   00009E   12....       LCALL   ?PUSH_XSTACK_I_ONE
   \   0000A1   740C         MOV     A,#0xc
   \   0000A3   12....       LCALL   ?XSTACK_DISP0_8
   \   0000A6   12....       LCALL   ?Subroutine53 & 0xFFFF
   \                     ??CrossCallReturnLabel_106:
   \   0000A9   12....       LCALL   ?XSTACK_DISP0_8
   \   0000AC   12....       LCALL   ?Subroutine33 & 0xFFFF
   \                     ??CrossCallReturnLabel_70:
   \   0000AF   12....       LCALL   ?DEALLOC_XSTACK8
    742              return;
   \   0000B2   02....       LJMP    ??CrossCallReturnLabel_68 & 0xFFFF
    743            }
    744            else if ( (ADDR_NOT_BCAST == NLME_IsAddressBroadcast(aoi)) && (aoi != ZDAppNwkAddr.addr.shortAddr) )
   \                     ??ZDO_ProcessMatchDescReq_0:
   \   0000B5                ; Setup parameters for call to function NLME_IsAddressBroadcast
   \   0000B5   AA..         MOV     R2,?V0 + 0
   \   0000B7   AB..         MOV     R3,?V0 + 1
   \   0000B9   12....       LCALL   ??NLME_IsAddressBroadcast?relay
   \   0000BC   E9           MOV     A,R1
   \   0000BD   700E         JNZ     ??ZDO_ProcessMatchDescReq_2
   \   0000BF   90....       MOV     DPTR,#ZDAppNwkAddr
   \   0000C2   E0           MOVX    A,@DPTR
   \   0000C3   65..         XRL     A,?V0 + 0
   \   0000C5   7004         JNZ     ??ZDO_ProcessMatchDescReq_3
   \   0000C7   A3           INC     DPTR
   \   0000C8   E0           MOVX    A,@DPTR
   \   0000C9   65..         XRL     A,?V0 + 1
   \                     ??ZDO_ProcessMatchDescReq_3:
   \   0000CB   70AB         JNZ     ??ZDO_ProcessMatchDescReq_1
    745            {
    746              ZDP_MatchDescRsp( inMsg->TransSeq, &(inMsg->srcAddr), ZDP_INVALID_REQTYPE,
    747                                       ZDAppNwkAddr.addr.shortAddr, 0, NULL, inMsg->SecurityUse );
    748              return;
    749            }
    750          
    751            numInClusters = *msg++;
   \                     ??ZDO_ProcessMatchDescReq_2:
   \   0000CD   85..82       MOV     DPL,?V0 + 2
   \   0000D0   85..83       MOV     DPH,?V0 + 3
   \   0000D3   E0           MOVX    A,@DPTR
   \   0000D4   F5..         MOV     ?V0 + 7,A
   \   0000D6   A3           INC     DPTR
   \   0000D7   8582..       MOV     ?V0 + 2,DPL
   \   0000DA   8583..       MOV     ?V0 + 3,DPH
    752            if ( numInClusters )
   \   0000DD   6022         JZ      ??ZDO_ProcessMatchDescReq_4
    753            {
    754              inClusters = (uint16*)osal_mem_alloc( numInClusters * sizeof( uint16 ) );
   \   0000DF                ; Setup parameters for call to function osal_mem_alloc
   \   0000DF   C3           CLR     C
   \   0000E0   33           RLC     A
   \   0000E1   FA           MOV     R2,A
   \   0000E2   E4           CLR     A
   \   0000E3   33           RLC     A
   \   0000E4   FB           MOV     R3,A
   \   0000E5   12....       LCALL   ??osal_mem_alloc?relay
   \   0000E8   7407         MOV     A,#0x7
   \   0000EA   12....       LCALL   ?XSTACK_DISP0_8
   \   0000ED   12....       LCALL   ?Subroutine26 & 0xFFFF
    755              msg = ZDO_ConvertOTAClusters( numInClusters, msg, inClusters );
   \                     ??CrossCallReturnLabel_49:
   \   0000F0                ; Setup parameters for call to function ZDO_ConvertOTAClusters
   \   0000F0   7407         MOV     A,#0x7
   \   0000F2   12....       LCALL   ?XSTACK_DISP0_8
   \   0000F5   12....       LCALL   ?Subroutine57 & 0xFFFF
   \                     ??CrossCallReturnLabel_112:
   \   0000F8   A9..         MOV     R1,?V0 + 7
   \   0000FA   12....       LCALL   ??ZDO_ConvertOTAClusters?relay
   \   0000FD   8A..         MOV     ?V0 + 2,R2
   \   0000FF   8B..         MOV     ?V0 + 3,R3
    756            }
    757            numOutClusters = *msg++;
   \                     ??ZDO_ProcessMatchDescReq_4:
   \   000101   85..82       MOV     DPL,?V0 + 2
   \   000104   85..83       MOV     DPH,?V0 + 3
   \   000107   E0           MOVX    A,@DPTR
   \   000108   F5..         MOV     ?V0 + 6,A
   \   00010A   A3           INC     DPTR
   \   00010B   8582..       MOV     ?V0 + 2,DPL
   \   00010E   8583..       MOV     ?V0 + 3,DPH
    758            if ( numOutClusters )
   \   000111   601E         JZ      ??ZDO_ProcessMatchDescReq_5
    759            {
    760              outClusters = (uint16 *)osal_mem_alloc( numOutClusters * sizeof( uint16 ) );
   \   000113                ; Setup parameters for call to function osal_mem_alloc
   \   000113   C3           CLR     C
   \   000114   33           RLC     A
   \   000115   FA           MOV     R2,A
   \   000116   E4           CLR     A
   \   000117   33           RLC     A
   \   000118   FB           MOV     R3,A
   \   000119   12....       LCALL   ??osal_mem_alloc?relay
   \   00011C   7409         MOV     A,#0x9
   \   00011E   12....       LCALL   ?XSTACK_DISP0_8
   \   000121   12....       LCALL   ?Subroutine26 & 0xFFFF
    761              msg = ZDO_ConvertOTAClusters( numOutClusters, msg, outClusters );
   \                     ??CrossCallReturnLabel_50:
   \   000124                ; Setup parameters for call to function ZDO_ConvertOTAClusters
   \   000124   7409         MOV     A,#0x9
   \   000126   12....       LCALL   ?XSTACK_DISP0_8
   \   000129   12....       LCALL   ?Subroutine57 & 0xFFFF
   \                     ??CrossCallReturnLabel_113:
   \   00012C   A9..         MOV     R1,?V0 + 6
   \   00012E   12....       LCALL   ??ZDO_ConvertOTAClusters?relay
    762            }
    763          
    764            // First count the number of endpoints that match.
    765            epDesc = epList;
   \                     ??ZDO_ProcessMatchDescReq_5:
   \   000131   90....       MOV     DPTR,#epList
   \   000134   805B         SJMP    ??CrossCallReturnLabel_96
    766            while ( epDesc )
    767            {
    768              // Don't search endpoint 0 and check if response is allowed
    769              if ( epDesc->epDesc->endPoint != ZDO_EP && (epDesc->flags&eEP_AllowMatch) )
    770              {
    771                if ( epDesc->pfnDescCB )
    772                {
    773                  sDesc = (SimpleDescriptionFormat_t *)epDesc->pfnDescCB( AF_DESCRIPTOR_SIMPLE, epDesc->epDesc->endPoint );
    774                  allocated = TRUE;
    775                }
    776                else
    777                {
    778                  sDesc = epDesc->epDesc->simpleDesc;
    779                  allocated = FALSE;
    780                }
    781          
    782                if ( sDesc && sDesc->AppProfId == profileID )
    783                {
    784                  uint8 *uint8Buf = (uint8 *)ZDOBuildBuf;
    785          
    786                  // If there are no search input/ouput clusters - respond
    787                  if ( ((numInClusters == 0) && (numOutClusters == 0))
    788                      // Are there matching input clusters?
    789                       || (ZDO_AnyClusterMatches( numInClusters, inClusters,
    790                            sDesc->AppNumInClusters, sDesc->pAppInClusterList ))
    791                      // Are there matching output clusters?
    792                       || (ZDO_AnyClusterMatches( numOutClusters, outClusters,
    793                            sDesc->AppNumOutClusters, sDesc->pAppOutClusterList ))     )
    794                  {
    795                    // Notify the endpoint of the match.
    796                    uint8 bufLen = sizeof( ZDO_MatchDescRspSent_t ) + (numOutClusters + numInClusters) * sizeof(uint16);
    797                    ZDO_MatchDescRspSent_t *pRspSent = (ZDO_MatchDescRspSent_t *) osal_msg_allocate( bufLen );
    798          
    799                    if (pRspSent)
    800                    {
    801                      pRspSent->hdr.event = ZDO_MATCH_DESC_RSP_SENT;
    802                      pRspSent->nwkAddr = inMsg->srcAddr.addr.shortAddr;
    803                      pRspSent->numInClusters = numInClusters;
    804                      pRspSent->numOutClusters = numOutClusters;
    805          
    806                      if (numInClusters)
    807                      {
    808                        pRspSent->pInClusters = (uint16*) (pRspSent + 1);
    809                        osal_memcpy(pRspSent->pInClusters, inClusters, numInClusters * sizeof(uint16));
    810                      }
    811                      else
    812                      {
    813                        pRspSent->pInClusters = NULL;
    814                      }
    815          
    816                      if (numOutClusters)
    817                      {
    818                        pRspSent->pOutClusters = (uint16*)(pRspSent + 1) + numInClusters;
    819                        osal_memcpy(pRspSent->pOutClusters, outClusters, numOutClusters * sizeof(uint16));
    820                      }
    821                      else
    822                      {
    823                        pRspSent->pOutClusters = NULL;
   \                     ??ZDO_ProcessMatchDescReq_6:
   \   000136   85..82       MOV     DPL,?V0 + 4
   \   000139   85..83       MOV     DPH,?V0 + 5
   \   00013C   A3           INC     DPTR
   \   00013D   A3           INC     DPTR
   \   00013E   A3           INC     DPTR
   \   00013F   A3           INC     DPTR
   \   000140   A3           INC     DPTR
   \   000141   A3           INC     DPTR
   \   000142   A3           INC     DPTR
   \   000143   A3           INC     DPTR
   \   000144   E4           CLR     A
   \   000145   F0           MOVX    @DPTR,A
   \   000146   A3           INC     DPTR
   \   000147   F0           MOVX    @DPTR,A
    824                      }
    825          
    826                      osal_msg_send( *epDesc->epDesc->task_id, (uint8 *)pRspSent );
   \                     ??ZDO_ProcessMatchDescReq_7:
   \   000148                ; Setup parameters for call to function osal_msg_send
   \   000148   AA..         MOV     R2,?V0 + 4
   \   00014A   AB..         MOV     R3,?V0 + 5
   \   00014C   85..82       MOV     DPL,?XSP + 0
   \   00014F   85..83       MOV     DPH,?XSP + 1
   \   000152   12....       LCALL   ?Subroutine64 & 0xFFFF
   \                     ??CrossCallReturnLabel_127:
   \   000155   12....       LCALL   ?Subroutine34 & 0xFFFF
    827                    }
    828          
    829                    uint8Buf[epCnt++] = sDesc->EndPoint;
   \                     ??CrossCallReturnLabel_73:
   \   000158   7402         MOV     A,#0x2
   \   00015A   12....       LCALL   ?XSTACK_DISP0_8
   \   00015D   12....       LCALL   ?Subroutine36 & 0xFFFF
   \                     ??CrossCallReturnLabel_77:
   \   000160   C0E0         PUSH    A
   \   000162   7404         MOV     A,#0x4
   \   000164   12....       LCALL   ?XSTACK_DISP0_8
   \   000167   E0           MOVX    A,@DPTR
   \   000168   24..         ADD     A,#(ZDOBuildBuf & 0xff)
   \   00016A   F582         MOV     DPL,A
   \   00016C   E4           CLR     A
   \   00016D   34..         ADDC    A,#((ZDOBuildBuf >> 8) & 0xff)
   \   00016F   F583         MOV     DPH,A
   \   000171   D0E0         POP     A
   \   000173   F0           MOVX    @DPTR,A
   \   000174   7404         MOV     A,#0x4
   \   000176   12....       LCALL   ?XSTACK_DISP0_8
   \   000179   E0           MOVX    A,@DPTR
   \   00017A   04           INC     A
   \   00017B   F0           MOVX    @DPTR,A
    830                  }
    831                }
    832          
    833                if ( allocated )
   \                     ??ZDO_ProcessMatchDescReq_8:
   \   00017C   E5..         MOV     A,?V0 + 3
   \   00017E   6008         JZ      ??CrossCallReturnLabel_66
    834                  osal_mem_free( sDesc );
   \   000180                ; Setup parameters for call to function osal_mem_free
   \   000180   7402         MOV     A,#0x2
   \   000182   12....       LCALL   ?XSTACK_DISP0_8
   \   000185   12....       LCALL   ?Subroutine32 & 0xFFFF
    835              }
    836              epDesc = epDesc->nextDesc;
   \                     ??CrossCallReturnLabel_66:
   \   000188   85..82       MOV     DPL,?XSP + 0
   \   00018B   85..83       MOV     DPH,?XSP + 1
   \   00018E   12....       LCALL   ?Subroutine47 & 0xFFFF
   \                     ??CrossCallReturnLabel_96:
   \   000191   12....       LCALL   ?Subroutine103 & 0xFFFF
   \                     ??CrossCallReturnLabel_216:
   \   000194   85..82       MOV     DPL,?XSP + 0
   \   000197   85..83       MOV     DPH,?XSP + 1
   \   00019A   12....       LCALL   ??Subroutine10_1 & 0xFFFF
   \                     ??CrossCallReturnLabel_304:
   \   00019D   85..82       MOV     DPL,?XSP + 0
   \   0001A0   85..83       MOV     DPH,?XSP + 1
   \   0001A3   E0           MOVX    A,@DPTR
   \   0001A4   7002         JNZ     ??ZDO_ProcessMatchDescReq_9
   \   0001A6   A3           INC     DPTR
   \   0001A7   E0           MOVX    A,@DPTR
   \                     ??ZDO_ProcessMatchDescReq_9:
   \   0001A8   7003         JNZ     $+5
   \   0001AA   02....       LJMP    ??ZDO_ProcessMatchDescReq_10 & 0xFFFF
   \   0001AD   85..82       MOV     DPL,?XSP + 0
   \   0001B0   85..83       MOV     DPH,?XSP + 1
   \   0001B3   12....       LCALL   ?Subroutine36 & 0xFFFF
   \                     ??CrossCallReturnLabel_78:
   \   0001B6   12....       LCALL   ??Subroutine104_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_219:
   \   0001B9   60CD         JZ      ??CrossCallReturnLabel_66
   \   0001BB   85..82       MOV     DPL,?XSP + 0
   \   0001BE   85..83       MOV     DPH,?XSP + 1
   \   0001C1   12....       LCALL   ?Subroutine51 & 0xFFFF
   \                     ??CrossCallReturnLabel_102:
   \   0001C4   A2E0         MOV     C,0xE0 /* A   */.0
   \   0001C6   50C0         JNC     ??CrossCallReturnLabel_66
   \   0001C8   85..82       MOV     DPL,?XSP + 0
   \   0001CB   85..83       MOV     DPH,?XSP + 1
   \   0001CE   12....       LCALL   ?Subroutine66 & 0xFFFF
   \                     ??CrossCallReturnLabel_129:
   \   0001D1   E0           MOVX    A,@DPTR
   \   0001D2   7002         JNZ     ??ZDO_ProcessMatchDescReq_11
   \   0001D4   A3           INC     DPTR
   \   0001D5   E0           MOVX    A,@DPTR
   \                     ??ZDO_ProcessMatchDescReq_11:
   \   0001D6   85..82       MOV     DPL,?XSP + 0
   \   0001D9   85..83       MOV     DPH,?XSP + 1
   \   0001DC   A3           INC     DPTR
   \   0001DD   6026         JZ      ??ZDO_ProcessMatchDescReq_12
   \   0001DF                ; Setup parameters for indirect call
   \   0001DF   12....       LCALL   ??Subroutine105_1 & 0xFFFF
   \                     ??CrossCallReturnLabel_222:
   \   0001E2   12....       LCALL   ?Subroutine36 & 0xFFFF
   \                     ??CrossCallReturnLabel_79:
   \   0001E5   FA           MOV     R2,A
   \   0001E6   7901         MOV     R1,#0x1
   \   0001E8   85..82       MOV     DPL,?XSP + 0
   \   0001EB   85..83       MOV     DPH,?XSP + 1
   \   0001EE   12....       LCALL   ?Subroutine46 & 0xFFFF
   \                     ??CrossCallReturnLabel_94:
   \   0001F1   F583         MOV     DPH,A
   \   0001F3   8882         MOV     DPL,R0
   \   0001F5   12....       LCALL   ?CALL_IND
   \   0001F8   7402         MOV     A,#0x2
   \   0001FA   12....       LCALL   ?XSTACK_DISP0_8
   \   0001FD   12....       LCALL   ?Subroutine26 & 0xFFFF
   \                     ??CrossCallReturnLabel_51:
   \   000200   75..01       MOV     ?V0 + 3,#0x1
   \   000203   8012         SJMP    ??ZDO_ProcessMatchDescReq_13
   \                     ??ZDO_ProcessMatchDescReq_12:
   \   000205   12....       LCALL   ??Subroutine105_1 & 0xFFFF
   \                     ??CrossCallReturnLabel_223:
   \   000208   12....       LCALL   ?Subroutine46 & 0xFFFF
   \                     ??CrossCallReturnLabel_95:
   \   00020B   F9           MOV     R1,A
   \   00020C   7402         MOV     A,#0x2
   \   00020E   12....       LCALL   ?XSTACK_DISP0_8
   \   000211   12....       LCALL   ??Subroutine10_1 & 0xFFFF
   \                     ??CrossCallReturnLabel_305:
   \   000214   75..00       MOV     ?V0 + 3,#0x0
   \                     ??ZDO_ProcessMatchDescReq_13:
   \   000217   7402         MOV     A,#0x2
   \   000219   12....       LCALL   ?XSTACK_DISP0_8
   \   00021C   E0           MOVX    A,@DPTR
   \   00021D   7002         JNZ     ??ZDO_ProcessMatchDescReq_14
   \   00021F   A3           INC     DPTR
   \   000220   E0           MOVX    A,@DPTR
   \                     ??ZDO_ProcessMatchDescReq_14:
   \   000221   7003         JNZ     $+5
   \   000223   02....       LJMP    ??ZDO_ProcessMatchDescReq_8 & 0xFFFF
   \   000226   7402         MOV     A,#0x2
   \   000228   12....       LCALL   ?XSTACK_DISP0_8
   \   00022B   12....       LCALL   ?Subroutine64 & 0xFFFF
   \                     ??CrossCallReturnLabel_128:
   \   00022E   A3           INC     DPTR
   \   00022F   E0           MOVX    A,@DPTR
   \   000230   6E           XRL     A,R6
   \   000231   7003         JNZ     ??ZDO_ProcessMatchDescReq_15
   \   000233   A3           INC     DPTR
   \   000234   E0           MOVX    A,@DPTR
   \   000235   6F           XRL     A,R7
   \                     ??ZDO_ProcessMatchDescReq_15:
   \   000236   6003         JZ      $+5
   \   000238   02....       LJMP    ??ZDO_ProcessMatchDescReq_8 & 0xFFFF
   \   00023B   E5..         MOV     A,?V0 + 7
   \   00023D   7004         JNZ     ??ZDO_ProcessMatchDescReq_16
   \   00023F   E5..         MOV     A,?V0 + 6
   \   000241   605D         JZ      ??ZDO_ProcessMatchDescReq_17
   \                     ??ZDO_ProcessMatchDescReq_16:
   \   000243                ; Setup parameters for call to function ZDO_AnyClusterMatches
   \   000243   7402         MOV     A,#0x2
   \   000245   12....       LCALL   ?XSTACK_DISP0_8
   \   000248   12....       LCALL   ?Subroutine66 & 0xFFFF
   \                     ??CrossCallReturnLabel_130:
   \   00024B   A3           INC     DPTR
   \   00024C   A3           INC     DPTR
   \   00024D   A3           INC     DPTR
   \   00024E   A3           INC     DPTR
   \   00024F   12....       LCALL   ?PUSH_XSTACK8_X_TWO
   \   000252   7404         MOV     A,#0x4
   \   000254   12....       LCALL   ?XSTACK_DISP0_8
   \   000257   12....       LCALL   ?Subroutine47 & 0xFFFF
   \                     ??CrossCallReturnLabel_97:
   \   00025A   A3           INC     DPTR
   \   00025B   E0           MOVX    A,@DPTR
   \   00025C   FC           MOV     R4,A
   \   00025D   7409         MOV     A,#0x9
   \   00025F   12....       LCALL   ?XSTACK_DISP0_8
   \   000262   12....       LCALL   ?Subroutine97 & 0xFFFF
   \                     ??CrossCallReturnLabel_205:
   \   000265   A9..         MOV     R1,?V0 + 7
   \   000267   12....       LCALL   ??ZDO_AnyClusterMatches?relay
   \   00026A   7402         MOV     A,#0x2
   \   00026C   12....       LCALL   ?DEALLOC_XSTACK8
   \   00026F   E9           MOV     A,R1
   \   000270   702E         JNZ     ??ZDO_ProcessMatchDescReq_17
   \   000272                ; Setup parameters for call to function ZDO_AnyClusterMatches
   \   000272   7402         MOV     A,#0x2
   \   000274   12....       LCALL   ?XSTACK_DISP0_8
   \   000277   12....       LCALL   ?Subroutine45 & 0xFFFF
   \                     ??CrossCallReturnLabel_260:
   \   00027A   A3           INC     DPTR
   \   00027B   12....       LCALL   ?PUSH_XSTACK8_X_TWO
   \   00027E   7404         MOV     A,#0x4
   \   000280   12....       LCALL   ?XSTACK_DISP0_8
   \   000283   12....       LCALL   ?Subroutine45 & 0xFFFF
   \                     ??CrossCallReturnLabel_261:
   \   000286   E0           MOVX    A,@DPTR
   \   000287   FC           MOV     R4,A
   \   000288   740B         MOV     A,#0xb
   \   00028A   12....       LCALL   ?XSTACK_DISP0_8
   \   00028D   12....       LCALL   ?Subroutine97 & 0xFFFF
   \                     ??CrossCallReturnLabel_206:
   \   000290   A9..         MOV     R1,?V0 + 6
   \   000292   12....       LCALL   ??ZDO_AnyClusterMatches?relay
   \   000295   7402         MOV     A,#0x2
   \   000297   12....       LCALL   ?DEALLOC_XSTACK8
   \   00029A   E9           MOV     A,R1
   \   00029B   7003         JNZ     $+5
   \   00029D   02....       LJMP    ??ZDO_ProcessMatchDescReq_8 & 0xFFFF
   \                     ??ZDO_ProcessMatchDescReq_17:
   \   0002A0                ; Setup parameters for call to function osal_msg_allocate
   \   0002A0   E5..         MOV     A,?V0 + 7
   \   0002A2   25..         ADD     A,?V0 + 6
   \   0002A4   C3           CLR     C
   \   0002A5   33           RLC     A
   \   0002A6   240A         ADD     A,#0xa
   \   0002A8   FA           MOV     R2,A
   \   0002A9   7B00         MOV     R3,#0x0
   \   0002AB   12....       LCALL   ??osal_msg_allocate?relay
   \   0002AE   8A..         MOV     ?V0 + 4,R2
   \   0002B0   8B..         MOV     ?V0 + 5,R3
   \   0002B2   EA           MOV     A,R2
   \   0002B3   7001         JNZ     ??ZDO_ProcessMatchDescReq_18
   \   0002B5   EB           MOV     A,R3
   \                     ??ZDO_ProcessMatchDescReq_18:
   \   0002B6   7003         JNZ     $+5
   \   0002B8   02....       LJMP    ??CrossCallReturnLabel_73 & 0xFFFF
   \   0002BB   74D2         MOV     A,#-0x2e
   \   0002BD   8A82         MOV     DPL,R2
   \   0002BF   8B83         MOV     DPH,R3
   \   0002C1   F0           MOVX    @DPTR,A
   \   0002C2   7405         MOV     A,#0x5
   \   0002C4   12....       LCALL   ?XSTACK_DISP0_8
   \   0002C7   12....       LCALL   ?Subroutine51 & 0xFFFF
   \                     ??CrossCallReturnLabel_103:
   \   0002CA   F8           MOV     R0,A
   \   0002CB   A3           INC     DPTR
   \   0002CC   E0           MOVX    A,@DPTR
   \   0002CD   F9           MOV     R1,A
   \   0002CE   8A82         MOV     DPL,R2
   \   0002D0   8B83         MOV     DPH,R3
   \   0002D2   A3           INC     DPTR
   \   0002D3   A3           INC     DPTR
   \   0002D4   12....       LCALL   ??Subroutine10_1 & 0xFFFF
   \                     ??CrossCallReturnLabel_306:
   \   0002D7   8A82         MOV     DPL,R2
   \   0002D9   8B83         MOV     DPH,R3
   \   0002DB   A3           INC     DPTR
   \   0002DC   A3           INC     DPTR
   \   0002DD   A3           INC     DPTR
   \   0002DE   A3           INC     DPTR
   \   0002DF   E5..         MOV     A,?V0 + 7
   \   0002E1   12....       LCALL   ?Subroutine25 & 0xFFFF
   \                     ??CrossCallReturnLabel_43:
   \   0002E4   A3           INC     DPTR
   \   0002E5   A3           INC     DPTR
   \   0002E6   A3           INC     DPTR
   \   0002E7   A3           INC     DPTR
   \   0002E8   A3           INC     DPTR
   \   0002E9   E5..         MOV     A,?V0 + 6
   \   0002EB   F0           MOVX    @DPTR,A
   \   0002EC   E5..         MOV     A,?V0 + 7
   \   0002EE   602E         JZ      ??ZDO_ProcessMatchDescReq_19
   \   0002F0   EA           MOV     A,R2
   \   0002F1   2405         ADD     A,#0x5
   \   0002F3   FA           MOV     R2,A
   \   0002F4   EB           MOV     A,R3
   \   0002F5   3400         ADDC    A,#0x0
   \   0002F7   FB           MOV     R3,A
   \   0002F8   E5..         MOV     A,?V0 + 4
   \   0002FA   240A         ADD     A,#0xa
   \   0002FC   F8           MOV     R0,A
   \   0002FD   E5..         MOV     A,?V0 + 5
   \   0002FF   3400         ADDC    A,#0x0
   \   000301   F9           MOV     R1,A
   \   000302   8A82         MOV     DPL,R2
   \   000304   8B83         MOV     DPH,R3
   \   000306   12....       LCALL   ??Subroutine10_1 & 0xFFFF
   \                     ??CrossCallReturnLabel_307:
   \   000309                ; Setup parameters for call to function osal_memcpy
   \   000309   7407         MOV     A,#0x7
   \   00030B   12....       LCALL   ?XSTACK_DISP0_8
   \   00030E   12....       LCALL   ?Subroutine48 & 0xFFFF
   \                     ??CrossCallReturnLabel_98:
   \   000311   12....       LCALL   ?PUSH_XSTACK_I_THREE
   \   000314   E5..         MOV     A,?V0 + 7
   \   000316   12....       LCALL   ?Subroutine55 & 0xFFFF
   \                     ??CrossCallReturnLabel_295:
   \   000319   12....       LCALL   ?DEALLOC_XSTACK8
   \   00031C   800D         SJMP    ??ZDO_ProcessMatchDescReq_20
   \                     ??ZDO_ProcessMatchDescReq_19:
   \   00031E   8A82         MOV     DPL,R2
   \   000320   8B83         MOV     DPH,R3
   \   000322   A3           INC     DPTR
   \   000323   A3           INC     DPTR
   \   000324   A3           INC     DPTR
   \   000325   A3           INC     DPTR
   \   000326   A3           INC     DPTR
   \   000327   E4           CLR     A
   \   000328   F0           MOVX    @DPTR,A
   \   000329   A3           INC     DPTR
   \   00032A   F0           MOVX    @DPTR,A
   \                     ??ZDO_ProcessMatchDescReq_20:
   \   00032B   E5..         MOV     A,?V0 + 6
   \   00032D   7003         JNZ     $+5
   \   00032F   02....       LJMP    ??ZDO_ProcessMatchDescReq_6 & 0xFFFF
   \   000332   E5..         MOV     A,?V0 + 4
   \   000334   2408         ADD     A,#0x8
   \   000336   FA           MOV     R2,A
   \   000337   E5..         MOV     A,?V0 + 5
   \   000339   3400         ADDC    A,#0x0
   \   00033B   FB           MOV     R3,A
   \   00033C   E5..         MOV     A,?V0 + 7
   \   00033E   C3           CLR     C
   \   00033F   33           RLC     A
   \   000340   F8           MOV     R0,A
   \   000341   E4           CLR     A
   \   000342   33           RLC     A
   \   000343   F9           MOV     R1,A
   \   000344   E5..         MOV     A,?V0 + 4
   \   000346   28           ADD     A,R0
   \   000347   F8           MOV     R0,A
   \   000348   E5..         MOV     A,?V0 + 5
   \   00034A   39           ADDC    A,R1
   \   00034B   F9           MOV     R1,A
   \   00034C   740A         MOV     A,#0xa
   \   00034E   28           ADD     A,R0
   \   00034F   F8           MOV     R0,A
   \   000350   E4           CLR     A
   \   000351   39           ADDC    A,R1
   \   000352   F9           MOV     R1,A
   \   000353   8A82         MOV     DPL,R2
   \   000355   8B83         MOV     DPH,R3
   \   000357   12....       LCALL   ??Subroutine10_1 & 0xFFFF
   \                     ??CrossCallReturnLabel_308:
   \   00035A                ; Setup parameters for call to function osal_memcpy
   \   00035A   7409         MOV     A,#0x9
   \   00035C   12....       LCALL   ?XSTACK_DISP0_8
   \   00035F   12....       LCALL   ?Subroutine48 & 0xFFFF
   \                     ??CrossCallReturnLabel_99:
   \   000362   12....       LCALL   ?PUSH_XSTACK_I_THREE
   \   000365   E5..         MOV     A,?V0 + 6
   \   000367   12....       LCALL   ?Subroutine55 & 0xFFFF
   \                     ??CrossCallReturnLabel_296:
   \   00036A   12....       LCALL   ?DEALLOC_XSTACK8
   \   00036D   02....       LJMP    ??ZDO_ProcessMatchDescReq_7 & 0xFFFF
    837            }
    838          
    839            // Send the message only if at least one match found.
    840            if ( epCnt )
   \                     ??ZDO_ProcessMatchDescReq_10:
   \   000370   7404         MOV     A,#0x4
   \   000372   12....       LCALL   ?XSTACK_DISP0_8
   \   000375   E0           MOVX    A,@DPTR
   \   000376   6042         JZ      ??ZDO_ProcessMatchDescReq_21
    841            {
    842              if ( ZSuccess == ZDP_MatchDescRsp( inMsg->TransSeq, &(inMsg->srcAddr), ZDP_SUCCESS,
    843                        ZDAppNwkAddr.addr.shortAddr, epCnt, (uint8 *)ZDOBuildBuf, inMsg->SecurityUse ) )
   \   000378                ; Setup parameters for call to function ZDP_EPRsp
   \   000378   7405         MOV     A,#0x5
   \   00037A   12....       LCALL   ?XSTACK_DISP0_8
   \   00037D   12....       LCALL   ?Subroutine41 & 0xFFFF
   \                     ??CrossCallReturnLabel_85:
   \   000380   12....       LCALL   ?PUSH_XSTACK_I_ONE
   \   000383   75....       MOV     ?V0 + 0,#(ZDOBuildBuf & 0xff)
   \   000386   75....       MOV     ?V0 + 1,#((ZDOBuildBuf >> 8) & 0xff)
   \   000389   78..         MOV     R0,#?V0 + 0
   \   00038B   12....       LCALL   ?PUSH_XSTACK_I_TWO
   \   00038E   7407         MOV     A,#0x7
   \   000390   12....       LCALL   ?XSTACK_DISP0_8
   \   000393   E0           MOVX    A,@DPTR
   \   000394   F5..         MOV     ?V0 + 0,A
   \   000396   78..         MOV     R0,#?V0 + 0
   \   000398   12....       LCALL   ?PUSH_XSTACK_I_ONE
   \   00039B   90....       MOV     DPTR,#ZDAppNwkAddr
   \   00039E   12....       LCALL   ?PUSH_XSTACK8_X_TWO
   \   0003A1   75..00       MOV     ?V0 + 0,#0x0
   \   0003A4   78..         MOV     R0,#?V0 + 0
   \   0003A6   12....       LCALL   ?PUSH_XSTACK_I_ONE
   \   0003A9   740C         MOV     A,#0xc
   \   0003AB   12....       LCALL   ?XSTACK_DISP0_8
   \   0003AE   12....       LCALL   ?Subroutine53 & 0xFFFF
   \                     ??CrossCallReturnLabel_107:
   \   0003B1   12....       LCALL   ?XSTACK_DISP0_8
   \   0003B4   12....       LCALL   ?Subroutine33 & 0xFFFF
   \                     ??CrossCallReturnLabel_71:
   \   0003B7   12....       LCALL   ?DEALLOC_XSTACK8
    844              {
    845          #if defined( LCD_SUPPORTED )
    846                //HalLcdWriteScreen( "Match Desc Req", "Rsp Sent" );
    847                // ClearScreen();
    848                Print8(HAL_LCD_LINE_2,10,"Match Desc Req",1);
    849                Print8(HAL_LCD_LINE_3,10,"Rsp Sent",1);
    850          #endif
    851              }
    852            }
    853            else
    854            {
    855          #if defined( LCD_SUPPORTED )
    856             // HalLcdWriteScreen( "Match Desc Req", "Non Matched" );
    857               //ClearScreen();
    858                Print8(HAL_LCD_LINE_2,10,"Match Desc Req",1);
    859                Print8(HAL_LCD_LINE_3,10,"Rsp Sent",1);
    860          #endif
    861            }
    862          
    863            if ( inClusters )
   \                     ??ZDO_ProcessMatchDescReq_21:
   \   0003BA   7407         MOV     A,#0x7
   \   0003BC   12....       LCALL   ?XSTACK_DISP0_8
   \   0003BF   E0           MOVX    A,@DPTR
   \   0003C0   7002         JNZ     ??ZDO_ProcessMatchDescReq_22
   \   0003C2   A3           INC     DPTR
   \   0003C3   E0           MOVX    A,@DPTR
   \                     ??ZDO_ProcessMatchDescReq_22:
   \   0003C4   6008         JZ      ??CrossCallReturnLabel_67
    864              osal_mem_free( inClusters );
   \   0003C6                ; Setup parameters for call to function osal_mem_free
   \   0003C6   7407         MOV     A,#0x7
   \   0003C8   12....       LCALL   ?XSTACK_DISP0_8
   \   0003CB   12....       LCALL   ?Subroutine32 & 0xFFFF
    865            if ( outClusters )
   \                     ??CrossCallReturnLabel_67:
   \   0003CE   7409         MOV     A,#0x9
   \   0003D0   12....       LCALL   ?XSTACK_DISP0_8
   \   0003D3   E0           MOVX    A,@DPTR
   \   0003D4   7002         JNZ     ??ZDO_ProcessMatchDescReq_23
   \   0003D6   A3           INC     DPTR
   \   0003D7   E0           MOVX    A,@DPTR
   \                     ??ZDO_ProcessMatchDescReq_23:
   \   0003D8   6008         JZ      ??CrossCallReturnLabel_68
    866              osal_mem_free( outClusters );
   \   0003DA                ; Setup parameters for call to function osal_mem_free
   \   0003DA   7409         MOV     A,#0x9
   \   0003DC   12....       LCALL   ?XSTACK_DISP0_8
   \   0003DF   12....       LCALL   ?Subroutine32 & 0xFFFF
   \                     ??CrossCallReturnLabel_68:
   \   0003E2   740B         MOV     A,#0xb
   \   0003E4   12....       LCALL   ?DEALLOC_XSTACK8
   \   0003E7   02....       LJMP    ??Subroutine134_0 & 0xFFFF
    867          }

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine66:
   \   000000   12....       LCALL   ??Subroutine105_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_226:
   \   000003   A3           INC     DPTR
   \   000004   A3           INC     DPTR
   \   000005   A3           INC     DPTR
   \   000006   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine64:
   \   000000   12....       LCALL   ?Subroutine105 & 0xFFFF
   \                     ??CrossCallReturnLabel_225:
   \   000003   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine57:
   \   000000   E0           MOVX    A,@DPTR
   \   000001   FC           MOV     R4,A
   \   000002   A3           INC     DPTR
   \   000003   E0           MOVX    A,@DPTR
   \   000004   FD           MOV     R5,A
   \   000005   AA..         MOV     R2,?V0 + 2
   \   000007   AB..         MOV     R3,?V0 + 3
   \   000009   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine55:
   \   000000   C3           CLR     C
   \   000001   33           RLC     A
   \   000002   FC           MOV     R4,A
   \   000003   E4           CLR     A
   \   000004   33           RLC     A
   \   000005   FD           MOV     R5,A
   \   000006   8A82         MOV     DPL,R2
   \   000008   8B83         MOV     DPH,R3
   \   00000A   12....       LCALL   ?Subroutine97 & 0xFFFF
   \                     ??CrossCallReturnLabel_210:
   \   00000D                REQUIRE ?Subroutine127
   \   00000D                ; // Fall through to label ?Subroutine127

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine127:
   \   000000   12....       LCALL   ??osal_memcpy?relay
   \   000003   7403         MOV     A,#0x3
   \   000005   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine53:
   \   000000   E0           MOVX    A,@DPTR
   \   000001   2402         ADD     A,#0x2
   \   000003   FC           MOV     R4,A
   \   000004   A3           INC     DPTR
   \   000005   E0           MOVX    A,@DPTR
   \   000006   3400         ADDC    A,#0x0
   \   000008   FD           MOV     R5,A
   \   000009   740C         MOV     A,#0xc
   \   00000B   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine51:
   \   000000   12....       LCALL   ?Subroutine101 & 0xFFFF
   \                     ??CrossCallReturnLabel_214:
   \   000003   E0           MOVX    A,@DPTR
   \   000004   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine48:
   \   000000   E0           MOVX    A,@DPTR
   \   000001   F5..         MOV     ?V0 + 0,A
   \   000003   A3           INC     DPTR
   \   000004   E0           MOVX    A,@DPTR
   \   000005   F5..         MOV     ?V0 + 1,A
   \   000007   75..00       MOV     ?V0 + 2,#0x0
   \   00000A   78..         MOV     R0,#?V0 + 0
   \   00000C   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine47:
   \   000000   12....       LCALL   ?Subroutine96 & 0xFFFF
   \                     ??CrossCallReturnLabel_204:
   \   000003   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine96:
   \   000000   12....       LCALL   ?Subroutine115 & 0xFFFF
   \                     ??CrossCallReturnLabel_250:
   \   000003   A3           INC     DPTR
   \   000004   A3           INC     DPTR
   \   000005   A3           INC     DPTR
   \   000006   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine46:
   \   000000   12....       LCALL   ?Subroutine101 & 0xFFFF
   \                     ??CrossCallReturnLabel_213:
   \   000003   A3           INC     DPTR
   \   000004   E0           MOVX    A,@DPTR
   \   000005   F8           MOV     R0,A
   \   000006   A3           INC     DPTR
   \   000007   E0           MOVX    A,@DPTR
   \   000008   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine101:
   \   000000   12....       LCALL   ?Subroutine115 & 0xFFFF
   \                     ??CrossCallReturnLabel_251:
   \   000003   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine115:
   \   000000   E0           MOVX    A,@DPTR
   \   000001   F8           MOV     R0,A
   \   000002   A3           INC     DPTR
   \   000003   E0           MOVX    A,@DPTR
   \   000004   F583         MOV     DPH,A
   \   000006   8882         MOV     DPL,R0
   \   000008   A3           INC     DPTR
   \   000009   A3           INC     DPTR
   \   00000A   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine45:
   \   000000   12....       LCALL   ?Subroutine96 & 0xFFFF
   \                     ??CrossCallReturnLabel_203:
   \   000003   02....       LJMP    ??Subroutine120_2 & 0xFFFF

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine41:
   \   000000   E0           MOVX    A,@DPTR
   \   000001   240E         ADD     A,#0xe
   \   000003   12....       LCALL   ?Subroutine95 & 0xFFFF
   \                     ??CrossCallReturnLabel_201:
   \   000006   F5..         MOV     ?V0 + 0,A
   \   000008   78..         MOV     R0,#?V0 + 0
   \   00000A   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine33:
   \   000000   E0           MOVX    A,@DPTR
   \   000001   240F         ADD     A,#0xf
   \   000003   12....       LCALL   ?Subroutine95 & 0xFFFF
   \                     ??CrossCallReturnLabel_200:
   \   000006   F9           MOV     R1,A
   \   000007   7A06         MOV     R2,#0x6
   \   000009   7B80         MOV     R3,#-0x80
   \   00000B   12....       LCALL   ??ZDP_EPRsp?relay
   \   00000E   7407         MOV     A,#0x7
   \   000010   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine95:
   \   000000   F8           MOV     R0,A
   \   000001   A3           INC     DPTR
   \   000002   E0           MOVX    A,@DPTR
   \   000003   12....       LCALL   ?Subroutine116 & 0xFFFF
   \                     ??CrossCallReturnLabel_284:
   \   000006   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine116:
   \   000000   3400         ADDC    A,#0x0
   \   000002   F9           MOV     R1,A
   \   000003                REQUIRE ?Subroutine124
   \   000003                ; // Fall through to label ?Subroutine124

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine124:
   \   000000   8882         MOV     DPL,R0
   \   000002   8983         MOV     DPH,R1
   \   000004   E0           MOVX    A,@DPTR
   \   000005   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine120:
   \   000000   A3           INC     DPTR
   \                     ??Subroutine120_0:
   \   000001   A3           INC     DPTR
   \                     ??Subroutine120_1:
   \   000002   A3           INC     DPTR
   \                     ??Subroutine120_2:
   \   000003   A3           INC     DPTR
   \   000004   A3           INC     DPTR
   \   000005   A3           INC     DPTR
   \   000006   A3           INC     DPTR
   \   000007   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine52:
   \   000000   12....       LCALL   ?Subroutine95 & 0xFFFF
   \                     ??CrossCallReturnLabel_202:
   \   000003   F5..         MOV     ?V0 + 2,A
   \   000005   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine59:
   \   000000   12....       LCALL   ?Subroutine121 & 0xFFFF
   \                     ??CrossCallReturnLabel_269:
   \   000003   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine128:
   \   000000   F0           MOVX    @DPTR,A
   \   000001   A3           INC     DPTR
   \   000002   E9           MOV     A,R1
   \   000003   F0           MOVX    @DPTR,A
   \   000004   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine25:
   \   000000   12....       LCALL   ?Subroutine93 & 0xFFFF
   \                     ??CrossCallReturnLabel_194:
   \   000003   A3           INC     DPTR
   \   000004   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine93:
   \   000000   F0           MOVX    @DPTR,A
   \   000001   8A82         MOV     DPL,R2
   \   000003   8B83         MOV     DPH,R3
   \   000005   A3           INC     DPTR
   \   000006   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine134:
   \   000000   AA..         MOV     R2,?V0 + 6
   \   000002   AB..         MOV     R3,?V0 + 7
   \                     ??Subroutine134_0:
   \   000004   7F08         MOV     R7,#0x8
   \   000006   02....       LJMP    ?BANKED_LEAVE_XDATA

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine10:
   \   000000   F8           MOV     R0,A
   \   000001   E5..         MOV     A,?V0 + 1
   \   000003   4F           ORL     A,R7
   \                     ??Subroutine10_0:
   \   000004   F9           MOV     R1,A
   \   000005   8C82         MOV     DPL,R4
   \   000007   8D83         MOV     DPH,R5
   \                     ??Subroutine10_1:
   \   000009   E8           MOV     A,R0
   \   00000A   02....       LJMP    ?Subroutine128 & 0xFFFF
    868          
    869          /*********************************************************************
    870           * @fn      ZDO_ProcessBindUnbindReq()
    871           *
    872           * @brief   Called to process a Bind or Unbind Request message.
    873           *
    874           * @param   inMsg  - incoming message (request)
    875           * @param   pReq - place to put parsed information
    876           *
    877           * @return  none
    878           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    879          void ZDO_ProcessBindUnbindReq( zdoIncomingMsg_t *inMsg, ZDO_BindUnbindReq_t *pReq )
   \                     ZDO_ProcessBindUnbindReq:
    880          {
   \   000000   74F4         MOV     A,#-0xc
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 12
   \   000005                ; Auto size: 12
   \   000005   74F4         MOV     A,#-0xc
   \   000007   12....       LCALL   ?ALLOC_XSTACK8
   \   00000A   8A..         MOV     ?V0 + 0,R2
   \   00000C   8B..         MOV     ?V0 + 1,R3
   \   00000E   EC           MOV     A,R4
   \   00000F   FE           MOV     R6,A
   \   000010   ED           MOV     A,R5
   \   000011   FF           MOV     R7,A
    881            zAddrType_t SourceAddr;       // Binding Source addres
    882            byte bindStat;
    883          
    884            SourceAddr.addrMode = Addr64Bit;
   \   000012   740B         MOV     A,#0xb
   \   000014   12....       LCALL   ?XSTACK_DISP0_8
   \   000017   7403         MOV     A,#0x3
   \   000019   F0           MOVX    @DPTR,A
    885            osal_cpyExtAddr( SourceAddr.addr.extAddr, pReq->srcAddress );
   \   00001A                ; Setup parameters for call to function osal_cpyExtAddr
   \   00001A   12....       LCALL   ?XSTACK_DISP0_8
   \   00001D   AA82         MOV     R2,DPL
   \   00001F   AB83         MOV     R3,DPH
   \   000021   12....       LCALL   ??osal_cpyExtAddr?relay
    886          
    887          
    888            // If the local device is not the primary binding cache
    889            // check the src address of the bind request.
    890            // If it is not the local device's extended address
    891            // discard the request.
    892            if ( !osal_ExtAddrEqual( SourceAddr.addr.extAddr, NLME_GetExtAddr()) ||
    893                  (pReq->dstAddress.addrMode != Addr64Bit &&
    894                   pReq->dstAddress.addrMode != AddrGroup) )
   \   000024                ; Setup parameters for call to function osal_ExtAddrEqual
   \   000024                ; Setup parameters for call to function NLME_GetExtAddr
   \   000024   12....       LCALL   ??NLME_GetExtAddr?relay
   \   000027   EA           MOV     A,R2
   \   000028   FC           MOV     R4,A
   \   000029   EB           MOV     A,R3
   \   00002A   FD           MOV     R5,A
   \   00002B   7403         MOV     A,#0x3
   \   00002D   12....       LCALL   ?XSTACK_DISP0_8
   \   000030   AA82         MOV     R2,DPL
   \   000032   AB83         MOV     R3,DPH
   \   000034   12....       LCALL   ??osal_ExtAddrEqual?relay
   \   000037   E9           MOV     A,R1
   \   000038   600A         JZ      ??ZDO_ProcessBindUnbindReq_0
   \   00003A   12....       LCALL   ?Subroutine69 & 0xFFFF
   \                     ??CrossCallReturnLabel_133:
   \   00003D   600A         JZ      ??ZDO_ProcessBindUnbindReq_1
   \   00003F   E0           MOVX    A,@DPTR
   \   000040   6401         XRL     A,#0x1
   \   000042   6005         JZ      ??ZDO_ProcessBindUnbindReq_1
    895            {
    896              bindStat = ZDP_NOT_SUPPORTED;
   \                     ??ZDO_ProcessBindUnbindReq_0:
   \   000044   7484         MOV     A,#-0x7c
   \   000046   02....       LJMP    ??ZDO_ProcessBindUnbindReq_2 & 0xFFFF
    897            }
    898            else
    899            {
    900              // Check source & destination endpoints
    901              if ( (pReq->srcEndpoint == 0 || pReq->srcEndpoint > MAX_ENDPOINTS)
    902                  || (( pReq->dstAddress.addrMode == Addr64Bit ) &&
    903                      (pReq->dstEndpoint == 0 || pReq->dstEndpoint > MAX_ENDPOINTS)) )
   \                     ??ZDO_ProcessBindUnbindReq_1:
   \   000049   8E82         MOV     DPL,R6
   \   00004B   8F83         MOV     DPH,R7
   \   00004D   A3           INC     DPTR
   \   00004E   A3           INC     DPTR
   \   00004F   A3           INC     DPTR
   \   000050   A3           INC     DPTR
   \   000051   A3           INC     DPTR
   \   000052   A3           INC     DPTR
   \   000053   A3           INC     DPTR
   \   000054   A3           INC     DPTR
   \   000055   E0           MOVX    A,@DPTR
   \   000056   601A         JZ      ??ZDO_ProcessBindUnbindReq_3
   \   000058   C3           CLR     C
   \   000059   94F1         SUBB    A,#-0xf
   \   00005B   5015         JNC     ??ZDO_ProcessBindUnbindReq_3
   \   00005D   12....       LCALL   ?Subroutine69 & 0xFFFF
   \                     ??CrossCallReturnLabel_134:
   \   000060   7014         JNZ     ??ZDO_ProcessBindUnbindReq_4
   \   000062   EE           MOV     A,R6
   \   000063   2414         ADD     A,#0x14
   \   000065   F582         MOV     DPL,A
   \   000067   EF           MOV     A,R7
   \   000068   12....       LCALL   ??Subroutine70_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_137:
   \   00006B   6005         JZ      ??ZDO_ProcessBindUnbindReq_3
   \   00006D   C3           CLR     C
   \   00006E   94F1         SUBB    A,#-0xf
   \   000070   4004         JC      ??ZDO_ProcessBindUnbindReq_4
    904              {
    905                bindStat = ZDP_INVALID_EP;
   \                     ??ZDO_ProcessBindUnbindReq_3:
   \   000072   7482         MOV     A,#-0x7e
   \   000074   807E         SJMP    ??ZDO_ProcessBindUnbindReq_2
    906              }
    907              else
    908              {
    909                if ( inMsg->clusterID == Bind_req )
   \                     ??ZDO_ProcessBindUnbindReq_4:
   \   000076   12....       LCALL   ?Subroutine70 & 0xFFFF
   \                     ??CrossCallReturnLabel_138:
   \   000079   6421         XRL     A,#0x21
   \   00007B   7002         JNZ     ??ZDO_ProcessBindUnbindReq_5
   \   00007D   A3           INC     DPTR
   \   00007E   E0           MOVX    A,@DPTR
   \                     ??ZDO_ProcessBindUnbindReq_5:
   \   00007F   702D         JNZ     ??ZDO_ProcessBindUnbindReq_6
    910                {
    911                  uint16 nwkAddr;
    912          
    913                  // Check for the destination address
    914                  if ( pReq->dstAddress.addrMode == Addr64Bit )
   \   000081   12....       LCALL   ?Subroutine69 & 0xFFFF
   \                     ??CrossCallReturnLabel_135:
   \   000084   7033         JNZ     ??ZDO_ProcessBindUnbindReq_7
    915                  {
    916                    if ( APSME_LookupNwkAddr( pReq->dstAddress.addr.extAddr, &nwkAddr ) == FALSE )
   \   000086                ; Setup parameters for call to function APSME_LookupNwkAddr
   \   000086   7401         MOV     A,#0x1
   \   000088   12....       LCALL   ?XSTACK_DISP0_8
   \   00008B   AC82         MOV     R4,DPL
   \   00008D   AD83         MOV     R5,DPH
   \   00008F   EE           MOV     A,R6
   \   000090   240B         ADD     A,#0xb
   \   000092   FA           MOV     R2,A
   \   000093   EF           MOV     A,R7
   \   000094   3400         ADDC    A,#0x0
   \   000096   FB           MOV     R3,A
   \   000097   12....       LCALL   ??APSME_LookupNwkAddr?relay
   \   00009A   E9           MOV     A,R1
   \   00009B   7011         JNZ     ??ZDO_ProcessBindUnbindReq_6
    917                    {
    918                      ZDP_NwkAddrReq( pReq->dstAddress.addr.extAddr, ZDP_ADDR_REQTYPE_SINGLE, 0, 0 );
   \   00009D                ; Setup parameters for call to function ZDP_NwkAddrReq
   \   00009D   7D00         MOV     R5,#0x0
   \   00009F   7C00         MOV     R4,#0x0
   \   0000A1   7900         MOV     R1,#0x0
   \   0000A3   EE           MOV     A,R6
   \   0000A4   240B         ADD     A,#0xb
   \   0000A6   FA           MOV     R2,A
   \   0000A7   EF           MOV     A,R7
   \   0000A8   3400         ADDC    A,#0x0
   \   0000AA   FB           MOV     R3,A
   \   0000AB   12....       LCALL   ??ZDP_NwkAddrReq?relay
    919                    }
    920                  }
    921                }
    922          
    923                if ( inMsg->clusterID == Bind_req )
   \                     ??ZDO_ProcessBindUnbindReq_6:
   \   0000AE   12....       LCALL   ?Subroutine70 & 0xFFFF
   \                     ??CrossCallReturnLabel_139:
   \   0000B1   6421         XRL     A,#0x21
   \   0000B3   7002         JNZ     ??ZDO_ProcessBindUnbindReq_8
   \   0000B5   A3           INC     DPTR
   \   0000B6   E0           MOVX    A,@DPTR
   \                     ??ZDO_ProcessBindUnbindReq_8:
   \   0000B7   7025         JNZ     ??ZDO_ProcessBindUnbindReq_9
    924                {
    925                  if ( APSME_BindRequest( pReq->srcEndpoint, pReq->clusterID,
    926                                 &(pReq->dstAddress), pReq->dstEndpoint ) == ZSuccess )
   \                     ??ZDO_ProcessBindUnbindReq_7:
   \   0000B9                ; Setup parameters for call to function APSME_BindRequest
   \   0000B9   12....       LCALL   ?Subroutine58 & 0xFFFF
   \                     ??CrossCallReturnLabel_115:
   \   0000BC   12....       LCALL   ?PUSH_XSTACK_I_ONE
   \   0000BF   12....       LCALL   ?Subroutine40 & 0xFFFF
   \                     ??CrossCallReturnLabel_82:
   \   0000C2   12....       LCALL   ??APSME_BindRequest?relay
   \   0000C5   7401         MOV     A,#0x1
   \   0000C7   12....       LCALL   ?DEALLOC_XSTACK8
   \   0000CA   E9           MOV     A,R1
   \   0000CB   700D         JNZ     ??ZDO_ProcessBindUnbindReq_10
    927                  {
    928                    bindStat = ZDP_SUCCESS;
   \                     ??ZDO_ProcessBindUnbindReq_11:
   \   0000CD   E4           CLR     A
   \   0000CE   85..82       MOV     DPL,?XSP + 0
   \   0000D1   85..83       MOV     DPH,?XSP + 1
   \   0000D4   F0           MOVX    @DPTR,A
    929                    // Notify to save info into NV
    930                    ZDApp_NVUpdate();
   \   0000D5                ; Setup parameters for call to function ZDApp_NVUpdate
   \   0000D5   12....       LCALL   ??ZDApp_NVUpdate?relay
   \   0000D8   8021         SJMP    ??ZDO_ProcessBindUnbindReq_12
    931                  }
    932                  else
    933                    bindStat = ZDP_TABLE_FULL;
   \                     ??ZDO_ProcessBindUnbindReq_10:
   \   0000DA   7487         MOV     A,#-0x79
   \   0000DC   8016         SJMP    ??ZDO_ProcessBindUnbindReq_2
    934                }
    935                else // Unbind_req
    936                {
    937                  if ( APSME_UnBindRequest( pReq->srcEndpoint, pReq->clusterID,
    938                                 &(pReq->dstAddress), pReq->dstEndpoint ) == ZSuccess )
   \                     ??ZDO_ProcessBindUnbindReq_9:
   \   0000DE                ; Setup parameters for call to function APSME_UnBindRequest
   \   0000DE   12....       LCALL   ?Subroutine58 & 0xFFFF
   \                     ??CrossCallReturnLabel_116:
   \   0000E1   12....       LCALL   ?PUSH_XSTACK_I_ONE
   \   0000E4   12....       LCALL   ?Subroutine40 & 0xFFFF
   \                     ??CrossCallReturnLabel_83:
   \   0000E7   12....       LCALL   ??APSME_UnBindRequest?relay
   \   0000EA   7401         MOV     A,#0x1
   \   0000EC   12....       LCALL   ?DEALLOC_XSTACK8
   \   0000EF   E9           MOV     A,R1
   \   0000F0   60DB         JZ      ??ZDO_ProcessBindUnbindReq_11
    939                  {
    940                    bindStat = ZDP_SUCCESS;
    941          
    942                    // Notify to save info into NV
    943                    ZDApp_NVUpdate();
    944                  }
    945                  else
    946                    bindStat = ZDP_NO_ENTRY;
   \   0000F2   7488         MOV     A,#-0x78
   \                     ??ZDO_ProcessBindUnbindReq_2:
   \   0000F4   85..82       MOV     DPL,?XSP + 0
   \   0000F7   85..83       MOV     DPH,?XSP + 1
   \   0000FA   F0           MOVX    @DPTR,A
    947                }
    948              }
    949            }
    950          
    951            // Send back a response message
    952            ZDP_SendData( &(inMsg->TransSeq), &(inMsg->srcAddr),
    953                         (inMsg->clusterID | ZDO_RESPONSE_BIT), 1, &bindStat,
    954                         inMsg->SecurityUse );
   \                     ??ZDO_ProcessBindUnbindReq_12:
   \   0000FB                ; Setup parameters for call to function ZDP_SendData
   \   0000FB   E5..         MOV     A,?V0 + 0
   \   0000FD   240E         ADD     A,#0xe
   \   0000FF   F582         MOV     DPL,A
   \   000101   E5..         MOV     A,?V0 + 1
   \   000103   12....       LCALL   ??Subroutine58_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_117:
   \   000106   12....       LCALL   ?PUSH_XSTACK_I_ONE
   \   000109   7401         MOV     A,#0x1
   \   00010B   12....       LCALL   ?XSTACK_DISP0_8
   \   00010E   8582..       MOV     ?V0 + 2,DPL
   \   000111   8583..       MOV     ?V0 + 3,DPH
   \   000114   78..         MOV     R0,#?V0 + 2
   \   000116   12....       LCALL   ?PUSH_XSTACK_I_TWO
   \   000119   12....       LCALL   ?Subroutine70 & 0xFFFF
   \                     ??CrossCallReturnLabel_140:
   \   00011C   F5..         MOV     ?V0 + 2,A
   \   00011E   A3           INC     DPTR
   \   00011F   E0           MOVX    A,@DPTR
   \   000120   4480         ORL     A,#0x80
   \   000122   F5..         MOV     ?V0 + 3,A
   \   000124   78..         MOV     R0,#?V0 + 2
   \   000126   12....       LCALL   ?PUSH_XSTACK_I_TWO
   \   000129   7901         MOV     R1,#0x1
   \   00012B   E5..         MOV     A,?V0 + 0
   \   00012D   2402         ADD     A,#0x2
   \   00012F   FC           MOV     R4,A
   \   000130   E5..         MOV     A,?V0 + 1
   \   000132   3400         ADDC    A,#0x0
   \   000134   FD           MOV     R5,A
   \   000135   E5..         MOV     A,?V0 + 0
   \   000137   240F         ADD     A,#0xf
   \   000139   FA           MOV     R2,A
   \   00013A   E5..         MOV     A,?V0 + 1
   \   00013C   3400         ADDC    A,#0x0
   \   00013E   FB           MOV     R3,A
   \   00013F   12....       LCALL   ??ZDP_SendData?relay
   \   000142   7405         MOV     A,#0x5
   \   000144   12....       LCALL   ?DEALLOC_XSTACK8
    955          }
   \   000147   740C         MOV     A,#0xc
   \   000149   02....       LJMP    ?Subroutine119 & 0xFFFF

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine69:
   \   000000   EE           MOV     A,R6
   \   000001   2413         ADD     A,#0x13
   \   000003   12....       LCALL   ?Subroutine108 & 0xFFFF
   \                     ??CrossCallReturnLabel_236:
   \   000006   6403         XRL     A,#0x3
   \   000008   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine40:
   \   000000   EE           MOV     A,R6
   \   000001   240B         ADD     A,#0xb
   \   000003   FC           MOV     R4,A
   \   000004   EF           MOV     A,R7
   \   000005   3400         ADDC    A,#0x0
   \   000007   FD           MOV     R5,A
   \   000008   8E82         MOV     DPL,R6
   \   00000A   8F83         MOV     DPH,R7
   \   00000C   A3           INC     DPTR
   \   00000D   A3           INC     DPTR
   \   00000E   A3           INC     DPTR
   \   00000F   A3           INC     DPTR
   \   000010   A3           INC     DPTR
   \   000011   A3           INC     DPTR
   \   000012   A3           INC     DPTR
   \   000013   A3           INC     DPTR
   \   000014   A3           INC     DPTR
   \   000015   12....       LCALL   ?Subroutine97 & 0xFFFF
   \                     ??CrossCallReturnLabel_209:
   \   000018   8E82         MOV     DPL,R6
   \   00001A   8F83         MOV     DPH,R7
   \   00001C   A3           INC     DPTR
   \   00001D   A3           INC     DPTR
   \   00001E   A3           INC     DPTR
   \   00001F   A3           INC     DPTR
   \   000020   A3           INC     DPTR
   \   000021   A3           INC     DPTR
   \   000022   A3           INC     DPTR
   \   000023   A3           INC     DPTR
   \   000024   E0           MOVX    A,@DPTR
   \   000025   F9           MOV     R1,A
   \   000026   22           RET
    956          
    957          /*********************************************************************
    958           * @fn      ZDO_UpdateAddrManager
    959           *
    960           * @brief   Update the Address Manager.
    961           *
    962           * @param   nwkAddr - network address
    963           * @param   extAddr - extended address
    964           *
    965           * @return  none
    966           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
    967          void ZDO_UpdateAddrManager( uint16 nwkAddr, uint8 *extAddr )
   \                     ZDO_UpdateAddrManager:
    968          {
   \   000000   C082         PUSH    DPL
   \   000002   C083         PUSH    DPH
   \   000004                ; Saved register size: 2
   \   000004                ; Auto size: 13
   \   000004   74F3         MOV     A,#-0xd
   \   000006   12....       LCALL   ?ALLOC_XSTACK8
    969            AddrMgrEntry_t addrEntry;
    970          
    971            // Update the address manager
    972            addrEntry.user = ADDRMGR_USER_DEFAULT;
   \   000009   E4           CLR     A
   \   00000A   85..82       MOV     DPL,?XSP + 0
   \   00000D   85..83       MOV     DPH,?XSP + 1
   \   000010   F0           MOVX    @DPTR,A
    973            addrEntry.nwkAddr = nwkAddr;
   \   000011   7401         MOV     A,#0x1
   \   000013   12....       LCALL   ?XSTACK_DISP0_8
   \   000016   12....       LCALL   ?Subroutine26 & 0xFFFF
    974            AddrMgrExtAddrSet( addrEntry.extAddr, extAddr );
   \                     ??CrossCallReturnLabel_52:
   \   000019                ; Setup parameters for call to function AddrMgrExtAddrSet
   \   000019   7403         MOV     A,#0x3
   \   00001B   12....       LCALL   ?XSTACK_DISP0_8
   \   00001E   AA82         MOV     R2,DPL
   \   000020   AB83         MOV     R3,DPH
   \   000022   12....       LCALL   ??AddrMgrExtAddrSet?relay
    975            AddrMgrEntryUpdate( &addrEntry );
   \   000025                ; Setup parameters for call to function AddrMgrEntryUpdate
   \   000025   85..82       MOV     DPL,?XSP + 0
   \   000028   85..83       MOV     DPH,?XSP + 1
   \   00002B   AA82         MOV     R2,DPL
   \   00002D   AB83         MOV     R3,DPH
   \   00002F   12....       LCALL   ??AddrMgrEntryUpdate?relay
    976          }
   \   000032   740D         MOV     A,#0xd
   \   000034   12....       LCALL   ?DEALLOC_XSTACK8
   \   000037   02....       LJMP    ?Subroutine118 & 0xFFFF
    977          
    978          #if defined ( ZDO_SERVERDISC_RESPONSE )
    979          /*********************************************************************
    980           * @fn          ZDO_ProcessServerDiscReq
    981           *
    982           * @brief       Process the Server_Discovery_req message.
    983           *
    984           * @param   inMsg  - incoming message (request)
    985           *
    986           * @return      none
    987           */
    988          void ZDO_ProcessServerDiscReq( zdoIncomingMsg_t *inMsg )
    989          {
    990            uint16 serverMask = BUILD_UINT16( inMsg->asdu[0], inMsg->asdu[1] );
    991            uint16 matchMask = serverMask & ZDO_Config_Node_Descriptor.ServerMask;
    992          
    993            if ( matchMask )
    994            {
    995              ZDP_ServerDiscRsp( inMsg->TransSeq, &(inMsg->srcAddr), ZSUCCESS,
    996                          ZDAppNwkAddr.addr.shortAddr, matchMask, inMsg->SecurityUse );
    997            }
    998          }
    999          #endif
   1000          
   1001          /*********************************************************************
   1002           * Call Back Functions from APS  - API
   1003           */
   1004          
   1005          /*********************************************************************
   1006           * @fn          ZDO_EndDeviceTimeoutCB
   1007           *
   1008           * @brief       This function handles the binding timer for the End
   1009           *              Device Bind command.
   1010           *
   1011           * @param       none
   1012           *
   1013           * @return      none
   1014           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   1015          void ZDO_EndDeviceTimeoutCB( void )
   \                     ZDO_EndDeviceTimeoutCB:
   1016          {
   \   000000                ; Saved register size: 0
   \   000000                ; Auto size: 0
   1017          #if defined ( REFLECTOR )
   1018            byte stat;
   1019            if ( ZDO_EDBind )
   1020            {
   1021              stat = ZDO_EDBind->status;
   1022          
   1023              // Send the response message to the first sent
   1024              ZDO_SendEDBindRsp( ZDO_EDBind->SrcTransSeq, &(ZDO_EDBind->SrcAddr),
   1025                                  stat, ZDO_EDBind->SecurityUse );
   1026          
   1027              ZDO_RemoveEndDeviceBind();
   1028            }
   1029          #endif  // REFLECTOR
   1030          }
   \   000000   02....       LJMP    ?BRET
   1031          
   1032          /*********************************************************************
   1033           * Optional Management Messages
   1034           */
   1035          
   1036          #if defined( ZDO_MGMT_LQI_RESPONSE ) && defined ( RTR_NWK )
   1037          /*********************************************************************
   1038           * @fn          ZDO_ProcessMgmtLqiReq
   1039           *
   1040           * @brief       This function handles parsing the incoming Management
   1041           *              LQI request and generate the response.
   1042           *
   1043           *   Note:      This function will limit the number of items returned
   1044           *              to ZDO_MAX_LQI_ITEMS items.
   1045           *
   1046           * @param       inMsg - incoming message (request)
   1047           *
   1048           * @return      none
   1049           */
   1050          void ZDO_ProcessMgmtLqiReq( zdoIncomingMsg_t *inMsg )
   1051          {
   1052            byte x;
   1053            byte index;
   1054            byte numItems;
   1055            byte maxItems;
   1056            ZDP_MgmtLqiItem_t* table;
   1057            ZDP_MgmtLqiItem_t* item;
   1058            neighborEntry_t    entry;
   1059            byte aItems;
   1060            associated_devices_t *aDevice;
   1061            uint8 StartIndex = inMsg->asdu[0];
   1062          
   1063            // Get the number of neighbor items
   1064            NLME_GetRequest( nwkNumNeighborTableEntries, 0, &maxItems );
   1065          
   1066            // Get the number of associated items
   1067            aItems = (uint8)AssocCount( PARENT, CHILD_FFD_RX_IDLE );
   1068            // Total number of items
   1069            maxItems += aItems;
   1070          
   1071            // Start with the supplied index
   1072            numItems = maxItems - StartIndex;
   1073          
   1074            // limit the size of the list
   1075            if ( numItems > ZDO_MAX_LQI_ITEMS )
   1076              numItems = ZDO_MAX_LQI_ITEMS;
   1077          
   1078            // Allocate the memory to build the table
   1079            table = (ZDP_MgmtLqiItem_t*)osal_mem_alloc( (short)
   1080                      ( numItems * sizeof( ZDP_MgmtLqiItem_t ) ) );
   1081          
   1082            if ( table != NULL )
   1083            {
   1084              x = 0;
   1085              item = table;
   1086              index = StartIndex;
   1087          
   1088              // Loop through associated items and build list
   1089              for ( ; x < numItems; x++ )
   1090              {
   1091                if ( index < aItems )
   1092                {
   1093                  // get next associated device
   1094                  aDevice = AssocFindDevice( index++ );
   1095          
   1096                  // set basic fields
   1097                  item->panID   = _NIB.nwkPanId;
   1098                  osal_cpyExtAddr( item->extPanID, _NIB.extendedPANID );
   1099                  item->nwkAddr = aDevice->shortAddr;
   1100                  item->permit  = ZDP_MGMT_BOOL_UNKNOWN;
   1101                  item->depth   = 0xFF;
   1102                  item->lqi     = aDevice->linkInfo.rxCost;
   1103          
   1104                  osal_memset( item->extAddr, 0x00, Z_EXTADDR_LEN );
   1105          
   1106                  // use association info to set other fields
   1107                  if ( aDevice->nodeRelation == PARENT )
   1108                  {
   1109                    if (  aDevice->shortAddr == 0 )
   1110                    {
   1111                      item->devType = ZDP_MGMT_DT_COORD;
   1112                    }
   1113                    else
   1114                    {
   1115                      item->devType = ZDP_MGMT_DT_ROUTER;
   1116                    }
   1117          
   1118                    item->rxOnIdle = ZDP_MGMT_BOOL_UNKNOWN;
   1119                    item->relation = ZDP_MGMT_REL_PARENT;
   1120                  }
   1121                  else
   1122                  {
   1123                    if ( aDevice->nodeRelation < CHILD_FFD )
   1124                    {
   1125                      item->devType = ZDP_MGMT_DT_ENDDEV;
   1126          
   1127                      if ( aDevice->nodeRelation == CHILD_RFD )
   1128                      {
   1129                        item->rxOnIdle = FALSE;
   1130                      }
   1131                      else
   1132                      {
   1133                        item->rxOnIdle = TRUE;
   1134                      }
   1135                    }
   1136                    else
   1137                    {
   1138                      item->devType = ZDP_MGMT_DT_ROUTER;
   1139          
   1140                      if ( aDevice->nodeRelation == CHILD_FFD )
   1141                      {
   1142                        item->rxOnIdle = FALSE;
   1143                      }
   1144                      else
   1145                      {
   1146                        item->rxOnIdle = TRUE;
   1147                      }
   1148                    }
   1149          
   1150                    item->relation = ZDP_MGMT_REL_CHILD;
   1151                  }
   1152          
   1153                  item++;
   1154                }
   1155                else
   1156                {
   1157                  if ( StartIndex <= aItems )
   1158                    // Start with 1st neighbor
   1159                    index = 0;
   1160                  else
   1161                    // Start with >1st neighbor
   1162                    index = StartIndex - aItems;
   1163                  break;
   1164                }
   1165              }
   1166          
   1167              // Loop through neighbor items and finish list
   1168              for ( ; x < numItems; x++ )
   1169              {
   1170                // Add next neighbor table item
   1171                NLME_GetRequest( nwkNeighborTable, index++, &entry );
   1172          
   1173                // set ZDP_MgmtLqiItem_t fields
   1174                item->panID    = entry.panId;
   1175                osal_memset( item->extPanID, 0x00, Z_EXTADDR_LEN);
   1176                osal_memset( item->extAddr, 0x00, Z_EXTADDR_LEN );
   1177                item->nwkAddr  = entry.neighborAddress;
   1178                item->rxOnIdle = ZDP_MGMT_BOOL_UNKNOWN;
   1179                item->relation = ZDP_MGMT_REL_UNKNOWN;
   1180                item->permit   = ZDP_MGMT_BOOL_UNKNOWN;
   1181                item->depth    = 0xFF;
   1182                item->lqi      = entry.linkInfo.rxCost;
   1183          
   1184                if ( item->nwkAddr == 0 )
   1185                {
   1186                  item->devType = ZDP_MGMT_DT_COORD;
   1187                }
   1188                else
   1189                {
   1190                  item->devType = ZDP_MGMT_DT_ROUTER;
   1191                }
   1192          
   1193                item++;
   1194              }
   1195          
   1196              // Send response
   1197              ZDP_MgmtLqiRsp( inMsg->TransSeq, &(inMsg->srcAddr), ZSuccess, maxItems,
   1198                              StartIndex, numItems, table, false );
   1199          
   1200              osal_mem_free( table );
   1201            }
   1202          }
   1203          #endif // ZDO_MGMT_LQI_RESPONSE && RTR_NWK
   1204          
   1205          #if defined( ZDO_MGMT_NWKDISC_RESPONSE )
   1206          /*********************************************************************
   1207           * @fn          ZDO_ProcessMgmtNwkDiscReq
   1208           *
   1209           * @brief       This function handles parsing the incoming Management
   1210           *              Network Discover request and starts the request.
   1211           *
   1212           * @param       inMsg - incoming message (request)
   1213           *
   1214           * @return      none
   1215           */
   1216          void ZDO_ProcessMgmtNwkDiscReq( zdoIncomingMsg_t *inMsg )
   1217          {
   1218            NLME_ScanFields_t scan;
   1219            uint8             index;
   1220            uint8             *msg;
   1221          
   1222            msg = inMsg->asdu;
   1223            scan.channels = BUILD_UINT32( msg[0], msg[1], msg[2], msg[3] );
   1224            msg += 4;
   1225            scan.duration = *msg++;
   1226            index         = *msg;
   1227          
   1228            // Save off the information to be used for the response
   1229            zdappMgmtNwkDiscReqInProgress          = true;
   1230            zdappMgmtNwkDiscRspAddr.addrMode       = Addr16Bit;
   1231            zdappMgmtNwkDiscRspAddr.addr.shortAddr = inMsg->srcAddr.addr.shortAddr;
   1232            zdappMgmtNwkDiscStartIndex             = index;
   1233            zdappMgmtNwkDiscRspTransSeq            = inMsg->TransSeq;
   1234          
   1235            if ( NLME_NwkDiscReq2( &scan ) != ZSuccess )
   1236            {
   1237              NLME_NwkDiscTerm();
   1238          
   1239              // zdappMgmtNwkDiscReqInProgress will be reset in the confirm callback
   1240            }
   1241          }
   1242          #endif // ZDO_MGMT_NWKDISC_RESPONSE
   1243          
   1244          #if defined ( ZDO_MGMT_NWKDISC_RESPONSE )
   1245          /*********************************************************************
   1246           * @fn          ZDO_FinishProcessingMgmtNwkDiscReq
   1247           *
   1248           * @brief       This function finishes the processing of the Management
   1249           *              Network Discover Request and generates the response.
   1250           *
   1251           *   Note:      This function will limit the number of items returned
   1252           *              to ZDO_MAX_NWKDISC_ITEMS items.
   1253           *
   1254           * @param       ResultCountSrcAddr - source of the request
   1255           * @param       msg - pointer to incoming message
   1256           * @param       SecurityUse -
   1257           *
   1258           * @return      none
   1259           */
   1260          void ZDO_FinishProcessingMgmtNwkDiscReq( byte ResultCount,
   1261                                                   networkDesc_t *NetworkList )
   1262          {
   1263            byte count;
   1264          
   1265          #if defined ( RTR_NWK )
   1266            networkDesc_t *newDesc, *pList = NetworkList;
   1267          
   1268            // Look for my PanID.
   1269            while ( pList )
   1270            {
   1271              if ( pList->panId == _NIB.nwkPanId )
   1272              {
   1273                break;
   1274              }
   1275          
   1276              if ( !pList->nextDesc )
   1277              {
   1278                break;
   1279              }
   1280              pList = pList->nextDesc;
   1281            }
   1282          
   1283            // If my Pan not present (query to a star network ZC or an isolated ZR?),
   1284            // prepend it.
   1285            if ( !pList || (pList->panId != _NIB.nwkPanId) )
   1286            {
   1287              newDesc = (networkDesc_t *)osal_mem_alloc( sizeof( networkDesc_t ) );
   1288              if ( newDesc )
   1289              {
   1290                byte pJoin;
   1291          
   1292                newDesc->panId = _NIB.nwkPanId;
   1293                newDesc->logicalChannel = _NIB.nwkLogicalChannel;
   1294                newDesc->beaconOrder = _NIB.beaconOrder;
   1295                newDesc->superFrameOrder = _NIB.superFrameOrder;
   1296                newDesc->version = NLME_GetProtocolVersion();
   1297                newDesc->stackProfile = zgStackProfile;
   1298                //Extended PanID
   1299                osal_cpyExtAddr( newDesc->extendedPANID, _NIB.extendedPANID);
   1300          
   1301                ZMacGetReq( ZMacAssociationPermit, &pJoin );
   1302                newDesc->chosenRouter = ((pJoin) ? ZDAppNwkAddr.addr.shortAddr :
   1303                                                   INVALID_NODE_ADDR);
   1304          
   1305                newDesc->nextDesc = NetworkList;
   1306                NetworkList = newDesc;
   1307                ResultCount++;
   1308              }
   1309            }
   1310          #endif
   1311          
   1312            // Calc the count and apply a max count.
   1313            if ( zdappMgmtNwkDiscStartIndex > ResultCount )
   1314            {
   1315              count = 0;
   1316            }
   1317            else
   1318            {
   1319              count = ResultCount - zdappMgmtNwkDiscStartIndex;
   1320              if ( count > ZDO_MAX_NWKDISC_ITEMS )
   1321              {
   1322                count = ZDO_MAX_NWKDISC_ITEMS;
   1323              }
   1324          
   1325              // Move the list pointer up to the start index.
   1326              NetworkList += zdappMgmtNwkDiscStartIndex;
   1327            }
   1328          
   1329            ZDP_MgmtNwkDiscRsp( zdappMgmtNwkDiscRspTransSeq,
   1330                               &zdappMgmtNwkDiscRspAddr, ZSuccess, ResultCount,
   1331                                zdappMgmtNwkDiscStartIndex,
   1332                                count,
   1333                                NetworkList,
   1334                                false );
   1335          
   1336          #if defined ( RTR_NWK )
   1337            if ( newDesc )
   1338            {
   1339              osal_mem_free( newDesc );
   1340            }
   1341          #endif
   1342          
   1343            NLME_NwkDiscTerm();
   1344          }
   1345          #endif
   1346          
   1347          #if defined ( ZDO_MGMT_RTG_RESPONSE ) && defined ( RTR_NWK )
   1348          /*********************************************************************
   1349           * @fn          ZDO_ProcessMgmtRtgReq
   1350           *
   1351           * @brief       This function finishes the processing of the Management
   1352           *              Routing Request and generates the response.
   1353           *
   1354           *   Note:      This function will limit the number of items returned
   1355           *              to ZDO_MAX_RTG_ITEMS items.
   1356           *
   1357           * @param       ResultCountSrcAddr - source of the request
   1358           * @param       msg - pointer to incoming message
   1359           * @param       SecurityUse -
   1360           *
   1361           * @return      none
   1362           */
   1363          void ZDO_ProcessMgmtRtgReq( zdoIncomingMsg_t *inMsg )
   1364          {
   1365            byte x;
   1366            byte maxNumItems;
   1367            byte numItems;
   1368            byte *pBuf;
   1369            rtgItem_t *pList;
   1370            uint8 StartIndex = inMsg->asdu[0];
   1371          
   1372            // Get the number of table items
   1373            NLME_GetRequest( nwkNumRoutingTableEntries, 0, &maxNumItems );
   1374          
   1375            numItems = maxNumItems - StartIndex;    // Start at the passed in index
   1376          
   1377            // limit the size of the list
   1378            if ( numItems > ZDO_MAX_RTG_ITEMS )
   1379              numItems = ZDO_MAX_RTG_ITEMS;
   1380          
   1381            // Allocate the memory to build the table
   1382            pBuf = osal_mem_alloc( (short)(sizeof( rtgItem_t ) * numItems) );
   1383          
   1384            if ( pBuf )
   1385            {
   1386              // Convert buffer to list
   1387              pList = (rtgItem_t *)pBuf;
   1388          
   1389              // Loop through items and build list
   1390              for ( x = 0; x < numItems; x++ )
   1391              {
   1392                NLME_GetRequest( nwkRoutingTable, (uint16)(x + StartIndex), (void*)pList );
   1393          
   1394                // Remap the status to the RoutingTableList Record Format defined in the ZigBee spec
   1395                switch( pList->status )
   1396                {
   1397                  case RT_ACTIVE:
   1398                    pList->status = ZDO_MGMT_RTG_ENTRY_ACTIVE;
   1399                    break;
   1400          
   1401                  case RT_DISC:
   1402                    pList->status = ZDO_MGMT_RTG_ENTRY_DISCOVERY_UNDERWAY;
   1403                    break;
   1404          
   1405                  case RT_LINK_FAIL:
   1406                    pList->status = ZDO_MGMT_RTG_ENTRY_DISCOVERY_FAILED;
   1407          
   1408                  case RT_INIT:
   1409                  case RT_REPAIR:
   1410                  default:
   1411                    pList->status = ZDO_MGMT_RTG_ENTRY_INACTIVE;
   1412                    break;
   1413                }
   1414          
   1415                // Increment pointer to next record
   1416                pList++;
   1417              }
   1418          
   1419              // Send response
   1420              ZDP_MgmtRtgRsp( inMsg->TransSeq, &(inMsg->srcAddr), ZSuccess, maxNumItems, StartIndex, numItems,
   1421                                    (rtgItem_t *)pBuf, false );
   1422          
   1423              osal_mem_free( pBuf );
   1424            }
   1425          }
   1426          #endif // defined(ZDO_MGMT_RTG_RESPONSE)  && defined(RTR_NWK)
   1427          
   1428          #if defined ( ZDO_MGMT_BIND_RESPONSE )
   1429          /*********************************************************************
   1430           * @fn          ZDO_ProcessMgmtBindReq
   1431           *
   1432           * @brief       This function finishes the processing of the Management
   1433           *              Bind Request and generates the response.
   1434           *
   1435           *   Note:      This function will limit the number of items returned
   1436           *              to ZDO_MAX_BIND_ITEMS items.
   1437           *
   1438           * @param       ResultCountSrcAddr - source of the request
   1439           * @param       msg - pointer to incoming message
   1440           * @param       SecurityUse -
   1441           *
   1442           * @return      none
   1443           */
   1444          void ZDO_ProcessMgmtBindReq( zdoIncomingMsg_t *inMsg )
   1445          {
   1446          #if defined ( REFLECTOR )
   1447            byte x;
   1448            uint16 maxNumItems;
   1449            uint16 numItems;
   1450            byte *pBuf = NULL;
   1451            apsBindingItem_t *pList;
   1452            uint8 StartIndex = inMsg->asdu[0];
   1453          
   1454            // Get the number of table items
   1455            APSME_GetRequest( apsNumBindingTableEntries, 0, (byte*)(&maxNumItems) );
   1456          
   1457            if ( maxNumItems > StartIndex )
   1458              numItems = maxNumItems - StartIndex;    // Start at the passed in index
   1459            else
   1460              numItems = 0;
   1461          
   1462            // limit the size of the list
   1463            if ( numItems > ZDO_MAX_BIND_ITEMS )
   1464              numItems = ZDO_MAX_BIND_ITEMS;
   1465          
   1466            // Allocate the memory to build the table
   1467            if ( numItems )
   1468              pBuf = osal_mem_alloc( sizeof( apsBindingItem_t ) * numItems );
   1469          
   1470            if ( pBuf )
   1471            {
   1472              // Convert buffer to list
   1473              pList = (apsBindingItem_t *)pBuf;
   1474          
   1475              // Loop through items and build list
   1476              for ( x = 0; x < numItems; x++ )
   1477              {
   1478                APSME_GetRequest( apsBindingTable, (x + StartIndex), (void*)pList );
   1479                pList++;
   1480              }
   1481            }
   1482          
   1483            // Send response
   1484            ZDP_MgmtBindRsp( inMsg->TransSeq, &(inMsg->srcAddr), ZSuccess, (byte)maxNumItems, StartIndex, (byte)numItems,
   1485                                  (apsBindingItem_t *)pBuf, false );
   1486          
   1487            if ( pBuf )
   1488            {
   1489              osal_mem_free( pBuf );
   1490            }
   1491          #endif
   1492          }
   1493          #endif // ZDO_MGMT_BIND_RESPONSE
   1494          
   1495          #if defined ( ZDO_MGMT_JOINDIRECT_RESPONSE ) && defined ( RTR_NWK )
   1496          /*********************************************************************
   1497           * @fn          ZDO_ProcessMgmtDirectJoinReq
   1498           *
   1499           * @brief       This function finishes the processing of the Management
   1500           *              Direct Join Request and generates the response.
   1501           *
   1502           * @param       inMsg - incoming message (request)
   1503           *
   1504           * @return      none
   1505           */
   1506          void ZDO_ProcessMgmtDirectJoinReq( zdoIncomingMsg_t *inMsg )
   1507          {
   1508            uint8 *deviceAddr;
   1509            uint8 capInfo;
   1510            uint8 stat;
   1511          
   1512            // Parse the message
   1513            deviceAddr = inMsg->asdu;
   1514            capInfo = inMsg->asdu[Z_EXTADDR_LEN];
   1515          
   1516            stat = (byte) NLME_DirectJoinRequest( deviceAddr, capInfo );
   1517          
   1518            ZDP_MgmtDirectJoinRsp( inMsg->TransSeq, &(inMsg->srcAddr), stat, false );
   1519          }
   1520          #endif // ZDO_MGMT_JOINDIRECT_RESPONSE && RTR_NWK
   1521          
   1522          #if defined ( ZDO_MGMT_LEAVE_RESPONSE )
   1523          /*********************************************************************
   1524           * @fn          ZDO_ProcessMgmtLeaveReq
   1525           *
   1526           * @brief       This function processes a Management Leave Request
   1527           *              and generates the response.
   1528           *
   1529           * @param       inMsg - incoming message (request)
   1530           *
   1531           * @return      none
   1532           */
   1533          void ZDO_ProcessMgmtLeaveReq( zdoIncomingMsg_t *inMsg )
   1534          {
   1535            NLME_LeaveReq_t req;
   1536            ZStatus_t       status;
   1537            uint8 *msg = inMsg->asdu;
   1538          
   1539          
   1540            if ( ( AddrMgrExtAddrValid( msg ) == FALSE                 ) ||
   1541                 ( osal_ExtAddrEqual( msg, NLME_GetExtAddr() ) == TRUE )    )
   1542            {
   1543              // Remove this device
   1544              req.extAddr = NULL;
   1545            }
   1546            else
   1547            {
   1548              // Remove child device
   1549              req.extAddr = msg;
   1550            }
   1551          
   1552            req.removeChildren = FALSE;
   1553            req.rejoin         = FALSE;
   1554            req.silent         = FALSE;
   1555          
   1556            status = NLME_LeaveReq( &req );
   1557          
   1558            ZDP_MgmtLeaveRsp( inMsg->TransSeq, &(inMsg->srcAddr), status, FALSE );
   1559          }
   1560          #endif // ZDO_MGMT_LEAVE_RESPONSE
   1561          
   1562          #if defined( ZDO_MGMT_PERMIT_JOIN_RESPONSE ) && defined( RTR_NWK )
   1563          /*********************************************************************
   1564           * @fn          ZDO_ProcessMgmtPermitJoinReq
   1565           *
   1566           * @brief       This function processes a Management Permit Join Request
   1567           *              and generates the response.
   1568           *
   1569           * @param       inMsg - incoming message (request)
   1570           *
   1571           * @return      none
   1572           */
   1573          void ZDO_ProcessMgmtPermitJoinReq( zdoIncomingMsg_t *inMsg )
   1574          {
   1575            uint8 stat;
   1576            uint8 duration;
   1577            uint8 tcsig;
   1578          
   1579            duration = inMsg->asdu[ZDP_MGMT_PERMIT_JOIN_REQ_DURATION];
   1580            tcsig    = inMsg->asdu[ZDP_MGMT_PERMIT_JOIN_REQ_TC_SIG];
   1581          
   1582            // Set the network layer permit join duration
   1583            stat = (byte) NLME_PermitJoiningRequest( duration );
   1584          
   1585            // Handle the Trust Center Significance
   1586            if ( tcsig == TRUE )
   1587            {
   1588              ZDSecMgrPermitJoining( duration );
   1589            }
   1590          
   1591            // Send a response if unicast
   1592            if (inMsg->srcAddr.addr.shortAddr != NWK_BROADCAST_SHORTADDR)
   1593            {
   1594              ZDP_MgmtPermitJoinRsp( inMsg->TransSeq, &(inMsg->srcAddr), stat, false );
   1595            }
   1596          }
   1597          #endif // ZDO_MGMT_PERMIT_JOIN_RESPONSE && defined( RTR_NWK )
   1598          
   1599          /*
   1600           * This function stub allows the next higher layer to be notified of
   1601           * a permit joining timeout.
   1602           */
   1603          #if defined( RTR_NWK )
   1604          /*********************************************************************
   1605           * @fn          ZDO_ProcessMgmtPermitJoinTimeout
   1606           *
   1607           * @brief       This function stub allows the next higher layer to be
   1608           *              notified of a permit joining timeout. Currently, this
   1609           *              directly bypasses the APS layer.
   1610           *
   1611           * @param       none
   1612           *
   1613           * @return      none
   1614           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   1615          void ZDO_ProcessMgmtPermitJoinTimeout( void )
   \                     NLME_PermitJoiningTimeout:
   1616          {
   \   000000                ; Saved register size: 0
   \   000000                ; Auto size: 0
   1617            #if defined( ZDO_MGMT_PERMIT_JOIN_RESPONSE )
   1618            {
   1619              // Currently, only the ZDSecMgr needs to be notified
   1620              ZDSecMgrPermitJoiningTimeout();
   1621            }
   1622            #endif
   1623          }
   \   000000   02....       LJMP    ?BRET
   1624          #endif // defined( RTR_NWK )
   1625          
   1626          #if defined ( ZDO_USERDESC_RESPONSE )
   1627          /*********************************************************************
   1628           * @fn          ZDO_ProcessUserDescReq
   1629           *
   1630           * @brief       This function finishes the processing of the User
   1631           *              Descriptor Request and generates the response.
   1632           *
   1633           * @param       inMsg - incoming message (request)
   1634           *
   1635           * @return      none
   1636           */
   1637          void ZDO_ProcessUserDescReq( zdoIncomingMsg_t *inMsg )
   1638          {
   1639            uint16 aoi = BUILD_UINT16( inMsg->asdu[0], inMsg->asdu[1] );
   1640            UserDescriptorFormat_t userDesc;
   1641          
   1642            if ( (aoi == ZDAppNwkAddr.addr.shortAddr) && (ZSUCCESS == osal_nv_read(
   1643                       ZCD_NV_USERDESC, 0, sizeof(UserDescriptorFormat_t), &userDesc )) )
   1644            {
   1645              ZDP_UserDescRsp( inMsg->TransSeq, &(inMsg->srcAddr), aoi, &userDesc, false );
   1646            }
   1647            else
   1648            {
   1649              ZDP_GenericRsp(inMsg->TransSeq, &(inMsg->srcAddr),
   1650                     ZDP_NOT_SUPPORTED, aoi, User_Desc_rsp, inMsg->SecurityUse );
   1651            }
   1652          }
   1653          #endif // ZDO_USERDESC_RESPONSE
   1654          
   1655          #if defined ( ZDO_USERDESCSET_RESPONSE )
   1656          /*********************************************************************
   1657           * @fn          ZDO_ProcessUserDescSet
   1658           *
   1659           * @brief       This function finishes the processing of the User
   1660           *              Descriptor Set and generates the response.
   1661           *
   1662           * @param       inMsg - incoming message (request)
   1663           *
   1664           * @return      none
   1665           */
   1666          void ZDO_ProcessUserDescSet( zdoIncomingMsg_t *inMsg )
   1667          {
   1668            uint8 *msg;
   1669            uint16 aoi;
   1670            UserDescriptorFormat_t userDesc;
   1671            uint8 outMsg[3];
   1672            uint8 status;
   1673          
   1674            msg = inMsg->asdu;
   1675            aoi = BUILD_UINT16( msg[0], msg[1] );
   1676          
   1677            if ( aoi == ZDAppNwkAddr.addr.shortAddr )
   1678            {
   1679              userDesc.len = (msg[2] < AF_MAX_USER_DESCRIPTOR_LEN) ? msg[2] : AF_MAX_USER_DESCRIPTOR_LEN;
   1680              msg ++;  // increment one for the length field
   1681          
   1682              osal_memcpy( userDesc.desc, &msg[2], userDesc.len );
   1683              osal_nv_write( ZCD_NV_USERDESC, 0, sizeof(UserDescriptorFormat_t), &userDesc );
   1684              if ( userDesc.len != 0 )
   1685              {
   1686                ZDO_Config_Node_Descriptor.UserDescAvail = TRUE;
   1687              }
   1688              else
   1689              {
   1690                ZDO_Config_Node_Descriptor.UserDescAvail = FALSE;
   1691              }
   1692          
   1693              status = ZDP_SUCCESS;
   1694            }
   1695            else
   1696            {
   1697              status =  ZDP_NOT_SUPPORTED;
   1698            }
   1699          
   1700            outMsg[0] = status;
   1701            outMsg[1] = LO_UINT16( aoi );
   1702            outMsg[2] = LO_UINT16( aoi );
   1703          
   1704            ZDP_SendData( &(inMsg->TransSeq), &(inMsg->srcAddr), User_Desc_conf, 3, outMsg,
   1705                         inMsg->SecurityUse );
   1706          }
   1707          #endif // ZDO_USERDESCSET_RESPONSE
   1708          
   1709          #if defined ( ZDO_ENDDEVICE_ANNCE ) && defined(RTR_NWK)
   1710          /*********************************************************************
   1711           * @fn          ZDO_ProcessEndDeviceAnnce
   1712           *
   1713           * @brief       This function processes an end device annouce message.
   1714           *
   1715           * @param       inMsg - incoming message
   1716           *
   1717           * @return      none
   1718           */
   1719          void ZDO_ProcessEndDeviceAnnce( zdoIncomingMsg_t *inMsg )
   1720          {
   1721            ZDO_DeviceAnnce_t Annce;
   1722            associated_devices_t *dev;
   1723            AddrMgrEntry_t addrEntry;
   1724          
   1725            // Parse incoming message
   1726            ZDO_ParseDeviceAnnce( inMsg, &Annce );
   1727          
   1728            addrEntry.user = ADDRMGR_USER_DEFAULT;
   1729            addrEntry.nwkAddr = Annce.nwkAddr;
   1730            AddrMgrExtAddrSet( addrEntry.extAddr, Annce.extAddr );
   1731            AddrMgrEntryUpdate( &addrEntry );
   1732          
   1733            // find device in device list
   1734            dev = AssocGetWithExt( Annce.extAddr );
   1735            if ( dev != NULL )
   1736            {
   1737              // if found and address is different
   1738              if ( dev->shortAddr != Annce.nwkAddr )
   1739              {
   1740                // update device list if device is (was) not our child
   1741                if ( dev->nodeRelation == NEIGHBOR || dev->nodeRelation == OTHER )
   1742                {
   1743                  dev->shortAddr = Annce.nwkAddr;
   1744                }
   1745              }
   1746            }
   1747          }
   1748          #endif // ZDO_ENDDEVICE_ANNCE
   1749          
   1750          /*********************************************************************
   1751           * @fn          ZDO_BuildSimpleDescBuf
   1752           *
   1753           * @brief       Build a byte sequence representation of a Simple Descriptor.
   1754           *
   1755           * @param       buf  - pointer to a byte array big enough for data.
   1756           * @param       desc - SimpleDescriptionFormat_t *
   1757           *
   1758           * @return      none
   1759           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   1760          void ZDO_BuildSimpleDescBuf( byte *buf, SimpleDescriptionFormat_t *desc )
   \                     ZDO_BuildSimpleDescBuf:
   1761          {
   \   000000   74F7         MOV     A,#-0x9
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 9
   \   000005                ; Auto size: 0
   1762            byte cnt;
   1763            uint16 *ptr;
   1764          
   1765            *buf++ = desc->EndPoint;
   \   000005   8C82         MOV     DPL,R4
   \   000007   8D83         MOV     DPH,R5
   \   000009   12....       LCALL   ?Subroutine20 & 0xFFFF
   1766            *buf++ = HI_UINT16( desc->AppProfId );
   \                     ??CrossCallReturnLabel_285:
   \   00000C   A882         MOV     R0,DPL
   \   00000E   A983         MOV     R1,DPH
   \   000010   12....       LCALL   ?Subroutine9 & 0xFFFF
   1767            *buf++ = LO_UINT16( desc->AppProfId );
   1768            *buf++ = HI_UINT16( desc->AppDeviceId );
   \                     ??CrossCallReturnLabel_17:
   \   000013   EC           MOV     A,R4
   \   000014   2403         ADD     A,#0x3
   \   000016   F8           MOV     R0,A
   \   000017   ED           MOV     A,R5
   \   000018   3400         ADDC    A,#0x0
   \   00001A   F9           MOV     R1,A
   \   00001B   8882         MOV     DPL,R0
   \   00001D   8983         MOV     DPH,R1
   \   00001F   12....       LCALL   ?Subroutine9 & 0xFFFF
   1769            *buf++ = LO_UINT16( desc->AppDeviceId );
   1770          
   1771            *buf++ = (byte)(desc->AppDevVer << 4);
   \                     ??CrossCallReturnLabel_18:
   \   000022   8C82         MOV     DPL,R4
   \   000024   8D83         MOV     DPH,R5
   \   000026   A3           INC     DPTR
   \   000027   A3           INC     DPTR
   \   000028   A3           INC     DPTR
   \   000029   A3           INC     DPTR
   \   00002A   A3           INC     DPTR
   \   00002B   E0           MOVX    A,@DPTR
   \   00002C   C4           SWAP    A
   \   00002D   54F0         ANL     A,#0xf0
   \   00002F   12....       LCALL   ?Subroutine14 & 0xFFFF
   1772          
   1773            *buf++ = desc->AppNumInClusters;
   \                     ??CrossCallReturnLabel_254:
   \   000032   E0           MOVX    A,@DPTR
   \   000033   12....       LCALL   ?Subroutine14 & 0xFFFF
   1774            ptr = desc->pAppInClusterList;
   \                     ??CrossCallReturnLabel_255:
   \   000036   12....       LCALL   ?Subroutine63 & 0xFFFF
   1775            for ( cnt = 0; cnt < desc->AppNumInClusters; ptr++, cnt++ )
   \                     ??CrossCallReturnLabel_125:
   \   000039   8003         SJMP    ??CrossCallReturnLabel_4
   1776            {
   1777              *buf++ = HI_UINT16( *ptr );
   \                     ??ZDO_BuildSimpleDescBuf_0:
   \   00003B   12....       LCALL   ?Subroutine2 & 0xFFFF
   1778              *buf++ = LO_UINT16( *ptr );
   1779            }
   \                     ??CrossCallReturnLabel_4:
   \   00003E   8C82         MOV     DPL,R4
   \   000040   8D83         MOV     DPH,R5
   \   000042   A3           INC     DPTR
   \   000043   A3           INC     DPTR
   \   000044   A3           INC     DPTR
   \   000045   A3           INC     DPTR
   \   000046   A3           INC     DPTR
   \   000047   A3           INC     DPTR
   \   000048   E0           MOVX    A,@DPTR
   \   000049   FE           MOV     R6,A
   \   00004A   E5..         MOV     A,?V0 + 0
   \   00004C   C3           CLR     C
   \   00004D   9E           SUBB    A,R6
   \   00004E   40EB         JC      ??ZDO_BuildSimpleDescBuf_0
   1780          
   1781            *buf++ = desc->AppNumOutClusters;
   \   000050   8C82         MOV     DPL,R4
   \   000052   8D83         MOV     DPH,R5
   \   000054   A3           INC     DPTR
   \   000055   A3           INC     DPTR
   \   000056   A3           INC     DPTR
   \   000057   A3           INC     DPTR
   \   000058   A3           INC     DPTR
   \   000059   A3           INC     DPTR
   \   00005A   A3           INC     DPTR
   \   00005B   A3           INC     DPTR
   \   00005C   A3           INC     DPTR
   \   00005D   12....       LCALL   ?Subroutine20 & 0xFFFF
   1782            ptr = desc->pAppOutClusterList;
   \                     ??CrossCallReturnLabel_286:
   \   000060   A3           INC     DPTR
   \   000061   A3           INC     DPTR
   \   000062   A3           INC     DPTR
   \   000063   A3           INC     DPTR
   \   000064   A3           INC     DPTR
   \   000065   A3           INC     DPTR
   \   000066   A3           INC     DPTR
   \   000067   A3           INC     DPTR
   \   000068   12....       LCALL   ?Subroutine63 & 0xFFFF
   1783            for ( cnt = 0; cnt < desc->AppNumOutClusters; ptr++, cnt++ )
   \                     ??CrossCallReturnLabel_126:
   \   00006B   8003         SJMP    ??CrossCallReturnLabel_5
   1784            {
   1785              *buf++ = HI_UINT16( *ptr );
   \                     ??ZDO_BuildSimpleDescBuf_1:
   \   00006D   12....       LCALL   ?Subroutine2 & 0xFFFF
   1786              *buf++ = LO_UINT16( *ptr );
   1787            }
   \                     ??CrossCallReturnLabel_5:
   \   000070   8C82         MOV     DPL,R4
   \   000072   8D83         MOV     DPH,R5
   \   000074   A3           INC     DPTR
   \   000075   A3           INC     DPTR
   \   000076   A3           INC     DPTR
   \   000077   A3           INC     DPTR
   \   000078   A3           INC     DPTR
   \   000079   A3           INC     DPTR
   \   00007A   A3           INC     DPTR
   \   00007B   A3           INC     DPTR
   \   00007C   A3           INC     DPTR
   \   00007D   E0           MOVX    A,@DPTR
   \   00007E   FE           MOV     R6,A
   \   00007F   E5..         MOV     A,?V0 + 0
   \   000081   C3           CLR     C
   \   000082   9E           SUBB    A,R6
   \   000083   40E8         JC      ??ZDO_BuildSimpleDescBuf_1
   1788          }
   \   000085   02....       LJMP    ?Subroutine135 & 0xFFFF

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine63:
   \   000000   A3           INC     DPTR
   \   000001   12....       LCALL   ?Subroutine103 & 0xFFFF
   \                     ??CrossCallReturnLabel_218:
   \   000004   75..00       MOV     ?V0 + 0,#0x0
   \   000007   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine20:
   \   000000   12....       LCALL   ?Subroutine100 & 0xFFFF
   \                     ??CrossCallReturnLabel_212:
   \   000003                REQUIRE ?Subroutine125
   \   000003                ; // Fall through to label ?Subroutine125

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine125:
   \   000000   8C82         MOV     DPL,R4
   \   000002   8D83         MOV     DPH,R5
   \   000004   A3           INC     DPTR
   \   000005   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine14:
   \   000000   12....       LCALL   ??Subroutine90_1 & 0xFFFF
   \                     ??CrossCallReturnLabel_188:
   \   000003   8C82         MOV     DPL,R4
   \   000005   8D83         MOV     DPH,R5
   \   000007   80..         SJMP    ??Subroutine120_0

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine9:
   \   000000   A3           INC     DPTR
   \   000001   12....       LCALL   ??Subroutine90_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_186:
   \   000004   12....       LCALL   ?Subroutine90 & 0xFFFF
   \                     ??CrossCallReturnLabel_187:
   \   000007   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine90:
   \   000000   8882         MOV     DPL,R0
   \   000002   8983         MOV     DPH,R1
   \                     ??Subroutine90_0:
   \   000004   E0           MOVX    A,@DPTR
   \                     ??Subroutine90_1:
   \   000005   8A82         MOV     DPL,R2
   \   000007   8B83         MOV     DPH,R3
   \   000009   F0           MOVX    @DPTR,A
   \   00000A   A3           INC     DPTR
   \   00000B   0A           INC     R2
   \   00000C   AB83         MOV     R3,DPH
   \   00000E   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine2:
   \   000000   8882         MOV     DPL,R0
   \   000002   8983         MOV     DPH,R1
   \   000004   A3           INC     DPTR
   \   000005   12....       LCALL   ?Subroutine100 & 0xFFFF
   \                     ??CrossCallReturnLabel_211:
   \   000008   12....       LCALL   ?Subroutine90 & 0xFFFF
   \                     ??CrossCallReturnLabel_185:
   \   00000B   12....       LCALL   ?Subroutine111 & 0xFFFF
   \                     ??CrossCallReturnLabel_244:
   \   00000E   05..         INC     ?V0 + 0
   \   000010   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine100:
   \   000000   E0           MOVX    A,@DPTR
   \   000001   8A82         MOV     DPL,R2
   \   000003   8B83         MOV     DPH,R3
   \   000005   F0           MOVX    @DPTR,A
   \   000006   A3           INC     DPTR
   \   000007   AA82         MOV     R2,DPL
   \   000009   AB83         MOV     R3,DPH
   \   00000B   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine111:
   \   000000   E8           MOV     A,R0
   \   000001   2402         ADD     A,#0x2
   \   000003   08           INC     R0
   \   000004   08           INC     R0
   \   000005   E9           MOV     A,R1
   \   000006   3400         ADDC    A,#0x0
   \   000008   F9           MOV     R1,A
   \   000009   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine135:
   \   000000   7F01         MOV     R7,#0x1
   \   000002   02....       LJMP    ?BANKED_LEAVE_XDATA
   1789          
   1790          #if defined ( ZDO_COORDINATOR )
   1791          /*********************************************************************
   1792           * @fn      ZDO_MatchEndDeviceBind()
   1793           *
   1794           * @brief
   1795           *
   1796           *   Called to match end device binding requests
   1797           *
   1798           * @param  bindReq  - binding request information
   1799           * @param  SecurityUse - Security enable/disable
   1800           *
   1801           * @return  none
   1802           */
   1803          void ZDO_MatchEndDeviceBind( ZDEndDeviceBind_t *bindReq )
   1804          {
   1805            zAddrType_t dstAddr;
   1806            uint8 sendRsp = FALSE;
   1807            uint8 status;
   1808          
   1809            // Is this the first request?
   1810            if ( matchED == NULL )
   1811            {
   1812              // Create match info structure
   1813              matchED = (ZDMatchEndDeviceBind_t *)osal_mem_alloc( sizeof ( ZDMatchEndDeviceBind_t ) );
   1814              if ( matchED )
   1815              {
   1816                // Clear the structure
   1817                osal_memset( (uint8 *)matchED, 0, sizeof ( ZDMatchEndDeviceBind_t ) );
   1818          
   1819                // Copy the first request's information
   1820                if ( !ZDO_CopyMatchInfo( &(matchED->ed1), bindReq ) )
   1821                {
   1822          
   1823                  status = ZDP_NO_ENTRY;
   1824                  sendRsp = TRUE;
   1825                }
   1826              }
   1827              else
   1828              {
   1829                status = ZDP_NO_ENTRY;
   1830                sendRsp = TRUE;
   1831              }
   1832          
   1833              if ( !sendRsp )
   1834              {
   1835                // Set into the correct state
   1836                matchED->state = ZDMATCH_WAIT_REQ;
   1837          
   1838                // Setup the timeout
   1839                APS_SetEndDeviceBindTimeout( AIB_MaxBindingTime, ZDO_EndDeviceBindMatchTimeoutCB );
   1840              }
   1841            }
   1842            else
   1843            {
   1844                matchED->state = ZDMATCH_SENDING_BINDS;
   1845          
   1846                // Copy the 2nd request's information
   1847                if ( !ZDO_CopyMatchInfo( &(matchED->ed2), bindReq ) )
   1848                {
   1849                  status = ZDP_NO_ENTRY;
   1850                  sendRsp = TRUE;
   1851                }
   1852          
   1853                // Make a source match for ed1
   1854                matchED->ed1numMatched = ZDO_CompareClusterLists(
   1855                            matchED->ed1.numOutClusters, matchED->ed1.outClusters,
   1856                            matchED->ed2.numInClusters, matchED->ed2.inClusters, ZDOBuildBuf );
   1857                if ( matchED->ed1numMatched )
   1858                {
   1859                  // Save the match list
   1860                  matchED->ed1Matched = osal_mem_alloc( (short)(matchED->ed1numMatched * sizeof ( uint16 )) );
   1861                  if ( matchED->ed1Matched )
   1862                  {
   1863                    osal_memcpy( matchED->ed1Matched, ZDOBuildBuf, (matchED->ed1numMatched * sizeof ( uint16 )) );
   1864                  }
   1865                  else
   1866                  {
   1867                    // Allocation error, stop
   1868                    status = ZDP_NO_ENTRY;
   1869                    sendRsp = TRUE;
   1870                  }
   1871                }
   1872          
   1873                // Make a source match for ed2
   1874                matchED->ed2numMatched = ZDO_CompareClusterLists(
   1875                            matchED->ed2.numOutClusters, matchED->ed2.outClusters,
   1876                            matchED->ed1.numInClusters, matchED->ed1.inClusters, ZDOBuildBuf );
   1877                if ( matchED->ed2numMatched )
   1878                {
   1879                  // Save the match list
   1880                  matchED->ed2Matched = osal_mem_alloc( (short)(matchED->ed2numMatched * sizeof ( uint16 )) );
   1881                  if ( matchED->ed2Matched )
   1882                  {
   1883                    osal_memcpy( matchED->ed2Matched, ZDOBuildBuf, (matchED->ed2numMatched * sizeof ( uint16 )) );
   1884                  }
   1885                  else
   1886                  {
   1887                    // Allocation error, stop
   1888                    status = ZDP_NO_ENTRY;
   1889                    sendRsp = TRUE;
   1890                  }
   1891                }
   1892          
   1893                if ( (sendRsp == FALSE) && (matchED->ed1numMatched || matchED->ed2numMatched) )
   1894                {
   1895                  // Do the first unbind/bind state
   1896                  ZDMatchSendState( ZDMATCH_REASON_START, ZDP_SUCCESS, 0 );
   1897                }
   1898                else
   1899                {
   1900                  status = ZDP_NO_MATCH;
   1901                  sendRsp = TRUE;
   1902                }
   1903            }
   1904          
   1905            if ( sendRsp )
   1906            {
   1907              // send response to this requester
   1908              dstAddr.addrMode = Addr16Bit;
   1909              dstAddr.addr.shortAddr = bindReq->srcAddr;
   1910              ZDP_EndDeviceBindRsp( bindReq->TransSeq, &dstAddr, status, bindReq->SecurityUse );
   1911          
   1912              if ( matchED->state == ZDMATCH_SENDING_BINDS )
   1913              {
   1914                // send response to first requester
   1915                dstAddr.addrMode = Addr16Bit;
   1916                dstAddr.addr.shortAddr = matchED->ed1.srcAddr;
   1917                ZDP_EndDeviceBindRsp( matchED->ed1.TransSeq, &dstAddr, status, matchED->ed1.SecurityUse );
   1918              }
   1919          
   1920              // Process ended - release memory used
   1921              ZDO_RemoveMatchMemory();
   1922            }
   1923          }
   1924          
   1925          static void ZDO_RemoveMatchMemory( void )
   1926          {
   1927            if ( matchED )
   1928            {
   1929              if ( matchED->ed2Matched )
   1930                osal_mem_free( matchED->ed2Matched );
   1931              if ( matchED->ed1Matched )
   1932                osal_mem_free( matchED->ed1Matched );
   1933          
   1934              if ( matchED->ed1.inClusters )
   1935                osal_mem_free( matchED->ed1.inClusters );
   1936          
   1937              if ( matchED->ed1.outClusters )
   1938                osal_mem_free( matchED->ed1.outClusters );
   1939          
   1940              if ( matchED->ed2.inClusters )
   1941                osal_mem_free( matchED->ed2.inClusters );
   1942          
   1943              if ( matchED->ed2.outClusters )
   1944                osal_mem_free( matchED->ed2.outClusters );
   1945          
   1946              osal_mem_free( matchED );
   1947          
   1948              matchED = (ZDMatchEndDeviceBind_t *)NULL;
   1949            }
   1950          }
   1951          
   1952          static uint8 ZDO_CopyMatchInfo( ZDEndDeviceBind_t *destReq, ZDEndDeviceBind_t *srcReq )
   1953          {
   1954            uint8 allOK = TRUE;
   1955          
   1956            // Copy bind information into the match info structure
   1957            osal_memcpy( (uint8 *)destReq, srcReq, sizeof ( ZDEndDeviceBind_t ) );
   1958          
   1959            // Copy input cluster IDs
   1960            if ( srcReq->numInClusters )
   1961            {
   1962              destReq->inClusters = osal_mem_alloc( (short)(srcReq->numInClusters * sizeof ( uint16 )) );
   1963              if ( destReq->inClusters )
   1964              {
   1965                // Copy the clusters
   1966                osal_memcpy( (uint8*)(destReq->inClusters), (uint8 *)(srcReq->inClusters),
   1967                                (srcReq->numInClusters * sizeof ( uint16 )) );
   1968              }
   1969              else
   1970                allOK = FALSE;
   1971            }
   1972          
   1973            // Copy output cluster IDs
   1974            if ( srcReq->numOutClusters )
   1975            {
   1976              destReq->outClusters = osal_mem_alloc( (short)(srcReq->numOutClusters * sizeof ( uint16 )) );
   1977              if ( destReq->outClusters )
   1978              {
   1979                // Copy the clusters
   1980                osal_memcpy( (uint8 *)(destReq->outClusters), (uint8 *)(srcReq->outClusters),
   1981                                (srcReq->numOutClusters * sizeof ( uint16 )) );
   1982              }
   1983              else
   1984                allOK = FALSE;
   1985            }
   1986          
   1987            if ( !allOK )
   1988            {
   1989              if ( destReq->inClusters )
   1990                osal_mem_free( destReq->inClusters );
   1991              if ( destReq->outClusters )
   1992                osal_mem_free( destReq->outClusters );
   1993            }
   1994          
   1995            return ( allOK );
   1996          }
   1997          
   1998          uint8 ZDMatchSendState( uint8 reason, uint8 status, uint8 TransSeq )
   1999          {
   2000            uint8 *dstIEEEAddr;
   2001            uint8 dstEP;
   2002            zAddrType_t dstAddr;
   2003            zAddrType_t destinationAddr;
   2004            uint16 msgType;
   2005            uint16 clusterID;
   2006            ZDEndDeviceBind_t *ed = NULL;
   2007            uint8 rspStatus = ZDP_SUCCESS;
   2008          
   2009            if ( matchED == NULL )
   2010              return ( FALSE );
   2011          
   2012            // Check sequence number
   2013            if ( reason == ZDMATCH_REASON_BIND_RSP || reason == ZDMATCH_REASON_UNBIND_RSP )
   2014            {
   2015              if ( TransSeq != matchED->transSeq )
   2016                return( FALSE ); // ignore the message
   2017            }
   2018          
   2019            // turn off timer
   2020            APS_SetEndDeviceBindTimeout( 0, ZDO_EndDeviceBindMatchTimeoutCB );
   2021          
   2022            if ( reason == ZDMATCH_REASON_TIMEOUT )
   2023            {
   2024              rspStatus = ZDP_TIMEOUT;    // The process will stop
   2025            }
   2026          
   2027            if ( reason == ZDMATCH_REASON_START || reason == ZDMATCH_REASON_BIND_RSP )
   2028            {
   2029              matchED->sending = ZDMATCH_SENDING_UNBIND;
   2030          
   2031              if ( reason == ZDMATCH_REASON_BIND_RSP && status != ZDP_SUCCESS )
   2032              {
   2033                rspStatus = status;
   2034              }
   2035            }
   2036            else if ( reason == ZDMATCH_REASON_UNBIND_RSP )
   2037            {
   2038              if ( status == ZDP_SUCCESS )
   2039              {
   2040                matchED->sending = ZDMATCH_SENDING_UNBIND;
   2041              }
   2042              else
   2043              {
   2044                matchED->sending = ZDMATCH_SENDING_BIND;
   2045              }
   2046            }
   2047          
   2048            if ( reason != ZDMATCH_REASON_START && matchED->sending == ZDMATCH_SENDING_UNBIND )
   2049            {
   2050              // Move to the next cluster ID
   2051              if ( matchED->ed1numMatched )
   2052                matchED->ed1numMatched--;
   2053              else if ( matchED->ed2numMatched )
   2054                matchED->ed2numMatched--;
   2055            }
   2056          
   2057            // What message do we send now
   2058            if ( matchED->ed1numMatched )
   2059            {
   2060              ed = &(matchED->ed1);
   2061              clusterID = matchED->ed1Matched[matchED->ed1numMatched-1];
   2062              dstIEEEAddr = matchED->ed2.ieeeAddr;
   2063              dstEP = matchED->ed2.endpoint;
   2064            }
   2065            else if ( matchED->ed2numMatched )
   2066            {
   2067              ed = &(matchED->ed2);
   2068              clusterID = matchED->ed2Matched[matchED->ed2numMatched-1];
   2069              dstIEEEAddr = matchED->ed1.ieeeAddr;
   2070              dstEP = matchED->ed1.endpoint;
   2071            }
   2072          
   2073            dstAddr.addrMode = Addr16Bit;
   2074          
   2075            // Send the next message
   2076            if ( rspStatus == ZDP_SUCCESS && ed )
   2077            {
   2078              // Send unbind/bind message to source
   2079              if ( matchED->sending == ZDMATCH_SENDING_UNBIND )
   2080                msgType = Unbind_req;
   2081              else
   2082                msgType = Bind_req;
   2083          
   2084              dstAddr.addr.shortAddr = ed->srcAddr;
   2085          
   2086              // Save off the transaction sequence number
   2087              matchED->transSeq = ZDP_TransID;
   2088          
   2089              destinationAddr.addrMode = Addr64Bit;
   2090              osal_cpyExtAddr( destinationAddr.addr.extAddr, dstIEEEAddr );
   2091          
   2092              ZDP_BindUnbindReq( msgType, &dstAddr, ed->ieeeAddr, ed->endpoint, clusterID,
   2093                  &destinationAddr, dstEP, ed->SecurityUse );
   2094          
   2095              // Set timeout for response
   2096              APS_SetEndDeviceBindTimeout( AIB_MaxBindingTime, ZDO_EndDeviceBindMatchTimeoutCB );
   2097            }
   2098            else
   2099            {
   2100              // Send the response messages to requesting devices
   2101              // send response to first requester
   2102              dstAddr.addr.shortAddr = matchED->ed1.srcAddr;
   2103              ZDP_EndDeviceBindRsp( matchED->ed1.TransSeq, &dstAddr, rspStatus, matchED->ed1.SecurityUse );
   2104          
   2105              // send response to second requester
   2106              if ( matchED->state == ZDMATCH_SENDING_BINDS )
   2107              {
   2108                dstAddr.addr.shortAddr = matchED->ed2.srcAddr;
   2109                ZDP_EndDeviceBindRsp( matchED->ed2.TransSeq, &dstAddr, rspStatus, matchED->ed2.SecurityUse );
   2110              }
   2111          
   2112              // Process ended - release memory used
   2113              ZDO_RemoveMatchMemory();
   2114            }
   2115          
   2116            return ( TRUE );
   2117          }
   2118          
   2119          static void ZDO_EndDeviceBindMatchTimeoutCB( void )
   2120          {
   2121            ZDMatchSendState( ZDMATCH_REASON_TIMEOUT, ZDP_TIMEOUT, 0 );
   2122          }
   2123          
   2124          #endif // ZDO_COORDINATOR
   2125          
   2126          /*********************************************************************
   2127           * ZDO MESSAGE PARSING API FUNCTIONS
   2128           */
   2129          
   2130          /*********************************************************************
   2131           * @fn          ZDO_ParseEndDeviceBindReq
   2132           *
   2133           * @brief       This function parses the End_Device_Bind_req message.
   2134           *
   2135           *     NOTE:  The clusters lists in bindReq are allocated in this
   2136           *            function and must be freed by that calling function.
   2137           *
   2138           * @param       inMsg  - incoming message (request)
   2139           * @param       bindReq - pointer to place to parse message to
   2140           *
   2141           * @return      none
   2142           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   2143          void ZDO_ParseEndDeviceBindReq( zdoIncomingMsg_t *inMsg, ZDEndDeviceBind_t *bindReq )
   \                     ZDO_ParseEndDeviceBindReq:
   2144          {
   \   000000   74F2         MOV     A,#-0xe
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 14
   \   000005                ; Auto size: 0
   \   000005   8C..         MOV     ?V0 + 0,R4
   \   000007   8D..         MOV     ?V0 + 1,R5
   2145            uint8 *msg;
   2146          
   2147            // Parse the message
   2148            bindReq->TransSeq = inMsg->TransSeq;
   \   000009   EA           MOV     A,R2
   \   00000A   240F         ADD     A,#0xf
   \   00000C   12....       LCALL   ?Subroutine54 & 0xFFFF
   \                     ??CrossCallReturnLabel_329:
   \   00000F   12....       LCALL   ?Subroutine25 & 0xFFFF
   2149            bindReq->srcAddr = inMsg->srcAddr.addr.shortAddr;
   \                     ??CrossCallReturnLabel_44:
   \   000012   12....       LCALL   ?Subroutine103 & 0xFFFF
   \                     ??CrossCallReturnLabel_217:
   \   000015   8C82         MOV     DPL,R4
   \   000017   8D83         MOV     DPH,R5
   \   000019   A3           INC     DPTR
   \   00001A   A3           INC     DPTR
   \   00001B   12....       LCALL   ??Subroutine10_1 & 0xFFFF
   2150            bindReq->SecurityUse = inMsg->SecurityUse;
   \                     ??CrossCallReturnLabel_309:
   \   00001E   EA           MOV     A,R2
   \   00001F   240E         ADD     A,#0xe
   \   000021   12....       LCALL   ?Subroutine54 & 0xFFFF
   \                     ??CrossCallReturnLabel_330:
   \   000024   A3           INC     DPTR
   \   000025   F0           MOVX    @DPTR,A
   2151            msg = inMsg->asdu;
   \   000026   12....       LCALL   ?Subroutine39 & 0xFFFF
   2152          
   2153            bindReq->localCoordinator = BUILD_UINT16( msg[0], msg[1] );
   \                     ??CrossCallReturnLabel_327:
   \   000029   A3           INC     DPTR
   \   00002A   A3           INC     DPTR
   \   00002B   A3           INC     DPTR
   \   00002C   A3           INC     DPTR
   \   00002D   12....       LCALL   ?Subroutine6 & 0xFFFF
   2154            msg += 2;
   2155          
   2156            osal_cpyExtAddr( &(bindReq->ieeeAddr), msg );
   \                     ??CrossCallReturnLabel_10:
   \   000030   2406         ADD     A,#0x6
   \   000032   12....       LCALL   ?Subroutine67 & 0xFFFF
   2157            msg += Z_EXTADDR_LEN;
   2158          
   2159            bindReq->endpoint = *msg++;
   \                     ??CrossCallReturnLabel_131:
   \   000035   C0E0         PUSH    A
   \   000037   12....       LCALL   ?Subroutine76 & 0xFFFF
   \                     ??CrossCallReturnLabel_152:
   \   00003A   D0E0         POP     A
   \   00003C   12....       LCALL   ?Subroutine13 & 0xFFFF
   2160            bindReq->profileID = BUILD_UINT16( msg[0], msg[1] );
   \                     ??CrossCallReturnLabel_24:
   \   00003F   F8           MOV     R0,A
   \   000040   E5..         MOV     A,?V0 + 0
   \   000042   240F         ADD     A,#0xf
   \   000044   12....       LCALL   ??Subroutine76_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_153:
   \   000047   E8           MOV     A,R0
   \   000048   12....       LCALL   ?Subroutine7 & 0xFFFF
   2161            msg += 2;
   2162          
   2163            bindReq->numInClusters = *msg++;
   \                     ??CrossCallReturnLabel_12:
   \   00004B   E5..         MOV     A,?V0 + 0
   \   00004D   2411         ADD     A,#0x11
   \   00004F   12....       LCALL   ?Subroutine71 & 0xFFFF
   \                     ??CrossCallReturnLabel_143:
   \   000052   12....       LCALL   ?Subroutine21 & 0xFFFF
   2164            bindReq->inClusters = NULL;
   \                     ??CrossCallReturnLabel_34:
   \   000055   2412         ADD     A,#0x12
   \   000057   12....       LCALL   ?Subroutine73 & 0xFFFF
   2165            if ( bindReq->numInClusters )
   \                     ??CrossCallReturnLabel_148:
   \   00005A   600F         JZ      ??ZDO_ParseEndDeviceBindReq_0
   2166            {
   2167              bindReq->inClusters = (uint16*)osal_mem_alloc( (bindReq->numInClusters * sizeof( uint16 )) );
   \   00005C   E5..         MOV     A,?V0 + 0
   \   00005E   2412         ADD     A,#0x12
   \   000060   12....       LCALL   ?Subroutine1 & 0xFFFF
   2168              msg = ZDO_ConvertOTAClusters( bindReq->numInClusters, msg, bindReq->inClusters );
   \                     ??CrossCallReturnLabel_2:
   \   000063   8A..         MOV     ?V0 + 2,R2
   \   000065   8B..         MOV     ?V0 + 3,R3
   \   000067   AE..         MOV     R6,?V0 + 2
   \   000069   AF..         MOV     R7,?V0 + 3
   2169            }
   2170          
   2171            bindReq->numOutClusters = *msg++;
   \                     ??ZDO_ParseEndDeviceBindReq_0:
   \   00006B   8E82         MOV     DPL,R6
   \   00006D   8F83         MOV     DPH,R7
   \   00006F   E0           MOVX    A,@DPTR
   \   000070   FA           MOV     R2,A
   \   000071   E5..         MOV     A,?V0 + 0
   \   000073   2414         ADD     A,#0x14
   \   000075   12....       LCALL   ?Subroutine71 & 0xFFFF
   \                     ??CrossCallReturnLabel_144:
   \   000078   12....       LCALL   ?Subroutine23 & 0xFFFF
   2172            bindReq->outClusters = NULL;
   \                     ??CrossCallReturnLabel_38:
   \   00007B   E5..         MOV     A,?V0 + 0
   \   00007D   2415         ADD     A,#0x15
   \   00007F   12....       LCALL   ?Subroutine73 & 0xFFFF
   2173            if ( bindReq->numOutClusters )
   \                     ??CrossCallReturnLabel_149:
   \   000082   6007         JZ      ??CrossCallReturnLabel_3
   2174            {
   2175              bindReq->outClusters = (uint16*)osal_mem_alloc( (bindReq->numOutClusters * sizeof( uint16 )) );
   \   000084   E5..         MOV     A,?V0 + 0
   \   000086   2415         ADD     A,#0x15
   \   000088   12....       LCALL   ?Subroutine1 & 0xFFFF
   2176              msg = ZDO_ConvertOTAClusters( bindReq->numOutClusters, msg, bindReq->outClusters );
   2177            }
   2178          }
   \                     ??CrossCallReturnLabel_3:
   \   00008B   02....       LJMP    ?Subroutine133 & 0xFFFF

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine73:
   \   000000   12....       LCALL   ?Subroutine110 & 0xFFFF
   \                     ??CrossCallReturnLabel_241:
   \   000003   E4           CLR     A
   \   000004   F0           MOVX    @DPTR,A
   \   000005   A3           INC     DPTR
   \   000006   F0           MOVX    @DPTR,A
   \   000007   EA           MOV     A,R2
   \   000008   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine71:
   \   000000   F5..         MOV     ?V0 + 2,A
   \   000002   E5..         MOV     A,?V0 + 1
   \   000004   3400         ADDC    A,#0x0
   \   000006   F5..         MOV     ?V0 + 3,A
   \   000008   EA           MOV     A,R2
   \   000009   85..82       MOV     DPL,?V0 + 2
   \   00000C   85..83       MOV     DPH,?V0 + 3
   \   00000F   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine1:
   \   000000   F5..         MOV     ?V0 + 4,A
   \   000002   E5..         MOV     A,?V0 + 1
   \   000004   3400         ADDC    A,#0x0
   \   000006   F5..         MOV     ?V0 + 5,A
   \   000008                ; Setup parameters for call to function osal_mem_alloc
   \   000008                ; Setup parameters for call to function osal_mem_alloc
   \   000008   85..82       MOV     DPL,?V0 + 2
   \   00000B   85..83       MOV     DPH,?V0 + 3
   \   00000E   E0           MOVX    A,@DPTR
   \   00000F   C3           CLR     C
   \   000010   33           RLC     A
   \   000011   FA           MOV     R2,A
   \   000012   E4           CLR     A
   \   000013   33           RLC     A
   \   000014   FB           MOV     R3,A
   \   000015   12....       LCALL   ??osal_mem_alloc?relay
   \   000018   85..82       MOV     DPL,?V0 + 4
   \   00001B   85..83       MOV     DPH,?V0 + 5
   \   00001E   EA           MOV     A,R2
   \   00001F   F0           MOVX    @DPTR,A
   \   000020   A3           INC     DPTR
   \   000021   EB           MOV     A,R3
   \   000022   F0           MOVX    @DPTR,A
   \   000023                ; Setup parameters for call to function ZDO_ConvertOTAClusters
   \   000023                ; Setup parameters for call to function ZDO_ConvertOTAClusters
   \   000023   85..82       MOV     DPL,?V0 + 4
   \   000026   85..83       MOV     DPH,?V0 + 5
   \   000029   E0           MOVX    A,@DPTR
   \   00002A   FC           MOV     R4,A
   \   00002B   A3           INC     DPTR
   \   00002C   E0           MOVX    A,@DPTR
   \   00002D   FD           MOV     R5,A
   \   00002E   EE           MOV     A,R6
   \   00002F   FA           MOV     R2,A
   \   000030   EF           MOV     A,R7
   \   000031   FB           MOV     R3,A
   \   000032   85..82       MOV     DPL,?V0 + 2
   \   000035   85..83       MOV     DPH,?V0 + 3
   \   000038   E0           MOVX    A,@DPTR
   \   000039   F9           MOV     R1,A
   \   00003A   12....       LCALL   ??ZDO_ConvertOTAClusters?relay
   \   00003D   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine76:
   \   000000   E5..         MOV     A,?V0 + 0
   \   000002   240E         ADD     A,#0xe
   \                     ??Subroutine76_0:
   \   000004   F582         MOV     DPL,A
   \   000006   E5..         MOV     A,?V0 + 1
   \                     ??Subroutine76_1:
   \   000008   12....       LCALL   ??Subroutine110_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_243:
   \   00000B   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine23:
   \   000000   12....       LCALL   ?Subroutine88 & 0xFFFF
   \                     ??CrossCallReturnLabel_184:
   \   000003   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine88:
   \   000000   12....       LCALL   ?Subroutine113 & 0xFFFF
   \                     ??CrossCallReturnLabel_292:
   \   000003   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine113:
   \   000000   F0           MOVX    @DPTR,A
   \   000001   8E82         MOV     DPL,R6
   \   000003   8F83         MOV     DPH,R7
   \   000005                REQUIRE ?Subroutine126
   \   000005                ; // Fall through to label ?Subroutine126

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine126:
   \   000000   A3           INC     DPTR
   \   000001   AE82         MOV     R6,DPL
   \   000003   AF83         MOV     R7,DPH
   \   000005   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine86:
   \   000000   F0           MOVX    @DPTR,A
   \   000001   A3           INC     DPTR
   \   000002   E9           MOV     A,R1
   \                     ??Subroutine86_0:
   \   000003   12....       LCALL   ?Subroutine114 & 0xFFFF
   \                     ??CrossCallReturnLabel_248:
   \   000006   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine114:
   \   000000   F0           MOVX    @DPTR,A
   \   000001   12....       LCALL   ?Subroutine117 & 0xFFFF
   \                     ??CrossCallReturnLabel_253:
   \   000004   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine117:
   \   000000   EE           MOV     A,R6
   \   000001   2402         ADD     A,#0x2
   \   000003   0E           INC     R6
   \   000004   0E           INC     R6
   \   000005   EF           MOV     A,R7
   \   000006   3400         ADDC    A,#0x0
   \   000008   FF           MOV     R7,A
   \   000009   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine21:
   \   000000   12....       LCALL   ?Subroutine83 & 0xFFFF
   \                     ??CrossCallReturnLabel_175:
   \   000003   E5..         MOV     A,?V0 + 0
   \   000005   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine67:
   \   000000   FA           MOV     R2,A
   \   000001   E5..         MOV     A,?V0 + 1
   \   000003   3400         ADDC    A,#0x0
   \   000005   FB           MOV     R3,A
   \   000006   12....       LCALL   ?Subroutine109 & 0xFFFF
   \                     ??CrossCallReturnLabel_324:
   \   000009   E0           MOVX    A,@DPTR
   \   00000A   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine109:
   \   000000   12....       LCALL   ??osal_cpyExtAddr?relay
   \   000003   EE           MOV     A,R6
   \   000004   2408         ADD     A,#0x8
   \                     ??Subroutine109_0:
   \   000006   FE           MOV     R6,A
   \   000007   EF           MOV     A,R7
   \   000008   3400         ADDC    A,#0x0
   \   00000A   FF           MOV     R7,A
   \   00000B                REQUIRE ?Subroutine130
   \   00000B                ; // Fall through to label ?Subroutine130

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine94:
   \   000000   EA           MOV     A,R2
   \   000001   2411         ADD     A,#0x11
   \   000003   F582         MOV     DPL,A
   \   000005   EB           MOV     A,R3
   \                     ??Subroutine94_0:
   \   000006   3400         ADDC    A,#0x0
   \   000008   F583         MOV     DPH,A
   \   00000A   E0           MOVX    A,@DPTR
   \   00000B   FE           MOV     R6,A
   \   00000C   A3           INC     DPTR
   \   00000D   E0           MOVX    A,@DPTR
   \   00000E   FF           MOV     R7,A
   \   00000F   8E82         MOV     DPL,R6
   \   000011   8F83         MOV     DPH,R7
   \   000013   E0           MOVX    A,@DPTR
   \   000014   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine83:
   \   000000   F0           MOVX    @DPTR,A
   \   000001   8E82         MOV     DPL,R6
   \   000003   8F83         MOV     DPH,R7
   \   000005   A3           INC     DPTR
   \   000006   0E           INC     R6
   \   000007   AF83         MOV     R7,DPH
   \   000009   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine54:
   \   000000   F582         MOV     DPL,A
   \   000002   EB           MOV     A,R3
   \   000003   12....       LCALL   ??Subroutine110_0 & 0xFFFF
   \                     ??Subroutine54_0:
   \   000006   E0           MOVX    A,@DPTR
   \   000007                REQUIRE ?Subroutine131
   \   000007                ; // Fall through to label ?Subroutine131

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine131:
   \   000000   8C82         MOV     DPL,R4
   \   000002   8D83         MOV     DPH,R5
   \   000004   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine110:
   \   000000   F582         MOV     DPL,A
   \   000002   E5..         MOV     A,?V0 + 1
   \                     ??Subroutine110_0:
   \   000004   3400         ADDC    A,#0x0
   \   000006   F583         MOV     DPH,A
   \   000008   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine13:
   \   000000   12....       LCALL   ?Subroutine87 & 0xFFFF
   \                     ??CrossCallReturnLabel_265:
   \   000003   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine87:
   \   000000   12....       LCALL   ?Subroutine113 & 0xFFFF
   \                     ??CrossCallReturnLabel_291:
   \   000003   02....       LJMP    ?Subroutine121 & 0xFFFF

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine7:
   \   000000   12....       LCALL   ?Subroutine85 & 0xFFFF
   \                     ??CrossCallReturnLabel_178:
   \   000003   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine85:
   \   000000   F0           MOVX    @DPTR,A
   \   000001   A3           INC     DPTR
   \   000002   E9           MOV     A,R1
   \   000003   12....       LCALL   ?Subroutine114 & 0xFFFF
   \                     ??CrossCallReturnLabel_249:
   \   000006   8E82         MOV     DPL,R6
   \   000008   8F83         MOV     DPH,R7
   \   00000A   E0           MOVX    A,@DPTR
   \   00000B   FA           MOV     R2,A
   \   00000C   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine39:
   \   000000   12....       LCALL   ?Subroutine94 & 0xFFFF
   \                     ??CrossCallReturnLabel_198:
   \   000003   FA           MOV     R2,A
   \   000004   A3           INC     DPTR
   \   000005   E0           MOVX    A,@DPTR
   \   000006   F9           MOV     R1,A
   \   000007   EA           MOV     A,R2
   \   000008   02....       LJMP    ?Subroutine131 & 0xFFFF

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine6:
   \   000000   12....       LCALL   ?Subroutine86 & 0xFFFF
   \                     ??CrossCallReturnLabel_180:
   \   000003                ; Setup parameters for call to function osal_cpyExtAddr
   \   000003                ; Setup parameters for call to function osal_cpyExtAddr
   \   000003   EE           MOV     A,R6
   \   000004   FC           MOV     R4,A
   \   000005   EF           MOV     A,R7
   \   000006   FD           MOV     R5,A
   \   000007   E5..         MOV     A,?V0 + 0
   \   000009   22           RET
   2179          
   2180          /*********************************************************************
   2181           * @fn          ZDO_ParseBindUnbindReq
   2182           *
   2183           * @brief       This function parses the Bind_req or Unbind_req message.
   2184           *
   2185           * @param       inMsg  - incoming message (request)
   2186           * @param       pReq - place to put parsed information
   2187           *
   2188           * @return      none
   2189           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   2190          void ZDO_ParseBindUnbindReq( zdoIncomingMsg_t *inMsg, ZDO_BindUnbindReq_t *pReq )
   \                     ZDO_ParseBindUnbindReq:
   2191          {
   \   000000   74F6         MOV     A,#-0xa
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 10
   \   000005                ; Auto size: 0
   \   000005   8C..         MOV     ?V0 + 0,R4
   \   000007   8D..         MOV     ?V0 + 1,R5
   2192            uint8 *msg;
   2193          
   2194            msg = inMsg->asdu;
   \   000009   12....       LCALL   ?Subroutine107 & 0xFFFF
   \                     ??CrossCallReturnLabel_231:
   \   00000C   3400         ADDC    A,#0x0
   \   00000E   12....       LCALL   ?Subroutine56 & 0xFFFF
   2195            osal_cpyExtAddr( pReq->srcAddress, msg );
   \                     ??CrossCallReturnLabel_111:
   \   000011                ; Setup parameters for call to function osal_cpyExtAddr
   \   000011   12....       LCALL   ?Subroutine0 & 0xFFFF
   2196            msg += Z_EXTADDR_LEN;
   2197            pReq->srcEndpoint = *msg++;
   2198            pReq->clusterID = BUILD_UINT16( msg[0], msg[1] );
   2199            msg += 2;
   2200            pReq->dstAddress.addrMode = *msg++;
   2201            if ( pReq->dstAddress.addrMode == Addr64Bit )
   \                     ??CrossCallReturnLabel_0:
   \   000014   7019         JNZ     ??ZDO_ParseBindUnbindReq_0
   2202            {
   2203              osal_cpyExtAddr( pReq->dstAddress.addr.extAddr, msg );
   \   000016                ; Setup parameters for call to function osal_cpyExtAddr
   \   000016   EE           MOV     A,R6
   \   000017   FC           MOV     R4,A
   \   000018   EF           MOV     A,R7
   \   000019   FD           MOV     R5,A
   \   00001A   E5..         MOV     A,?V0 + 0
   \   00001C   240B         ADD     A,#0xb
   \   00001E   12....       LCALL   ?Subroutine68 & 0xFFFF
   2204              msg += Z_EXTADDR_LEN;
   2205              pReq->dstEndpoint = *msg;
   \                     ??CrossCallReturnLabel_256:
   \   000021   E0           MOVX    A,@DPTR
   \   000022   C0E0         PUSH    A
   \   000024   E5..         MOV     A,?V0 + 0
   \   000026   2414         ADD     A,#0x14
   \   000028   12....       LCALL   ??Subroutine76_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_154:
   \   00002B   D0E0         POP     A
   \   00002D   8006         SJMP    ??ZDO_ParseBindUnbindReq_1
   2206            }
   2207            else
   2208            {
   2209              // copy group address
   2210              pReq->dstAddress.addr.shortAddr = BUILD_UINT16( msg[0], msg[1] );
   \                     ??ZDO_ParseBindUnbindReq_0:
   \   00002F   12....       LCALL   ?Subroutine38 & 0xFFFF
   \                     ??CrossCallReturnLabel_80:
   \   000032   F0           MOVX    @DPTR,A
   \   000033   A3           INC     DPTR
   \   000034   E9           MOV     A,R1
   \                     ??ZDO_ParseBindUnbindReq_1:
   \   000035   02....       LJMP    ?Subroutine132 & 0xFFFF
   2211            }
   2212          }

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine38:
   \   000000   12....       LCALL   ?Subroutine121 & 0xFFFF
   \                     ??CrossCallReturnLabel_267:
   \   000003   F8           MOV     R0,A
   \   000004   E5..         MOV     A,?V0 + 0
   \   000006   240B         ADD     A,#0xb
   \   000008   12....       LCALL   ?Subroutine110 & 0xFFFF
   \                     ??CrossCallReturnLabel_240:
   \   00000B   E8           MOV     A,R0
   \   00000C   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine0:
   \   000000   EE           MOV     A,R6
   \   000001   FC           MOV     R4,A
   \   000002   EF           MOV     A,R7
   \   000003   FD           MOV     R5,A
   \   000004   AA..         MOV     R2,?V0 + 0
   \   000006   AB..         MOV     R3,?V0 + 1
   \   000008   12....       LCALL   ?Subroutine109 & 0xFFFF
   \                     ??CrossCallReturnLabel_325:
   \   00000B   12....       LCALL   ?Subroutine99 & 0xFFFF
   \                     ??CrossCallReturnLabel_262:
   \   00000E   A3           INC     DPTR
   \   00000F   A3           INC     DPTR
   \   000010   A3           INC     DPTR
   \   000011   12....       LCALL   ?Subroutine87 & 0xFFFF
   \                     ??CrossCallReturnLabel_264:
   \   000014   85..82       MOV     DPL,?V0 + 0
   \   000017   85..83       MOV     DPH,?V0 + 1
   \   00001A   A3           INC     DPTR
   \   00001B   A3           INC     DPTR
   \   00001C   A3           INC     DPTR
   \   00001D   A3           INC     DPTR
   \   00001E   A3           INC     DPTR
   \   00001F   A3           INC     DPTR
   \   000020   A3           INC     DPTR
   \   000021   A3           INC     DPTR
   \   000022   A3           INC     DPTR
   \   000023   12....       LCALL   ?Subroutine85 & 0xFFFF
   \                     ??CrossCallReturnLabel_177:
   \   000026   E5..         MOV     A,?V0 + 0
   \   000028   2413         ADD     A,#0x13
   \   00002A   12....       LCALL   ?Subroutine110 & 0xFFFF
   \                     ??CrossCallReturnLabel_238:
   \   00002D   EA           MOV     A,R2
   \   00002E   12....       LCALL   ?Subroutine83 & 0xFFFF
   \                     ??CrossCallReturnLabel_173:
   \   000031   7403         MOV     A,#0x3
   \   000033   6A           XRL     A,R2
   \   000034   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine68:
   \   000000   FA           MOV     R2,A
   \   000001   E5..         MOV     A,?V0 + 1
   \   000003   3400         ADDC    A,#0x0
   \   000005   FB           MOV     R3,A
   \   000006   12....       LCALL   ??osal_cpyExtAddr?relay
   \   000009   8E82         MOV     DPL,R6
   \   00000B   8F83         MOV     DPH,R7
   \   00000D   A3           INC     DPTR
   \   00000E   02....       LJMP    ?Subroutine120 & 0xFFFF

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine99:
   \   000000   E0           MOVX    A,@DPTR
   \   000001   85..82       MOV     DPL,?V0 + 0
   \   000004   85..83       MOV     DPH,?V0 + 1
   \   000007   02....       LJMP    ??Subroutine120_1 & 0xFFFF
   2213          
   2214          /*********************************************************************
   2215           * @fn      ZDO_ParseAddrRsp
   2216           *
   2217           * @brief   Turns the inMsg (incoming message) into the out parsed
   2218           *          structure.
   2219           *
   2220           * @param   inMsg - incoming message
   2221           *
   2222           * @return  pointer to parsed structures.  This structure was
   2223           *          allocated using osal_mem_alloc, so it must be freed
   2224           *          by the calling function [osal_mem_free()].
   2225           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   2226          ZDO_NwkIEEEAddrResp_t *ZDO_ParseAddrRsp( zdoIncomingMsg_t *inMsg )
   \                     ZDO_ParseAddrRsp:
   2227          {
   \   000000   74F2         MOV     A,#-0xe
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 14
   \   000005                ; Auto size: 0
   \   000005   EA           MOV     A,R2
   \   000006   FE           MOV     R6,A
   \   000007   EB           MOV     A,R3
   \   000008   FF           MOV     R7,A
   2228            ZDO_NwkIEEEAddrResp_t *rsp;
   2229            uint8 *msg;
   2230            byte cnt = 0;
   2231          
   2232            // Calculate the number of items in the list
   2233            if ( inMsg->asduLen > (1 + Z_EXTADDR_LEN + 2) )
   \   000009   EE           MOV     A,R6
   \   00000A   2410         ADD     A,#0x10
   \   00000C   F582         MOV     DPL,A
   \   00000E   EF           MOV     A,R7
   \   00000F   12....       LCALL   ??Subroutine70_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_141:
   \   000012   C3           CLR     C
   \   000013   940C         SUBB    A,#0xc
   \   000015   400D         JC      ??ZDO_ParseAddrRsp_0
   2234              cnt = inMsg->asdu[1 + Z_EXTADDR_LEN + 2];
   \   000017   12....       LCALL   ?Subroutine106 & 0xFFFF
   \                     ??CrossCallReturnLabel_228:
   \   00001A   12....       LCALL   ??Subroutine70_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_142:
   \   00001D   240B         ADD     A,#0xb
   \   00001F   12....       LCALL   ?Subroutine52 & 0xFFFF
   \                     ??CrossCallReturnLabel_105:
   \   000022   8003         SJMP    ??ZDO_ParseAddrRsp_1
   2235            else
   2236              cnt = 0;
   \                     ??ZDO_ParseAddrRsp_0:
   \   000024   75..00       MOV     ?V0 + 2,#0x0
   2237          
   2238            // Make buffer
   2239            rsp = (ZDO_NwkIEEEAddrResp_t *)osal_mem_alloc( sizeof(ZDO_NwkIEEEAddrResp_t) + (cnt * sizeof ( uint16 )) );
   \                     ??ZDO_ParseAddrRsp_1:
   \   000027                ; Setup parameters for call to function osal_mem_alloc
   \   000027   E5..         MOV     A,?V0 + 2
   \   000029   C3           CLR     C
   \   00002A   33           RLC     A
   \   00002B   F8           MOV     R0,A
   \   00002C   E4           CLR     A
   \   00002D   33           RLC     A
   \   00002E   F9           MOV     R1,A
   \   00002F   740D         MOV     A,#0xd
   \   000031   12....       LCALL   ?Subroutine78 & 0xFFFF
   \                     ??CrossCallReturnLabel_167:
   \   000034   8A..         MOV     ?V0 + 0,R2
   \   000036   8B..         MOV     ?V0 + 1,R3
   2240          
   2241            if ( rsp )
   \   000038   EA           MOV     A,R2
   \   000039   7001         JNZ     ??ZDO_ParseAddrRsp_2
   \   00003B   EB           MOV     A,R3
   \                     ??ZDO_ParseAddrRsp_2:
   \   00003C   607F         JZ      ??ZDO_ParseAddrRsp_3
   2242            {
   2243              msg = inMsg->asdu;
   \   00003E   12....       LCALL   ?Subroutine106 & 0xFFFF
   \                     ??CrossCallReturnLabel_229:
   \   000041   12....       LCALL   ??Subroutine43_1 & 0xFFFF
   2244          
   2245              rsp->status = *msg++;
   \                     ??CrossCallReturnLabel_90:
   \   000044   8A82         MOV     DPL,R2
   \   000046   8B83         MOV     DPH,R3
   \   000048   12....       LCALL   ?Subroutine23 & 0xFFFF
   2246              if ( rsp->status == ZDO_SUCCESS )
   \                     ??CrossCallReturnLabel_39:
   \   00004B   7070         JNZ     ??ZDO_ParseAddrRsp_3
   2247              {
   2248                osal_cpyExtAddr( rsp->extAddr, msg );
   \   00004D                ; Setup parameters for call to function osal_cpyExtAddr
   \   00004D   EE           MOV     A,R6
   \   00004E   FC           MOV     R4,A
   \   00004F   EF           MOV     A,R7
   \   000050   FD           MOV     R5,A
   \   000051   12....       LCALL   ?Subroutine82 & 0xFFFF
   \                     ??CrossCallReturnLabel_272:
   \   000054   12....       LCALL   ??osal_cpyExtAddr?relay
   2249                msg += Z_EXTADDR_LEN;
   \   000057   EE           MOV     A,R6
   \   000058   2408         ADD     A,#0x8
   \   00005A   FE           MOV     R6,A
   \   00005B   EF           MOV     A,R7
   \   00005C   3400         ADDC    A,#0x0
   \   00005E   FF           MOV     R7,A
   2250                rsp->nwkAddr = BUILD_UINT16( msg[0], msg[1] );
   \   00005F   12....       LCALL   ?Subroutine49 & 0xFFFF
   \                     ??CrossCallReturnLabel_276:
   \   000062   12....       LCALL   ?Subroutine8 & 0xFFFF
   2251          
   2252                msg += 2;
   2253                rsp->numAssocDevs = 0;
   \                     ??CrossCallReturnLabel_14:
   \   000065   E5..         MOV     A,?V0 + 0
   \   000067   240B         ADD     A,#0xb
   \   000069   F582         MOV     DPL,A
   \   00006B   E5..         MOV     A,?V0 + 1
   \   00006D   12....       LCALL   ?Subroutine75 & 0xFFFF
   2254          
   2255                // StartIndex field is only present if NumAssocDev field is non-zero.
   2256                if ( cnt > 0 )
   \                     ??CrossCallReturnLabel_150:
   \   000070   604B         JZ      ??ZDO_ParseAddrRsp_3
   2257                {
   2258                  uint16 *pList = &(rsp->devList[0]);
   \   000072   E5..         MOV     A,?V0 + 0
   \   000074   240D         ADD     A,#0xd
   \   000076   F8           MOV     R0,A
   \   000077   E5..         MOV     A,?V0 + 1
   \   000079   3400         ADDC    A,#0x0
   \   00007B   F9           MOV     R1,A
   2259                  byte n = cnt;
   \   00007C   85....       MOV     ?V0 + 3,?V0 + 2
   2260          
   2261                  rsp->numAssocDevs = *msg++;
   \   00007F   8E82         MOV     DPL,R6
   \   000081   8F83         MOV     DPH,R7
   \   000083   E0           MOVX    A,@DPTR
   \   000084   C0E0         PUSH    A
   \   000086   E5..         MOV     A,?V0 + 0
   \   000088   240B         ADD     A,#0xb
   \   00008A   12....       LCALL   ??Subroutine76_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_155:
   \   00008D   D0E0         POP     A
   \   00008F   12....       LCALL   ?Subroutine11 & 0xFFFF
   2262                  rsp->startIndex = *msg++;
   \                     ??CrossCallReturnLabel_19:
   \   000092   C0E0         PUSH    A
   \   000094   E5..         MOV     A,?V0 + 0
   \   000096   240C         ADD     A,#0xc
   \   000098   12....       LCALL   ??Subroutine76_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_156:
   \   00009B   D0E0         POP     A
   \   00009D   12....       LCALL   ?Subroutine28 & 0xFFFF
   2263          
   2264                  while ( n != 0 )
   2265                  {
   2266                    *pList++ = BUILD_UINT16( msg[0], msg[1] );
   \                     ??CrossCallReturnLabel_57:
   \   0000A0   8E82         MOV     DPL,R6
   \   0000A2   8F83         MOV     DPH,R7
   \   0000A4   E0           MOVX    A,@DPTR
   \   0000A5   FC           MOV     R4,A
   \   0000A6   A3           INC     DPTR
   \   0000A7   E0           MOVX    A,@DPTR
   \   0000A8   FB           MOV     R3,A
   \   0000A9   EC           MOV     A,R4
   \   0000AA   8882         MOV     DPL,R0
   \   0000AC   8983         MOV     DPH,R1
   \   0000AE   12....       LCALL   ??Subroutine26_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_53:
   \   0000B1   12....       LCALL   ?Subroutine81 & 0xFFFF
   2267                    msg += sizeof( uint16 );
   \                     ??CrossCallReturnLabel_171:
   \   0000B4   12....       LCALL   ?Subroutine117 & 0xFFFF
   2268                    n--;
   2269                  }
   \                     ??CrossCallReturnLabel_252:
   \   0000B7   15..         DEC     ?V0 + 3
   \   0000B9   E5..         MOV     A,?V0 + 3
   \   0000BB   70E3         JNZ     ??CrossCallReturnLabel_57
   2270                }
   2271              }
   2272            }
   2273            return ( rsp );
   \                     ??ZDO_ParseAddrRsp_3:
   \   0000BD   AA..         MOV     R2,?V0 + 0
   \   0000BF   AB..         MOV     R3,?V0 + 1
   \   0000C1                REQUIRE ?Subroutine133
   \   0000C1                ; // Fall through to label ?Subroutine133
   2274          }

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine8:
   \   000000   A3           INC     DPTR
   \                     ??Subroutine8_0:
   \   000001   12....       LCALL   ?Subroutine86 & 0xFFFF
   \                     ??CrossCallReturnLabel_179:
   \   000004   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine81:
   \   000000   12....       LCALL   ?Subroutine111 & 0xFFFF
   \                     ??CrossCallReturnLabel_245:
   \   000003   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine82:
   \   000000   EA           MOV     A,R2
   \   000001   2403         ADD     A,#0x3
   \   000003   0A           INC     R2
   \   000004   80..         SJMP    ?Subroutine122

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine75:
   \   000000   12....       LCALL   ??Subroutine110_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_242:
   \   000003   E4           CLR     A
   \   000004   F0           MOVX    @DPTR,A
   \   000005   E5..         MOV     A,?V0 + 2
   \   000007   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine49:
   \   000000   8E82         MOV     DPL,R6
   \   000002   8F83         MOV     DPH,R7
   \   000004   12....       LCALL   ?Subroutine121 & 0xFFFF
   \                     ??CrossCallReturnLabel_268:
   \   000007                REQUIRE ?Subroutine123
   \   000007                ; // Fall through to label ?Subroutine123

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine123:
   \   000000   85..82       MOV     DPL,?V0 + 0
   \   000003   85..83       MOV     DPH,?V0 + 1
   \   000006   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine11:
   \   000000   12....       LCALL   ?Subroutine83 & 0xFFFF
   \                     ??CrossCallReturnLabel_174:
   \   000003   E0           MOVX    A,@DPTR
   \   000004   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine78:
   \   000000   12....       LCALL   ?Subroutine112 & 0xFFFF
   \                     ??CrossCallReturnLabel_246:
   \   000003   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine112:
   \   000000   28           ADD     A,R0
   \   000001   FA           MOV     R2,A
   \   000002   E4           CLR     A
   \   000003   39           ADDC    A,R1
   \   000004   FB           MOV     R3,A
   \   000005   12....       LCALL   ??osal_mem_alloc?relay
   \   000008   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine43:
   \   000000   75..00       MOV     ?V0 + 2,#0x0
   \                     ??Subroutine43_0:
   \   000003   12....       LCALL   ?Subroutine107 & 0xFFFF
   \                     ??Subroutine43_1:
   \   000006   12....       LCALL   ??Subroutine94_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_199:
   \   000009   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine28:
   \   000000   12....       LCALL   ?Subroutine83 & 0xFFFF
   \                     ??CrossCallReturnLabel_176:
   \   000003   22           RET
   2275          
   2276          /*********************************************************************
   2277           * @fn          ZDO_ParseNodeDescRsp
   2278           *
   2279           * @brief       This function parses the Node_Desc_rsp message.
   2280           *
   2281           * @param       inMsg - incoming message
   2282           * @param       pNDRsp - place to parse the message into
   2283           *
   2284           * @return      none
   2285           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   2286          void ZDO_ParseNodeDescRsp( zdoIncomingMsg_t *inMsg, ZDO_NodeDescRsp_t *pNDRsp )
   \                     ZDO_ParseNodeDescRsp:
   2287          {
   \   000000   74F7         MOV     A,#-0x9
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 9
   \   000005                ; Auto size: 0
   2288            uint8 *msg;
   2289          
   2290            msg = inMsg->asdu;
   \   000005   12....       LCALL   ?Subroutine44 & 0xFFFF
   2291          
   2292            pNDRsp->status = *msg++;
   \                     ??CrossCallReturnLabel_91:
   \   000008   8C82         MOV     DPL,R4
   \   00000A   8D83         MOV     DPH,R5
   \   00000C   12....       LCALL   ?Subroutine91 & 0xFFFF
   \                     ??CrossCallReturnLabel_190:
   \   00000F   A882         MOV     R0,DPL
   \   000011   A983         MOV     R1,DPH
   2293            pNDRsp->nwkAddr = BUILD_UINT16( msg[0], msg[1] );
   \   000013   E0           MOVX    A,@DPTR
   \   000014   FE           MOV     R6,A
   \   000015   A3           INC     DPTR
   \   000016   E0           MOVX    A,@DPTR
   \   000017   FB           MOV     R3,A
   \   000018   EE           MOV     A,R6
   \   000019   8C82         MOV     DPL,R4
   \   00001B   8D83         MOV     DPH,R5
   \   00001D   A3           INC     DPTR
   \   00001E   12....       LCALL   ??Subroutine26_0 & 0xFFFF
   2294          
   2295            if ( pNDRsp->status == ZDP_SUCCESS )
   \                     ??CrossCallReturnLabel_54:
   \   000021   8C82         MOV     DPL,R4
   \   000023   8D83         MOV     DPH,R5
   \   000025   E0           MOVX    A,@DPTR
   \   000026   6003         JZ      $+5
   \   000028   02....       LJMP    ??CrossCallReturnLabel_310 & 0xFFFF
   2296            {
   2297              msg += 2;
   \   00002B   12....       LCALL   ?Subroutine81 & 0xFFFF
   2298              pNDRsp->nodeDesc.LogicalType = *msg & 0x07;
   \                     ??CrossCallReturnLabel_172:
   \   00002E   EC           MOV     A,R4
   \   00002F   2403         ADD     A,#0x3
   \   000031   FA           MOV     R2,A
   \   000032   ED           MOV     A,R5
   \   000033   3400         ADDC    A,#0x0
   \   000035   FB           MOV     R3,A
   \   000036   8882         MOV     DPL,R0
   \   000038   8983         MOV     DPH,R1
   \   00003A   E0           MOVX    A,@DPTR
   \   00003B   5407         ANL     A,#0x7
   \   00003D   C0E0         PUSH    A
   \   00003F   8A82         MOV     DPL,R2
   \   000041   8B83         MOV     DPH,R3
   \   000043   E0           MOVX    A,@DPTR
   \   000044   54F8         ANL     A,#0xf8
   \   000046   FE           MOV     R6,A
   \   000047   D0E0         POP     A
   \   000049   4E           ORL     A,R6
   \   00004A   12....       LCALL   ?Subroutine15 & 0xFFFF
   2299          
   2300              pNDRsp->nodeDesc.ComplexDescAvail = ( *msg & 0x08 ) >> 3;
   \                     ??CrossCallReturnLabel_278:
   \   00004D   A2E3         MOV     C,0xE0 /* A   */.3
   \   00004F   8B83         MOV     DPH,R3
   \   000051   8A82         MOV     DPL,R2
   \   000053   E0           MOVX    A,@DPTR
   \   000054   92E3         MOV     0xE0 /* A   */.3,C
   \   000056   12....       LCALL   ?Subroutine15 & 0xFFFF
   2301              pNDRsp->nodeDesc.UserDescAvail = ( *msg & 0x10 ) >> 4;
   \                     ??CrossCallReturnLabel_279:
   \   000059   A2E4         MOV     C,0xE0 /* A   */.4
   \   00005B   8B83         MOV     DPH,R3
   \   00005D   8A82         MOV     DPL,R2
   \   00005F   E0           MOVX    A,@DPTR
   \   000060   92E4         MOV     0xE0 /* A   */.4,C
   \   000062   12....       LCALL   ?Subroutine29 & 0xFFFF
   2302          
   2303              msg++;  // Reserved bits.
   2304              pNDRsp->nodeDesc.FrequencyBand = (*msg >> 3) & 0x1f;
   \                     ??CrossCallReturnLabel_59:
   \   000065   EC           MOV     A,R4
   \   000066   2404         ADD     A,#0x4
   \   000068   0A           INC     R2
   \   000069   ED           MOV     A,R5
   \   00006A   3400         ADDC    A,#0x0
   \   00006C   FB           MOV     R3,A
   \   00006D   E0           MOVX    A,@DPTR
   \   00006E   54F8         ANL     A,#0xf8
   \   000070   C0E0         PUSH    A
   \   000072   8A82         MOV     DPL,R2
   \   000074   8B83         MOV     DPH,R3
   \   000076   E0           MOVX    A,@DPTR
   \   000077   5407         ANL     A,#0x7
   \   000079   FE           MOV     R6,A
   \   00007A   D0E0         POP     A
   \   00007C   4E           ORL     A,R6
   \   00007D   FE           MOV     R6,A
   \   00007E   12....       LCALL   ?Subroutine15 & 0xFFFF
   2305              pNDRsp->nodeDesc.APSFlags = *msg++ & 0x07;
   \                     ??CrossCallReturnLabel_280:
   \   000081   5407         ANL     A,#0x7
   \   000083   C0E0         PUSH    A
   \   000085   74F8         MOV     A,#-0x8
   \   000087   5E           ANL     A,R6
   \   000088   FE           MOV     R6,A
   \   000089   D0E0         POP     A
   \   00008B   4E           ORL     A,R6
   \   00008C   A3           INC     DPTR
   \   00008D   08           INC     R0
   \   00008E   A983         MOV     R1,DPH
   \   000090   8A82         MOV     DPL,R2
   \   000092   8B83         MOV     DPH,R3
   \   000094   12....       LCALL   ?Subroutine15 & 0xFFFF
   2306              pNDRsp->nodeDesc.CapabilityFlags = *msg++;
   \                     ??CrossCallReturnLabel_281:
   \   000097   8C82         MOV     DPL,R4
   \   000099   8D83         MOV     DPH,R5
   \   00009B   A3           INC     DPTR
   \   00009C   A3           INC     DPTR
   \   00009D   A3           INC     DPTR
   \   00009E   A3           INC     DPTR
   \   00009F   A3           INC     DPTR
   \   0000A0   12....       LCALL   ?Subroutine29 & 0xFFFF
   2307              pNDRsp->nodeDesc.ManufacturerCode[0] = *msg++;
   \                     ??CrossCallReturnLabel_60:
   \   0000A3   12....       LCALL   ??Subroutine54_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_331:
   \   0000A6   A3           INC     DPTR
   \   0000A7   A3           INC     DPTR
   \   0000A8   A3           INC     DPTR
   \   0000A9   A3           INC     DPTR
   \   0000AA   A3           INC     DPTR
   \   0000AB   A3           INC     DPTR
   \   0000AC   12....       LCALL   ?Subroutine5 & 0xFFFF
   2308              pNDRsp->nodeDesc.ManufacturerCode[1] = *msg++;
   \                     ??CrossCallReturnLabel_8:
   \   0000AF   12....       LCALL   ?Subroutine5 & 0xFFFF
   2309              pNDRsp->nodeDesc.MaxBufferSize = *msg++;
   \                     ??CrossCallReturnLabel_9:
   \   0000B2   A3           INC     DPTR
   \   0000B3   12....       LCALL   ?Subroutine4 & 0xFFFF
   2310              pNDRsp->nodeDesc.MaxTransferSize[0] = *msg++;
   \                     ??CrossCallReturnLabel_6:
   \   0000B6   12....       LCALL   ?Subroutine4 & 0xFFFF
   2311              pNDRsp->nodeDesc.MaxTransferSize[1] = *msg++;
   \                     ??CrossCallReturnLabel_7:
   \   0000B9   A3           INC     DPTR
   \   0000BA   12....       LCALL   ?Subroutine91 & 0xFFFF
   2312              pNDRsp->nodeDesc.ServerMask = BUILD_UINT16( msg[0], msg[1] );
   \                     ??CrossCallReturnLabel_191:
   \   0000BD   12....       LCALL   ?Subroutine59 & 0xFFFF
   \                     ??CrossCallReturnLabel_119:
   \   0000C0   F8           MOV     R0,A
   \   0000C1   EC           MOV     A,R4
   \   0000C2   240B         ADD     A,#0xb
   \   0000C4   F582         MOV     DPL,A
   \   0000C6   ED           MOV     A,R5
   \   0000C7   12....       LCALL   ??Subroutine76_1 & 0xFFFF
   \                     ??CrossCallReturnLabel_157:
   \   0000CA   12....       LCALL   ??Subroutine10_1 & 0xFFFF
   2313            }
   2314          }
   \                     ??CrossCallReturnLabel_310:
   \   0000CD   02....       LJMP    ?Subroutine135 & 0xFFFF

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine29:
   \   000000   12....       LCALL   ?Subroutine91 & 0xFFFF
   \                     ??CrossCallReturnLabel_189:
   \   000003   08           INC     R0
   \   000004   A983         MOV     R1,DPH
   \   000006   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine91:
   \   000000   F0           MOVX    @DPTR,A
   \   000001   8882         MOV     DPL,R0
   \   000003   8983         MOV     DPH,R1
   \   000005   A3           INC     DPTR
   \   000006   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine5:
   \   000000   12....       LCALL   ?Subroutine84 & 0xFFFF
   \                     ??CrossCallReturnLabel_258:
   \   000003   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine84:
   \   000000   F0           MOVX    @DPTR,A
   \   000001   8882         MOV     DPL,R0
   \   000003   8983         MOV     DPH,R1
   \   000005   A3           INC     DPTR
   \   000006   08           INC     R0
   \   000007   A983         MOV     R1,DPH
   \   000009   E0           MOVX    A,@DPTR
   \   00000A   8C82         MOV     DPL,R4
   \   00000C   8D83         MOV     DPH,R5
   \   00000E   02....       LJMP    ?Subroutine120 & 0xFFFF

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine4:
   \   000000   12....       LCALL   ?Subroutine84 & 0xFFFF
   \                     ??CrossCallReturnLabel_259:
   \   000003   A3           INC     DPTR
   \   000004   A3           INC     DPTR
   \   000005   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine15:
   \   000000   F0           MOVX    @DPTR,A
   \   000001   02....       LJMP    ?Subroutine124 & 0xFFFF
   2315          
   2316          /*********************************************************************
   2317           * @fn          ZDO_ParesPowerDescRsp
   2318           *
   2319           * @brief       This function parses the Power_Desc_rsp message.
   2320           *
   2321           * @param       inMsg  - incoming message
   2322           * @param       pNPRsp - place to parse the message into
   2323           *
   2324           * @return      none
   2325           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   2326          void ZDO_ParsePowerDescRsp( zdoIncomingMsg_t *inMsg, ZDO_PowerRsp_t *pNPRsp )
   \                     ZDO_ParsePowerDescRsp:
   2327          {
   \   000000   74F6         MOV     A,#-0xa
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 10
   \   000005                ; Auto size: 0
   2328            uint8 *msg;
   2329          
   2330            msg = inMsg->asdu;
   \   000005   12....       LCALL   ?Subroutine3 & 0xFFFF
   2331            pNPRsp->status = *msg++;
   2332            pNPRsp->nwkAddr = BUILD_UINT16( msg[0], msg[1] );
   2333          
   2334            if ( pNPRsp->status == ZDP_SUCCESS )
   \                     ??CrossCallReturnLabel_297:
   \   000008   8C82         MOV     DPL,R4
   \   00000A   8D83         MOV     DPH,R5
   \   00000C   E0           MOVX    A,@DPTR
   \   00000D   7067         JNZ     ??CrossCallReturnLabel_313
   2335            {
   2336              msg += 2;
   \   00000F   12....       LCALL   ?Subroutine80 & 0xFFFF
   2337              pNPRsp->pwrDesc.AvailablePowerSources = *msg >> 4;
   \                     ??CrossCallReturnLabel_271:
   \   000012   EC           MOV     A,R4
   \   000013   2403         ADD     A,#0x3
   \   000015   ED           MOV     A,R5
   \   000016   3400         ADDC    A,#0x0
   \   000018   0C           INC     R4
   \   000019   0C           INC     R4
   \   00001A   0C           INC     R4
   \   00001B   FD           MOV     R5,A
   \   00001C   8C82         MOV     DPL,R4
   \   00001E   8D83         MOV     DPH,R5
   \   000020   E0           MOVX    A,@DPTR
   \   000021   540F         ANL     A,#0xf
   \   000023   FE           MOV     R6,A
   \   000024   A3           INC     DPTR
   \   000025   E0           MOVX    A,@DPTR
   \   000026   12....       LCALL   ?Subroutine61 & 0xFFFF
   \                     ??CrossCallReturnLabel_123:
   \   000029   7404         MOV     A,#0x4
   \   00002B   78..         MOV     R0,#?V0 + 0
   \   00002D   12....       LCALL   ?S_SHL
   \   000030   E5..         MOV     A,?V0 + 0
   \   000032   4E           ORL     A,R6
   \   000033   12....       LCALL   ?Subroutine10 & 0xFFFF
   2338              pNPRsp->pwrDesc.PowerMode = *msg++ & 0x0F;
   \                     ??CrossCallReturnLabel_311:
   \   000036   74F0         MOV     A,#-0x10
   \   000038   58           ANL     A,R0
   \   000039   F8           MOV     R0,A
   \   00003A   8A82         MOV     DPL,R2
   \   00003C   8B83         MOV     DPH,R3
   \   00003E   E0           MOVX    A,@DPTR
   \   00003F   FE           MOV     R6,A
   \   000040   740F         MOV     A,#0xf
   \   000042   5E           ANL     A,R6
   \   000043   48           ORL     A,R0
   \   000044   FE           MOV     R6,A
   \   000045   E9           MOV     A,R1
   \   000046   FF           MOV     R7,A
   \   000047   A3           INC     DPTR
   \   000048   0A           INC     R2
   \   000049   AB83         MOV     R3,DPH
   \   00004B   8C82         MOV     DPL,R4
   \   00004D   8D83         MOV     DPH,R5
   \   00004F   EE           MOV     A,R6
   \   000050   F0           MOVX    @DPTR,A
   \   000051   A3           INC     DPTR
   \   000052   EF           MOV     A,R7
   \   000053   F0           MOVX    @DPTR,A
   2339              pNPRsp->pwrDesc.CurrentPowerSourceLevel = *msg >> 4;
   \   000054   740F         MOV     A,#0xf
   \   000056   59           ANL     A,R1
   \   000057   12....       LCALL   ?Subroutine61 & 0xFFFF
   \                     ??CrossCallReturnLabel_124:
   \   00005A   740C         MOV     A,#0xc
   \   00005C   78..         MOV     R0,#?V0 + 0
   \   00005E   12....       LCALL   ?S_SHL
   \   000061   EE           MOV     A,R6
   \   000062   12....       LCALL   ?Subroutine10 & 0xFFFF
   2340              pNPRsp->pwrDesc.CurrentPowerSource = *msg++ & 0x0F;
   \                     ??CrossCallReturnLabel_312:
   \   000065   74F0         MOV     A,#-0x10
   \   000067   59           ANL     A,R1
   \   000068   F9           MOV     R1,A
   \   000069   8A82         MOV     DPL,R2
   \   00006B   8B83         MOV     DPH,R3
   \   00006D   E0           MOVX    A,@DPTR
   \   00006E   FB           MOV     R3,A
   \   00006F   740F         MOV     A,#0xf
   \   000071   5B           ANL     A,R3
   \   000072   49           ORL     A,R1
   \   000073   12....       LCALL   ??Subroutine10_0 & 0xFFFF
   2341            }
   2342          }
   \                     ??CrossCallReturnLabel_313:
   \   000076   02....       LJMP    ??Subroutine132_0 & 0xFFFF

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine61:
   \   000000   FF           MOV     R7,A
   \   000001   8A82         MOV     DPL,R2
   \   000003   8B83         MOV     DPH,R3
   \   000005   E0           MOVX    A,@DPTR
   \   000006   C4           SWAP    A
   \   000007   540F         ANL     A,#0xf
   \   000009   F5..         MOV     ?V0 + 0,A
   \   00000B   75..00       MOV     ?V0 + 1,#0x0
   \   00000E   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine3:
   \   000000   12....       LCALL   ?Subroutine107 & 0xFFFF
   \                     ??CrossCallReturnLabel_232:
   \   000003   12....       LCALL   ??Subroutine110_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_239:
   \   000006   12....       LCALL   ?Subroutine97 & 0xFFFF
   \                     ??CrossCallReturnLabel_207:
   \   000009   8A82         MOV     DPL,R2
   \   00000B   8B83         MOV     DPH,R3
   \   00000D   E0           MOVX    A,@DPTR
   \   00000E   8C82         MOV     DPL,R4
   \   000010   8D83         MOV     DPH,R5
   \   000012   12....       LCALL   ?Subroutine93 & 0xFFFF
   \                     ??CrossCallReturnLabel_196:
   \   000015   AA82         MOV     R2,DPL
   \   000017   AB83         MOV     R3,DPH
   \   000019   E0           MOVX    A,@DPTR
   \   00001A   FE           MOV     R6,A
   \   00001B   A3           INC     DPTR
   \   00001C   E0           MOVX    A,@DPTR
   \   00001D   F9           MOV     R1,A
   \   00001E   EE           MOV     A,R6
   \   00001F   8C82         MOV     DPL,R4
   \   000021   8D83         MOV     DPH,R5
   \   000023   A3           INC     DPTR
   \   000024                REQUIRE ?Subroutine128
   \   000024                ; // Fall through to label ?Subroutine128
   2343          
   2344          /*********************************************************************
   2345           * @fn          ZDO_ParseSimpleDescRsp
   2346           *
   2347           * @brief       This function parse the Simple_Desc_rsp message.
   2348           *
   2349           *   NOTE: The pAppInClusterList and pAppOutClusterList fields
   2350           *         in the SimpleDescriptionFormat_t structure are allocated
   2351           *         and the calling function needs to free [osal_msg_free()]
   2352           *         these buffers.
   2353           *
   2354           * @param       inMsg  - incoming message
   2355           * @param       pSimpleDescRsp - place to parse the message into
   2356           *
   2357           * @return      none
   2358           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   2359          void ZDO_ParseSimpleDescRsp( zdoIncomingMsg_t *inMsg, ZDO_SimpleDescRsp_t *pSimpleDescRsp )
   \                     ZDO_ParseSimpleDescRsp:
   2360          {
   \   000000   74F7         MOV     A,#-0x9
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 9
   \   000005                ; Auto size: 0
   2361            uint8 *msg;
   2362          
   2363            msg = inMsg->asdu;
   \   000005   12....       LCALL   ?Subroutine3 & 0xFFFF
   2364            pSimpleDescRsp->status = *msg++;
   2365            pSimpleDescRsp->nwkAddr = BUILD_UINT16( msg[0], msg[1] );
   2366            msg += sizeof ( uint16 );
   2367            msg++; // Skip past the length field.
   \                     ??CrossCallReturnLabel_298:
   \   000008   12....       LCALL   ?Subroutine82 & 0xFFFF
   2368          
   2369            if ( pSimpleDescRsp->status == ZDP_SUCCESS )
   \                     ??CrossCallReturnLabel_273:
   \   00000B   8C82         MOV     DPL,R4
   \   00000D   8D83         MOV     DPH,R5
   \   00000F   E0           MOVX    A,@DPTR
   \   000010   700D         JNZ     ??ZDO_ParseSimpleDescRsp_0
   2370            {
   2371              ZDO_ParseSimpleDescBuf( msg, &(pSimpleDescRsp->simpleDesc) );
   \   000012                ; Setup parameters for call to function ZDO_ParseSimpleDescBuf
   \   000012   EC           MOV     A,R4
   \   000013   2403         ADD     A,#0x3
   \   000015   0C           INC     R4
   \   000016   0C           INC     R4
   \   000017   0C           INC     R4
   \   000018   ED           MOV     A,R5
   \   000019   3400         ADDC    A,#0x0
   \   00001B   FD           MOV     R5,A
   \   00001C   12....       LCALL   ??ZDO_ParseSimpleDescBuf?relay
   2372            }
   2373          }
   \                     ??ZDO_ParseSimpleDescRsp_0:
   \   00001F                REQUIRE ?Subroutine135
   \   00001F                ; // Fall through to label ?Subroutine135
   2374          
   2375          /*********************************************************************
   2376           * @fn          ZDO_ParseEPListRsp
   2377           *
   2378           * @brief       This parse the Active_EP_rsp or Match_Desc_rsp message.
   2379           *
   2380           * @param       inMsg  - incoming message
   2381           *
   2382           * @return      none
   2383           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   2384          ZDO_ActiveEndpointRsp_t *ZDO_ParseEPListRsp( zdoIncomingMsg_t *inMsg )
   \                     ZDO_ParseEPListRsp:
   2385          {
   \   000000   74F1         MOV     A,#-0xf
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 15
   \   000005                ; Auto size: 0
   2386            ZDO_ActiveEndpointRsp_t *pRsp;
   2387            uint8 *msg;
   2388            uint8 Status;
   2389            uint8 cnt;
   2390          
   2391            msg = inMsg->asdu;
   \   000005   12....       LCALL   ??Subroutine43_0 & 0xFFFF
   2392            Status = *msg++;
   \                     ??CrossCallReturnLabel_88:
   \   000008   F5..         MOV     ?V0 + 1,A
   \   00000A   A3           INC     DPTR
   \   00000B   AE82         MOV     R6,DPL
   \   00000D   AF83         MOV     R7,DPH
   2393            cnt = msg[2];
   \   00000F   A3           INC     DPTR
   \   000010   A3           INC     DPTR
   \   000011   E0           MOVX    A,@DPTR
   \   000012   F5..         MOV     ?V0 + 0,A
   2394          
   2395            pRsp = (ZDO_ActiveEndpointRsp_t *)osal_mem_alloc( sizeof(  ZDO_ActiveEndpointRsp_t ) + cnt );
   \   000014                ; Setup parameters for call to function osal_mem_alloc
   \   000014   F5..         MOV     ?V0 + 2,A
   \   000016   7404         MOV     A,#0x4
   \   000018   25..         ADD     A,?V0 + 2
   \   00001A   FA           MOV     R2,A
   \   00001B   E4           CLR     A
   \   00001C   3400         ADDC    A,#0x0
   \   00001E   FB           MOV     R3,A
   \   00001F   12....       LCALL   ??osal_mem_alloc?relay
   \   000022   8A..         MOV     ?V0 + 2,R2
   \   000024   8B..         MOV     ?V0 + 3,R3
   2396            if ( pRsp )
   \   000026   EA           MOV     A,R2
   \   000027   7001         JNZ     ??ZDO_ParseEPListRsp_0
   \   000029   EB           MOV     A,R3
   \                     ??ZDO_ParseEPListRsp_0:
   \   00002A   6043         JZ      ??ZDO_ParseEPListRsp_1
   2397            {
   2398              pRsp->status = Status;
   \   00002C   8A82         MOV     DPL,R2
   \   00002E   8B83         MOV     DPH,R3
   \   000030   E5..         MOV     A,?V0 + 1
   \   000032   12....       LCALL   ??Subroutine89_0 & 0xFFFF
   2399              pRsp->nwkAddr = BUILD_UINT16( msg[0], msg[1] );
   \                     ??CrossCallReturnLabel_321:
   \   000035   E0           MOVX    A,@DPTR
   \   000036   FA           MOV     R2,A
   \   000037   A3           INC     DPTR
   \   000038   E0           MOVX    A,@DPTR
   \   000039   F8           MOV     R0,A
   \   00003A   E4           CLR     A
   \   00003B   C8           XCH     A,R0
   \   00003C   F9           MOV     R1,A
   \   00003D   EA           MOV     A,R2
   \   00003E   85..82       MOV     DPL,?V0 + 2
   \   000041   8B83         MOV     DPH,R3
   \   000043   A3           INC     DPTR
   \   000044   12....       LCALL   ?Subroutine128 & 0xFFFF
   2400              msg += sizeof( uint16 );
   2401              pRsp->cnt = cnt;
   \                     ??CrossCallReturnLabel_299:
   \   000047   85..82       MOV     DPL,?V0 + 2
   \   00004A   8B83         MOV     DPH,R3
   \   00004C   A3           INC     DPTR
   \   00004D   A3           INC     DPTR
   \   00004E   12....       LCALL   ?Subroutine89 & 0xFFFF
   2402              msg++; // pass cnt
   2403              osal_memcpy( pRsp->epList, msg, cnt );
   \                     ??CrossCallReturnLabel_320:
   \   000051   A3           INC     DPTR
   \   000052   A3           INC     DPTR
   \   000053   A3           INC     DPTR
   \   000054   A982         MOV     R1,DPL
   \   000056   AA83         MOV     R2,DPH
   \   000058   89..         MOV     ?V0 + 4,R1
   \   00005A   8A..         MOV     ?V0 + 5,R2
   \   00005C   88..         MOV     ?V0 + 6,R0
   \   00005E   78..         MOV     R0,#?V0 + 4
   \   000060   12....       LCALL   ?PUSH_XSTACK_I_THREE
   \   000063   AC..         MOV     R4,?V0 + 0
   \   000065   7D00         MOV     R5,#0x0
   \   000067   E5..         MOV     A,?V0 + 2
   \   000069   12....       LCALL   ?Subroutine74 & 0xFFFF
   \                     ??CrossCallReturnLabel_293:
   \   00006C   12....       LCALL   ?DEALLOC_XSTACK8
   2404            }
   2405          
   2406            return ( pRsp );
   \                     ??ZDO_ParseEPListRsp_1:
   \   00006F   AA..         MOV     R2,?V0 + 2
   \   000071   AB..         MOV     R3,?V0 + 3
   \   000073                REQUIRE ?Subroutine136
   \   000073                ; // Fall through to label ?Subroutine136
   2407          }

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine136:
   \   000000   7F07         MOV     R7,#0x7
   \   000002   02....       LJMP    ?BANKED_LEAVE_XDATA

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine74:
   \   000000   2404         ADD     A,#0x4
   \   000002   FA           MOV     R2,A
   \   000003   EB           MOV     A,R3
   \   000004   3400         ADDC    A,#0x0
   \   000006   FB           MOV     R3,A
   \   000007   02....       LJMP    ?Subroutine127 & 0xFFFF
   2408          
   2409          /*********************************************************************
   2410           * @fn          ZDO_ParseServerDiscRsp
   2411           *
   2412           * @brief       Parse the Server_Discovery_rsp message.
   2413           *
   2414           * @param       inMsg - incoming message.
   2415           * @param       pRsp - place to put the parsed information.
   2416           *
   2417           * @return      none
   2418           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   2419          void ZDO_ParseServerDiscRsp( zdoIncomingMsg_t *inMsg, ZDO_ServerDiscRsp_t *pRsp )
   \                     ZDO_ParseServerDiscRsp:
   2420          {
   \   000000   74F7         MOV     A,#-0x9
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 9
   \   000005                ; Auto size: 0
   2421            pRsp->status = inMsg->asdu[0];
   \   000005   EA           MOV     A,R2
   \   000006   2411         ADD     A,#0x11
   \   000008   F8           MOV     R0,A
   \   000009   EB           MOV     A,R3
   \   00000A   12....       LCALL   ?Subroutine116 & 0xFFFF
   \                     ??CrossCallReturnLabel_283:
   \   00000D   FA           MOV     R2,A
   \   00000E   A3           INC     DPTR
   \   00000F   E0           MOVX    A,@DPTR
   \   000010   F583         MOV     DPH,A
   \   000012   8A82         MOV     DPL,R2
   \   000014   12....       LCALL   ??Subroutine54_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_332:
   \   000017   12....       LCALL   ?Subroutine15 & 0xFFFF
   2422            pRsp->serverMask = BUILD_UINT16( inMsg->asdu[1], inMsg->asdu[2] );
   \                     ??CrossCallReturnLabel_282:
   \   00001A   12....       LCALL   ??Subroutine102_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_317:
   \   00001D   A3           INC     DPTR
   \   00001E   E0           MOVX    A,@DPTR
   \   00001F   FA           MOV     R2,A
   \   000020   8882         MOV     DPL,R0
   \   000022   8983         MOV     DPH,R1
   \   000024   A3           INC     DPTR
   \   000025   12....       LCALL   ?Subroutine62 & 0xFFFF
   \                     ??CrossCallReturnLabel_287:
   \   000028   12....       LCALL   ?Subroutine128 & 0xFFFF
   2423          }
   \                     ??CrossCallReturnLabel_300:
   \   00002B   02....       LJMP    ?Subroutine135 & 0xFFFF

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine62:
   \   000000   A3           INC     DPTR
   \   000001   E0           MOVX    A,@DPTR
   \   000002   F9           MOV     R1,A
   \   000003   EA           MOV     A,R2
   \   000004   02....       LJMP    ?Subroutine125 & 0xFFFF
   2424          
   2425          /*********************************************************************
   2426           * @fn          ZDO_ParseMgmtLqiRsp
   2427           *
   2428           * @brief       This function parses the incoming Management
   2429           *              LQI response
   2430           *
   2431           * @param       inMsg - incoming message
   2432           *
   2433           * @return      a pointer to parsed response structure (NULL if not allocated).
   2434           *          This structure was allocated using osal_mem_alloc, so it must be freed
   2435           *          by the calling function [osal_mem_free()].
   2436           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   2437          ZDO_MgmtLqiRsp_t *ZDO_ParseMgmtLqiRsp( zdoIncomingMsg_t *inMsg )
   \                     ZDO_ParseMgmtLqiRsp:
   2438          {
   \   000000   74F0         MOV     A,#-0x10
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 16
   \   000005                ; Auto size: 0
   2439            ZDO_MgmtLqiRsp_t *pRsp;
   2440            uint8 status;
   2441            uint8 startIndex = 0;
   \   000005   75..00       MOV     ?V0 + 4,#0x0
   2442            uint8 neighborLqiCount = 0;
   \   000008   75..00       MOV     ?V0 + 1,#0x0
   2443            uint8 neighborLqiEntries = 0;
   \   00000B   75..00       MOV     ?V0 + 0,#0x0
   2444            uint8 *msg;
   2445          
   2446            msg = inMsg->asdu;
   \   00000E   12....       LCALL   ?Subroutine42 & 0xFFFF
   2447          
   2448            status = *msg++;
   2449            if ( status == ZSuccess )
   \                     ??CrossCallReturnLabel_289:
   \   000011   7011         JNZ     ??ZDO_ParseMgmtLqiRsp_0
   2450            {
   2451              neighborLqiEntries = *msg++;
   \   000013   E0           MOVX    A,@DPTR
   \   000014   F5..         MOV     ?V0 + 0,A
   \   000016   A3           INC     DPTR
   2452              startIndex = *msg++;
   \   000017   E0           MOVX    A,@DPTR
   \   000018   F5..         MOV     ?V0 + 4,A
   \   00001A   A3           INC     DPTR
   2453              neighborLqiCount = *msg++;
   \   00001B   E0           MOVX    A,@DPTR
   \   00001C   F5..         MOV     ?V0 + 1,A
   \   00001E   A3           INC     DPTR
   \   00001F   0E           INC     R6
   \   000020   0E           INC     R6
   \   000021   0E           INC     R6
   \   000022   AF83         MOV     R7,DPH
   2454            }
   2455          
   2456            // Allocate a buffer big enough to handle the list.
   2457            pRsp = (ZDO_MgmtLqiRsp_t *)osal_mem_alloc(
   2458                      sizeof( ZDO_MgmtLqiRsp_t ) + (neighborLqiCount * sizeof( neighborLqiItem_t )) );
   \                     ??ZDO_ParseMgmtLqiRsp_0:
   \   000024                ; Setup parameters for call to function osal_mem_alloc
   \   000024   E5..         MOV     A,?V0 + 1
   \   000026   75F00E       MOV     B,#0xe
   \   000029   12....       LCALL   ?Subroutine77 & 0xFFFF
   2459            if ( pRsp )
   \                     ??CrossCallReturnLabel_165:
   \   00002C   7001         JNZ     ??ZDO_ParseMgmtLqiRsp_1
   \   00002E   EB           MOV     A,R3
   \                     ??ZDO_ParseMgmtLqiRsp_1:
   \   00002F   6079         JZ      ??ZDO_ParseMgmtLqiRsp_2
   2460            {
   2461              uint8 x;
   2462              neighborLqiItem_t *pList = pRsp->list;
   \   000031   EA           MOV     A,R2
   \   000032   2404         ADD     A,#0x4
   \   000034   F5..         MOV     ?V0 + 2,A
   \   000036   EB           MOV     A,R3
   \   000037   3400         ADDC    A,#0x0
   \   000039   F5..         MOV     ?V0 + 3,A
   2463              pRsp->status = status;
   \   00003B   8A82         MOV     DPL,R2
   \   00003D   8B83         MOV     DPH,R3
   \   00003F   E5..         MOV     A,?V0 + 5
   \   000041   F0           MOVX    @DPTR,A
   2464              pRsp->neighborLqiEntries = neighborLqiEntries;
   \   000042   A3           INC     DPTR
   \   000043   E5..         MOV     A,?V0 + 0
   \   000045   12....       LCALL   ?Subroutine12 & 0xFFFF
   2465              pRsp->startIndex = startIndex;
   2466              pRsp->neighborLqiCount = neighborLqiCount;
   \                     ??CrossCallReturnLabel_22:
   \   000048   E5..         MOV     A,?V0 + 1
   \   00004A   F0           MOVX    @DPTR,A
   2467          
   2468              for ( x = 0; x < neighborLqiCount; x++ )
   \   00004B   75..00       MOV     ?V0 + 0,#0x0
   \   00004E   8053         SJMP    ??ZDO_ParseMgmtLqiRsp_3
   2469              {
   2470                osal_cpyExtAddr(pList->extPANId, msg);   //Copy extended PAN ID
   \                     ??ZDO_ParseMgmtLqiRsp_4:
   \   000050                ; Setup parameters for call to function osal_cpyExtAddr
   \   000050   EE           MOV     A,R6
   \   000051   FC           MOV     R4,A
   \   000052   EF           MOV     A,R7
   \   000053   FD           MOV     R5,A
   \   000054   E5..         MOV     A,?V0 + 2
   \   000056   2404         ADD     A,#0x4
   \   000058   FA           MOV     R2,A
   \   000059   E5..         MOV     A,?V0 + 3
   \   00005B   3400         ADDC    A,#0x0
   \   00005D   FB           MOV     R3,A
   \   00005E   12....       LCALL   ??osal_cpyExtAddr?relay
   2471                msg += Z_EXTADDR_LEN;
   2472          
   2473                msg += Z_EXTADDR_LEN;  // Throwing away IEEE.
   \   000061   EE           MOV     A,R6
   \   000062   2410         ADD     A,#0x10
   \   000064   12....       LCALL   ?Subroutine72 & 0xFFFF
   2474                pList->nwkAddr = BUILD_UINT16( msg[0], msg[1] );
   \                     ??CrossCallReturnLabel_145:
   \   000067   12....       LCALL   ?Subroutine59 & 0xFFFF
   \                     ??CrossCallReturnLabel_120:
   \   00006A   85..82       MOV     DPL,?V0 + 2
   \   00006D   85..83       MOV     DPH,?V0 + 3
   \   000070   12....       LCALL   ?Subroutine128 & 0xFFFF
   2475                msg += 2 + 1 + 1 + 1;      // Skip DeviceType, RxOnIdle, Rlationship, PermitJoining and Depth
   \                     ??CrossCallReturnLabel_301:
   \   000073   EE           MOV     A,R6
   \   000074   2405         ADD     A,#0x5
   \   000076   12....       LCALL   ?Subroutine72 & 0xFFFF
   2476                pList->rxLqi = *msg++;
   \                     ??CrossCallReturnLabel_146:
   \   000079   E0           MOVX    A,@DPTR
   \   00007A   C0E0         PUSH    A
   \   00007C   E5..         MOV     A,?V0 + 2
   \   00007E   240D         ADD     A,#0xd
   \   000080   F582         MOV     DPL,A
   \   000082   E5..         MOV     A,?V0 + 3
   \   000084   12....       LCALL   ??Subroutine76_1 & 0xFFFF
   \                     ??CrossCallReturnLabel_158:
   \   000087   D0E0         POP     A
   \   000089   12....       LCALL   ?Subroutine23 & 0xFFFF
   2477                pList->txQuality = 0;  // This is not specified OTA by ZigBee 1.1.
   \                     ??CrossCallReturnLabel_40:
   \   00008C   E5..         MOV     A,?V0 + 2
   \   00008E   240C         ADD     A,#0xc
   \   000090   F582         MOV     DPL,A
   \   000092   E5..         MOV     A,?V0 + 3
   \   000094   12....       LCALL   ?Subroutine75 & 0xFFFF
   2478                pList++;
   \                     ??CrossCallReturnLabel_151:
   \   000097   240E         ADD     A,#0xe
   \   000099   F5..         MOV     ?V0 + 2,A
   \   00009B   E5..         MOV     A,?V0 + 3
   \   00009D   3400         ADDC    A,#0x0
   \   00009F   F5..         MOV     ?V0 + 3,A
   2479              }
   \   0000A1   05..         INC     ?V0 + 0
   \                     ??ZDO_ParseMgmtLqiRsp_3:
   \   0000A3   E5..         MOV     A,?V0 + 0
   \   0000A5   C3           CLR     C
   \   0000A6   95..         SUBB    A,?V0 + 1
   \   0000A8   40A6         JC      ??ZDO_ParseMgmtLqiRsp_4
   2480            }
   2481          
   2482            return ( pRsp );
   \                     ??ZDO_ParseMgmtLqiRsp_2:
   \   0000AA   02....       LJMP    ?Subroutine134 & 0xFFFF
   2483          }

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine72:
   \   000000   12....       LCALL   ??Subroutine109_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_326:
   \   000003   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine12:
   \   000000   12....       LCALL   ?Subroutine93 & 0xFFFF
   \                     ??CrossCallReturnLabel_195:
   \   000003   A3           INC     DPTR
   \   000004   E5..         MOV     A,?V0 + 4
   \   000006   12....       LCALL   ?Subroutine92 & 0xFFFF
   \                     ??CrossCallReturnLabel_192:
   \   000009   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine92:
   \   000000   F0           MOVX    @DPTR,A
   \   000001   8A82         MOV     DPL,R2
   \   000003   8B83         MOV     DPH,R3
   \   000005   A3           INC     DPTR
   \   000006   A3           INC     DPTR
   \   000007   A3           INC     DPTR
   \   000008   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine77:
   \   000000   A4           MUL     AB
   \   000001   F8           MOV     R0,A
   \   000002   A9F0         MOV     R1,B
   \   000004   7404         MOV     A,#0x4
   \   000006   12....       LCALL   ?Subroutine112 & 0xFFFF
   \                     ??CrossCallReturnLabel_247:
   \   000009   8A..         MOV     ?V0 + 6,R2
   \   00000B   8B..         MOV     ?V0 + 7,R3
   \   00000D   EA           MOV     A,R2
   \   00000E   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine42:
   \   000000   12....       LCALL   ?Subroutine94 & 0xFFFF
   \                     ??CrossCallReturnLabel_197:
   \   000003   F5..         MOV     ?V0 + 5,A
   \   000005   02....       LJMP    ?Subroutine126 & 0xFFFF
   2484          
   2485          /*********************************************************************
   2486           * @fn          ZDO_ParseMgmNwkDiscRsp
   2487           *
   2488           * @brief       This function parses the incoming Management
   2489           *              Network Discover response.
   2490           *
   2491           * @param       inMsg - incoming message
   2492           *
   2493           * @return      pointer to parsed response.  This structure was
   2494           *          allocated using osal_mem_alloc, so it must be freed
   2495           *          by the calling function [osal_mem_free()].
   2496           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   2497          ZDO_MgmNwkDiscRsp_t *ZDO_ParseMgmNwkDiscRsp( zdoIncomingMsg_t *inMsg )
   \                     ZDO_ParseMgmNwkDiscRsp:
   2498          {
   \   000000   74F0         MOV     A,#-0x10
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 16
   \   000005                ; Auto size: 0
   2499            ZDO_MgmNwkDiscRsp_t *pRsp;
   2500            uint8 status;
   2501            uint8 networkCount = 0;
   \   000005   75..00       MOV     ?V0 + 1,#0x0
   2502            uint8 startIndex = 0;
   \   000008   75..00       MOV     ?V0 + 0,#0x0
   2503            uint8 networkListCount = 0;
   \   00000B   12....       LCALL   ?Subroutine43 & 0xFFFF
   2504            uint8 *msg;
   2505          
   2506            msg = inMsg->asdu;
   2507            status = *msg++;
   \                     ??CrossCallReturnLabel_86:
   \   00000E   F5..         MOV     ?V0 + 3,A
   \   000010   A3           INC     DPTR
   \   000011   AE82         MOV     R6,DPL
   \   000013   AF83         MOV     R7,DPH
   2508          
   2509            if ( status == ZSuccess )
   \   000015   700A         JNZ     ??CrossCallReturnLabel_121
   2510            {
   2511              networkCount = *msg++;
   \   000017   E0           MOVX    A,@DPTR
   \   000018   F5..         MOV     ?V0 + 1,A
   \   00001A   A3           INC     DPTR
   2512              startIndex = *msg++;
   \   00001B   E0           MOVX    A,@DPTR
   \   00001C   F5..         MOV     ?V0 + 0,A
   \   00001E   12....       LCALL   ?Subroutine60 & 0xFFFF
   2513              networkListCount = *msg++;
   2514            }
   2515          
   2516            // Allocate a buffer big enough to handle the list.
   2517            pRsp = (ZDO_MgmNwkDiscRsp_t *)osal_mem_alloc( sizeof( ZDO_MgmNwkDiscRsp_t )
   2518                                            + (networkListCount * sizeof( mgmtNwkDiscItem_t )) );
   \                     ??CrossCallReturnLabel_121:
   \   000021                ; Setup parameters for call to function osal_mem_alloc
   \   000021   85....       MOV     ?V0 + 4,?V0 + 2
   \   000024   75..00       MOV     ?V0 + 5,#0x0
   \   000027   7404         MOV     A,#0x4
   \   000029   78..         MOV     R0,#?V0 + 4
   \   00002B   12....       LCALL   ?S_SHL
   \   00002E   7404         MOV     A,#0x4
   \   000030   25..         ADD     A,?V0 + 4
   \   000032   FA           MOV     R2,A
   \   000033   E4           CLR     A
   \   000034   35..         ADDC    A,?V0 + 5
   \   000036   FB           MOV     R3,A
   \   000037   12....       LCALL   ??osal_mem_alloc?relay
   \   00003A   8A..         MOV     ?V0 + 6,R2
   \   00003C   8B..         MOV     ?V0 + 7,R3
   2519            if ( pRsp )
   \   00003E   EA           MOV     A,R2
   \   00003F   7001         JNZ     ??ZDO_ParseMgmNwkDiscRsp_0
   \   000041   EB           MOV     A,R3
   \                     ??ZDO_ParseMgmNwkDiscRsp_0:
   \   000042   7003         JNZ     $+5
   \   000044   02....       LJMP    ??ZDO_ParseMgmNwkDiscRsp_1 & 0xFFFF
   2520            {
   2521              uint8 x;
   2522              mgmtNwkDiscItem_t *pList;
   2523          
   2524              pRsp->status = status;
   \   000047   8A82         MOV     DPL,R2
   \   000049   8B83         MOV     DPH,R3
   \   00004B   E5..         MOV     A,?V0 + 3
   \   00004D   F0           MOVX    @DPTR,A
   2525              pRsp->networkCount = networkCount;
   \   00004E   A3           INC     DPTR
   \   00004F   E5..         MOV     A,?V0 + 1
   \   000051   12....       LCALL   ?Subroutine25 & 0xFFFF
   2526              pRsp->startIndex = startIndex;
   \                     ??CrossCallReturnLabel_45:
   \   000054   E5..         MOV     A,?V0 + 0
   \   000056   12....       LCALL   ?Subroutine24 & 0xFFFF
   2527              pRsp->networkListCount = networkListCount;
   2528              pList = pRsp->list;
   \                     ??CrossCallReturnLabel_41:
   \   000059   12....       LCALL   ?Subroutine79 & 0xFFFF
   2529          
   2530              for ( x = 0; x < networkListCount; x++ )
   \                     ??CrossCallReturnLabel_169:
   \   00005C   75..00       MOV     ?V0 + 3,#0x0
   \   00005F   8077         SJMP    ??ZDO_ParseMgmNwkDiscRsp_2
   2531              {
   2532                osal_cpyExtAddr(pList->extendedPANID, msg);   //Copy extended PAN ID
   \                     ??ZDO_ParseMgmNwkDiscRsp_3:
   \   000061                ; Setup parameters for call to function osal_cpyExtAddr
   \   000061   EE           MOV     A,R6
   \   000062   FC           MOV     R4,A
   \   000063   EF           MOV     A,R7
   \   000064   FD           MOV     R5,A
   \   000065   AA..         MOV     R2,?V0 + 0
   \   000067   AB..         MOV     R3,?V0 + 1
   \   000069   12....       LCALL   ??osal_cpyExtAddr?relay
   2533                pList->PANId = BUILD_UINT16( msg[0], msg[1] );
   \   00006C   12....       LCALL   ?Subroutine49 & 0xFFFF
   \                     ??CrossCallReturnLabel_277:
   \   00006F   A3           INC     DPTR
   \   000070   A3           INC     DPTR
   \   000071   A3           INC     DPTR
   \   000072   A3           INC     DPTR
   \   000073   A3           INC     DPTR
   \   000074   A3           INC     DPTR
   \   000075   A3           INC     DPTR
   \   000076   A3           INC     DPTR
   \   000077   12....       LCALL   ?Subroutine128 & 0xFFFF
   2534                msg += Z_EXTADDR_LEN;
   \                     ??CrossCallReturnLabel_302:
   \   00007A   EE           MOV     A,R6
   \   00007B   2408         ADD     A,#0x8
   \   00007D   12....       LCALL   ?Subroutine72 & 0xFFFF
   2535          
   2536                pList->logicalChannel = *msg++;
   \                     ??CrossCallReturnLabel_147:
   \   000080   12....       LCALL   ?Subroutine50 & 0xFFFF
   \                     ??CrossCallReturnLabel_100:
   \   000083   12....       LCALL   ?Subroutine22 & 0xFFFF
   2537                pList->stackProfile = (*msg) & 0x0F;
   \                     ??CrossCallReturnLabel_36:
   \   000086   540F         ANL     A,#0xf
   \   000088   C0E0         PUSH    A
   \   00008A   E5..         MOV     A,?V0 + 0
   \   00008C   240B         ADD     A,#0xb
   \   00008E   12....       LCALL   ??Subroutine76_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_159:
   \   000091   D0E0         POP     A
   \   000093   12....       LCALL   ?Subroutine27 & 0xFFFF
   2538                pList->version = (*msg++ >> 4) & 0x0F;
   \                     ??CrossCallReturnLabel_55:
   \   000096   C0E0         PUSH    A
   \   000098   E5..         MOV     A,?V0 + 0
   \   00009A   240C         ADD     A,#0xc
   \   00009C   12....       LCALL   ??Subroutine76_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_160:
   \   00009F   D0E0         POP     A
   \   0000A1   12....       LCALL   ?Subroutine11 & 0xFFFF
   2539                pList->beaconOrder = (*msg) & 0x0F;
   \                     ??CrossCallReturnLabel_20:
   \   0000A4   540F         ANL     A,#0xf
   \   0000A6   C0E0         PUSH    A
   \   0000A8   E5..         MOV     A,?V0 + 0
   \   0000AA   240D         ADD     A,#0xd
   \   0000AC   12....       LCALL   ??Subroutine76_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_161:
   \   0000AF   D0E0         POP     A
   \   0000B1   12....       LCALL   ?Subroutine27 & 0xFFFF
   2540                pList->superFrameOrder = (*msg++ >> 4) & 0x0F;
   \                     ??CrossCallReturnLabel_56:
   \   0000B4   C0E0         PUSH    A
   \   0000B6   12....       LCALL   ?Subroutine76 & 0xFFFF
   \                     ??CrossCallReturnLabel_162:
   \   0000B9   D0E0         POP     A
   \   0000BB   12....       LCALL   ?Subroutine11 & 0xFFFF
   2541                pList->permitJoining = *msg++;
   \                     ??CrossCallReturnLabel_21:
   \   0000BE   C0E0         PUSH    A
   \   0000C0   E5..         MOV     A,?V0 + 0
   \   0000C2   240F         ADD     A,#0xf
   \   0000C4   12....       LCALL   ??Subroutine76_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_163:
   \   0000C7   D0E0         POP     A
   \   0000C9   12....       LCALL   ?Subroutine21 & 0xFFFF
   2542                pList++;
   \                     ??CrossCallReturnLabel_35:
   \   0000CC   2410         ADD     A,#0x10
   \   0000CE   F5..         MOV     ?V0 + 0,A
   \   0000D0   E5..         MOV     A,?V0 + 1
   \   0000D2   3400         ADDC    A,#0x0
   \   0000D4   F5..         MOV     ?V0 + 1,A
   2543              }
   \   0000D6   05..         INC     ?V0 + 3
   \                     ??ZDO_ParseMgmNwkDiscRsp_2:
   \   0000D8   E5..         MOV     A,?V0 + 3
   \   0000DA   C3           CLR     C
   \   0000DB   95..         SUBB    A,?V0 + 2
   \   0000DD   4082         JC      ??ZDO_ParseMgmNwkDiscRsp_3
   2544            }
   2545          
   2546            return ( pRsp );
   \                     ??ZDO_ParseMgmNwkDiscRsp_1:
   \   0000DF   02....       LJMP    ?Subroutine134 & 0xFFFF
   2547          }

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine27:
   \   000000   12....       LCALL   ??Subroutine89_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_322:
   \   000003   E0           MOVX    A,@DPTR
   \   000004   C4           SWAP    A
   \   000005   540F         ANL     A,#0xf
   \   000007   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine22:
   \   000000   A3           INC     DPTR
   \   000001   A3           INC     DPTR
   \   000002   A3           INC     DPTR
   \   000003   A3           INC     DPTR
   \   000004   A3           INC     DPTR
   \   000005   12....       LCALL   ?Subroutine88 & 0xFFFF
   \                     ??CrossCallReturnLabel_183:
   \   000008   E0           MOVX    A,@DPTR
   \   000009   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine79:
   \   000000   EA           MOV     A,R2
   \   000001   2404         ADD     A,#0x4
   \   000003   F5..         MOV     ?V0 + 0,A
   \   000005   EB           MOV     A,R3
   \   000006   3400         ADDC    A,#0x0
   \   000008   F5..         MOV     ?V0 + 1,A
   \   00000A   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine60:
   \   000000   A3           INC     DPTR
   \   000001   E0           MOVX    A,@DPTR
   \   000002   F5..         MOV     ?V0 + 2,A
   \   000004   A3           INC     DPTR
   \   000005   0E           INC     R6
   \   000006   0E           INC     R6
   \   000007   0E           INC     R6
   \   000008   AF83         MOV     R7,DPH
   \   00000A   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine24:
   \   000000   12....       LCALL   ?Subroutine92 & 0xFFFF
   \                     ??CrossCallReturnLabel_193:
   \   000003   E5..         MOV     A,?V0 + 2
   \   000005   F0           MOVX    @DPTR,A
   \   000006   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine50:
   \   000000   12....       LCALL   ?Subroutine99 & 0xFFFF
   \                     ??CrossCallReturnLabel_263:
   \   000003   22           RET
   2548          
   2549          /*********************************************************************
   2550           * @fn          ZDO_ParseMgmtRtgRsp
   2551           *
   2552           * @brief       This function parses the incoming Management
   2553           *              Routing response.
   2554           *
   2555           * @param       inMsg - incoming message
   2556           *
   2557           * @return      a pointer to parsed response structure (NULL if not allocated).
   2558           *          This structure was allocated using osal_mem_alloc, so it must be freed
   2559           *          by the calling function [osal_mem_free()].
   2560           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   2561          ZDO_MgmtRtgRsp_t *ZDO_ParseMgmtRtgRsp( zdoIncomingMsg_t *inMsg )
   \                     ZDO_ParseMgmtRtgRsp:
   2562          {
   \   000000   74F2         MOV     A,#-0xe
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 14
   \   000005                ; Auto size: 0
   2563            ZDO_MgmtRtgRsp_t *pRsp;
   2564            uint8 status;
   2565            uint8 rtgCount = 0;
   \   000005   75..00       MOV     ?V0 + 3,#0x0
   2566            uint8 startIndex = 0;
   \   000008   75..00       MOV     ?V0 + 4,#0x0
   2567            uint8 rtgListCount = 0;
   \   00000B   75..00       MOV     ?V0 + 5,#0x0
   2568            uint8 *msg;
   2569          
   2570            msg = inMsg->asdu;
   \   00000E   12....       LCALL   ??Subroutine43_0 & 0xFFFF
   2571          
   2572            status = *msg++;
   \                     ??CrossCallReturnLabel_89:
   \   000011   F5..         MOV     ?V0 + 2,A
   \   000013   A3           INC     DPTR
   \   000014   AE82         MOV     R6,DPL
   \   000016   AF83         MOV     R7,DPH
   2573            if ( status == ZSuccess )
   \   000018   7011         JNZ     ??ZDO_ParseMgmtRtgRsp_0
   2574            {
   2575              rtgCount = *msg++;
   \   00001A   E0           MOVX    A,@DPTR
   \   00001B   F5..         MOV     ?V0 + 3,A
   \   00001D   A3           INC     DPTR
   2576              startIndex = *msg++;
   \   00001E   E0           MOVX    A,@DPTR
   \   00001F   F5..         MOV     ?V0 + 4,A
   \   000021   A3           INC     DPTR
   2577              rtgListCount = *msg++;
   \   000022   E0           MOVX    A,@DPTR
   \   000023   F5..         MOV     ?V0 + 5,A
   \   000025   A3           INC     DPTR
   \   000026   0E           INC     R6
   \   000027   0E           INC     R6
   \   000028   0E           INC     R6
   \   000029   AF83         MOV     R7,DPH
   2578            }
   2579          
   2580            // Allocate a buffer big enough to handle the list
   2581            pRsp = (ZDO_MgmtRtgRsp_t *)osal_mem_alloc(
   2582                    sizeof( ZDO_MgmtRtgRsp_t ) + (rtgListCount * sizeof( rtgItem_t )) );
   \                     ??ZDO_ParseMgmtRtgRsp_0:
   \   00002B                ; Setup parameters for call to function osal_mem_alloc
   \   00002B   E5..         MOV     A,?V0 + 5
   \   00002D   75F006       MOV     B,#0x6
   \   000030   A4           MUL     AB
   \   000031   F8           MOV     R0,A
   \   000032   A9F0         MOV     R1,B
   \   000034   7404         MOV     A,#0x4
   \   000036   12....       LCALL   ?Subroutine78 & 0xFFFF
   2583            if ( pRsp )
   \                     ??CrossCallReturnLabel_168:
   \   000039   EA           MOV     A,R2
   \   00003A   7001         JNZ     ??ZDO_ParseMgmtRtgRsp_1
   \   00003C   EB           MOV     A,R3
   \                     ??ZDO_ParseMgmtRtgRsp_1:
   \   00003D   604D         JZ      ??ZDO_ParseMgmtRtgRsp_2
   2584            {
   2585              uint8 x;
   2586              rtgItem_t *pList = pRsp->list;
   \   00003F   EA           MOV     A,R2
   \   000040   2404         ADD     A,#0x4
   \   000042   F8           MOV     R0,A
   \   000043   EB           MOV     A,R3
   \   000044   3400         ADDC    A,#0x0
   \   000046   F9           MOV     R1,A
   2587              pRsp->status = status;
   \   000047   8A82         MOV     DPL,R2
   \   000049   8B83         MOV     DPH,R3
   \   00004B   E5..         MOV     A,?V0 + 2
   \   00004D   F0           MOVX    @DPTR,A
   2588              pRsp->rtgCount = rtgCount;
   \   00004E   A3           INC     DPTR
   \   00004F   E5..         MOV     A,?V0 + 3
   \   000051   12....       LCALL   ?Subroutine12 & 0xFFFF
   2589              pRsp->startIndex = startIndex;
   2590              pRsp->rtgListCount = rtgListCount;
   \                     ??CrossCallReturnLabel_23:
   \   000054   E5..         MOV     A,?V0 + 5
   \   000056   F0           MOVX    @DPTR,A
   2591          
   2592              for ( x = 0; x < rtgListCount; x++ )
   \   000057   75..00       MOV     ?V0 + 0,#0x0
   \   00005A   8029         SJMP    ??ZDO_ParseMgmtRtgRsp_3
   2593              {
   2594                pList->dstAddress = BUILD_UINT16( msg[0], msg[1] );
   \                     ??ZDO_ParseMgmtRtgRsp_4:
   \   00005C   8E82         MOV     DPL,R6
   \   00005E   8F83         MOV     DPH,R7
   \   000060   E0           MOVX    A,@DPTR
   \   000061   12....       LCALL   ?Subroutine65 & 0xFFFF
   \                     ??CrossCallReturnLabel_315:
   \   000064   12....       LCALL   ?Subroutine17 & 0xFFFF
   2595                msg += 2;
   2596                pList->status = *msg++;
   \                     ??CrossCallReturnLabel_28:
   \   000067   8E82         MOV     DPL,R6
   \   000069   8F83         MOV     DPH,R7
   \   00006B   E0           MOVX    A,@DPTR
   \   00006C   8882         MOV     DPL,R0
   \   00006E   8983         MOV     DPH,R1
   \   000070   12....       LCALL   ?Subroutine22 & 0xFFFF
   2597                pList->nextHopAddress = BUILD_UINT16( msg[0], msg[1] );
   \                     ??CrossCallReturnLabel_37:
   \   000073   12....       LCALL   ?Subroutine65 & 0xFFFF
   \                     ??CrossCallReturnLabel_316:
   \   000076   A3           INC     DPTR
   \   000077   A3           INC     DPTR
   \   000078   12....       LCALL   ?Subroutine17 & 0xFFFF
   2598                msg += 2;
   2599                pList++;
   \                     ??CrossCallReturnLabel_29:
   \   00007B   E8           MOV     A,R0
   \   00007C   2406         ADD     A,#0x6
   \   00007E   F8           MOV     R0,A
   \   00007F   E9           MOV     A,R1
   \   000080   3400         ADDC    A,#0x0
   \   000082   F9           MOV     R1,A
   2600              }
   \   000083   05..         INC     ?V0 + 0
   \                     ??ZDO_ParseMgmtRtgRsp_3:
   \   000085   E5..         MOV     A,?V0 + 0
   \   000087   C3           CLR     C
   \   000088   95..         SUBB    A,?V0 + 5
   \   00008A   40D0         JC      ??ZDO_ParseMgmtRtgRsp_4
   2601            }
   2602          
   2603            return ( pRsp );
   \                     ??ZDO_ParseMgmtRtgRsp_2:
   \   00008C   02....       LJMP    ?Subroutine133 & 0xFFFF
   2604          }

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine65:
   \   000000   F5..         MOV     ?V0 + 2,A
   \   000002   A3           INC     DPTR
   \   000003   E0           MOVX    A,@DPTR
   \   000004   FD           MOV     R5,A
   \   000005   E5..         MOV     A,?V0 + 2
   \   000007   02....       LJMP    ?Subroutine129 & 0xFFFF

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine17:
   \   000000   F0           MOVX    @DPTR,A
   \   000001   A3           INC     DPTR
   \   000002   ED           MOV     A,R5
   \   000003   12....       LCALL   ??Subroutine86_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_181:
   \   000006   22           RET
   2605          
   2606          /*********************************************************************
   2607           * @fn          ZDO_ParseMgmtBindRsp
   2608           *
   2609           * @brief       This function parses the incoming Management
   2610           *              Binding response.
   2611           *
   2612           * @param       inMsg - pointer to message to parse
   2613           *
   2614           * @return      a pointer to parsed response structure (NULL if not allocated).
   2615           *          This structure was allocated using osal_mem_alloc, so it must be freed
   2616           *          by the calling function [osal_mem_free()].
   2617           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   2618          ZDO_MgmtBindRsp_t *ZDO_ParseMgmtBindRsp( zdoIncomingMsg_t *inMsg )
   \                     ZDO_ParseMgmtBindRsp:
   2619          {
   \   000000   74F0         MOV     A,#-0x10
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 16
   \   000005                ; Auto size: 0
   2620            ZDO_MgmtBindRsp_t *pRsp;
   2621            uint8 status;
   2622            uint8 bindingCount = 0;
   \   000005   75..00       MOV     ?V0 + 4,#0x0
   2623            uint8 startIndex = 0;
   \   000008   75..00       MOV     ?V0 + 3,#0x0
   2624            uint8 bindingListCount = 0;
   \   00000B   75..00       MOV     ?V0 + 2,#0x0
   2625            uint8 *msg;
   2626          
   2627            msg = inMsg->asdu;
   \   00000E   12....       LCALL   ?Subroutine42 & 0xFFFF
   2628          
   2629            status = *msg++;
   2630            if ( status == ZSuccess )
   \                     ??CrossCallReturnLabel_290:
   \   000011   700A         JNZ     ??CrossCallReturnLabel_122
   2631            {
   2632              bindingCount = *msg++;
   \   000013   E0           MOVX    A,@DPTR
   \   000014   F5..         MOV     ?V0 + 4,A
   \   000016   A3           INC     DPTR
   2633              startIndex = *msg++;
   \   000017   E0           MOVX    A,@DPTR
   \   000018   F5..         MOV     ?V0 + 3,A
   \   00001A   12....       LCALL   ?Subroutine60 & 0xFFFF
   2634              bindingListCount = *msg++;
   2635            }
   2636          
   2637            // Allocate a buffer big enough to handle the list
   2638            pRsp = (ZDO_MgmtBindRsp_t *)osal_mem_alloc(
   2639                    (sizeof ( ZDO_MgmtBindRsp_t ) + (bindingListCount * sizeof( apsBindingItem_t ))) );
   \                     ??CrossCallReturnLabel_122:
   \   00001D                ; Setup parameters for call to function osal_mem_alloc
   \   00001D   E5..         MOV     A,?V0 + 2
   \   00001F   75F015       MOV     B,#0x15
   \   000022   12....       LCALL   ?Subroutine77 & 0xFFFF
   2640            if ( pRsp )
   \                     ??CrossCallReturnLabel_166:
   \   000025   7001         JNZ     ??ZDO_ParseMgmtBindRsp_0
   \   000027   EB           MOV     A,R3
   \                     ??ZDO_ParseMgmtBindRsp_0:
   \   000028   6055         JZ      ??ZDO_ParseMgmtBindRsp_1
   2641            {
   2642              uint8 x;
   2643              apsBindingItem_t *pList = pRsp->list;
   \   00002A   12....       LCALL   ?Subroutine79 & 0xFFFF
   2644              pRsp->status = status;
   \                     ??CrossCallReturnLabel_170:
   \   00002D   8A82         MOV     DPL,R2
   \   00002F   8B83         MOV     DPH,R3
   \   000031   E5..         MOV     A,?V0 + 5
   \   000033   F0           MOVX    @DPTR,A
   2645              pRsp->bindingCount = bindingCount;
   \   000034   A3           INC     DPTR
   \   000035   E5..         MOV     A,?V0 + 4
   \   000037   12....       LCALL   ?Subroutine25 & 0xFFFF
   2646              pRsp->startIndex = startIndex;
   \                     ??CrossCallReturnLabel_46:
   \   00003A   E5..         MOV     A,?V0 + 3
   \   00003C   12....       LCALL   ?Subroutine24 & 0xFFFF
   2647              pRsp->bindingListCount = bindingListCount;
   2648          
   2649              for ( x = 0; x < bindingListCount; x++ )
   \                     ??CrossCallReturnLabel_42:
   \   00003F   75..00       MOV     ?V0 + 3,#0x0
   \   000042   8014         SJMP    ??ZDO_ParseMgmtBindRsp_2
   2650              {
   2651                osal_cpyExtAddr( pList->srcAddr, msg );
   2652                msg += Z_EXTADDR_LEN;
   2653                pList->srcEP = *msg++;
   2654          
   2655                // Get the Cluster ID
   2656          
   2657                pList->clusterID = BUILD_UINT16( msg[0], msg[1] );
   2658                msg += 2;
   2659                pList->dstAddr.addrMode = *msg++;
   2660                if ( pList->dstAddr.addrMode == Addr64Bit )
   2661                {
   2662                  osal_cpyExtAddr( pList->dstAddr.addr.extAddr, msg );
   2663                  msg += Z_EXTADDR_LEN;
   2664                  pList->dstEP = *msg++;
   2665                }
   2666                else
   2667                {
   2668                  pList->dstAddr.addr.shortAddr = BUILD_UINT16( msg[0], msg[1] );
   \                     ??ZDO_ParseMgmtBindRsp_3:
   \   000044   12....       LCALL   ?Subroutine38 & 0xFFFF
   \                     ??CrossCallReturnLabel_81:
   \   000047   12....       LCALL   ??Subroutine8_0 & 0xFFFF
   2669                  msg += 2;
   2670                }
   2671          
   2672                pList++;
   \                     ??CrossCallReturnLabel_16:
   \   00004A   E5..         MOV     A,?V0 + 0
   \   00004C   2415         ADD     A,#0x15
   \   00004E   F5..         MOV     ?V0 + 0,A
   \   000050   E5..         MOV     A,?V0 + 1
   \   000052   3400         ADDC    A,#0x0
   \   000054   F5..         MOV     ?V0 + 1,A
   \   000056   05..         INC     ?V0 + 3
   \                     ??ZDO_ParseMgmtBindRsp_2:
   \   000058   E5..         MOV     A,?V0 + 3
   \   00005A   C3           CLR     C
   \   00005B   95..         SUBB    A,?V0 + 2
   \   00005D   5020         JNC     ??ZDO_ParseMgmtBindRsp_1
   \   00005F                ; Setup parameters for call to function osal_cpyExtAddr
   \   00005F   12....       LCALL   ?Subroutine0 & 0xFFFF
   \                     ??CrossCallReturnLabel_1:
   \   000062   70E0         JNZ     ??ZDO_ParseMgmtBindRsp_3
   \   000064                ; Setup parameters for call to function osal_cpyExtAddr
   \   000064   EE           MOV     A,R6
   \   000065   FC           MOV     R4,A
   \   000066   EF           MOV     A,R7
   \   000067   FD           MOV     R5,A
   \   000068   E5..         MOV     A,?V0 + 0
   \   00006A   240B         ADD     A,#0xb
   \   00006C   12....       LCALL   ?Subroutine67 & 0xFFFF
   \                     ??CrossCallReturnLabel_132:
   \   00006F   C0E0         PUSH    A
   \   000071   E5..         MOV     A,?V0 + 0
   \   000073   2414         ADD     A,#0x14
   \   000075   12....       LCALL   ??Subroutine76_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_164:
   \   000078   D0E0         POP     A
   \   00007A   12....       LCALL   ?Subroutine28 & 0xFFFF
   \                     ??CrossCallReturnLabel_58:
   \   00007D   80CB         SJMP    ??CrossCallReturnLabel_16
   2673              }
   2674            }
   2675          
   2676            return ( pRsp );
   \                     ??ZDO_ParseMgmtBindRsp_1:
   \   00007F                REQUIRE ?Subroutine134
   \   00007F                ; // Fall through to label ?Subroutine134
   2677          }
   2678          
   2679          /*********************************************************************
   2680           * @fn          ZDO_ParseUserDescRsp
   2681           *
   2682           * @brief       This function parses the incoming User
   2683           *              Descriptor Response.
   2684           *
   2685           * @param       inMsg - incoming response message
   2686           *
   2687           * @return      a pointer to parsed response structure (NULL if not allocated).
   2688           *          This structure was allocated using osal_mem_alloc, so it must be freed
   2689           *          by the calling function [osal_mem_free()].
   2690           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   2691          ZDO_UserDescRsp_t *ZDO_ParseUserDescRsp( zdoIncomingMsg_t *inMsg )
   \                     ZDO_ParseUserDescRsp:
   2692          {
   \   000000   74F1         MOV     A,#-0xf
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 15
   \   000005                ; Auto size: 0
   2693            ZDO_UserDescRsp_t *pRsp;
   2694            uint8 *msg;
   2695            uint8 descLen = 0;
   \   000005   12....       LCALL   ?Subroutine43 & 0xFFFF
   2696          
   2697            msg = inMsg->asdu;
   2698          
   2699            if ( msg[0] == ZSuccess )
   \                     ??CrossCallReturnLabel_87:
   \   000008   7006         JNZ     ??ZDO_ParseUserDescRsp_0
   2700              descLen = msg[3];
   \   00000A   A3           INC     DPTR
   \   00000B   A3           INC     DPTR
   \   00000C   A3           INC     DPTR
   \   00000D   E0           MOVX    A,@DPTR
   \   00000E   F5..         MOV     ?V0 + 2,A
   2701          
   2702            pRsp = (ZDO_UserDescRsp_t *)osal_mem_alloc( sizeof ( ZDO_UserDescRsp_t ) + descLen );
   \                     ??ZDO_ParseUserDescRsp_0:
   \   000010                ; Setup parameters for call to function osal_mem_alloc
   \   000010   85....       MOV     ?V0 + 0,?V0 + 2
   \   000013   7404         MOV     A,#0x4
   \   000015   25..         ADD     A,?V0 + 0
   \   000017   FA           MOV     R2,A
   \   000018   E4           CLR     A
   \   000019   3400         ADDC    A,#0x0
   \   00001B   FB           MOV     R3,A
   \   00001C   12....       LCALL   ??osal_mem_alloc?relay
   \   00001F   8A..         MOV     ?V0 + 0,R2
   \   000021   8B..         MOV     ?V0 + 1,R3
   2703            if ( pRsp )
   \   000023   EA           MOV     A,R2
   \   000024   7001         JNZ     ??ZDO_ParseUserDescRsp_1
   \   000026   EB           MOV     A,R3
   \                     ??ZDO_ParseUserDescRsp_1:
   \   000027   604B         JZ      ??ZDO_ParseUserDescRsp_2
   2704            {
   2705              pRsp->status = msg[0];
   \   000029   8E82         MOV     DPL,R6
   \   00002B   8F83         MOV     DPH,R7
   \   00002D   E0           MOVX    A,@DPTR
   \   00002E   8A82         MOV     DPL,R2
   \   000030   8B83         MOV     DPH,R3
   \   000032   12....       LCALL   ?Subroutine30 & 0xFFFF
   2706              pRsp->nwkAddr = BUILD_UINT16( msg[1], msg[2] );
   \                     ??CrossCallReturnLabel_61:
   \   000035   8E82         MOV     DPL,R6
   \   000037   8F83         MOV     DPH,R7
   \   000039   A3           INC     DPTR
   \   00003A   A3           INC     DPTR
   \   00003B   E0           MOVX    A,@DPTR
   \   00003C   F8           MOV     R0,A
   \   00003D   E4           CLR     A
   \   00003E   C8           XCH     A,R0
   \   00003F   F9           MOV     R1,A
   \   000040   EA           MOV     A,R2
   \   000041   85..82       MOV     DPL,?V0 + 0
   \   000044   8B83         MOV     DPH,R3
   \   000046   A3           INC     DPTR
   \   000047   12....       LCALL   ?Subroutine128 & 0xFFFF
   2707              pRsp->length = descLen;
   \                     ??CrossCallReturnLabel_303:
   \   00004A   85..82       MOV     DPL,?V0 + 0
   \   00004D   8B83         MOV     DPH,R3
   \   00004F   A3           INC     DPTR
   \   000050   A3           INC     DPTR
   \   000051   A3           INC     DPTR
   \   000052   E5..         MOV     A,?V0 + 2
   \   000054   F0           MOVX    @DPTR,A
   2708              if ( descLen )
   \   000055   601D         JZ      ??ZDO_ParseUserDescRsp_2
   2709                osal_memcpy( pRsp->desc, &msg[4], descLen );
   \   000057                ; Setup parameters for call to function osal_memcpy
   \   000057   EE           MOV     A,R6
   \   000058   2404         ADD     A,#0x4
   \   00005A   F5..         MOV     ?V0 + 4,A
   \   00005C   EF           MOV     A,R7
   \   00005D   3400         ADDC    A,#0x0
   \   00005F   F5..         MOV     ?V0 + 5,A
   \   000061   88..         MOV     ?V0 + 6,R0
   \   000063   78..         MOV     R0,#?V0 + 4
   \   000065   12....       LCALL   ?PUSH_XSTACK_I_THREE
   \   000068   AC..         MOV     R4,?V0 + 2
   \   00006A   7D00         MOV     R5,#0x0
   \   00006C   E5..         MOV     A,?V0 + 0
   \   00006E   12....       LCALL   ?Subroutine74 & 0xFFFF
   \                     ??CrossCallReturnLabel_294:
   \   000071   12....       LCALL   ?DEALLOC_XSTACK8
   2710            }
   2711          
   2712            return ( pRsp );
   \                     ??ZDO_ParseUserDescRsp_2:
   \   000074   AA..         MOV     R2,?V0 + 0
   \   000076   AB..         MOV     R3,?V0 + 1
   \   000078   02....       LJMP    ?Subroutine136 & 0xFFFF
   2713          }

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine30:
   \   000000   12....       LCALL   ??Subroutine89_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_323:
   \   000003   A3           INC     DPTR
   \   000004   E0           MOVX    A,@DPTR
   \   000005   FA           MOV     R2,A
   \   000006   22           RET
   2714          
   2715          /*********************************************************************
   2716           * @fn          ZDO_ParseSimpleDescBuf
   2717           *
   2718           * @brief       Parse a byte sequence representation of a Simple Descriptor.
   2719           *
   2720           * @param       buf  - pointer to a byte array representing a Simple Desc.
   2721           * @param       desc - SimpleDescriptionFormat_t *
   2722           *
   2723           *              This routine allocates storage for the cluster IDs because
   2724           *              they are 16-bit and need to be aligned to be properly processed.
   2725           *              This routine returns non-zero if an allocation fails.
   2726           *
   2727           *              NOTE: This means that the caller or user of the input structure
   2728           *                    is responsible for freeing the memory
   2729           *
   2730           * @return      0: success
   2731           *              1: failure due to malloc failure.
   2732           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   2733          uint8 ZDO_ParseSimpleDescBuf( byte *buf, SimpleDescriptionFormat_t *desc )
   \                     ZDO_ParseSimpleDescBuf:
   2734          {
   \   000000   74F3         MOV     A,#-0xd
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 13
   \   000005                ; Auto size: 0
   \   000005   EA           MOV     A,R2
   \   000006   FE           MOV     R6,A
   \   000007   EB           MOV     A,R3
   \   000008   FF           MOV     R7,A
   \   000009   8C..         MOV     ?V0 + 0,R4
   \   00000B   8D..         MOV     ?V0 + 1,R5
   2735            uint8 num, i;
   2736          
   2737            desc->EndPoint = *buf++;
   \   00000D   8E82         MOV     DPL,R6
   \   00000F   8F83         MOV     DPH,R7
   \   000011   12....       LCALL   ??Subroutine54_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_333:
   \   000014   12....       LCALL   ?Subroutine13 & 0xFFFF
   2738            desc->AppProfId = BUILD_UINT16( buf[0], buf[1] );
   \                     ??CrossCallReturnLabel_25:
   \   000017   8C82         MOV     DPL,R4
   \   000019   8D83         MOV     DPH,R5
   \   00001B   A3           INC     DPTR
   \   00001C   12....       LCALL   ?Subroutine7 & 0xFFFF
   2739            buf += 2;
   2740            desc->AppDeviceId = BUILD_UINT16( buf[0], buf[1] );
   \                     ??CrossCallReturnLabel_13:
   \   00001F   12....       LCALL   ?Subroutine62 & 0xFFFF
   \                     ??CrossCallReturnLabel_288:
   \   000022   A3           INC     DPTR
   \   000023   12....       LCALL   ?Subroutine8 & 0xFFFF
   2741            buf += 2;
   2742            desc->AppDevVer = *buf >> 4;
   2743          
   2744            desc->Reserved = 0;
   \                     ??CrossCallReturnLabel_15:
   \   000026   8E82         MOV     DPL,R6
   \   000028   8F83         MOV     DPH,R7
   \   00002A   E0           MOVX    A,@DPTR
   \   00002B   C4           SWAP    A
   \   00002C   540F         ANL     A,#0xf
   \   00002E   8C82         MOV     DPL,R4
   \   000030   8D83         MOV     DPH,R5
   \   000032   A3           INC     DPTR
   \   000033   A3           INC     DPTR
   \   000034   A3           INC     DPTR
   \   000035   A3           INC     DPTR
   \   000036   A3           INC     DPTR
   \   000037   12....       LCALL   ?Subroutine30 & 0xFFFF
   2745            buf++;
   2746          
   2747            // move in input cluster list (if any). allocate aligned memory.
   2748            num = desc->AppNumInClusters = *buf++;
   \                     ??CrossCallReturnLabel_62:
   \   00003A   A3           INC     DPTR
   \   00003B   0E           INC     R6
   \   00003C   0E           INC     R6
   \   00003D   AF83         MOV     R7,DPH
   \   00003F   8C82         MOV     DPL,R4
   \   000041   8D83         MOV     DPH,R5
   \   000043   A3           INC     DPTR
   \   000044   A3           INC     DPTR
   \   000045   A3           INC     DPTR
   \   000046   A3           INC     DPTR
   \   000047   A3           INC     DPTR
   \   000048   A3           INC     DPTR
   \   000049   F0           MOVX    @DPTR,A
   \   00004A   8A..         MOV     ?V0 + 4,R2
   2749            if ( num )
   \   00004C   6023         JZ      ??ZDO_ParseSimpleDescBuf_0
   2750            {
   2751              if (!(desc->pAppInClusterList = (uint16 *)osal_mem_alloc(num*sizeof(uint16))))
   \   00004E   EC           MOV     A,R4
   \   00004F   2407         ADD     A,#0x7
   \   000051   F5..         MOV     ?V0 + 2,A
   \   000053   ED           MOV     A,R5
   \   000054   12....       LCALL   ?Subroutine19 & 0xFFFF
   \                     ??CrossCallReturnLabel_32:
   \   000057   7002         JNZ     ??ZDO_ParseSimpleDescBuf_1
   \   000059   A3           INC     DPTR
   \   00005A   E0           MOVX    A,@DPTR
   \                     ??ZDO_ParseSimpleDescBuf_1:
   \   00005B   7004         JNZ     ??ZDO_ParseSimpleDescBuf_2
   2752              {
   2753                // malloc failed. we're done.
   2754                return 1;
   \                     ??ZDO_ParseSimpleDescBuf_3:
   \   00005D   7901         MOV     R1,#0x1
   \   00005F   807B         SJMP    ??ZDO_ParseSimpleDescBuf_4
   2755              }
   2756              for (i=0; i<num; ++i)
   \                     ??ZDO_ParseSimpleDescBuf_2:
   \   000061   7A00         MOV     R2,#0x0
   \   000063   8006         SJMP    ??CrossCallReturnLabel_26
   2757              {
   2758                desc->pAppInClusterList[i] = BUILD_UINT16( buf[0], buf[1] );
   \                     ??ZDO_ParseSimpleDescBuf_5:
   \   000065   12....       LCALL   ?Subroutine37 & 0xFFFF
   \                     ??CrossCallReturnLabel_274:
   \   000068   12....       LCALL   ?Subroutine16 & 0xFFFF
   2759                buf += 2;
   2760              }
   \                     ??CrossCallReturnLabel_26:
   \   00006B   EA           MOV     A,R2
   \   00006C   C3           CLR     C
   \   00006D   95..         SUBB    A,?V0 + 4
   \   00006F   40F4         JC      ??ZDO_ParseSimpleDescBuf_5
   2761            }
   2762          
   2763            // move in output cluster list (if any). allocate aligned memory.
   2764            num = desc->AppNumOutClusters = *buf++;
   \                     ??ZDO_ParseSimpleDescBuf_0:
   \   000071   8E82         MOV     DPL,R6
   \   000073   8F83         MOV     DPH,R7
   \   000075   E0           MOVX    A,@DPTR
   \   000076   FA           MOV     R2,A
   \   000077   A3           INC     DPTR
   \   000078   AE82         MOV     R6,DPL
   \   00007A   AF83         MOV     R7,DPH
   \   00007C   85..82       MOV     DPL,?V0 + 0
   \   00007F   85..83       MOV     DPH,?V0 + 1
   \   000082   A3           INC     DPTR
   \   000083   A3           INC     DPTR
   \   000084   A3           INC     DPTR
   \   000085   A3           INC     DPTR
   \   000086   A3           INC     DPTR
   \   000087   A3           INC     DPTR
   \   000088   A3           INC     DPTR
   \   000089   A3           INC     DPTR
   \   00008A   A3           INC     DPTR
   \   00008B   F0           MOVX    @DPTR,A
   \   00008C   8A..         MOV     ?V0 + 4,R2
   2765            if (num)
   \   00008E   604A         JZ      ??ZDO_ParseSimpleDescBuf_6
   2766            {
   2767              if (!(desc->pAppOutClusterList = (uint16 *)osal_mem_alloc(num*sizeof(uint16))))
   \   000090   E5..         MOV     A,?V0 + 0
   \   000092   240A         ADD     A,#0xa
   \   000094   F5..         MOV     ?V0 + 2,A
   \   000096   E5..         MOV     A,?V0 + 1
   \   000098   12....       LCALL   ?Subroutine19 & 0xFFFF
   \                     ??CrossCallReturnLabel_33:
   \   00009B   7002         JNZ     ??ZDO_ParseSimpleDescBuf_7
   \   00009D   A3           INC     DPTR
   \   00009E   E0           MOVX    A,@DPTR
   \                     ??ZDO_ParseSimpleDescBuf_7:
   \   00009F   7026         JNZ     ??ZDO_ParseSimpleDescBuf_8
   2768              {
   2769                // malloc failed. free input cluster list memory if there is any
   2770                if (desc->pAppInClusterList)
   \   0000A1   85..82       MOV     DPL,?V0 + 0
   \   0000A4   85..83       MOV     DPH,?V0 + 1
   \   0000A7   A3           INC     DPTR
   \   0000A8   A3           INC     DPTR
   \   0000A9   A3           INC     DPTR
   \   0000AA   A3           INC     DPTR
   \   0000AB   A3           INC     DPTR
   \   0000AC   A3           INC     DPTR
   \   0000AD   A3           INC     DPTR
   \   0000AE   E0           MOVX    A,@DPTR
   \   0000AF   7002         JNZ     ??ZDO_ParseSimpleDescBuf_9
   \   0000B1   A3           INC     DPTR
   \   0000B2   E0           MOVX    A,@DPTR
   \                     ??ZDO_ParseSimpleDescBuf_9:
   \   0000B3   60A8         JZ      ??ZDO_ParseSimpleDescBuf_3
   2771                {
   2772                  osal_mem_free(desc->pAppInClusterList);
   \   0000B5                ; Setup parameters for call to function osal_mem_free
   \   0000B5   85..82       MOV     DPL,?V0 + 0
   \   0000B8   85..83       MOV     DPH,?V0 + 1
   \   0000BB   A3           INC     DPTR
   \   0000BC   A3           INC     DPTR
   \   0000BD   A3           INC     DPTR
   \   0000BE   A3           INC     DPTR
   \   0000BF   A3           INC     DPTR
   \   0000C0   A3           INC     DPTR
   \   0000C1   A3           INC     DPTR
   \   0000C2   12....       LCALL   ?Subroutine32 & 0xFFFF
   \                     ??CrossCallReturnLabel_69:
   \   0000C5   8096         SJMP    ??ZDO_ParseSimpleDescBuf_3
   2773                }
   2774                return 1;
   2775              }
   2776              for (i=0; i<num; ++i)
   \                     ??ZDO_ParseSimpleDescBuf_8:
   \   0000C7   7A00         MOV     R2,#0x0
   \   0000C9   8009         SJMP    ??CrossCallReturnLabel_27
   2777              {
   2778                desc->pAppOutClusterList[i] = BUILD_UINT16( buf[0], buf[1] );
   \                     ??ZDO_ParseSimpleDescBuf_10:
   \   0000CB   12....       LCALL   ?Subroutine37 & 0xFFFF
   \                     ??CrossCallReturnLabel_275:
   \   0000CE   A3           INC     DPTR
   \   0000CF   A3           INC     DPTR
   \   0000D0   A3           INC     DPTR
   \   0000D1   12....       LCALL   ?Subroutine16 & 0xFFFF
   2779                buf += 2;
   2780              }
   \                     ??CrossCallReturnLabel_27:
   \   0000D4   EA           MOV     A,R2
   \   0000D5   C3           CLR     C
   \   0000D6   95..         SUBB    A,?V0 + 4
   \   0000D8   40F1         JC      ??ZDO_ParseSimpleDescBuf_10
   2781            }
   2782            return 0;
   \                     ??ZDO_ParseSimpleDescBuf_6:
   \   0000DA   7900         MOV     R1,#0x0
   \                     ??ZDO_ParseSimpleDescBuf_4:
   \   0000DC   7F05         MOV     R7,#0x5
   \   0000DE   02....       LJMP    ?BANKED_LEAVE_XDATA
   2783          }

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine37:
   \   000000   8E82         MOV     DPL,R6
   \   000002   8F83         MOV     DPH,R7
   \   000004   E0           MOVX    A,@DPTR
   \   000005   FC           MOV     R4,A
   \   000006   A3           INC     DPTR
   \   000007   E0           MOVX    A,@DPTR
   \   000008   F9           MOV     R1,A
   \   000009   E4           CLR     A
   \   00000A   2C           ADD     A,R4
   \   00000B   E9           MOV     A,R1
   \   00000C   FD           MOV     R5,A
   \   00000D   EA           MOV     A,R2
   \   00000E   33           RLC     A
   \   00000F   F8           MOV     R0,A
   \   000010   E4           CLR     A
   \   000011   33           RLC     A
   \   000012   F9           MOV     R1,A
   \   000013   02....       LJMP    ?Subroutine123 & 0xFFFF

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine19:
   \   000000   3400         ADDC    A,#0x0
   \   000002   F5..         MOV     ?V0 + 3,A
   \   000004                ; Setup parameters for call to function osal_mem_alloc
   \   000004                ; Setup parameters for call to function osal_mem_alloc
   \   000004   EA           MOV     A,R2
   \   000005   C3           CLR     C
   \   000006   33           RLC     A
   \   000007   FA           MOV     R2,A
   \   000008   E4           CLR     A
   \   000009   33           RLC     A
   \   00000A   FB           MOV     R3,A
   \   00000B   12....       LCALL   ??osal_mem_alloc?relay
   \   00000E   85..82       MOV     DPL,?V0 + 2
   \   000011   85..83       MOV     DPH,?V0 + 3
   \   000014   EA           MOV     A,R2
   \   000015   F0           MOVX    @DPTR,A
   \   000016   A3           INC     DPTR
   \   000017   EB           MOV     A,R3
   \   000018   F0           MOVX    @DPTR,A
   \   000019   85..82       MOV     DPL,?V0 + 2
   \   00001C   85..83       MOV     DPH,?V0 + 3
   \   00001F   E0           MOVX    A,@DPTR
   \   000020   22           RET

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   \                     ?Subroutine16:
   \   000000   A3           INC     DPTR
   \   000001   A3           INC     DPTR
   \   000002   A3           INC     DPTR
   \   000003   A3           INC     DPTR
   \   000004   A3           INC     DPTR
   \   000005   A3           INC     DPTR
   \   000006   A3           INC     DPTR
   \   000007   E0           MOVX    A,@DPTR
   \   000008   28           ADD     A,R0
   \   000009   FB           MOV     R3,A
   \   00000A   A3           INC     DPTR
   \   00000B   E0           MOVX    A,@DPTR
   \   00000C   39           ADDC    A,R1
   \   00000D   8B82         MOV     DPL,R3
   \   00000F   F583         MOV     DPH,A
   \   000011   EC           MOV     A,R4
   \   000012   F0           MOVX    @DPTR,A
   \   000013   A3           INC     DPTR
   \   000014   ED           MOV     A,R5
   \   000015   12....       LCALL   ??Subroutine86_0 & 0xFFFF
   \                     ??CrossCallReturnLabel_182:
   \   000018   0A           INC     R2
   \   000019   22           RET
   2784          
   2785          /*********************************************************************
   2786           * @fn          ZDO_ParseDeviceAnnce
   2787           *
   2788           * @brief       Parse a Device Announce message.
   2789           *
   2790           * @param       inMsg - Incoming message
   2791           * @param       pAnnce - place to put the parsed information
   2792           *
   2793           * @return      none
   2794           */

   \                                 In  segment BANKED_CODE, align 1, keep-with-next
   2795          void ZDO_ParseDeviceAnnce( zdoIncomingMsg_t *inMsg, ZDO_DeviceAnnce_t *pAnnce )
   \                     ZDO_ParseDeviceAnnce:
   2796          {
   \   000000   74F6         MOV     A,#-0xa
   \   000002   12....       LCALL   ?BANKED_ENTER_XDATA
   \   000005                ; Saved register size: 10
   \   000005                ; Auto size: 0
   \   000005   8C..         MOV     ?V0 + 0,R4
   \   000007   8D..         MOV     ?V0 + 1,R5
   2797            uint8 *msg;
   2798          
   2799            // Parse incoming message
   2800            msg = inMsg->asdu;
   \   000009   12....       LCALL   ?Subroutine39 & 0xFFFF
   2801            pAnnce->nwkAddr = BUILD_UINT16( msg[0], msg[1] );
   \                     ??CrossCallReturnLabel_328:
   \   00000C   12....       LCALL   ?Subroutine6 & 0xFFFF
   2802            msg += 2;
   2803            osal_cpyExtAddr( pAnnce->extAddr, msg );
   \                     ??CrossCallReturnLabel_11:
   \   00000F   2402         ADD     A,#0x2
   \   000011   12....       LCALL   ?Subroutine68 & 0xFFFF
   2804            msg += Z_EXTADDR_LEN;
   2805            pAnnce->capabilities = *msg;
   \                     ??CrossCallReturnLabel_257:
   \   000014   12....       LCALL   ?Subroutine50 & 0xFFFF
   \                     ??CrossCallReturnLabel_101:
   \   000017   A3           INC     DPTR
   \   000018   A3           INC     DPTR
   \   000019   A3           INC     DPTR
   \   00001A   A3           INC     DPTR
   \   00001B   A3           INC     DPTR
   \   00001C   02....       LJMP    ?Subroutine132 & 0xFFFF
   2806          }

   \                                 In  segment XDATA_I, align 1, keep-with-next
   \                     __Constant_0:
   \   000000                DS 4
   \   000004                REQUIRE `?<Initializer for __Constant_0>`
   \   000004                REQUIRE __INIT_XDATA_I

   \                                 In  segment XDATA_ID, align 1, keep-with-next
   \                     `?<Initializer for __Constant_0>`:
   \   000000   00000000     DD 0

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_Init?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_Init

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_StartDevice?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_StartDevice

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_UpdateNwkStatus?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_UpdateNwkStatus

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_AnyClusterMatches?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_AnyClusterMatches

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ProcessNodeDescReq?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ProcessNodeDescReq

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ProcessPowerDescReq?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ProcessPowerDescReq

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ProcessSimpleDescReq?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ProcessSimpleDescReq

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ProcessActiveEPReq?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ProcessActiveEPReq

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ConvertOTAClusters?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ConvertOTAClusters

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ProcessMatchDescReq?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ProcessMatchDescReq

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ProcessBindUnbindReq?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ProcessBindUnbindReq

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_UpdateAddrManager?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_UpdateAddrManager

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_EndDeviceTimeoutCB?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_EndDeviceTimeoutCB

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??NLME_PermitJoiningTimeout?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    NLME_PermitJoiningTimeout

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_BuildSimpleDescBuf?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_BuildSimpleDescBuf

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ParseEndDeviceBindReq?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ParseEndDeviceBindReq

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ParseBindUnbindReq?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ParseBindUnbindReq

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ParseAddrRsp?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ParseAddrRsp

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ParseNodeDescRsp?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ParseNodeDescRsp

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ParsePowerDescRsp?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ParsePowerDescRsp

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ParseSimpleDescRsp?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ParseSimpleDescRsp

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ParseEPListRsp?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ParseEPListRsp

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ParseServerDiscRsp?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ParseServerDiscRsp

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ParseMgmtLqiRsp?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ParseMgmtLqiRsp

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ParseMgmNwkDiscRsp?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ParseMgmNwkDiscRsp

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ParseMgmtRtgRsp?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ParseMgmtRtgRsp

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ParseMgmtBindRsp?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ParseMgmtBindRsp

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ParseUserDescRsp?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ParseUserDescRsp

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ParseSimpleDescBuf?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ParseSimpleDescBuf

   \                                 In  segment BANK_RELAYS, align 1
   \                     ??ZDO_ParseDeviceAnnce?relay:
   \   000000   12....       LCALL   ?BDISPATCH
   \   000003   ......       DC24    ZDO_ParseDeviceAnnce
   2807          
   2808          /*********************************************************************
   2809          *********************************************************************/
   2810          
   2811          

   Maximum stack usage in bytes:

     Function                       ISTACK PSTACK XSTACK
     --------                       ------ ------ ------
     NLME_PermitJoiningTimeout          0      0      0
     ZDO_AnyClusterMatches              0      0     41
     ZDO_BuildSimpleDescBuf             1      0      9
     ZDO_ConvertOTAClusters             0      0     38
     ZDO_EndDeviceTimeoutCB             0      0      0
     ZDO_Init                           2      0      0
       -> NLME_DeviceJoiningInit        4      0      0
     ZDO_ParseAddrRsp                   1      0     14
       -> osal_mem_alloc                0      0     28
       -> osal_cpyExtAddr               0      0     28
     ZDO_ParseBindUnbindReq             1      0     10
       -> osal_cpyExtAddr               0      0     20
       -> osal_cpyExtAddr               0      0     20
     ZDO_ParseDeviceAnnce               1      0     10
       -> osal_cpyExtAddr               0      0     20
     ZDO_ParseEPListRsp                 1      0     18
       -> osal_mem_alloc                0      0     30
       -> osal_memcpy                   0      0     36
     ZDO_ParseEndDeviceBindReq          1      0     14
       -> osal_cpyExtAddr               0      0     28
       -> osal_mem_alloc                0      0     28
       -> ZDO_ConvertOTAClusters        0      0     28
       -> osal_mem_alloc                0      0     28
       -> ZDO_ConvertOTAClusters        0      0     28
     ZDO_ParseMgmNwkDiscRsp             1      0     16
       -> osal_mem_alloc                0      0     32
       -> osal_cpyExtAddr               0      0     32
     ZDO_ParseMgmtBindRsp               1      0     16
       -> osal_mem_alloc                0      0     32
       -> osal_cpyExtAddr               0      0     32
       -> osal_cpyExtAddr               0      0     32
     ZDO_ParseMgmtLqiRsp                1      0     16
       -> osal_mem_alloc                0      0     32
       -> osal_cpyExtAddr               0      0     32
     ZDO_ParseMgmtRtgRsp                1      0     14
       -> osal_mem_alloc                0      0     28
     ZDO_ParseNodeDescRsp               2      0      9
     ZDO_ParsePowerDescRsp              1      0     10
     ZDO_ParseServerDiscRsp             1      0      9
     ZDO_ParseSimpleDescBuf             1      0     22
       -> osal_mem_alloc                0      0     26
       -> osal_mem_alloc                0      0     26
       -> osal_mem_free                 0      0     26
     ZDO_ParseSimpleDescRsp             1      0      9
       -> ZDO_ParseSimpleDescBuf        0      0     18
     ZDO_ParseUserDescRsp               1      0     18
       -> osal_mem_alloc                0      0     30
       -> osal_memcpy                   0      0     36
     ZDO_ProcessActiveEPReq             0      0     21
       -> NLME_GetShortAddr             0      0     28
       -> afNumEndPoints                0      0     28
       -> afEndPoints                   0      0     28
       -> ZDP_EPRsp                     0      0     42
     ZDO_ProcessBindUnbindReq           1      0     29
       -> osal_cpyExtAddr               0      0     48
       -> NLME_GetExtAddr               0      0     48
       -> osal_ExtAddrEqual             0      0     48
       -> APSME_LookupNwkAddr           0      0     48
       -> ZDP_NwkAddrReq                0      0     48
       -> APSME_BindRequest             0      0     50
       -> ZDApp_NVUpdate                0      0     48
       -> APSME_UnBindRequest           0      0     50
       -> ZDP_SendData                  0      0     58
     ZDO_ProcessMatchDescReq            1      0     34
       -> NLME_IsAddressBroadcast       0      0     54
       -> ZDP_EPRsp                     0      0     68
       -> NLME_IsAddressBroadcast       0      0     54
       -> osal_mem_alloc                0      0     54
       -> ZDO_ConvertOTAClusters        0      0     54
       -> osal_mem_alloc                0      0     54
       -> ZDO_ConvertOTAClusters        0      0     54
       -> osal_msg_send                 0      0     54
       -> osal_mem_free                 0      0     54
       -> ZDO_AnyClusterMatches         0      0     58
       -> ZDO_AnyClusterMatches         0      0     58
       -> osal_msg_allocate             0      0     54
       -> osal_memcpy                   0      0     60
       -> osal_memcpy                   0      0     60
       -> ZDP_EPRsp                     0      0     68
       -> osal_mem_free                 0      0     54
       -> osal_mem_free                 0      0     54
     ZDO_ProcessNodeDescReq             0      0     14
       -> ZDP_NodeDescMsg               0      0     24
       -> ZDP_GenericRsp                0      0     28
     ZDO_ProcessPowerDescReq            0      0     14
       -> ZDP_PowerDescMsg              0      0     24
       -> ZDP_GenericRsp                0      0     28
     ZDO_ProcessSimpleDescReq           0      0     12
       -> afFindSimpleDesc              0      0     24
       -> ZDP_SimpleDescMsg             0      0     24
       -> osal_mem_free                 0      0     24
     ZDO_StartDevice                    1      0     23
       -> NLME_NetworkDiscoveryRequest
                                        0      0     46
       -> nwk_ScanJoiningOrphan         0      0     46
       -> NLME_OrphanJoinRequest        0      0     46
       -> osal_start_timerEx            0      0     46
     ZDO_UpdateAddrManager              3      0     13
       -> AddrMgrExtAddrSet             4      0     26
       -> AddrMgrEntryUpdate            4      0     26
     ZDO_UpdateNwkStatus                1      0     12
       -> NLME_GetShortAddr             0      0     24
       -> NLME_GetExtAddr               0      0     24
       -> osal_msg_allocate             0      0     24
       -> osal_msg_send                 0      0     24


   Segment part sizes:

     Function/Label                 Bytes
     --------------                 -----
     ZDOBuildBuf                      52
     ZDO_Init                          7
     ?Subroutine118                    7
     ZDO_StartDevice                 164
     ?Subroutine18                    15
     ?Subroutine119                    8
     ZDO_UpdateNwkStatus              82
     ?Subroutine26                     6
     ?Subroutine56                     8
     ?Subroutine105                    9
     ?Subroutine36                     4
     ?Subroutine104                   10
     ?Subroutine34                    12
     ?Subroutine130                    5
     ?Subroutine89                     7
     ZDO_AnyClusterMatches            95
     ?Subroutine103                    6
     ZDO_ProcessNodeDescReq           66
     ?Subroutine132                    6
     ?Subroutine35                    22
     ?Subroutine102                    9
     ?Subroutine129                    5
     ?Subroutine31                    30
     ?Subroutine108                    9
     ?Subroutine106                    7
     ?Subroutine121                    7
     ZDO_ProcessPowerDescReq          66
     ZDO_ProcessSimpleDescReq        152
     ?Subroutine44                     8
     ?Subroutine32                     7
     ?Subroutine97                     6
     ZDO_ProcessActiveEPReq          143
     ?Subroutine70                    12
     ?Subroutine58                    14
     ?Subroutine133                    5
     ?Subroutine107                    7
     ZDO_ConvertOTAClusters           62
     ?Subroutine80                     3
     ?Subroutine122                    7
     ZDO_ProcessMatchDescReq        1002
     ?Subroutine66                     7
     ?Subroutine64                     4
     ?Subroutine57                    10
     ?Subroutine55                    13
     ?Subroutine127                    6
     ?Subroutine53                    12
     ?Subroutine51                     5
     ?Subroutine48                    13
     ?Subroutine47                     4
     ?Subroutine96                     7
     ?Subroutine46                     9
     ?Subroutine101                    4
     ?Subroutine115                   11
     ?Subroutine45                     6
     ?Subroutine41                    11
     ?Subroutine33                    17
     ?Subroutine95                     7
     ?Subroutine116                    3
     ?Subroutine124                    6
     ?Subroutine120                    8
     ?Subroutine52                     6
     ?Subroutine59                     4
     ?Subroutine128                    5
     ?Subroutine25                     5
     ?Subroutine93                     7
     ?Subroutine134                    9
     ?Subroutine10                    13
     ZDO_ProcessBindUnbindReq        332
     ?Subroutine69                     9
     ?Subroutine40                    39
     ZDO_UpdateAddrManager            58
     ZDO_EndDeviceTimeoutCB            3
     NLME_PermitJoiningTimeout         3
     ZDO_BuildSimpleDescBuf          136
     ?Subroutine63                     8
     ?Subroutine20                     3
     ?Subroutine125                    6
     ?Subroutine14                     9
     ?Subroutine9                      8
     ?Subroutine90                    15
     ?Subroutine2                     17
     ?Subroutine100                   12
     ?Subroutine111                   10
     ?Subroutine135                    5
     ZDO_ParseEndDeviceBindReq       142
     ?Subroutine73                     9
     ?Subroutine71                    16
     ?Subroutine1                     62
     ?Subroutine76                    12
     ?Subroutine23                     4
     ?Subroutine88                     4
     ?Subroutine113                    5
     ?Subroutine126                    6
     ?Subroutine86                     7
     ?Subroutine114                    5
     ?Subroutine117                   10
     ?Subroutine21                     6
     ?Subroutine67                    11
     ?Subroutine109                   11
     ?Subroutine94                    21
     ?Subroutine83                    10
     ?Subroutine54                     7
     ?Subroutine131                    5
     ?Subroutine110                    9
     ?Subroutine13                     4
     ?Subroutine87                     6
     ?Subroutine7                      4
     ?Subroutine85                    13
     ?Subroutine39                    11
     ?Subroutine6                     10
     ZDO_ParseBindUnbindReq           56
     ?Subroutine38                    13
     ?Subroutine0                     53
     ?Subroutine68                    17
     ?Subroutine99                    10
     ZDO_ParseAddrRsp                193
     ?Subroutine8                      5
     ?Subroutine81                     4
     ?Subroutine82                     6
     ?Subroutine75                     8
     ?Subroutine49                     7
     ?Subroutine123                    7
     ?Subroutine11                     5
     ?Subroutine78                     4
     ?Subroutine112                    9
     ?Subroutine43                    10
     ?Subroutine28                     4
     ZDO_ParseNodeDescRsp            208
     ?Subroutine29                     7
     ?Subroutine91                     7
     ?Subroutine5                      4
     ?Subroutine84                    17
     ?Subroutine4                      6
     ?Subroutine15                     4
     ZDO_ParsePowerDescRsp           121
     ?Subroutine61                    15
     ?Subroutine3                     36
     ZDO_ParseSimpleDescRsp           31
     ZDO_ParseEPListRsp              115
     ?Subroutine136                    5
     ?Subroutine74                    10
     ZDO_ParseServerDiscRsp           46
     ?Subroutine62                     7
     ZDO_ParseMgmtLqiRsp             173
     ?Subroutine72                     4
     ?Subroutine12                    10
     ?Subroutine92                     9
     ?Subroutine77                    15
     ?Subroutine42                     8
     ZDO_ParseMgmNwkDiscRsp          226
     ?Subroutine27                     8
     ?Subroutine22                    10
     ?Subroutine79                    11
     ?Subroutine60                    11
     ?Subroutine24                     7
     ?Subroutine50                     4
     ZDO_ParseMgmtRtgRsp             143
     ?Subroutine65                    10
     ?Subroutine17                     7
     ZDO_ParseMgmtBindRsp            127
     ZDO_ParseUserDescRsp            123
     ?Subroutine30                     7
     ZDO_ParseSimpleDescBuf          225
     ?Subroutine37                    22
     ?Subroutine19                    33
     ?Subroutine16                    26
     ZDO_ParseDeviceAnnce             31
     __Constant_0                      4
     ?<Initializer for __Constant_0>
                                       4
     ??ZDO_Init?relay                  6
     ??ZDO_StartDevice?relay           6
     ??ZDO_UpdateNwkStatus?relay       6
     ??ZDO_AnyClusterMatches?relay     6
     ??ZDO_ProcessNodeDescReq?relay    6
     ??ZDO_ProcessPowerDescReq?relay
                                       6
     ??ZDO_ProcessSimpleDescReq?relay
                                       6
     ??ZDO_ProcessActiveEPReq?relay    6
     ??ZDO_ConvertOTAClusters?relay    6
     ??ZDO_ProcessMatchDescReq?relay
                                       6
     ??ZDO_ProcessBindUnbindReq?relay
                                       6
     ??ZDO_UpdateAddrManager?relay     6
     ??ZDO_EndDeviceTimeoutCB?relay    6
     ??NLME_PermitJoiningTimeout?relay
                                       6
     ??ZDO_BuildSimpleDescBuf?relay    6
     ??ZDO_ParseEndDeviceBindReq?relay
                                       6
     ??ZDO_ParseBindUnbindReq?relay    6
     ??ZDO_ParseAddrRsp?relay          6
     ??ZDO_ParseNodeDescRsp?relay      6
     ??ZDO_ParsePowerDescRsp?relay     6
     ??ZDO_ParseSimpleDescRsp?relay    6
     ??ZDO_ParseEPListRsp?relay        6
     ??ZDO_ParseServerDiscRsp?relay    6
     ??ZDO_ParseMgmtLqiRsp?relay       6
     ??ZDO_ParseMgmNwkDiscRsp?relay    6
     ??ZDO_ParseMgmtRtgRsp?relay       6
     ??ZDO_ParseMgmtBindRsp?relay      6
     ??ZDO_ParseUserDescRsp?relay      6
     ??ZDO_ParseSimpleDescBuf?relay    6
     ??ZDO_ParseDeviceAnnce?relay      6

 
 5 695 bytes in segment BANKED_CODE
   180 bytes in segment BANK_RELAYS
     4 bytes in segment XDATA_I
     4 bytes in segment XDATA_ID
    52 bytes in segment XDATA_Z
 
 5 875 bytes of CODE  memory (+ 4 bytes shared)
    52 bytes of XDATA memory (+ 4 bytes shared)

Errors: none
Warnings: none
