///////////////////////////////////////////////////////////////////////////////
//                                                                            /
// IAR 8051 C/C++ Compiler V7.30B/W32                   12/Sep/2010  21:57:25 /
// 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 33\ZStack-1.4.3-1.2.1\Compon /
//                          ents\osal\mcu\ccsoc\OSAL_Nv.c                     /
//    Command line       =  -f "C:\Texas Instruments                          /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\Tools\CC2430DB\f8wRouter. /
//                          cfg" (-DCPU32MHZ -DFORCE_MAC_NEAR                 /
//                          -DROOT=__near_func -DMAC_CFG_APP_PENDING_QUEUE=TR /
//                          UE -DRTR_NWK -DBLINK_LEDS "-DCONST=const __code"  /
//                          -DGENERIC=__generic) -f "C:\Texas Instruments     /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\Tools\CC2430DB\f8wConfig. /
//                          cfg" (-DSECURE=1 -DDEFAULT_CHANLIST=0x04000000    /
//                          -DZDAPP_CONFIG_PAN_ID=0x00FF                      /
//                          -DNWK_START_DELAY=100 -DEXTENDED_JOINING_RANDOM_M /
//                          ASK=0x007F -DBEACON_REQUEST_DELAY=100             /
//                          -DBEACON_REQ_DELAY_MASK=0x00FF                    /
//                          -DROUTE_EXPIRY_TIME=30 -DAPSC_ACK_WAIT_DURATION_P /
//                          OLLED=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 33\ZStack-1.4.3-1.2.1\Compo /
//                          nents\osal\mcu\ccsoc\OSAL_Nv.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 33\ZStack-1.4.3-1.2.1\Projects\zstack /
//                          \Project\Location\CC2430DB\RefNode\List\" -lA     /
//                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Proje /
//                          cts\zstack\Project\Location\CC2430DB\RefNode\List /
//                          \" --diag_suppress Pe001,Pa010 --diag_remark      /
//                          pe550 -o "C:\Texas Instruments                    /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\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 33\ZStack-1.4.3-1.2.1\Proje /
//                          cts\zstack\Project\Location\CC2430DB\" -I         /
//                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Proje /
//                          cts\zstack\Project\Location\CC2430DB\..\SOURCE\"  /
//                          -I "C:\Texas Instruments                          /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\ZMAIN\TI2430DB\" -I       /
//                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Proje /
//                          cts\zstack\Project\Location\CC2430DB\..\..\..\..\ /
//                          ..\COMPONENTS\MT\" -I "C:\Texas Instruments       /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\HAL\INCL /
//                          UDE\" -I "C:\Texas Instruments                    /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\HAL\TARG /
//                          ET\CC2430BB\" -I "C:\Texas Instruments            /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\OSAL\MCU /
//                          \CCSOC\" -I "C:\Texas Instruments                 /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\OSAL\INC /
//                          LUDE\" -I "C:\Texas Instruments                   /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\AF /
//                          \" -I "C:\Texas Instruments                       /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\NW /
//                          K\" -I "C:\Texas Instruments                      /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\SE /
//                          C\" -I "C:\Texas Instruments                      /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\SY /
//                          S\" -I "C:\Texas Instruments                      /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\ZD /
//                          O\" -I "C:\Texas Instruments                      /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\ZMAC\F8W /
//                          \" -I "C:\Texas Instruments                       /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\ZMAC\"   /
//                          -I "C:\Texas Instruments                          /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\SERVICES /
//                          \SADDR\" -I "C:\Texas Instruments                 /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\SERVICES /
//                          \SDATA\" -I "C:\Texas Instruments                 /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\INCL /
//                          UDE\" -I "C:\Texas Instruments                    /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\HIGH /
//                          _LEVEL\" -I "C:\Texas Instruments                 /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\LOW_ /
//                          LEVEL\SRF03\" -I "C:\Texas Instruments            /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\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 33\ZStack-1.4.3-1.2.1\Projec /
//                          ts\zstack\Project\Location\CC2430DB\RefNode\List\ /
//                          OSAL_Nv.s51                                       /
//                                                                            /
//                                                                            /
///////////////////////////////////////////////////////////////////////////////

        NAME OSAL_Nv

        RTMODEL "__calling_convention", "xdata_reentrant"
        RTMODEL "__code_model", "banked"
        RTMODEL "__core", "plain"
        RTMODEL "__data_model", "large"
        RTMODEL "__dptr_size", "16"
        RTMODEL "__extended_stack", "disabled"
        RTMODEL "__location_for_constants", "data"
        RTMODEL "__number_of_dptrs", "1"
        RTMODEL "__rt_version", "1"

        RSEG DOVERLAY:DATA:NOROOT(0)
        RSEG IOVERLAY:IDATA:NOROOT(0)
        RSEG ISTACK:IDATA:NOROOT(0)
        RSEG PSTACK:XDATA:NOROOT(0)
        RSEG XSTACK:XDATA:NOROOT(0)

        EXTERN ??calcChkF?relay
        EXTERN ??compactPage?relay
        EXTERN ??erasePage?relay
        EXTERN ??findItem?relay
        EXTERN ??initItem?relay
        EXTERN ??initNV?relay
        EXTERN ??initPage?relay
        EXTERN ??setItem?relay
        EXTERN ??setPageUse?relay
        EXTERN ??writeBuf?relay
        EXTERN ??writeItem?relay
        EXTERN ??writeWord?relay
        EXTERN ??writeWordH?relay
        EXTERN ??writeWordM?relay
        EXTERN ??xferBuf?relay
        EXTERN ?ALLOC_XSTACK8
        EXTERN ?BANKED_ENTER_XDATA
        EXTERN ?BANKED_LEAVE_XDATA
        EXTERN ?BDISPATCH
        EXTERN ?BRET
        EXTERN ?DEALLOC_XSTACK8
        EXTERN ?PUSH_XSTACK8_X_TWO
        EXTERN ?PUSH_XSTACK_I_ONE
        EXTERN ?PUSH_XSTACK_I_TWO
        EXTERN ?S_SHL
        EXTERN ?US_SHR
        EXTERN ?V0
        EXTERN ?XSP
        EXTERN ?XSTACK_DISP0_8
        EXTERN __INIT_XDATA_Z

        FUNCTION ??calcChkF?relay,0203H
        FUNCTION ??compactPage?relay,0203H
        FUNCTION ??erasePage?relay,0203H
        FUNCTION ??findItem?relay,0203H
        FUNCTION ??initItem?relay,0203H
        FUNCTION ??initNV?relay,0203H
        FUNCTION ??initPage?relay,0203H
        PUBLIC ??osal_nv_init?relay
        FUNCTION ??osal_nv_init?relay,0203H
        PUBLIC ??osal_nv_item_init?relay
        FUNCTION ??osal_nv_item_init?relay,0203H
        PUBLIC ??osal_nv_item_len?relay
        FUNCTION ??osal_nv_item_len?relay,0203H
        PUBLIC ??osal_nv_read?relay
        FUNCTION ??osal_nv_read?relay,0203H
        PUBLIC ??osal_nv_write?relay
        FUNCTION ??osal_nv_write?relay,0203H
        FUNCTION ??setItem?relay,0203H
        FUNCTION ??setPageUse?relay,0203H
        FUNCTION ??writeBuf?relay,0203H
        FUNCTION ??writeItem?relay,0203H
        FUNCTION ??writeWord?relay,0203H
        FUNCTION ??writeWordH?relay,0203H
        FUNCTION ??writeWordM?relay,0203H
        FUNCTION ??xferBuf?relay,0203H
        PUBWEAK FADDRH
        PUBWEAK FCTL
        PUBWEAK FWT
        PUBWEAK _A_IEN0
        FUNCTION calcChkF,021203H
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 20, STACK
        FUNCTION compactPage,021203H
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME XSTACK, 28, STACK
        FUNCTION erasePage,0a1203H
        ARGFRAME XSTACK, 29, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 18, STACK
        FUNCTION findItem,021203H
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 12, STACK
        PUBLIC flashXdataBuf
        FUNCTION initItem,021203H
        ARGFRAME XSTACK, 32, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME XSTACK, 19, STACK
        FUNCTION initNV,021203H
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 30, STACK
        FUNCTION initPage,021203H
        ARGFRAME XSTACK, 29, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 26, STACK
        PUBLIC osal_nv_init
        FUNCTION osal_nv_init,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME ISTACK, 2, STACK
        PUBLIC osal_nv_item_init
        FUNCTION osal_nv_item_init,021203H
        ARGFRAME XSTACK, 2, STACK
        LOCFRAME XSTACK, 16, STACK
        PUBLIC osal_nv_item_len
        FUNCTION osal_nv_item_len,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 18, STACK
        PUBLIC osal_nv_read
        FUNCTION osal_nv_read,021203H
        ARGFRAME XSTACK, 4, STACK
        LOCFRAME XSTACK, 16, STACK
        PUBLIC osal_nv_write
        FUNCTION osal_nv_write,021203H
        ARGFRAME XSTACK, 4, STACK
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME XSTACK, 34, STACK
        FUNCTION setItem,021203H
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 20, STACK
        FUNCTION setPageUse,021203H
        ARGFRAME XSTACK, 29, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME XSTACK, 8, STACK
        FUNCTION writeBuf,021203H
        ARGFRAME XSTACK, 32, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 1, STACK
        LOCFRAME XSTACK, 21, STACK
        FUNCTION writeItem,021203H
        ARGFRAME XSTACK, 19, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 28, STACK
        FUNCTION writeWord,021203H
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 12, STACK
        FUNCTION writeWordH,021203H
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 1, STACK
        LOCFRAME XSTACK, 13, STACK
        FUNCTION writeWordM,021203H
        ARGFRAME XSTACK, 31, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 14, STACK
        FUNCTION xferBuf,021203H
        ARGFRAME XSTACK, 34, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 21, STACK
        
        CFI Names cfiNames0
        CFI StackFrame CFA_SP SP DATA
        CFI StackFrame CFA_PSP16 PSP16 XDATA
        CFI StackFrame CFA_XSP16 XSP16 XDATA
        CFI StaticOverlayFrame CFA_IOVERLAY IOVERLAY
        CFI StaticOverlayFrame CFA_DOVERLAY DOVERLAY
        CFI Resource `PSW.CY`:1, `B.BR0`:1, `B.BR1`:1, `B.BR2`:1, `B.BR3`:1
        CFI Resource `B.BR4`:1, `B.BR5`:1, `B.BR6`:1, `B.BR7`:1, `VB.BR8`:1
        CFI Resource `VB.BR9`:1, `VB.BR10`:1, `VB.BR11`:1, `VB.BR12`:1
        CFI Resource `VB.BR13`:1, `VB.BR14`:1, `VB.BR15`:1, VB:8, B:8, A:8
        CFI Resource PSW:8, DPL0:8, DPH0:8, R0:8, R1:8, R2:8, R3:8, R4:8, R5:8
        CFI Resource R6:8, R7:8, V0:8, V1:8, V2:8, V3:8, V4:8, V5:8, V6:8, V7:8
        CFI Resource SP:8, PSPH:8, PSPL:8, PSP16:16, XSPH:8, XSPL:8, XSP16:16
        CFI VirtualResource ?RET:24
        CFI Resource ?BRET_EXT:8
        CFI VirtualResource ?RET_HIGH:8, ?RET_LOW:8
        CFI ResourceParts PSP16 PSPH, PSPL
        CFI ResourceParts XSP16 XSPH, XSPL
        CFI ResourceParts ?RET ?BRET_EXT, ?RET_HIGH, ?RET_LOW
        CFI EndNames cfiNames0
        
        CFI Common cfiCommon0 Using cfiNames0
        CFI CodeAlign 1
        CFI DataAlign -1
        CFI ReturnAddress ?RET CODE
        CFI CFA_DOVERLAY Used
        CFI CFA_IOVERLAY Used
        CFI CFA_SP SP+-3
        CFI CFA_PSP16 PSP16+0
        CFI CFA_XSP16 XSP16+0
        CFI `PSW.CY` SameValue
        CFI `B.BR0` SameValue
        CFI `B.BR1` SameValue
        CFI `B.BR2` SameValue
        CFI `B.BR3` SameValue
        CFI `B.BR4` SameValue
        CFI `B.BR5` SameValue
        CFI `B.BR6` SameValue
        CFI `B.BR7` SameValue
        CFI `VB.BR8` SameValue
        CFI `VB.BR9` SameValue
        CFI `VB.BR10` SameValue
        CFI `VB.BR11` SameValue
        CFI `VB.BR12` SameValue
        CFI `VB.BR13` SameValue
        CFI `VB.BR14` SameValue
        CFI `VB.BR15` SameValue
        CFI VB SameValue
        CFI B Undefined
        CFI A Undefined
        CFI PSW SameValue
        CFI DPL0 SameValue
        CFI DPH0 SameValue
        CFI R0 Undefined
        CFI R1 Undefined
        CFI R2 Undefined
        CFI R3 Undefined
        CFI R4 Undefined
        CFI R5 Undefined
        CFI R6 SameValue
        CFI R7 SameValue
        CFI V0 SameValue
        CFI V1 SameValue
        CFI V2 SameValue
        CFI V3 SameValue
        CFI V4 SameValue
        CFI V5 SameValue
        CFI V6 SameValue
        CFI V7 SameValue
        CFI PSPH Undefined
        CFI PSPL Undefined
        CFI XSPH Undefined
        CFI XSPL Undefined
        CFI ?RET Concat
        CFI ?BRET_EXT Frame(CFA_SP, 3)
        CFI ?RET_HIGH Frame(CFA_SP, 2)
        CFI ?RET_LOW Frame(CFA_SP, 1)
        CFI EndCommon cfiCommon0
        
        
        CFI Common cfiCommon1 Using cfiNames0
        CFI CodeAlign 1
        CFI DataAlign -1
        CFI ReturnAddress ?RET CODE
        CFI CFA_DOVERLAY Used
        CFI CFA_IOVERLAY Used
        CFI CFA_SP SP+-2
        CFI CFA_PSP16 PSP16+0
        CFI CFA_XSP16 XSP16+0
        CFI `PSW.CY` SameValue
        CFI `B.BR0` SameValue
        CFI `B.BR1` SameValue
        CFI `B.BR2` SameValue
        CFI `B.BR3` SameValue
        CFI `B.BR4` SameValue
        CFI `B.BR5` SameValue
        CFI `B.BR6` SameValue
        CFI `B.BR7` SameValue
        CFI `VB.BR8` SameValue
        CFI `VB.BR9` SameValue
        CFI `VB.BR10` SameValue
        CFI `VB.BR11` SameValue
        CFI `VB.BR12` SameValue
        CFI `VB.BR13` SameValue
        CFI `VB.BR14` SameValue
        CFI `VB.BR15` SameValue
        CFI VB SameValue
        CFI B SameValue
        CFI A SameValue
        CFI PSW SameValue
        CFI DPL0 SameValue
        CFI DPH0 SameValue
        CFI R0 SameValue
        CFI R1 SameValue
        CFI R2 SameValue
        CFI R3 SameValue
        CFI R4 SameValue
        CFI R5 SameValue
        CFI R6 SameValue
        CFI R7 SameValue
        CFI V0 SameValue
        CFI V1 SameValue
        CFI V2 SameValue
        CFI V3 SameValue
        CFI V4 SameValue
        CFI V5 SameValue
        CFI V6 SameValue
        CFI V7 SameValue
        CFI PSPH Undefined
        CFI PSPL Undefined
        CFI XSPH Undefined
        CFI XSPL Undefined
        CFI ?RET Concat
        CFI ?BRET_EXT SameValue
        CFI ?RET_HIGH Frame(CFA_SP, 2)
        CFI ?RET_LOW Frame(CFA_SP, 1)
        CFI EndCommon cfiCommon1
        
HalAdcCheckVdd      SYMBOL "HalAdcCheckVdd"
??HalAdcCheckVdd?relay SYMBOL "?relay", HalAdcCheckVdd
osal_nv_init        SYMBOL "osal_nv_init"
??osal_nv_init?relay SYMBOL "?relay", osal_nv_init
osal_nv_item_init   SYMBOL "osal_nv_item_init"
??osal_nv_item_init?relay SYMBOL "?relay", osal_nv_item_init
osal_nv_item_len    SYMBOL "osal_nv_item_len"
??osal_nv_item_len?relay SYMBOL "?relay", osal_nv_item_len
osal_nv_read        SYMBOL "osal_nv_read"
??osal_nv_read?relay SYMBOL "?relay", osal_nv_read
osal_nv_write       SYMBOL "osal_nv_write"
??osal_nv_write?relay SYMBOL "?relay", osal_nv_write

        EXTERN nvReadHdr
        FUNCTION nvReadHdr,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN HalAdcCheckVdd
        FUNCTION HalAdcCheckVdd,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 17, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN nvReadWord
        FUNCTION nvReadWord,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 21, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN flashWriteBuf
        FUNCTION flashWriteBuf,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 14, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN nvReadByte
        FUNCTION nvReadByte,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN nvReadBuf
        FUNCTION nvReadBuf,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN ??HalAdcCheckVdd?relay
        FUNCTION ??HalAdcCheckVdd?relay,00H

// C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Components\osal\mcu\ccsoc\OSAL_Nv.c
//    1 /**************************************************************************************************
//    2   Filename:       OSAL_Nv.c
//    3   Revised:        $Date: 2007-10-28 18:43:04 -0700 (Sun, 28 Oct 2007) $
//    4   Revision:       $Revision: 15800 $
//    5 
//    6   Description:    This module contains the OSAL non-volatile memory functions.
//    7 
//    8 
//    9   Copyright 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   Notes:
//   42     - A trick buried deep in initPage() requires that the MSB of the NV Item Id is to
//   43       be reserved for use by this module.
//   44     - Due to .s51 code and code-size saving tricks, the max NV item size is 1024 bytes.
//   45 **************************************************************************************************/
//   46 
//   47 /*********************************************************************
//   48  * INCLUDES
//   49  */
//   50 
//   51 #include "ZComDef.h"
//   52 #include "hal_adc.h"

        ASEGN SFR_AN:DATA:NOROOT,0a8H
// union <unnamed> volatile __sfr _A_IEN0
_A_IEN0:
        DS 1

        ASEGN SFR_AN:DATA:NOROOT,0abH
// unsigned char volatile __sfr FWT
FWT:
        DS 1

        ASEGN SFR_AN:DATA:NOROOT,0adH
// unsigned char volatile __sfr FADDRH
FADDRH:
        DS 1

        ASEGN SFR_AN:DATA:NOROOT,0aeH
// unsigned char volatile __sfr FCTL
FCTL:
        DS 1
//   53 #include "osal.h"
//   54 #include "OSAL_Nv.h"
//   55 #include <ioCC2430.h>
//   56 
//   57 /*********************************************************************
//   58  * CONSTANTS
//   59  */
//   60 
//   61 #define OSAL_NV_ACTIVE          0x00
//   62 #define OSAL_NV_ERASED          0xFF
//   63 #define OSAL_NV_ERASED_ID       0xFFFF
//   64 #define OSAL_NV_ZEROED_ID       0x0000
//   65 // Reserve MSB of Id to signal a search for the "old" source copy (new write interrupted/failed.)
//   66 #define OSAL_NV_SOURCE_ID       0x8000
//   67 
//   68 #define OSAL_NV_PAGE_FREE      (OSAL_NV_PAGE_SIZE - Z_EXTADDR_LEN)
//   69 
//   70 /* The last Flash page will reserve an IEEE addr block at the end of the page where the tools know
//   71  * to program the IEEE.
//   72  */
//   73 #define OSAL_NV_IEEE_OFFSET    (OSAL_NV_PAGE_SIZE - Z_EXTADDR_LEN)
//   74 #define OSAL_NV_IEEE_PAGE       63
//   75 
//   76 // In case pages 0-1 are ever used, define a null page value.
//   77 #define OSAL_NV_PAGE_NULL       0
//   78 
//   79 // In case item Id 0 is ever used, define a null item value.
//   80 #define OSAL_NV_ITEM_NULL       0
//   81 
//   82 #define OSAL_NV_WORD_SIZE       4
//   83 
//   84 #define OSAL_NV_PAGE_HDR_OFFSET 0
//   85 
//   86 /*********************************************************************
//   87  * MACROS
//   88  */
//   89 
//   90 #define  OSAL_NV_CHECK_BUS_VOLTAGE  (HalAdcCheckVdd( HAL_ADC_VDD_LIMIT_4 ))
//   91 
//   92 #define OSAL_NV_DATA_SIZE( LEN )  \ 
//   93    ((((LEN) + OSAL_NV_WORD_SIZE - 1) / OSAL_NV_WORD_SIZE) * OSAL_NV_WORD_SIZE)
//   94 
//   95 #define OSAL_NV_ITEM_SIZE( LEN )  \ 
//   96   (((((LEN) + OSAL_NV_WORD_SIZE - 1) / OSAL_NV_WORD_SIZE) * OSAL_NV_WORD_SIZE) + OSAL_NV_HDR_SIZE)
//   97 
//   98 /*********************************************************************
//   99  * TYPEDEFS
//  100  */
//  101 
//  102 typedef struct
//  103 {
//  104   uint16 id;
//  105   uint16 len;   // Enforce Flash-WORD size on len.
//  106   uint16 chk;   // Byte-wise checksum of the 'len' data bytes of the item.
//  107   uint16 stat;  // Item status.
//  108 } osalNvHdr_t;
//  109 // Struct member offsets.
//  110 #define OSAL_NV_HDR_ID    0
//  111 #define OSAL_NV_HDR_LEN   2
//  112 #define OSAL_NV_HDR_CHK   4
//  113 #define OSAL_NV_HDR_STAT  6
//  114 
//  115 #define OSAL_NV_HDR_ITEM  2  // Length of any item of a header struct.
//  116 #define OSAL_NV_HDR_SIZE  8
//  117 #define OSAL_NV_HDR_HALF (OSAL_NV_HDR_SIZE / 2)
//  118 
//  119 typedef struct
//  120 {
//  121   uint16 active;
//  122   uint16 inUse;
//  123   uint16 xfer;
//  124   uint16 spare;
//  125 } osalNvPgHdr_t;
//  126 // Struct member offsets.
//  127 #define OSAL_NV_PG_ACTIVE 0
//  128 #define OSAL_NV_PG_INUSE  2
//  129 #define OSAL_NV_PG_XFER   4
//  130 #define OSAL_NV_PG_SPARE  6
//  131 
//  132 #define OSAL_NV_PAGE_HDR_SIZE  8
//  133 #define OSAL_NV_PAGE_HDR_HALF (OSAL_NV_PAGE_HDR_SIZE / 2)
//  134 
//  135 typedef enum
//  136 {
//  137   eNvXfer,
//  138   eNvZero
//  139 } eNvHdrEnum;
//  140 
//  141 typedef enum
//  142 {
//  143   ePgActive,
//  144   ePgInUse,
//  145   ePgXfer,
//  146   ePgSpare
//  147 } ePgHdrEnum;
//  148 
//  149 /*********************************************************************
//  150  * GLOBAL VARIABLES
//  151  */
//  152 
//  153 /* This can be placed in the non-retention RAM - the assembly routine is copied from Flash to XDATA
//  154  * on every call. If enough retention RAM is available, or if on a mains-powered device, could
//  155  * easily change to copy Flash to XDATA only on initialization.
//  156  */

        RSEG XDATA_Z:XDATA:NOROOT(0)
//  157 uint8 __xdata flashXdataBuf[22];
flashXdataBuf:
        DS 22
        REQUIRE __INIT_XDATA_Z
//  158 
//  159 /*********************************************************************
//  160  * EXTERNAL FUNCTIONS
//  161  */
//  162 
//  163 /*********************************************************************
//  164  * @fn      nvRead...
//  165  *
//  166  * @brief   Reads a byte, OSAL_NV_WORD_SIZE, or OSAL_NV_HDR_SIZE bytes from NV.
//  167  *
//  168  * @param   pg - Valid NV page.
//  169  * @param   offset - Valid offset into the page.
//  170  * @param   buf - Valid buffer space at least as big as the read request.
//  171  *
//  172  * @return  none
//  173  */
//  174 extern __near_func void nvReadByte( uint8 pg, uint16 offset, uint8 *buf );
//  175 extern __near_func void nvReadWord( uint8 pg, uint16 offset, uint8 *buf );
//  176 extern __near_func void nvReadHdr(uint8 pg, uint16 offset, uint8 *buf);
//  177 
//  178 /*********************************************************************
//  179  * @fn      nvReadBuf
//  180  *
//  181  * @brief   Reads N bytes from NV.
//  182  *
//  183  * @param   pg - Valid NV page.
//  184  * @param   offset - Valid offset into the page.
//  185  * @param   buf - Valid buffer space at least as big as the read request.
//  186  * @param   cnt - Number of bytes to read.
//  187  *
//  188  * @return  none
//  189  */
//  190 extern __near_func void nvReadBuf(uint8 pg, uint16 offset, uint8 *buf, uint16 cnt);
//  191 
//  192 /*********************************************************************
//  193  * @fn      flashWriteBuf
//  194  *
//  195  * @brief   Writes N blocks of 4-bytes to NV.
//  196  *
//  197  * @param   cnt - Number of blocks of 4-bytes to write.
//  198  * @param   buf - Valid buffer space at least as big as the write request.
//  199  * @param   addr - Valid FADDRH/L address: 3-byte addr / 4 = 2-byte addr.
//  200  *
//  201  * @return  none
//  202  */
//  203 extern __near_func void flashWriteBuf(uint8 cnt, uint16 buf, uint16 addr);
//  204 
//  205 extern bool HalAdcCheckVdd(uint8 limit);
//  206 
//  207 /*********************************************************************
//  208  * LOCAL VARIABLES
//  209  */
//  210 
//  211 // Offset into the page of the first available erased space.

        RSEG XDATA_Z:XDATA:NOROOT(0)
//  212 static uint16 pgOff[OSAL_NV_PAGES_USED];
pgOff:
        DS 4
        REQUIRE __INIT_XDATA_Z
//  213 
//  214 // Count of the bytes lost for the zeroed-out items.

        RSEG XDATA_Z:XDATA:NOROOT(0)
//  215 static uint16 pgLost[OSAL_NV_PAGES_USED];
pgLost:
        DS 4
        REQUIRE __INIT_XDATA_Z
//  216 

        RSEG XDATA_Z:XDATA:NOROOT(0)
//  217 static uint8 pgRes;  // Page reserved for item compacting transfer.
pgRes:
        DS 1
        REQUIRE __INIT_XDATA_Z
//  218 
//  219 // Saving ~100 code bytes to move a uint8* parameter/return value from findItem() to a global.

        RSEG XDATA_Z:XDATA:NOROOT(0)
//  220 static uint8 findPg;
findPg:
        DS 1
        REQUIRE __INIT_XDATA_Z
//  221 
//  222 /* Immediately before the voltage critical operations of a page erase or
//  223  * a word write, check bus voltage. If less than min, set global flag & abort.
//  224  * Since this is to be done at the lowest level, many void functions would have to be changed to
//  225  * return a value and code added to check that value before proceeding, resulting in a very
//  226  * expensive code size hit for implementing this properly. Therefore, use this global as follows:
//  227  * at the start of osal_nv_item_init/osal_nv_write, set to FALSE, and at the end, before returning,
//  228  * check the value. Thus, the global is an accumulator of any error that occurred in any of the
//  229  * attempts to modify Flash with a low bus voltage during the complicated sequence of events that
//  230  * may occur on any item init or write. This is much more expedient and code saving than adding
//  231  * return values and checking return values to early out. No matter which method is used, an NV
//  232  * data record may end up mangled due to the low VCC conditions. The strategy is that the headers
//  233  * and checksums will detect and allow recovery from such a condition.
//  234  *
//  235  * One unfortunate side-effect of using the global fail flag vice adding and checking return
//  236  * values, is that when setting an item Id to zero has failed due to the low VCC check,
//  237  * the page lost-bytes counter is still updated. Having an artificially high lost-byte
//  238  * count makes it look like there are more bytes to recover from compacting a page than there may
//  239  * actually be. The easy work-around implemented is it to invoke initNV() from osal_nv_item_init or
//  240  * osal_nv_write anytime that the failF gets set - this will re-walk all of the pages and set the
//  241  * page offset count and page lost bytes count to their actual values.
//  242  */

        RSEG XDATA_Z:XDATA:NOROOT(0)
