///////////////////////////////////////////////////////////////////////////////
//                                                                            /
// IAR 8051 C/C++ Compiler V7.30B/W32                   18/Jun/2010  16:30:27 /
// Copyright 2004-2007 IAR Systems. All rights reserved.                      /
//                                                                            /
//    Core               =  plain                                             /
//    Code model         =  banked                                            /
//    Data model         =  large                                             /
//    Calling convention =  xdata reentrant                                   /
//    Constant location  =  data                                              /
//    Dptr setup         =  1,16                                              /
//    Source file        =  C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projects\ /
//                          zstack\Samples\Location\Source\Sensor_18B20.c     /
//    Command line       =  -f "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Proje /
//                          cts\zstack\Samples\Location\CC2430DB\..\..\..\Too /
//                          ls\CC2430DB\f8wRouter.cfg" (-DCPU32MHZ            /
//                          -DFORCE_MAC_NEAR -DROOT=__near_func               /
//                          -DMAC_CFG_APP_PENDING_QUEUE=TRUE -DRTR_NWK        /
//                          -DBLINK_LEDS "-DCONST=const __code"               /
//                          -DGENERIC=__generic) -f "C:\Texas                 /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\CC2430DB\..\..\..\Tools\CC2430DB\f /
//                          8wConfig.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\ZStack-1.4.3-1.2.1\Projects /
//                          \zstack\Samples\Location\Source\Sensor_18B20.c"   /
//                          -D CC2430EB -D LOCATION_REFNODE -D xNV_RESTORE    /
//                          -D ZTOOL_P1 -D MT_TASK -D POWER_SAVING -D         /
//                          HAL_UART_BIG_TX_BUF=1 -D                          /
//                          SPI_MGR_DEFAULT_MAX_TX_BUFF=1024 -D               /
//                          SPI_MGR_DEFAULT_OVERFLOW=1 -lC "C:\Texas          /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\CC2430DB\RefNode\List\" -lA        /
//                          "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projects /
//                          \zstack\Samples\Location\CC2430DB\RefNode\List\"  /
//                          --diag_suppress Pe001,Pa010 --diag_remark pe550   /
//                          -o "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Proje /
//                          cts\zstack\Samples\Location\CC2430DB\RefNode\Obj\ /
//                          " -e --require_prototypes -z9 --no_code_motion    /
//                          --debug --core=plain --dptr=16,1                  /
//                          --data_model=large --code_model=banked            /
//                          --calling_convention=xdata_reentrant              /
//                          --place_constants=data --nr_virtual_regs 8 -I     /
//                          "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projects /
//                          \zstack\Samples\Location\CC2430DB\" -I "C:\Texas  /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\CC2430DB\..\SOURCE\" -I "C:\Texas  /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\CC2430DB\..\..\..\ZMAIN\TI2430DB\" /
//                           -I "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Proj /
//                          ects\zstack\Samples\Location\CC2430DB\..\..\..\.. /
//                          \..\COMPONENTS\MT\" -I "C:\Texas                  /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\CC2430DB\..\..\..\..\..\COMPONENTS /
//                          \HAL\INCLUDE\" -I "C:\Texas                       /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\CC2430DB\..\..\..\..\..\COMPONENTS /
//                          \HAL\TARGET\CC2430BB\" -I "C:\Texas               /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\CC2430DB\..\..\..\..\..\COMPONENTS /
//                          \OSAL\MCU\CCSOC\" -I "C:\Texas                    /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\CC2430DB\..\..\..\..\..\COMPONENTS /
//                          \OSAL\INCLUDE\" -I "C:\Texas                      /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\CC2430DB\..\..\..\..\..\COMPONENTS /
//                          \STACK\AF\" -I "C:\Texas                          /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\CC2430DB\..\..\..\..\..\COMPONENTS /
//                          \STACK\NWK\" -I "C:\Texas                         /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\CC2430DB\..\..\..\..\..\COMPONENTS /
//                          \STACK\SEC\" -I "C:\Texas                         /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\CC2430DB\..\..\..\..\..\COMPONENTS /
//                          \STACK\SYS\" -I "C:\Texas                         /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\CC2430DB\..\..\..\..\..\COMPONENTS /
//                          \STACK\ZDO\" -I "C:\Texas                         /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\CC2430DB\..\..\..\..\..\COMPONENTS /
//                          \ZMAC\F8W\" -I "C:\Texas                          /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\CC2430DB\..\..\..\..\..\COMPONENTS /
//                          \ZMAC\" -I "C:\Texas Instruments\ZStack-1.4.3-1.2 /
//                          .1\Projects\zstack\Samples\Location\CC2430DB\..\. /
//                          .\..\..\..\COMPONENTS\SERVICES\SADDR\" -I         /
//                          "C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projects /
//                          \zstack\Samples\Location\CC2430DB\..\..\..\..\..\ /
//                          COMPONENTS\SERVICES\SDATA\" -I "C:\Texas          /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\CC2430DB\..\..\..\..\..\COMPONENTS /
//                          \MAC\INCLUDE\" -I "C:\Texas                       /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\CC2430DB\..\..\..\..\..\COMPONENTS /
//                          \MAC\HIGH_LEVEL\" -I "C:\Texas                    /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\CC2430DB\..\..\..\..\..\COMPONENTS /
//                          \MAC\LOW_LEVEL\SRF03\" -I "C:\Texas               /
//                          Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Sa /
//                          mples\Location\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\ZStack-1.4.3-1.2.1\Projects\ /
//                          zstack\Samples\Location\CC2430DB\RefNode\List\Sen /
//                          sor_18B20.s51                                     /
//                                                                            /
//                                                                            /
///////////////////////////////////////////////////////////////////////////////

        NAME Sensor_18B20

        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 ??Delay_nus?relay
        EXTERN ??init_1820?relay
        EXTERN ??read_1820?relay
        EXTERN ??read_data?relay
        EXTERN ??write_1820?relay
        EXTERN ?BANKED_ENTER_XDATA
        EXTERN ?BANKED_LEAVE_XDATA
        EXTERN ?BDISPATCH
        EXTERN ?BRET
        EXTERN ?S_SHL
        EXTERN ?V0
        EXTERN __INIT_XDATA_I
        EXTERN __INIT_XDATA_Z

        PUBLIC ??DataChange?relay
        FUNCTION ??DataChange?relay,0203H
        PUBLIC ??Delay_nus?relay
        FUNCTION ??Delay_nus?relay,0203H
        PUBLIC ??ds18b20_main?relay
        FUNCTION ??ds18b20_main?relay,0203H
        PUBLIC ??init_1820?relay
        FUNCTION ??init_1820?relay,0203H
        PUBLIC ??match_rom?relay
        FUNCTION ??match_rom?relay,0203H
        PUBLIC ??read_1820?relay
        FUNCTION ??read_1820?relay,0203H
        PUBLIC ??read_data?relay
        FUNCTION ??read_data?relay,0203H
        PUBLIC ??read_data_value?relay
        FUNCTION ??read_data_value?relay,0203H
        PUBLIC ??write_1820?relay
        FUNCTION ??write_1820?relay,0203H
        PUBLIC DataChange
        FUNCTION DataChange,0203H
        ARGFRAME XSTACK, 0, STACK
        PUBLIC Delay_nus
        FUNCTION Delay_nus,080203H
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        PUBWEAK P0DIR
        PUBWEAK _A_P0
        PUBLIC data_value
        PUBLIC ds18b20_main
        FUNCTION ds18b20_main,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 10, STACK
        PUBLIC flag
        PUBLIC init_1820
        FUNCTION init_1820,021203H
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 2, STACK
        PUBLIC match_rom
        FUNCTION match_rom,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        PUBLIC read_1820
        FUNCTION read_1820,021203H
        ARGFRAME XSTACK, 10, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 12, STACK
        PUBLIC read_data
        FUNCTION read_data,021203H
        ARGFRAME XSTACK, 10, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME ISTACK, 1, STACK
        LOCFRAME XSTACK, 9, STACK
        PUBLIC read_data_value
        FUNCTION read_data_value,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 10, STACK
        PUBLIC sensor_data_value
        PUBLIC write_1820
        FUNCTION write_1820,021203H
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 10, 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
        
