main.lst
上传用户:xhjmsc
上传日期:2019-09-13
资源大小:389k
文件大小:90k
源码类别:

传真(Fax)编程

开发平台:

C/C++

  1. ##############################################################################
  2. #                                                                            #
  3. # IAR MSP430 C/EC++ Compiler V2.10A/W32                23/Apr/2007  18:06:22 #
  4. # Copyright 1996-2003 IAR Systems. All rights reserved.                      #
  5. #                                                                            #
  6. #    __rt_version  =  1                                                      #
  7. #    __double_size =  32                                                     #
  8. #    __reg_r4      =  free                                                   #
  9. #    __reg_r5      =  free                                                   #
  10. #    __pic         =  no                                                     #
  11. #    Source file   =  E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  12. #                     filesmain.c                                           #
  13. #    Command line  =  -I "C:Program FilesIAR SystemsEmbedded Workbench    #
  14. #                     3.2430INC" -I "C:Program FilesIAR                 #
  15. #                     SystemsEmbedded Workbench 3.2430INCCLIB" -lCN     #
  16. #                     E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  17. #                     DebugList -lA E:projectFaxProgramVson_Bryan_Fax_ #
  18. #                     Conexant_070423DebugList -o                         #
  19. #                     E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  20. #                     DebugObj -z2 --no_cse --no_unroll --no_inline        #
  21. #                     --no_code_motion --debug -e                            #
  22. #                     E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  23. #                     filesmain.c                                           #
  24. #    List file     =  E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  25. #                     DebugListmain.lst                                    #
  26. #    Object file   =  E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  27. #                     DebugObjmain.r43                                     #
  28. #                                                                            #
  29. #                                                                            #
  30. ##############################################################################
  31. E:projectFaxProgramVson_Bryan_Fax_Conexant_070423filesmain.c
  32.       1          /************************************************
  33.       2          Network 3G Fax
  34.       3          Copyright 2006 by Vson. All rights reserved.
  35.       4          Author:      Bryan Cai
  36.       5          Date:        2006.09.04
  37.       6          Description: Carry out a Network 3G Fax with Conexant CX06833.
  38.       7          Note:
  39.       8          Identifier abbreviation: 
  40.       9                                   c-const
  41.      10                                   a-array
  42.      11                                   p-pointer
  43.      12                                   g-global
  44.      13                                   uc-unsigned char
  45.      14                                   w-unsigned int
  46.      15                                   cnt-count
  47.      16                                   pnt-point
  48.      17          Update:
  49.      18                2007.04.12  Bryan      Concise the FaxManager program
  50.      19                2007.03.20  Bryan      Complete all DTE command function
  51.      20                2007.03.16  Bryan      Fast exit RxProcess when error occur.
  52.      21                2007.01.03  Bryan      Add Modem RX parameter set
  53.      22                2006.12.27  Bryan      add RX multi imagepages
  54.      23                2006.12.22  Bryan      Flash I/O changed
  55.      24                2006.11.02  Bryan      program header
  56.      25          
  57.      26          ************************************************/
  58.      27          
  59.      28          
  60.      29          #include "includeH.h"
  61.                                     In segment DATA16_AN, at 0x120
  62.       unsigned short volatile __data WDTCTL
  63.                         WDTCTL:
  64.       000000                        DS8 2
  65.                                     In segment DATA16_AN, at 0x20
  66.       unsigned char const volatile __data P1IN
  67.                         P1IN:
  68.       000000                        DS8 1
  69.                                     In segment DATA16_AN, at 0x21
  70.       unsigned char volatile __data P1OUT
  71.                         P1OUT:
  72.       000000                        DS8 1
  73.                                     In segment DATA16_AN, at 0x22
  74.       unsigned char volatile __data P1DIR
  75.                         P1DIR:
  76.       000000                        DS8 1
  77.                                     In segment DATA16_AN, at 0x36
  78.       unsigned char volatile __data P6DIR
  79.                         P6DIR:
  80.       000000                        DS8 1
  81.      30          
  82.      31          
  83.      32          
  84.      33          //interrupt [USART0TX_VECTOR] void intUartTx(void);
  85.      34          //interrupt [USART0RX_VECTOR] void intUartRx(void);
  86.      35          
  87.      36          /* AT command Set
  88.      37          unsigned char  ATcmdPrefix[]={0x41,0x54}, ATcmdSuffix[]={0x0D},
  89.      38                          //ATFS0[]={0x26,0x46,0x53,0x30,0x3d,0x30,0x45,0x31,0x56,0x31,0x51,0x30},
  90.      39                          //ATS7[]={0x53,0x37,0x3d,0x36,0x30,0x26,0x44,0x33,0x26,0x4b,0x34},
  91.      40                          //ATX4M1L0[]={0x58,0x34,0x4d,0x31,0x4c,0x30},
  92.      41                          //FCLASS[]={0x2b,0x46,0x43,0x4c,0x41,0x53,0x53,0x3d,0x31},
  93.      42                          //FCLASS0[]={0x2b,0x46,0x43,0x4c,0x41,0x53,0x53,0x3d,0x30},
  94.      43                          
  95.      44                          
  96.      45                          ATS0RX[]={0x53,0x30,0x3d,0x30},                
  97.      46                          DT[]={0x44,0x54,0x39,0x36,0x31,0x31,0x33,0x39,0x35,0x30,0x39},
  98.      47                          A[]={0x41},
  99.      48                          //DT[]={0x44,0x54,0x39,0x30,0x37,0x39,0x37,0x36,0x39,0x30,0x35,0x31,0x39,0x31},     
  100.      49                          FRH[]={0x2b,0x46,0x52,0x48,0x3d,0x33,0x0d},  
  101.      50                          FTH[]={0x2b,0x46,0x54,0x48,0x3d,0x33,0x0d},
  102.      51                          //FTHNSF[]={0xff,0x03,0x54,0x47,0x46,0x33,0x36,0x36,0x43,0x00,0x77,0x9C,0x10,0x03},
  103.      52                  //for TX 
  104.      53                          FTHTSI[]={0xff,0x03,0x43,0x78,0x61,0x46,0x10,0x03},
  105.      54                          FTHDCS[]={0xff,0x13,0x83,0x00,0x46,0x78,0x10,0x03},//for TX
  106.      55                  //for RX
  107.      56                          //FTHCSI[]={0xff,0x03,0x40,0x78,0x61,0x46,0x10,0x03},//@Fax
  108.      57                          FTHCSI[]={0xff,0x03,0x40,0x36,0x33,0x38,0x10,0x03},//@836
  109.      58                          FTHDIS[]={0xff,0x13,0x80,0x00,0xee,0x78,0x10,0x03},//for RX ee 78
  110.      59                          //FTHDIS[]={0xff,0x13,0x80,0x00,0x46,0x70,0x10,0x03},//for RX ee 78
  111.      60                          //FTHCSI[]={0xff,0x03,0x40,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x36,0x33,0x38,0x10,0x03},//@Fax
  112.      61                          //FTHDIS[]={0xff,0x13,0x80,0x00,0xee,0x78,0x10,0x03},//for RX ee 78
  113.      62                          FTHCFR[]={0xff,0x13,0x84,0x10,0x03},// Confirmation to receive  MSB 21H LSB 83H
  114.      63                          FTHMCF[]={0xff,0x13,0x8C,0x10,0x03},// Message Confirmation MSB 31H LSB 8CH
  115.      64                          FTHEOP[]={0xff,0x13,0x2f,0x10,0x03},
  116.      65                          FTHDNC[]={0xff,0x13,0xfb,0x10,0x03},
  117.      66                          FTHEOM[]={0xff,0x03,0x43,0x78,0x61,0x46,0x10,0x03},
  118.      67                          FTS[]={0x2b,0x46,0x54,0x53,0x3d,0x38},  
  119.      68                          FTM[]={0x2b,0x46,0x54,0x4d,0x3d,0x39,0x36},
  120.      69                          //FRM[]={0x2b,0x46,0x52,0x4d,0x3d,0x31,0x34,0x35},
  121.      70                          FRM[]={0x2b,0x46,0x52,0x4d,0x3d,0x39,0x36},  
  122.      71                          H0[]={0x48,0x00}, 
  123.      72                          TerminalFlag[]={0x10,0x03};
  124.      73          */
  125.      74          
  126.      75          
  127.      76          
  128.                                     In segment CODE, align 2, keep-with-next
  129.      77          void main(void)
  130.                         main:
  131.      78          {     
  132.       000000   0A12                 PUSH.W  R10
  133.       000002   0B12                 PUSH.W  R11
  134.       000004   0812                 PUSH.W  R8
  135.       000006   0912                 PUSH.W  R9
  136.       000008   0612                 PUSH.W  R6
  137.       00000A   0712                 PUSH.W  R7
  138.       00000C   0412                 PUSH.W  R4
  139.       00000E   0512                 PUSH.W  R5
  140.       000010   31800C00             SUB.W   #0xc, SP
  141.      79          
  142.      80                  
  143.      81                unsigned int wGeneralCount = 0, 
  144.       000014   81430000             MOV.W   #0x0, 0x0(SP)
  145.      82                             wOKcount=0, 
  146.       000018   81430800             MOV.W   #0x0, 0x8(SP)
  147.      83                             wNotOKcount=0, 
  148.       00001C   81430A00             MOV.W   #0x0, 0xa(SP)
  149.      84                             wOneFaxHead=0, 
  150.       000020   81430200             MOV.W   #0x0, 0x2(SP)
  151.      85                             wOneFaxRear=0,
  152.       000024   81430400             MOV.W   #0x0, 0x4(SP)
  153.      86                             wGeneralVar=0;
  154.       000028   0A43                 MOV.W   #0x0, R10
  155.      87                unsigned char
  156.      88                              ucRxIndex3=0,ucRxIndex2=0,
  157.       00002A   4543                 MOV.B   #0x0, R5
  158.       00002C   4443                 MOV.B   #0x0, R4
  159.      89                              ucRxIndex1=0,ucRxIndex0=0,
  160.       00002E   4B43                 MOV.B   #0x0, R11
  161.       000030   4843                 MOV.B   #0x0, R8
  162.      90                              ucSoftUartRxCnt=0;
  163.       000032   4643                 MOV.B   #0x0, R6
  164.      91                //unsigned char ucGeneralCount=1;
  165.      92                unsigned char ucGeneralCnt=0;
  166.       000034   C1430600             MOV.B   #0x0, 0x6(SP)
  167.      93                unsigned char ucRingNum=0;
  168.       000038   4743                 MOV.B   #0x0, R7
  169.      94                unsigned char ucRxIndex=0;
  170.       00003A   4943                 MOV.B   #0x0, R9
  171.      95                //unsigned char ucSoftUartRxData=0;
  172.      96                //unsigned char ucFlashWriteData;
  173.      97                //unsigned char ucFlashColumnAddCnt;
  174.      98                //unsigned int wGeneralCnt;
  175.      99                //unsigned int wBlockAddress=0,wPageAddress=0;
  176.     100                WDTCTL=WDTPW+WDTHOLD;              //close watch dog
  177.       00003C   B240805A2001         MOV.W   #0x5a80, &0x120
  178.     101                
  179.     102          /*
  180.     103                FLASH_CON_PORT_OUT |= CE; //COMMAND_LATCH_INTO_INITAIL all control disable
  181.     104                 FLASH_CON_PORT_OUT &= ~CE;
  182.     105                FLASH_CON_PORT_OUT |= WE;
  183.     106                 FLASH_CON_PORT_OUT &= ~WE;
  184.     107                FLASH_CON_PORT_OUT |= RE;
  185.     108                 FLASH_CON_PORT_OUT &= ~RE;
  186.     109                  FLASH_CON_PORT_OUT |= CLE;
  187.     110                FLASH_CON_PORT_OUT &= ~CLE;
  188.     111                 FLASH_CON_PORT_OUT |= ALE;
  189.     112                FLASH_CON_PORT_OUT &= ~ALE;
  190.     113          */
  191.     114                //while (1) _NOP(); 
  192.     115                IoInitial();
  193.       000042   B012....             CALL    #IoInitial
  194.     116                InitUART();
  195.       000046   B012....             CALL    #InitUART
  196.     117                Flash_Reset();
  197.       00004A   B012....             CALL    #Flash_Reset
  198.     118                FLASH_READ_ID();
  199.       00004E   B012....             CALL    #FLASH_READ_ID
  200.     119                //while (0) aucUartRxBuf[ucRxIndex++]=SoftUartRxOneFrame();
  201.     120                SOFTUART_PORT_DIRECTION |= bitSOFTUARTTX;
  202.       000052   D2D33600             BIS.B   #0x1, &0x36
  203.     121          /*
  204.     122                while (0)
  205.     123                {
  206.     124                SOFTUART_PORT_OUT |= bitSOFTUARTTX;
  207.     125                delay1us(20);
  208.     126                SOFTUART_PORT_OUT &= ~bitSOFTUARTTX;
  209.     127                delay1us(8);
  210.     128                SOFTUART_PORT_OUT |= bitSOFTUARTTX;
  211.     129                for (ucGeneralCnt=0;ucGeneralCnt<8;ucGeneralCnt++)
  212.     130               {
  213.     131                  delay1us(2);//SoftUartDelayHalf();
  214.     132                  ucSoftUartRxData=ucSoftUartRxData>>1;
  215.     133                  //if ((SOFTUART_PORT_IN & bitSOFTUARTRX) == bitSOFTUARTRX)
  216.     134                    //ucSoftUartRxData |= BIT7;//BIT7;//(1<<ucGeneralCount);//set   Rx bit
  217.     135                  //else
  218.     136                    //{ucSoftUartRxData &= ~BIT7;__no_operation();__no_operation();__no_operation();}//~BIT7;//~(1<<ucGeneralCount);//set   Rx bit
  219.     137                  if ((SOFTUART_PORT_OUT & bitSOFTUARTTX) != bitSOFTUARTTX)
  220.     138                    {SOFTUART_PORT_OUT |= bitSOFTUARTTX;} //set   Tx bit
  221.     139                  else
  222.     140                    {SOFTUART_PORT_OUT &= ~bitSOFTUARTTX;__no_operation();__no_operation();}
  223.     141                  delay1us(2);//SoftUartDelayHalf();
  224.     142                  __no_operation();
  225.     143                  __no_operation();
  226.     144                  __no_operation();
  227.     145                  __no_operation();
  228.     146                  __no_operation();
  229.     147                    
  230.     148                }
  231.     149                
  232.     150                SOFTUART_PORT_OUT &= ~bitSOFTUARTTX;
  233.     151                delay1us(8);
  234.     152                SOFTUART_PORT_OUT |= bitSOFTUARTTX;
  235.     153               }
  236.     154               */
  237.     155                Delay2000ms();
  238.       000056   B012....             CALL    #Delay2000ms
  239.     156                
  240.     157                ReadLastViewData();
  241.       00005A   7E402900             MOV.B   #0x29, R14
  242.       00005E   7C402800             MOV.B   #0x28, R12
  243.       000062   B012....             CALL    #ReadLast16BytesFromFlashMemoryArea
  244.     158                //ReadLast16BytesFromFlashMemoryArea(cstViewDataAreaStartBlockNum,cstViewDataAreaOverBlockNum);
  245.     159                 
  246.     160                ucRxIndex=gucUartRxCnt;
  247.       000066   5942....             MOV.B   &gucUartRxCnt, R9
  248.     161                if ((gucGeneralStatus & bitReadFlashMemoryOK) == bitReadFlashMemoryOK)
  249.       00006A   F2B02000....         BIT.B   #0x20, &gucGeneralStatus
  250.       000070   1C28                 JNC     ??main_10
  251.     162                {
  252.     163                 gucViewRingNum = aucUartRxBuf[ucRxIndex++];
  253.       000072   4E49                 MOV.B   R9, R14
  254.       000074   3EF0FF00             AND.W   #0xff, R14
  255.       000078   D24E........         MOV.B   aucUartRxBuf(R14), &aucViewData + 0x6
  256.       00007E   5953                 ADD.B   #0x1, R9
  257.     164                 gucViewStaticStatus = aucUartRxBuf[ucRxIndex++];
  258.       000080   4E49                 MOV.B   R9, R14
  259.       000082   3EF0FF00             AND.W   #0xff, R14
  260.       000086   D24E........         MOV.B   aucUartRxBuf(R14), &aucViewData + 0x7
  261.       00008C   5953                 ADD.B   #0x1, R9
  262.     165                 gucViewDynamicStatus = aucUartRxBuf[ucRxIndex++];
  263.       00008E   4E49                 MOV.B   R9, R14
  264.       000090   3EF0FF00             AND.W   #0xff, R14
  265.       000094   D24E........         MOV.B   aucUartRxBuf(R14), &aucViewData + 0x8
  266.       00009A   5953                 ADD.B   #0x1, R9
  267.     166                 gucViewDceNewFaxNum = aucUartRxBuf[ucRxIndex++];
  268.       00009C   4E49                 MOV.B   R9, R14
  269.       00009E   3EF0FF00             AND.W   #0xff, R14
  270.       0000A2   D24E........         MOV.B   aucUartRxBuf(R14), &aucViewData + 0x9
  271.       0000A8   5953                 ADD.B   #0x1, R9
  272.     167                }
  273.     168                ViewCommunicationTX(0);
  274.                         ??main_10:
  275.       0000AA   4C43                 MOV.B   #0x0, R12
  276.       0000AC   B012....             CALL    #ViewCommunicationTX
  277.     169                
  278.     170                //while (1) wGeneralCount = gwGeneralPageAddress>>6;
  279.     171                //while (1) _NOP();
  280.     172          /*
  281.     173                while (1) 
  282.     174                {
  283.     175                 ViewCommunicationTX(1); 
  284.     176                 ViewCommunicationRX();
  285.     177                }
  286.     178          */
  287.     179          
  288.     180           
  289.     181          
  290.     182             
  291.     183               
  292.     184               //while (1)
  293.     185               //{
  294.     186               //Initial Device  Reset Modem
  295.     187                ModemResetPortDir |= bitModemHardwareReset;
  296.       0000B0   F2D040002200         BIS.B   #0x40, &0x22
  297.     188                ModemResetCon &= ~bitModemHardwareReset;
  298.       0000B6   F2C040002100         BIC.B   #0x40, &0x21
  299.     189                ATcmdDelay();
  300.       0000BC   B012....             CALL    #ATcmdDelay
  301.     190                ModemResetPortDir &= ~bitModemHardwareReset;
  302.       0000C0   F2C040002200         BIC.B   #0x40, &0x22
  303.     191                ModemResetCon |= bitModemHardwareReset;
  304.       0000C6   F2D040002100         BIS.B   #0x40, &0x21
  305.     192               while (1)
  306.     193               {
  307.     194                     
  308.     195                  ATcmdDelay();
  309.                         ??main_0:
  310.       0000CC   B012....             CALL    #ATcmdDelay
  311.     196                  SendATcmd();          
  312.       0000D0   B012....             CALL    #SendATcmd
  313.     197                  ATcmdDelay();
  314.       0000D4   B012....             CALL    #ATcmdDelay
  315.     198                  ATcmdDelay();
  316.       0000D8   B012....             CALL    #ATcmdDelay
  317.     199                  if ((0x0d!=aucUartRxBuf[ucRxIndex0])&&(0x4B!=aucUartRxBuf[ucRxIndex1]))
  318.       0000DC   4E48                 MOV.B   R8, R14
  319.       0000DE   3EF0FF00             AND.W   #0xff, R14
  320.       0000E2   FE900D00....         CMP.B   #0xd, aucUartRxBuf(R14)
  321.       0000E8   F127                 JEQ     ??main_0
  322.       0000EA   4E4B                 MOV.B   R11, R14
  323.       0000EC   3EF0FF00             AND.W   #0xff, R14
  324.       0000F0   FE904B00....         CMP.B   #0x4b, aucUartRxBuf(R14)
  325.       0000F6   EA27                 JEQ     ??main_0
  326.     200                  {
  327.     201                  SendATcmdModemSoftReset();
  328.       0000F8   B012....             CALL    #SendATcmdModemSoftReset
  329.     202                  ATcmdDelay();
  330.       0000FC   B012....             CALL    #ATcmdDelay
  331.     203                  ATcmdDelay();
  332.       000100   B012....             CALL    #ATcmdDelay
  333.     204                
  334.     205                  ucRxIndex1=gucUartRxCnt-3;
  335.       000104   7E40FD00             MOV.B   #0xfd, R14
  336.       000108   5E52....             ADD.B   &gucUartRxCnt, R14
  337.       00010C   4B4E                 MOV.B   R14, R11
  338.     206                  ucRxIndex0=gucUartRxCnt-2;
  339.       00010E   7E40FE00             MOV.B   #0xfe, R14
  340.       000112   5E52....             ADD.B   &gucUartRxCnt, R14
  341.       000116   484E                 MOV.B   R14, R8
  342.     207                  if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
  343.       000118   4E48                 MOV.B   R8, R14
  344.       00011A   3EF0FF00             AND.W   #0xff, R14
  345.       00011E   FE900D00....         CMP.B   #0xd, aucUartRxBuf(R14)
  346.       000124   D323                 JNE     ??main_0
  347.       000126   4E4B                 MOV.B   R11, R14
  348.       000128   3EF0FF00             AND.W   #0xff, R14
  349.       00012C   FE904B00....         CMP.B   #0x4b, aucUartRxBuf(R14)
  350.       000132   CC23                 JNE     ??main_0
  351.     208                    {break;}
  352.     209                  }
  353.     210               }//while
  354.     211               while (1)
  355.     212               {
  356.     213                ATcmdDelay();
  357.                         ??main_2:
  358.       000134   B012....             CALL    #ATcmdDelay
  359.     214                SendATcmd();          //a bug of Sep.22 If this AT is not added, the ring can't receive sometimes.
  360.       000138   B012....             CALL    #SendATcmd
  361.     215                ATcmdDelay();
  362.       00013C   B012....             CALL    #ATcmdDelay
  363.     216                ATcmdDelay();
  364.       000140   B012....             CALL    #ATcmdDelay
  365.     217              
  366.     218                while (wGeneralCount++<0xffff)
  367.                         ??main_1:
  368.       000144   2E41                 MOV.W   0x0(SP), R14
  369.       000146   1F43                 MOV.W   #0x1, R15
  370.       000148   0F5E                 ADD.W   R14, R15
  371.       00014A   814F0000             MOV.W   R15, 0x0(SP)
  372.       00014E   3E93                 CMP.W   #0xffff, R14
  373.       000150   2524                 JEQ     ??main_11
  374.     219                {
  375.     220                 ucRxIndex1=gucUartRxCnt-3;
  376.       000152   7E40FD00             MOV.B   #0xfd, R14
  377.       000156   5E52....             ADD.B   &gucUartRxCnt, R14
  378.       00015A   4B4E                 MOV.B   R14, R11
  379.     221                 ucRxIndex0=gucUartRxCnt-2;
  380.       00015C   7E40FE00             MOV.B   #0xfe, R14
  381.       000160   5E52....             ADD.B   &gucUartRxCnt, R14
  382.       000164   484E                 MOV.B   R14, R8
  383.     222                 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
  384.       000166   38F0FF00             AND.W   #0xff, R8
  385.       00016A   F8900D00....         CMP.B   #0xd, aucUartRxBuf(R8)
  386.       000170   0920                 JNE     ??main_12
  387.       000172   3BF0FF00             AND.W   #0xff, R11
  388.       000176   FB904B00....         CMP.B   #0x4b, aucUartRxBuf(R11)
  389.       00017C   0320                 JNE     ??main_12
  390.     223                  {wOKcount++;break;}
  391.       00017E   91530800             ADD.W   #0x1, 0x8(SP)
  392.       000182   0C3C                 JMP     ??main_11
  393.     224                 if (wGeneralCount==0xffff)
  394.                         ??main_12:
  395.       000184   B1930000             CMP.W   #0xffff, 0x0(SP)
  396.       000188   DD23                 JNE     ??main_1
  397.     225                 {    
  398.     226                  //wGeneralCount=0;
  399.     227                  wNotOKcount++;
  400.       00018A   91530A00             ADD.W   #0x1, 0xa(SP)
  401.     228                  SendATcmdModemSoftReset();
  402.       00018E   B012....             CALL    #SendATcmdModemSoftReset
  403.     229                  ATcmdDelay();
  404.       000192   B012....             CALL    #ATcmdDelay
  405.     230                  ATcmdDelay();
  406.       000196   B012....             CALL    #ATcmdDelay
  407.       00019A   D43F                 JMP     ??main_1
  408.     231                 }//if
  409.     232                }//while
  410.     233                ucRxIndex1=gucUartRxCnt-3;
  411.                         ??main_11:
  412.       00019C   7E40FD00             MOV.B   #0xfd, R14
  413.       0001A0   5E52....             ADD.B   &gucUartRxCnt, R14
  414.       0001A4   4B4E                 MOV.B   R14, R11
  415.     234                ucRxIndex0=gucUartRxCnt-2;
  416.       0001A6   7E40FE00             MOV.B   #0xfe, R14
  417.       0001AA   5E52....             ADD.B   &gucUartRxCnt, R14
  418.       0001AE   484E                 MOV.B   R14, R8
  419.     235                if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
  420.       0001B0   38F0FF00             AND.W   #0xff, R8
  421.       0001B4   F8900D00....         CMP.B   #0xd, aucUartRxBuf(R8)
  422.       0001BA   BC23                 JNE     ??main_2
  423.       0001BC   3BF0FF00             AND.W   #0xff, R11
  424.       0001C0   FB904B00....         CMP.B   #0x4b, aucUartRxBuf(R11)
  425.       0001C6   B623                 JNE     ??main_2
  426.     236                  {wOKcount++;break;}
  427.       0001C8   91530800             ADD.W   #0x1, 0x8(SP)
  428.     237               }//while
  429.     238          
  430.     239               _NOP();
  431.       0001CC   0343                 NOP
  432.     240               gucGeneralStatus &= ~bitModemActive;
  433.       0001CE   E2C3....             BIC.B   #0x2, &gucGeneralStatus
  434.     241               
  435.     242               //gucUartRxCnt++;
  436.     243               //}//while
  437.     244                
  438.     245               //Main Circle
  439.     246               while (1)
  440.     247               {     
  441.     248                //Key Scan and Set Parameters
  442.     249                
  443.     250                KeyScan();
  444.                         ??main_7:
  445.       0001D2   B012....             CALL    #KeyScan
  446.     251                //}// test keyscan
  447.     252                //while (1)//test keyscan
  448.     253                //{//test keyscan
  449.     254                
  450.     255                //if Modem active(bitModemActive=0X0002)
  451.     256                   //detect modem
  452.     257                //else
  453.     258                  //detect PC command through SoftUart
  454.     259                ucRingNum=0;
  455.       0001D6   4743                 MOV.B   #0x0, R7
  456.     260                if ((gucGeneralStatus & bitModemActive) == bitModemActive)
  457.       0001D8   E2B3....             BIT.B   #0x2, &gucGeneralStatus
  458.       0001DC   1B29                 JNC     ??main_13
  459.     261                {             
  460.     262                      while (wGeneralCount++<0xffff)    
  461.                         ??main_3:
  462.       0001DE   2E41                 MOV.W   0x0(SP), R14
  463.       0001E0   1F43                 MOV.W   #0x1, R15
  464.       0001E2   0F5E                 ADD.W   R14, R15
  465.       0001E4   814F0000             MOV.W   R15, 0x0(SP)
  466.       0001E8   3E93                 CMP.W   #0xffff, R14
  467.       0001EA   BC24                 JEQ     ??main_14
  468.     263                      { 
  469.     264                        ucRxIndex3=gucUartRxCnt-6;
  470.       0001EC   7E40FA00             MOV.B   #0xfa, R14
  471.       0001F0   5E52....             ADD.B   &gucUartRxCnt, R14
  472.       0001F4   454E                 MOV.B   R14, R5
  473.     265                        ucRxIndex2=gucUartRxCnt-5;
  474.       0001F6   7E40FB00             MOV.B   #0xfb, R14
  475.       0001FA   5E52....             ADD.B   &gucUartRxCnt, R14
  476.       0001FE   444E                 MOV.B   R14, R4
  477.     266                        ucRxIndex1=gucUartRxCnt-4;
  478.       000200   7E40FC00             MOV.B   #0xfc, R14
  479.       000204   5E52....             ADD.B   &gucUartRxCnt, R14
  480.       000208   4B4E                 MOV.B   R14, R11
  481.     267                        ucRxIndex0=gucUartRxCnt-3;
  482.       00020A   7E40FD00             MOV.B   #0xfd, R14
  483.       00020E   5E52....             ADD.B   &gucUartRxCnt, R14
  484.       000212   484E                 MOV.B   R14, R8
  485.     268                        if ((aucUartRxBuf[ucRxIndex0]==0x47)&&(aucUartRxBuf[ucRxIndex1]==0x4e)&&
  486.     269                            (aucUartRxBuf[ucRxIndex2]==0x49)&&(aucUartRxBuf[ucRxIndex3]==0x52))
  487.       000214   38F0FF00             AND.W   #0xff, R8
  488.       000218   F8904700....         CMP.B   #0x47, aucUartRxBuf(R8)
  489.       00021E   DF23                 JNE     ??main_3
  490.       000220   3BF0FF00             AND.W   #0xff, R11
  491.       000224   FB904E00....         CMP.B   #0x4e, aucUartRxBuf(R11)
  492.       00022A   D923                 JNE     ??main_3
  493.       00022C   34F0FF00             AND.W   #0xff, R4
  494.       000230   F4904900....         CMP.B   #0x49, aucUartRxBuf(R4)
  495.       000236   D323                 JNE     ??main_3
  496.       000238   35F0FF00             AND.W   #0xff, R5
  497.       00023C   F5905200....         CMP.B   #0x52, aucUartRxBuf(R5)
  498.       000242   CD23                 JNE     ??main_3
  499.     270                        {
  500.     271                          gucUartRxCnt+=1;
  501.       000244   D253....             ADD.B   #0x1, &gucUartRxCnt
  502.     272                          ucRingNum++;
  503.       000248   5753                 ADD.B   #0x1, R7
  504.     273                          //if AutoMode
  505.     274                          //{
  506.     275                          //if Ring Num < Ring Num Max
  507.     276                              //gucUartRxCnt++; RingNumCnt++;
  508.     277                          //else
  509.     278                              //break;
  510.     279                          //}
  511.     280                          //else (Manual Mode)
  512.     281                            //if Receive Start Key Switch On
  513.     282                            //   break;
  514.     283                          if ((gucViewStaticStatus & bitViewAutoMode) == bitViewAutoMode) //auto mode
  515.       00024A   F2B01000....         BIT.B   #0x10, &aucViewData + 0x7
  516.       000250   4C28                 JNC     ??main_5
  517.     284                           {
  518.     285                             while (1)
  519.     286                              {
  520.     287                             
  521.     288                                ucRxIndex3=gucUartRxCnt-6;
  522.                         ??main_4:
  523.       000252   7E40FA00             MOV.B   #0xfa, R14
  524.       000256   5E52....             ADD.B   &gucUartRxCnt, R14
  525.       00025A   454E                 MOV.B   R14, R5
  526.     289                                  ucRxIndex2=gucUartRxCnt-5;
  527.       00025C   7E40FB00             MOV.B   #0xfb, R14
  528.       000260   5E52....             ADD.B   &gucUartRxCnt, R14
  529.       000264   444E                 MOV.B   R14, R4
  530.     290                                  ucRxIndex1=gucUartRxCnt-4;
  531.       000266   7E40FC00             MOV.B   #0xfc, R14
  532.       00026A   5E52....             ADD.B   &gucUartRxCnt, R14
  533.       00026E   4B4E                 MOV.B   R14, R11
  534.     291                                  ucRxIndex0=gucUartRxCnt-3;
  535.       000270   7E40FD00             MOV.B   #0xfd, R14
  536.       000274   5E52....             ADD.B   &gucUartRxCnt, R14
  537.       000278   484E                 MOV.B   R14, R8
  538.     292                                  if ((aucUartRxBuf[ucRxIndex0]==0x47)&&(aucUartRxBuf[ucRxIndex1]==0x4e)&&
  539.     293                                      (aucUartRxBuf[ucRxIndex2]==0x49)&&(aucUartRxBuf[ucRxIndex3]==0x52))
  540.       00027A   38F0FF00             AND.W   #0xff, R8
  541.       00027E   F8904700....         CMP.B   #0x47, aucUartRxBuf(R8)
  542.       000284   1520                 JNE     ??main_15
  543.       000286   3BF0FF00             AND.W   #0xff, R11
  544.       00028A   FB904E00....         CMP.B   #0x4e, aucUartRxBuf(R11)
  545.       000290   0F20                 JNE     ??main_15
  546.       000292   34F0FF00             AND.W   #0xff, R4
  547.       000296   F4904900....         CMP.B   #0x49, aucUartRxBuf(R4)
  548.       00029C   0920                 JNE     ??main_15
  549.       00029E   35F0FF00             AND.W   #0xff, R5
  550.       0002A2   F5905200....         CMP.B   #0x52, aucUartRxBuf(R5)
  551.       0002A8   0320                 JNE     ??main_15
  552.     294                                       {ucRingNum++;gucUartRxCnt++;}// pointer to next imcoming RING
  553.       0002AA   5753                 ADD.B   #0x1, R7
  554.       0002AC   D253....             ADD.B   #0x1, &gucUartRxCnt
  555.     295                                  if (ucRingNum>=gucViewRingNum) 
  556.                         ??main_15:
  557.       0002B0   5792....             CMP.B   &aucViewData + 0x6, R7
  558.       0002B4   0428                 JNC     ??main_16
  559.     296                                   {gucGeneralStatus |= bitSendFaxSignalOK;break;}//OK
  560.       0002B6   F2D01000....         BIS.B   #0x10, &gucGeneralStatus
  561.       0002BC   533C                 JMP     ??main_14
  562.     297                                  //time overflow quit
  563.     298                                  if (gwTimeOverflowCount++ == 0xffff)
  564.                         ??main_16:
  565.       0002BE   1E42....             MOV.W   &gwTimeOverflowCount, R14
  566.       0002C2   1F43                 MOV.W   #0x1, R15
  567.       0002C4   0F5E                 ADD.W   R14, R15
  568.       0002C6   824F....             MOV.W   R15, &gwTimeOverflowCount
  569.       0002CA   3E93                 CMP.W   #0xffff, R14
  570.       0002CC   0220                 JNE     ??main_17
  571.     299                                       gucTimeOverflowCount++;
  572.       0002CE   D253....             ADD.B   #0x1, &gucTimeOverflowCount
  573.     300                                  if (gucTimeOverflowCount == 20)
  574.                         ??main_17:
  575.       0002D2   F2901400....         CMP.B   #0x14, &gucTimeOverflowCount
  576.       0002D8   BC23                 JNE     ??main_4
  577.     301                                  {gucGeneralStatus &= ~bitSendFaxSignalOK;gucTimeOverflowCount=0;gwTimeOverflowCount=0;break;}
  578.       0002DA   F2C01000....         BIC.B   #0x10, &gucGeneralStatus
  579.       0002E0   C243....             MOV.B   #0x0, &gucTimeOverflowCount
  580.       0002E4   8243....             MOV.W   #0x0, &gwTimeOverflowCount
  581.       0002E8   3D3C                 JMP     ??main_14
  582.     302                              }
  583.     303                             
  584.     304                           }//if auto mode end
  585.     305                          else //manual mode
  586.     306                           {
  587.     307                             while (1)
  588.     308                             {
  589.     309                               gucUartRxCnt++;// pointer to next imcoming RING
  590.                         ??main_5:
  591.       0002EA   D253....             ADD.B   #0x1, &gucUartRxCnt
  592.     310                               ucRxIndex3=gucUartRxCnt-6;
  593.       0002EE   7E40FA00             MOV.B   #0xfa, R14
  594.       0002F2   5E52....             ADD.B   &gucUartRxCnt, R14
  595.       0002F6   454E                 MOV.B   R14, R5
  596.     311                                ucRxIndex2=gucUartRxCnt-5;
  597.       0002F8   7E40FB00             MOV.B   #0xfb, R14
  598.       0002FC   5E52....             ADD.B   &gucUartRxCnt, R14
  599.       000300   444E                 MOV.B   R14, R4
  600.     312                                ucRxIndex1=gucUartRxCnt-4;
  601.       000302   7E40FC00             MOV.B   #0xfc, R14
  602.       000306   5E52....             ADD.B   &gucUartRxCnt, R14
  603.       00030A   4B4E                 MOV.B   R14, R11
  604.     313                                ucRxIndex0=gucUartRxCnt-3;
  605.       00030C   7E40FD00             MOV.B   #0xfd, R14
  606.       000310   5E52....             ADD.B   &gucUartRxCnt, R14
  607.       000314   484E                 MOV.B   R14, R8
  608.     314                                if ((aucUartRxBuf[ucRxIndex0]==0x47)&&(aucUartRxBuf[ucRxIndex1]==0x4e)&&
  609.     315                                    (aucUartRxBuf[ucRxIndex2]==0x49)&&(aucUartRxBuf[ucRxIndex3]==0x52))
  610.       000316   38F0FF00             AND.W   #0xff, R8
  611.       00031A   F8904700....         CMP.B   #0x47, aucUartRxBuf(R8)
  612.       000320   1320                 JNE     ??main_18
  613.       000322   3BF0FF00             AND.W   #0xff, R11
  614.       000326   FB904E00....         CMP.B   #0x4e, aucUartRxBuf(R11)
  615.       00032C   0D20                 JNE     ??main_18
  616.       00032E   34F0FF00             AND.W   #0xff, R4
  617.       000332   F4904900....         CMP.B   #0x49, aucUartRxBuf(R4)
  618.       000338   0720                 JNE     ??main_18
  619.       00033A   35F0FF00             AND.W   #0xff, R5
  620.       00033E   F5905200....         CMP.B   #0x52, aucUartRxBuf(R5)
  621.       000344   0120                 JNE     ??main_18
  622.     316                                    ucRingNum++;
  623.       000346   5753                 ADD.B   #0x1, R7
  624.     317                                if (ucRingNum>10)//if RING is over 10, error
  625.                         ??main_18:
  626.       000348   77900B00             CMP.B   #0xb, R7
  627.       00034C   0428                 JNC     ??main_19
  628.     318                                {gucGeneralStatus &= ~bitSendFaxSignalOK;break;}//Not OK
  629.       00034E   F2C01000....         BIC.B   #0x10, &gucGeneralStatus
  630.       000354   073C                 JMP     ??main_14
  631.     319                               if ((KEY_PORT_IN & bitKeySendFaxSignal) != bitKeySendFaxSignal)
  632.                         ??main_19:
  633.       000356   F2B010002000         BIT.B   #0x10, &0x20
  634.       00035C   C62F                 JC      ??main_5
  635.     320                                {gucGeneralStatus |= bitSendFaxSignalOK;break;}//OK      
  636.       00035E   F2D01000....         BIS.B   #0x10, &gucGeneralStatus
  637.     321                             }
  638.     322                           }//else manual mode end
  639.     323                          break;
  640.     324                        }//if 
  641.     325                      }//while
  642.     326                      
  643.     327          
  644.     328                        //receive fax
  645.     329                        if ((gucGeneralStatus & bitSendFaxSignalOK) == bitSendFaxSignalOK)
  646.                         ??main_14:
  647.       000364   F2B01000....         BIT.B   #0x10, &gucGeneralStatus
  648.       00036A   5128                 JNC     ??main_20
  649.     330                          {
  650.     331                            gucGeneralStatus &= ~bitSendFaxSignalOK;
  651.       00036C   F2C01000....         BIC.B   #0x10, &gucGeneralStatus
  652.     332                            //Driver Screen Flash Receiving
  653.     333                            
  654.     334                            gucViewDynamicStatus |= bitViewReceiving;
  655.       000372   D2D3....             BIS.B   #0x1, &aucViewData + 0x8
  656.     335             
  657.     336                            ViewCommunicationTX(0x01);
  658.       000376   5C43                 MOV.B   #0x1, R12
  659.       000378   B012....             CALL    #ViewCommunicationTX
  660.     337                            //ViewCommunicationRX();
  661.     338          
  662.     339                            
  663.     340                            gucUartRxCnt=0;//
  664.       00037C   C243....             MOV.B   #0x0, &gucUartRxCnt
  665.     341                            gucFrhErrorStatus=0x00;
  666.       000380   C243....             MOV.B   #0x0, &gucFrhErrorStatus
  667.     342                            FaxRXProcess();
  668.       000384   B012....             CALL    #FaxRXProcess
  669.     343                            
  670.     344                            //Off Screen Flash Receiving
  671.     345                            gucViewDynamicStatus &= ~bitViewReceiving;
  672.       000388   D2C3....             BIC.B   #0x1, &aucViewData + 0x8
  673.     346                            ViewCommunicationTX(0x01);
  674.       00038C   5C43                 MOV.B   #0x1, R12
  675.       00038E   B012....             CALL    #ViewCommunicationTX
  676.     347                            //if receive is OK
  677.     348                                //write data to flash
  678.     349                            //FaxRawDataBuf2Flash();
  679.     350                            //gucRxTxFlag = DTERX;
  680.     351                            
  681.     352                            
  682.     353                            if (gucFrhErrorStatus!=3)
  683.       000392   F2900300....         CMP.B   #0x3, &gucFrhErrorStatus
  684.       000398   1024                 JEQ     ??main_21
  685.     354                            {
  686.     355                              FaxRxBufRawdata2PCFromSoftUart();
  687.       00039A   B012....             CALL    #FaxRxBufRawdata2PCFromSoftUart
  688.     356                              //FaxRxBufRawdata2PCFromUart();
  689.     357                              FaxRxBufRawdata2Flash();
  690.       00039E   B012....             CALL    #FaxRxBufRawdata2Flash
  691.     358                              //FaxData2PCFromSoftUart();
  692.     359                              gucViewStaticStatus |= bitViewNewFax;
  693.       0003A2   E2D2....             BIS.B   #0x4, &aucViewData + 0x7
  694.     360                              gucViewDynamicStatus |= bitViewNewFax;
  695.       0003A6   E2D2....             BIS.B   #0x4, &aucViewData + 0x8
  696.     361                              gucViewDceNewFaxNum++;
  697.       0003AA   D253....             ADD.B   #0x1, &aucViewData + 0x9
  698.     362                              ViewCommunicationTX(0x01);
  699.       0003AE   5C43                 MOV.B   #0x1, R12
  700.       0003B0   B012....             CALL    #ViewCommunicationTX
  701.     363                              ReadAndWriteViewDataMemory();
  702.       0003B4   B012....             CALL    #ReadAndWriteViewDataMemory
  703.       0003B8   2A3C                 JMP     ??main_20
  704.     364                              
  705.     365                            }//if
  706.     366                            else
  707.     367                             { 
  708.     368                               ModemResetPortDir |= bitModemHardwareReset;
  709.                         ??main_21:
  710.       0003BA   F2D040002200         BIS.B   #0x40, &0x22
  711.     369                               ModemResetCon &= ~bitModemHardwareReset;
  712.       0003C0   F2C040002100         BIC.B   #0x40, &0x21
  713.     370                               ATcmdDelay();
  714.       0003C6   B012....             CALL    #ATcmdDelay
  715.     371                               ModemResetPortDir &= ~bitModemHardwareReset;
  716.       0003CA   F2C040002200         BIC.B   #0x40, &0x22
  717.     372                               ModemResetCon |= bitModemHardwareReset;
  718.       0003D0   F2D040002100         BIS.B   #0x40, &0x21
  719.     373                               //InitUART();
  720.     374                               while (1) //add at Apr. 13, 2007 can't receive RS232 Data
  721.     375                               {
  722.     376                                SendATcmdModemSoftReset();
  723.                         ??main_6:
  724.       0003D6   B012....             CALL    #SendATcmdModemSoftReset
  725.     377                                ATcmdDelay();
  726.       0003DA   B012....             CALL    #ATcmdDelay
  727.     378                                ATcmdDelay();
  728.       0003DE   B012....             CALL    #ATcmdDelay
  729.     379                
  730.     380                                ucRxIndex1=gucUartRxCnt-3;
  731.       0003E2   7E40FD00             MOV.B   #0xfd, R14
  732.       0003E6   5E52....             ADD.B   &gucUartRxCnt, R14
  733.       0003EA   4B4E                 MOV.B   R14, R11
  734.     381                                ucRxIndex0=gucUartRxCnt-2;
  735.       0003EC   7E40FE00             MOV.B   #0xfe, R14
  736.       0003F0   5E52....             ADD.B   &gucUartRxCnt, R14
  737.       0003F4   484E                 MOV.B   R14, R8
  738.     382                                if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
  739.       0003F6   38F0FF00             AND.W   #0xff, R8
  740.       0003FA   F8900D00....         CMP.B   #0xd, aucUartRxBuf(R8)
  741.       000400   EA23                 JNE     ??main_6
  742.       000402   3BF0FF00             AND.W   #0xff, R11
  743.       000406   FB904B00....         CMP.B   #0x4b, aucUartRxBuf(R11)
  744.       00040C   E423                 JNE     ??main_6
  745.     383                                   {break;}
  746.     384                               }
  747.     385                              }//else Rx error
  748.     386                            //break; //Cant's delete it should be over this while circle //break; //delete at Mar. 16, 2007
  749.     387                          }//if fax receive end
  750.     388          
  751.     389                  //Fax receive over, reset bitModemActive for PC detect the new fax
  752.     390                  gucGeneralStatus &= ~bitModemActive;  //fax receiving over 
  753.                         ??main_20:
  754.       00040E   E2C3....             BIC.B   #0x2, &gucGeneralStatus
  755.       000412   DF3E                 JMP     ??main_7
  756.     391                }//if modem active end
  757.     392                else
  758.     393                {
  759.     394                  //receive data from SoftUart
  760.     395                  ucSoftUartRxCnt=0;
  761.                         ??main_13:
  762.       000414   4643                 MOV.B   #0x0, R6
  763.     396                  gucSoftUartRxCnt=0;
  764.       000416   C243....             MOV.B   #0x0, &gucSoftUartRxCnt
  765.     397                  //ucGeneralCnt=0;
  766.     398                  while (1)
  767.     399                  {
  768.     400                     aucSoftUartRxBuf[ucSoftUartRxCnt++]=SoftUartRxOneFrame();//receive one Byte Data
  769.                         ??main_8:
  770.       00041A   4E46                 MOV.B   R6, R14
  771.       00041C   3EF0FF00             AND.W   #0xff, R14
  772.       000420   0E12                 PUSH.W  R14
  773.       000422   B012....             CALL    #SoftUartRxOneFrame
  774.       000426   3E41                 POP.W   R14
  775.       000428   CE4C....             MOV.B   R12, aucSoftUartRxBuf(R14)
  776.       00042C   5653                 ADD.B   #0x1, R6
  777.     401                     if (ucSoftUartRxCnt>19)//17)//
  778.       00042E   76901400             CMP.B   #0x14, R6
  779.       000432   0128                 JNC     ??main_22
  780.     402                       ucSoftUartRxCnt=0;//gucSoftUartRxCnt=0; 2-2=0
  781.       000434   4643                 MOV.B   #0x0, R6
  782.     403                     if (aucSoftUartRxBuf[ucSoftUartRxCnt-1]==0x03 && aucSoftUartRxBuf[ucSoftUartRxCnt-2]==0x10)
  783.                         ??main_22:
  784.       000436   3E40....             MOV.W   #aucSoftUartRxBuf, R14
  785.       00043A   4F46                 MOV.B   R6, R15
  786.       00043C   3FF0FF00             AND.W   #0xff, R15
  787.       000440   0E5F                 ADD.W   R15, R14
  788.       000442   FE900300FFFF         CMP.B   #0x3, 0xffff(R14)
  789.       000448   0E20                 JNE     ??main_23
  790.       00044A   3E40....             MOV.W   #aucSoftUartRxBuf, R14
  791.       00044E   4F46                 MOV.B   R6, R15
  792.       000450   3FF0FF00             AND.W   #0xff, R15
  793.       000454   0E5F                 ADD.W   R15, R14
  794.       000456   FE901000FEFF         CMP.B   #0x10, 0xfffe(R14)
  795.       00045C   0420                 JNE     ??main_23
  796.     404                       {gucSoftUartRxCnt=ucSoftUartRxCnt;ucSoftUartRxCnt=0; break;}//{gucSoftUartRxCnt=0; break;} //bug of Apr. 03, 20007
  797.       00045E   C246....             MOV.B   R6, &gucSoftUartRxCnt
  798.       000462   4643                 MOV.B   #0x0, R6
  799.       000464   0F3C                 JMP     ??main_24
  800.     405                     if ((gucGeneralStatus & bitModemActive) == bitModemActive)//if modem active, over this while function
  801.                         ??main_23:
  802.       000466   E2B3....             BIT.B   #0x2, &gucGeneralStatus
  803.       00046A   0C2C                 JC      ??main_24
  804.     406                       break;
  805.     407                   if (((KEY_PORT_IN & bitKeyRingNumDec) != bitKeyRingNumDec) || 
  806.     408                  ((KEY_PORT_IN & bitKeyRingNumAdd) != bitKeyRingNumAdd) ||
  807.     409                  ((KEY_PORT_IN & bitKeyAutoMode) != bitKeyAutoMode) ||
  808.     410                  ((KEY_PORT_IN & bitKeyManualMode) != bitKeyManualMode)) //||
  809.       00046C   D2B32000             BIT.B   #0x1, &0x20
  810.       000470   0928                 JNC     ??main_24
  811.       000472   E2B32000             BIT.B   #0x2, &0x20
  812.       000476   0628                 JNC     ??main_24
  813.       000478   E2B22000             BIT.B   #0x4, &0x20
  814.       00047C   0328                 JNC     ??main_24
  815.       00047E   F2B22000             BIT.B   #0x8, &0x20
  816.       000482   CB2F                 JC      ??main_8
  817.     411                  //((KEY_PORT_IN & bitKeySendFaxSignal) != bitKeySendFaxSignal))
  818.     412                  break;
  819.     413                  }
  820.     414                
  821.     415                //Judge the received data
  822.     416                
  823.     417                //PC get Modem Bus command:ba 23 00 01 10 03
  824.     418                  if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03) && (aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
  825.     419                      (aucSoftUartRxBuf[gucSoftUartRxCnt-3]==0x01) && (aucSoftUartRxBuf[gucSoftUartRxCnt-4]==0x00)&&
  826.     420                      (aucSoftUartRxBuf[gucSoftUartRxCnt-5]==0x23) && (aucSoftUartRxBuf[gucSoftUartRxCnt-6]==0xba))
  827.                         ??main_24:
  828.       000484   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  829.       000488   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  830.       00048C   3EF0FF00             AND.W   #0xff, R14
  831.       000490   0F5E                 ADD.W   R14, R15
  832.       000492   FF900300FFFF         CMP.B   #0x3, 0xffff(R15)
  833.       000498   3A20                 JNE     ??main_25
  834.       00049A   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  835.       00049E   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  836.       0004A2   3EF0FF00             AND.W   #0xff, R14
  837.       0004A6   0F5E                 ADD.W   R14, R15
  838.       0004A8   FF901000FEFF         CMP.B   #0x10, 0xfffe(R15)
  839.       0004AE   2F20                 JNE     ??main_25
  840.       0004B0   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  841.       0004B4   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  842.       0004B8   3EF0FF00             AND.W   #0xff, R14
  843.       0004BC   0F5E                 ADD.W   R14, R15
  844.       0004BE   DF93FDFF             CMP.B   #0x1, 0xfffd(R15)
  845.       0004C2   2520                 JNE     ??main_25
  846.       0004C4   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  847.       0004C8   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  848.       0004CC   3EF0FF00             AND.W   #0xff, R14
  849.       0004D0   0F5E                 ADD.W   R14, R15
  850.       0004D2   CF93FCFF             CMP.B   #0x0, 0xfffc(R15)
  851.       0004D6   1B20                 JNE     ??main_25
  852.       0004D8   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  853.       0004DC   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  854.       0004E0   3EF0FF00             AND.W   #0xff, R14
  855.       0004E4   0F5E                 ADD.W   R14, R15
  856.       0004E6   FF902300FBFF         CMP.B   #0x23, 0xfffb(R15)
  857.       0004EC   1020                 JNE     ??main_25
  858.       0004EE   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  859.       0004F2   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  860.       0004F6   3EF0FF00             AND.W   #0xff, R14
  861.       0004FA   0F5E                 ADD.W   R14, R15
  862.       0004FC   FF90BA00FAFF         CMP.B   #0xba, 0xfffa(R15)
  863.       000502   0520                 JNE     ??main_25
  864.     421                  {
  865.     422                     DteGetModemBus();
  866.       000504   B012....             CALL    #DteGetModemBus
  867.     423                     SoftUartTxOneFrame(0xff); 
  868.       000508   7C43                 MOV.B   #0xff, R12
  869.       00050A   B012....             CALL    #SoftUartTxOneFrame
  870.     424                  }
  871.     425                
  872.     426                //PC return Modem Bus command:ba 23 00 02 10 03
  873.     427                  if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03) && (aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
  874.     428                      (aucSoftUartRxBuf[gucSoftUartRxCnt-3]==0x02) && (aucSoftUartRxBuf[gucSoftUartRxCnt-4]==0x00)&&
  875.     429                      (aucSoftUartRxBuf[gucSoftUartRxCnt-5]==0x23) && (aucSoftUartRxBuf[gucSoftUartRxCnt-6]==0xba))
  876.                         ??main_25:
  877.       00050E   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  878.       000512   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  879.       000516   3EF0FF00             AND.W   #0xff, R14
  880.       00051A   0F5E                 ADD.W   R14, R15
  881.       00051C   FF900300FFFF         CMP.B   #0x3, 0xffff(R15)
  882.       000522   3A20                 JNE     ??main_26
  883.       000524   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  884.       000528   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  885.       00052C   3EF0FF00             AND.W   #0xff, R14
  886.       000530   0F5E                 ADD.W   R14, R15
  887.       000532   FF901000FEFF         CMP.B   #0x10, 0xfffe(R15)
  888.       000538   2F20                 JNE     ??main_26
  889.       00053A   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  890.       00053E   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  891.       000542   3EF0FF00             AND.W   #0xff, R14
  892.       000546   0F5E                 ADD.W   R14, R15
  893.       000548   EF93FDFF             CMP.B   #0x2, 0xfffd(R15)
  894.       00054C   2520                 JNE     ??main_26
  895.       00054E   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  896.       000552   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  897.       000556   3EF0FF00             AND.W   #0xff, R14
  898.       00055A   0F5E                 ADD.W   R14, R15
  899.       00055C   CF93FCFF             CMP.B   #0x0, 0xfffc(R15)
  900.       000560   1B20                 JNE     ??main_26
  901.       000562   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  902.       000566   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  903.       00056A   3EF0FF00             AND.W   #0xff, R14
  904.       00056E   0F5E                 ADD.W   R14, R15
  905.       000570   FF902300FBFF         CMP.B   #0x23, 0xfffb(R15)
  906.       000576   1020                 JNE     ??main_26
  907.       000578   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  908.       00057C   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  909.       000580   3EF0FF00             AND.W   #0xff, R14
  910.       000584   0F5E                 ADD.W   R14, R15
  911.       000586   FF90BA00FAFF         CMP.B   #0xba, 0xfffa(R15)
  912.       00058C   0520                 JNE     ??main_26
  913.     430                  {
  914.     431                     DteReturnModemBus();
  915.       00058E   B012....             CALL    #DteReturnModemBus
  916.     432                     SoftUartTxOneFrame(0xff);
  917.       000592   7C43                 MOV.B   #0xff, R12
  918.       000594   B012....             CALL    #SoftUartTxOneFrame
  919.     433                  }
  920.     434                
  921.     435                //PC get Fax List command:ba 23 00 03 10 03
  922.     436                  if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
  923.     437                      (aucSoftUartRxBuf[gucSoftUartRxCnt-3]==0x03)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-4]==0x00)&&
  924.     438                      (aucSoftUartRxBuf[gucSoftUartRxCnt-5]==0x23)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-6]==0xba))
  925.                         ??main_26:
  926.       000598   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  927.       00059C   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  928.       0005A0   3EF0FF00             AND.W   #0xff, R14
  929.       0005A4   0F5E                 ADD.W   R14, R15
  930.       0005A6   FF900300FFFF         CMP.B   #0x3, 0xffff(R15)
  931.       0005AC   3820                 JNE     ??main_27
  932.       0005AE   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  933.       0005B2   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  934.       0005B6   3EF0FF00             AND.W   #0xff, R14
  935.       0005BA   0F5E                 ADD.W   R14, R15
  936.       0005BC   FF901000FEFF         CMP.B   #0x10, 0xfffe(R15)
  937.       0005C2   2D20                 JNE     ??main_27
  938.       0005C4   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  939.       0005C8   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  940.       0005CC   3EF0FF00             AND.W   #0xff, R14
  941.       0005D0   0F5E                 ADD.W   R14, R15
  942.       0005D2   FF900300FDFF         CMP.B   #0x3, 0xfffd(R15)
  943.       0005D8   2220                 JNE     ??main_27
  944.       0005DA   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  945.       0005DE   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  946.       0005E2   3EF0FF00             AND.W   #0xff, R14
  947.       0005E6   0F5E                 ADD.W   R14, R15
  948.       0005E8   CF93FCFF             CMP.B   #0x0, 0xfffc(R15)
  949.       0005EC   1820                 JNE     ??main_27
  950.       0005EE   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  951.       0005F2   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  952.       0005F6   3EF0FF00             AND.W   #0xff, R14
  953.       0005FA   0F5E                 ADD.W   R14, R15
  954.       0005FC   FF902300FBFF         CMP.B   #0x23, 0xfffb(R15)
  955.       000602   0D20                 JNE     ??main_27
  956.       000604   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  957.       000608   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  958.       00060C   3EF0FF00             AND.W   #0xff, R14
  959.       000610   0F5E                 ADD.W   R14, R15
  960.       000612   FF90BA00FAFF         CMP.B   #0xba, 0xfffa(R15)
  961.       000618   0220                 JNE     ??main_27
  962.     439                  {
  963.     440                     DteGetFaxList();
  964.       00061A   B012....             CALL    #DteGetFaxList
  965.     441                  }
  966.     442                
  967.     443                //PC get One Fax command:ba 23 00 04 HeadLow HeadHigh RearLow RearHigh 10 03
  968.     444                  if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
  969.     445                      (aucSoftUartRxBuf[gucSoftUartRxCnt-7]==0x04)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-8]==0x00)&&
  970.     446                      (aucSoftUartRxBuf[gucSoftUartRxCnt-9]==0x23)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-10]==0xba))
  971.                         ??main_27:
  972.       00061E   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  973.       000622   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  974.       000626   3EF0FF00             AND.W   #0xff, R14
  975.       00062A   0F5E                 ADD.W   R14, R15
  976.       00062C   FF900300FFFF         CMP.B   #0x3, 0xffff(R15)
  977.       000632   8F20                 JNE     ??main_28
  978.       000634   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  979.       000638   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  980.       00063C   3EF0FF00             AND.W   #0xff, R14
  981.       000640   0F5E                 ADD.W   R14, R15
  982.       000642   FF901000FEFF         CMP.B   #0x10, 0xfffe(R15)
  983.       000648   8420                 JNE     ??main_28
  984.       00064A   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  985.       00064E   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  986.       000652   3EF0FF00             AND.W   #0xff, R14
  987.       000656   0F5E                 ADD.W   R14, R15
  988.       000658   EF92F9FF             CMP.B   #0x4, 0xfff9(R15)
  989.       00065C   7A20                 JNE     ??main_28
  990.       00065E   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  991.       000662   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  992.       000666   3EF0FF00             AND.W   #0xff, R14
  993.       00066A   0F5E                 ADD.W   R14, R15
  994.       00066C   CF93F8FF             CMP.B   #0x0, 0xfff8(R15)
  995.       000670   7020                 JNE     ??main_28
  996.       000672   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  997.       000676   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  998.       00067A   3EF0FF00             AND.W   #0xff, R14
  999.       00067E   0F5E                 ADD.W   R14, R15
  1000.       000680   FF902300F7FF         CMP.B   #0x23, 0xfff7(R15)
  1001.       000686   6520                 JNE     ??main_28
  1002.       000688   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1003.       00068C   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1004.       000690   3EF0FF00             AND.W   #0xff, R14
  1005.       000694   0F5E                 ADD.W   R14, R15
  1006.       000696   FF90BA00F6FF         CMP.B   #0xba, 0xfff6(R15)
  1007.       00069C   5A20                 JNE     ??main_28
  1008.     447                  {
  1009.     448                   
  1010.     449                     if (gucFrhErrorStatus==0)
  1011.       00069E   C293....             CMP.B   #0x0, &gucFrhErrorStatus
  1012.       0006A2   5720                 JNE     ??main_28
  1013.     450                     {
  1014.     451                       ucRxIndex1=gucSoftUartRxCnt-6;//Low  Byte
  1015.       0006A4   7E40FA00             MOV.B   #0xfa, R14
  1016.       0006A8   5E52....             ADD.B   &gucSoftUartRxCnt, R14
  1017.       0006AC   4B4E                 MOV.B   R14, R11
  1018.     452                       ucRxIndex0=gucSoftUartRxCnt-5;//High Byte
  1019.       0006AE   7E40FB00             MOV.B   #0xfb, R14
  1020.       0006B2   5E52....             ADD.B   &gucSoftUartRxCnt, R14
  1021.       0006B6   484E                 MOV.B   R14, R8
  1022.     453                       wGeneralVar=aucSoftUartRxBuf[ucRxIndex0];
  1023.       0006B8   4E48                 MOV.B   R8, R14
  1024.       0006BA   3EF0FF00             AND.W   #0xff, R14
  1025.       0006BE   5E4E....             MOV.B   aucSoftUartRxBuf(R14), R14
  1026.       0006C2   3EF0FF00             AND.W   #0xff, R14
  1027.       0006C6   0A4E                 MOV.W   R14, R10
  1028.     454                       wOneFaxHead=(wGeneralVar<<8) | aucSoftUartRxBuf[ucRxIndex1];
  1029.       0006C8   0F4A                 MOV.W   R10, R15
  1030.       0006CA   3FF0FF00             AND.W   #0xff, R15
  1031.       0006CE   8F10                 SWPB    R15
  1032.       0006D0   4E4B                 MOV.B   R11, R14
  1033.       0006D2   3EF0FF00             AND.W   #0xff, R14
  1034.       0006D6   5E4E....             MOV.B   aucSoftUartRxBuf(R14), R14
  1035.       0006DA   3EF0FF00             AND.W   #0xff, R14
  1036.       0006DE   0FDE                 BIS.W   R14, R15
  1037.       0006E0   814F0200             MOV.W   R15, 0x2(SP)
  1038.     455                     
  1039.     456                       ucRxIndex1=gucSoftUartRxCnt-4;//Low  Byte
  1040.       0006E4   7E40FC00             MOV.B   #0xfc, R14
  1041.       0006E8   5E52....             ADD.B   &gucSoftUartRxCnt, R14
  1042.       0006EC   4B4E                 MOV.B   R14, R11
  1043.     457                       ucRxIndex0=gucSoftUartRxCnt-3;//High Byte
  1044.       0006EE   7E40FD00             MOV.B   #0xfd, R14
  1045.       0006F2   5E52....             ADD.B   &gucSoftUartRxCnt, R14
  1046.       0006F6   484E                 MOV.B   R14, R8
  1047.     458                       wGeneralVar=aucSoftUartRxBuf[ucRxIndex0];
  1048.       0006F8   4E48                 MOV.B   R8, R14
  1049.       0006FA   3EF0FF00             AND.W   #0xff, R14
  1050.       0006FE   5E4E....             MOV.B   aucSoftUartRxBuf(R14), R14
  1051.       000702   3EF0FF00             AND.W   #0xff, R14
  1052.       000706   0A4E                 MOV.W   R14, R10
  1053.     459                       wOneFaxRear=(wGeneralVar<<8) | aucSoftUartRxBuf[ucRxIndex1];
  1054.       000708   0F4A                 MOV.W   R10, R15
  1055.       00070A   3FF0FF00             AND.W   #0xff, R15
  1056.       00070E   8F10                 SWPB    R15
  1057.       000710   4E4B                 MOV.B   R11, R14
  1058.       000712   3EF0FF00             AND.W   #0xff, R14
  1059.       000716   5E4E....             MOV.B   aucSoftUartRxBuf(R14), R14
  1060.       00071A   3EF0FF00             AND.W   #0xff, R14
  1061.       00071E   0FDE                 BIS.W   R14, R15
  1062.       000720   814F0400             MOV.W   R15, 0x4(SP)
  1063.     460                     
  1064.     461                       DteGetOneFax(wOneFaxHead, wOneFaxRear);
  1065.       000724   1E410400             MOV.W   0x4(SP), R14
  1066.       000728   1C410200             MOV.W   0x2(SP), R12
  1067.       00072C   B012....             CALL    #DteGetOneFax
  1068.     462                       if (gucViewDceNewFaxNum>0) 
  1069.       000730   D293....             CMP.B   #0x1, &aucViewData + 0x9
  1070.       000734   0728                 JNC     ??main_29
  1071.     463                        {
  1072.     464                        gucViewDceNewFaxNum--;// for DCE check the new fax
  1073.       000736   F253....             ADD.B   #0xff, &aucViewData + 0x9
  1074.     465                          gucViewStaticStatus |= bitViewNewFax;
  1075.       00073A   E2D2....             BIS.B   #0x4, &aucViewData + 0x7
  1076.     466                          gucViewDynamicStatus |= bitViewNewFax;
  1077.       00073E   E2D2....             BIS.B   #0x4, &aucViewData + 0x8
  1078.       000742   023C                 JMP     ??main_30
  1079.     467                        }
  1080.     468                       else
  1081.     469                        {gucViewStaticStatus &= ~bitViewNewFax;}
  1082.                         ??main_29:
  1083.       000744   E2C2....             BIC.B   #0x4, &aucViewData + 0x7
  1084.     470                       
  1085.     471                       ViewCommunicationTX(0x01);
  1086.                         ??main_30:
  1087.       000748   5C43                 MOV.B   #0x1, R12
  1088.       00074A   B012....             CALL    #ViewCommunicationTX
  1089.     472                       ReadAndWriteViewDataMemory();
  1090.       00074E   B012....             CALL    #ReadAndWriteViewDataMemory
  1091.     473                     }
  1092.     474                  }
  1093.     475                  
  1094.     476                //PC delete One Fax command:ba 23 00 05 HeadLow HeadHigh RearLow RearHigh 10 03
  1095.     477                  if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
  1096.     478                      (aucSoftUartRxBuf[gucSoftUartRxCnt-7]==0x05)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-8]==0x00)&&
  1097.     479                      (aucSoftUartRxBuf[gucSoftUartRxCnt-9]==0x23)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-10]==0xba))
  1098.                         ??main_28:
  1099.       000752   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1100.       000756   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1101.       00075A   3EF0FF00             AND.W   #0xff, R14
  1102.       00075E   0F5E                 ADD.W   R14, R15
  1103.       000760   FF900300FFFF         CMP.B   #0x3, 0xffff(R15)
  1104.       000766   7720                 JNE     ??main_31
  1105.       000768   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1106.       00076C   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1107.       000770   3EF0FF00             AND.W   #0xff, R14
  1108.       000774   0F5E                 ADD.W   R14, R15
  1109.       000776   FF901000FEFF         CMP.B   #0x10, 0xfffe(R15)
  1110.       00077C   6C20                 JNE     ??main_31
  1111.       00077E   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1112.       000782   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1113.       000786   3EF0FF00             AND.W   #0xff, R14
  1114.       00078A   0F5E                 ADD.W   R14, R15
  1115.       00078C   FF900500F9FF         CMP.B   #0x5, 0xfff9(R15)
  1116.       000792   6120                 JNE     ??main_31
  1117.       000794   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1118.       000798   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1119.       00079C   3EF0FF00             AND.W   #0xff, R14
  1120.       0007A0   0F5E                 ADD.W   R14, R15
  1121.       0007A2   CF93F8FF             CMP.B   #0x0, 0xfff8(R15)
  1122.       0007A6   5720                 JNE     ??main_31
  1123.       0007A8   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1124.       0007AC   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1125.       0007B0   3EF0FF00             AND.W   #0xff, R14
  1126.       0007B4   0F5E                 ADD.W   R14, R15
  1127.       0007B6   FF902300F7FF         CMP.B   #0x23, 0xfff7(R15)
  1128.       0007BC   4C20                 JNE     ??main_31
  1129.       0007BE   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1130.       0007C2   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1131.       0007C6   3EF0FF00             AND.W   #0xff, R14
  1132.       0007CA   0F5E                 ADD.W   R14, R15
  1133.       0007CC   FF90BA00F6FF         CMP.B   #0xba, 0xfff6(R15)
  1134.       0007D2   4120                 JNE     ??main_31
  1135.     480                  {
  1136.     481                   
  1137.     482                     if (gucFrhErrorStatus==0)
  1138.       0007D4   C293....             CMP.B   #0x0, &gucFrhErrorStatus
  1139.       0007D8   3E20                 JNE     ??main_31
  1140.     483                     {
  1141.     484                       ucRxIndex1=gucSoftUartRxCnt-6;//Low  Byte
  1142.       0007DA   7E40FA00             MOV.B   #0xfa, R14
  1143.       0007DE   5E52....             ADD.B   &gucSoftUartRxCnt, R14
  1144.       0007E2   4B4E                 MOV.B   R14, R11
  1145.     485                       ucRxIndex0=gucSoftUartRxCnt-5;//High Byte
  1146.       0007E4   7E40FB00             MOV.B   #0xfb, R14
  1147.       0007E8   5E52....             ADD.B   &gucSoftUartRxCnt, R14
  1148.       0007EC   484E                 MOV.B   R14, R8
  1149.     486                       wGeneralVar=aucSoftUartRxBuf[ucRxIndex0];
  1150.       0007EE   4E48                 MOV.B   R8, R14
  1151.       0007F0   3EF0FF00             AND.W   #0xff, R14
  1152.       0007F4   5E4E....             MOV.B   aucSoftUartRxBuf(R14), R14
  1153.       0007F8   3EF0FF00             AND.W   #0xff, R14
  1154.       0007FC   0A4E                 MOV.W   R14, R10
  1155.     487                       wOneFaxHead=(wGeneralVar<<8) | aucSoftUartRxBuf[ucRxIndex1];
  1156.       0007FE   0F4A                 MOV.W   R10, R15
  1157.       000800   3FF0FF00             AND.W   #0xff, R15
  1158.       000804   8F10                 SWPB    R15
  1159.       000806   4E4B                 MOV.B   R11, R14
  1160.       000808   3EF0FF00             AND.W   #0xff, R14
  1161.       00080C   5E4E....             MOV.B   aucSoftUartRxBuf(R14), R14
  1162.       000810   3EF0FF00             AND.W   #0xff, R14
  1163.       000814   0FDE                 BIS.W   R14, R15
  1164.       000816   814F0200             MOV.W   R15, 0x2(SP)
  1165.     488                     
  1166.     489                       ucRxIndex1=gucSoftUartRxCnt-4;//Low  Byte
  1167.       00081A   7E40FC00             MOV.B   #0xfc, R14
  1168.       00081E   5E52....             ADD.B   &gucSoftUartRxCnt, R14
  1169.       000822   4B4E                 MOV.B   R14, R11
  1170.     490                       ucRxIndex0=gucSoftUartRxCnt-3;//High Byte
  1171.       000824   7E40FD00             MOV.B   #0xfd, R14
  1172.       000828   5E52....             ADD.B   &gucSoftUartRxCnt, R14
  1173.       00082C   484E                 MOV.B   R14, R8
  1174.     491                       wGeneralVar=aucSoftUartRxBuf[ucRxIndex0];
  1175.       00082E   4E48                 MOV.B   R8, R14
  1176.       000830   3EF0FF00             AND.W   #0xff, R14
  1177.       000834   5E4E....             MOV.B   aucSoftUartRxBuf(R14), R14
  1178.       000838   3EF0FF00             AND.W   #0xff, R14
  1179.       00083C   0A4E                 MOV.W   R14, R10
  1180.     492                       wOneFaxRear=(wGeneralVar<<8) | aucSoftUartRxBuf[ucRxIndex1];
  1181.       00083E   3AF0FF00             AND.W   #0xff, R10
  1182.       000842   8A10                 SWPB    R10
  1183.       000844   3BF0FF00             AND.W   #0xff, R11
  1184.       000848   5E4B....             MOV.B   aucSoftUartRxBuf(R11), R14
  1185.       00084C   3EF0FF00             AND.W   #0xff, R14
  1186.       000850   0ADE                 BIS.W   R14, R10
  1187.       000852   814A0400             MOV.W   R10, 0x4(SP)
  1188.     493                     
  1189.     494                       //DteDelOneFax(wOneFaxHead, wOneFaxRear);
  1190.     495                     }
  1191.     496                  }
  1192.     497                  
  1193.     498                //PC delete all fax command:ba 23 00 05 10 03
  1194.     499                  if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
  1195.     500                      (aucSoftUartRxBuf[gucSoftUartRxCnt-3]==0x06)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-4]==0x00)&&
  1196.     501                      (aucSoftUartRxBuf[gucSoftUartRxCnt-5]==0x23)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-6]==0xba))
  1197.     502                  {
  1198.     503                     ;//DteDelAllFax();
  1199.     504                  }
  1200.     505                
  1201.     506                //PC send the system time to Dce command:ba 23 00 0b YearLow YearHigh Month Day Hour Minute Second 10 03
  1202.     507                  if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
  1203.     508                      (aucSoftUartRxBuf[gucSoftUartRxCnt-10]==0x0b)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-11]==0x00)&&
  1204.     509                      (aucSoftUartRxBuf[gucSoftUartRxCnt-12]==0x23)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-13]==0xba))
  1205.                         ??main_31:
  1206.       000856   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1207.       00085A   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1208.       00085E   3EF0FF00             AND.W   #0xff, R14
  1209.       000862   0F5E                 ADD.W   R14, R15
  1210.       000864   FF900300FFFF         CMP.B   #0x3, 0xffff(R15)
  1211.       00086A   7420                 JNE     ??main_32
  1212.       00086C   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1213.       000870   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1214.       000874   3EF0FF00             AND.W   #0xff, R14
  1215.       000878   0F5E                 ADD.W   R14, R15
  1216.       00087A   FF901000FEFF         CMP.B   #0x10, 0xfffe(R15)
  1217.       000880   6920                 JNE     ??main_32
  1218.       000882   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1219.       000886   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1220.       00088A   3EF0FF00             AND.W   #0xff, R14
  1221.       00088E   0F5E                 ADD.W   R14, R15
  1222.       000890   FF900B00F6FF         CMP.B   #0xb, 0xfff6(R15)
  1223.       000896   5E20                 JNE     ??main_32
  1224.       000898   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1225.       00089C   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1226.       0008A0   3EF0FF00             AND.W   #0xff, R14
  1227.       0008A4   0F5E                 ADD.W   R14, R15
  1228.       0008A6   CF93F5FF             CMP.B   #0x0, 0xfff5(R15)
  1229.       0008AA   5420                 JNE     ??main_32
  1230.       0008AC   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1231.       0008B0   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1232.       0008B4   3EF0FF00             AND.W   #0xff, R14
  1233.       0008B8   0F5E                 ADD.W   R14, R15
  1234.       0008BA   FF902300F4FF         CMP.B   #0x23, 0xfff4(R15)
  1235.       0008C0   4920                 JNE     ??main_32
  1236.       0008C2   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1237.       0008C6   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1238.       0008CA   3EF0FF00             AND.W   #0xff, R14
  1239.       0008CE   0F5E                 ADD.W   R14, R15
  1240.       0008D0   FF90BA00F3FF         CMP.B   #0xba, 0xfff3(R15)
  1241.       0008D6   3E20                 JNE     ??main_32
  1242.     510                  {
  1243.     511                   
  1244.     512                     if (gucFrhErrorStatus==0)
  1245.       0008D8   C293....             CMP.B   #0x0, &gucFrhErrorStatus
  1246.       0008DC   3B20                 JNE     ??main_32
  1247.     513                     {
  1248.     514                       /*
  1249.     515                       SetSystemTime(aucSoftUartRxBuf[gucSoftUartRxCnt-9], aucSoftUartRxBuf[gucSoftUartRxCnt-8],
  1250.     516                                     aucSoftUartRxBuf[gucSoftUartRxCnt-7], aucSoftUartRxBuf[gucSoftUartRxCnt-6],
  1251.     517                                     aucSoftUartRxBuf[gucSoftUartRxCnt-5], aucSoftUartRxBuf[gucSoftUartRxCnt-4],
  1252.     518                                     aucSoftUartRxBuf[gucSoftUartRxCnt-3]);
  1253.     519                       */
  1254.     520                       ucRxIndex=gucSoftUartRxCnt-8;
  1255.       0008DE   7E40F800             MOV.B   #0xf8, R14
  1256.       0008E2   5E52....             ADD.B   &gucSoftUartRxCnt, R14
  1257.       0008E6   494E                 MOV.B   R14, R9
  1258.     521                       for (ucGeneralCnt = 0; ucGeneralCnt < 6; ucGeneralCnt++)
  1259.       0008E8   C1430600             MOV.B   #0x0, 0x6(SP)
  1260.                         ??main_9:
  1261.       0008EC   F19006000600         CMP.B   #0x6, 0x6(SP)
  1262.       0008F2   2D2C                 JC      ??main_33
  1263.     522                       {
  1264.     523                           aucViewData[cstViewSecondIndex] = aucUartRxBuf[ucRxIndex++];//second
  1265.       0008F4   4E49                 MOV.B   R9, R14
  1266.       0008F6   3EF0FF00             AND.W   #0xff, R14
  1267.       0008FA   D24E........         MOV.B   aucUartRxBuf(R14), &aucViewData + 0x2
  1268.       000900   5953                 ADD.B   #0x1, R9
  1269.     524                           aucViewData[cstViewMinuteIndex] = aucUartRxBuf[ucRxIndex++];//minute
  1270.       000902   4E49                 MOV.B   R9, R14
  1271.       000904   3EF0FF00             AND.W   #0xff, R14
  1272.       000908   D24E........         MOV.B   aucUartRxBuf(R14), &aucViewData + 0x1
  1273.       00090E   5953                 ADD.B   #0x1, R9
  1274.     525                           aucViewData[cstViewHourIndex] = aucUartRxBuf[ucRxIndex++];//hour
  1275.       000910   4E49                 MOV.B   R9, R14
  1276.       000912   3EF0FF00             AND.W   #0xff, R14
  1277.       000916   D24E........         MOV.B   aucUartRxBuf(R14), &aucViewData
  1278.       00091C   5953                 ADD.B   #0x1, R9
  1279.     526                           aucViewData[cstViewDateIndex] = aucUartRxBuf[ucRxIndex++];//date
  1280.       00091E   4E49                 MOV.B   R9, R14
  1281.       000920   3EF0FF00             AND.W   #0xff, R14
  1282.       000924   D24E........         MOV.B   aucUartRxBuf(R14), &aucViewData + 0x4
  1283.       00092A   5953                 ADD.B   #0x1, R9
  1284.     527                           aucViewData[cstViewMonthIndex] = aucUartRxBuf[ucRxIndex++];//month
  1285.       00092C   4E49                 MOV.B   R9, R14
  1286.       00092E   3EF0FF00             AND.W   #0xff, R14
  1287.       000932   D24E........         MOV.B   aucUartRxBuf(R14), &aucViewData + 0x3
  1288.       000938   5953                 ADD.B   #0x1, R9
  1289.     528                           aucViewData[cstViewYearIndex] = aucUartRxBuf[ucRxIndex++];//Year
  1290.       00093A   4E49                 MOV.B   R9, R14
  1291.       00093C   3EF0FF00             AND.W   #0xff, R14
  1292.       000940   D24E........         MOV.B   aucUartRxBuf(R14), &aucViewData + 0x5
  1293.       000946   5953                 ADD.B   #0x1, R9
  1294.     529                       }
  1295.       000948   D1530600             ADD.B   #0x1, 0x6(SP)
  1296.       00094C   CF3F                 JMP     ??main_9
  1297.     530                       ViewCommunicationTX(0x00);
  1298.                         ??main_33:
  1299.       00094E   4C43                 MOV.B   #0x0, R12
  1300.       000950   B012....             CALL    #ViewCommunicationTX
  1301.     531                     }
  1302.     532                  }
  1303.     533                    
  1304.     534                //format flash
  1305.     535                  if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
  1306.     536                      (aucSoftUartRxBuf[gucSoftUartRxCnt-3]==0x0c)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-4]==0x00)&&
  1307.     537                      (aucSoftUartRxBuf[gucSoftUartRxCnt-5]==0x23)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-6]==0xba))
  1308.                         ??main_32:
  1309.       000954   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1310.       000958   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1311.       00095C   3EF0FF00             AND.W   #0xff, R14
  1312.       000960   0F5E                 ADD.W   R14, R15
  1313.       000962   FF900300FFFF         CMP.B   #0x3, 0xffff(R15)
  1314.       000968   3820                 JNE     ??main_34
  1315.       00096A   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1316.       00096E   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1317.       000972   3EF0FF00             AND.W   #0xff, R14
  1318.       000976   0F5E                 ADD.W   R14, R15
  1319.       000978   FF901000FEFF         CMP.B   #0x10, 0xfffe(R15)
  1320.       00097E   2D20                 JNE     ??main_34
  1321.       000980   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1322.       000984   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1323.       000988   3EF0FF00             AND.W   #0xff, R14
  1324.       00098C   0F5E                 ADD.W   R14, R15
  1325.       00098E   FF900C00FDFF         CMP.B   #0xc, 0xfffd(R15)
  1326.       000994   2220                 JNE     ??main_34
  1327.       000996   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1328.       00099A   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1329.       00099E   3EF0FF00             AND.W   #0xff, R14
  1330.       0009A2   0F5E                 ADD.W   R14, R15
  1331.       0009A4   CF93FCFF             CMP.B   #0x0, 0xfffc(R15)
  1332.       0009A8   1820                 JNE     ??main_34
  1333.       0009AA   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1334.       0009AE   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1335.       0009B2   3EF0FF00             AND.W   #0xff, R14
  1336.       0009B6   0F5E                 ADD.W   R14, R15
  1337.       0009B8   FF902300FBFF         CMP.B   #0x23, 0xfffb(R15)
  1338.       0009BE   0D20                 JNE     ??main_34
  1339.       0009C0   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1340.       0009C4   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1341.       0009C8   3EF0FF00             AND.W   #0xff, R14
  1342.       0009CC   0F5E                 ADD.W   R14, R15
  1343.       0009CE   FF90BA00FAFF         CMP.B   #0xba, 0xfffa(R15)
  1344.       0009D4   0220                 JNE     ??main_34
  1345.     538                  {
  1346.     539                   FlashFormat();
  1347.       0009D6   B012....             CALL    #FlashFormat
  1348.     540                  }
  1349.     541                  
  1350.     542                //Flash bad block process
  1351.     543                  if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
  1352.     544                      (aucSoftUartRxBuf[gucSoftUartRxCnt-3]==0x0d)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-4]==0x00)&&
  1353.     545                      (aucSoftUartRxBuf[gucSoftUartRxCnt-5]==0x23)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-6]==0xba))
  1354.                         ??main_34:
  1355.       0009DA   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1356.       0009DE   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1357.       0009E2   3EF0FF00             AND.W   #0xff, R14
  1358.       0009E6   0F5E                 ADD.W   R14, R15
  1359.       0009E8   FF900300FFFF         CMP.B   #0x3, 0xffff(R15)
  1360.       0009EE   3B20                 JNE     ??main_35
  1361.       0009F0   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1362.       0009F4   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1363.       0009F8   3EF0FF00             AND.W   #0xff, R14
  1364.       0009FC   0F5E                 ADD.W   R14, R15
  1365.       0009FE   FF901000FEFF         CMP.B   #0x10, 0xfffe(R15)
  1366.       000A04   3020                 JNE     ??main_35
  1367.       000A06   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1368.       000A0A   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1369.       000A0E   3EF0FF00             AND.W   #0xff, R14
  1370.       000A12   0F5E                 ADD.W   R14, R15
  1371.       000A14   FF900D00FDFF         CMP.B   #0xd, 0xfffd(R15)
  1372.       000A1A   2520                 JNE     ??main_35
  1373.       000A1C   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1374.       000A20   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1375.       000A24   3EF0FF00             AND.W   #0xff, R14
  1376.       000A28   0F5E                 ADD.W   R14, R15
  1377.       000A2A   CF93FCFF             CMP.B   #0x0, 0xfffc(R15)
  1378.       000A2E   1B20                 JNE     ??main_35
  1379.       000A30   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1380.       000A34   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1381.       000A38   3EF0FF00             AND.W   #0xff, R14
  1382.       000A3C   0F5E                 ADD.W   R14, R15
  1383.       000A3E   FF902300FBFF         CMP.B   #0x23, 0xfffb(R15)
  1384.       000A44   1020                 JNE     ??main_35
  1385.       000A46   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1386.       000A4A   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1387.       000A4E   3EF0FF00             AND.W   #0xff, R14
  1388.       000A52   0F5E                 ADD.W   R14, R15
  1389.       000A54   FF90BA00FAFF         CMP.B   #0xba, 0xfffa(R15)
  1390.       000A5A   0520                 JNE     ??main_35
  1391.     546                  {
  1392.     547                   CheckInvalidBlock();
  1393.       000A5C   B012....             CALL    #CheckInvalidBlock
  1394.     548                   SoftUartTxOneFrame(0xff);
  1395.       000A60   7C43                 MOV.B   #0xff, R12
  1396.       000A62   B012....             CALL    #SoftUartTxOneFrame
  1397.     549                  }
  1398.     550                  
  1399.     551                //PC set CSI and DIS
  1400.     552                  if ((aucSoftUartRxBuf[gucSoftUartRxCnt-1]==0x03)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-2]==0x10)&&
  1401.     553                      (aucSoftUartRxBuf[gucSoftUartRxCnt-7]==0x0e)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-8]==0x00)&&
  1402.     554                      (aucSoftUartRxBuf[gucSoftUartRxCnt-9]==0x23)&&(aucSoftUartRxBuf[gucSoftUartRxCnt-10]==0xba))
  1403.                         ??main_35:
  1404.       000A66   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1405.       000A6A   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1406.       000A6E   3EF0FF00             AND.W   #0xff, R14
  1407.       000A72   0F5E                 ADD.W   R14, R15
  1408.       000A74   FF900300FFFF         CMP.B   #0x3, 0xffff(R15)
  1409.       000A7A   ....                 JEQ     $+6
  1410.       000A7C   3040....             BR      #??main_7
  1411.       000A80   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1412.       000A84   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1413.       000A88   3EF0FF00             AND.W   #0xff, R14
  1414.       000A8C   0F5E                 ADD.W   R14, R15
  1415.       000A8E   FF901000FEFF         CMP.B   #0x10, 0xfffe(R15)
  1416.       000A94   ....                 JEQ     $+6
  1417.       000A96   3040....             BR      #??main_7
  1418.       000A9A   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1419.       000A9E   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1420.       000AA2   3EF0FF00             AND.W   #0xff, R14
  1421.       000AA6   0F5E                 ADD.W   R14, R15
  1422.       000AA8   FF900E00F9FF         CMP.B   #0xe, 0xfff9(R15)
  1423.       000AAE   ....                 JEQ     $+6
  1424.       000AB0   3040....             BR      #??main_7
  1425.       000AB4   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1426.       000AB8   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1427.       000ABC   3EF0FF00             AND.W   #0xff, R14
  1428.       000AC0   0F5E                 ADD.W   R14, R15
  1429.       000AC2   CF93F8FF             CMP.B   #0x0, 0xfff8(R15)
  1430.       000AC6   ....                 JEQ     $+6
  1431.       000AC8   3040....             BR      #??main_7
  1432.       000ACC   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1433.       000AD0   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1434.       000AD4   3EF0FF00             AND.W   #0xff, R14
  1435.       000AD8   0F5E                 ADD.W   R14, R15
  1436.       000ADA   FF902300F7FF         CMP.B   #0x23, 0xfff7(R15)
  1437.       000AE0   ....                 JEQ     $+6
  1438.       000AE2   3040....             BR      #??main_7
  1439.       000AE6   3F40....             MOV.W   #aucSoftUartRxBuf, R15
  1440.       000AEA   5E42....             MOV.B   &gucSoftUartRxCnt, R14
  1441.       000AEE   3EF0FF00             AND.W   #0xff, R14
  1442.       000AF2   0F5E                 ADD.W   R14, R15
  1443.       000AF4   FF90BA00F6FF         CMP.B   #0xba, 0xfff6(R15)
  1444.       000AFA   ....                 JEQ     $+6
  1445.       000AFC   3040....             BR      #??main_7
  1446.     555                  {
  1447.     556                     SetCSIandDIS();
  1448.       000B00   B012....             CALL    #SetCSIandDIS
  1449.     557                     DceResponsePc();
  1450.       000B04   B012....             CALL    #DceResponsePc
  1451.       000B08   3040....             BR      #??main_7
  1452.     558                   
  1453.     559                  }
  1454.     560                /* get new fax
  1455.     561                  if ((aucUartRxBuf[gucUartRxCnt-1]==0x03)&&(aucUartRxBuf[gucUartRxCnt-2]==0x10)&&
  1456.     562                      (aucUartRxBuf[gucUartRxCnt-3]==0x01)&&(aucUartRxBuf[gucUartRxCnt-4]==0x00)&&
  1457.     563                      (aucUartRxBuf[gucUartRxCnt-5]==0x23)&&(aucUartRxBuf[gucUartRxCnt-6]==0xba))
  1458.     564                      //;
  1459.     565                  //if (gucRxTxFlag == DTERX)
  1460.     566                  {
  1461.     567                    FaxData2PCFromSoftUart();//FaxRXProcess();//FaxData2PC();   //FaxTXProcess();
  1462.     568                    gucRxTxFlag = DTETX;
  1463.     569                  }
  1464.     570                */
  1465.     571                 }//else over Modem active not active 
  1466.     572              }//while end Main circle over
  1467.     573          }//main function over
  1468.     574           
  1469.     575          /***************************************************************************
  1470.     576               
  1471.     577          ***************************************************************************/
  1472.     578          /***************************************************************************/
  1473.     579          
  1474.     580          /*
  1475.     581          #include "KeyScan.c"
  1476.     582          #include "ViewData2Flash.c"
  1477.     583          #include "LCDView.c"
  1478.     584          #include "DTEcmdProcess.c"
  1479.     585          #include "FaxRxBuf2Flash.c"   
  1480.     586          #include "IoInitial.c"
  1481.     587          #include "Uart.c"
  1482.     588          #include "SoftUart.c"
  1483.     589          #include "ParameterSet.c"
  1484.     590          #include "ATcmdSet.c"
  1485.     591          #include "Flash.c"
  1486.     592          #include "FaxPropertyTableManage.c"
  1487.     593          #include "FaxFrontPointerManage.c"
  1488.     594          #include "FaxRearPointerManage.c"
  1489.     595          #include "FlashBadBlockProcess.c"
  1490.     596          #include "FaxProcess.c"
  1491.     597          //#include "FaxData2pc.c"
  1492.     598          //#include "FaxRxBufRawdata2pc.c"
  1493.     599          #include "Delay.c"
  1494.     600          
  1495.     601          */
  1496.    Maximum stack usage in bytes:
  1497.      Function                       CSTACK
  1498.      --------                       ------
  1499.      main                              32
  1500.        -> IoInitial                    30
  1501.        -> InitUART                     30
  1502.        -> Flash_Reset                  30
  1503.        -> FLASH_READ_ID                30
  1504.        -> Delay2000ms                  30
  1505.        -> ReadLast16BytesFromFlashMemoryArea
  1506.                                        30
  1507.        -> ViewCommunicationTX          30
  1508.        -> ATcmdDelay                   30
  1509.        -> ATcmdDelay                   30
  1510.        -> SendATcmd                    30
  1511.        -> ATcmdDelay                   30
  1512.        -> ATcmdDelay                   30
  1513.        -> SendATcmdModemSoftReset      30
  1514.        -> ATcmdDelay                   30
  1515.        -> ATcmdDelay                   30
  1516.        -> ATcmdDelay                   30
  1517.        -> SendATcmd                    30
  1518.        -> ATcmdDelay                   30
  1519.        -> ATcmdDelay                   30
  1520.        -> SendATcmdModemSoftReset      30
  1521.        -> ATcmdDelay                   30
  1522.        -> ATcmdDelay                   30
  1523.        -> KeyScan                      30
  1524.        -> ViewCommunicationTX          30
  1525.        -> FaxRXProcess                 30
  1526.        -> ViewCommunicationTX          30
  1527.        -> FaxRxBufRawdata2PCFromSoftUart
  1528.                                        30
  1529.        -> FaxRxBufRawdata2Flash        30
  1530.        -> ViewCommunicationTX          30
  1531.        -> ReadAndWriteViewDataMemory
  1532.                                        30
  1533.        -> ATcmdDelay                   30
  1534.        -> SendATcmdModemSoftReset      30
  1535.        -> ATcmdDelay                   30
  1536.        -> ATcmdDelay                   30
  1537.        -> SoftUartRxOneFrame           32
  1538.        -> DteGetModemBus               30
  1539.        -> SoftUartTxOneFrame           30
  1540.        -> DteReturnModemBus            30
  1541.        -> SoftUartTxOneFrame           30
  1542.        -> DteGetFaxList                30
  1543.        -> DteGetOneFax                 30
  1544.        -> ViewCommunicationTX          30
  1545.        -> ReadAndWriteViewDataMemory
  1546.                                        30
  1547.        -> ViewCommunicationTX          30
  1548.        -> FlashFormat                  30
  1549.        -> CheckInvalidBlock            30
  1550.        -> SoftUartTxOneFrame           30
  1551.        -> SetCSIandDIS                 30
  1552.        -> DceResponsePc                30
  1553.    Segment part sizes:
  1554.      Function/Label Bytes
  1555.      -------------- -----
  1556.      WDTCTL            2
  1557.      P1IN              1
  1558.      P1OUT             1
  1559.      P1DIR             1
  1560.      P6DIR             1
  1561.      main           2828
  1562.  
  1563.  2 828 bytes in segment CODE
  1564.      6 bytes in segment DATA16_AN
  1565.  
  1566.  2 828 bytes of CODE memory
  1567.      0 bytes of DATA memory (+ 6 bytes shared)
  1568. Errors: none
  1569. Warnings: none