//  243 static uint8 failF;
failF:
        DS 1
        REQUIRE __INIT_XDATA_Z
//  244 
//  245 /*********************************************************************
//  246  * LOCAL FUNCTIONS
//  247  */
//  248 
//  249 static uint8  initNV( void );
//  250 
//  251 static void   setPageUse( uint8 pg, uint8 inUse );
//  252 static uint16 initPage( uint8 pg, uint16 id, uint8 findDups );
//  253 static void   erasePage( uint8 pg );
//  254 static void   compactPage( uint8 pg );
//  255 
//  256 static uint16 findItem( uint16 id );
//  257 static uint8  initItem( uint8 flag, uint16 id, uint16 len, void *buf );
//  258 static void   setItem( uint8 pg, uint16 offset, eNvHdrEnum stat );
//  259 
//  260 static uint16 calcChkB( uint16 len, uint8 *buf );
//  261 static uint16 calcChkF( byte pg, uint16 offset, uint16 len );
//  262 
//  263 static void   writeWord( uint8 pg, uint16 offset, uint8 *buf );
//  264 static void   writeWordH( uint8 pg, uint16 offset, uint8 *buf );
//  265 static void   writeWordM( uint8 pg, uint16 offset, uint8 *buf, uint8 cnt );
//  266 static void   writeBuf( uint8 pg, uint16 offset, uint16 len, uint8 *buf );
//  267 static void   xferBuf( uint8 srcPg, uint16 srcOff, uint8 dstPg, uint16 dstOff, uint16 len );
//  268 
//  269 static uint8  writeItem( uint8 pg, uint16 id, uint16 len, void *buf, uint8 flag );
//  270 
//  271 static uint8  writeIEEE( void *buf );
//  272 
//  273 /*********************************************************************
//  274  * @fn      initNV
//  275  *
//  276  * @brief   Initialize the NV flash pages.
//  277  *
//  278  * @param   none
//  279  *
//  280  * @return  TRUE
//  281  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  282 static uint8 initNV( void )
initNV:
        CFI Block cfiBlock0 Using cfiCommon0
        CFI Function initNV
//  283 {
        FUNCALL initNV, nvReadHdr
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 29, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 29, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL initNV, nvReadHdr
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 29, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 29, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL initNV, setPageUse
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 29, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 29, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL initNV, initPage
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 29, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 29, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL initNV, nvReadHdr
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 29, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 29, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL initNV, writeWordM
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 30, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL initNV, writeWordM
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 30, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL initNV, setPageUse
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 29, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 29, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL initNV, compactPage
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 29, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 29, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL initNV, erasePage
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 29, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 29, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL initNV, initNV
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 29, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 29, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xd
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 13)
        ; Saved register size: 13
        ; Auto size: 16
        MOV     A,#-0x10
        LCALL   ?ALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 29)
//  284   osalNvPgHdr_t pgHdr, ieee;
//  285   uint8 oldPg = OSAL_NV_PAGE_NULL;
        MOV     ?V0 + 0,#0x0
//  286   uint8 newPg = OSAL_NV_PAGE_NULL;
        MOV     R7,#0x0
//  287   uint8 findDups = FALSE;
        MOV     ?V0 + 4,R7
//  288   uint8 xBad;
//  289   uint8 pg;
//  290 
//  291   nvReadHdr( OSAL_NV_IEEE_PAGE, OSAL_NV_IEEE_OFFSET, (uint8 *)(&ieee) );
        ; Setup parameters for call to function nvReadHdr
        MOV     A,#0x8
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine0 & 0xFFFF
//  292   if ( (ieee.active == OSAL_NV_ERASED_ID) &&
//  293        (ieee.inUse == OSAL_NV_ERASED_ID) &&
//  294        (ieee.xfer == OSAL_NV_ERASED_ID) &&
//  295        (ieee.spare == OSAL_NV_ERASED_ID) )
??CrossCallReturnLabel_0:
        JNZ     ??initNV_0
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??initNV_0:
        JNZ     ??initNV_1
        MOV     A,#0xa
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,#0xff
        JNZ     ??initNV_2
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??initNV_2:
        JNZ     ??initNV_1
        MOV     A,#0xc
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,#0xff
        JNZ     ??initNV_3
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??initNV_3:
        JNZ     ??initNV_1
        MOV     A,#0xe
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,#0xff
        JNZ     ??initNV_4
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??initNV_4:
        JNZ     ??initNV_1
//  296   {
//  297     xBad = TRUE;
        MOV     ?V0 + 1,#0x1
        SJMP    ??initNV_5
//  298   }
//  299   else
//  300   {
//  301     xBad = FALSE;
??initNV_1:
        MOV     ?V0 + 1,R7
//  302   }
//  303 
//  304   pgRes = OSAL_NV_PAGE_NULL;
??initNV_5:
        CLR     A
        MOV     DPTR,#pgRes
        MOVX    @DPTR,A
//  305 
//  306   for ( pg = OSAL_NV_PAGE_BEG; pg <= OSAL_NV_PAGE_END; pg++ )
        MOV     R6,#0x3c
//  307   {
//  308     nvReadHdr( pg, OSAL_NV_PAGE_HDR_OFFSET, (uint8 *)(&pgHdr) );
??initNV_6:
        ; Setup parameters for call to function nvReadHdr
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     R2,#0x0
        MOV     R3,#0x0
        MOV     A,R6
        MOV     R1,A
        LCALL   ??Subroutine0_0 & 0xFFFF
//  309 
//  310     if ( pgHdr.active == OSAL_NV_ERASED_ID )
??CrossCallReturnLabel_2:
        JNZ     ??initNV_7
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??initNV_7:
        JNZ     ??initNV_8
//  311     {
//  312       if ( pgRes == OSAL_NV_PAGE_NULL )
        MOV     DPTR,#pgRes
        MOVX    A,@DPTR
        JNZ     ??initNV_9
//  313       {
//  314         pgRes = pg;
        MOV     A,R6
        MOVX    @DPTR,A
        SJMP    ??initNV_10
//  315       }
//  316       else
//  317       {
//  318         setPageUse( pg, TRUE );
??initNV_9:
        ; Setup parameters for call to function setPageUse
        MOV     R2,#0x1
        MOV     A,R6
        MOV     R1,A
        LCALL   ??setPageUse?relay
        SJMP    ??initNV_10
//  319       }
//  320     }
//  321     else  // Page is active.
//  322     {
//  323       // If the page is not yet in use, it is the tgt of items from an xfer.
//  324       if ( pgHdr.inUse == OSAL_NV_ERASED_ID )
??initNV_8:
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,#0xff
        JNZ     ??initNV_11
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??initNV_11:
        JNZ     ??initNV_12
//  325       {
//  326         newPg = pg;
        MOV     A,R6
        MOV     R7,A
        SJMP    ??initNV_10
//  327       }
//  328       // An Xfer from this page was in progress.
//  329       else if ( pgHdr.xfer != OSAL_NV_ERASED_ID )
??initNV_12:
        MOV     A,#0x4
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,#0xff
        JNZ     ??initNV_13
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??initNV_13:
        JZ      ??initNV_10
//  330       {
//  331         oldPg = pg;
        MOV     ?V0 + 0,R6
//  332       }
//  333     }
//  334 
//  335     // Calculate page offset and lost bytes - any "old" item triggers an N^2 re-scan from start.
//  336     if ( initPage( pg, OSAL_NV_ITEM_NULL, findDups ) != OSAL_NV_ITEM_NULL )
??initNV_10:
        ; Setup parameters for call to function initPage
        MOV     R4,?V0 + 4
        MOV     R2,#0x0
        MOV     R3,#0x0
        MOV     A,R6
        MOV     R1,A
        LCALL   ??initPage?relay
        MOV     A,R2
        JNZ     ??initNV_14
        MOV     A,R3
??initNV_14:
        JZ      ??initNV_15
//  337     {
//  338       findDups = TRUE;
        MOV     ?V0 + 4,#0x1
//  339       pg = OSAL_NV_PAGE_BEG-1;
        MOV     R6,#0x3b
//  340       continue;
        LJMP    ??initNV_16 & 0xFFFF
//  341     }
//  342 
//  343     nvReadHdr( pg, OSAL_NV_IEEE_OFFSET, (uint8 *)(&pgHdr) );
??initNV_15:
        ; Setup parameters for call to function nvReadHdr
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     R2,#-0x8
        MOV     R3,#0x7
        MOV     A,R6
        MOV     R1,A
        LCALL   nvReadHdr & 0xFFFF
//  344     if ( xBad )
        MOV     A,?V0 + 1
        JZ      ??initNV_17
//  345     {
//  346       /* TBD - For the cost of more code space, the IEEE could be checksummed & then tested here
//  347        * before installing to the erased IEEE on page 63.
//  348        */
//  349       if ( (pgHdr.active != OSAL_NV_ERASED_ID) ||
//  350            (pgHdr.inUse != OSAL_NV_ERASED_ID) ||
//  351            (pgHdr.xfer != OSAL_NV_ERASED_ID) ||
//  352            (pgHdr.spare != OSAL_NV_ERASED_ID) )
        MOVX    A,@DPTR
        XRL     A,#0xff
        JNZ     ??initNV_18
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??initNV_18:
        JNZ     ??initNV_19
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,#0xff
        JNZ     ??initNV_20
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??initNV_20:
        JNZ     ??initNV_19
        MOV     A,#0x4
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,#0xff
        JNZ     ??initNV_21
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??initNV_21:
        JNZ     ??initNV_19
        MOV     A,#0x6
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,#0xff
        JNZ     ??initNV_22
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??initNV_22:
        JZ      ??initNV_16
//  353       {
//  354         writeWordM( OSAL_NV_IEEE_PAGE, OSAL_NV_IEEE_OFFSET, (uint8 *)(&pgHdr), 2 );
??initNV_19:
        ; Setup parameters for call to function writeWordM
        MOV     ?V0 + 1,#0x2
        MOV     R0,#?V0 + 1
        LCALL   ?PUSH_XSTACK_I_ONE
        CFI CFA_XSP16 add(XSP16, 30)
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     R2,#-0x8
        MOV     R3,#0x7
        MOV     R1,#0x3f
        LCALL   ??Subroutine20_0 & 0xFFFF
??CrossCallReturnLabel_64:
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 29)
//  355         xBad = FALSE;
        MOV     ?V0 + 1,#0x0
        SJMP    ??initNV_16
//  356       }
//  357     }
//  358     else
//  359     {
//  360       writeWordM( pg, OSAL_NV_IEEE_OFFSET, (uint8 *)(&ieee), 2 );
??initNV_17:
        ; Setup parameters for call to function writeWordM
        MOV     ?V0 + 2,#0x2
        MOV     R0,#?V0 + 2
        LCALL   ?PUSH_XSTACK_I_ONE
        CFI CFA_XSP16 add(XSP16, 30)
        MOV     A,#0x9
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine20 & 0xFFFF
??CrossCallReturnLabel_62:
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 29)
//  361     }
//  362   }  // for ( pg = OSAL_NV_PAGE_BEG; pg <= OSAL_NV_PAGE_END; pg++ )
??initNV_16:
        INC     R6
        MOV     A,R6
        CLR     C
        SUBB    A,#0x3e
        JNC     $+5
        LJMP    ??initNV_6 & 0xFFFF
//  363 
//  364   /* First the old page is erased, and then the new page is put into use.
//  365    * So if a transfer was in progress, the new page will always not yet be
//  366    * marked as in use, since that is the last step to ending a transfer.
//  367    */
//  368   if ( newPg != OSAL_NV_PAGE_NULL )
        MOV     A,R7
        JZ      ??initNV_23
//  369   {
//  370     /* If there is already a fallow page reserved, keep it and put the newPg in use.
//  371      * An unfinished compaction will finish to the new reserve page and the old page
//  372      * will be erased and reserved.
//  373      */
//  374     if ( pgRes != OSAL_NV_PAGE_NULL )
        MOV     DPTR,#pgRes
        MOVX    A,@DPTR
        JZ      ??initNV_24
//  375     {
//  376       setPageUse( newPg, TRUE );
        ; Setup parameters for call to function setPageUse
        MOV     R2,#0x1
        MOV     A,R7
        MOV     R1,A
        LCALL   ??setPageUse?relay
//  377     }
//  378     /* If setting old page to 'xfer' failed or board reset before it was effected, there is no way
//  379      * to know which page was the 'old page' - so just reset all NV pages to start clean.
//  380      */
//  381     else if ( oldPg != OSAL_NV_PAGE_NULL )
//  382     {
//  383       pgRes = newPg;
//  384     }
//  385 
//  386     /* If a page compaction was interrupted and the page being compacted is not
//  387      * yet erased, then there may be items remaining to xfer before erasing.
//  388      */
//  389     if ( oldPg != OSAL_NV_PAGE_NULL )
??initNV_25:
        MOV     A,?V0 + 0
        JZ      ??initNV_23
//  390     {
//  391       compactPage( oldPg );
??initNV_26:
        ; Setup parameters for call to function compactPage
        MOV     R1,?V0 + 0
        LCALL   ??compactPage?relay
//  392     }
//  393   }
//  394 
//  395   /* If no page met the criteria to be the reserve page:
//  396    *  - A compactPage() failed or board reset before doing so.
//  397    *  - Perhaps the user changed which Flash pages are dedicated to NV and downloaded the code
//  398    *    without erasing Flash?
//  399    */
//  400   if ( pgRes == OSAL_NV_PAGE_NULL )
??initNV_23:
        MOV     DPTR,#pgRes
        MOVX    A,@DPTR
        JNZ     ??initNV_27
//  401   {
//  402     for ( pg = OSAL_NV_PAGE_BEG; pg <= OSAL_NV_PAGE_END; pg++ )
        MOV     R6,#0x3c
//  403     {
//  404       erasePage( pg );
??initNV_28:
        ; Setup parameters for call to function erasePage
        MOV     A,R6
        MOV     R1,A
        LCALL   ??erasePage?relay
//  405     }
        INC     R6
        MOV     A,R6
        CLR     C
        SUBB    A,#0x3e
        JC      ??initNV_28
//  406     initNV();
        ; Setup parameters for call to function initNV
        LCALL   ??initNV?relay
//  407   }
//  408 
//  409   return TRUE;
??initNV_27:
        MOV     R1,#0x1
        MOV     A,#0x10
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 13)
        MOV     R7,#0x5
        LJMP    ?BANKED_LEAVE_XDATA
        CFI CFA_XSP16 add(XSP16, 29)
??initNV_24:
        MOV     A,?V0 + 0
        JZ      ??initNV_25
        MOV     A,R7
        MOVX    @DPTR,A
        SJMP    ??initNV_26
        CFI EndBlock cfiBlock0
//  410 }
//  411 
//  412 /*********************************************************************
//  413  * @fn      setPageUse
//  414  *
//  415  * @brief   Set page header active/inUse state according to 'inUse'.
//  416  *
//  417  * @param   pg - Valid NV page to verify and init.
//  418  * @param   inUse - Boolean TRUE if inUse, FALSE if only active.
//  419  *
//  420  * @return  none
//  421  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  422 static void setPageUse( uint8 pg, uint8 inUse )
setPageUse:
        CFI Block cfiBlock1 Using cfiCommon0
        CFI Function setPageUse
//  423 {
        FUNCALL setPageUse, writeWord
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 8, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 8, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        PUSH    DPL
        CFI DPL0 Frame(CFA_SP, 4)
        CFI CFA_SP SP+-4
        PUSH    DPH
        CFI DPH0 Frame(CFA_SP, 5)
        CFI CFA_SP SP+-5
        ; Saved register size: 2
        ; Auto size: 8
        MOV     A,#-0x8
        LCALL   ?ALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 8)
//  424   osalNvPgHdr_t pgHdr;
//  425 
//  426   pgHdr.active = OSAL_NV_ZEROED_ID;
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        CLR     A
        MOVX    @DPTR,A
        INC     DPTR
        MOVX    @DPTR,A
//  427 
//  428   if ( inUse )
        MOV     A,R2
        JZ      ??setPageUse_0
//  429   {
//  430     pgHdr.inUse = OSAL_NV_ZEROED_ID;
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        CLR     A
        SJMP    ??setPageUse_1
//  431   }
//  432   else
//  433   {
//  434     pgHdr.inUse = OSAL_NV_ERASED_ID;
??setPageUse_0:
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOV     A,#-0x1
??setPageUse_1:
        LCALL   ??Subroutine17_1 & 0xFFFF
//  435   }
//  436 
//  437   writeWord( pg, OSAL_NV_PAGE_HDR_OFFSET, (uint8*)(&pgHdr) );
??CrossCallReturnLabel_56:
        MOV     R2,#0x0
        MOV     R3,#0x0
        LCALL   ??writeWord?relay
//  438 }
        MOV     A,#0x8
        LCALL   ?DEALLOC_XSTACK8
        CFI EndBlock cfiBlock1
        REQUIRE ?Subroutine37
        ; // Fall through to label ?Subroutine37

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine37:
        CFI Block cfiBlock2 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+-5
        CFI DPL0 Frame(CFA_SP, 4)
        CFI DPH0 Frame(CFA_SP, 5)
        POP     DPH
        CFI CFA_SP SP+-4
        CFI DPH0 SameValue
        POP     DPL
        CFI CFA_SP SP+-3
        CFI DPL0 SameValue
        LJMP    ?BRET
        CFI EndBlock cfiBlock2
//  439 
//  440 /*********************************************************************
//  441  * @fn      initPage
//  442  *
//  443  * @brief   Walk the page items; calculate checksums, lost bytes & page offset.
//  444  *
//  445  * @param   pg - Valid NV page to verify and init.
//  446  * @param   id - Valid NV item Id to use function as a "findItem".
//  447  *               If set to NULL then just perform the page initialization.
//  448  *
//  449  * @return  If 'id' is non-NULL and good checksums are found, return the offset
//  450  *          of the data corresponding to item Id; else OSAL_NV_ITEM_NULL.
//  451  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  452 static uint16 initPage( uint8 pg, uint16 id, uint8 findDups )
initPage:
        CFI Block cfiBlock3 Using cfiCommon0
        CFI Function initPage
//  453 {
        FUNCALL initPage, setItem
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 26, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL initPage, nvReadHdr
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 26, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL initPage, calcChkF
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 26, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL initPage, findItem
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 26, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL initPage, setItem
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 26, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x10
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        ; Saved register size: 16
        ; Auto size: 10
        MOV     A,#-0xa
        LCALL   ?ALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 26)
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     A,R2
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R3
        MOVX    @DPTR,A
        MOV     ?V0 + 6,R1
        MOV     ?V0 + 7,R4
//  454   uint16 offset = OSAL_NV_PAGE_HDR_SIZE;
        MOV     ?V0 + 2,#0x8
        MOV     ?V0 + 3,#0x0
//  455   uint16 sz, lost = 0;
        MOV     R6,#0x0
        MOV     R7,#0x0
        SJMP    ??initPage_0
//  456   osalNvHdr_t hdr;
//  457 
//  458   do
//  459   {
//  460     nvReadHdr( pg, offset, (uint8 *)(&hdr) );
//  461 
//  462     if ( hdr.id == OSAL_NV_ERASED_ID )
//  463     {
//  464       break;
//  465     }
//  466     offset += OSAL_NV_HDR_SIZE;
//  467     sz = OSAL_NV_DATA_SIZE( hdr.len );
//  468 
//  469     // A bad 'len' write has blown away the rest of the page.
//  470     if ( (offset + sz) > OSAL_NV_PAGE_FREE )
//  471     {
//  472       lost += (OSAL_NV_PAGE_FREE - offset + OSAL_NV_HDR_SIZE);
//  473       offset = OSAL_NV_PAGE_FREE;
//  474       break;
//  475     }
//  476 
//  477     if ( hdr.id != OSAL_NV_ZEROED_ID )
//  478     {
//  479       /* This trick allows function to do double duty for findItem() without
//  480        * compromising its essential functionality at powerup initialization.
//  481        */
//  482       if ( id != OSAL_NV_ITEM_NULL )
//  483       {
//  484         /* This trick allows asking to find the old/transferred item in case
//  485          * of a successful new item write that gets interrupted before the
//  486          * old item can be zeroed out.
//  487          */
//  488         if ( (id & 0x7fff) == hdr.id )
//  489         {
//  490           if ( (((id & OSAL_NV_SOURCE_ID) == 0) && (hdr.stat == OSAL_NV_ERASED_ID)) ||
//  491                (((id & OSAL_NV_SOURCE_ID) != 0) && (hdr.stat != OSAL_NV_ERASED_ID)) )
//  492           {
//  493             return offset;
//  494           }
//  495         }
//  496       }
//  497       // When invoked from the osal_nv_init(), verify checksums and find & zero any duplicates.
//  498       else
//  499       {
//  500         if ( hdr.chk == calcChkF( pg, offset, hdr.len ) )
//  501         {
//  502           if ( findDups )
//  503           {
//  504             if ( hdr.stat == OSAL_NV_ERASED_ID )
//  505             {
//  506               /* The trick of setting the MSB of the item Id causes the logic
//  507                * immediately above to return a valid page only if the header 'stat'
//  508                * indicates that it was the older item being transferred.
//  509                */
//  510               uint16 off = findItem( (hdr.id | OSAL_NV_SOURCE_ID) );
//  511   
//  512               if ( off != OSAL_NV_ITEM_NULL )
//  513               {
//  514                 setItem( findPg, off, eNvZero );  // Mark old duplicate as invalid.
//  515               }
//  516             }
//  517           }
//  518           // Any "old" item immediately exits and triggers the N^2 exhaustive initialization.
//  519           else if ( hdr.stat != OSAL_NV_ERASED_ID )
//  520           {
//  521             return OSAL_NV_ERASED_ID;
//  522           }
//  523         }
//  524         else
//  525         {
//  526           setItem( pg, offset, eNvZero );  // Mark bad checksum as invalid.
??initPage_1:
        ; Setup parameters for call to function setItem
        MOV     R4,#0x1
        MOV     R2,?V0 + 2
        MOV     R3,?V0 + 3
        MOV     R1,?V0 + 6
        LCALL   ??setItem?relay
//  527           lost += (OSAL_NV_HDR_SIZE + sz);
//  528         }
//  529       }
//  530     }
//  531     else
//  532     {
//  533       lost += (OSAL_NV_HDR_SIZE + sz);
??initPage_2:
        MOV     A,#0x8
        ADD     A,?V0 + 0
        MOV     R0,A
        CLR     A
        ADDC    A,?V0 + 1
        MOV     R1,A
        MOV     A,R6
        ADD     A,R0
        MOV     R6,A
        MOV     A,R7
        ADDC    A,R1
        MOV     R7,A
//  534     }
//  535     offset += sz;
??initPage_3:
        MOV     A,?V0 + 2
        ADD     A,?V0 + 0
        MOV     ?V0 + 2,A
        MOV     A,?V0 + 3
        ADDC    A,?V0 + 1
        MOV     ?V0 + 3,A
//  536 
//  537   } while ( TRUE );
??initPage_0:
        ; Setup parameters for call to function nvReadHdr
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     R2,?V0 + 2
        MOV     R3,?V0 + 3
        MOV     R1,?V0 + 6
        LCALL   ??Subroutine0_0 & 0xFFFF
??CrossCallReturnLabel_3:
        JNZ     ??initPage_4
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??initPage_4:
        JZ      ??initPage_5
        MOV     A,?V0 + 2
        ADD     A,#0x8
        MOV     ?V0 + 2,A
        MOV     A,?V0 + 3
        ADDC    A,#0x0
        MOV     ?V0 + 3,A
        MOV     A,#0x4
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine5 & 0xFFFF
??CrossCallReturnLabel_18:
        MOV     ?V0 + 0,A
        MOV     A,#-0x1
        ANL     A,R1
        MOV     ?V0 + 1,A
        MOV     A,?V0 + 0
        ADD     A,?V0 + 2
        MOV     R0,A
        MOV     A,R1
        ADDC    A,?V0 + 3
        MOV     R1,A
        CLR     C
        MOV     A,R0
        SUBB    A,#-0x7
        MOV     A,R1
        SUBB    A,#0x7
        JC      ??initPage_6
        CLR     A
        ADD     A,R6
        MOV     R0,A
        MOV     A,#0x8
        ADDC    A,R7
        MOV     R1,A
        MOV     A,R0
        CLR     C
        SUBB    A,?V0 + 2
        MOV     R6,A
        MOV     A,R1
        SUBB    A,?V0 + 3
        MOV     R7,A
        MOV     ?V0 + 2,#-0x8
        MOV     ?V0 + 3,#0x7
//  538 
//  539   pgOff[pg - OSAL_NV_PAGE_BEG] = offset;
??initPage_5:
        MOV     A,?V0 + 6
        LCALL   ??Subroutine25_0 & 0xFFFF
??CrossCallReturnLabel_75:
        MOV     A,?V0 + 2
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,?V0 + 3
        LCALL   ?Subroutine19 & 0xFFFF
//  540   pgLost[pg - OSAL_NV_PAGE_BEG] = lost;
??CrossCallReturnLabel_60:
        MOV     A,R6
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R7
        MOVX    @DPTR,A
//  541 
//  542   return OSAL_NV_ITEM_NULL;
        MOV     R2,#0x0
        MOV     R3,#0x0
??initPage_7:
        LJMP    ?Subroutine38 & 0xFFFF
??initPage_6:
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        JNZ     ??initPage_8
        INC     DPTR
        MOVX    A,@DPTR
??initPage_8:
        JNZ     $+5
        LJMP    ??initPage_2 & 0xFFFF
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    A,@DPTR
        JNZ     ??initPage_9
        INC     DPTR
        MOVX    A,@DPTR
??initPage_9:
        JZ      ??initPage_10
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    A,@DPTR
        MOV     R0,A
        INC     DPTR
        MOVX    A,@DPTR
        ANL     A,#0x7f
        MOV     R1,A
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,R0
        JNZ     ??initPage_11
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,R1
??initPage_11:
        JZ      $+5
        LJMP    ??initPage_3 & 0xFFFF
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        INC     DPTR
        MOVX    A,@DPTR
        ANL     A,#0x80
        MOV     R1,A
        CLR     A
        JNZ     ??initPage_12
        MOV     A,R1
??initPage_12:
        JNZ     ??initPage_13
        MOV     A,#0x8
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,#0xff
        JNZ     ??initPage_14
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??initPage_14:
        JZ      $+5
        LJMP    ??initPage_3 & 0xFFFF
        SJMP    ??initPage_15
??initPage_13:
        MOV     A,#0x8
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,#0xff
        JNZ     ??initPage_16
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??initPage_16:
        JNZ     $+5
        LJMP    ??initPage_3 & 0xFFFF
??initPage_15:
        MOV     R2,?V0 + 2
        MOV     R3,?V0 + 3
        SJMP    ??initPage_7