DataChange          SYMBOL "DataChange"
??DataChange?relay  SYMBOL "?relay", DataChange
Delay_nus           SYMBOL "Delay_nus"
??Delay_nus?relay   SYMBOL "?relay", Delay_nus
ds18b20_main        SYMBOL "ds18b20_main"
??ds18b20_main?relay SYMBOL "?relay", ds18b20_main
init_1820           SYMBOL "init_1820"
??init_1820?relay   SYMBOL "?relay", init_1820
match_rom           SYMBOL "match_rom"
??match_rom?relay   SYMBOL "?relay", match_rom
read_1820           SYMBOL "read_1820"
??read_1820?relay   SYMBOL "?relay", read_1820
read_data           SYMBOL "read_data"
??read_data?relay   SYMBOL "?relay", read_data
read_data_value     SYMBOL "read_data_value"
??read_data_value?relay SYMBOL "?relay", read_data_value
write_1820          SYMBOL "write_1820"
??write_1820?relay  SYMBOL "?relay", write_1820

// C:\Texas Instruments\ZStack-1.4.3-1.2.1\Projects\zstack\Samples\Location\Source\Sensor_18B20.c
//    1 
//    2 /*********************************************************************  
//    3 *文件名:18B20.c
//    4 *功能：DS18B20温度采集 
//    5 * @data:2009.4.24
//    6 * by mchen
//    7 *********************************************************************/  
//    8 #include "Sensor_18B20.h"

        ASEGN SFR_AN:DATA:NOROOT,080H
