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

传真(Fax)编程

开发平台:

C/C++

  1. ##############################################################################
  2. #                                                                            #
  3. # IAR MSP430 C/EC++ Compiler V2.10A/W32                23/Apr/2007  18:04:08 #
  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. #                     filesFaxProcess.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. #                     filesFaxProcess.c                                     #
  24. #    List file     =  E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  25. #                     DebugListFaxProcess.lst                              #
  26. #    Object file   =  E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  27. #                     DebugObjFaxProcess.r43                               #
  28. #                                                                            #
  29. #                                                                            #
  30. ##############################################################################
  31. E:projectFaxProgramVson_Bryan_Fax_Conexant_070423filesFaxProcess.c
  32.       1          
  33.       2          
  34.       3          #include "includeH.h"
  35.                                     In segment DATA16_AN, at 0x29
  36.       unsigned char volatile __data P2OUT
  37.                         P2OUT:
  38.       000000                        DS8 1
  39.                                     In segment DATA16_AN, at 0x31
  40.       unsigned char volatile __data P5OUT
  41.                         P5OUT:
  42.       000000                        DS8 1
  43.                                     In segment DATA16_AN, at 0x32
  44.       unsigned char volatile __data P5DIR
  45.                         P5DIR:
  46.       000000                        DS8 1
  47.       4          
  48.       5          
  49.       6          //**************************************************************************
  50.                                     In segment CODE, align 2, keep-with-next
  51.       7          void  FaxRXProcess(void)
  52.                         FaxRXProcess:
  53.       8          {     
  54.       000000   0A12                 PUSH.W  R10
  55.       000002   0B12                 PUSH.W  R11
  56.       000004   0812                 PUSH.W  R8
  57.       000006   0912                 PUSH.W  R9
  58.       000008   0612                 PUSH.W  R6
  59.       00000A   0712                 PUSH.W  R7
  60.       00000C   0412                 PUSH.W  R4
  61.       00000E   0512                 PUSH.W  R5
  62.       000010   2182                 SUB.W   #0x4, SP
  63.       9                unsigned char ucFlashSttsOverflowCnt = 0;
  64.       000012   4643                 MOV.B   #0x0, R6
  65.      10                unsigned char ucGeneralCount = 0;
  66.       000014   4443                 MOV.B   #0x0, R4
  67.      11                unsigned char ucGeneralCnt = 0;
  68.       000016   4A43                 MOV.B   #0x0, R10
  69.      12                unsigned char ucRxIndex3 = 0;
  70.       000018   C1430000             MOV.B   #0x0, 0x0(SP)
  71.      13                unsigned char ucRxIndex2 = 0;
  72.       00001C   C1430100             MOV.B   #0x0, 0x1(SP)
  73.      14                unsigned char ucRxIndex1 = 0;
  74.       000020   4B43                 MOV.B   #0x0, R11
  75.      15                unsigned char ucRxIndex0 = 0;
  76.       000022   4843                 MOV.B   #0x0, R8
  77.      16                
  78.      17                unsigned int  wNextPageAddress = 0;
  79.       000024   0543                 MOV.W   #0x0, R5
  80.      18                unsigned int  wPageAddress = 0;
  81.       000026   0943                 MOV.W   #0x0, R9
  82.      19                unsigned int  wGeneralCount = 0;
  83.       000028   0743                 MOV.W   #0x0, R7
  84.      20                unsigned int  wDataRearCount = 0;
  85.       00002A   81430200             MOV.W   #0x0, 0x2(SP)
  86.      21          
  87.      22                FaxRxInit();
  88.       00002E   B012....             CALL    #FaxRxInit
  89.      23          /***************************************************************************/      
  90.      24          
  91.      25          //ATA     
  92.      26                
  93.      27                SendATcmdATA();                 //Connect
  94.       000032   B012....             CALL    #SendATcmdATA
  95.      28          
  96.      29                while (1)  //CONNECT(54) 0D 0A
  97.      30                {
  98.      31                 ucRxIndex1 = gucUartRxCnt-3;//get array index
  99.                         ??FaxRXProcess_0:
  100.       000036   7E40FD00             MOV.B   #0xfd, R14
  101.       00003A   5E52....             ADD.B   &gucUartRxCnt, R14
  102.       00003E   4B4E                 MOV.B   R14, R11
  103.      32                  ucRxIndex0 = gucUartRxCnt-2;//get array index
  104.       000040   7E40FE00             MOV.B   #0xfe, R14
  105.       000044   5E52....             ADD.B   &gucUartRxCnt, R14
  106.       000048   484E                 MOV.B   R14, R8
  107.      33                  if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1]))
  108.       00004A   38F0FF00             AND.W   #0xff, R8
  109.       00004E   F8900D00....         CMP.B   #0xd, aucUartRxBuf(R8)
  110.       000054   0620                 JNE     ??FaxRXProcess_32
  111.       000056   3BF0FF00             AND.W   #0xff, R11
  112.       00005A   FB905400....         CMP.B   #0x54, aucUartRxBuf(R11)
  113.       000060   1724                 JEQ     ??FaxRXProcess_33
  114.      34                    break;
  115.      35                  //if check time>min. 5S, Receive Fax error, program should be quit  
  116.      36                  RxFaxTimeOverflowErrorQuit();
  117.                         ??FaxRXProcess_32:
  118.       000062   1E42....             MOV.W   &gwTimeOverflowCount, R14
  119.       000066   1F43                 MOV.W   #0x1, R15
  120.       000068   0F5E                 ADD.W   R14, R15
  121.       00006A   824F....             MOV.W   R15, &gwTimeOverflowCount
  122.       00006E   3E93                 CMP.W   #0xffff, R14
  123.       000070   0420                 JNE     ??FaxRXProcess_34
  124.       000072   D253....             ADD.B   #0x1, &gucTimeOverflowCount
  125.       000076   C243....             MOV.B   #0x0, &gucFrhErrorStatus
  126.                         ??FaxRXProcess_34:
  127.       00007A   F2901400....         CMP.B   #0x14, &gucTimeOverflowCount
  128.       000080   DA23                 JNE     ??FaxRXProcess_0
  129.       000082   F2400300....         MOV.B   #0x3, &gucFrhErrorStatus
  130.       000088   C243....             MOV.B   #0x0, &gucTimeOverflowCount
  131.       00008C   8243....             MOV.W   #0x0, &gwTimeOverflowCount
  132.      37          
  133.      38                }
  134.      39                
  135.      40                Delay1500ms();  // delay 1.5S minimun 1 second
  136.                         ??FaxRXProcess_33:
  137.       000090   B012....             CALL    #Delay1500ms
  138.      41                
  139.      42                SendATdataFTHCSI();    //If the final bit is 0, the modem will generates CONNECT message.
  140.       000094   B012....             CALL    #SendATdataFTHCSI
  141.      43                while (1)  //CONNECT(54) 0D 0A
  142.      44                {
  143.      45                  ucRxIndex1 = gucUartRxCnt-3;
  144.                         ??FaxRXProcess_1:
  145.       000098   7E40FD00             MOV.B   #0xfd, R14
  146.       00009C   5E52....             ADD.B   &gucUartRxCnt, R14
  147.       0000A0   4B4E                 MOV.B   R14, R11
  148.      46                  ucRxIndex0 = gucUartRxCnt-2;
  149.       0000A2   7E40FE00             MOV.B   #0xfe, R14
  150.       0000A6   5E52....             ADD.B   &gucUartRxCnt, R14
  151.       0000AA   484E                 MOV.B   R14, R8
  152.      47                  if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1]))
  153.       0000AC   38F0FF00             AND.W   #0xff, R8
  154.       0000B0   F8900D00....         CMP.B   #0xd, aucUartRxBuf(R8)
  155.       0000B6   0620                 JNE     ??FaxRXProcess_35
  156.       0000B8   3BF0FF00             AND.W   #0xff, R11
  157.       0000BC   FB905400....         CMP.B   #0x54, aucUartRxBuf(R11)
  158.       0000C2   1724                 JEQ     ??FaxRXProcess_36
  159.      48                    break;
  160.      49                  //if check time>min. 5S, Receive Fax error, progra should be quit  
  161.      50                  RxFaxTimeOverflowErrorQuit();
  162.                         ??FaxRXProcess_35:
  163.       0000C4   1E42....             MOV.W   &gwTimeOverflowCount, R14
  164.       0000C8   1F43                 MOV.W   #0x1, R15
  165.       0000CA   0F5E                 ADD.W   R14, R15
  166.       0000CC   824F....             MOV.W   R15, &gwTimeOverflowCount
  167.       0000D0   3E93                 CMP.W   #0xffff, R14
  168.       0000D2   0420                 JNE     ??FaxRXProcess_37
  169.       0000D4   D253....             ADD.B   #0x1, &gucTimeOverflowCount
  170.       0000D8   C243....             MOV.B   #0x0, &gucFrhErrorStatus
  171.                         ??FaxRXProcess_37:
  172.       0000DC   F2901400....         CMP.B   #0x14, &gucTimeOverflowCount
  173.       0000E2   DA23                 JNE     ??FaxRXProcess_1
  174.       0000E4   F2400300....         MOV.B   #0x3, &gucFrhErrorStatus
  175.       0000EA   C243....             MOV.B   #0x0, &gucTimeOverflowCount
  176.       0000EE   8243....             MOV.W   #0x0, &gwTimeOverflowCount
  177.      51                }
  178.      52                
  179.      53                for (ucGeneralCount = 0; ucGeneralCount < 50; ucGeneralCount++)// delay 1.5S minimun 1 second
  180.                         ??FaxRXProcess_36:
  181.       0000F2   4443                 MOV.B   #0x0, R4
  182.                         ??FaxRXProcess_2:
  183.       0000F4   74903200             CMP.B   #0x32, R4
  184.       0000F8   042C                 JC      ??FaxRXProcess_38
  185.      54                {
  186.      55                   ATcmdDelay();  //50ms
  187.       0000FA   B012....             CALL    #ATcmdDelay
  188.      56                }
  189.       0000FE   5453                 ADD.B   #0x1, R4
  190.       000100   F93F                 JMP     ??FaxRXProcess_2
  191.      57          
  192.      58                SendATdataFTHDIS();//SendATdataFTHTSI(sizeof (FTHDIS)); a bug of Sep.18
  193.                         ??FaxRXProcess_38:
  194.       000102   B012....             CALL    #SendATdataFTHDIS
  195.      59                
  196.      60                while (1)    //O K 0D 0A
  197.      61                {
  198.      62                  ucRxIndex1 = gucUartRxCnt-3;
  199.                         ??FaxRXProcess_3:
  200.       000106   7E40FD00             MOV.B   #0xfd, R14
  201.       00010A   5E52....             ADD.B   &gucUartRxCnt, R14
  202.       00010E   4B4E                 MOV.B   R14, R11
  203.      63                  ucRxIndex0 = gucUartRxCnt-2;
  204.       000110   7E40FE00             MOV.B   #0xfe, R14
  205.       000114   5E52....             ADD.B   &gucUartRxCnt, R14
  206.       000118   484E                 MOV.B   R14, R8
  207.      64                  if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x4B == aucUartRxBuf[ucRxIndex1])) //K ==0x4b
  208.       00011A   38F0FF00             AND.W   #0xff, R8
  209.       00011E   F8900D00....         CMP.B   #0xd, aucUartRxBuf(R8)
  210.       000124   0620                 JNE     ??FaxRXProcess_39
  211.       000126   3BF0FF00             AND.W   #0xff, R11
  212.       00012A   FB904B00....         CMP.B   #0x4b, aucUartRxBuf(R11)
  213.       000130   1724                 JEQ     ??FaxRXProcess_40
  214.      65                    break;
  215.      66                  //if check time>min. 5S, Receive Fax error, progra should be quit  
  216.      67                  RxFaxTimeOverflowErrorQuit();
  217.                         ??FaxRXProcess_39:
  218.       000132   1E42....             MOV.W   &gwTimeOverflowCount, R14
  219.       000136   1F43                 MOV.W   #0x1, R15
  220.       000138   0F5E                 ADD.W   R14, R15
  221.       00013A   824F....             MOV.W   R15, &gwTimeOverflowCount
  222.       00013E   3E93                 CMP.W   #0xffff, R14
  223.       000140   0420                 JNE     ??FaxRXProcess_41
  224.       000142   D253....             ADD.B   #0x1, &gucTimeOverflowCount
  225.       000146   C243....             MOV.B   #0x0, &gucFrhErrorStatus
  226.                         ??FaxRXProcess_41:
  227.       00014A   F2901400....         CMP.B   #0x14, &gucTimeOverflowCount
  228.       000150   DA23                 JNE     ??FaxRXProcess_3
  229.       000152   F2400300....         MOV.B   #0x3, &gucFrhErrorStatus
  230.       000158   C243....             MOV.B   #0x0, &gucTimeOverflowCount
  231.       00015C   8243....             MOV.W   #0x0, &gwTimeOverflowCount
  232.      68                }
  233.      69                    
  234.      70          //*
  235.      71          //FRH  TSI (transmitting subscriber identification)        
  236.      72                SendATcmdFRH();  
  237.                         ??FaxRXProcess_40:
  238.       000160   B012....             CALL    #SendATcmdFRH
  239.      73                while (1)    //Connect data.....OK 0D 0A
  240.      74                {
  241.      75                  ucRxIndex1 = gucUartRxCnt-3;
  242.                         ??FaxRXProcess_4:
  243.       000164   7E40FD00             MOV.B   #0xfd, R14
  244.       000168   5E52....             ADD.B   &gucUartRxCnt, R14
  245.       00016C   4B4E                 MOV.B   R14, R11
  246.      76                  ucRxIndex0 = gucUartRxCnt-2;
  247.       00016E   7E40FE00             MOV.B   #0xfe, R14
  248.       000172   5E52....             ADD.B   &gucUartRxCnt, R14
  249.       000176   484E                 MOV.B   R14, R8
  250.      77                  if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1])) //Connect
  251.       000178   4E48                 MOV.B   R8, R14
  252.       00017A   3EF0FF00             AND.W   #0xff, R14
  253.       00017E   FE900D00....         CMP.B   #0xd, aucUartRxBuf(R14)
  254.       000184   0720                 JNE     ??FaxRXProcess_42
  255.       000186   4E4B                 MOV.B   R11, R14
  256.       000188   3EF0FF00             AND.W   #0xff, R14
  257.       00018C   FE905400....         CMP.B   #0x54, aucUartRxBuf(R14)
  258.       000192   2524                 JEQ     ??FaxRXProcess_43
  259.      78                    break;
  260.      79                  if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x52 == aucUartRxBuf[ucRxIndex1])) //No Carrier
  261.                         ??FaxRXProcess_42:
  262.       000194   4E48                 MOV.B   R8, R14
  263.       000196   3EF0FF00             AND.W   #0xff, R14
  264.       00019A   FE900D00....         CMP.B   #0xd, aucUartRxBuf(R14)
  265.       0001A0   0720                 JNE     ??FaxRXProcess_44
  266.       0001A2   4E4B                 MOV.B   R11, R14
  267.       0001A4   3EF0FF00             AND.W   #0xff, R14
  268.       0001A8   FE905200....         CMP.B   #0x52, aucUartRxBuf(R14)
  269.       0001AE   1724                 JEQ     ??FaxRXProcess_43
  270.      80                    break;
  271.      81                  //if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4b==aucUartRxBuf[ucRxIndex1]))
  272.      82                    //{ucFrhErrorStatus=0x03;break;}
  273.      83                  //if check time>min. 5S, Receive Fax error, progra should be quit  
  274.      84                  RxFaxTimeOverflowErrorQuit();
  275.                         ??FaxRXProcess_44:
  276.       0001B0   1E42....             MOV.W   &gwTimeOverflowCount, R14
  277.       0001B4   1F43                 MOV.W   #0x1, R15
  278.       0001B6   0F5E                 ADD.W   R14, R15
  279.       0001B8   824F....             MOV.W   R15, &gwTimeOverflowCount
  280.       0001BC   3E93                 CMP.W   #0xffff, R14
  281.       0001BE   0420                 JNE     ??FaxRXProcess_45
  282.       0001C0   D253....             ADD.B   #0x1, &gucTimeOverflowCount
  283.       0001C4   C243....             MOV.B   #0x0, &gucFrhErrorStatus
  284.                         ??FaxRXProcess_45:
  285.       0001C8   F2901400....         CMP.B   #0x14, &gucTimeOverflowCount
  286.       0001CE   CA23                 JNE     ??FaxRXProcess_4
  287.       0001D0   F2400300....         MOV.B   #0x3, &gucFrhErrorStatus
  288.       0001D6   C243....             MOV.B   #0x0, &gucTimeOverflowCount
  289.       0001DA   8243....             MOV.W   #0x0, &gwTimeOverflowCount
  290.      85                }//while
  291.      86                
  292.      87                for (ucGeneralCnt = 0;ucGeneralCnt < 5;ucGeneralCnt++)
  293.                         ??FaxRXProcess_43:
  294.       0001DE   4A43                 MOV.B   #0x0, R10
  295.                         ??FaxRXProcess_7:
  296.       0001E0   7A900500             CMP.B   #0x5, R10
  297.       0001E4   D32C                 JC      ??FaxRXProcess_46
  298.      88                {
  299.      89                  if (gucFrhErrorStatus == 0x03 || (0x0d == aucUartRxBuf[ucRxIndex0]) && (0x52 == aucUartRxBuf[ucRxIndex1]))
  300.       0001E6   F2900300....         CMP.B   #0x3, &gucFrhErrorStatus
  301.       0001EC   0E24                 JEQ     ??FaxRXProcess_47
  302.       0001EE   4E48                 MOV.B   R8, R14
  303.       0001F0   3EF0FF00             AND.W   #0xff, R14
  304.       0001F4   FE900D00....         CMP.B   #0xd, aucUartRxBuf(R14)
  305.       0001FA   5E20                 JNE     ??FaxRXProcess_48
  306.       0001FC   4E4B                 MOV.B   R11, R14
  307.       0001FE   3EF0FF00             AND.W   #0xff, R14
  308.       000202   FE905200....         CMP.B   #0x52, aucUartRxBuf(R14)
  309.       000208   5720                 JNE     ??FaxRXProcess_48
  310.      90                  {
  311.      91                   SendATcmdSuffix();
  312.                         ??FaxRXProcess_47:
  313.       00020A   B012....             CALL    #SendATcmdSuffix
  314.      92                   ATcmdDelay();
  315.       00020E   B012....             CALL    #ATcmdDelay
  316.      93                   ATcmdDelay();
  317.       000212   B012....             CALL    #ATcmdDelay
  318.      94                   ATcmdDelay();
  319.       000216   B012....             CALL    #ATcmdDelay
  320.      95                   SendATcmdPrefix();
  321.       00021A   B012....             CALL    #SendATcmdPrefix
  322.      96                   ATcmdDelay();
  323.       00021E   B012....             CALL    #ATcmdDelay
  324.      97                   SendATcmdSuffix();
  325.       000222   B012....             CALL    #SendATcmdSuffix
  326.      98                   ATcmdDelay();
  327.       000226   B012....             CALL    #ATcmdDelay
  328.      99                   ATcmdDelay();
  329.       00022A   B012....             CALL    #ATcmdDelay
  330.     100                   ATcmdDelay();
  331.       00022E   B012....             CALL    #ATcmdDelay
  332.     101                   Delay2000ms();//add at Jan. 16, 2007
  333.       000232   B012....             CALL    #Delay2000ms
  334.     102                   FthCsiDis();
  335.       000236   B012....             CALL    #FthCsiDis
  336.     103                   SendATcmdFRH();  
  337.       00023A   B012....             CALL    #SendATcmdFRH
  338.     104                   while (1)    //Connect data.....OK 0D 0A
  339.     105                   {
  340.     106                    ucRxIndex1 = gucUartRxCnt-3;
  341.                         ??FaxRXProcess_5:
  342.       00023E   7E40FD00             MOV.B   #0xfd, R14
  343.       000242   5E52....             ADD.B   &gucUartRxCnt, R14
  344.       000246   4B4E                 MOV.B   R14, R11
  345.     107                    ucRxIndex0 = gucUartRxCnt-2;
  346.       000248   7E40FE00             MOV.B   #0xfe, R14
  347.       00024C   5E52....             ADD.B   &gucUartRxCnt, R14
  348.       000250   484E                 MOV.B   R14, R8
  349.     108                    if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1]))
  350.       000252   4E48                 MOV.B   R8, R14
  351.       000254   3EF0FF00             AND.W   #0xff, R14
  352.       000258   FE900D00....         CMP.B   #0xd, aucUartRxBuf(R14)
  353.       00025E   0720                 JNE     ??FaxRXProcess_49
  354.       000260   4E4B                 MOV.B   R11, R14
  355.       000262   3EF0FF00             AND.W   #0xff, R14
  356.       000266   FE905400....         CMP.B   #0x54, aucUartRxBuf(R14)
  357.       00026C   2524                 JEQ     ??FaxRXProcess_48
  358.     109                      break;
  359.     110                    if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x52 == aucUartRxBuf[ucRxIndex1]))
  360.                         ??FaxRXProcess_49:
  361.       00026E   4E48                 MOV.B   R8, R14
  362.       000270   3EF0FF00             AND.W   #0xff, R14
  363.       000274   FE900D00....         CMP.B   #0xd, aucUartRxBuf(R14)
  364.       00027A   0720                 JNE     ??FaxRXProcess_50
  365.       00027C   4E4B                 MOV.B   R11, R14
  366.       00027E   3EF0FF00             AND.W   #0xff, R14
  367.       000282   FE905200....         CMP.B   #0x52, aucUartRxBuf(R14)
  368.       000288   1724                 JEQ     ??FaxRXProcess_48
  369.     111                      break;
  370.     112                    //if check time>min. 5S, Receive Fax error, progra should be quit  
  371.     113                    RxFaxTimeOverflowErrorQuit();
  372.                         ??FaxRXProcess_50:
  373.       00028A   1E42....             MOV.W   &gwTimeOverflowCount, R14
  374.       00028E   1F43                 MOV.W   #0x1, R15
  375.       000290   0F5E                 ADD.W   R14, R15
  376.       000292   824F....             MOV.W   R15, &gwTimeOverflowCount
  377.       000296   3E93                 CMP.W   #0xffff, R14
  378.       000298   0420                 JNE     ??FaxRXProcess_51
  379.       00029A   D253....             ADD.B   #0x1, &gucTimeOverflowCount
  380.       00029E   C243....             MOV.B   #0x0, &gucFrhErrorStatus
  381.                         ??FaxRXProcess_51:
  382.       0002A2   F2901400....         CMP.B   #0x14, &gucTimeOverflowCount
  383.       0002A8   CA23                 JNE     ??FaxRXProcess_5
  384.       0002AA   F2400300....         MOV.B   #0x3, &gucFrhErrorStatus
  385.       0002B0   C243....             MOV.B   #0x0, &gucTimeOverflowCount
  386.       0002B4   8243....             MOV.W   #0x0, &gwTimeOverflowCount
  387.     114                   }//while
  388.     115                  }//if
  389.     116                  if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1]))
  390.                         ??FaxRXProcess_48:
  391.       0002B8   4E48                 MOV.B   R8, R14
  392.       0002BA   3EF0FF00             AND.W   #0xff, R14
  393.       0002BE   FE900D00....         CMP.B   #0xd, aucUartRxBuf(R14)
  394.       0002C4   6120                 JNE     ??FaxRXProcess_52
  395.       0002C6   4E4B                 MOV.B   R11, R14
  396.       0002C8   3EF0FF00             AND.W   #0xff, R14
  397.       0002CC   FE905400....         CMP.B   #0x54, aucUartRxBuf(R14)
  398.       0002D2   5A20                 JNE     ??FaxRXProcess_52
  399.     117                  {
  400.     118                    while (1)    
  401.     119                    {
  402.     120                     ucRxIndex1 = gucUartRxCnt-3;
  403.                         ??FaxRXProcess_6:
  404.       0002D4   7E40FD00             MOV.B   #0xfd, R14
  405.       0002D8   5E52....             ADD.B   &gucUartRxCnt, R14
  406.       0002DC   4B4E                 MOV.B   R14, R11
  407.     121                      ucRxIndex0 = gucUartRxCnt-2;
  408.       0002DE   7E40FE00             MOV.B   #0xfe, R14
  409.       0002E2   5E52....             ADD.B   &gucUartRxCnt, R14
  410.       0002E6   484E                 MOV.B   R14, R8
  411.     122                      if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x4B == aucUartRxBuf[ucRxIndex1]))
  412.       0002E8   4E48                 MOV.B   R8, R14
  413.       0002EA   3EF0FF00             AND.W   #0xff, R14
  414.       0002EE   FE900D00....         CMP.B   #0xd, aucUartRxBuf(R14)
  415.       0002F4   0720                 JNE     ??FaxRXProcess_53
  416.       0002F6   4E4B                 MOV.B   R11, R14
  417.       0002F8   3EF0FF00             AND.W   #0xff, R14
  418.       0002FC   FE904B00....         CMP.B   #0x4b, aucUartRxBuf(R14)
  419.       000302   3424                 JEQ     ??FaxRXProcess_54
  420.     123                        break;
  421.     124                      if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x52 == aucUartRxBuf[ucRxIndex1]))
  422.                         ??FaxRXProcess_53:
  423.       000304   4E48                 MOV.B   R8, R14
  424.       000306   3EF0FF00             AND.W   #0xff, R14
  425.       00030A   FE900D00....         CMP.B   #0xd, aucUartRxBuf(R14)
  426.       000310   0720                 JNE     ??FaxRXProcess_55
  427.       000312   4E4B                 MOV.B   R11, R14
  428.       000314   3EF0FF00             AND.W   #0xff, R14
  429.       000318   FE905200....         CMP.B   #0x52, aucUartRxBuf(R14)
  430.       00031E   2624                 JEQ     ??FaxRXProcess_54
  431.     125                        break;
  432.     126                      if ((0x13 == aucUartRxBuf[ucRxIndex0]) && (0xff == aucUartRxBuf[ucRxIndex1]))
  433.                         ??FaxRXProcess_55:
  434.       000320   4E48                 MOV.B   R8, R14
  435.       000322   3EF0FF00             AND.W   #0xff, R14
  436.       000326   FE901300....         CMP.B   #0x13, aucUartRxBuf(R14)
  437.       00032C   0820                 JNE     ??FaxRXProcess_56
  438.       00032E   4E4B                 MOV.B   R11, R14
  439.       000330   3EF0FF00             AND.W   #0xff, R14
  440.       000334   FE93....             CMP.B   #0xff, aucUartRxBuf(R14)
  441.       000338   0220                 JNE     ??FaxRXProcess_56
  442.     127                        {gucFrhErrorStatus=CNGFthOnlySendOneNSF;}
  443.       00033A   D243....             MOV.B   #0x1, &gucFrhErrorStatus
  444.     128                      //if check time>min. 5S, Receive Fax error, progra should be quit  
  445.     129                      RxFaxTimeOverflowErrorQuit();
  446.                         ??FaxRXProcess_56:
  447.       00033E   1E42....             MOV.W   &gwTimeOverflowCount, R14
  448.       000342   1F43                 MOV.W   #0x1, R15
  449.       000344   0F5E                 ADD.W   R14, R15
  450.       000346   824F....             MOV.W   R15, &gwTimeOverflowCount
  451.       00034A   3E93                 CMP.W   #0xffff, R14
  452.       00034C   0420                 JNE     ??FaxRXProcess_57
  453.       00034E   D253....             ADD.B   #0x1, &gucTimeOverflowCount
  454.       000352   C243....             MOV.B   #0x0, &gucFrhErrorStatus
  455.                         ??FaxRXProcess_57:
  456.       000356   F2901400....         CMP.B   #0x14, &gucTimeOverflowCount
  457.       00035C   BB23                 JNE     ??FaxRXProcess_6
  458.       00035E   F2400300....         MOV.B   #0x3, &gucFrhErrorStatus
  459.       000364   C243....             MOV.B   #0x0, &gucTimeOverflowCount
  460.       000368   8243....             MOV.W   #0x0, &gwTimeOverflowCount
  461.     130                    }//while
  462.     131                    if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x52 == aucUartRxBuf[ucRxIndex1]))
  463.                         ??FaxRXProcess_54:
  464.       00036C   4E48                 MOV.B   R8, R14
  465.       00036E   3EF0FF00             AND.W   #0xff, R14
  466.       000372   FE900D00....         CMP.B   #0xd, aucUartRxBuf(R14)
  467.       000378   0920                 JNE     ??FaxRXProcess_46
  468.       00037A   4E4B                 MOV.B   R11, R14
  469.       00037C   3EF0FF00             AND.W   #0xff, R14
  470.       000380   FE905200....         CMP.B   #0x52, aucUartRxBuf(R14)
  471.       000386   0220                 JNE     ??FaxRXProcess_46
  472.     132                        continue;//Response is not OK, but NO Carrier. should Re FTH CSI and DIS
  473.     133                    else
  474.     134                        break;//break for cycle
  475.     135                  }//if
  476.     136                }//for
  477.                         ??FaxRXProcess_52:
  478.       000388   5A53                 ADD.B   #0x1, R10
  479.       00038A   2A3F                 JMP     ??FaxRXProcess_7
  480.     137                ucRxIndex0 = gucUartRxCnt-25;
  481.                         ??FaxRXProcess_46:
  482.       00038C   7E40E700             MOV.B   #0xe7, R14
  483.       000390   5E52....             ADD.B   &gucUartRxCnt, R14
  484.       000394   484E                 MOV.B   R14, R8
  485.     138                for (ucGeneralCnt = 0;ucGeneralCnt < 25;ucGeneralCnt++)
  486.       000396   4A43                 MOV.B   #0x0, R10
  487.                         ??FaxRXProcess_8:
  488.       000398   7A901900             CMP.B   #0x19, R10
  489.       00039C   0D2C                 JC      ??FaxRXProcess_58
  490.     139                {FRHTSI[ucRxIndex1++] = aucUartRxBuf[ucRxIndex0++];}
  491.       00039E   4F4B                 MOV.B   R11, R15
  492.       0003A0   3FF0FF00             AND.W   #0xff, R15
  493.       0003A4   4E48                 MOV.B   R8, R14
  494.       0003A6   3EF0FF00             AND.W   #0xff, R14
  495.       0003AA   DF4E........         MOV.B   aucUartRxBuf(R14), FRHTSI(R15)
  496.       0003B0   5853                 ADD.B   #0x1, R8
  497.       0003B2   5B53                 ADD.B   #0x1, R11
  498.       0003B4   5A53                 ADD.B   #0x1, R10
  499.       0003B6   F03F                 JMP     ??FaxRXProcess_8
  500.     140                
  501.     141          //FRH DCS (digital command signal)
  502.     142                if (gucFrhErrorStatus != CNGFthOnlySendOneNSF)
  503.                         ??FaxRXProcess_58:
  504.       0003B8   D293....             CMP.B   #0x1, &gucFrhErrorStatus
  505.       0003BC   6824                 JEQ     ??FaxRXProcess_59
  506.     143                {          
  507.     144                  SendATcmdFRH(); 
  508.       0003BE   B012....             CALL    #SendATcmdFRH
  509.     145                  while (1)    
  510.     146                  {
  511.     147                   ucRxIndex1 = gucUartRxCnt-3;
  512.                         ??FaxRXProcess_9:
  513.       0003C2   7E40FD00             MOV.B   #0xfd, R14
  514.       0003C6   5E52....             ADD.B   &gucUartRxCnt, R14
  515.       0003CA   4B4E                 MOV.B   R14, R11
  516.     148                    ucRxIndex0 = gucUartRxCnt-2;
  517.       0003CC   7E40FE00             MOV.B   #0xfe, R14
  518.       0003D0   5E52....             ADD.B   &gucUartRxCnt, R14
  519.       0003D4   484E                 MOV.B   R14, R8
  520.     149                    if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1]))
  521.       0003D6   38F0FF00             AND.W   #0xff, R8
  522.       0003DA   F8900D00....         CMP.B   #0xd, aucUartRxBuf(R8)
  523.       0003E0   0620                 JNE     ??FaxRXProcess_60
  524.       0003E2   3BF0FF00             AND.W   #0xff, R11
  525.       0003E6   FB905400....         CMP.B   #0x54, aucUartRxBuf(R11)
  526.       0003EC   1724                 JEQ     ??FaxRXProcess_61
  527.     150                      break;
  528.     151                    //if check time>min. 5S, Receive Fax error, progra should be quit  
  529.     152                    RxFaxTimeOverflowErrorQuit();
  530.                         ??FaxRXProcess_60:
  531.       0003EE   1E42....             MOV.W   &gwTimeOverflowCount, R14
  532.       0003F2   1F43                 MOV.W   #0x1, R15
  533.       0003F4   0F5E                 ADD.W   R14, R15
  534.       0003F6   824F....             MOV.W   R15, &gwTimeOverflowCount
  535.       0003FA   3E93                 CMP.W   #0xffff, R14
  536.       0003FC   0420                 JNE     ??FaxRXProcess_62
  537.       0003FE   D253....             ADD.B   #0x1, &gucTimeOverflowCount
  538.       000402   C243....             MOV.B   #0x0, &gucFrhErrorStatus
  539.                         ??FaxRXProcess_62:
  540.       000406   F2901400....         CMP.B   #0x14, &gucTimeOverflowCount
  541.       00040C   DA23                 JNE     ??FaxRXProcess_9
  542.       00040E   F2400300....         MOV.B   #0x3, &gucFrhErrorStatus
  543.       000414   C243....             MOV.B   #0x0, &gucTimeOverflowCount
  544.       000418   8243....             MOV.W   #0x0, &gwTimeOverflowCount
  545.     153                  }//while
  546.     154                  if (gucFrhErrorStatus == 0x03) return; //add at Mar. 16, 2007.
  547.                         ??FaxRXProcess_61:
  548.       00041C   F2900300....         CMP.B   #0x3, &gucFrhErrorStatus
  549.       000422   ....                 JNE     $+6
  550.       000424   3040....             BR      #??FaxRXProcess_63
  551.     155                
  552.     156                  while (1)    
  553.     157                  {
  554.     158                   ucRxIndex1 = gucUartRxCnt-3;
  555.                         ??FaxRXProcess_10:
  556.       000428   7E40FD00             MOV.B   #0xfd, R14
  557.       00042C   5E52....             ADD.B   &gucUartRxCnt, R14
  558.       000430   4B4E                 MOV.B   R14, R11
  559.     159                    ucRxIndex0 = gucUartRxCnt-2;
  560.       000432   7E40FE00             MOV.B   #0xfe, R14
  561.       000436   5E52....             ADD.B   &gucUartRxCnt, R14
  562.       00043A   484E                 MOV.B   R14, R8
  563.     160                    if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x4B == aucUartRxBuf[ucRxIndex1]))
  564.       00043C   38F0FF00             AND.W   #0xff, R8
  565.       000440   F8900D00....         CMP.B   #0xd, aucUartRxBuf(R8)
  566.       000446   0620                 JNE     ??FaxRXProcess_64
  567.       000448   3BF0FF00             AND.W   #0xff, R11
  568.       00044C   FB904B00....         CMP.B   #0x4b, aucUartRxBuf(R11)
  569.       000452   1724                 JEQ     ??FaxRXProcess_65
  570.     161                      break;
  571.     162                    //if check time>min. 5S, Receive Fax error, progra should be quit  
  572.     163                    RxFaxTimeOverflowErrorQuit();
  573.                         ??FaxRXProcess_64:
  574.       000454   1E42....             MOV.W   &gwTimeOverflowCount, R14
  575.       000458   1F43                 MOV.W   #0x1, R15
  576.       00045A   0F5E                 ADD.W   R14, R15
  577.       00045C   824F....             MOV.W   R15, &gwTimeOverflowCount
  578.       000460   3E93                 CMP.W   #0xffff, R14
  579.       000462   0420                 JNE     ??FaxRXProcess_66
  580.       000464   D253....             ADD.B   #0x1, &gucTimeOverflowCount
  581.       000468   C243....             MOV.B   #0x0, &gucFrhErrorStatus
  582.                         ??FaxRXProcess_66:
  583.       00046C   F2901400....         CMP.B   #0x14, &gucTimeOverflowCount
  584.       000472   DA23                 JNE     ??FaxRXProcess_10
  585.       000474   F2400300....         MOV.B   #0x3, &gucFrhErrorStatus
  586.       00047A   C243....             MOV.B   #0x0, &gucTimeOverflowCount
  587.       00047E   8243....             MOV.W   #0x0, &gwTimeOverflowCount
  588.     164                  }//while 
  589.     165                  if (gucFrhErrorStatus == 0x03) return; //add at Mar. 16, 2007.     
  590.                         ??FaxRXProcess_65:
  591.       000482   F2900300....         CMP.B   #0x3, &gucFrhErrorStatus
  592.       000488   ....                 JNE     $+6
  593.       00048A   3040....             BR      #??FaxRXProcess_63
  594.     166                }//if
  595.     167                
  596.     168                //if (ucFrhErrorStatus==03) return; //add at Mar. 16, 2007.
  597.     169          //*/
  598.     170          
  599.     171          
  600.     172          
  601.     173          //FRM TCF (training check)
  602.     174                SendATcmdFRM();
  603.                         ??FaxRXProcess_59:
  604.       00048E   B012....             CALL    #SendATcmdFRM
  605.     175          
  606.     176                while (1)    
  607.     177                {
  608.     178                 ucRxIndex1 = gucUartRxCnt-3;
  609.                         ??FaxRXProcess_11:
  610.       000492   7E40FD00             MOV.B   #0xfd, R14
  611.       000496   5E52....             ADD.B   &gucUartRxCnt, R14
  612.       00049A   4B4E                 MOV.B   R14, R11
  613.     179                  ucRxIndex0 = gucUartRxCnt-2;
  614.       00049C   7E40FE00             MOV.B   #0xfe, R14
  615.       0004A0   5E52....             ADD.B   &gucUartRxCnt, R14
  616.       0004A4   484E                 MOV.B   R14, R8
  617.     180                  if ((0x0d == aucUartRxBuf[ucRxIndex0]) && (0x54 == aucUartRxBuf[ucRxIndex1]))
  618.       0004A6   38F0FF00             AND.W   #0xff, R8
  619.       0004AA   F8900D00....         CMP.B   #0xd, aucUartRxBuf(R8)
  620.       0004B0   0620                 JNE     ??FaxRXProcess_67
  621.       0004B2   3BF0FF00             AND.W   #0xff, R11
  622.       0004B6   FB905400....         CMP.B   #0x54, aucUartRxBuf(R11)
  623.       0004BC   1724                 JEQ     ??FaxRXProcess_68
  624.     181                    break;
  625.     182                  //if check time>min. 5S, Receive Fax error, progra should be quit  
  626.     183                  RxFaxTimeOverflowErrorQuit();
  627.                         ??FaxRXProcess_67:
  628.       0004BE   1E42....             MOV.W   &gwTimeOverflowCount, R14
  629.       0004C2   1F43                 MOV.W   #0x1, R15
  630.       0004C4   0F5E                 ADD.W   R14, R15
  631.       0004C6   824F....             MOV.W   R15, &gwTimeOverflowCount
  632.       0004CA   3E93                 CMP.W   #0xffff, R14
  633.       0004CC   0420                 JNE     ??FaxRXProcess_69
  634.       0004CE   D253....             ADD.B   #0x1, &gucTimeOverflowCount
  635.       0004D2   C243....             MOV.B   #0x0, &gucFrhErrorStatus
  636.                         ??FaxRXProcess_69:
  637.       0004D6   F2901400....         CMP.B   #0x14, &gucTimeOverflowCount
  638.       0004DC   DA23                 JNE     ??FaxRXProcess_11
  639.       0004DE   F2400300....         MOV.B   #0x3, &gucFrhErrorStatus
  640.       0004E4   C243....             MOV.B   #0x0, &gucTimeOverflowCount
  641.       0004E8   8243....             MOV.W   #0x0, &gwTimeOverflowCount
  642.     184                }
  643.     185                if (gucFrhErrorStatus == 0x03) return;
  644.                         ??FaxRXProcess_68:
  645.       0004EC   F2900300....         CMP.B   #0x3, &gucFrhErrorStatus
  646.       0004F2   ....                 JNE     $+6
  647.       0004F4   3040....             BR      #??FaxRXProcess_63
  648.     186                //Carrier==Training check     
  649.     187          ///* //add the No carrier check a bug of Dec.25,2006     
  650.     188                while (1)    
  651.     189                {
  652.     190                  ucRxIndex1 = gucUartRxCnt-3;
  653.                         ??FaxRXProcess_12:
  654.       0004F8   7E40FD00             MOV.B   #0xfd, R14
  655.       0004FC   5E52....             ADD.B   &gucUartRxCnt, R14
  656.       000500   4B4E                 MOV.B   R14, R11
  657.     191                  ucRxIndex0 = gucUartRxCnt-2;
  658.       000502   7E40FE00             MOV.B   #0xfe, R14
  659.       000506   5E52....             ADD.B   &gucUartRxCnt, R14
  660.       00050A   484E                 MOV.B   R14, R8
  661.     192                  if ((aucUartRxBuf[ucRxIndex0] == 0x0d)&&(aucUartRxBuf[ucRxIndex1] == 0x52))//4B Result code is not OK, but No carrier
  662.       00050C   38F0FF00             AND.W   #0xff, R8
  663.       000510   F8900D00....         CMP.B   #0xd, aucUartRxBuf(R8)
  664.       000516   0620                 JNE     ??FaxRXProcess_70
  665.       000518   3BF0FF00             AND.W   #0xff, R11
  666.       00051C   FB905200....         CMP.B   #0x52, aucUartRxBuf(R11)
  667.       000522   1724                 JEQ     ??FaxRXProcess_71
  668.     193                    break;
  669.     194                  //if check time>min. 5S, Receive Fax error, progra should be quit  
  670.     195                  RxFaxTimeOverflowErrorQuit();
  671.                         ??FaxRXProcess_70:
  672.       000524   1E42....             MOV.W   &gwTimeOverflowCount, R14
  673.       000528   1F43                 MOV.W   #0x1, R15
  674.       00052A   0F5E                 ADD.W   R14, R15
  675.       00052C   824F....             MOV.W   R15, &gwTimeOverflowCount
  676.       000530   3E93                 CMP.W   #0xffff, R14
  677.       000532   0420                 JNE     ??FaxRXProcess_72
  678.       000534   D253....             ADD.B   #0x1, &gucTimeOverflowCount
  679.       000538   C243....             MOV.B   #0x0, &gucFrhErrorStatus
  680.                         ??FaxRXProcess_72:
  681.       00053C   F2901400....         CMP.B   #0x14, &gucTimeOverflowCount
  682.       000542   DA23                 JNE     ??FaxRXProcess_12
  683.       000544   F2400300....         MOV.B   #0x3, &gucFrhErrorStatus
  684.       00054A   C243....             MOV.B   #0x0, &gucTimeOverflowCount
  685.       00054E   8243....             MOV.W   #0x0, &gwTimeOverflowCount
  686.     196                }
  687.     197                if (gucFrhErrorStatus == 0x03) return;      
  688.                         ??FaxRXProcess_71:
  689.       000552   F2900300....         CMP.B   #0x3, &gucFrhErrorStatus
  690.       000558   ....                 JNE     $+6
  691.       00055A   3040....             BR      #??FaxRXProcess_63
  692.     198          //*/   
  693.     199          //Training check over   
  694.     200          //FTHCFR  (confirmation to receive)
  695.     201                SendATcmdFTH();
  696.       00055E   B012....             CALL    #SendATcmdFTH
  697.     202                while (1)    //Connect
  698.     203                {
  699.     204                 ucRxIndex1=gucUartRxCnt-3;
  700.                         ??FaxRXProcess_13:
  701.       000562   7E40FD00             MOV.B   #0xfd, R14
  702.       000566   5E52....             ADD.B   &gucUartRxCnt, R14
  703.       00056A   4B4E                 MOV.B   R14, R11
  704.     205                  ucRxIndex0=gucUartRxCnt-2;
  705.       00056C   7E40FE00             MOV.B   #0xfe, R14
  706.       000570   5E52....             ADD.B   &gucUartRxCnt, R14
  707.       000574   484E                 MOV.B   R14, R8
  708.     206                  if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x54==aucUartRxBuf[ucRxIndex1]))
  709.       000576   38F0FF00             AND.W   #0xff, R8
  710.       00057A   F8900D00....         CMP.B   #0xd, aucUartRxBuf(R8)
  711.       000580   0620                 JNE     ??FaxRXProcess_73
  712.       000582   3BF0FF00             AND.W   #0xff, R11
  713.       000586   FB905400....         CMP.B   #0x54, aucUartRxBuf(R11)
  714.       00058C   1724                 JEQ     ??FaxRXProcess_74
  715.     207                    break;
  716.     208                  //if check time>min. 5S, Receive Fax error, progra should be quit  
  717.     209                  RxFaxTimeOverflowErrorQuit();
  718.                         ??FaxRXProcess_73:
  719.       00058E   1E42....             MOV.W   &gwTimeOverflowCount, R14
  720.       000592   1F43                 MOV.W   #0x1, R15
  721.       000594   0F5E                 ADD.W   R14, R15
  722.       000596   824F....             MOV.W   R15, &gwTimeOverflowCount
  723.       00059A   3E93                 CMP.W   #0xffff, R14
  724.       00059C   0420                 JNE     ??FaxRXProcess_75
  725.       00059E   D253....             ADD.B   #0x1, &gucTimeOverflowCount
  726.       0005A2   C243....             MOV.B   #0x0, &gucFrhErrorStatus
  727.                         ??FaxRXProcess_75:
  728.       0005A6   F2901400....         CMP.B   #0x14, &gucTimeOverflowCount
  729.       0005AC   DA23                 JNE     ??FaxRXProcess_13
  730.       0005AE   F2400300....         MOV.B   #0x3, &gucFrhErrorStatus
  731.       0005B4   C243....             MOV.B   #0x0, &gucTimeOverflowCount
  732.       0005B8   8243....             MOV.W   #0x0, &gwTimeOverflowCount
  733.     210                }
  734.     211                if (gucFrhErrorStatus==0x03) return;
  735.                         ??FaxRXProcess_74:
  736.       0005BC   F2900300....         CMP.B   #0x3, &gucFrhErrorStatus
  737.       0005C2   ....                 JNE     $+6
  738.       0005C4   3040....             BR      #??FaxRXProcess_63
  739.     212                
  740.     213                for (ucGeneralCount=0; ucGeneralCount<30; ucGeneralCount++)// delay 1.5S minimun 1 second
  741.       0005C8   4443                 MOV.B   #0x0, R4
  742.                         ??FaxRXProcess_14:
  743.       0005CA   74901E00             CMP.B   #0x1e, R4
  744.       0005CE   042C                 JC      ??FaxRXProcess_76
  745.     214                {
  746.     215                   ATcmdDelay();  //50ms
  747.       0005D0   B012....             CALL    #ATcmdDelay
  748.     216                }
  749.       0005D4   5453                 ADD.B   #0x1, R4
  750.       0005D6   F93F                 JMP     ??FaxRXProcess_14
  751.     217                
  752.     218                SendATdataFTHCFR();
  753.                         ??FaxRXProcess_76:
  754.       0005D8   B012....             CALL    #SendATdataFTHCFR
  755.     219          
  756.     220                while (1)    
  757.     221                {
  758.     222                 ucRxIndex1=gucUartRxCnt-3;
  759.                         ??FaxRXProcess_15:
  760.       0005DC   7E40FD00             MOV.B   #0xfd, R14
  761.       0005E0   5E52....             ADD.B   &gucUartRxCnt, R14
  762.       0005E4   4B4E                 MOV.B   R14, R11
  763.     223                  ucRxIndex0=gucUartRxCnt-2;
  764.       0005E6   7E40FE00             MOV.B   #0xfe, R14
  765.       0005EA   5E52....             ADD.B   &gucUartRxCnt, R14
  766.       0005EE   484E                 MOV.B   R14, R8
  767.     224                  if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
  768.       0005F0   38F0FF00             AND.W   #0xff, R8
  769.       0005F4   F8900D00....         CMP.B   #0xd, aucUartRxBuf(R8)
  770.       0005FA   0620                 JNE     ??FaxRXProcess_77
  771.       0005FC   3BF0FF00             AND.W   #0xff, R11
  772.       000600   FB904B00....         CMP.B   #0x4b, aucUartRxBuf(R11)
  773.       000606   1724                 JEQ     ??FaxRXProcess_78
  774.     225                    break;
  775.     226                  //if check time>min. 5S, Receive Fax error, progra should be quit  
  776.     227                  RxFaxTimeOverflowErrorQuit();
  777.                         ??FaxRXProcess_77:
  778.       000608   1E42....             MOV.W   &gwTimeOverflowCount, R14
  779.       00060C   1F43                 MOV.W   #0x1, R15
  780.       00060E   0F5E                 ADD.W   R14, R15
  781.       000610   824F....             MOV.W   R15, &gwTimeOverflowCount
  782.       000614   3E93                 CMP.W   #0xffff, R14
  783.       000616   0420                 JNE     ??FaxRXProcess_79
  784.       000618   D253....             ADD.B   #0x1, &gucTimeOverflowCount
  785.       00061C   C243....             MOV.B   #0x0, &gucFrhErrorStatus
  786.                         ??FaxRXProcess_79:
  787.       000620   F2901400....         CMP.B   #0x14, &gucTimeOverflowCount
  788.       000626   DA23                 JNE     ??FaxRXProcess_15
  789.       000628   F2400300....         MOV.B   #0x3, &gucFrhErrorStatus
  790.       00062E   C243....             MOV.B   #0x0, &gucTimeOverflowCount
  791.       000632   8243....             MOV.W   #0x0, &gwTimeOverflowCount
  792.     228                }  
  793.     229                if (gucFrhErrorStatus==0x03) return;
  794.                         ??FaxRXProcess_78:
  795.       000636   F2900300....         CMP.B   #0x3, &gucFrhErrorStatus
  796.       00063C   ....                 JNE     $+6
  797.       00063E   3040....             BR      #??FaxRXProcess_63
  798.     230                
  799.     231          
  800.     232          
  801.     233          //FRM pageimage
  802.     234                //SendATcmdFRM146();
  803.     235                SendATcmdFRM();
  804.       000642   B012....             CALL    #SendATcmdFRM
  805.     236                     
  806.     237                wGeneralCount=0;//63;
  807.       000646   0743                 MOV.W   #0x0, R7
  808.     238                ucGeneralCnt=0;//28;
  809.       000648   4A43                 MOV.B   #0x0, R10
  810.     239                //wPageAddress=0;
  811.     240                gucFrhErrorStatus=0;
  812.       00064A   C243....             MOV.B   #0x0, &gucFrhErrorStatus
  813.     241                gucUartRxCnt=0;
  814.       00064E   C243....             MOV.B   #0x0, &gucUartRxCnt
  815.     242                gpucQueueRear=0;
  816.       000652   C243....             MOV.B   #0x0, &gpucQueueRear
  817.     243                gpucQueueFront=0;
  818.       000656   C243....             MOV.B   #0x0, &gpucQueueFront
  819.     244                gdwRxQueueRearCnt=0;
  820.       00065A   8243....             MOV.W   #0x0, &gdwRxQueueRearCnt
  821.       00065E   8243....             MOV.W   #0x0, &gdwRxQueueRearCnt + 0x2
  822.     245                gdwRxQueueFrontCnt=0;
  823.       000662   8243....             MOV.W   #0x0, &gdwRxQueueFrontCnt
  824.       000666   8243....             MOV.W   #0x0, &gdwRxQueueFrontCnt + 0x2
  825.     246                //ZERO_ADDRESS();
  826.     247          
  827.     248                wPageAddress=cstFaxRxBufStartPage;//+1;//Block 19 Modify at Jan. 6, 2007
  828.       00066A   3940C004             MOV.W   #0x4c0, R9
  829.     249               
  830.     250                do{
  831.     251            wNextPageAddress=wPageAddress+64;
  832.                         ??FaxRXProcess_16:
  833.       00066E   3E404000             MOV.W   #0x40, R14
  834.       000672   0E59                 ADD.W   R9, R14
  835.       000674   054E                 MOV.W   R14, R5
  836.     252            wPageAddress=CalNextPageAddress(wPageAddress);
  837.       000676   0C49                 MOV.W   R9, R12
  838.       000678   B012....             CALL    #CalNextPageAddress
  839.       00067C   094C                 MOV.W   R12, R9
  840.     253           }while(wNextPageAddress==wPageAddress);
  841.       00067E   0599                 CMP.W   R9, R5
  842.       000680   F627                 JEQ     ??FaxRXProcess_16
  843.     254                      //erase next block
  844.     255                if (wPageAddress%64==0)
  845.       000682   0C49                 MOV.W   R9, R12
  846.       000684   3E404000             MOV.W   #0x40, R14
  847.       000688   B012....             CALL    #?DivMod16u
  848.       00068C   0E93                 CMP.W   #0x0, R14
  849.       00068E   0A20                 JNE     ??FaxRXProcess_80
  850.     256                {
  851.     257                   ROW_ADDRESS_LOW=wPageAddress & 0XFF;
  852.       000690   C249....             MOV.B   R9, &ROW_ADDRESS_LOW
  853.     258                   ROW_ADDRESS_HIGH=(wPageAddress>>8) & 0XFF; 
  854.       000694   0E49                 MOV.W   R9, R14
  855.       000696   8E10                 SWPB    R14
  856.       000698   3EF0FF00             AND.W   #0xff, R14
  857.       00069C   C24E....             MOV.B   R14, &ROW_ADDRESS_HIGH
  858.     259                   ERASE_ONE_BLOCK();
  859.       0006A0   B012....             CALL    #ERASE_ONE_BLOCK
  860.     260                }
  861.     261                wPageAddress=cstFaxRxBufStartPage+1;
  862.                         ??FaxRXProcess_80:
  863.       0006A4   3940C104             MOV.W   #0x4c1, R9
  864.     262          //COMMAND
  865.     263                        //Flash_Reset();
  866.     264                        COMMAND_VAL=0X80;
  867.       0006A8   F2408000....         MOV.B   #0x80, &COMMAND_VAL
  868.     265                     COMMAND_LATCH_INTO();
  869.       0006AE   B012....             CALL    #COMMAND_LATCH_INTO
  870.     266          
  871.     267          //ADDRESS
  872.     268                     ADDRESS_VALUE=0;//COLUMN_ADDRESS_HIGH; //#0X00
  873.       0006B2   C243....             MOV.B   #0x0, &ADDRESS_VALUE
  874.     269                     ADDRESS_LATCH_INTO();
  875.       0006B6   B012....             CALL    #ADDRESS_LATCH_INTO
  876.     270          
  877.     271                     ADDRESS_VALUE=0;//COLUMN_ADDRESS_HIGH; //#0X00
  878.       0006BA   C243....             MOV.B   #0x0, &ADDRESS_VALUE
  879.     272                     ADDRESS_LATCH_INTO();
  880.       0006BE   B012....             CALL    #ADDRESS_LATCH_INTO
  881.     273          
  882.     274                     ADDRESS_VALUE=wPageAddress & 0xff; //#0X00
  883.       0006C2   C249....             MOV.B   R9, &ADDRESS_VALUE
  884.     275                     ADDRESS_LATCH_INTO();
  885.       0006C6   B012....             CALL    #ADDRESS_LATCH_INTO
  886.     276          
  887.     277                     ADDRESS_VALUE=(wPageAddress>>8) & 0xff; //#0X00
  888.       0006CA   0E49                 MOV.W   R9, R14
  889.       0006CC   8E10                 SWPB    R14
  890.       0006CE   3EF0FF00             AND.W   #0xff, R14
  891.       0006D2   C24E....             MOV.B   R14, &ADDRESS_VALUE
  892.     278                     ADDRESS_LATCH_INTO();
  893.       0006D6   B012....             CALL    #ADDRESS_LATCH_INTO
  894.     279          
  895.     280                     FLASH_CON_PORT_OUT &=~ ALE;
  896.       0006DA   E2C32900             BIC.B   #0x2, &0x29
  897.     281                     //CALL DELAY_100US
  898.     282                     //for(i=0;i<0xff;i++);
  899.     283                     DATA_PORT_OUT_INITIAL; //MCU OUTPUT,MCU WRITE A DATA TO FLASH
  900.       0006DE   F2433200             MOV.B   #0xff, &0x32
  901.     284          //Pageimage     
  902.     285                while (1)    
  903.     286                {
  904.     287                 //if ((0x10 == aucUartRxBuf[ucRxIndex1]) && (0x03 == aucUartRxBuf[ucRxIndex0]))//terminate stream 10 03
  905.     288                 //if ((0x10 == aucUartRxBuf[gucUartRxCnt-1]) && (0x03 == aucUartRxBuf[gucUartRxCnt]))//terminate stream 10 03
  906.     289                       //break;
  907.     290                    //if check time>min. 5S, Receive Fax error, progra should be quit  
  908.     291                    RxFaxTimeOverflowErrorQuit();
  909.                         ??FaxRXProcess_17:
  910.       0006E2   1E42....             MOV.W   &gwTimeOverflowCount, R14
  911.       0006E6   1F43                 MOV.W   #0x1, R15
  912.       0006E8   0F5E                 ADD.W   R14, R15
  913.       0006EA   824F....             MOV.W   R15, &gwTimeOverflowCount
  914.       0006EE   3E93                 CMP.W   #0xffff, R14
  915.       0006F0   0420                 JNE     ??FaxRXProcess_81
  916.       0006F2   D253....             ADD.B   #0x1, &gucTimeOverflowCount
  917.       0006F6   C243....             MOV.B   #0x0, &gucFrhErrorStatus
  918.                         ??FaxRXProcess_81:
  919.       0006FA   F2901400....         CMP.B   #0x14, &gucTimeOverflowCount
  920.       000700   0820                 JNE     ??FaxRXProcess_82
  921.       000702   F2400300....         MOV.B   #0x3, &gucFrhErrorStatus
  922.       000708   C243....             MOV.B   #0x0, &gucTimeOverflowCount
  923.       00070C   8243....             MOV.W   #0x0, &gwTimeOverflowCount
  924.       000710   023D                 JMP     ??FaxRXProcess_83
  925.     292                    ucRxIndex1=gucUartRxCnt-3;
  926.                         ??FaxRXProcess_82:
  927.       000712   7E40FD00             MOV.B   #0xfd, R14
  928.       000716   5E52....             ADD.B   &gucUartRxCnt, R14
  929.       00071A   4B4E                 MOV.B   R14, R11
  930.     293                    ucRxIndex0=gucUartRxCnt-2;
  931.       00071C   7E40FE00             MOV.B   #0xfe, R14
  932.       000720   5E52....             ADD.B   &gucUartRxCnt, R14
  933.       000724   484E                 MOV.B   R14, R8
  934.     294                    if ((aucUartRxBuf[ucRxIndex0]==0x0d)&&(aucUartRxBuf[ucRxIndex1]==0x52))//4B  Result code is not OK, but No carrier
  935.       000726   38F0FF00             AND.W   #0xff, R8
  936.       00072A   F8900D00....         CMP.B   #0xd, aucUartRxBuf(R8)
  937.       000730   6A20                 JNE     ??FaxRXProcess_84
  938.       000732   3BF0FF00             AND.W   #0xff, R11
  939.       000736   FB905200....         CMP.B   #0x52, aucUartRxBuf(R11)
  940.       00073C   6420                 JNE     ??FaxRXProcess_84
  941.     295                       {
  942.     296                            
  943.     297                           PageImageEndProcess();
  944.       00073E   B012....             CALL    #PageImageEndProcess
  945.     298                           
  946.     299                           if (gucFrhErrorStatus==0x03) break; //add at Mar. 16, 2007.
  947.       000742   F2900300....         CMP.B   #0x3, &gucFrhErrorStatus
  948.       000748   E624                 JEQ     ??FaxRXProcess_83
  949.     300                           
  950.     301                           //More than two pages process //add at Dec.27,2006
  951.     302                           ucRxIndex3=gucUartRxCnt-38;
  952.       00074A   7E40DA00             MOV.B   #0xda, R14
  953.       00074E   5E52....             ADD.B   &gucUartRxCnt, R14
  954.       000752   C14E0000             MOV.B   R14, 0x0(SP)
  955.     303                           ucRxIndex2=gucUartRxCnt-37;
  956.       000756   7E40DB00             MOV.B   #0xdb, R14
  957.       00075A   5E52....             ADD.B   &gucUartRxCnt, R14
  958.       00075E   C14E0100             MOV.B   R14, 0x1(SP)
  959.     304                           ucRxIndex1=gucUartRxCnt-36;
  960.       000762   7E40DC00             MOV.B   #0xdc, R14
  961.       000766   5E52....             ADD.B   &gucUartRxCnt, R14
  962.       00076A   4B4E                 MOV.B   R14, R11
  963.     305                           ucRxIndex0=gucUartRxCnt-35;
  964.       00076C   7E40DD00             MOV.B   #0xdd, R14
  965.       000770   5E52....             ADD.B   &gucUartRxCnt, R14
  966.       000774   484E                 MOV.B   R14, R8
  967.     306                           if ((aucUartRxBuf[ucRxIndex0]==0x05)&&(aucUartRxBuf[ucRxIndex1]==0x35)&&
  968.     307                               (aucUartRxBuf[ucRxIndex2]==0x4f)&&(aucUartRxBuf[ucRxIndex3]==0x13))
  969.       000776   4E48                 MOV.B   R8, R14
  970.       000778   3EF0FF00             AND.W   #0xff, R14
  971.       00077C   FE900500....         CMP.B   #0x5, aucUartRxBuf(R14)
  972.       000782   1820                 JNE     ??FaxRXProcess_85
  973.       000784   4E4B                 MOV.B   R11, R14
  974.       000786   3EF0FF00             AND.W   #0xff, R14
  975.       00078A   FE903500....         CMP.B   #0x35, aucUartRxBuf(R14)
  976.       000790   1120                 JNE     ??FaxRXProcess_85
  977.       000792   5E410100             MOV.B   0x1(SP), R14
  978.       000796   3EF0FF00             AND.W   #0xff, R14
  979.       00079A   FE904F00....         CMP.B   #0x4f, aucUartRxBuf(R14)
  980.       0007A0   0920                 JNE     ??FaxRXProcess_85
  981.       0007A2   6E41                 MOV.B   0x0(SP), R14
  982.       0007A4   3EF0FF00             AND.W   #0xff, R14
  983.       0007A8   FE901300....         CMP.B   #0x13, aucUartRxBuf(R14)
  984.       0007AE   0220                 JNE     ??FaxRXProcess_85
  985.     308                            {
  986.     309                              SendATcmdFRM();
  987.       0007B0   B012....             CALL    #SendATcmdFRM
  988.     310                            }
  989.     311          // multi pages over flag                 
  990.     312                           if ((aucUartRxBuf[ucRxIndex0]==0x66)&&(aucUartRxBuf[ucRxIndex1]==0x33)&&
  991.     313                               (aucUartRxBuf[ucRxIndex2]==0x2f)&&(aucUartRxBuf[ucRxIndex3]==0x13))
  992.                         ??FaxRXProcess_85:
  993.       0007B4   4E48                 MOV.B   R8, R14
  994.       0007B6   3EF0FF00             AND.W   #0xff, R14
  995.       0007BA   FE906600....         CMP.B   #0x66, aucUartRxBuf(R14)
  996.       0007C0   1620                 JNE     ??FaxRXProcess_86
  997.       0007C2   4E4B                 MOV.B   R11, R14
  998.       0007C4   3EF0FF00             AND.W   #0xff, R14
  999.       0007C8   FE903300....         CMP.B   #0x33, aucUartRxBuf(R14)
  1000.       0007CE   0F20                 JNE     ??FaxRXProcess_86
  1001.       0007D0   5E410100             MOV.B   0x1(SP), R14
  1002.       0007D4   3EF0FF00             AND.W   #0xff, R14
  1003.       0007D8   FE902F00....         CMP.B   #0x2f, aucUartRxBuf(R14)
  1004.       0007DE   0720                 JNE     ??FaxRXProcess_86
  1005.       0007E0   6E41                 MOV.B   0x0(SP), R14
  1006.       0007E2   3EF0FF00             AND.W   #0xff, R14
  1007.       0007E6   FE901300....         CMP.B   #0x13, aucUartRxBuf(R14)
  1008.       0007EC   9424                 JEQ     ??FaxRXProcess_83
  1009.     314                            {  
  1010.     315                              break;
  1011.     316                            }
  1012.     317          // one page over flag                 
  1013.     318                           if ((aucUartRxBuf[ucRxIndex0]==0x2f)&&(aucUartRxBuf[ucRxIndex1]==0x13))
  1014.                         ??FaxRXProcess_86:
  1015.       0007EE   38F0FF00             AND.W   #0xff, R8
  1016.       0007F2   F8902F00....         CMP.B   #0x2f, aucUartRxBuf(R8)
  1017.       0007F8   0620                 JNE     ??FaxRXProcess_84
  1018.       0007FA   3BF0FF00             AND.W   #0xff, R11
  1019.       0007FE   FB901300....         CMP.B   #0x13, aucUartRxBuf(R11)
  1020.       000804   8824                 JEQ     ??FaxRXProcess_83
  1021.     319                              { 
  1022.     320                                break;
  1023.     321                              }
  1024.     322                       }
  1025.     323          
  1026.     324                    if (gdwRxQueueRearCnt-gdwRxQueueFrontCnt>32)
  1027.                         ??FaxRXProcess_84:
  1028.       000806   1E42....             MOV.W   &gdwRxQueueRearCnt, R14
  1029.       00080A   1F42....             MOV.W   &gdwRxQueueRearCnt + 0x2, R15
  1030.       00080E   1E82....             SUB.W   &gdwRxQueueFrontCnt, R14
  1031.       000812   1F72....             SUBC.W  &gdwRxQueueFrontCnt + 0x2, R15
  1032.       000816   0F93                 CMP.W   #0x0, R15
  1033.       000818   642B                 JNC     ??FaxRXProcess_17
  1034.       00081A   0320                 JNE     ??FaxRXProcess_87
  1035.       00081C   3E902100             CMP.W   #0x21, R14
  1036.       000820   602B                 JNC     ??FaxRXProcess_17
  1037.     325                    {
  1038.     326                        if (gdwRxQueueRearCnt-gdwRxQueueFrontCnt>254)   // if data num is more than the buffer space, error happan.
  1039.                         ??FaxRXProcess_87:
  1040.       000822   1E42....             MOV.W   &gdwRxQueueRearCnt, R14
  1041.       000826   1F42....             MOV.W   &gdwRxQueueRearCnt + 0x2, R15
  1042.       00082A   1E82....             SUB.W   &gdwRxQueueFrontCnt, R14
  1043.       00082E   1F72....             SUBC.W  &gdwRxQueueFrontCnt + 0x2, R15
  1044.       000832   0F93                 CMP.W   #0x0, R15
  1045.       000834   0528                 JNC     ??FaxRXProcess_88
  1046.       000836   0320                 JNE     ??FaxRXProcess_31
  1047.       000838   3E90FF00             CMP.W   #0xff, R14
  1048.       00083C   0128                 JNC     ??FaxRXProcess_88
  1049.     327                          {
  1050.     328                            while (1);//gucGeneralStatus |= FAXRXERROR;
  1051.                         ??FaxRXProcess_31:
  1052.       00083E   FF3F                 JMP     ??FaxRXProcess_31
  1053.     329                          }
  1054.     330                        if (wGeneralCount++<64) // 32*64=2048
  1055.                         ??FaxRXProcess_88:
  1056.       000840   0E47                 MOV.W   R7, R14
  1057.       000842   1743                 MOV.W   #0x1, R7
  1058.       000844   075E                 ADD.W   R14, R7
  1059.       000846   3E904000             CMP.W   #0x40, R14
  1060.       00084A   172C                 JC      ??FaxRXProcess_89
  1061.     331                        {
  1062.     332                          for (ucGeneralCnt=0;ucGeneralCnt<32;ucGeneralCnt++)
  1063.       00084C   4A43                 MOV.B   #0x0, R10
  1064.                         ??FaxRXProcess_19:
  1065.       00084E   7A902000             CMP.B   #0x20, R10
  1066.       000852   472F                 JC      ??FaxRXProcess_17
  1067.     333                          {
  1068.     334                           FLASH_CON_PORT_OUT&=~WE;
  1069.       000854   D2C32900             BIC.B   #0x1, &0x29
  1070.     335                          DATA_PORT_OUT=aucUartRxBuf[gpucQueueFront++];
  1071.       000858   5E42....             MOV.B   &gpucQueueFront, R14
  1072.       00085C   3EF0FF00             AND.W   #0xff, R14
  1073.       000860   D24E....3100         MOV.B   aucUartRxBuf(R14), &0x31
  1074.       000866   D253....             ADD.B   #0x1, &gpucQueueFront
  1075.     336                          gdwRxQueueFrontCnt++;               //The total num that is writed to flash
  1076.       00086A   9253....             ADD.W   #0x1, &gdwRxQueueFrontCnt
  1077.       00086E   8263....             ADDC.W  #0x0, &gdwRxQueueFrontCnt + 0x2
  1078.     337                          FLASH_CON_PORT_OUT |= WE;
  1079.       000872   D2D32900             BIS.B   #0x1, &0x29
  1080.     338                         }
  1081.       000876   5A53                 ADD.B   #0x1, R10
  1082.       000878   EA3F                 JMP     ??FaxRXProcess_19
  1083.     339                   //ucGeneralCnt=0;
  1084.     340                        }
  1085.     341                        else
  1086.     342                        { 
  1087.     343                          wGeneralCount=0;
  1088.                         ??FaxRXProcess_89:
  1089.       00087A   0743                 MOV.W   #0x0, R7
  1090.     344                          
  1091.     345                          COMMAND_VAL=0X10; //10H INITIATES PROGRAM
  1092.       00087C   F2401000....         MOV.B   #0x10, &COMMAND_VAL
  1093.     346                       COMMAND_LATCH_INTO();
  1094.       000882   B012....             CALL    #COMMAND_LATCH_INTO
  1095.     347          
  1096.     348                       READ_STATUS();
  1097.       000886   B012....             CALL    #READ_STATUS
  1098.     349                          ucFlashSttsOverflowCnt=0;
  1099.       00088A   4643                 MOV.B   #0x0, R6
  1100.     350                       while (FLASH_STATUS==1&&(ucFlashSttsOverflowCnt++)<2)
  1101.                         ??FaxRXProcess_20:
  1102.       00088C   D293....             CMP.B   #0x1, &FLASH_STATUS
  1103.       000890   0520                 JNE     ??FaxRXProcess_90
  1104.       000892   4E46                 MOV.B   R6, R14
  1105.       000894   5643                 MOV.B   #0x1, R6
  1106.       000896   465E                 ADD.B   R14, R6
  1107.       000898   6E93                 CMP.B   #0x2, R14
  1108.       00089A   F82B                 JNC     ??FaxRXProcess_20
  1109.     351                     {
  1110.     352                      ;//ERASE_ONE_BLOCK();
  1111.     353                      //PROGRAM_ONE_PAGE();
  1112.     354                     }
  1113.     355                          if (wPageAddress<2559) wPageAddress++; //add at Jan. 18, 2007
  1114.                         ??FaxRXProcess_90:
  1115.       00089C   3990FF09             CMP.W   #0x9ff, R9
  1116.       0008A0   012C                 JC      ??FaxRXProcess_21
  1117.       0008A2   1953                 ADD.W   #0x1, R9
  1118.     356                       do{
  1119.     357                        wNextPageAddress=wPageAddress+64;
  1120.                         ??FaxRXProcess_21:
  1121.       0008A4   3E404000             MOV.W   #0x40, R14
  1122.       0008A8   0E59                 ADD.W   R9, R14
  1123.       0008AA   054E                 MOV.W   R14, R5
  1124.     358                        wPageAddress=CalNextPageAddress(wPageAddress);
  1125.       0008AC   0C49                 MOV.W   R9, R12
  1126.       0008AE   B012....             CALL    #CalNextPageAddress
  1127.       0008B2   094C                 MOV.W   R12, R9
  1128.     359                        }while(wNextPageAddress==wPageAddress);
  1129.       0008B4   0599                 CMP.W   R9, R5
  1130.       0008B6   F627                 JEQ     ??FaxRXProcess_21
  1131.     360                      if (wPageAddress%64==0)
  1132.       0008B8   0C49                 MOV.W   R9, R12
  1133.       0008BA   3E404000             MOV.W   #0x40, R14
  1134.       0008BE   B012....             CALL    #?DivMod16u
  1135.       0008C2   0E93                 CMP.W   #0x0, R14
  1136.       0008C4   0A20                 JNE     ??FaxRXProcess_91
  1137.     361                         {
  1138.     362                            ROW_ADDRESS_LOW=wPageAddress & 0XFF;
  1139.       0008C6   C249....             MOV.B   R9, &ROW_ADDRESS_LOW
  1140.     363                            ROW_ADDRESS_HIGH=(wPageAddress>>8) & 0XFF; 
  1141.       0008CA   0E49                 MOV.W   R9, R14
  1142.       0008CC   8E10                 SWPB    R14
  1143.       0008CE   3EF0FF00             AND.W   #0xff, R14
  1144.       0008D2   C24E....             MOV.B   R14, &ROW_ADDRESS_HIGH
  1145.     364                            ERASE_ONE_BLOCK();
  1146.       0008D6   B012....             CALL    #ERASE_ONE_BLOCK
  1147.     365                         }
  1148.     366                        //Flash_Reset();
  1149.     367                        COMMAND_VAL=0X80;
  1150.                         ??FaxRXProcess_91:
  1151.       0008DA   F2408000....         MOV.B   #0x80, &COMMAND_VAL
  1152.     368                     COMMAND_LATCH_INTO();
  1153.       0008E0   B012....             CALL    #COMMAND_LATCH_INTO
  1154.     369          
  1155.     370          //ADDRESS
  1156.     371                     ADDRESS_VALUE=0;//COLUMN_ADDRESS_HIGH; //#0X00
  1157.       0008E4   C243....             MOV.B   #0x0, &ADDRESS_VALUE
  1158.     372                     ADDRESS_LATCH_INTO();
  1159.       0008E8   B012....             CALL    #ADDRESS_LATCH_INTO
  1160.     373          
  1161.     374                     ADDRESS_VALUE=0;//COLUMN_ADDRESS_HIGH; //#0X00
  1162.       0008EC   C243....             MOV.B   #0x0, &ADDRESS_VALUE
  1163.     375                     ADDRESS_LATCH_INTO();
  1164.       0008F0   B012....             CALL    #ADDRESS_LATCH_INTO
  1165.     376          
  1166.     377                     ADDRESS_VALUE=wPageAddress & 0xff; //#0X00
  1167.       0008F4   C249....             MOV.B   R9, &ADDRESS_VALUE
  1168.     378                     ADDRESS_LATCH_INTO();
  1169.       0008F8   B012....             CALL    #ADDRESS_LATCH_INTO
  1170.     379          
  1171.     380                     ADDRESS_VALUE=(wPageAddress>>8) & 0xff; //#0X00
  1172.       0008FC   0E49                 MOV.W   R9, R14
  1173.       0008FE   8E10                 SWPB    R14
  1174.       000900   3EF0FF00             AND.W   #0xff, R14
  1175.       000904   C24E....             MOV.B   R14, &ADDRESS_VALUE
  1176.     381                     ADDRESS_LATCH_INTO();
  1177.       000908   B012....             CALL    #ADDRESS_LATCH_INTO
  1178.     382          
  1179.     383                     FLASH_CON_PORT_OUT &=~ ALE;
  1180.       00090C   E2C32900             BIC.B   #0x2, &0x29
  1181.     384                     //CALL DELAY_100US
  1182.     385                     //for(i=0;i<0xff;i++);
  1183.     386                     DATA_PORT_OUT_INITIAL; //MCU OUTPUT,MCU WRITE A DATA TO FLASH
  1184.       000910   F2433200             MOV.B   #0xff, &0x32
  1185.       000914   E63E                 JMP     ??FaxRXProcess_17
  1186.     387                      
  1187.     388                        }//else
  1188.     389                    }//if
  1189.     390                }//while 
  1190.     391                
  1191.     392                if (gucFrhErrorStatus==0x03) return; //add at Mar. 16, 2007.
  1192.                         ??FaxRXProcess_83:
  1193.       000916   F2900300....         CMP.B   #0x3, &gucFrhErrorStatus
  1194.       00091C   EA25                 JEQ     ??FaxRXProcess_63
  1195.     393          
  1196.     394