??initPage_10:
        ; Setup parameters for call to function calcChkF
        MOV     A,#0x4
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine13 & 0xFFFF
??CrossCallReturnLabel_43:
        MOV     R2,?V0 + 2
        MOV     R3,?V0 + 3
        MOV     R1,?V0 + 6
        LCALL   ??calcChkF?relay
        MOV     ?V0 + 4,R2
        MOV     ?V0 + 5,R3
        MOV     R0,?V0 + 4
        MOV     R1,?V0 + 5
        MOV     A,#0x6
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,R0
        JNZ     ??initPage_17
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,R1
??initPage_17:
        JZ      $+5
        LJMP    ??initPage_1 & 0xFFFF
        MOV     A,?V0 + 7
        JZ      ??initPage_18
        MOV     A,#0x8
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,#0xff
        JNZ     ??initPage_19
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??initPage_19:
        JZ      $+5
        LJMP    ??initPage_3 & 0xFFFF
        ; Setup parameters for call to function findItem
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        MOV     R2,A
        INC     DPTR
        MOVX    A,@DPTR
        ORL     A,#0x80
        MOV     R3,A
        LCALL   ??findItem?relay
        MOV     A,R2
        JNZ     ??initPage_20
        MOV     A,R3
??initPage_20:
        JNZ     $+5
        LJMP    ??initPage_3 & 0xFFFF
        ; Setup parameters for call to function setItem
        MOV     R4,#0x1
        MOV     DPTR,#findPg
        MOVX    A,@DPTR
        MOV     R1,A
        LCALL   ??setItem?relay
        LJMP    ??initPage_3 & 0xFFFF
??initPage_18:
        MOV     A,#0x8
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,#0xff
        JNZ     ??initPage_21
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??initPage_21:
        JNZ     $+5
        LJMP    ??initPage_3 & 0xFFFF
        MOV     R2,#-0x1
        MOV     R3,#-0x1
        LJMP    ??initPage_7 & 0xFFFF
        CFI EndBlock cfiBlock3
//  543 }

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine0:
        CFI Block cfiCond4 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_0
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 29)
        CFI Block cfiCond5 Using cfiCommon0
        CFI (cfiCond5) NoFunction
        CFI (cfiCond5) Conditional ??CrossCallReturnLabel_1
        CFI (cfiCond5) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond5) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond5) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond5) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond5) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond5) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond5) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond5) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond5) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond5) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond5) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond5) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond5) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond5) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond5) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond5) CFA_SP SP+0
        CFI (cfiCond5) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiPicker6 Using cfiCommon1
        CFI (cfiPicker6) NoFunction
        CFI (cfiPicker6) Picker
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     R2,#-0x8
        MOV     R3,#0x7
        MOV     R1,#0x3f
        CFI Block cfiCond7 Using cfiCommon0
        CFI (cfiCond7) NoFunction
        CFI (cfiCond7) Conditional ??CrossCallReturnLabel_2
        CFI (cfiCond7) R6 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond7) VB load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond7) V0 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond7) V1 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond7) V2 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond7) V3 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond7) V4 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond7) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond7) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond7) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond7) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond7) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond7) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond7) CFA_SP SP+0
        CFI (cfiCond7) CFA_XSP16 add(XSP16, 29)
        CFI Block cfiCond8 Using cfiCommon0
        CFI (cfiCond8) NoFunction
        CFI (cfiCond8) Conditional ??CrossCallReturnLabel_3
        CFI (cfiCond8) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond8) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond8) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond8) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond8) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond8) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond8) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond8) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond8) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond8) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond8) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond8) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond8) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond8) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond8) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond8) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond8) CFA_SP SP+0
        CFI (cfiCond8) CFA_XSP16 add(XSP16, 26)
??Subroutine0_0:
        LCALL   nvReadHdr & 0xFFFF
        MOVX    A,@DPTR
        XRL     A,#0xff
        RET
        CFI EndBlock cfiCond4
        CFI EndBlock cfiCond5
        CFI EndBlock cfiPicker6
        CFI EndBlock cfiCond7
        CFI EndBlock cfiCond8
//  544 
//  545 /*********************************************************************
//  546  * @fn      erasePage
//  547  *
//  548  * @brief   Erases a page in Flash.
//  549  *
//  550  * @param   pg - Valid NV page to erase.
//  551  *
//  552  * @return  none
//  553  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  554 static void erasePage( uint8 pg )
erasePage:
        CFI Block cfiBlock9 Using cfiCommon0
        CFI Function erasePage
//  555 {
        FUNCALL erasePage, HalAdcCheckVdd
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 17, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 17, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL erasePage, nvReadHdr
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 17, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 17, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL erasePage, writeWordM
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 18, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 18, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x9
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        ; Saved register size: 9
        ; Auto size: 8
        MOV     A,#-0x8
        LCALL   ?ALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 17)
        MOV     A,R1
        MOV     R6,A
//  556   halIntState_t intState;
//  557   osalNvHdr_t ieee;
//  558 
//  559   if ( !OSAL_NV_CHECK_BUS_VOLTAGE )
        ; Setup parameters for call to function HalAdcCheckVdd
        MOV     R1,#0x4
        LCALL   ??HalAdcCheckVdd?relay
        MOV     A,R1
        JNZ     ??erasePage_0
//  560   {
//  561     failF = TRUE;
        MOV     A,#0x1
        MOV     DPTR,#failF
        MOVX    @DPTR,A
//  562     return;
        SJMP    ??erasePage_1
//  563   }
//  564 
//  565   HAL_ENTER_CRITICAL_SECTION( intState );  // Hold off interrupts.
??erasePage_0:
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R2,A
        CLR     0xa8.7
//  566   FADDRH = (pg) << 1;
        MOV     A,R6
        CLR     C
        RLC     A
        MOV     0xad,A
//  567   FCTL = 0x01;
        MOV     0xae,#0x1
//  568   asm("NOP");
        NOP
//  569   while(FCTL == 0x80);
??erasePage_2:
        MOV     A,#-0x80
        XRL     A,0xae
        JZ      ??erasePage_2
//  570   HAL_EXIT_CRITICAL_SECTION( intState );   // Re-enable interrupts.
        MOV     A,R2
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  571 
//  572   pgOff[pg - OSAL_NV_PAGE_BEG] = OSAL_NV_PAGE_HDR_SIZE;
        LCALL   ?Subroutine25 & 0xFFFF
??CrossCallReturnLabel_76:
        MOV     A,#0x8
        MOVX    @DPTR,A
        INC     DPTR
        CLR     A
        LCALL   ?Subroutine19 & 0xFFFF
//  573   pgLost[pg - OSAL_NV_PAGE_BEG] = 0;
??CrossCallReturnLabel_61:
        LCALL   ??Subroutine17_0 & 0xFFFF
//  574 
//  575   nvReadHdr( OSAL_NV_IEEE_PAGE, OSAL_NV_IEEE_OFFSET, (uint8 *)(&ieee) );
??CrossCallReturnLabel_55:
        MOV     R2,#-0x8
        MOV     R3,#0x7
        MOV     R1,#0x3f
        LCALL   nvReadHdr & 0xFFFF
//  576   writeWordM( pg, OSAL_NV_IEEE_OFFSET, (uint8 *)(&ieee), 2 );
        ; Setup parameters for call to function writeWordM
        MOV     ?V0 + 0,#0x2
        MOV     R0,#?V0 + 0
        LCALL   ?PUSH_XSTACK_I_ONE
        CFI CFA_XSP16 add(XSP16, 18)
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine20 & 0xFFFF
??CrossCallReturnLabel_63:
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 17)
//  577 }
??erasePage_1:
        MOV     A,#0x8
        CFI EndBlock cfiBlock9
        REQUIRE ?Subroutine39
        REQUIRE _A_IEN0
        REQUIRE FADDRH
        REQUIRE FCTL
        ; // Fall through to label ?Subroutine39

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine39:
        CFI Block cfiBlock10 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 17)
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI Invalid
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 9)
        CFI Valid
        MOV     R7,#0x1
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock10

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine25:
        CFI Block cfiCond11 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_76
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 17)
        CFI Block cfiCond12 Using cfiCommon0
        CFI (cfiCond12) NoFunction
        CFI (cfiCond12) Conditional ??CrossCallReturnLabel_77
        CFI (cfiCond12) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond12) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond12) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond12) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond12) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond12) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond12) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond12) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond12) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond12) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond12) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond12) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond12) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond12) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond12) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond12) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond12) CFA_SP SP+0
        CFI (cfiCond12) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond13 Using cfiCommon0
        CFI (cfiCond13) NoFunction
        CFI (cfiCond13) Conditional ??CrossCallReturnLabel_78
        CFI (cfiCond13) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond13) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond13) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond13) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond13) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond13) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond13) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond13) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond13) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond13) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond13) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond13) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond13) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond13) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond13) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond13) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond13) CFA_SP SP+0
        CFI (cfiCond13) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiPicker14 Using cfiCommon1
        CFI (cfiPicker14) NoFunction
        CFI (cfiPicker14) Picker
        MOV     A,R6
        CFI Block cfiCond15 Using cfiCommon0
        CFI (cfiCond15) NoFunction
        CFI (cfiCond15) Conditional ??CrossCallReturnLabel_75
        CFI (cfiCond15) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond15) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond15) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond15) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond15) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond15) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond15) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond15) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond15) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond15) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond15) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond15) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond15) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond15) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond15) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond15) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond15) CFA_SP SP+0
        CFI (cfiCond15) CFA_XSP16 add(XSP16, 26)
??Subroutine25_0:
        LCALL   ?Subroutine35 & 0xFFFF
??CrossCallReturnLabel_103:
        RET
        CFI EndBlock cfiCond11
        CFI EndBlock cfiCond12
        CFI EndBlock cfiCond13
        CFI EndBlock cfiPicker14
        CFI EndBlock cfiCond15

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine19:
        CFI Block cfiCond16 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_60
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond17 Using cfiCommon0
        CFI (cfiCond17) NoFunction
        CFI (cfiCond17) Conditional ??CrossCallReturnLabel_61
        CFI (cfiCond17) R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond17) VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond17) V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond17) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond17) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond17) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond17) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond17) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond17) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond17) CFA_SP SP+0
        CFI (cfiCond17) CFA_XSP16 add(XSP16, 17)
        CFI Block cfiPicker18 Using cfiCommon1
        CFI (cfiPicker18) NoFunction
        CFI (cfiPicker18) Picker
        MOVX    @DPTR,A
        LCALL   ?Subroutine36 & 0xFFFF
??CrossCallReturnLabel_105:
        RET
        CFI EndBlock cfiCond16
        CFI EndBlock cfiCond17
        CFI EndBlock cfiPicker18

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine36:
        CFI Block cfiCond19 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_105, ??CrossCallReturnLabel_60
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond20 Using cfiCommon0
        CFI (cfiCond20) NoFunction
        CFI (cfiCond20) Conditional ??CrossCallReturnLabel_105, ??CrossCallReturnLabel_61
        CFI (cfiCond20) R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond20) VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond20) V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond20) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond20) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond20) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond20) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond20) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond20) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond20) CFA_SP SP+0
        CFI (cfiCond20) CFA_XSP16 add(XSP16, 17)
        CFI Block cfiCond21 Using cfiCommon0
        CFI (cfiCond21) NoFunction
        CFI (cfiCond21) Conditional ??CrossCallReturnLabel_104
        CFI (cfiCond21) R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond21) VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond21) V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond21) V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond21) V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond21) V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond21) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond21) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond21) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond21) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond21) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond21) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond21) CFA_SP SP+0
        CFI (cfiCond21) CFA_XSP16 add(XSP16, 20)
        CFI Block cfiPicker22 Using cfiCommon1
        CFI (cfiPicker22) NoFunction
        CFI (cfiPicker22) Picker
        MOV     A,R0
        ADD     A,#((pgLost + 136) & 0xff)
        MOV     DPL,A
        MOV     A,R1
        ADDC    A,#(((pgLost - 120) >> 8) & 0xff)
        MOV     DPH,A
        RET
        CFI EndBlock cfiCond19
        CFI EndBlock cfiCond20
        CFI EndBlock cfiCond21
        CFI EndBlock cfiPicker22

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine17:
        CFI Block cfiCond23 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_53
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 24)
        CFI Block cfiCond24 Using cfiCommon0
        CFI (cfiCond24) NoFunction
        CFI (cfiCond24) Conditional ??CrossCallReturnLabel_54
        CFI (cfiCond24) R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond24) VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond24) V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond24) V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond24) V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond24) V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond24) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond24) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond24) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond24) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond24) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond24) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond24) CFA_SP SP+0
        CFI (cfiCond24) CFA_XSP16 add(XSP16, 20)
        CFI Block cfiPicker25 Using cfiCommon1
        CFI (cfiPicker25) NoFunction
        CFI (cfiPicker25) Picker
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        CFI Block cfiCond26 Using cfiCommon0
        CFI (cfiCond26) NoFunction
        CFI (cfiCond26) Conditional ??CrossCallReturnLabel_55
        CFI (cfiCond26) R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond26) VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond26) V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond26) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond26) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond26) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond26) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond26) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond26) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond26) CFA_SP SP+0
        CFI (cfiCond26) CFA_XSP16 add(XSP16, 17)
??Subroutine17_0:
        CLR     A
        CFI Block cfiCond27 Using cfiCommon0
        CFI (cfiCond27) NoFunction
        CFI (cfiCond27) Conditional ??CrossCallReturnLabel_56
        CFI (cfiCond27) DPL0 Frame(CFA_SP, 4)
        CFI (cfiCond27) DPH0 Frame(CFA_SP, 5)
        CFI (cfiCond27) CFA_SP SP+-5
        CFI (cfiCond27) CFA_XSP16 add(XSP16, 8)
??Subroutine17_1:
        MOVX    @DPTR,A
        INC     DPTR
        CFI Block cfiCond28 Using cfiCommon0
        CFI (cfiCond28) NoFunction
        CFI (cfiCond28) Conditional ??CrossCallReturnLabel_57
        CFI (cfiCond28) R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond28) VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond28) V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond28) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond28) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond28) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond28) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond28) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond28) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond28) CFA_SP SP+0
        CFI (cfiCond28) CFA_XSP16 add(XSP16, 13)
??Subroutine17_2:
        MOVX    @DPTR,A
        ; Setup parameters for call to function writeWordH
        ; Setup parameters for call to function writeWord
        ; Setup parameters for call to function nvReadHdr
        ; Setup parameters for call to function writeWord
        ; Setup parameters for call to function writeWord
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     R4,DPL
        MOV     R5,DPH
        RET
        CFI EndBlock cfiCond23
        CFI EndBlock cfiCond24
        CFI EndBlock cfiPicker25
        CFI EndBlock cfiCond26
        CFI EndBlock cfiCond27
        CFI EndBlock cfiCond28
//  578 
//  579 /*********************************************************************
//  580  * @fn      compactPage
//  581  *
//  582  * @brief   Compacts the page specified.
//  583  *
//  584  * @param   srcPg - Valid NV page to erase.
//  585  *
//  586  * @return  none
//  587  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  588 static void compactPage( uint8 srcPg )
compactPage:
        CFI Block cfiBlock29 Using cfiCommon0
        CFI Function compactPage
//  589 {
        FUNCALL compactPage, writeWordH
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 24, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 24, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL compactPage, calcChkF
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 24, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 24, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL compactPage, setItem
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 24, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 24, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL compactPage, writeBuf
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 26, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL compactPage, xferBuf
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 28, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 28, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL compactPage, setItem
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 24, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 24, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL compactPage, nvReadHdr
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 24, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 24, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL compactPage, erasePage
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 24, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 24, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL compactPage, setPageUse
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 24, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 24, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xe
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 14)
        ; Saved register size: 14
        ; Auto size: 10
        MOV     A,#-0xa
        LCALL   ?ALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 24)
        MOV     A,R1
        MOV     R6,A
//  590   uint16 dstOff = pgOff[pgRes-OSAL_NV_PAGE_BEG];
        LCALL   ?Subroutine3 & 0xFFFF
??CrossCallReturnLabel_14:
        LCALL   ?Subroutine6 & 0xFFFF
//  591   uint16 srcOff = OSAL_NV_ZEROED_ID;
??CrossCallReturnLabel_21:
        LCALL   ?Subroutine17 & 0xFFFF
//  592   osalNvHdr_t hdr;
//  593 
//  594   // Mark page as being in process of compaction.
//  595   writeWordH( srcPg, OSAL_NV_PG_XFER, (uint8*)(&srcOff) );
??CrossCallReturnLabel_53:
        MOV     R2,#0x4
        MOV     R3,A
        MOV     A,R6
        MOV     R1,A
        LCALL   ??writeWordH?relay
//  596 
//  597   srcOff = OSAL_NV_PAGE_HDR_SIZE;
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     A,#0x8
        MOVX    @DPTR,A
        INC     DPTR
        CLR     A
        LJMP    ??compactPage_0 & 0xFFFF
//  598 
//  599   do
//  600   {
//  601     uint16 sz;
//  602     nvReadHdr( srcPg, srcOff, (uint8 *)(&hdr) );
//  603 
//  604     if ( hdr.id == OSAL_NV_ERASED_ID )
//  605     {
//  606       break;
//  607     }
//  608 
//  609     srcOff += OSAL_NV_HDR_SIZE;
//  610 
//  611     if ( (srcOff + hdr.len) > OSAL_NV_PAGE_FREE )
//  612     {
//  613       break;
//  614     }
//  615 
//  616     sz = OSAL_NV_DATA_SIZE( hdr.len );
??compactPage_1:
        MOV     A,#0x4
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine5 & 0xFFFF
??CrossCallReturnLabel_19:
        MOV     ?V0 + 4,A
        MOV     A,#-0x1
        ANL     A,R1
        MOV     ?V0 + 5,A
//  617 
//  618     if ( hdr.id != OSAL_NV_ZEROED_ID )
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        JNZ     ??compactPage_2
        INC     DPTR
        MOVX    A,@DPTR
??compactPage_2:
        JZ      ??CrossCallReturnLabel_32
//  619     {
//  620       if ( hdr.chk == calcChkF( srcPg, srcOff, hdr.len ) )
        ; Setup parameters for call to function calcChkF
        MOV     A,#0x4
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine13 & 0xFFFF
??CrossCallReturnLabel_44:
        LCALL   ?Subroutine10 & 0xFFFF
??CrossCallReturnLabel_33:
        LCALL   ?Subroutine28 & 0xFFFF
??CrossCallReturnLabel_84:
        MOV     A,#0x6
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,R0
        JNZ     ??compactPage_3
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,R1
??compactPage_3:
        JNZ     ??compactPage_4
//  621       {
//  622         setItem( srcPg, srcOff, eNvXfer );
        ; Setup parameters for call to function setItem
        MOV     R4,#0x0
        LCALL   ?Subroutine9 & 0xFFFF
//  623         writeBuf( pgRes, dstOff, OSAL_NV_HDR_SIZE, (byte *)(&hdr) );
??CrossCallReturnLabel_31:
        ; Setup parameters for call to function writeBuf
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOV     ?V0 + 2,DPL
        MOV     ?V0 + 3,DPH
        MOV     R0,#?V0 + 2
        LCALL   ?PUSH_XSTACK_I_TWO
        CFI CFA_XSP16 add(XSP16, 26)
        MOV     R4,#0x8
        MOV     R5,#0x0
        MOV     R2,?V0 + 0
        MOV     R3,?V0 + 1
        MOV     DPTR,#pgRes
        MOVX    A,@DPTR
        MOV     R1,A
        LCALL   ??writeBuf?relay
        MOV     A,#0x2
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 24)
//  624         dstOff += OSAL_NV_HDR_SIZE;
        LCALL   ?Subroutine23 & 0xFFFF
//  625         xferBuf( srcPg, srcOff, pgRes, dstOff, sz );
??CrossCallReturnLabel_71:
        ; Setup parameters for call to function xferBuf
        MOV     R0,#?V0 + 4
        LCALL   ?PUSH_XSTACK_I_TWO
        CFI CFA_XSP16 add(XSP16, 26)
        MOV     R0,#?V0 + 0
        LCALL   ?PUSH_XSTACK_I_TWO
        CFI CFA_XSP16 add(XSP16, 28)
        MOV     DPTR,#pgRes
        MOVX    A,@DPTR
        MOV     R4,A
        MOV     A,#0x4
        LCALL   ?XSTACK_DISP0_8
        LCALL   ??Subroutine10_0 & 0xFFFF
??CrossCallReturnLabel_34:
        LCALL   ??xferBuf?relay
        MOV     A,#0x4
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 24)
//  626         dstOff += sz;
        MOV     A,?V0 + 0
        ADD     A,?V0 + 4
        MOV     ?V0 + 0,A
        MOV     A,?V0 + 1
        ADDC    A,?V0 + 5
        MOV     ?V0 + 1,A
//  627       }
//  628 
//  629       setItem( srcPg, srcOff, eNvZero );  // Mark old location as invalid.
??compactPage_4:
        ; Setup parameters for call to function setItem
        MOV     R4,#0x1
        LCALL   ?Subroutine9 & 0xFFFF
//  630     }
//  631 
//  632     srcOff += sz;
??CrossCallReturnLabel_32:
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    A,@DPTR
        ADD     A,?V0 + 4
        MOVX    @DPTR,A
        INC     DPTR
        MOVX    A,@DPTR
        ADDC    A,?V0 + 5
??compactPage_0:
        MOVX    @DPTR,A
//  633 
//  634   } while ( TRUE );
        ; Setup parameters for call to function nvReadHdr
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOV     R4,DPL
        MOV     R5,DPH
        LCALL   ?Subroutine10 & 0xFFFF
??CrossCallReturnLabel_35:
        LCALL   nvReadHdr & 0xFFFF
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,#0xff
        JNZ     ??compactPage_5
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??compactPage_5:
        JZ      ??compactPage_6
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    A,@DPTR
        ADD     A,#0x8
        LCALL   ?Subroutine33 & 0xFFFF
??CrossCallReturnLabel_97:
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        PUSH    DPL
        CFI CFA_SP SP+-1
        PUSH    DPH
        CFI CFA_SP SP+-2
        MOV     A,#0x4
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine2 & 0xFFFF
??CrossCallReturnLabel_6:
        POP     DPH
        CFI CFA_SP SP+-1
        POP     DPL
        CFI CFA_SP SP+0
        MOVX    A,@DPTR
        ADD     A,R0
        MOV     R0,A
        INC     DPTR
        MOVX    A,@DPTR
        LCALL   ?Subroutine24 & 0xFFFF
??CrossCallReturnLabel_73:
        JNC     $+5
        LJMP    ??compactPage_1 & 0xFFFF
//  635 
//  636   pgOff[pgRes-OSAL_NV_PAGE_BEG] = dstOff;
??compactPage_6:
        LCALL   ?Subroutine3 & 0xFFFF
??CrossCallReturnLabel_15:
        MOV     A,?V0 + 0
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,?V0 + 1
        MOVX    @DPTR,A
//  637 
//  638   /* In order to recover from a page compaction that is interrupted,
//  639    * the logic in osal_nv_init() depends upon the following order:
//  640    * 1. Compacted page is erased.
//  641    * 2. State of the target of compaction is changed ePgActive to ePgInUse.
//  642    */
//  643   erasePage( srcPg );
        ; Setup parameters for call to function erasePage
        MOV     A,R6
        MOV     R1,A
        LCALL   ??erasePage?relay
//  644 
//  645   // Mark the reserve page as being in use.
//  646   setPageUse( pgRes, TRUE );
        ; Setup parameters for call to function setPageUse
        MOV     R2,#0x1
        MOV     DPTR,#pgRes
        MOVX    A,@DPTR
        MOV     R1,A
        LCALL   ??setPageUse?relay
//  647 
//  648   // Set the reserve page to be the newly erased page.
//  649   pgRes = srcPg;
        MOV     A,R6
        MOV     DPTR,#pgRes
        MOVX    @DPTR,A
//  650 }
        MOV     A,#0xa
        LCALL   ?DEALLOC_XSTACK8
        CFI EndBlock cfiBlock29
        REQUIRE ?Subroutine40
        ; // Fall through to label ?Subroutine40

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine40:
        CFI Block cfiBlock30 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 14)
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        MOV     R7,#0x6
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock30

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine13:
        CFI Block cfiCond31 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_43
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond32 Using cfiCommon0
        CFI (cfiCond32) NoFunction
        CFI (cfiCond32) Conditional ??CrossCallReturnLabel_44
        CFI (cfiCond32) R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond32) VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond32) V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond32) V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond32) V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond32) V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond32) V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond32) V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond32) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond32) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond32) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond32) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond32) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond32) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond32) CFA_SP SP+0
        CFI (cfiCond32) CFA_XSP16 add(XSP16, 24)
        CFI Block cfiCond33 Using cfiCommon0
        CFI (cfiCond33) NoFunction
        CFI (cfiCond33) Conditional ??CrossCallReturnLabel_45
        CFI (cfiCond33) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond33) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond33) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond33) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond33) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond33) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond33) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond33) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond33) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond33) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond33) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond33) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond33) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond33) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond33) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond33) CFA_SP SP+0
        CFI (cfiCond33) CFA_XSP16 add(XSP16, 31)
        CFI Block cfiCond34 Using cfiCommon0
        CFI (cfiCond34) NoFunction
        CFI (cfiCond34) Conditional ??CrossCallReturnLabel_46
        CFI (cfiCond34) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond34) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond34) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond34) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond34) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond34) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond34) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond34) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond34) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond34) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond34) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond34) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond34) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond34) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond34) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond34) CFA_SP SP+0
        CFI (cfiCond34) CFA_XSP16 add(XSP16, 32)
        CFI Block cfiPicker35 Using cfiCommon1
        CFI (cfiPicker35) NoFunction
        CFI (cfiPicker35) Picker
        MOVX    A,@DPTR
        MOV     R4,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R5,A
        RET
        CFI EndBlock cfiCond31
        CFI EndBlock cfiCond32
        CFI EndBlock cfiCond33
        CFI EndBlock cfiCond34
        CFI EndBlock cfiPicker35

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine10:
        CFI Block cfiCond36 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_33
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 24)
        CFI Block cfiCond37 Using cfiCommon0
        CFI (cfiCond37) NoFunction
        CFI (cfiCond37) Conditional ??CrossCallReturnLabel_35
        CFI (cfiCond37) R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond37) VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond37) V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond37) V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond37) V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond37) V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond37) V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond37) V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond37) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond37) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond37) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond37) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond37) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond37) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond37) CFA_SP SP+0
        CFI (cfiCond37) CFA_XSP16 add(XSP16, 24)
        CFI Block cfiPicker38 Using cfiCommon1
        CFI (cfiPicker38) NoFunction
        CFI (cfiPicker38) Picker
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        CFI Block cfiCond39 Using cfiCommon0
        CFI (cfiCond39) NoFunction
        CFI (cfiCond39) Conditional ??CrossCallReturnLabel_34
        CFI (cfiCond39) R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond39) VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond39) V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond39) V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond39) V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond39) V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond39) V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond39) V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond39) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond39) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond39) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond39) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond39) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond39) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond39) CFA_SP SP+0
        CFI (cfiCond39) CFA_XSP16 add(XSP16, 28)
??Subroutine10_0:
        LCALL   ??Subroutine32_0 & 0xFFFF
??CrossCallReturnLabel_94:
        MOV     A,R6
        MOV     R1,A
        RET
        CFI EndBlock cfiCond36
        CFI EndBlock cfiCond37
        CFI EndBlock cfiPicker38
        CFI EndBlock cfiCond39

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine9:
        CFI Block cfiCond40 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_31
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 24)
        CFI Block cfiCond41 Using cfiCommon0
        CFI (cfiCond41) NoFunction
        CFI (cfiCond41) Conditional ??CrossCallReturnLabel_32
        CFI (cfiCond41) R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond41) VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond41) V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond41) V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond41) V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond41) V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond41) V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond41) V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond41) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond41) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond41) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond41) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond41) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond41) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond41) CFA_SP SP+0
        CFI (cfiCond41) CFA_XSP16 add(XSP16, 24)
        CFI Block cfiPicker42 Using cfiCommon1
        CFI (cfiPicker42) NoFunction
        CFI (cfiPicker42) Picker
        LCALL   ?Subroutine32 & 0xFFFF