// union <unnamed> volatile __sfr _A_P0
_A_P0:
        DS 1

        ASEGN SFR_AN:DATA:NOROOT,0fdH
// unsigned char volatile __sfr P0DIR
P0DIR:
        DS 1
//    9 #include "ioCC2430.h"
//   10 

        RSEG XDATA_Z:XDATA:NOROOT(0)
//   11 unsigned char sensor_data_value[2];
sensor_data_value:
        DS 2
        REQUIRE __INIT_XDATA_Z

        RSEG XDATA_Z:XDATA:NOROOT(0)
//   12 unsigned char flag;
flag:
        DS 1
        REQUIRE __INIT_XDATA_Z

        RSEG XDATA_Z:XDATA:NOROOT(0)
//   13 unsigned int data_value;
data_value:
        DS 2
        REQUIRE __INIT_XDATA_Z
//   14 
//   15 

        RSEG XDATA_I:XDATA:NOROOT(0)
        DATA
//   16 static unsigned char get_serial[]={
get_serial:
        DS 32
        REQUIRE `?<Initializer for get_serial>`
        REQUIRE __INIT_XDATA_I
//   17   0x1C,0x00,0x00,0x02,0x02,0x68,0xd8,0x28,
//   18   0x9E,0x00,0x00,0x02,0x02,0x93,0x34,0x28,
//   19   0xE4,0x00,0x00,0x02,0x02,0x66,0x4D,0x28,
//   20   0xE6,0x00,0x00,0x02,0x02,0x93,0x9B,0x28
//   21   //0xF7,0x00,0x00,0x02,0x02,0x75,0xE1,0x28
//   22  };
//   23 
//   24 

        RSEG BANKED_CODE:CODE:NOROOT(0)
//   25 void Delay_nus(uint16 s) 
Delay_nus:
        CFI Block cfiBlock0 Using cfiCommon0
        CFI Function Delay_nus
//   26 {
        ; Saved register size: 0
        ; Auto size: 0
        SJMP    ??Delay_nus_0
//   27   while (s--)
//   28   {
//   29     asm("NOP");
??Delay_nus_1:
        NOP
//   30     asm("NOP");
        NOP
//   31     asm("NOP");
        NOP
//   32   }
??Delay_nus_0:
        MOV     A,R2
        MOV     R0,A
        MOV     A,R3
        MOV     R1,A
        MOV     A,#-0x1
        ADD     A,R0
        DEC     R2
        MOV     A,#-0x1
        ADDC    A,R1
        MOV     R3,A
        MOV     A,R0
        JNZ     ??Delay_nus_2
        MOV     A,R1
??Delay_nus_2:
        JNZ     ??Delay_nus_1
//   33 }
        LJMP    ?BRET
        CFI EndBlock cfiBlock0
//   34 

        RSEG BANKED_CODE:CODE:NOROOT(0)
//   35 void write_1820(unsigned char x)  
write_1820:
        CFI Block cfiBlock1 Using cfiCommon0
        CFI Function write_1820
//   36 {  unsigned char m;    
        FUNCALL write_1820, Delay_nus
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 10, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 10, 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: 0
        MOV     A,R1
        MOV     R7,A
//   37     SET_OUT;
        ORL     0xfd,#0x4
//   38     for(m=0;m<8;m++)  
        MOV     R6,#0x0
//   39     {  
//   40        CL_DQ;
??write_1820_0:
        CLR     0x80.2
//   41        if(x&(1<<m))    //写数据，从低位开始  
        MOV     ?V0 + 0,#0x1
        MOV     ?V0 + 1,#0x0
        MOV     A,R6
        MOV     R0,#?V0 + 0
        LCALL   ?S_SHL
        MOV     A,?V0 + 0
        ANL     A,R7
        JZ      ??write_1820_1