??CrossCallReturnLabel_93:
        MOV     A,R6
        MOV     R1,A
        LCALL   ??setItem?relay
        RET
        CFI EndBlock cfiCond40
        CFI EndBlock cfiCond41
        CFI EndBlock cfiPicker42

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine5:
        CFI Block cfiCond43 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_18
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond44 Using cfiCommon0
        CFI (cfiCond44) NoFunction
        CFI (cfiCond44) Conditional ??CrossCallReturnLabel_19
        CFI (cfiCond44) R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond44) VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond44) V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond44) V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond44) V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond44) V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond44) V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond44) V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond44) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond44) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond44) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond44) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond44) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond44) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond44) CFA_SP SP+0
        CFI (cfiCond44) CFA_XSP16 add(XSP16, 24)
        CFI Block cfiCond45 Using cfiCommon0
        CFI (cfiCond45) NoFunction
        CFI (cfiCond45) Conditional ??CrossCallReturnLabel_20
        CFI (cfiCond45) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond45) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond45) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond45) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond45) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond45) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond45) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond45) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond45) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond45) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond45) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond45) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond45) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond45) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond45) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond45) CFA_SP SP+0
        CFI (cfiCond45) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiPicker46 Using cfiCommon1
        CFI (cfiPicker46) NoFunction
        CFI (cfiPicker46) Picker
        LCALL   ?Subroutine31 & 0xFFFF
??CrossCallReturnLabel_91:
        RET
        CFI EndBlock cfiCond43
        CFI EndBlock cfiCond44
        CFI EndBlock cfiCond45
        CFI EndBlock cfiPicker46

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine31:
        CFI Block cfiCond47 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_91, ??CrossCallReturnLabel_18
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond48 Using cfiCommon0
        CFI (cfiCond48) NoFunction
        CFI (cfiCond48) Conditional ??CrossCallReturnLabel_91, ??CrossCallReturnLabel_19
        CFI (cfiCond48) R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond48) VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond48) V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond48) V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond48) V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond48) V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond48) V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond48) V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond48) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond48) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond48) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond48) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond48) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond48) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond48) CFA_SP SP+0
        CFI (cfiCond48) CFA_XSP16 add(XSP16, 24)
        CFI Block cfiCond49 Using cfiCommon0
        CFI (cfiCond49) NoFunction
        CFI (cfiCond49) Conditional ??CrossCallReturnLabel_91, ??CrossCallReturnLabel_20
        CFI (cfiCond49) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond49) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond49) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond49) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond49) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond49) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond49) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond49) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond49) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond49) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond49) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond49) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond49) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond49) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond49) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond49) CFA_SP SP+0
        CFI (cfiCond49) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiCond50 Using cfiCommon0
        CFI (cfiCond50) NoFunction
        CFI (cfiCond50) Conditional ??CrossCallReturnLabel_90, ??CrossCallReturnLabel_16
        CFI (cfiCond50) R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond50) VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond50) V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond50) V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond50) V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond50) V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond50) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond50) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond50) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond50) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond50) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond50) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond50) CFA_SP SP+0
        CFI (cfiCond50) CFA_XSP16 add(XSP16, 20)
        CFI Block cfiCond51 Using cfiCommon0
        CFI (cfiCond51) NoFunction
        CFI (cfiCond51) Conditional ??CrossCallReturnLabel_90, ??CrossCallReturnLabel_17
        CFI (cfiCond51) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond51) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond51) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond51) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond51) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond51) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond51) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond51) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond51) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond51) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond51) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond51) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond51) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond51) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond51) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond51) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond51) CFA_SP SP+0
        CFI (cfiCond51) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiPicker52 Using cfiCommon1
        CFI (cfiPicker52) NoFunction
        CFI (cfiPicker52) Picker
        MOVX    A,@DPTR
        ADD     A,#0x3
        MOV     R0,A
        INC     DPTR
        MOVX    A,@DPTR
        ADDC    A,#0x0
        MOV     R1,A
        MOV     A,#-0x4
        ANL     A,R0
        RET
        CFI EndBlock cfiCond47
        CFI EndBlock cfiCond48
        CFI EndBlock cfiCond49
        CFI EndBlock cfiCond50
        CFI EndBlock cfiCond51
        CFI EndBlock cfiPicker52

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine3:
        CFI Block cfiCond53 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_14
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 24)
        CFI Block cfiCond54 Using cfiCommon0
        CFI (cfiCond54) NoFunction
        CFI (cfiCond54) Conditional ??CrossCallReturnLabel_15
        CFI (cfiCond54) R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond54) VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond54) V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond54) V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond54) V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond54) V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond54) V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond54) V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond54) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond54) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond54) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond54) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond54) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond54) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond54) CFA_SP SP+0
        CFI (cfiCond54) CFA_XSP16 add(XSP16, 24)
        CFI Block cfiPicker55 Using cfiCommon1
        CFI (cfiPicker55) NoFunction
        CFI (cfiPicker55) Picker
        MOV     DPTR,#pgRes
        MOVX    A,@DPTR
        LCALL   ?Subroutine35 & 0xFFFF
??CrossCallReturnLabel_102:
        RET
        CFI EndBlock cfiCond53
        CFI EndBlock cfiCond54
        CFI EndBlock cfiPicker55

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine35:
        CFI Block cfiCond56 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_103, ??CrossCallReturnLabel_76
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 17)
        CFI Block cfiCond57 Using cfiCommon0
        CFI (cfiCond57) NoFunction
        CFI (cfiCond57) Conditional ??CrossCallReturnLabel_103, ??CrossCallReturnLabel_77
        CFI (cfiCond57) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond57) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond57) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond57) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond57) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond57) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond57) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond57) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond57) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond57) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond57) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond57) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond57) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond57) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond57) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond57) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond57) CFA_SP SP+0
        CFI (cfiCond57) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond58 Using cfiCommon0
        CFI (cfiCond58) NoFunction
        CFI (cfiCond58) Conditional ??CrossCallReturnLabel_103, ??CrossCallReturnLabel_78
        CFI (cfiCond58) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond58) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond58) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond58) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond58) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond58) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond58) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond58) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond58) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond58) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond58) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond58) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond58) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond58) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond58) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond58) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond58) CFA_SP SP+0
        CFI (cfiCond58) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond59 Using cfiCommon0
        CFI (cfiCond59) NoFunction
        CFI (cfiCond59) Conditional ??CrossCallReturnLabel_103, ??CrossCallReturnLabel_75
        CFI (cfiCond59) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond59) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond59) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond59) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond59) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond59) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond59) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond59) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond59) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond59) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond59) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond59) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond59) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond59) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond59) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond59) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond59) CFA_SP SP+0
        CFI (cfiCond59) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond60 Using cfiCommon0
        CFI (cfiCond60) NoFunction
        CFI (cfiCond60) Conditional ??CrossCallReturnLabel_102, ??CrossCallReturnLabel_14
        CFI (cfiCond60) R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond60) VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond60) V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond60) V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond60) V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond60) V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond60) V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond60) V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond60) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond60) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond60) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond60) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond60) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond60) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond60) CFA_SP SP+0
        CFI (cfiCond60) CFA_XSP16 add(XSP16, 24)
        CFI Block cfiCond61 Using cfiCommon0
        CFI (cfiCond61) NoFunction
        CFI (cfiCond61) Conditional ??CrossCallReturnLabel_102, ??CrossCallReturnLabel_15
        CFI (cfiCond61) R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond61) VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond61) V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond61) V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond61) V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond61) V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond61) V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond61) V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond61) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond61) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond61) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond61) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond61) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond61) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond61) CFA_SP SP+0
        CFI (cfiCond61) CFA_XSP16 add(XSP16, 24)
        CFI Block cfiPicker62 Using cfiCommon1
        CFI (cfiPicker62) NoFunction
        CFI (cfiPicker62) Picker
        CLR     C
        RLC     A
        MOV     R0,A
        CLR     A
        RLC     A
        MOV     R1,A
        MOV     A,R0
        ADD     A,#((pgOff + 136) & 0xff)
        MOV     DPL,A
        MOV     A,R1
        ADDC    A,#(((pgOff - 120) >> 8) & 0xff)
        MOV     DPH,A
        RET
        CFI EndBlock cfiCond56
        CFI EndBlock cfiCond57
        CFI EndBlock cfiCond58
        CFI EndBlock cfiCond59
        CFI EndBlock cfiCond60
        CFI EndBlock cfiCond61
        CFI EndBlock cfiPicker62
//  651 
//  652 /*********************************************************************
//  653  * @fn      findItem
//  654  *
//  655  * @brief   Find an item Id in NV and return the page and offset to its data.
//  656  *
//  657  * @param   id - Valid NV item Id.
//  658  *
//  659  * @return  Offset of data corresponding to item Id, if found;
//  660  *          otherwise OSAL_NV_ITEM_NULL.
//  661  *
//  662  *          The page containing the item, if found;
//  663  *          otherwise no valid assignment made - left equal to item Id.
//  664  *
//  665  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  666 static uint16 findItem( uint16 id )
findItem:
        CFI Block cfiBlock63 Using cfiCommon0
        CFI Function findItem
//  667 {
        FUNCALL findItem, initPage
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xc
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        ; Saved register size: 12
        ; Auto size: 0
        MOV     A,R2
        MOV     R6,A
        MOV     A,R3
        SJMP    ??findItem_0
//  668   uint16 off;
//  669   uint8 pg;
//  670 
//  671   for ( pg = OSAL_NV_PAGE_BEG; pg <= OSAL_NV_PAGE_END; pg++ )
//  672   {
//  673     if ( (off = initPage( pg, id, FALSE )) != OSAL_NV_ITEM_NULL )
//  674     {
//  675       findPg = pg;
//  676       return off;
//  677     }
//  678   }
//  679 
//  680   // Now attempt to find the item as the "old" item of a failed/interrupted NV write.
//  681   if ( (id & OSAL_NV_SOURCE_ID) == 0 )
//  682   {
//  683     return findItem( id | OSAL_NV_SOURCE_ID );
??findItem_1:
        MOV     A,#-0x80
        ORL     A,R7
??findItem_0:
        MOV     R7,A
//  684   }
        MOV     ?V0 + 0,#0x3c
??findItem_2:
        ; Setup parameters for call to function initPage
        MOV     R4,#0x0
        MOV     A,R6
        MOV     R2,A
        MOV     A,R7
        MOV     R3,A
        MOV     R1,?V0 + 0
        LCALL   ??initPage?relay
        MOV     A,R2
        JNZ     ??findItem_3
        MOV     A,R3
??findItem_3:
        JZ      ??findItem_4
        MOV     A,?V0 + 0
        MOV     DPTR,#findPg
        MOVX    @DPTR,A
        SJMP    ??findItem_5
??findItem_4:
        INC     ?V0 + 0
        MOV     A,?V0 + 0
        CLR     C
        SUBB    A,#0x3e
        JC      ??findItem_2
        MOV     A,#-0x80
        ANL     A,R7
        MOV     R1,A
        CLR     A
        JNZ     ??findItem_6
        MOV     A,R1
??findItem_6:
        JZ      ??findItem_1
//  685   else
//  686   {
//  687     findPg = OSAL_NV_PAGE_NULL;
        CLR     A
        MOV     DPTR,#findPg
        MOVX    @DPTR,A
//  688     return OSAL_NV_ITEM_NULL;
        MOV     R2,A
        MOV     R3,A
        CFI EndBlock cfiBlock63
??findItem_5:
        REQUIRE ?Subroutine41
        ; // Fall through to label ?Subroutine41
//  689   }
//  690 }

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine41:
        CFI Block cfiBlock64 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        MOV     R7,#0x4
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock64
//  691 
//  692 /*********************************************************************
//  693  * @fn      initItem
//  694  *
//  695  * @brief   An NV item is created and initialized with the data passed to the function, if any.
//  696  *
//  697  * @param   id  - Valid NV item Id.
//  698  * @param   len - Item data length.
//  699  * @param  *buf - Pointer to item initalization data. Set to NULL if none.
//  700  *
//  701  * @return  TRUE if item write and read back checksums ok; FALSE otherwise.
//  702  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  703 static uint8 initItem( uint8 flag, uint16 id, uint16 len, void *buf )
initItem:
        CFI Block cfiBlock65 Using cfiCommon0
        CFI Function initItem
//  704 {
        FUNCALL initItem, writeItem
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 19, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 19, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL initItem, compactPage
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x10
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        ; Saved register size: 16
        ; Auto size: 0
        MOV     ?V0 + 0,R1
        MOV     ?V0 + 4,R2
        MOV     ?V0 + 5,R3
        MOV     A,#0x10
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        MOV     ?V0 + 6,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     ?V0 + 7,A
//  705   uint16 sz = OSAL_NV_ITEM_SIZE( len );
        MOV     A,#0x3
        ADD     A,R4
        MOV     R0,A
        CLR     A
        ADDC    A,R5
        MOV     R1,A
        MOV     A,#-0x4
        ANL     A,R0
        MOV     R0,A
        MOV     A,#0x8
        ADD     A,R0
        MOV     R2,A
        CLR     A
        ADDC    A,R1
        MOV     R3,A
//  706   uint8 rtrn = FALSE;
        MOV     ?V0 + 1,#0x0
//  707   uint8 cnt = OSAL_NV_PAGES_USED;
        MOV     ?V0 + 2,#0x2
//  708   uint8 pg = pgRes+1;  // Set to 1 after the reserve page to even wear across all available pages.
        MOV     DPTR,#pgRes
        MOVX    A,@DPTR
        INC     A
        MOV     R7,A
//  709   uint8 idx;
//  710 
//  711   do {
//  712     if (pg >= OSAL_NV_PAGE_BEG+OSAL_NV_PAGES_USED)
??initItem_0:
        MOV     A,R7
        CLR     C
        SUBB    A,#0x3e
        JC      ??initItem_1
//  713     {
//  714       pg = OSAL_NV_PAGE_BEG;
        MOV     R7,#0x3c
//  715     }
//  716     if ( pg != pgRes )
??initItem_1:
        MOV     DPTR,#pgRes
        MOVX    A,@DPTR
        XRL     A,R7
        JZ      ??initItem_2
//  717     {
//  718       idx = pg - OSAL_NV_PAGE_BEG;
        MOV     A,#-0x3c
        ADD     A,R7
        MOV     R6,A
//  719       if ( (pgOff[idx] - pgLost[idx] + sz) <= OSAL_NV_PAGE_FREE )
        LCALL   ?Subroutine30 & 0xFFFF
??CrossCallReturnLabel_88:
        PUSH    DPL
        CFI CFA_SP SP+-1
        PUSH    DPH
        CFI CFA_SP SP+-2
        MOV     A,R0
        ADD     A,#(pgLost & 0xff)
        MOV     DPL,A
        MOV     A,R1
        ADDC    A,#((pgLost >> 8) & 0xff)
        MOV     DPH,A
        LCALL   ?Subroutine2 & 0xFFFF
??CrossCallReturnLabel_7:
        POP     DPH
        CFI CFA_SP SP+-1
        POP     DPL
        CFI CFA_SP SP+0
        MOVX    A,@DPTR
        CLR     C
        SUBB    A,R0
        MOV     R0,A
        INC     DPTR
        MOVX    A,@DPTR
        SUBB    A,R1
        MOV     R1,A
        MOV     A,R2
        ADD     A,R0
        MOV     R0,A
        MOV     A,R3
        LCALL   ?Subroutine24 & 0xFFFF
??CrossCallReturnLabel_74:
        JC      ??initItem_3
//  720       {
//  721         break;
//  722       }
//  723     }
//  724     pg++;
??initItem_2:
        INC     R7
//  725   } while (--cnt);
        DEC     ?V0 + 2
        MOV     A,?V0 + 2
        JNZ     ??initItem_0
//  726 
//  727   if (cnt)
??initItem_3:
        MOV     A,?V0 + 2
        JZ      ??initItem_4
//  728   {
//  729     // Item fits if an old page is compacted.
//  730     if ( (pgOff[idx] + sz) > OSAL_NV_PAGE_FREE )
        MOV     A,R6
        LCALL   ?Subroutine30 & 0xFFFF
??CrossCallReturnLabel_89:
        MOVX    A,@DPTR
        ADD     A,R2
        MOV     R0,A
        INC     DPTR
        MOVX    A,@DPTR
        ADDC    A,R3
        MOV     R1,A
        CLR     C
        MOV     A,R0
        SUBB    A,#-0x7
        MOV     A,R1
        SUBB    A,#0x7
        JC      ??initItem_5
//  731     {
//  732       pg = pgRes;
        MOV     DPTR,#pgRes
        MOVX    A,@DPTR
        MOV     R7,A
//  733     }
//  734 
//  735     // New item is the first one written to the reserved page, then the old page is compacted.
//  736     rtrn = writeItem( pg, id, len, buf, flag );
??initItem_5:
        ; Setup parameters for call to function writeItem
        MOV     A,?V0 + 0
        MOV     ?V0 + 1,A
        MOV     R0,#?V0 + 1
        LCALL   ?PUSH_XSTACK_I_ONE
        CFI CFA_XSP16 add(XSP16, 17)
        MOV     ?V0 + 2,?V0 + 6
        MOV     ?V0 + 3,?V0 + 7
        MOV     R0,#?V0 + 2
        LCALL   ?PUSH_XSTACK_I_TWO
        CFI CFA_XSP16 add(XSP16, 19)
        MOV     R2,?V0 + 4
        MOV     R3,?V0 + 5
        MOV     A,R7
        MOV     R1,A
        LCALL   ??writeItem?relay
        MOV     A,#0x3
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 16)
        MOV     A,R1
        MOV     ?V0 + 1,A
//  737 
//  738     if ( pg == pgRes )
        MOV     DPTR,#pgRes
        MOVX    A,@DPTR
        XRL     A,R7
        JNZ     ??initItem_4
//  739     {
//  740       if ( flag )
        MOV     A,?V0 + 0
        JZ      ??initItem_6
//  741       {
//  742         compactPage( OSAL_NV_PAGE_BEG+idx );
        ; Setup parameters for call to function compactPage
        MOV     A,#0x3c
        ADD     A,R6
        MOV     R1,A
        LCALL   ??compactPage?relay
        SJMP    ??initItem_4
//  743       }
//  744       else
//  745       {
//  746         *(uint8 *)buf = OSAL_NV_PAGE_BEG+idx;
??initItem_6:
        MOV     A,#0x3c
        ADD     A,R6
        MOV     DPL,?V0 + 6
        MOV     DPH,?V0 + 7
        MOVX    @DPTR,A
//  747       }
//  748     }
//  749   }
//  750 
//  751   return rtrn;
??initItem_4:
        MOV     R1,?V0 + 1
        LJMP    ??Subroutine38_1 & 0xFFFF
        CFI EndBlock cfiBlock65
//  752 }

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine30:
        CFI Block cfiCond66 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_88
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        CFI Block cfiCond67 Using cfiCommon0
        CFI (cfiCond67) NoFunction
        CFI (cfiCond67) Conditional ??CrossCallReturnLabel_89
        CFI (cfiCond67) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond67) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond67) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond67) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond67) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond67) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond67) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond67) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond67) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond67) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond67) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond67) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond67) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond67) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond67) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond67) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond67) CFA_SP SP+0
        CFI (cfiCond67) CFA_XSP16 add(XSP16, 16)
        CFI Block cfiPicker68 Using cfiCommon1
        CFI (cfiPicker68) NoFunction
        CFI (cfiPicker68) Picker
        CLR     C
        RLC     A
        MOV     R0,A
        CLR     A
        RLC     A
        MOV     R1,A
        MOV     A,R0
        ADD     A,#(pgOff & 0xff)
        MOV     DPL,A
        MOV     A,R1
        ADDC    A,#((pgOff >> 8) & 0xff)
        MOV     DPH,A
        RET
        CFI EndBlock cfiCond66
        CFI EndBlock cfiCond67
        CFI EndBlock cfiPicker68

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine24:
        CFI Block cfiCond69 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_73
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 24)
        CFI Block cfiCond70 Using cfiCommon0
        CFI (cfiCond70) NoFunction
        CFI (cfiCond70) Conditional ??CrossCallReturnLabel_74
        CFI (cfiCond70) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond70) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond70) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond70) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond70) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond70) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond70) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond70) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond70) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond70) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond70) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond70) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond70) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond70) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond70) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond70) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond70) CFA_SP SP+0
        CFI (cfiCond70) CFA_XSP16 add(XSP16, 16)
        CFI Block cfiPicker71 Using cfiCommon1
        CFI (cfiPicker71) NoFunction
        CFI (cfiPicker71) Picker
        ADDC    A,R1
        MOV     R1,A
        CLR     C
        MOV     A,R0
        SUBB    A,#-0x7
        MOV     A,R1
        SUBB    A,#0x7
        RET
        CFI EndBlock cfiCond69
        CFI EndBlock cfiCond70
        CFI EndBlock cfiPicker71
//  753 
//  754 /*********************************************************************
//  755  * @fn      setItem
//  756  *
//  757  * @brief   Set an item Id or status to mark its state.
//  758  *
//  759  * @param   pg - Valid NV page.
//  760  * @param   offset - Valid offset into the page of the item data - the header
//  761  *                   offset is calculated from this.
//  762  * @param   stat - Valid enum value for the item status.
//  763  *
//  764  * @return  none
//  765  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  766 static void setItem( uint8 pg, uint16 offset, eNvHdrEnum stat )
setItem:
        CFI Block cfiBlock72 Using cfiCommon0
        CFI Function setItem
//  767 {
        FUNCALL setItem, nvReadHdr
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 20, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL setItem, writeWord
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 20, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL setItem, writeWord
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 20, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xc
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        ; Saved register size: 12
        ; Auto size: 8
        MOV     A,#-0x8
        LCALL   ?ALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 20)
        MOV     ?V0 + 0,R1
        MOV     A,R4
        MOV     R6,A
//  768   osalNvHdr_t hdr;
//  769 
//  770   offset -= OSAL_NV_HDR_SIZE;
        MOV     A,R2
        ADD     A,#-0x8
        MOV     ?V0 + 2,A
        MOV     A,R3
        ADDC    A,#-0x1
        MOV     ?V0 + 3,A
//  771   nvReadHdr( pg, offset, (uint8 *)(&hdr) );
        ; Setup parameters for call to function nvReadHdr
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     R2,?V0 + 2
        MOV     R3,A
        LCALL   nvReadHdr & 0xFFFF
//  772 
//  773   if ( stat == eNvXfer )
        MOV     A,R6
        JNZ     ??setItem_0
//  774   {
//  775     hdr.stat = OSAL_NV_ACTIVE;
        MOV     A,#0x6
        LCALL   ?XSTACK_DISP0_8
        CLR     A
        MOVX    @DPTR,A
        INC     DPTR
        MOVX    @DPTR,A
//  776     writeWord( pg, offset+OSAL_NV_HDR_CHK, (uint8*)(&(hdr.chk)) );
        ; Setup parameters for call to function writeWord
        MOV     A,#0x4
        LCALL   ?XSTACK_DISP0_8
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     A,#0x4
        ADD     A,?V0 + 2
        MOV     R2,A
        CLR     A
        ADDC    A,?V0 + 3
        MOV     R3,A
        MOV     R1,?V0 + 0
        LCALL   ??writeWord?relay
        SJMP    ??setItem_1
//  777   }
//  778   else // if ( stat == eNvZero )
//  779   {
//  780     uint16 sz = ((hdr.len + (OSAL_NV_WORD_SIZE-1)) / OSAL_NV_WORD_SIZE) * OSAL_NV_WORD_SIZE +
//  781                                                                           OSAL_NV_HDR_SIZE;
??setItem_0:
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine4 & 0xFFFF
??CrossCallReturnLabel_16:
        MOV     R6,A
        CLR     A
        ADDC    A,R1
        MOV     R7,A
//  782     hdr.id = 0;
        LCALL   ?Subroutine17 & 0xFFFF
//  783     writeWord( pg, offset, (uint8 *)(&hdr) );
??CrossCallReturnLabel_54:
        MOV     R2,?V0 + 2
        MOV     R3,?V0 + 3
        MOV     R1,?V0 + 0
        LCALL   ??writeWord?relay
//  784     pgLost[pg-OSAL_NV_PAGE_BEG] += sz;
        MOV     A,?V0 + 0
        CLR     C
        RLC     A
        MOV     R0,A
        CLR     A
        RLC     A
        MOV     R1,A
        LCALL   ?Subroutine36 & 0xFFFF
??CrossCallReturnLabel_104:
        MOVX    A,@DPTR
        ADD     A,R6
        MOVX    @DPTR,A
        INC     DPTR
        MOVX    A,@DPTR
        ADDC    A,R7
        MOVX    @DPTR,A
//  785   }
//  786 }
??setItem_1:
        MOV     A,#0x8
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 12)
        LJMP    ?Subroutine41 & 0xFFFF
        CFI EndBlock cfiBlock72
//  787 
//  788 /*********************************************************************
//  789  * @fn      calcChkB
//  790  *
//  791  * @brief   Calculates the data checksum over the 'buf' parameter.
//  792  *
//  793  * @param   pg - A valid NV Flash page.
//  794  * @param   offset - A valid offset into the page.
//  795  * @param   len - Byte count of the data to be checksummed.
//  796  *
//  797  * @return  Calculated checksum of the data bytes.
//  798  */
//  799 static uint16 calcChkB( uint16 len, uint8 *buf )
//  800 {
//  801   uint8 fill = len % OSAL_NV_WORD_SIZE;
//  802   uint16 chk;
//  803 
//  804   if ( !buf )
//  805   {
//  806     chk = len * OSAL_NV_ERASED;
//  807   }
//  808   else
//  809   {
//  810     chk = 0;
//  811     while ( len-- )
//  812     {
//  813       chk += *buf++;
//  814     }
//  815   }
//  816 
//  817   // calcChkF() will calculate over OSAL_NV_WORD_SIZE alignment.
//  818   if ( fill )
//  819   {
//  820     chk += (OSAL_NV_WORD_SIZE - fill) * OSAL_NV_ERASED;
//  821   }
//  822 
//  823   return chk;
//  824 }
//  825 
//  826 /*********************************************************************
//  827  * @fn      calcChkF
//  828  *
//  829  * @brief   Calculates the data checksum by reading the data bytes from NV.
//  830  *
//  831  * @param   pg - A valid NV Flash page.
//  832  * @param   offset - A valid offset into the page.
//  833  * @param   len - Byte count of the data to be checksummed.
//  834  *
//  835  * @return  Calculated checksum of the data bytes.
//  836  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  837 static uint16 calcChkF( byte pg, uint16 offset, uint16 len )
calcChkF:
        CFI Block cfiBlock73 Using cfiCommon0
        CFI Function calcChkF
//  838 {
        FUNCALL calcChkF, nvReadWord
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 20, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x10
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        ; Saved register size: 16
        ; Auto size: 4
        MOV     A,#-0x4
        LCALL   ?ALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 20)
        MOV     ?V0 + 0,R1
        MOV     ?V0 + 2,R2
        MOV     ?V0 + 3,R3
        MOV     A,R4
        MOV     R6,A
        MOV     A,R5
        MOV     R7,A
//  839   uint16 chk = 0;
        MOV     ?V0 + 6,#0x0
        MOV     ?V0 + 7,#0x0
//  840 
//  841   len = (len + (OSAL_NV_WORD_SIZE-1)) / OSAL_NV_WORD_SIZE;
        MOV     A,#0x3
        ADD     A,R6
        MOV     ?V0 + 4,A
        CLR     A
        ADDC    A,R7
        MOV     ?V0 + 5,A
        MOV     A,#0x2
        MOV     R0,#?V0 + 4
        LCALL   ?US_SHR
        MOV     R6,?V0 + 4
        MOV     R7,?V0 + 5
        SJMP    ??calcChkF_0
//  842 
//  843   while ( len-- )
//  844   {
//  845     uint8 cnt, tmp[OSAL_NV_WORD_SIZE];
//  846 
//  847     nvReadWord( pg, offset, tmp );
??calcChkF_1:
        ; Setup parameters for call to function nvReadWord
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     R2,?V0 + 2
        MOV     R3,?V0 + 3
        MOV     R1,?V0 + 0
        LCALL   nvReadWord & 0xFFFF
//  848     offset += OSAL_NV_WORD_SIZE;
        LCALL   ?Subroutine34 & 0xFFFF
//  849 
//  850     for ( cnt = 0; cnt < OSAL_NV_WORD_SIZE; cnt++ )
??CrossCallReturnLabel_100:
        MOV     R2,#0x0
//  851     {
//  852       chk += tmp[cnt];
??calcChkF_2:
        MOV     ?V0 + 4,R2
        LCALL   ?Subroutine26 & 0xFFFF
??CrossCallReturnLabel_79:
        MOVX    A,@DPTR
        MOV     R0,A
        MOV     A,?V0 + 6
        ADD     A,R0
        MOV     ?V0 + 6,A
        MOV     A,?V0 + 7
        ADDC    A,#0x0
        MOV     ?V0 + 7,A
//  853     }
        INC     R2
        MOV     A,R2
        CLR     C
        SUBB    A,#0x4
        JC      ??calcChkF_2
//  854   }
??calcChkF_0:
        MOV     A,R6
        MOV     R0,A
        MOV     A,R7
        MOV     R1,A
        MOV     A,#-0x1
        ADD     A,R0
        DEC     R6
        MOV     A,#-0x1
        ADDC    A,R1
        MOV     R7,A
        MOV     A,R0
        JNZ     ??calcChkF_3
        MOV     A,R1
??calcChkF_3:
        JNZ     ??calcChkF_1
//  855 
//  856   return chk;
        MOV     R2,?V0 + 6
        MOV     R3,?V0 + 7
        CFI EndBlock cfiBlock73
        REQUIRE ?Subroutine43
        ; // Fall through to label ?Subroutine43
//  857 }

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine43:
        CFI Block cfiBlock74 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 20)
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        MOV     A,#0x4
        LJMP    ??Subroutine38_0 & 0xFFFF
        CFI EndBlock cfiBlock74
//  858 
//  859 /*********************************************************************
//  860  * @fn      writeWord
//  861  *
//  862  * @brief   Writes a Flash-WORD to NV.
//  863  *
//  864  * @param   pg - A valid NV Flash page.
//  865  * @param   offset - A valid offset into the page.
//  866  * @param   buf - Pointer to source buffer.
//  867  *
//  868  * @return  none
//  869  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  870 static void writeWord( uint8 pg, uint16 offset, uint8 *buf )
writeWord:
        CFI Block cfiBlock75 Using cfiCommon0
        CFI Function writeWord
//  871 {
        FUNCALL writeWord, HalAdcCheckVdd
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL writeWord, flashWriteBuf
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xc
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        ; Saved register size: 12
        ; Auto size: 0
        MOV     ?V0 + 2,R2
        MOV     ?V0 + 3,R3
        MOV     A,R4
        MOV     R6,A
        MOV     A,R5
        MOV     R7,A
//  872     offset = (offset >> 2) + ((uint16)pg << 9);
        MOV     A,#0x2
        MOV     R0,#?V0 + 2
        LCALL   ?US_SHR
        MOV     ?V0 + 0,R1
        MOV     ?V0 + 1,A
        MOV     A,#0x9
        MOV     R0,#?V0 + 0
        LCALL   ?S_SHL
        ADD     A,?V0 + 2
        MOV     A,?V0 + 1
        ADDC    A,?V0 + 3
        MOV     ?V0 + 3,A
//  873 
//  874     if ( OSAL_NV_CHECK_BUS_VOLTAGE )
        ; Setup parameters for call to function HalAdcCheckVdd
        MOV     R1,#0x4
        LCALL   ??HalAdcCheckVdd?relay
        MOV     A,R1
        JZ      ??writeWord_0
//  875     {
//  876     flashWriteBuf(1, (uint16)buf, offset);
        ; Setup parameters for call to function flashWriteBuf
        MOV     R4,?V0 + 2
        MOV     R5,?V0 + 3
        MOV     A,R6
        MOV     R2,A
        MOV     A,R7
        MOV     R3,A
        MOV     R1,#0x1
        LCALL   flashWriteBuf & 0xFFFF
        SJMP    ??writeWord_1
//  877     }
//  878     else
//  879     {
//  880       failF = TRUE;
??writeWord_0:
        MOV     A,#0x1
        MOV     DPTR,#failF
        MOVX    @DPTR,A
//  881     }
//  882 }
??writeWord_1:
        LJMP    ?Subroutine41 & 0xFFFF
        CFI EndBlock cfiBlock75
//  883 
//  884 /*********************************************************************
//  885  * @fn      writeWordM
//  886  *
//  887  * @brief   Writes multiple Flash-WORDs to NV.
//  888  *
//  889  * @param   pg - A valid NV Flash page.
//  890  * @param   offset - A valid offset into the page.
//  891  * @param   buf - Pointer to source buffer.
//  892  * @param   cnt - Number of 4-byte blocks to write.
//  893  *
//  894  * @return  none
//  895  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  896 static void writeWordM( uint8 pg, uint16 offset, uint8 *buf, uint8 cnt )
writeWordM:
        CFI Block cfiBlock76 Using cfiCommon0
        CFI Function writeWordM
//  897 {
        FUNCALL writeWordM, HalAdcCheckVdd
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 14, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 14, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL writeWordM, flashWriteBuf
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 14, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 14, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xe
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 14)
        ; Saved register size: 14
        ; Auto size: 0
        MOV     ?V0 + 4,R2
        MOV     ?V0 + 5,R3
        MOV     A,R4
        MOV     R6,A
        MOV     A,R5
        MOV     R7,A
        MOV     A,#0xe
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        MOV     ?V0 + 2,A
//  898   offset = (offset >> 2) + ((uint16)pg << 9);
        MOV     A,#0x2
        MOV     R0,#?V0 + 4
        LCALL   ?US_SHR
        MOV     ?V0 + 0,R1
        MOV     ?V0 + 1,A
        MOV     A,#0x9
        MOV     R0,#?V0 + 0
        LCALL   ?S_SHL
        ADD     A,?V0 + 4
        MOV     A,?V0 + 1
        ADDC    A,?V0 + 5
        MOV     ?V0 + 5,A
//  899 
//  900   if ( OSAL_NV_CHECK_BUS_VOLTAGE )
        ; Setup parameters for call to function HalAdcCheckVdd
        MOV     R1,#0x4
        LCALL   ??HalAdcCheckVdd?relay
        MOV     A,R1
        JZ      ??writeWordM_0
//  901   {
//  902     flashWriteBuf(cnt, (uint16)buf, offset);
        ; Setup parameters for call to function flashWriteBuf
        MOV     R4,?V0 + 4
        MOV     R5,?V0 + 5
        MOV     A,R6
        MOV     R2,A
        MOV     A,R7
        MOV     R3,A
        MOV     R1,?V0 + 2
        LCALL   flashWriteBuf & 0xFFFF
        SJMP    ??writeWordM_1
//  903   }
//  904   else
//  905   {
//  906     failF = TRUE;
??writeWordM_0:
        MOV     A,#0x1
        MOV     DPTR,#failF
        MOVX    @DPTR,A
//  907   }
//  908 }
??writeWordM_1:
        LJMP    ?Subroutine40 & 0xFFFF
        CFI EndBlock cfiBlock76
//  909 
//  910 /*********************************************************************
//  911  * @fn      writeWordH
//  912  *
//  913  * @brief   Writes the 1st half of a Flash-WORD to NV (filling 2nd half with 0xffff).
//  914  *
//  915  * @param   pg - A valid NV Flash page.
//  916  * @param   offset - A valid offset into the page.
//  917  * @param   buf - Pointer to source buffer.
//  918  *
//  919  * @return  none
//  920  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  921 static void writeWordH( uint8 pg, uint16 offset, uint8 *buf )
writeWordH:
        CFI Block cfiBlock77 Using cfiCommon0
        CFI Function writeWordH
//  922 {
        FUNCALL writeWordH, writeWord
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 13, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 13, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x9
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 9)
        ; Saved register size: 9
        ; Auto size: 4
        MOV     A,#-0x4
        LCALL   ?ALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 13)
//  923   uint8 tmp[4];
//  924 
//  925   tmp[0] = buf[0];
        MOV     DPL,R4
        MOV     DPH,R5
        MOVX    A,@DPTR
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    @DPTR,A
//  926   tmp[1] = buf[1];
        MOV     DPL,R4
        MOV     DPH,R5
        INC     DPTR
        MOVX    A,@DPTR
        PUSH    A
        CFI CFA_SP SP+-1
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        POP     A
        CFI CFA_SP SP+0
        MOVX    @DPTR,A
//  927   tmp[2] = OSAL_NV_ERASED;
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOV     A,#-0x1
        MOVX    @DPTR,A
//  928   tmp[3] = OSAL_NV_ERASED;
        MOV     A,#0x3
        LCALL   ?XSTACK_DISP0_8
        MOV     A,#-0x1
        LCALL   ??Subroutine17_2 & 0xFFFF
//  929 
//  930   writeWord( pg, offset, tmp );
??CrossCallReturnLabel_57:
        LCALL   ??writeWord?relay
//  931 }
        MOV     A,#0x4
        LJMP    ?Subroutine39 & 0xFFFF
        CFI EndBlock cfiBlock77
//  932 
//  933 /*********************************************************************
//  934  * @fn      writeBuf
//  935  *
//  936  * @brief   Writes a data buffer to NV.
//  937  *
//  938  * @param   dstPg - A valid NV Flash page.
//  939  * @param   offset - A valid offset into the page.
//  940  * @param   len  - Byte count of the data to write.
//  941  * @param   buf  - The data to write.
//  942  *
//  943  * @return  TRUE if data buf checksum matches read back checksum, else FALSE.
//  944  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  945 static void writeBuf( uint8 dstPg, uint16 dstOff, uint16 len, uint8 *buf )
writeBuf:
        CFI Block cfiBlock78 Using cfiCommon0
        CFI Function writeBuf
//  946 {
        FUNCALL writeBuf, nvReadWord
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 20, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL writeBuf, writeWord
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 20, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL writeBuf, writeWordM
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 21, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 21, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL writeBuf, nvReadWord
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 20, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL writeBuf, writeWord
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 20, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x10
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        ; Saved register size: 16
        ; Auto size: 4
        MOV     A,#-0x4
        LCALL   ?ALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 20)
        MOV     ?V0 + 2,R1
        MOV     ?V0 + 0,R2
        MOV     ?V0 + 1,R3
        MOV     A,R4
        MOV     R6,A
        MOV     A,R5
        MOV     R7,A
        MOV     A,#0x14
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        MOV     ?V0 + 6,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     ?V0 + 7,A
//  947   uint8 rem = dstOff % OSAL_NV_WORD_SIZE;
        MOV     A,R2
        ANL     A,#0x3
        MOV     ?V0 + 3,A
//  948   uint8 tmp[OSAL_NV_WORD_SIZE];
//  949 
//  950   if ( rem )
        JZ      ??writeBuf_0
//  951   {
//  952     dstOff = (dstOff / OSAL_NV_WORD_SIZE) * OSAL_NV_WORD_SIZE;
        MOV     A,#-0x4
        ANL     A,?V0 + 0
        MOV     ?V0 + 0,A
//  953     nvReadWord( dstPg, dstOff, tmp );
        ; Setup parameters for call to function nvReadWord
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     R2,A
        LCALL   nvReadWord & 0xFFFF
        SJMP    ??writeBuf_1
//  954 
//  955     while ( (rem < OSAL_NV_WORD_SIZE) && len )
//  956     {
//  957       tmp[rem++] = *buf++;
??writeBuf_2:
        MOV     DPL,?V0 + 6
        MOV     DPH,?V0 + 7
        MOVX    A,@DPTR
        PUSH    A
        CFI CFA_SP SP+-1
        MOV     ?V0 + 4,?V0 + 3
        LCALL   ?Subroutine26 & 0xFFFF
??CrossCallReturnLabel_80:
        POP     A
        CFI CFA_SP SP+0
        LCALL   ?Subroutine18 & 0xFFFF
??CrossCallReturnLabel_58:
        INC     ?V0 + 3
//  958       len--;
        MOV     A,R6
        ADD     A,#-0x1
        DEC     R6
        MOV     A,R7
        ADDC    A,#-0x1
        MOV     R7,A
//  959     }
??writeBuf_1:
        MOV     A,?V0 + 3
        CLR     C
        SUBB    A,#0x4
        JNC     ??writeBuf_3
        MOV     A,R6
        JNZ     ??writeBuf_4
        MOV     A,R7
??writeBuf_4:
        JNZ     ??writeBuf_2
//  960 
//  961     writeWord( dstPg, dstOff, tmp );
??writeBuf_3:
        ; Setup parameters for call to function writeWord
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     R2,?V0 + 0
        MOV     R3,?V0 + 1
        MOV     R1,?V0 + 2
        LCALL   ??writeWord?relay
//  962     dstOff += OSAL_NV_WORD_SIZE;
        MOV     A,?V0 + 0
        ADD     A,#0x4
        MOV     ?V0 + 0,A
        MOV     A,?V0 + 1
        ADDC    A,#0x0
        MOV     ?V0 + 1,A
//  963   }
//  964 
//  965   rem = len % OSAL_NV_WORD_SIZE;
??writeBuf_0:
        MOV     A,R6
        ANL     A,#0x3
        MOV     ?V0 + 3,A
//  966   len /= OSAL_NV_WORD_SIZE;
        MOV     ?V0 + 4,R6
        MOV     ?V0 + 5,R7
        MOV     A,#0x2
        MOV     R0,#?V0 + 4
        LCALL   ?US_SHR
//  967 
//  968   if ( len )
        MOV     A,?V0 + 4
        JNZ     ??writeBuf_5
        MOV     A,?V0 + 5
??writeBuf_5:
        JZ      ??writeBuf_6
//  969   {
//  970     writeWordM( dstPg, dstOff, buf, (uint8)len );
        ; Setup parameters for call to function writeWordM
        MOV     R0,#?V0 + 4
        LCALL   ?PUSH_XSTACK_I_ONE
        CFI CFA_XSP16 add(XSP16, 21)
        MOV     R4,?V0 + 6
        MOV     R5,?V0 + 7
        MOV     R2,?V0 + 0
        MOV     R3,?V0 + 1
        MOV     R1,?V0 + 2
        LCALL   ??Subroutine20_0 & 0xFFFF
??CrossCallReturnLabel_65:
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 20)
//  971     dstOff += OSAL_NV_WORD_SIZE * len;
        MOV     A,#0x2
        MOV     R0,#?V0 + 4
        LCALL   ?S_SHL
        MOV     R0,?V0 + 4
        MOV     R1,?V0 + 5
        MOV     A,?V0 + 0
        ADD     A,R0
        MOV     ?V0 + 0,A
        MOV     A,?V0 + 1
        ADDC    A,R1
        MOV     ?V0 + 1,A
//  972     buf += OSAL_NV_WORD_SIZE * len;
        MOV     A,?V0 + 6
        ADD     A,R0
        MOV     ?V0 + 6,A
        MOV     A,?V0 + 7
        ADDC    A,R1
        MOV     ?V0 + 7,A
//  973   }
//  974 
//  975   if ( rem )
??writeBuf_6:
        MOV     A,?V0 + 3
        JZ      ??writeBuf_7
//  976   {
//  977     uint8 idx = 0;
        MOV     R6,#0x0
//  978     nvReadWord( dstPg, dstOff, tmp );
        ; Setup parameters for call to function nvReadWord
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     R2,?V0 + 0
        MOV     R3,?V0 + 1
        MOV     R1,?V0 + 2
        LCALL   nvReadWord & 0xFFFF
        SJMP    ??writeBuf_8
//  979     while ( rem-- )
//  980     {
//  981       tmp[idx++] = *buf++;
??writeBuf_9:
        MOV     DPL,?V0 + 6
        MOV     DPH,?V0 + 7
        MOVX    A,@DPTR
        PUSH    A
        CFI CFA_SP SP+-1
        MOV     ?V0 + 4,R6
        LCALL   ?Subroutine26 & 0xFFFF
??CrossCallReturnLabel_81:
        POP     A
        CFI CFA_SP SP+0
        LCALL   ?Subroutine18 & 0xFFFF
??CrossCallReturnLabel_59:
        INC     R6
//  982     }
??writeBuf_8:
        MOV     R2,?V0 + 3
        MOV     A,#-0x1
        ADD     A,R2
        MOV     ?V0 + 3,A
        MOV     A,R2
        JNZ     ??writeBuf_9
//  983     writeWord( dstPg, dstOff, tmp );
        ; Setup parameters for call to function writeWord
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     R2,?V0 + 0
        MOV     R3,?V0 + 1
        MOV     R1,?V0 + 2
        LCALL   ??writeWord?relay
//  984   }
//  985 }
??writeBuf_7:
        LJMP    ?Subroutine43 & 0xFFFF
        CFI EndBlock cfiBlock78

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine38:
        CFI Block cfiBlock79 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 26)
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        MOV     A,#0xa
??Subroutine38_0:
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 16)
??Subroutine38_1:
        MOV     R7,#0x8
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock79

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine26:
        CFI Block cfiCond80 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_79
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 20)
        CFI Block cfiCond81 Using cfiCommon0
        CFI (cfiCond81) NoFunction
        CFI (cfiCond81) Conditional ??CrossCallReturnLabel_80
        CFI (cfiCond81) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond81) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond81) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond81) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond81) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond81) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond81) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond81) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond81) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond81) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond81) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond81) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond81) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond81) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond81) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond81) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond81) CFA_SP SP+-1
        CFI (cfiCond81) CFA_XSP16 add(XSP16, 20)
        CFI Block cfiCond82 Using cfiCommon0
        CFI (cfiCond82) NoFunction
        CFI (cfiCond82) Conditional ??CrossCallReturnLabel_81
        CFI (cfiCond82) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond82) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond82) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond82) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond82) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond82) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond82) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond82) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond82) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond82) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond82) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond82) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond82) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond82) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond82) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond82) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond82) CFA_SP SP+-1
        CFI (cfiCond82) CFA_XSP16 add(XSP16, 20)
        CFI Block cfiPicker83 Using cfiCommon1
        CFI (cfiPicker83) NoFunction
        CFI (cfiPicker83) Picker
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     A,DPL
        ADD     A,?V0 + 4
        MOV     DPL,A
        MOV     A,DPH
        ADDC    A,#0x0
        MOV     DPH,A
        RET
        CFI EndBlock cfiCond80
        CFI EndBlock cfiCond81
        CFI EndBlock cfiCond82
        CFI EndBlock cfiPicker83

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine18:
        CFI Block cfiCond84 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_58
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 20)
        CFI Block cfiCond85 Using cfiCommon0
        CFI (cfiCond85) NoFunction
        CFI (cfiCond85) Conditional ??CrossCallReturnLabel_59
        CFI (cfiCond85) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond85) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond85) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond85) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond85) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond85) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond85) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond85) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond85) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond85) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond85) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond85) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond85) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond85) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond85) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond85) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond85) CFA_SP SP+0
        CFI (cfiCond85) CFA_XSP16 add(XSP16, 20)
        CFI Block cfiPicker86 Using cfiCommon1
        CFI (cfiPicker86) NoFunction
        CFI (cfiPicker86) Picker
        MOVX    @DPTR,A
        MOV     DPL,?V0 + 6
        MOV     DPH,?V0 + 7
        INC     DPTR
        MOV     ?V0 + 6,DPL
        MOV     ?V0 + 7,DPH
        RET
        CFI EndBlock cfiCond84
        CFI EndBlock cfiCond85
        CFI EndBlock cfiPicker86
//  986 
//  987 /*********************************************************************
//  988  * @fn      xferBuf
//  989  *
//  990  * @brief   Xfers an NV buffer from one location to another, enforcing OSAL_NV_WORD_SIZE writes.
//  991  *
//  992  * @return  none
//  993  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  994 static void xferBuf( uint8 srcPg, uint16 srcOff, uint8 dstPg, uint16 dstOff, uint16 len )
xferBuf:
        CFI Block cfiBlock87 Using cfiCommon0
        CFI Function xferBuf
//  995 {
        FUNCALL xferBuf, nvReadWord
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 21, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 21, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL xferBuf, nvReadByte
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 21, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 21, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL xferBuf, writeWord
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 21, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 21, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL xferBuf, nvReadWord
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 21, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 21, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL xferBuf, writeWord
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 21, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 21, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL xferBuf, nvReadWord
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 21, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 21, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL xferBuf, nvReadByte
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 21, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 21, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL xferBuf, writeWord
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 21, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 21, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xf
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 15)
        ; Saved register size: 15
        ; Auto size: 6
        MOV     A,#-0x6
        LCALL   ?ALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 21)
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     A,R2
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R3
        MOVX    @DPTR,A
        MOV     ?V0 + 6,R1
        MOV     ?V0 + 1,R4
        MOV     A,#0x15
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine7 & 0xFFFF
??CrossCallReturnLabel_25:
        MOV     A,#0x17
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        MOV     R6,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R7,A
//  996   uint8 rem = dstOff % OSAL_NV_WORD_SIZE;
        MOV     A,?V0 + 2
        ANL     A,#0x3
        MOV     ?V0 + 0,A
//  997   uint8 tmp[OSAL_NV_WORD_SIZE];
//  998 
//  999   if ( rem )
        JZ      ??CrossCallReturnLabel_67
// 1000   {
// 1001     dstOff -= rem;
        MOV     ?V0 + 4,A
        CLR     C
        MOV     A,?V0 + 2
        SUBB    A,?V0 + 4
        MOV     ?V0 + 2,A
        MOV     A,?V0 + 3
        SUBB    A,#0x0
        MOV     ?V0 + 3,A
// 1002     nvReadWord( dstPg, dstOff, tmp );
        ; Setup parameters for call to function nvReadWord
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     R2,?V0 + 2
        MOV     R3,?V0 + 3
        MOV     R1,?V0 + 1
        LCALL   nvReadWord & 0xFFFF
        SJMP    ??xferBuf_0
// 1003 
// 1004     while ( (rem < OSAL_NV_WORD_SIZE) && len )
// 1005     {
// 1006       nvReadByte( srcPg, srcOff, tmp+rem );
??xferBuf_1:
        ; Setup parameters for call to function nvReadByte
        MOV     ?V0 + 4,?V0 + 0
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine1 & 0xFFFF
// 1007       srcOff++;
// 1008       rem++;
??CrossCallReturnLabel_4:
        INC     ?V0 + 0
// 1009       len--;
        MOV     A,R6
        ADD     A,#-0x1
        DEC     R6
        MOV     A,R7
        ADDC    A,#-0x1
        MOV     R7,A
// 1010     }
??xferBuf_0:
        MOV     A,?V0 + 0
        CLR     C
        SUBB    A,#0x4
        JNC     ??xferBuf_2
        MOV     A,R6
        JNZ     ??xferBuf_3
        MOV     A,R7
??xferBuf_3:
        JNZ     ??xferBuf_1
// 1011 
// 1012     writeWord( dstPg, dstOff, tmp );
??xferBuf_2:
        ; Setup parameters for call to function writeWord
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine21 & 0xFFFF
// 1013     dstOff += OSAL_NV_WORD_SIZE;
// 1014   }
// 1015 
// 1016   rem = len % OSAL_NV_WORD_SIZE;
??CrossCallReturnLabel_67:
        MOV     A,R6
        ANL     A,#0x3
        MOV     ?V0 + 0,A
// 1017   len /= OSAL_NV_WORD_SIZE;
        MOV     ?V0 + 4,R6
        MOV     ?V0 + 5,R7
        MOV     A,#0x2
        MOV     R0,#?V0 + 4
        LCALL   ?US_SHR
        MOV     R6,?V0 + 4
        MOV     R7,?V0 + 5
        SJMP    ??CrossCallReturnLabel_68
// 1018 
// 1019   while ( len-- )
// 1020   {
// 1021     nvReadWord( srcPg, srcOff, tmp );
??xferBuf_4:
        ; Setup parameters for call to function nvReadWord
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        LCALL   ?Subroutine12 & 0xFFFF
??CrossCallReturnLabel_38:
        MOV     R1,?V0 + 6
        LCALL   nvReadWord & 0xFFFF
// 1022     srcOff += OSAL_NV_WORD_SIZE;
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    A,@DPTR
        ADD     A,#0x4
        LCALL   ?Subroutine33 & 0xFFFF
// 1023     writeWord( dstPg, dstOff, tmp );
??CrossCallReturnLabel_98:
        ; Setup parameters for call to function writeWord
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine21 & 0xFFFF
// 1024     dstOff += OSAL_NV_WORD_SIZE;
// 1025   }
??CrossCallReturnLabel_68:
        MOV     A,R6
        MOV     R0,A
        MOV     A,R7
        MOV     R1,A
        MOV     A,#-0x1
        ADD     A,R0
        DEC     R6
        MOV     A,#-0x1
        ADDC    A,R1
        MOV     R7,A
        MOV     A,R0
        JNZ     ??xferBuf_5
        MOV     A,R1
??xferBuf_5:
        JNZ     ??xferBuf_4
// 1026 
// 1027   if ( rem )
        MOV     A,?V0 + 0
        JZ      ??xferBuf_6
// 1028   {
// 1029     uint8 idx = 0;
        MOV     R6,#0x0
// 1030     nvReadWord( dstPg, dstOff, tmp );
        ; Setup parameters for call to function nvReadWord
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     R2,?V0 + 2
        MOV     R3,?V0 + 3
        MOV     R1,?V0 + 1
        LCALL   nvReadWord & 0xFFFF
        SJMP    ??xferBuf_7
// 1031     while ( rem-- )
// 1032     {
// 1033       nvReadByte( srcPg, srcOff, tmp+idx );
??xferBuf_8:
        ; Setup parameters for call to function nvReadByte
        MOV     ?V0 + 4,R6
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine1 & 0xFFFF
// 1034       srcOff++;
// 1035       idx++;
??CrossCallReturnLabel_5:
        INC     R6
// 1036     }
??xferBuf_7:
        MOV     R2,?V0 + 0
        MOV     A,#-0x1
        ADD     A,R2
        MOV     ?V0 + 0,A
        MOV     A,R2
        JNZ     ??xferBuf_8
// 1037     writeWord( dstPg, dstOff, tmp );
        ; Setup parameters for call to function writeWord
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     R2,?V0 + 2
        MOV     R3,?V0 + 3
        MOV     R1,?V0 + 1
        LCALL   ??writeWord?relay