//   42        SET_DQ; 
        SETB    0x80.2
        SJMP    ??write_1820_2
//   43        else  
//   44        CL_DQ;  
??write_1820_1:
        CLR     0x80.2
//   45        Delay_nus(40);   //15~60us  
??write_1820_2:
        ; Setup parameters for call to function Delay_nus
        MOV     R2,#0x28
        MOV     R3,#0x0
        LCALL   ??Delay_nus?relay
//   46        SET_DQ;  
        SETB    0x80.2
//   47     }
        INC     R6
        MOV     A,R6
        CLR     C
        SUBB    A,#0x8
        JC      ??write_1820_0
//   48     //SET_OUT;
//   49     SET_DQ;  
        SETB    0x80.2
        CFI EndBlock cfiBlock1
//   50 }  
        REQUIRE ?Subroutine3
        REQUIRE _A_P0
        REQUIRE P0DIR
        ; // Fall through to label ?Subroutine3

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine3:
        CFI Block cfiBlock2 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 10)
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-9)))
        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(-10)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V1 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,#0x2
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock2
//   51 

        RSEG BANKED_CODE:CODE:NOROOT(0)
//   52 unsigned char read_1820(void)  
read_1820:
        CFI Block cfiBlock3 Using cfiCommon0
        CFI Function read_1820
//   53 {   unsigned char temp,k,n;    
        FUNCALL read_1820, Delay_nus
        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
//   54     temp=0;  
        MOV     ?V0 + 0,#0x0
//   55     for(n=0;n<8;n++)  
        MOV     R6,#0x0
//   56        {  
//   57       CL_DQ;     
??read_1820_0:
        CLR     0x80.2
//   58       SET_DQ; 
        SETB    0x80.2
//   59       SET_IN;  
        ANL     0xfd,#0xfb
//   60       k=IN_DQ;    //读数据,从低位开始  
        MOV     C,0x80.2
        CLR     A
        MOV     0xE0 /* A   */.0,C
//   61       if(k)  
        MOV     ?V0 + 2,#0x1
        MOV     ?V0 + 3,#0x0
        JZ      ??read_1820_1
//   62       temp|=(1<<n);  
        MOV     A,R6
        MOV     R0,#?V0 + 2
        LCALL   ?S_SHL
        MOV     A,?V0 + 2
        ORL     ?V0 + 0,A
        SJMP    ??read_1820_2
//   63       else  
//   64       temp&=~(1<<n);  
??read_1820_1:
        MOV     A,R6
        MOV     R0,#?V0 + 2
        LCALL   ?S_SHL
        MOV     A,?V0 + 2
        CPL     A
        ANL     ?V0 + 0,A
//   65       Delay_nus(70); //60~120us      
??read_1820_2:
        ; Setup parameters for call to function Delay_nus
        MOV     R2,#0x46
        MOV     R3,#0x0
        LCALL   ??Delay_nus?relay
//   66       SET_OUT;
        ORL     0xfd,#0x4
//   67 
//   68    }  
        INC     R6
        MOV     A,R6
        CLR     C
        SUBB    A,#0x8
        JC      ??read_1820_0
//   69    return (temp);  
        MOV     R1,?V0 + 0
        CFI EndBlock cfiBlock3
        REQUIRE ?Subroutine4
        REQUIRE _A_P0
        REQUIRE P0DIR
        ; // Fall through to label ?Subroutine4
//   70 }  

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine4:
        CFI Block cfiBlock4 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 cfiBlock4
//   71 
//   72 /*功能匹配*/

        RSEG BANKED_CODE:CODE:NOROOT(0)
//   73 BYTE match_rom(unsigned char *rom)
match_rom:
        CFI Block cfiBlock5 Using cfiCommon0
        CFI Function match_rom
//   74 {
        FUNCALL match_rom, init_1820
        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 match_rom, write_1820
        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 match_rom, write_1820
        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
        MOV     R7,A
//   75  unsigned char i;
//   76  init_1820();
        ; Setup parameters for call to function init_1820
        LCALL   ??init_1820?relay
//   77  write_1820(0x55);
        ; Setup parameters for call to function write_1820
        MOV     R1,#0x55
        LCALL   ??write_1820?relay
//   78  for(i=8;i>0;i--)
        MOV     ?V0 + 0,#0x8