// 1038   }
// 1039 }
??xferBuf_6:
        MOV     A,#0x6
        CFI EndBlock cfiBlock87
        REQUIRE ?Subroutine42
        ; // Fall through to label ?Subroutine42

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine42:
        CFI Block cfiBlock88 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 21)
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI Invalid
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 15)
        CFI Valid
        MOV     R7,#0x7
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock88

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine21:
        CFI Block cfiCond89 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_67
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 21)
        CFI Block cfiCond90 Using cfiCommon0
        CFI (cfiCond90) NoFunction
        CFI (cfiCond90) Conditional ??CrossCallReturnLabel_68
        CFI (cfiCond90) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond90) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond90) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond90) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond90) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond90) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond90) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond90) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond90) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond90) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond90) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond90) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond90) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond90) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond90) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond90) CFA_SP SP+0
        CFI (cfiCond90) CFA_XSP16 add(XSP16, 21)
        CFI Block cfiPicker91 Using cfiCommon1
        CFI (cfiPicker91) NoFunction
        CFI (cfiPicker91) Picker
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     R2,?V0 + 2
        MOV     R3,?V0 + 3
        MOV     R1,?V0 + 1
        LCALL   ??writeWord?relay
        LCALL   ?Subroutine34 & 0xFFFF
??CrossCallReturnLabel_101:
        RET
        CFI EndBlock cfiCond89
        CFI EndBlock cfiCond90
        CFI EndBlock cfiPicker91

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine34:
        CFI Block cfiCond92 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_100
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 20)
        CFI Block cfiCond93 Using cfiCommon0
        CFI (cfiCond93) NoFunction
        CFI (cfiCond93) Conditional ??CrossCallReturnLabel_101, ??CrossCallReturnLabel_67
        CFI (cfiCond93) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond93) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond93) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond93) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond93) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond93) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond93) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond93) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond93) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond93) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond93) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond93) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond93) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond93) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond93) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond93) CFA_SP SP+0
        CFI (cfiCond93) CFA_XSP16 add(XSP16, 21)
        CFI Block cfiCond94 Using cfiCommon0
        CFI (cfiCond94) NoFunction
        CFI (cfiCond94) Conditional ??CrossCallReturnLabel_101, ??CrossCallReturnLabel_68
        CFI (cfiCond94) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond94) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond94) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond94) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond94) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond94) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond94) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond94) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond94) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond94) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond94) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond94) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond94) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond94) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond94) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond94) CFA_SP SP+0
        CFI (cfiCond94) CFA_XSP16 add(XSP16, 21)
        CFI Block cfiPicker95 Using cfiCommon1
        CFI (cfiPicker95) NoFunction
        CFI (cfiPicker95) Picker
        MOV     A,?V0 + 2
        ADD     A,#0x4
        MOV     ?V0 + 2,A
        MOV     A,?V0 + 3
        ADDC    A,#0x0
        MOV     ?V0 + 3,A
        RET
        CFI EndBlock cfiCond92
        CFI EndBlock cfiCond93
        CFI EndBlock cfiCond94
        CFI EndBlock cfiPicker95

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine1:
        CFI Block cfiCond96 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_4
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 21)
        CFI Block cfiCond97 Using cfiCommon0
        CFI (cfiCond97) NoFunction
        CFI (cfiCond97) Conditional ??CrossCallReturnLabel_5
        CFI (cfiCond97) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond97) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond97) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond97) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond97) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond97) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond97) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond97) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond97) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond97) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond97) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond97) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond97) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond97) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond97) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond97) CFA_SP SP+0
        CFI (cfiCond97) CFA_XSP16 add(XSP16, 21)
        CFI Block cfiPicker98 Using cfiCommon1
        CFI (cfiPicker98) NoFunction
        CFI (cfiPicker98) Picker
        MOV     A,DPL
        ADD     A,?V0 + 4
        MOV     R4,A
        MOV     A,DPH
        ADDC    A,#0x0
        MOV     R5,A
        LCALL   ?Subroutine32 & 0xFFFF
??CrossCallReturnLabel_92:
        MOV     R1,?V0 + 6
        LCALL   nvReadByte & 0xFFFF
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    A,@DPTR
        ADD     A,#0x1
        LCALL   ?Subroutine33 & 0xFFFF
??CrossCallReturnLabel_99:
        RET
        CFI EndBlock cfiCond96
        CFI EndBlock cfiCond97
        CFI EndBlock cfiPicker98

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine33:
        CFI Block cfiCond99 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_97
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 24)
        CFI Block cfiCond100 Using cfiCommon0
        CFI (cfiCond100) NoFunction
        CFI (cfiCond100) Conditional ??CrossCallReturnLabel_98
        CFI (cfiCond100) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond100) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond100) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond100) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond100) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond100) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond100) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond100) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond100) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond100) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond100) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond100) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond100) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond100) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond100) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond100) CFA_SP SP+0
        CFI (cfiCond100) CFA_XSP16 add(XSP16, 21)
        CFI Block cfiCond101 Using cfiCommon0
        CFI (cfiCond101) NoFunction
        CFI (cfiCond101) Conditional ??CrossCallReturnLabel_99, ??CrossCallReturnLabel_4
        CFI (cfiCond101) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond101) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond101) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond101) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond101) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond101) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond101) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond101) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond101) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond101) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond101) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond101) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond101) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond101) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond101) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond101) CFA_SP SP+0
        CFI (cfiCond101) CFA_XSP16 add(XSP16, 21)
        CFI Block cfiCond102 Using cfiCommon0
        CFI (cfiCond102) NoFunction
        CFI (cfiCond102) Conditional ??CrossCallReturnLabel_99, ??CrossCallReturnLabel_5
        CFI (cfiCond102) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond102) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond102) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond102) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond102) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond102) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond102) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond102) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond102) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond102) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond102) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond102) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond102) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond102) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond102) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond102) CFA_SP SP+0
        CFI (cfiCond102) CFA_XSP16 add(XSP16, 21)
        CFI Block cfiPicker103 Using cfiCommon1
        CFI (cfiPicker103) NoFunction
        CFI (cfiPicker103) Picker
        MOVX    @DPTR,A
        INC     DPTR
        MOVX    A,@DPTR
        ADDC    A,#0x0
        MOVX    @DPTR,A
        RET
        CFI EndBlock cfiCond99
        CFI EndBlock cfiCond100
        CFI EndBlock cfiCond101
        CFI EndBlock cfiCond102
        CFI EndBlock cfiPicker103
// 1040 
// 1041 /*********************************************************************
// 1042  * @fn      writeItem
// 1043  *
// 1044  * @brief   Writes an item header/data combo to the specified NV page.
// 1045  *
// 1046  * @param   pg - Valid NV Flash page.
// 1047  * @param   id - Valid NV item Id.
// 1048  * @param   len  - Byte count of the data to write.
// 1049  * @param   buf  - The data to write. If NULL, no data/checksum write.
// 1050  * @param   flag - TRUE if the checksum should be written, FALSE otherwise.
// 1051  *
// 1052  * @return  TRUE if header/data to write matches header/data read back, else FALSE.
// 1053  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
// 1054 static uint8 writeItem( uint8 pg, uint16 id, uint16 len, void *buf, uint8 flag )
writeItem:
        CFI Block cfiBlock104 Using cfiCommon0
        CFI Function writeItem
// 1055 {
        FUNCALL writeItem, setPageUse
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 26, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL writeItem, writeWord
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 26, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL writeItem, nvReadHdr
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 26, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL writeItem, writeBuf
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 28, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 28, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL writeItem, calcChkF
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 26, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL writeItem, writeWordH
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 26, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL writeItem, nvReadHdr
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 26, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 26, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x10
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        ; Saved register size: 16
        ; Auto size: 10
        MOV     A,#-0xa
        LCALL   ?ALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 26)
        MOV     A,R1
        MOV     R6,A
        MOV     ?V0 + 6,R2
        MOV     ?V0 + 7,R3
        MOV     ?V0 + 4,R4
        MOV     ?V0 + 5,R5
        MOV     A,#0x1c
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        MOV     ?V0 + 2,A
// 1056   uint16 offset = pgOff[pg-OSAL_NV_PAGE_BEG];
        LCALL   ?Subroutine25 & 0xFFFF
??CrossCallReturnLabel_77:
        LCALL   ?Subroutine6 & 0xFFFF
// 1057   uint8 rtrn = FALSE;
??CrossCallReturnLabel_22:
        MOV     R7,#0x0
// 1058   osalNvHdr_t hdr;
// 1059 
// 1060   if ( pg == pgRes )
        MOV     DPTR,#pgRes
        MOVX    A,@DPTR
        XRL     A,R6
        JNZ     ??writeItem_0
// 1061   {
// 1062     /* Mark reserve page as being active, in process of receiving items.
// 1063      * Invoking function must effect a page compaction.
// 1064      */
// 1065     setPageUse( pg, FALSE );
        ; Setup parameters for call to function setPageUse
        MOV     R2,#0x0
        MOV     A,R6
        MOV     R1,A
        LCALL   ??setPageUse?relay
// 1066   }
// 1067 
// 1068   hdr.id = id;
??writeItem_0:
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOV     A,?V0 + 6
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,?V0 + 7
        MOVX    @DPTR,A
// 1069   hdr.len = len;
        MOV     A,#0x4
        LCALL   ?XSTACK_DISP0_8
        MOV     A,?V0 + 4
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,?V0 + 5
        MOVX    @DPTR,A
// 1070 
// 1071   writeWord( pg, offset, (uint8 *)&hdr );
        ; Setup parameters for call to function writeWord
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     R2,?V0 + 0
        MOV     R3,?V0 + 1
        MOV     A,R6
        MOV     R1,A
        LCALL   ??writeWord?relay
// 1072   nvReadHdr( pg, offset, (uint8 *)(&hdr) );
        ; Setup parameters for call to function nvReadHdr
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     R2,?V0 + 0
        MOV     R3,?V0 + 1
        MOV     A,R6
        MOV     R1,A
        LCALL   nvReadHdr & 0xFFFF
// 1073 
// 1074   if ( (hdr.id == id) && (hdr.len == len) )
        MOVX    A,@DPTR
        XRL     A,?V0 + 6
        JNZ     ??writeItem_1
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,?V0 + 7
??writeItem_1:
        JZ      $+5
        LJMP    ??writeItem_2 & 0xFFFF
        MOV     A,#0x4
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,?V0 + 4
        JNZ     ??writeItem_3
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,?V0 + 5
??writeItem_3:
        JZ      $+5
        LJMP    ??writeItem_2 & 0xFFFF
// 1075   {
// 1076     if ( flag )
        MOV     A,?V0 + 2
        JNZ     $+5
        LJMP    ??writeItem_4 & 0xFFFF
// 1077     {
// 1078       uint16 chk = calcChkB( len, buf );
        MOV     A,#0x1a
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine2 & 0xFFFF
??CrossCallReturnLabel_8:
        MOV     DPL,R0
        MOV     DPH,R1
        MOV     R0,?V0 + 4
        MOV     R1,?V0 + 5
        MOV     A,R0
        ANL     A,#0x3
        MOV     ?V0 + 2,A
        MOV     A,DPL
        JNZ     ??writeItem_5
        MOV     A,DPH
??writeItem_5:
        JNZ     ??writeItem_6
        MOV     A,R0
        MOV     B,#-0x1
        MUL     AB
        MOV     R0,A
        MOV     R2,B
        MOV     B,#-0x1
        MOV     A,R1
        MUL     AB
        ADD     A,R2
        MOV     R1,A
        MOV     A,R0
        MOV     R2,A
        MOV     A,R1
        MOV     R3,A
        SJMP    ??writeItem_7
??writeItem_6:
        MOV     R2,#0x0
        MOV     R3,#0x0
        SJMP    ??writeItem_8
??writeItem_9:
        MOVX    A,@DPTR
        MOV     R4,A
        MOV     A,R2
        ADD     A,R4
        MOV     R2,A
        MOV     A,R3
        ADDC    A,#0x0
        MOV     R3,A
        INC     DPTR
??writeItem_8:
        MOV     A,R0
        MOV     R4,A
        MOV     A,R1
        MOV     R5,A
        MOV     A,#-0x1
        ADD     A,R4
        DEC     R0
        MOV     A,#-0x1
        ADDC    A,R5
        MOV     R1,A
        MOV     A,R4
        JNZ     ??writeItem_10
        MOV     A,R5
??writeItem_10:
        JNZ     ??writeItem_9
??writeItem_7:
        MOV     A,?V0 + 2
        JZ      ??writeItem_11
        MOV     A,#0x4
        CLR     C
        SUBB    A,?V0 + 2
        MOV     R0,A
        CLR     A
        SUBB    A,#0x0
        MOV     R1,A
        MOV     A,R0
        MOV     B,#-0x1
        MUL     AB
        MOV     R0,A
        MOV     R4,B
        MOV     B,#-0x1
        MOV     A,R1
        MUL     AB
        ADD     A,R4
        MOV     R1,A
        MOV     A,R2
        ADD     A,R0
        MOV     R2,A
        MOV     A,R3
        ADDC    A,R1
        MOV     R3,A
??writeItem_11:
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     A,R2
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R3
        MOVX    @DPTR,A
// 1079   
// 1080       offset += OSAL_NV_HDR_SIZE;
        LCALL   ?Subroutine23 & 0xFFFF
// 1081       if ( buf != NULL )
??CrossCallReturnLabel_72:
        MOV     A,#0x1a
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        JNZ     ??writeItem_12
        INC     DPTR
        MOVX    A,@DPTR
??writeItem_12:
        JZ      ??writeItem_13
// 1082       {
// 1083         writeBuf( pg, offset, len, buf );
        ; Setup parameters for call to function writeBuf
        MOV     A,#0x1a
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?PUSH_XSTACK8_X_TWO
        CFI CFA_XSP16 add(XSP16, 28)
        MOV     R4,?V0 + 4
        MOV     R5,?V0 + 5
        MOV     R2,?V0 + 0
        MOV     R3,?V0 + 1
        MOV     A,R6
        MOV     R1,A
        LCALL   ??writeBuf?relay
        MOV     A,#0x2
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 26)
// 1084       }
// 1085   
// 1086       if ( chk == calcChkF( pg, offset, len ) )
??writeItem_13:
        ; Setup parameters for call to function calcChkF
        MOV     R4,?V0 + 4
        MOV     R5,?V0 + 5
        MOV     R2,?V0 + 0
        MOV     R3,?V0 + 1
        MOV     A,R6
        MOV     R1,A
        LCALL   ?Subroutine28 & 0xFFFF
??CrossCallReturnLabel_85:
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    A,@DPTR
        XRL     A,R0
        JNZ     ??writeItem_14
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,R1
??writeItem_14:
        JNZ     ??writeItem_2
// 1087       {
// 1088         writeWordH( pg, (offset-OSAL_NV_WORD_SIZE), (uint8 *)&chk );
        ; Setup parameters for call to function writeWordH
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     A,#-0x4
        LCALL   ?Subroutine22 & 0xFFFF
??CrossCallReturnLabel_69:
        LCALL   ??writeWordH?relay
// 1089         nvReadHdr( pg, (offset-OSAL_NV_HDR_SIZE), (uint8 *)(&hdr) );
        ; Setup parameters for call to function nvReadHdr
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     A,#-0x8
        LCALL   ?Subroutine22 & 0xFFFF
??CrossCallReturnLabel_70:
        LCALL   nvReadHdr & 0xFFFF
// 1090   
// 1091         if ( chk == hdr.chk )
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        LCALL   ?Subroutine2 & 0xFFFF
??CrossCallReturnLabel_9:
        MOV     A,#0x6
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,R0
        JNZ     ??writeItem_15
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,R1
??writeItem_15:
        JNZ     ??writeItem_2
// 1092         {
// 1093           rtrn = pg;
??writeItem_4:
        MOV     A,R6
        MOV     R7,A
// 1094         }
// 1095       }
// 1096     }
// 1097     else
// 1098     {
// 1099       rtrn = pg;
// 1100     }
// 1101   }
// 1102 
// 1103   len = OSAL_NV_ITEM_SIZE( hdr.len );
// 1104   pgOff[pg-OSAL_NV_PAGE_BEG] += len;
??writeItem_2:
        MOV     A,#0x4
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine4 & 0xFFFF
??CrossCallReturnLabel_17:
        MOV     R2,A
        CLR     A
        ADDC    A,R1
        MOV     R3,A
        LCALL   ?Subroutine25 & 0xFFFF
??CrossCallReturnLabel_78:
        MOVX    A,@DPTR
        ADD     A,R2
        MOVX    @DPTR,A
        INC     DPTR
        MOVX    A,@DPTR
        ADDC    A,R3
        MOVX    @DPTR,A
// 1105 
// 1106   return rtrn;
        MOV     A,R7
        MOV     R1,A
        LJMP    ?Subroutine38 & 0xFFFF
        CFI EndBlock cfiBlock104
// 1107 }

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine28:
        CFI Block cfiCond105 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_84
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 24)
        CFI Block cfiCond106 Using cfiCommon0
        CFI (cfiCond106) NoFunction
        CFI (cfiCond106) Conditional ??CrossCallReturnLabel_85
        CFI (cfiCond106) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond106) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond106) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond106) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond106) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond106) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond106) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond106) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond106) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond106) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond106) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond106) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond106) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond106) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond106) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond106) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond106) CFA_SP SP+0
        CFI (cfiCond106) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiPicker107 Using cfiCommon1
        CFI (cfiPicker107) NoFunction
        CFI (cfiPicker107) Picker
        LCALL   ??calcChkF?relay
        MOV     ?V0 + 2,R2
        MOV     ?V0 + 3,R3
        MOV     R0,?V0 + 2
        MOV     R1,?V0 + 3
        RET
        CFI EndBlock cfiCond105
        CFI EndBlock cfiCond106
        CFI EndBlock cfiPicker107

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine23:
        CFI Block cfiCond108 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_71
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 24)
        CFI Block cfiCond109 Using cfiCommon0
        CFI (cfiCond109) NoFunction
        CFI (cfiCond109) Conditional ??CrossCallReturnLabel_72
        CFI (cfiCond109) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond109) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond109) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond109) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond109) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond109) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond109) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond109) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond109) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond109) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond109) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond109) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond109) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond109) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond109) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond109) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond109) CFA_SP SP+0
        CFI (cfiCond109) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiPicker110 Using cfiCommon1
        CFI (cfiPicker110) NoFunction
        CFI (cfiPicker110) Picker
        MOV     A,?V0 + 0
        ADD     A,#0x8
        MOV     ?V0 + 0,A
        MOV     A,?V0 + 1
        ADDC    A,#0x0
        MOV     ?V0 + 1,A
        RET
        CFI EndBlock cfiCond108
        CFI EndBlock cfiCond109
        CFI EndBlock cfiPicker110

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine22:
        CFI Block cfiCond111 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_69
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond112 Using cfiCommon0
        CFI (cfiCond112) NoFunction
        CFI (cfiCond112) Conditional ??CrossCallReturnLabel_70
        CFI (cfiCond112) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond112) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond112) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond112) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond112) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond112) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond112) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond112) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond112) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond112) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond112) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond112) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond112) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond112) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond112) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond112) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond112) CFA_SP SP+0
        CFI (cfiCond112) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiPicker113 Using cfiCommon1
        CFI (cfiPicker113) NoFunction
        CFI (cfiPicker113) Picker
        ADD     A,?V0 + 0
        MOV     R2,A
        MOV     A,#-0x1
        ADDC    A,?V0 + 1
        MOV     R3,A
        MOV     A,R6
        MOV     R1,A
        RET
        CFI EndBlock cfiCond111
        CFI EndBlock cfiCond112
        CFI EndBlock cfiPicker113

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine4:
        CFI Block cfiCond114 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_16
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 20)
        CFI Block cfiCond115 Using cfiCommon0
        CFI (cfiCond115) NoFunction
        CFI (cfiCond115) Conditional ??CrossCallReturnLabel_17
        CFI (cfiCond115) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond115) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond115) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond115) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond115) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond115) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond115) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond115) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond115) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond115) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond115) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond115) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond115) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond115) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond115) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond115) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond115) CFA_SP SP+0
        CFI (cfiCond115) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiPicker116 Using cfiCommon1
        CFI (cfiPicker116) NoFunction
        CFI (cfiPicker116) Picker
        LCALL   ?Subroutine31 & 0xFFFF
??CrossCallReturnLabel_90:
        MOV     R0,A
        MOV     A,#0x8
        ADD     A,R0
        RET
        CFI EndBlock cfiCond114
        CFI EndBlock cfiCond115
        CFI EndBlock cfiPicker116

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine2:
        CFI Block cfiCond117 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_6
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+-2
        CFI CFA_XSP16 add(XSP16, 24)
        CFI Block cfiCond118 Using cfiCommon0
        CFI (cfiCond118) NoFunction
        CFI (cfiCond118) Conditional ??CrossCallReturnLabel_7
        CFI (cfiCond118) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond118) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond118) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond118) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond118) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond118) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond118) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond118) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond118) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond118) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond118) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond118) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond118) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond118) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond118) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond118) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond118) CFA_SP SP+-2
        CFI (cfiCond118) CFA_XSP16 add(XSP16, 16)
        CFI Block cfiCond119 Using cfiCommon0
        CFI (cfiCond119) NoFunction
        CFI (cfiCond119) Conditional ??CrossCallReturnLabel_8
        CFI (cfiCond119) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond119) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond119) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond119) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond119) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond119) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond119) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond119) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond119) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond119) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond119) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond119) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond119) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond119) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond119) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond119) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond119) CFA_SP SP+0
        CFI (cfiCond119) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond120 Using cfiCommon0
        CFI (cfiCond120) NoFunction
        CFI (cfiCond120) Conditional ??CrossCallReturnLabel_9
        CFI (cfiCond120) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond120) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond120) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond120) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond120) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond120) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond120) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond120) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond120) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond120) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond120) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond120) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond120) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond120) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond120) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond120) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond120) CFA_SP SP+0
        CFI (cfiCond120) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond121 Using cfiCommon0
        CFI (cfiCond121) NoFunction
        CFI (cfiCond121) Conditional ??CrossCallReturnLabel_10
        CFI (cfiCond121) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond121) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond121) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond121) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond121) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond121) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond121) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond121) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond121) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond121) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond121) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond121) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond121) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond121) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond121) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond121) CFA_SP SP+-2
        CFI (cfiCond121) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiCond122 Using cfiCommon0
        CFI (cfiCond122) NoFunction
        CFI (cfiCond122) Conditional ??CrossCallReturnLabel_11
        CFI (cfiCond122) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond122) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond122) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond122) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond122) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond122) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond122) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond122) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond122) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond122) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond122) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond122) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond122) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond122) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond122) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond122) CFA_SP SP+0
        CFI (cfiCond122) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiCond123 Using cfiCommon0
        CFI (cfiCond123) NoFunction
        CFI (cfiCond123) Conditional ??CrossCallReturnLabel_12
        CFI (cfiCond123) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond123) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond123) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond123) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond123) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond123) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond123) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond123) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond123) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond123) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond123) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond123) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond123) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond123) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond123) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond123) CFA_SP SP+-2
        CFI (cfiCond123) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiCond124 Using cfiCommon0
        CFI (cfiCond124) NoFunction
        CFI (cfiCond124) Conditional ??CrossCallReturnLabel_13
        CFI (cfiCond124) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond124) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond124) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond124) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond124) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond124) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond124) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond124) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond124) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond124) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond124) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond124) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond124) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond124) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond124) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond124) CFA_SP SP+0
        CFI (cfiCond124) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiPicker125 Using cfiCommon1
        CFI (cfiPicker125) NoFunction
        CFI (cfiPicker125) Picker
        MOVX    A,@DPTR
        MOV     R0,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R1,A
        RET
        CFI EndBlock cfiCond117
        CFI EndBlock cfiCond118
        CFI EndBlock cfiCond119
        CFI EndBlock cfiCond120
        CFI EndBlock cfiCond121
        CFI EndBlock cfiCond122
        CFI EndBlock cfiCond123
        CFI EndBlock cfiCond124
        CFI EndBlock cfiPicker125
// 1108 
// 1109 /*********************************************************************
// 1110  * @fn      writeIEEE
// 1111  *
// 1112  * @brief   Writes special location / protocol for the IEEE. The global 'failF' should have been
// 1113  *          cleared before invoking.
// 1114  *
// 1115  * @param   buf  - The data to write.
// 1116  *
// 1117  * @return  TRUE if header/data to write matches header/data read back, else FALSE.
// 1118  */
// 1119 static uint8 writeIEEE( void *buf )
// 1120 {
// 1121   osalNvHdr_t hdr;
// 1122   nvReadHdr( OSAL_NV_IEEE_PAGE, OSAL_NV_IEEE_OFFSET, (uint8 *)(&hdr) );
// 1123 
// 1124   if ( (hdr.id == OSAL_NV_ERASED_ID) && (hdr.len == OSAL_NV_ERASED_ID) &&
// 1125        (hdr.chk == OSAL_NV_ERASED_ID) && (hdr.stat == OSAL_NV_ERASED_ID) )
// 1126   {
// 1127     writeWordM( OSAL_NV_IEEE_PAGE, OSAL_NV_IEEE_OFFSET, buf, 2 );
// 1128     return ((failF) ? NV_OPER_FAILED : ZSUCCESS);
// 1129   }
// 1130   else
// 1131   {
// 1132     return NV_OPER_FAILED;
// 1133   }
// 1134 }
// 1135 
// 1136 /*********************************************************************
// 1137  * @fn      osal_nv_init
// 1138  *
// 1139  * @brief   Initialize NV service.
// 1140  *
// 1141  * @param   p - Not used.
// 1142  *
// 1143  * @return  none
// 1144  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
// 1145 void osal_nv_init( void *p )
osal_nv_init:
        CFI Block cfiBlock126 Using cfiCommon0
        CFI Function osal_nv_init
// 1146 {
        FUNCALL osal_nv_init, initNV
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 0, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        PUSH    DPL
        CFI DPL0 Frame(CFA_SP, 4)
        CFI CFA_SP SP+-4
        PUSH    DPH
        CFI DPH0 Frame(CFA_SP, 5)
        CFI CFA_SP SP+-5
        ; Saved register size: 2
        ; Auto size: 0
// 1147   (void)p;  // Suppress Lint warning.
// 1148 
// 1149   // Set Flash write timing based on CPU speed.
// 1150 #ifdef CPU16MHZ
// 1151   FWT = 0x15;
// 1152 #else
// 1153   FWT = 0x2A;
        MOV     0xab,#0x2a
// 1154 #endif
// 1155 
// 1156   (void)initNV();  // Always returns TRUE after pages have been erased.
        ; Setup parameters for call to function initNV
        LCALL   ??initNV?relay
// 1157 }
        LJMP    ?Subroutine37 & 0xFFFF
        CFI EndBlock cfiBlock126
        REQUIRE FWT