//   79  {
//   80           write_1820(*(rom+i-1));
??match_rom_0:
        ; Setup parameters for call to function write_1820
        MOV     ?V0 + 2,?V0 + 0
        MOV     A,R6
        ADD     A,?V0 + 2
        MOV     R0,A
        MOV     A,R7
        ADDC    A,#0x0
        MOV     R1,A
        MOV     A,#-0x1
        ADD     A,R0
        MOV     DPL,A
        MOV     A,#-0x1
        ADDC    A,R1
        MOV     DPH,A
        MOVX    A,@DPTR
        MOV     R1,A
        LCALL   ??write_1820?relay
//   81  }
        DEC     ?V0 + 0
        MOV     A,?V0 + 0
        JNZ     ??match_rom_0
//   82  return 1;
        MOV     R1,#0x1
        SJMP    ?Subroutine4
        CFI EndBlock cfiBlock5
//   83 }
//   84 

        RSEG BANKED_CODE:CODE:NOROOT(0)
//   85 void init_1820(void) 
init_1820:
        CFI Block cfiBlock6 Using cfiCommon0
        CFI Function init_1820
//   86 {
        FUNCALL init_1820, Delay_nus
        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
        FUNCALL init_1820, Delay_nus
        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
        FUNCALL init_1820, Delay_nus
        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
//   87    //cli(); 
//   88   SET_OUT; 
        ORL     0xfd,#0x4
//   89   SET_DQ;//输出1
        SETB    0x80.2
//   90   CL_DQ; 
        CLR     0x80.2
//   91   Delay_nus(550);//拉低一段时间 
        ; Setup parameters for call to function Delay_nus
        MOV     R2,#0x26
        MOV     R3,#0x2
        LCALL   ??Delay_nus?relay
//   92   SET_DQ;//释放 
        SETB    0x80.2
//   93   SET_IN;//输入 
        ANL     0xfd,#0xfb
//   94   Delay_nus(40); //释放总线后等待15-60us
        ; Setup parameters for call to function Delay_nus
        MOV     R2,#0x28
        MOV     R3,#0x0
        LCALL   ??Delay_nus?relay
//   95   while(IN_DQ)  {;}//等待回复 
??init_1820_0:
        MOV     C,0x80.2
        JC      ??init_1820_0
//   96   Delay_nus(240);//回复的低电平在60到240us  
        ; Setup parameters for call to function Delay_nus
        MOV     R2,#-0x10
        MOV     R3,#0x0
        LCALL   ??Delay_nus?relay
//   97   SET_OUT; 
        ORL     0xfd,#0x4
//   98   SET_DQ;//回到初始DQ=1；
        SETB    0x80.2
//   99  }
        POP     DPH
        CFI DPH0 SameValue
        CFI CFA_SP SP+-4
        POP     DPL
        CFI DPL0 SameValue
        CFI CFA_SP SP+-3
        LJMP    ?BRET
        CFI EndBlock cfiBlock6
        REQUIRE _A_P0
        REQUIRE P0DIR
//  100  

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  101 void read_data(unsigned char *serial)
read_data:
        CFI Block cfiBlock7 Using cfiCommon0
        CFI Function read_data
//  102  {
        FUNCALL read_data, init_1820
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL read_data, write_1820
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL read_data, write_1820
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL read_data, Delay_nus
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL read_data, init_1820
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL read_data, write_1820
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL read_data, write_1820
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL read_data, read_1820
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL read_data, read_1820
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 9, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 9, 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: 0
//  103     unsigned int j; 
//  104     unsigned char temh,teml; 
//  105     unsigned char a,b,c;
//  106  
//  107     init_1820();  //复位18b20  
        ; Setup parameters for call to function init_1820
        LCALL   ?Subroutine1 & 0xFFFF
//  108     write_1820(0xcc);   // 发出转换命令 搜索器件 
//  109     write_1820(0x44);     //启动 
//  110     for(j=20;j>1;j--)  
??CrossCallReturnLabel_2:
        MOV     R6,#0x13
//  111     Delay_nus(50000);
??read_data_0:
        ; Setup parameters for call to function Delay_nus
        MOV     R2,#0x50
        MOV     R3,#-0x3d
        LCALL   ??Delay_nus?relay
        DEC     R6
        MOV     A,R6
        JNZ     ??read_data_0
//  112     init_1820();  
        ; Setup parameters for call to function init_1820
        LCALL   ?Subroutine0 & 0xFFFF
//  113     write_1820(0xcc);
//  114     //match_rom(serial);   //匹配
//  115     write_1820(0xbe); 
//  116          
//  117     teml=read_1820();  //读数据  
//  118     temh=read_1820();  
//  119     if(temh&0x80)//判断正负
??CrossCallReturnLabel_0:
        MOV     C,0xE0 /* A   */.7
        JNC     ??read_data_1
//  120     {
//  121       flag=1;
        MOV     A,#0x1
        MOV     DPTR,#flag
        MOVX    @DPTR,A
//  122       c=0;
//  123       c=c|temh;
//  124       c=c&0x00ff;
//  125       c=c<<8;
//  126       a=c;
//  127   
//  128       a=c|teml;
//  129  
//  130       a=(a^0xffff);//异或
//  131       a=a+1;  //取反加1
        MOV     A,#-0x1
        XRL     A,?V0 + 0
        INC     A
        MOV     R2,A
//  132       teml=a&0x0f;
        MOV     A,#0xf
        ANL     A,R2
        MOV     ?V0 + 0,A
//  133       temh=a>>4;
        MOV     A,R2
        SWAP    A
        ANL     A,#0xf
        MOV     R2,A
        SJMP    ??read_data_2
//  134     }
//  135     else
//  136     {
//  137       flag=0;   //为正
??read_data_1:
        CLR     A
        MOV     DPTR,#flag
        MOVX    @DPTR,A
//  138       a=temh<<4;
//  139       a+=(teml&0xf0)>>4; //得到高位的值
//  140       b=teml&0x0f;
//  141       temh=a;
        MOV     A,?V0 + 0
        SWAP    A
        ANL     A,#0xf
        PUSH    A
        CFI CFA_SP SP+-1
        MOV     A,R2
        SWAP    A
        ANL     A,#0xf0
        MOV     R2,A
        POP     A
        CFI CFA_SP SP+0
        ADD     A,R2
        MOV     R2,A
//  142       teml=b&0x00ff;
        ANL     ?V0 + 0,#0xf
//  143     }
//  144     sensor_data_value[0]=teml;
??read_data_2:
        MOV     A,?V0 + 0
        MOV     DPTR,#sensor_data_value
        MOVX    @DPTR,A
//  145     sensor_data_value[1]=temh;
        MOV     A,R2
        MOV     DPTR,#(sensor_data_value + 1)
        MOVX    @DPTR,A
//  146  }
        MOV     R7,#0x1
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock7
//  147 
//  148  

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  149 unsigned int read_data_value(void)
read_data_value:
        CFI Block cfiBlock8 Using cfiCommon0
        CFI Function read_data_value
//  150  {
        FUNCALL read_data_value, init_1820
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 10, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 10, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL read_data_value, write_1820
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 10, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 10, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL read_data_value, write_1820
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 10, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 10, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL read_data_value, init_1820
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 10, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 10, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL read_data_value, write_1820
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 10, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 10, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL read_data_value, write_1820
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 10, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 10, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL read_data_value, read_1820
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 10, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 10, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL read_data_value, read_1820
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 10, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 10, 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: 0
//  151 //    unsigned int j; 
//  152     unsigned char temh,teml; 
//  153 //    unsigned char a,b,c;
//  154 //    unsigned int data_value;
//  155  
//  156     init_1820();  //复位18b20  
        ; Setup parameters for call to function init_1820
        LCALL   ?Subroutine1 & 0xFFFF
//  157     write_1820(0xcc);   // 发出转换命令 搜索器件 
//  158     write_1820(0x44);     //启动 
//  159 //    for(j=20;j>1;j--)  
//  160 //    Delay_nus(500);
//  161     init_1820();  
??CrossCallReturnLabel_3:
        ; Setup parameters for call to function init_1820
        LCALL   ?Subroutine0 & 0xFFFF
//  162     write_1820(0xcc);
//  163     //match_rom(serial);   //匹配
//  164     write_1820(0xbe); 
//  165          
//  166     teml=read_1820();  //读数据  
//  167     temh=read_1820();  
//  168 
//  169     sensor_data_value[0]=teml;
??CrossCallReturnLabel_1:
        MOV     A,?V0 + 0
        MOV     DPTR,#sensor_data_value
        MOVX    @DPTR,A
//  170     sensor_data_value[1]=temh;
        MOV     A,R2
        MOV     DPTR,#(sensor_data_value + 1)
        MOVX    @DPTR,A