// 1158 
// 1159 /*********************************************************************
// 1160  * @fn      osal_nv_item_init
// 1161  *
// 1162  * @brief   If the NV item does not already exist, it is created and
// 1163  *          initialized with the data passed to the function, if any.
// 1164  *          This function must be called before calling osal_nv_read() or
// 1165  *          osal_nv_write().
// 1166  *
// 1167  * @param   id  - Valid NV item Id.
// 1168  * @param   len - Item length.
// 1169  * @param  *buf - Pointer to item initalization data. Set to NULL if none.
// 1170  *
// 1171  * @return  NV_ITEM_UNINIT - Id did not exist and was created successfully.
// 1172  *          ZSUCCESS       - Id already existed, no action taken.
// 1173  *          NV_OPER_FAILED - Failure to find or create Id.
// 1174  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
// 1175 uint8 osal_nv_item_init( uint16 id, uint16 len, void *buf )
osal_nv_item_init:
        CFI Block cfiBlock127 Using cfiCommon0
        CFI Function osal_nv_item_init
// 1176 {
        FUNCALL osal_nv_item_init, findItem
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 14, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 14, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_item_init, initItem
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_item_init, initNV
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 14, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 14, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xe
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 14)
        ; Saved register size: 14
        ; Auto size: 0
        MOV     A,R2
        MOV     R6,A
        MOV     A,R3
        MOV     R7,A
        MOV     ?V0 + 0,R4
        MOV     ?V0 + 1,R5
        MOV     A,#0xe
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine7 & 0xFFFF
// 1177   /* Global fail flag for fail due to low bus voltage has less impact on code
// 1178    * size than passing back a return value all the way from the lowest level.
// 1179    */
// 1180   failF = FALSE;
??CrossCallReturnLabel_26:
        CLR     A
        MOV     DPTR,#failF
        MOVX    @DPTR,A
// 1181 
// 1182   // ZCD_NV_EXTADDR is maintained without an osalNvHdr_t, so it is always already initialized.
// 1183   if ( (id == ZCD_NV_EXTADDR) || (findItem( id ) != OSAL_NV_ITEM_NULL) )
        MOV     A,#0x1
        XRL     A,R6
        JNZ     ??osal_nv_item_init_0
        MOV     A,R7
??osal_nv_item_init_0:
        JZ      ??osal_nv_item_init_1
        ; Setup parameters for call to function findItem
        LCALL   ??findItem?relay
        MOV     A,R2
        JNZ     ??osal_nv_item_init_2
        MOV     A,R3
??osal_nv_item_init_2:
        JZ      ??osal_nv_item_init_3
// 1184   {
// 1185     return ZSUCCESS;
??osal_nv_item_init_1:
        MOV     R1,#0x0
        SJMP    ??osal_nv_item_init_4
// 1186   }
// 1187   else if ( initItem( TRUE, id, len, buf ) )
??osal_nv_item_init_3:
        ; Setup parameters for call to function initItem
        MOV     R0,#?V0 + 2
        LCALL   ?PUSH_XSTACK_I_TWO
        CFI CFA_XSP16 add(XSP16, 16)
        MOV     R4,?V0 + 0
        MOV     R5,?V0 + 1
        MOV     A,R6
        MOV     R2,A
        MOV     A,R7
        MOV     R3,A
        MOV     R1,#0x1
        LCALL   ??initItem?relay
        MOV     A,#0x2
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 14)
        MOV     A,R1
        JZ      ??osal_nv_item_init_5
// 1188   {
// 1189     if ( failF )
        MOV     DPTR,#failF
        MOVX    A,@DPTR
        JZ      ??osal_nv_item_init_6
// 1190     {
// 1191       (void)initNV();  // See comment at the declaration of failF.
        ; Setup parameters for call to function initNV
        LCALL   ??initNV?relay
// 1192       return NV_OPER_FAILED;
// 1193     }
// 1194     else
// 1195     {
// 1196       return NV_ITEM_UNINIT;
// 1197     }
// 1198   }
// 1199   else
// 1200   {
// 1201     return NV_OPER_FAILED;
??osal_nv_item_init_5:
        MOV     R1,#0x10
??osal_nv_item_init_4:
        LJMP    ?Subroutine40 & 0xFFFF
// 1202   }
??osal_nv_item_init_6:
        MOV     R1,#0xf
        SJMP    ??osal_nv_item_init_4
        CFI EndBlock cfiBlock127
// 1203 }
// 1204 
// 1205 /*********************************************************************
// 1206  * @fn      osal_nv_item_len
// 1207  *
// 1208  * @brief   Get the data length of the item stored in NV memory.
// 1209  *
// 1210  * @param   id  - Valid NV item Id.
// 1211  *
// 1212  * @return  Item length, if found; zero otherwise.
// 1213  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
// 1214 uint16 osal_nv_item_len( uint16 id )
osal_nv_item_len:
        CFI Block cfiBlock128 Using cfiCommon0
        CFI Function osal_nv_item_len
// 1215 {
        FUNCALL osal_nv_item_len, findItem
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 18, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 18, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_item_len, nvReadHdr
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 18, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 18, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xa
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 10)
        ; Saved register size: 10
        ; Auto size: 8
        MOV     A,#-0x8
        LCALL   ?ALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 18)
// 1216   if ( id == ZCD_NV_EXTADDR )
        MOV     A,#0x1
        XRL     A,R2
        JNZ     ??osal_nv_item_len_0
        MOV     A,R3
??osal_nv_item_len_0:
        JNZ     ??osal_nv_item_len_1
// 1217   {
// 1218     return Z_EXTADDR_LEN;
        MOV     R2,#0x8
??osal_nv_item_len_2:
        MOV     R3,#0x0
        SJMP    ??CrossCallReturnLabel_39
// 1219   }
// 1220   else
// 1221   {
// 1222     uint16 offset = findItem( id );
??osal_nv_item_len_1:
        ; Setup parameters for call to function findItem
        LCALL   ?Subroutine27 & 0xFFFF
// 1223 
// 1224     if ( offset == OSAL_NV_ITEM_NULL )
??CrossCallReturnLabel_82:
        JNZ     ??osal_nv_item_len_3
        MOV     A,R1
??osal_nv_item_len_3:
        JNZ     ??osal_nv_item_len_4
// 1225     {
// 1226       return 0;
        MOV     R2,#0x0
        SJMP    ??osal_nv_item_len_2
// 1227     }
// 1228     else
// 1229     {
// 1230       osalNvHdr_t hdr;
// 1231       nvReadHdr( findPg, (offset - OSAL_NV_HDR_SIZE), (uint8 *)(&hdr) );
??osal_nv_item_len_4:
        ; Setup parameters for call to function nvReadHdr
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     A,#-0x8
        ADD     A,R0
        MOV     R2,A
        MOV     A,#-0x1
        ADDC    A,R1
        MOV     R3,A
        MOV     DPTR,#findPg
        MOVX    A,@DPTR
        MOV     R1,A
        LCALL   nvReadHdr & 0xFFFF
// 1232       return hdr.len;
        MOV     A,#0x2
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine12 & 0xFFFF
??CrossCallReturnLabel_39:
        MOV     A,#0x8
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 10)
        MOV     R7,#0x2
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock128
// 1233     }
// 1234   }
// 1235 }

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine12:
        CFI Block cfiCond129 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_38
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 21)
        CFI Block cfiCond130 Using cfiCommon0
        CFI (cfiCond130) NoFunction
        CFI (cfiCond130) Conditional ??CrossCallReturnLabel_39
        CFI (cfiCond130) R6 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond130) VB load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond130) V0 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond130) V1 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond130) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond130) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond130) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond130) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond130) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond130) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond130) CFA_SP SP+0
        CFI (cfiCond130) CFA_XSP16 add(XSP16, 18)
        CFI Block cfiCond131 Using cfiCommon0
        CFI (cfiCond131) NoFunction
        CFI (cfiCond131) Conditional ??CrossCallReturnLabel_40
        CFI (cfiCond131) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond131) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond131) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond131) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond131) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond131) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond131) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond131) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond131) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond131) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond131) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond131) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond131) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond131) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond131) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond131) CFA_SP SP+0
        CFI (cfiCond131) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiCond132 Using cfiCommon0
        CFI (cfiCond132) NoFunction
        CFI (cfiCond132) Conditional ??CrossCallReturnLabel_41
        CFI (cfiCond132) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond132) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond132) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond132) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond132) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond132) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond132) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond132) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond132) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond132) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond132) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond132) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond132) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond132) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond132) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond132) CFA_SP SP+0
        CFI (cfiCond132) CFA_XSP16 add(XSP16, 32)
        CFI Block cfiCond133 Using cfiCommon0
        CFI (cfiCond133) NoFunction
        CFI (cfiCond133) Conditional ??CrossCallReturnLabel_42
        CFI (cfiCond133) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond133) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond133) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond133) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond133) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond133) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond133) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond133) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond133) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond133) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond133) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond133) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond133) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond133) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond133) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond133) CFA_SP SP+0
        CFI (cfiCond133) CFA_XSP16 add(XSP16, 34)
        CFI Block cfiPicker134 Using cfiCommon1
        CFI (cfiPicker134) NoFunction
        CFI (cfiPicker134) Picker
        LCALL   ??Subroutine32_0 & 0xFFFF
??CrossCallReturnLabel_96:
        RET
        CFI EndBlock cfiCond129
        CFI EndBlock cfiCond130
        CFI EndBlock cfiCond131
        CFI EndBlock cfiCond132
        CFI EndBlock cfiCond133
        CFI EndBlock cfiPicker134
// 1236 
// 1237 /*********************************************************************
// 1238  * @fn      osal_nv_write
// 1239  *
// 1240  * @brief   Write a data item to NV. Function can write an entire item to NV or
// 1241  *          an element of an item by indexing into the item with an offset.
// 1242  *
// 1243  * @param   id  - Valid NV item Id.
// 1244  * @param   ndx - Index offset into item
// 1245  * @param   len - Length of data to write.
// 1246  * @param  *buf - Data to write.
// 1247  *
// 1248  * @return  ZSUCCESS if successful, NV_ITEM_UNINIT if item did not
// 1249  *          exist in NV and offset is non-zero, NV_OPER_FAILED if failure.
// 1250  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
// 1251 uint8 osal_nv_write( uint16 id, uint16 ndx, uint16 len, void *buf )
osal_nv_write:
        CFI Block cfiBlock135 Using cfiCommon0
        CFI Function osal_nv_write
// 1252 {
        FUNCALL osal_nv_write, nvReadHdr
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 30, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_write, writeWordM
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 31, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 31, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_write, findItem
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 30, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_write, nvReadHdr
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 30, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_write, nvReadByte
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 30, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_write, initItem
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 32, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 32, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_write, setItem
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 30, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_write, xferBuf
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 34, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 34, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_write, writeBuf
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 32, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 32, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_write, xferBuf
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 34, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 34, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_write, calcChkF
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 30, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_write, writeWordH
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 30, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_write, nvReadHdr
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 30, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_write, setItem
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 30, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_write, compactPage
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 30, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_write, initNV
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 30, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 30, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xf
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 15)
        ; Saved register size: 15
        ; Auto size: 15
        MOV     A,#-0xf
        LCALL   ?ALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 30)
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        MOV     A,R2
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R3
        MOVX    @DPTR,A
        MOV     ?V0 + 4,R4
        MOV     ?V0 + 5,R5
// 1253   uint8 rtrn = ZSUCCESS;
        MOV     ?V0 + 6,#0x0
// 1254 
// 1255   /* Global fail flag for fail due to low bus voltage has less impact on code
// 1256    * size than passing back a return value all the way from the lowest level.
// 1257    */
// 1258   failF = FALSE;
        CLR     A
        MOV     DPTR,#failF
        MOVX    @DPTR,A
// 1259 
// 1260   if ( id == ZCD_NV_EXTADDR )
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,#0x1
        JNZ     ??osal_nv_write_0
        INC     DPTR
        MOVX    A,@DPTR
??osal_nv_write_0:
        JNZ     ??osal_nv_write_1
// 1261   {
// 1262     return writeIEEE( buf );
        ; Setup parameters for call to function nvReadHdr
        MOV     A,#0x7
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine0 & 0xFFFF
??CrossCallReturnLabel_1:
        JNZ     ??osal_nv_write_2
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??osal_nv_write_2:
        JNZ     ??osal_nv_write_3
        MOV     A,#0x9
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,#0xff
        JNZ     ??osal_nv_write_4
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??osal_nv_write_4:
        JNZ     ??osal_nv_write_3
        MOV     A,#0xb
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,#0xff
        JNZ     ??osal_nv_write_5
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??osal_nv_write_5:
        JNZ     ??osal_nv_write_3
        MOV     A,#0xd
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,#0xff
        JNZ     ??osal_nv_write_6
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,#0xff
??osal_nv_write_6:
        JNZ     ??osal_nv_write_3
        ; Setup parameters for call to function writeWordM
        MOV     ?V0 + 0,#0x2
        MOV     R0,#?V0 + 0
        LCALL   ?PUSH_XSTACK_I_ONE
        CFI CFA_XSP16 add(XSP16, 31)
        MOV     A,#0x21
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine13 & 0xFFFF
??CrossCallReturnLabel_45:
        MOV     R2,#-0x8
        MOV     R3,#0x7
        MOV     R1,#0x3f
        LCALL   ??Subroutine20_0 & 0xFFFF
??CrossCallReturnLabel_66:
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 30)
        MOV     DPTR,#failF
        MOVX    A,@DPTR
        JZ      ??osal_nv_write_7
        MOV     R2,#0x10
        SJMP    ??osal_nv_write_8
??osal_nv_write_7:
        MOV     R2,#0x0
??osal_nv_write_8:
        MOV     A,R2
        MOV     R1,A
        SJMP    ??osal_nv_write_9
??osal_nv_write_3:
        MOV     R1,#0x10
??osal_nv_write_9:
        LJMP    ??osal_nv_write_10 & 0xFFFF
// 1263   }
// 1264 
// 1265   if ( len != 0 )
??osal_nv_write_1:
        MOV     A,#0x1e
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        JNZ     ??osal_nv_write_11
        INC     DPTR
        MOVX    A,@DPTR
??osal_nv_write_11:
        JNZ     $+5
        LJMP    ??osal_nv_write_12 & 0xFFFF
// 1266   {
// 1267     osalNvHdr_t hdr;
// 1268     uint16 origOff, srcOff;
// 1269     uint16 cnt;
// 1270     uint8 *ptr;
// 1271 
// 1272     origOff = srcOff = findItem( id );
        ; Setup parameters for call to function findItem
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine12 & 0xFFFF
??CrossCallReturnLabel_40:
        LCALL   ?Subroutine27 & 0xFFFF
??CrossCallReturnLabel_83:
        MOV     R6,A
        MOV     A,R1
        MOV     R7,A
        MOV     A,#0x5
        LCALL   ?XSTACK_DISP0_8
        MOV     A,R0
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R1
        MOVX    @DPTR,A
// 1273     if ( srcOff == OSAL_NV_ITEM_NULL )
        MOV     A,R6
        JNZ     ??osal_nv_write_13
        MOV     A,R7
??osal_nv_write_13:
        JNZ     ??osal_nv_write_14
// 1274     {
// 1275       return NV_ITEM_UNINIT;
        MOV     R1,#0xf
        LJMP    ??osal_nv_write_10 & 0xFFFF
// 1276     }
// 1277 
// 1278     nvReadHdr( findPg, (srcOff - OSAL_NV_HDR_SIZE), (uint8 *)(&hdr) );
??osal_nv_write_14:
        ; Setup parameters for call to function nvReadHdr
        MOV     A,#0x7
        LCALL   ?XSTACK_DISP0_8
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     A,#-0x8
        ADD     A,R6
        MOV     R2,A
        MOV     A,#-0x1
        ADDC    A,R7
        MOV     R3,A
        MOV     DPTR,#findPg
        MOVX    A,@DPTR
        MOV     R1,A
        LCALL   nvReadHdr & 0xFFFF
// 1279     if ( hdr.len < (ndx + len) )
        MOV     A,#0x9
        LCALL   ?XSTACK_DISP0_8
        PUSH    DPL
        CFI CFA_SP SP+-1
        PUSH    DPH
        CFI CFA_SP SP+-2
        MOV     A,#0x1e
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine14 & 0xFFFF
??CrossCallReturnLabel_47:
        POP     DPH
        CFI CFA_SP SP+-1
        POP     DPL
        CFI CFA_SP SP+0
        CLR     C
        MOVX    A,@DPTR
        SUBB    A,R0
        INC     DPTR
        MOVX    A,@DPTR
        SUBB    A,R1
        JNC     ??osal_nv_write_15
// 1280     {
// 1281       return NV_OPER_FAILED;
        MOV     R1,#0x10
        LJMP    ??osal_nv_write_10 & 0xFFFF
// 1282     }
// 1283 
// 1284     srcOff += ndx;
??osal_nv_write_15:
        LCALL   ?Subroutine29 & 0xFFFF
// 1285     ptr = buf;
??CrossCallReturnLabel_86:
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine6 & 0xFFFF
// 1286     cnt = len;
??CrossCallReturnLabel_23:
        MOV     A,#0x1e
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine7 & 0xFFFF
??CrossCallReturnLabel_27:
        SJMP    ??osal_nv_write_16
// 1287     while ( cnt )
// 1288     {
// 1289       uint8 tmp;
// 1290       nvReadByte( findPg, srcOff++, &tmp );
// 1291       if ( tmp != *ptr++ )
// 1292       {
// 1293         break;
// 1294       }
// 1295       cnt--;
??osal_nv_write_17:
        MOV     A,?V0 + 2
        ADD     A,#-0x1
        MOV     ?V0 + 2,A
        MOV     A,?V0 + 3
        ADDC    A,#-0x1
        MOV     ?V0 + 3,A
        MOV     A,?V0 + 2
        JNZ     ??osal_nv_write_18
        MOV     A,?V0 + 3
??osal_nv_write_18:
        JNZ     $+5
        LJMP    ??osal_nv_write_19 & 0xFFFF
??osal_nv_write_16:
        ; Setup parameters for call to function nvReadByte
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     A,R6
        MOV     R2,A
        MOV     A,R7
        MOV     R3,A
        MOV     DPTR,#findPg
        MOVX    A,@DPTR
        MOV     R1,A
        LCALL   nvReadByte & 0xFFFF
        MOV     A,R6
        ADD     A,#0x1
        INC     R6
        MOV     A,R7
        ADDC    A,#0x0
        MOV     R7,A
        MOV     R0,?V0 + 0
        MOV     R1,?V0 + 1
        MOV     DPL,R0
        MOV     DPH,R1
        INC     DPTR
        MOV     ?V0 + 0,DPL
        MOV     ?V0 + 1,DPH
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    A,@DPTR
        MOV     R2,A
        MOV     DPL,R0
        MOV     DPH,R1
        MOVX    A,@DPTR
        XRL     A,R2
        JZ      ??osal_nv_write_17
// 1296     }
// 1297 
// 1298     if ( cnt != 0 )  // If the buffer to write is different in one or more bytes.
// 1299     {
// 1300       uint8 comPg, dstPg = initItem( FALSE, id, hdr.len, &comPg );
        ; Setup parameters for call to function initItem
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     ?V0 + 0,DPL
        MOV     ?V0 + 1,DPH
        MOV     R0,#?V0 + 0
        LCALL   ?PUSH_XSTACK_I_TWO
        CFI CFA_XSP16 add(XSP16, 32)
        MOV     A,#0xb
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine13 & 0xFFFF
??CrossCallReturnLabel_46:
        MOV     A,#0x3
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine12 & 0xFFFF
??CrossCallReturnLabel_41:
        MOV     R1,#0x0
        LCALL   ??initItem?relay
        MOV     A,#0x2
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 30)
        MOV     A,R1
        MOV     ?V0 + 0,A
// 1301 
// 1302       if ( dstPg != OSAL_NV_PAGE_NULL )
        JNZ     $+5
        LJMP    ??osal_nv_write_20 & 0xFFFF
// 1303       {
// 1304         uint16 tmp = OSAL_NV_DATA_SIZE( hdr.len );
        MOV     A,#0x9
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine5 & 0xFFFF
??CrossCallReturnLabel_20:
        MOV     R0,A
        MOV     A,#0x3
        LCALL   ?XSTACK_DISP0_8
        MOV     A,R0
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R1
        MOVX    @DPTR,A
// 1305         uint16 dstOff = pgOff[dstPg-OSAL_NV_PAGE_BEG] - tmp;
        MOV     A,?V0 + 0
        CLR     C
        RLC     A
        MOV     R0,A
        CLR     A
        RLC     A
        MOV     R1,A
        MOV     A,R0
        ADD     A,#((pgOff + 136) & 0xff)
        MOV     R0,A
        MOV     A,R1
        ADDC    A,#(((pgOff - 120) >> 8) & 0xff)
        MOV     R1,A
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        MOV     A,R0
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R1
        MOVX    @DPTR,A
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine15 & 0xFFFF
??CrossCallReturnLabel_49:
        PUSH    DPL
        CFI CFA_SP SP+-1
        PUSH    DPH
        CFI CFA_SP SP+-2
        MOV     A,#0x3
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine2 & 0xFFFF
??CrossCallReturnLabel_10:
        POP     DPH
        CFI CFA_SP SP+-1
        POP     DPL
        CFI CFA_SP SP+0
        LCALL   ?Subroutine16 & 0xFFFF
// 1306         uint8 srcPg = findPg;
??CrossCallReturnLabel_51:
        MOV     DPTR,#findPg
        MOVX    A,@DPTR
        MOV     ?V0 + 1,A
// 1307         srcOff = origOff;
// 1308 
// 1309         setItem( srcPg, srcOff, eNvXfer );
        ; Setup parameters for call to function setItem
        MOV     R4,#0x0
        MOV     A,#0x5
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine11 & 0xFFFF
// 1310 
// 1311         xferBuf( srcPg, srcOff, dstPg, dstOff, ndx );
??CrossCallReturnLabel_36:
        ; Setup parameters for call to function xferBuf
        MOV     R0,#?V0 + 4
        LCALL   ?PUSH_XSTACK_I_TWO
        CFI CFA_XSP16 add(XSP16, 32)
        MOV     ?V0 + 2,R6
        MOV     ?V0 + 3,R7
        MOV     R0,#?V0 + 2
        LCALL   ?PUSH_XSTACK_I_TWO
        CFI CFA_XSP16 add(XSP16, 34)
        MOV     R4,?V0 + 0
        MOV     A,#0x9
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine12 & 0xFFFF
??CrossCallReturnLabel_42:
        MOV     R1,?V0 + 1
        LCALL   ??xferBuf?relay
        MOV     A,#0x4
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 30)
// 1312         srcOff += ndx;
// 1313         dstOff += ndx;
        LCALL   ?Subroutine29 & 0xFFFF
// 1314 
// 1315         writeBuf( dstPg, dstOff, len, buf );
??CrossCallReturnLabel_87:
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?PUSH_XSTACK8_X_TWO
        CFI CFA_XSP16 add(XSP16, 32)
        MOV     A,#0x20
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine8 & 0xFFFF
??CrossCallReturnLabel_29:
        LCALL   ??writeBuf?relay
        MOV     A,#0x2
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 30)
// 1316         srcOff += len;
// 1317         dstOff += len;
// 1318 
// 1319         xferBuf( srcPg, srcOff, dstPg, dstOff, (hdr.len-ndx-len) );
        ; Setup parameters for call to function xferBuf
        MOV     A,#0x9
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        CLR     C
        SUBB    A,?V0 + 4
        MOV     R2,A
        INC     DPTR
        MOVX    A,@DPTR
        SUBB    A,?V0 + 5
        MOV     R3,A
        MOV     A,#0x1e
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine2 & 0xFFFF
??CrossCallReturnLabel_11:
        MOV     A,R2
        CLR     C
        SUBB    A,R0
        MOV     ?V0 + 2,A
        MOV     A,R3
        SUBB    A,R1
        MOV     ?V0 + 3,A
        MOV     R0,#?V0 + 2
        LCALL   ?PUSH_XSTACK_I_TWO
        CFI CFA_XSP16 add(XSP16, 32)
        MOV     A,#0x20
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        ADD     A,R6
        MOV     ?V0 + 2,A
        INC     DPTR
        MOVX    A,@DPTR
        ADDC    A,R7
        MOV     ?V0 + 3,A
        MOV     R0,#?V0 + 2
        LCALL   ?PUSH_XSTACK_I_TWO
        CFI CFA_XSP16 add(XSP16, 34)
        MOV     R4,?V0 + 0
        MOV     A,#0x9
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine14 & 0xFFFF
??CrossCallReturnLabel_48:
        MOV     A,#0x22
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        ADD     A,R0
        MOV     R2,A
        INC     DPTR
        MOVX    A,@DPTR
        ADDC    A,R1
        MOV     R3,A
        MOV     R1,?V0 + 1
        LCALL   ??xferBuf?relay
        MOV     A,#0x4
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 30)
// 1320 
// 1321         // Calculate and write the new checksum.
// 1322         dstOff = pgOff[dstPg-OSAL_NV_PAGE_BEG] - tmp;
        MOV     A,#0x1
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine15 & 0xFFFF
??CrossCallReturnLabel_50:
        PUSH    DPL
        CFI CFA_SP SP+-1
        PUSH    DPH
        CFI CFA_SP SP+-2
        MOV     A,#0x3
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine2 & 0xFFFF
??CrossCallReturnLabel_12:
        POP     DPH
        CFI CFA_SP SP+-1
        POP     DPL
        CFI CFA_SP SP+0
        LCALL   ?Subroutine16 & 0xFFFF
// 1323         tmp = calcChkF( dstPg, dstOff, hdr.len );
??CrossCallReturnLabel_52:
        ; Setup parameters for call to function calcChkF
        MOV     A,#0x9
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine8 & 0xFFFF
??CrossCallReturnLabel_30:
        LCALL   ??calcChkF?relay
        MOV     A,#0x3
        LCALL   ?XSTACK_DISP0_8
        MOV     A,R2
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R3
        MOVX    @DPTR,A
// 1324         dstOff -= OSAL_NV_HDR_SIZE;
        MOV     A,R6
        ADD     A,#-0x8
        MOV     R6,A
        MOV     A,R7
        ADDC    A,#-0x1
        MOV     R7,A
// 1325         writeWordH( dstPg, (dstOff+OSAL_NV_HDR_CHK), (uint8 *)&tmp );
        ; Setup parameters for call to function writeWordH
        MOV     A,#0x3
        LCALL   ?XSTACK_DISP0_8
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     A,#0x4
        ADD     A,R6
        MOV     R2,A
        CLR     A
        ADDC    A,R7
        MOV     R3,A
        MOV     R1,?V0 + 0
        LCALL   ??writeWordH?relay
// 1326         nvReadHdr( dstPg, dstOff, (uint8 *)(&hdr) );
        ; Setup parameters for call to function nvReadHdr
        MOV     A,#0x7
        LCALL   ?XSTACK_DISP0_8
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     A,R6
        MOV     R2,A
        MOV     A,R7
        MOV     R3,A
        MOV     R1,?V0 + 0
        LCALL   nvReadHdr & 0xFFFF
// 1327 
// 1328         if ( tmp == hdr.chk )
        MOV     A,#0x3
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine2 & 0xFFFF
??CrossCallReturnLabel_13:
        MOV     A,#0xb
        LCALL   ?XSTACK_DISP0_8
        MOVX    A,@DPTR
        XRL     A,R0
        JNZ     ??osal_nv_write_21
        INC     DPTR
        MOVX    A,@DPTR
        XRL     A,R1
??osal_nv_write_21:
        JNZ     ??osal_nv_write_22
// 1329         {
// 1330           setItem( srcPg, origOff, eNvZero );
        ; Setup parameters for call to function setItem
        MOV     R4,#0x1
        MOV     A,#0x5
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine11 & 0xFFFF
??CrossCallReturnLabel_37:
        SJMP    ??osal_nv_write_23