//  171     
//  172     data_value = temh;
//  173     data_value = ( data_value << 8 )| teml;
        MOV     A,?V0 + 0
        MOV     DPTR,#data_value
        MOVX    @DPTR,A
        INC     DPTR
        MOV     A,R1
        MOVX    @DPTR,A
//  174 
//  175     return data_value;
        MOV     DPTR,#data_value
        MOVX    A,@DPTR
        MOV     R2,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R3,A
        LJMP    ?Subroutine3 & 0xFFFF
        CFI EndBlock cfiBlock8
//  176     
//  177  }

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine1:
        CFI Block cfiCond9 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_2
        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, 9)
        CFI Block cfiCond10 Using cfiCommon0
        CFI (cfiCond10) NoFunction
        CFI (cfiCond10) Conditional ??CrossCallReturnLabel_3
        CFI (cfiCond10) R6 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond10) VB load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond10) V0 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond10) V1 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond10) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond10) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond10) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond10) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond10) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond10) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond10) CFA_SP SP+0
        CFI (cfiCond10) CFA_XSP16 add(XSP16, 10)
        CFI Block cfiPicker11 Using cfiCommon1
        CFI (cfiPicker11) NoFunction
        CFI (cfiPicker11) Picker
        LCALL   ?Subroutine2 & 0xFFFF
??CrossCallReturnLabel_4:
        ; Setup parameters for call to function write_1820
        ; Setup parameters for call to function write_1820
        MOV     R1,#0x44
        LCALL   ??write_1820?relay
        RET
        CFI EndBlock cfiCond9
        CFI EndBlock cfiCond10
        CFI EndBlock cfiPicker11

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine0:
        CFI Block cfiCond12 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_0
        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, 9)
        CFI Block cfiCond13 Using cfiCommon0
        CFI (cfiCond13) NoFunction
        CFI (cfiCond13) Conditional ??CrossCallReturnLabel_1
        CFI (cfiCond13) R6 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond13) VB load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond13) V0 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond13) V1 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, 10)
        CFI Block cfiPicker14 Using cfiCommon1
        CFI (cfiPicker14) NoFunction
        CFI (cfiPicker14) Picker
        LCALL   ?Subroutine2 & 0xFFFF
??CrossCallReturnLabel_5:
        ; Setup parameters for call to function write_1820
        ; Setup parameters for call to function write_1820
        MOV     R1,#-0x42
        LCALL   ??write_1820?relay
        ; Setup parameters for call to function read_1820
        ; Setup parameters for call to function read_1820
        LCALL   ??read_1820?relay
        MOV     A,R1
        MOV     ?V0 + 0,A
        ; Setup parameters for call to function read_1820
        ; Setup parameters for call to function read_1820
        LCALL   ??read_1820?relay
        MOV     A,R1
        MOV     R2,A
        RET
        CFI EndBlock cfiCond12
        CFI EndBlock cfiCond13
        CFI EndBlock cfiPicker14

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine2:
        CFI Block cfiCond15 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_4, ??CrossCallReturnLabel_2
        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, 9)
        CFI Block cfiCond16 Using cfiCommon0
        CFI (cfiCond16) NoFunction
        CFI (cfiCond16) Conditional ??CrossCallReturnLabel_4, ??CrossCallReturnLabel_3
        CFI (cfiCond16) R6 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond16) VB load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond16) V0 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond16) V1 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond16) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond16) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond16) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond16) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond16) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond16) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond16) CFA_SP SP+0
        CFI (cfiCond16) CFA_XSP16 add(XSP16, 10)
        CFI Block cfiCond17 Using cfiCommon0
        CFI (cfiCond17) NoFunction
        CFI (cfiCond17) Conditional ??CrossCallReturnLabel_5, ??CrossCallReturnLabel_0
        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, 9)
        CFI Block cfiCond18 Using cfiCommon0
        CFI (cfiCond18) NoFunction
        CFI (cfiCond18) Conditional ??CrossCallReturnLabel_5, ??CrossCallReturnLabel_1
        CFI (cfiCond18) R6 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond18) VB load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond18) V0 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond18) V1 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond18) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond18) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond18) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond18) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond18) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond18) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond18) CFA_SP SP+0
        CFI (cfiCond18) CFA_XSP16 add(XSP16, 10)
        CFI Block cfiPicker19 Using cfiCommon1
        CFI (cfiPicker19) NoFunction
        CFI (cfiPicker19) Picker
        LCALL   ??init_1820?relay
        ; Setup parameters for call to function write_1820
        ; Setup parameters for call to function write_1820
        ; Setup parameters for call to function write_1820
        ; Setup parameters for call to function write_1820
        MOV     R1,#-0x34
        LCALL   ??write_1820?relay
        RET
        CFI EndBlock cfiCond15
        CFI EndBlock cfiCond16
        CFI EndBlock cfiCond17
        CFI EndBlock cfiCond18
        CFI EndBlock cfiPicker19
//  178    
//  179 ////////////处理数据部分/////////////////

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  180  void DataChange(unsigned char Temp_channel)
DataChange:
        CFI Block cfiBlock20 Using cfiCommon0
        CFI Function DataChange
//  181  {
        ; Saved register size: 0
        ; Auto size: 0
//  182    unsigned char temh,teml;
//  183    unsigned char ch[9];
//  184    unsigned int num;
//  185    unsigned i;
//  186    
//  187    teml=sensor_data_value[0];
//  188    temh=sensor_data_value[1];
//  189    i=(Temp_channel-0x31)*2;
//  190    ch[0]=Temp_channel;//当前显示的传感器的编号
//  191    ch[1]=' ';
//  192    num=teml*625;          //小数部分的取值每位代表0.0625（精度）
//  193    if(flag==1)            //判断正负温度
//  194    {
//  195      ch[2]='-';              //+0x2d 为变"-"ASCII码
//  196    }
//  197    else ch[2]='+';   
//  198    if(temh/100==0)
//  199      ch[3]=' ';
//  200    else ch[3]=temh/100+0x30;      //+0x30 为变 0~9 ASCII码
//  201    if((temh/10%10==0)&&(temh/100==0))
//  202      ch[4]=' ';
//  203    else ch[4]=temh/10%10+0x30;
//  204    ch[5]=temh%10+0x30;
//  205    ch[6]='.';
//  206    ch[7]=num/1000+0x30;//忽略小数点后1位的数
//  207    ch[8]='\0';
//  208  //  Print(i,15,ch,1);   //显示温度值
//  209  //  Print(i,80,"℃",1); //显示摄氏度标示  ℃
//  210 }
        LJMP    ?BRET
        CFI EndBlock cfiBlock20
//  211 
//  212 

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  213 void ds18b20_main()
ds18b20_main:
        CFI Block cfiBlock21 Using cfiCommon0
        CFI Function ds18b20_main
//  214 {
        FUNCALL ds18b20_main, read_data
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 10, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 10, 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: 0
        SJMP    ??ds18b20_main_0
//  215   unsigned char i=0;
//  216   while(1){
//  217     read_data(get_serial+i*8);// 读取温度
??ds18b20_main_1:
        ; Setup parameters for call to function read_data
        MOV     ?V0 + 0,R6
        MOV     ?V0 + 1,#0x0
        MOV     A,#0x3
        MOV     R0,#?V0 + 0
        LCALL   ?S_SHL
        MOV     A,?V0 + 0
        ADD     A,#(get_serial & 0xff)
        MOV     R2,A
        MOV     A,?V0 + 1
        ADDC    A,#((get_serial >> 8) & 0xff)
        MOV     R3,A
        LCALL   ??read_data?relay
//  218     DataChange(i+0x31); //数据处理 
//  219     i++ ;
        INC     R6
//  220     if(i==4) i=0;
        MOV     A,#0x4
        XRL     A,R6
        JNZ     ??ds18b20_main_1
??ds18b20_main_0:
        MOV     R6,#0x0
        SJMP    ??ds18b20_main_1
        CFI EndBlock cfiBlock21
//  221   }
//  222 }

        RSEG XDATA_ID:CODE:NOROOT(0)
        DATA
`?<Initializer for get_serial>`:
        DB 28, 0, 0, 2, 2, 104, 216, 40, 158, 0, 0, 2, 2, 147, 52, 40, 228, 0
        DB 0, 2, 2, 102, 77, 40, 230, 0, 0, 2, 2, 147, 155, 40

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

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

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

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

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

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

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

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

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

        END
//  223 
// 
// 489 bytes in segment BANKED_CODE
//  54 bytes in segment BANK_RELAYS
//   2 bytes in segment SFR_AN
//  32 bytes in segment XDATA_I
//  32 bytes in segment XDATA_ID
//   5 bytes in segment XDATA_Z
// 
// 575 bytes of CODE  memory
//   0 bytes of DATA  memory (+ 2 bytes shared)
//  37 bytes of XDATA memory
//
//Errors: none
//Warnings: none