// 1331         }
// 1332         else
// 1333         {
// 1334           rtrn = NV_OPER_FAILED;
??osal_nv_write_22:
        MOV     ?V0 + 6,#0x10
// 1335         }
// 1336 
// 1337         if ( dstPg == pgRes )
??osal_nv_write_23:
        MOV     DPTR,#pgRes
        MOVX    A,@DPTR
        XRL     A,?V0 + 0
        JNZ     ??osal_nv_write_19
// 1338         {
// 1339           compactPage( comPg );
        ; Setup parameters for call to function compactPage
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOVX    A,@DPTR
        MOV     R1,A
        LCALL   ??compactPage?relay
        SJMP    ??osal_nv_write_19
// 1340         }
// 1341       }
// 1342       else
// 1343       {
// 1344         rtrn = NV_OPER_FAILED;
??osal_nv_write_20:
        MOV     ?V0 + 6,#0x10
// 1345       }
// 1346     }
// 1347   }
// 1348 
// 1349   if ( failF )
??osal_nv_write_19:
        MOV     DPTR,#failF
        MOVX    A,@DPTR
        JZ      ??osal_nv_write_12
// 1350   {
// 1351     (void)initNV();  // See comment at the declaration of failF.
        ; Setup parameters for call to function initNV
        LCALL   ??initNV?relay
// 1352     rtrn = NV_OPER_FAILED;
        MOV     ?V0 + 6,#0x10
// 1353   }
// 1354 
// 1355   return rtrn;
??osal_nv_write_12:
        MOV     R1,?V0 + 6
??osal_nv_write_10:
        MOV     A,#0xf
        LJMP    ?Subroutine42 & 0xFFFF
        CFI EndBlock cfiBlock135
// 1356 }

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine29:
        CFI Block cfiCond136 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_86
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 30)
        CFI Block cfiCond137 Using cfiCommon0
        CFI (cfiCond137) NoFunction
        CFI (cfiCond137) Conditional ??CrossCallReturnLabel_87
        CFI (cfiCond137) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond137) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond137) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond137) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond137) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond137) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond137) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond137) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond137) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond137) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond137) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond137) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond137) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond137) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond137) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond137) CFA_SP SP+0
        CFI (cfiCond137) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiPicker138 Using cfiCommon1
        CFI (cfiPicker138) NoFunction
        CFI (cfiPicker138) Picker
        MOV     A,R6
        ADD     A,?V0 + 4
        MOV     R6,A
        MOV     A,R7
        ADDC    A,?V0 + 5
        MOV     R7,A
        ; Setup parameters for call to function writeBuf
        MOV     A,#0x20
        RET
        CFI EndBlock cfiCond136
        CFI EndBlock cfiCond137
        CFI EndBlock cfiPicker138

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine27:
        CFI Block cfiCond139 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_82
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 18)
        CFI Block cfiCond140 Using cfiCommon0
        CFI (cfiCond140) NoFunction
        CFI (cfiCond140) Conditional ??CrossCallReturnLabel_83
        CFI (cfiCond140) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond140) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond140) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond140) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond140) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond140) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond140) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond140) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond140) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond140) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond140) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond140) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond140) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond140) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond140) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond140) CFA_SP SP+0
        CFI (cfiCond140) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiPicker141 Using cfiCommon1
        CFI (cfiPicker141) NoFunction
        CFI (cfiPicker141) Picker
        LCALL   ??findItem?relay
        MOV     ?V0 + 0,R2
        MOV     ?V0 + 1,R3
        MOV     R0,?V0 + 0
        MOV     R1,?V0 + 1
        MOV     A,R0
        RET
        CFI EndBlock cfiCond139
        CFI EndBlock cfiCond140
        CFI EndBlock cfiPicker141

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine20:
        CFI Block cfiCond142 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_62
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 30)
        CFI Block cfiCond143 Using cfiCommon0
        CFI (cfiCond143) NoFunction
        CFI (cfiCond143) Conditional ??CrossCallReturnLabel_63
        CFI (cfiCond143) R6 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond143) VB load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond143) V0 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond143) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond143) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond143) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond143) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond143) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond143) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond143) CFA_SP SP+0
        CFI (cfiCond143) CFA_XSP16 add(XSP16, 18)
        CFI Block cfiPicker144 Using cfiCommon1
        CFI (cfiPicker144) NoFunction
        CFI (cfiPicker144) Picker
        MOV     R4,DPL
        MOV     R5,DPH
        MOV     R2,#-0x8
        MOV     R3,#0x7
        MOV     A,R6
        MOV     R1,A
        CFI Block cfiCond145 Using cfiCommon0
        CFI (cfiCond145) NoFunction
        CFI (cfiCond145) Conditional ??CrossCallReturnLabel_64
        CFI (cfiCond145) R6 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond145) VB load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond145) V0 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond145) V1 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond145) V2 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond145) V3 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond145) V4 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond145) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond145) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond145) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond145) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond145) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond145) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond145) CFA_SP SP+0
        CFI (cfiCond145) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiCond146 Using cfiCommon0
        CFI (cfiCond146) NoFunction
        CFI (cfiCond146) Conditional ??CrossCallReturnLabel_65
        CFI (cfiCond146) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond146) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond146) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond146) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond146) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond146) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond146) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond146) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond146) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond146) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond146) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond146) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond146) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond146) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond146) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond146) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond146) CFA_SP SP+0
        CFI (cfiCond146) CFA_XSP16 add(XSP16, 21)
        CFI Block cfiCond147 Using cfiCommon0
        CFI (cfiCond147) NoFunction
        CFI (cfiCond147) Conditional ??CrossCallReturnLabel_66
        CFI (cfiCond147) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond147) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond147) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond147) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond147) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond147) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond147) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond147) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond147) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond147) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond147) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond147) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond147) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond147) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond147) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond147) CFA_SP SP+0
        CFI (cfiCond147) CFA_XSP16 add(XSP16, 31)
??Subroutine20_0:
        LCALL   ??writeWordM?relay
        MOV     A,#0x1
        RET
        CFI EndBlock cfiCond142
        CFI EndBlock cfiCond143
        CFI EndBlock cfiPicker144
        CFI EndBlock cfiCond145
        CFI EndBlock cfiCond146
        CFI EndBlock cfiCond147

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine16:
        CFI Block cfiCond148 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_51
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 30)
        CFI Block cfiCond149 Using cfiCommon0
        CFI (cfiCond149) NoFunction
        CFI (cfiCond149) Conditional ??CrossCallReturnLabel_52
        CFI (cfiCond149) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond149) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond149) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond149) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond149) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond149) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond149) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond149) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond149) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond149) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond149) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond149) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond149) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond149) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond149) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond149) CFA_SP SP+0
        CFI (cfiCond149) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiPicker150 Using cfiCommon1
        CFI (cfiPicker150) NoFunction
        CFI (cfiPicker150) Picker
        MOVX    A,@DPTR
        CLR     C
        SUBB    A,R0
        MOV     R6,A
        INC     DPTR
        MOVX    A,@DPTR
        SUBB    A,R1
        MOV     R7,A
        RET
        CFI EndBlock cfiCond148
        CFI EndBlock cfiCond149
        CFI EndBlock cfiPicker150

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine15:
        CFI Block cfiCond151 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_49
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 30)
        CFI Block cfiCond152 Using cfiCommon0
        CFI (cfiCond152) NoFunction
        CFI (cfiCond152) Conditional ??CrossCallReturnLabel_50
        CFI (cfiCond152) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond152) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond152) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond152) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond152) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond152) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond152) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond152) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond152) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond152) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond152) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond152) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond152) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond152) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond152) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond152) CFA_SP SP+0
        CFI (cfiCond152) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiPicker153 Using cfiCommon1
        CFI (cfiPicker153) NoFunction
        CFI (cfiPicker153) Picker
        MOVX    A,@DPTR
        MOV     R0,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     DPH,A
        MOV     DPL,R0
        RET
        CFI EndBlock cfiCond151
        CFI EndBlock cfiCond152
        CFI EndBlock cfiPicker153

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine14:
        CFI Block cfiCond154 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_47
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+-2
        CFI CFA_XSP16 add(XSP16, 30)
        CFI Block cfiCond155 Using cfiCommon0
        CFI (cfiCond155) NoFunction
        CFI (cfiCond155) Conditional ??CrossCallReturnLabel_48
        CFI (cfiCond155) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond155) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond155) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond155) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond155) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond155) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond155) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond155) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond155) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond155) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond155) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond155) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond155) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond155) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond155) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond155) CFA_SP SP+0
        CFI (cfiCond155) CFA_XSP16 add(XSP16, 34)
        CFI Block cfiPicker156 Using cfiCommon1
        CFI (cfiPicker156) NoFunction
        CFI (cfiPicker156) Picker
        MOVX    A,@DPTR
        ADD     A,?V0 + 4
        MOV     R0,A
        INC     DPTR
        MOVX    A,@DPTR
        ADDC    A,?V0 + 5
        MOV     R1,A
        RET
        CFI EndBlock cfiCond154
        CFI EndBlock cfiCond155
        CFI EndBlock cfiPicker156

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine11:
        CFI Block cfiCond157 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_36
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 30)
        CFI Block cfiCond158 Using cfiCommon0
        CFI (cfiCond158) NoFunction
        CFI (cfiCond158) Conditional ??CrossCallReturnLabel_37
        CFI (cfiCond158) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond158) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond158) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond158) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond158) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond158) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond158) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond158) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond158) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond158) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond158) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond158) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond158) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond158) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond158) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond158) CFA_SP SP+0
        CFI (cfiCond158) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiPicker159 Using cfiCommon1
        CFI (cfiPicker159) NoFunction
        CFI (cfiPicker159) Picker
        LCALL   ??Subroutine32_0 & 0xFFFF
??CrossCallReturnLabel_95:
        MOV     R1,?V0 + 1
        LCALL   ??setItem?relay
        RET
        CFI EndBlock cfiCond157
        CFI EndBlock cfiCond158
        CFI EndBlock cfiPicker159

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine32:
        CFI Block cfiCond160 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_93, ??CrossCallReturnLabel_31
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 24)
        CFI Block cfiCond161 Using cfiCommon0
        CFI (cfiCond161) NoFunction
        CFI (cfiCond161) Conditional ??CrossCallReturnLabel_93, ??CrossCallReturnLabel_32
        CFI (cfiCond161) R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond161) VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond161) V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond161) V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond161) V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond161) V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond161) V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond161) V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond161) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond161) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond161) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond161) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond161) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond161) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond161) CFA_SP SP+0
        CFI (cfiCond161) CFA_XSP16 add(XSP16, 24)
        CFI Block cfiCond162 Using cfiCommon0
        CFI (cfiCond162) NoFunction
        CFI (cfiCond162) Conditional ??CrossCallReturnLabel_92, ??CrossCallReturnLabel_4
        CFI (cfiCond162) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond162) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond162) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond162) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond162) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond162) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond162) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond162) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond162) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond162) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond162) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond162) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond162) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond162) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond162) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond162) CFA_SP SP+0
        CFI (cfiCond162) CFA_XSP16 add(XSP16, 21)
        CFI Block cfiCond163 Using cfiCommon0
        CFI (cfiCond163) NoFunction
        CFI (cfiCond163) Conditional ??CrossCallReturnLabel_92, ??CrossCallReturnLabel_5
        CFI (cfiCond163) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond163) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond163) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond163) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond163) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond163) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond163) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond163) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond163) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond163) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond163) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond163) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond163) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond163) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond163) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond163) CFA_SP SP+0
        CFI (cfiCond163) CFA_XSP16 add(XSP16, 21)
        CFI Block cfiPicker164 Using cfiCommon1
        CFI (cfiPicker164) NoFunction
        CFI (cfiPicker164) Picker
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        CFI Block cfiCond165 Using cfiCommon0
        CFI (cfiCond165) NoFunction
        CFI (cfiCond165) Conditional ??CrossCallReturnLabel_94, ??CrossCallReturnLabel_33
        CFI (cfiCond165) R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond165) VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond165) V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond165) V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond165) V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond165) V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond165) V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond165) V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond165) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond165) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond165) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond165) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond165) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond165) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond165) CFA_SP SP+0
        CFI (cfiCond165) CFA_XSP16 add(XSP16, 24)
        CFI Block cfiCond166 Using cfiCommon0
        CFI (cfiCond166) NoFunction
        CFI (cfiCond166) Conditional ??CrossCallReturnLabel_94, ??CrossCallReturnLabel_35
        CFI (cfiCond166) R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond166) VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond166) V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond166) V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond166) V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond166) V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond166) V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond166) V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond166) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond166) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond166) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond166) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond166) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond166) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond166) CFA_SP SP+0
        CFI (cfiCond166) CFA_XSP16 add(XSP16, 24)
        CFI Block cfiCond167 Using cfiCommon0
        CFI (cfiCond167) NoFunction
        CFI (cfiCond167) Conditional ??CrossCallReturnLabel_94, ??CrossCallReturnLabel_34
        CFI (cfiCond167) R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond167) VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond167) V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond167) V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond167) V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond167) V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond167) V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond167) V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond167) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond167) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond167) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond167) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond167) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond167) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond167) CFA_SP SP+0
        CFI (cfiCond167) CFA_XSP16 add(XSP16, 28)
        CFI Block cfiCond168 Using cfiCommon0
        CFI (cfiCond168) NoFunction
        CFI (cfiCond168) Conditional ??CrossCallReturnLabel_96, ??CrossCallReturnLabel_38
        CFI (cfiCond168) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond168) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond168) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond168) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond168) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond168) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond168) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond168) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond168) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond168) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond168) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond168) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond168) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond168) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond168) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond168) CFA_SP SP+0
        CFI (cfiCond168) CFA_XSP16 add(XSP16, 21)
        CFI Block cfiCond169 Using cfiCommon0
        CFI (cfiCond169) NoFunction
        CFI (cfiCond169) Conditional ??CrossCallReturnLabel_96, ??CrossCallReturnLabel_39
        CFI (cfiCond169) R6 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond169) VB load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond169) V0 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond169) V1 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond169) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond169) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond169) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond169) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond169) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond169) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond169) CFA_SP SP+0
        CFI (cfiCond169) CFA_XSP16 add(XSP16, 18)
        CFI Block cfiCond170 Using cfiCommon0
        CFI (cfiCond170) NoFunction
        CFI (cfiCond170) Conditional ??CrossCallReturnLabel_96, ??CrossCallReturnLabel_40
        CFI (cfiCond170) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond170) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond170) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond170) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond170) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond170) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond170) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond170) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond170) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond170) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond170) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond170) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond170) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond170) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond170) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond170) CFA_SP SP+0
        CFI (cfiCond170) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiCond171 Using cfiCommon0
        CFI (cfiCond171) NoFunction
        CFI (cfiCond171) Conditional ??CrossCallReturnLabel_96, ??CrossCallReturnLabel_41
        CFI (cfiCond171) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond171) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond171) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond171) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond171) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond171) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond171) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond171) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond171) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond171) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond171) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond171) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond171) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond171) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond171) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond171) CFA_SP SP+0
        CFI (cfiCond171) CFA_XSP16 add(XSP16, 32)
        CFI Block cfiCond172 Using cfiCommon0
        CFI (cfiCond172) NoFunction
        CFI (cfiCond172) Conditional ??CrossCallReturnLabel_96, ??CrossCallReturnLabel_42
        CFI (cfiCond172) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond172) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond172) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond172) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond172) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond172) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond172) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond172) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond172) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond172) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond172) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond172) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond172) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond172) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond172) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond172) CFA_SP SP+0
        CFI (cfiCond172) CFA_XSP16 add(XSP16, 34)
        CFI Block cfiCond173 Using cfiCommon0
        CFI (cfiCond173) NoFunction
        CFI (cfiCond173) Conditional ??CrossCallReturnLabel_95, ??CrossCallReturnLabel_36
        CFI (cfiCond173) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond173) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond173) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond173) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond173) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond173) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond173) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond173) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond173) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond173) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond173) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond173) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond173) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond173) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond173) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond173) CFA_SP SP+0
        CFI (cfiCond173) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiCond174 Using cfiCommon0
        CFI (cfiCond174) NoFunction
        CFI (cfiCond174) Conditional ??CrossCallReturnLabel_95, ??CrossCallReturnLabel_37
        CFI (cfiCond174) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond174) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond174) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond174) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond174) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond174) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond174) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond174) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond174) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond174) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond174) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond174) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond174) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond174) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond174) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond174) CFA_SP SP+0
        CFI (cfiCond174) CFA_XSP16 add(XSP16, 30)
??Subroutine32_0:
        MOVX    A,@DPTR
        MOV     R2,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R3,A
        RET
        CFI EndBlock cfiCond160
        CFI EndBlock cfiCond161
        CFI EndBlock cfiCond162
        CFI EndBlock cfiCond163
        CFI EndBlock cfiPicker164
        CFI EndBlock cfiCond165
        CFI EndBlock cfiCond166
        CFI EndBlock cfiCond167
        CFI EndBlock cfiCond168
        CFI EndBlock cfiCond169
        CFI EndBlock cfiCond170
        CFI EndBlock cfiCond171
        CFI EndBlock cfiCond172
        CFI EndBlock cfiCond173
        CFI EndBlock cfiCond174

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine8:
        CFI Block cfiCond175 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_29
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 32)
        CFI Block cfiCond176 Using cfiCommon0
        CFI (cfiCond176) NoFunction
        CFI (cfiCond176) Conditional ??CrossCallReturnLabel_30
        CFI (cfiCond176) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond176) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond176) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond176) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond176) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond176) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond176) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond176) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond176) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond176) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond176) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond176) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond176) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond176) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond176) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond176) CFA_SP SP+0
        CFI (cfiCond176) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiPicker177 Using cfiCommon1
        CFI (cfiPicker177) NoFunction
        CFI (cfiPicker177) Picker
        MOVX    A,@DPTR
        MOV     R4,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R5,A
        MOV     A,R6
        MOV     R2,A
        MOV     A,R7
        MOV     R3,A
        MOV     R1,?V0 + 0
        RET
        CFI EndBlock cfiCond175
        CFI EndBlock cfiCond176
        CFI EndBlock cfiPicker177

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine7:
        CFI Block cfiCond178 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_25
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 21)
        CFI Block cfiCond179 Using cfiCommon0
        CFI (cfiCond179) NoFunction
        CFI (cfiCond179) Conditional ??CrossCallReturnLabel_26
        CFI (cfiCond179) R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond179) VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond179) V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond179) V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond179) V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond179) V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond179) V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond179) V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond179) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond179) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond179) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond179) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond179) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond179) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond179) CFA_SP SP+0
        CFI (cfiCond179) CFA_XSP16 add(XSP16, 14)
        CFI Block cfiCond180 Using cfiCommon0
        CFI (cfiCond180) NoFunction
        CFI (cfiCond180) Conditional ??CrossCallReturnLabel_27
        CFI (cfiCond180) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond180) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond180) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond180) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond180) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond180) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond180) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond180) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond180) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond180) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond180) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond180) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond180) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond180) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond180) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond180) CFA_SP SP+0
        CFI (cfiCond180) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiCond181 Using cfiCommon0
        CFI (cfiCond181) NoFunction
        CFI (cfiCond181) Conditional ??CrossCallReturnLabel_28
        CFI (cfiCond181) R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond181) VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond181) V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond181) V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond181) V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond181) V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond181) V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond181) V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond181) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond181) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond181) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond181) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond181) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond181) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond181) CFA_SP SP+0
        CFI (cfiCond181) CFA_XSP16 add(XSP16, 14)
        CFI Block cfiPicker182 Using cfiCommon1
        CFI (cfiPicker182) NoFunction
        CFI (cfiPicker182) Picker
        MOVX    A,@DPTR
        MOV     ?V0 + 2,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     ?V0 + 3,A
        RET
        CFI EndBlock cfiCond178
        CFI EndBlock cfiCond179
        CFI EndBlock cfiCond180
        CFI EndBlock cfiCond181
        CFI EndBlock cfiPicker182

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine6:
        CFI Block cfiCond183 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_21
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 24)
        CFI Block cfiCond184 Using cfiCommon0
        CFI (cfiCond184) NoFunction
        CFI (cfiCond184) Conditional ??CrossCallReturnLabel_22
        CFI (cfiCond184) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond184) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond184) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond184) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond184) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond184) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond184) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond184) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond184) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond184) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond184) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond184) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond184) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond184) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond184) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond184) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond184) CFA_SP SP+0
        CFI (cfiCond184) CFA_XSP16 add(XSP16, 26)
        CFI Block cfiCond185 Using cfiCommon0
        CFI (cfiCond185) NoFunction
        CFI (cfiCond185) Conditional ??CrossCallReturnLabel_23
        CFI (cfiCond185) R6 load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond185) VB load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond185) V0 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond185) V1 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond185) V2 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond185) V3 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond185) V4 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond185) V5 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond185) V6 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond185) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond185) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond185) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond185) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond185) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond185) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond185) CFA_SP SP+0
        CFI (cfiCond185) CFA_XSP16 add(XSP16, 30)
        CFI Block cfiCond186 Using cfiCommon0
        CFI (cfiCond186) NoFunction
        CFI (cfiCond186) Conditional ??CrossCallReturnLabel_24
        CFI (cfiCond186) R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond186) VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond186) V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond186) V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond186) V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond186) V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond186) V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond186) V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond186) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond186) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond186) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond186) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond186) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond186) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond186) CFA_SP SP+0
        CFI (cfiCond186) CFA_XSP16 add(XSP16, 14)
        CFI Block cfiPicker187 Using cfiCommon1
        CFI (cfiPicker187) NoFunction
        CFI (cfiPicker187) Picker
        MOVX    A,@DPTR
        MOV     ?V0 + 0,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     ?V0 + 1,A
        RET
        CFI EndBlock cfiCond183
        CFI EndBlock cfiCond184
        CFI EndBlock cfiCond185
        CFI EndBlock cfiCond186
        CFI EndBlock cfiPicker187
// 1357 
// 1358 /*********************************************************************
// 1359  * @fn      osal_nv_read
// 1360  *
// 1361  * @brief   Read data from NV. This function can be used to read an entire item from NV or
// 1362  *          an element of an item by indexing into the item with an offset.
// 1363  *          Read data is copied into *buf.
// 1364  *
// 1365  * @param   id  - Valid NV item Id.
// 1366  * @param   ndx - Index offset into item
// 1367  * @param   len - Length of data to read.
// 1368  * @param  *buf - Data is read into this buffer.
// 1369  *
// 1370  * @return  ZSUCCESS if NV data was copied to the parameter 'buf'.
// 1371  *          Otherwise, NV_OPER_FAILED for failure.
// 1372  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
// 1373 uint8 osal_nv_read( uint16 id, uint16 ndx, uint16 len, void *buf )
osal_nv_read:
        CFI Block cfiBlock188 Using cfiCommon0
        CFI Function osal_nv_read
// 1374 {
        FUNCALL osal_nv_read, nvReadBuf
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL osal_nv_read, findItem
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 14, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 14, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xe
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 14)
        ; Saved register size: 14
        ; Auto size: 0
        MOV     A,R4
        MOV     R6,A
        MOV     A,R5
        MOV     R7,A
        MOV     A,#0xe
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine7 & 0xFFFF
??CrossCallReturnLabel_28:
        MOV     A,#0x10
        LCALL   ?XSTACK_DISP0_8
        LCALL   ?Subroutine6 & 0xFFFF
// 1375   uint16 offset;
// 1376 
// 1377   if ( id == ZCD_NV_EXTADDR )
??CrossCallReturnLabel_24:
        MOV     A,#0x1
        XRL     A,R2
        JNZ     ??osal_nv_read_0
        MOV     A,R3
??osal_nv_read_0:
        JNZ     ??osal_nv_read_1
// 1378   {
// 1379     offset = OSAL_NV_IEEE_OFFSET;
        MOV     R2,#-0x8
        MOV     R3,#0x7
// 1380     findPg = OSAL_NV_IEEE_PAGE;
        MOV     A,#0x3f
        MOV     DPTR,#findPg
        MOVX    @DPTR,A
// 1381   }
// 1382   else
// 1383   {
// 1384     offset = findItem( id );
// 1385     if ( offset == OSAL_NV_ITEM_NULL )
// 1386     {
// 1387       return NV_OPER_FAILED;
// 1388     }
// 1389   }
// 1390 
// 1391   nvReadBuf(findPg, offset+ndx, buf, len);
??osal_nv_read_2:
        ; Setup parameters for call to function nvReadBuf
        MOV     R0,#?V0 + 2
        LCALL   ?PUSH_XSTACK_I_TWO
        CFI CFA_XSP16 add(XSP16, 16)
        MOV     R4,?V0 + 0
        MOV     R5,?V0 + 1
        MOV     A,R6
        ADD     A,R2
        MOV     R2,A
        MOV     A,R7
        ADDC    A,R3
        MOV     R3,A
        MOV     DPTR,#findPg
        MOVX    A,@DPTR
        MOV     R1,A
        LCALL   nvReadBuf & 0xFFFF
        MOV     A,#0x2
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 14)
// 1392 
// 1393   return ZSUCCESS;
        MOV     R1,#0x0
??osal_nv_read_3:
        LJMP    ?Subroutine40 & 0xFFFF
??osal_nv_read_1:
        ; Setup parameters for call to function findItem
        LCALL   ??findItem?relay
        MOV     A,R2
        JNZ     ??osal_nv_read_4
        MOV     A,R3
??osal_nv_read_4:
        JNZ     ??osal_nv_read_2
        MOV     R1,#0x10
        SJMP    ??osal_nv_read_3
        CFI EndBlock cfiBlock188
// 1394 }

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??initNV?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    initNV

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??setPageUse?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    setPageUse

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??initPage?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    initPage

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??erasePage?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    erasePage

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??compactPage?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    compactPage

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??findItem?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    findItem

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??initItem?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    initItem

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??setItem?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    setItem

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??calcChkF?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    calcChkF

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??writeWord?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    writeWord

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??writeWordM?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    writeWordM

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??writeWordH?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    writeWordH

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??writeBuf?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    writeBuf

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??xferBuf?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    xferBuf

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??writeItem?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    writeItem

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??osal_nv_init?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    osal_nv_init

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??osal_nv_item_init?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    osal_nv_item_init

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??osal_nv_item_len?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    osal_nv_item_len

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??osal_nv_write?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    osal_nv_write

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??osal_nv_read?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    osal_nv_read

        END
// 1395 
// 1396 /*********************************************************************
// 1397 *********************************************************************/
// 
// 4 665 bytes in segment BANKED_CODE
//   120 bytes in segment BANK_RELAYS
//     4 bytes in segment SFR_AN
//    33 bytes in segment XDATA_Z
// 
// 4 785 bytes of CODE  memory
//     0 bytes of DATA  memory (+ 4 bytes shared)
//    33 bytes of XDATA memory
//
//Errors: none
//Warnings: none
