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

传真(Fax)编程

开发平台:

C/C++

  1. ##############################################################################
  2. #                                                                            #
  3. # IAR MSP430 C/EC++ Compiler V2.10A/W32                23/Apr/2007  18:04:07 #
  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. #                     filesDTEcmdProcess.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. #                     filesDTEcmdProcess.c                                  #
  24. #    List file     =  E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  25. #                     DebugListDTEcmdProcess.lst                           #
  26. #    Object file   =  E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  27. #                     DebugObjDTEcmdProcess.r43                            #
  28. #                                                                            #
  29. #                                                                            #
  30. ##############################################################################
  31. E:projectFaxProgramVson_Bryan_Fax_Conexant_070423filesDTEcmdProcess.c
  32.       1          /************************************************
  33.       2          Description: 
  34.       3                process Dte Command
  35.       4          Input:
  36.       5                none
  37.       6          Output:
  38.       7                none
  39.       8          Update:
  40.       9                2007.03.20 Bryan      add some function
  41.      10                2007.1.25  Bryan      function header     create
  42.      11          ************************************************/
  43.      12          
  44.      13          #include "includeH.h"
  45.                                     In segment DATA16_AN, at 0x28
  46.       unsigned char const volatile __data P2IN
  47.                         P2IN:
  48.       000000                        DS8 1
  49.                                     In segment DATA16_AN, at 0x29
  50.       unsigned char volatile __data P2OUT
  51.                         P2OUT:
  52.       000000                        DS8 1
  53.                                     In segment DATA16_AN, at 0x30
  54.       unsigned char const volatile __data P5IN
  55.                         P5IN:
  56.       000000                        DS8 1
  57.                                     In segment DATA16_AN, at 0x32
  58.       unsigned char volatile __data P5DIR
  59.                         P5DIR:
  60.       000000                        DS8 1
  61.                                     In segment DATA16_AN, at 0x35
  62.       unsigned char volatile __data P6OUT
  63.                         P6OUT:
  64.       000000                        DS8 1
  65.                                     In segment DATA16_AN, at 0x36
  66.       unsigned char volatile __data P6DIR
  67.                         P6DIR:
  68.       000000                        DS8 1
  69.      14          
  70.                                     In segment CODE, align 2, align-sorted
  71.      15          void DteGetModemBus(void)
  72.                         DteGetModemBus:
  73.      16          {
  74.      17              MODEM_BUS_CON_PORT |= MODEM_BUS_2_MCU;
  75.       000000   F2D010003500         BIS.B   #0x10, &0x35
  76.      18              MODEM_BUS_CON_PORT &= ~MODEM_BUS_2_PC; 
  77.       000006   F2C23500             BIC.B   #0x8, &0x35
  78.      19              gucViewStaticStatus &= ~bitViewReceiving;
  79.       00000A   D2C3....             BIC.B   #0x1, &aucViewData + 0x7
  80.      20              gucViewStaticStatus |= bitViewSending;
  81.       00000E   E2D3....             BIS.B   #0x2, &aucViewData + 0x7
  82.      21              ViewCommunicationTX(0x01);
  83.       000012   5C43                 MOV.B   #0x1, R12
  84.       000014   3040....             BR      #ViewCommunicationTX
  85.      22              
  86.      23          }
  87.      24          
  88.      25          //*************************************************************************
  89.                                     In segment CODE, align 2, keep-with-next
  90.      26          void DteReturnModemBus(void)
  91.                         DteReturnModemBus:
  92.      27          {
  93.       000000   0A12                 PUSH.W  R10
  94.       000002   0B12                 PUSH.W  R11
  95.       000004   0812                 PUSH.W  R8
  96.       000006   0912                 PUSH.W  R9
  97.       000008   0612                 PUSH.W  R6
  98.      28               unsigned int  wGeneralCount = 0;
  99.       00000A   0643                 MOV.W   #0x0, R6
  100.      29               unsigned int  wOKcount=0;
  101.       00000C   0B43                 MOV.W   #0x0, R11
  102.      30               unsigned int  wNotOKcount=0; 
  103.       00000E   0843                 MOV.W   #0x0, R8
  104.      31               unsigned char  ucRxIndex1=0;
  105.       000010   4943                 MOV.B   #0x0, R9
  106.      32               unsigned char  ucRxIndex0=0;
  107.       000012   4A43                 MOV.B   #0x0, R10
  108.      33                              
  109.      34              MODEM_BUS_CON_PORT |= MODEM_BUS_2_PC;
  110.       000014   F2D23500             BIS.B   #0x8, &0x35
  111.      35              MODEM_BUS_CON_PORT &= ~MODEM_BUS_2_MCU;
  112.       000018   F2C010003500         BIC.B   #0x10, &0x35
  113.      36              while (1)
  114.      37               {
  115.      38                ATcmdDelay();
  116.                         ??DteReturnModemBus_1:
  117.       00001E   B012....             CALL    #ATcmdDelay
  118.      39                SendATcmd();          
  119.       000022   B012....             CALL    #SendATcmd
  120.      40                ATcmdDelay();
  121.       000026   B012....             CALL    #ATcmdDelay
  122.      41                ATcmdDelay();
  123.       00002A   B012....             CALL    #ATcmdDelay
  124.      42              
  125.      43                while (wGeneralCount++<0xffff)
  126.                         ??DteReturnModemBus_0:
  127.       00002E   0E46                 MOV.W   R6, R14
  128.       000030   1643                 MOV.W   #0x1, R6
  129.       000032   065E                 ADD.W   R14, R6
  130.       000034   3E93                 CMP.W   #0xffff, R14
  131.       000036   2224                 JEQ     ??DteReturnModemBus_2
  132.      44                {
  133.      45                 ucRxIndex1=gucUartRxCnt-3;
  134.       000038   7E40FD00             MOV.B   #0xfd, R14
  135.       00003C   5E52....             ADD.B   &gucUartRxCnt, R14
  136.       000040   494E                 MOV.B   R14, R9
  137.      46                 ucRxIndex0=gucUartRxCnt-2;
  138.       000042   7E40FE00             MOV.B   #0xfe, R14
  139.       000046   5E52....             ADD.B   &gucUartRxCnt, R14
  140.       00004A   4A4E                 MOV.B   R14, R10
  141.      47                 if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
  142.       00004C   3AF0FF00             AND.W   #0xff, R10
  143.       000050   FA900D00....         CMP.B   #0xd, aucUartRxBuf(R10)
  144.       000056   0820                 JNE     ??DteReturnModemBus_3
  145.       000058   39F0FF00             AND.W   #0xff, R9
  146.       00005C   F9904B00....         CMP.B   #0x4b, aucUartRxBuf(R9)
  147.       000062   0220                 JNE     ??DteReturnModemBus_3
  148.      48                  {wOKcount++;break;}
  149.       000064   1B53                 ADD.W   #0x1, R11
  150.       000066   0A3C                 JMP     ??DteReturnModemBus_2
  151.      49                 if (wGeneralCount==0xffff)
  152.                         ??DteReturnModemBus_3:
  153.       000068   3693                 CMP.W   #0xffff, R6
  154.       00006A   E123                 JNE     ??DteReturnModemBus_0
  155.      50                 {    
  156.      51                  //wGeneralCount=0;
  157.      52                  wNotOKcount++;
  158.       00006C   1853                 ADD.W   #0x1, R8
  159.      53                  SendATcmdModemSoftReset();
  160.       00006E   B012....             CALL    #SendATcmdModemSoftReset
  161.      54                  ATcmdDelay();
  162.       000072   B012....             CALL    #ATcmdDelay
  163.      55                  ATcmdDelay();
  164.       000076   B012....             CALL    #ATcmdDelay
  165.       00007A   D93F                 JMP     ??DteReturnModemBus_0
  166.      56                 }//if
  167.      57                }//while
  168.      58                ucRxIndex1=gucUartRxCnt-3;
  169.                         ??DteReturnModemBus_2:
  170.       00007C   7E40FD00             MOV.B   #0xfd, R14
  171.       000080   5E52....             ADD.B   &gucUartRxCnt, R14
  172.       000084   494E                 MOV.B   R14, R9
  173.      59                ucRxIndex0=gucUartRxCnt-2;
  174.       000086   7E40FE00             MOV.B   #0xfe, R14
  175.       00008A   5E52....             ADD.B   &gucUartRxCnt, R14
  176.       00008E   4A4E                 MOV.B   R14, R10
  177.      60                if ((0x0d==aucUartRxBuf[ucRxIndex0])&&(0x4B==aucUartRxBuf[ucRxIndex1]))
  178.       000090   3AF0FF00             AND.W   #0xff, R10
  179.       000094   FA900D00....         CMP.B   #0xd, aucUartRxBuf(R10)
  180.       00009A   C123                 JNE     ??DteReturnModemBus_1
  181.       00009C   39F0FF00             AND.W   #0xff, R9
  182.       0000A0   F9904B00....         CMP.B   #0x4b, aucUartRxBuf(R9)
  183.       0000A6   BB23                 JNE     ??DteReturnModemBus_1
  184.      61                  {wOKcount++;break;}
  185.       0000A8   1B53                 ADD.W   #0x1, R11
  186.      62               }//while
  187.      63          
  188.      64               _NOP();
  189.       0000AA   0343                 NOP
  190.      65               gucViewStaticStatus |= bitViewReceiving;
  191.       0000AC   D2D3....             BIS.B   #0x1, &aucViewData + 0x7
  192.      66               gucViewStaticStatus &= ~bitViewSending;
  193.       0000B0   E2C3....             BIC.B   #0x2, &aucViewData + 0x7
  194.      67               ViewCommunicationTX(0x01);
  195.       0000B4   5C43                 MOV.B   #0x1, R12
  196.       0000B6   B012....             CALL    #ViewCommunicationTX
  197.      68          }
  198.       0000BA   3040....             BR      #?Epilogue5
  199.      69          
  200.      70          
  201.      71          //*************************************************************************
  202.                                     In segment CODE, align 2, keep-with-next
  203.      72          void DteGetFaxList(void)
  204.                         DteGetFaxList:
  205.      73          {
  206.       000000   0A12                 PUSH.W  R10
  207.       000002   0B12                 PUSH.W  R11
  208.       000004   0812                 PUSH.W  R8
  209.       000006   0912                 PUSH.W  R9
  210.       000008   0612                 PUSH.W  R6
  211.       00000A   0712                 PUSH.W  R7
  212.       00000C   0412                 PUSH.W  R4
  213.       00000E   0512                 PUSH.W  R5
  214.       000010   31800600             SUB.W   #0x6, SP
  215.      74           unsigned int wPageAddress=0, wBlockAddress=0,
  216.       000014   0743                 MOV.W   #0x0, R7
  217.       000016   0543                 MOV.W   #0x0, R5
  218.      75                        wColumnAddress=0,wNextPageAddress=0,
  219.       000018   0A43                 MOV.W   #0x0, R10
  220.       00001A   81430200             MOV.W   #0x0, 0x2(SP)
  221.      76                        wRearPntCnt=0;
  222.       00001E   81430400             MOV.W   #0x0, 0x4(SP)
  223.      77           unsigned char ucRxIndex=0,
  224.       000022   4B43                 MOV.B   #0x0, R11
  225.      78                         ucGeneralCnt=0,ucFaxPropertyLenCnt,
  226.       000024   C1430000             MOV.B   #0x0, 0x0(SP)
  227.      79                         ucRxIndex3=0,ucRxIndex2=0,
  228.       000028   4443                 MOV.B   #0x0, R4
  229.       00002A   4843                 MOV.B   #0x0, R8
  230.      80                         ucRxIndex0=0,ucRxIndex1=0;
  231.       00002C   4943                 MOV.B   #0x0, R9
  232.       00002E   4643                 MOV.B   #0x0, R6
  233.      81          
  234.      82                 SOFTUART_PORT_DIRECTION |= bitSOFTUARTTX;//set SOFTUARTTX open SoftUart TX
  235.       000030   D2D33600             BIS.B   #0x1, &0x36
  236.      83            for (wBlockAddress=cstFaxPropertyTableStartBlockNum;
  237.       000034   1543                 MOV.W   #0x1, R5
  238.      84                wBlockAddress<=cstFaxPropertyTableOverBlockNum;wBlockAddress++)
  239.                         ??DteGetFaxList_5:
  240.       000036   35900B00             CMP.W   #0xb, R5
  241.       00003A   CE2C                 JC      ??DteGetFaxList_6
  242.      85           {
  243.      86           //1 block==64pages
  244.      87           for (wPageAddress=(wBlockAddress<<6);wPageAddress<((wBlockAddress<<6)+64);wPageAddress++)
  245.       00003C   0C45                 MOV.W   R5, R12
  246.       00003E   B012....             CALL    #?ShiftLeft16_6
  247.       000042   074C                 MOV.W   R12, R7
  248.                         ??DteGetFaxList_4:
  249.       000044   0C45                 MOV.W   R5, R12
  250.       000046   B012....             CALL    #?ShiftLeft16_6
  251.       00004A   3C504000             ADD.W   #0x40, R12
  252.       00004E   079C                 CMP.W   R12, R7
  253.       000050   A92C                 JC      ??DteGetFaxList_7
  254.      88           {
  255.      89                do{
  256.      90               wNextPageAddress=wPageAddress+64;
  257.                         ??DteGetFaxList_0:
  258.       000052   3E404000             MOV.W   #0x40, R14
  259.       000056   0E57                 ADD.W   R7, R14
  260.       000058   814E0200             MOV.W   R14, 0x2(SP)
  261.      91               wPageAddress=CalNextPageAddress(wPageAddress);
  262.       00005C   0C47                 MOV.W   R7, R12
  263.       00005E   B012....             CALL    #CalNextPageAddress
  264.       000062   074C                 MOV.W   R12, R7
  265.      92                }while(wNextPageAddress==wPageAddress);
  266.       000064   81970200             CMP.W   R7, 0x2(SP)
  267.       000068   F427                 JEQ     ??DteGetFaxList_0
  268.      93                
  269.      94                wColumnAddress=0;
  270.       00006A   0A43                 MOV.W   #0x0, R10
  271.      95                ROW_ADDRESS_LOW=wPageAddress & 0XFF;
  272.       00006C   C247....             MOV.B   R7, &ROW_ADDRESS_LOW
  273.      96                ROW_ADDRESS_HIGH=(wPageAddress>>8) & 0XFF;
  274.       000070   0E47                 MOV.W   R7, R14
  275.       000072   8E10                 SWPB    R14
  276.       000074   3EF0FF00             AND.W   #0xff, R14
  277.       000078   C24E....             MOV.B   R14, &ROW_ADDRESS_HIGH
  278.      97                
  279.      98                //if a block no erase, one page can write 8 tiems(00 512 1024 1536 2048 2064 2080 2096)
  280.      99                //So 8 times shall be readed within one page.
  281.     100                for (ucGeneralCnt=0;ucGeneralCnt<8;ucGeneralCnt++)
  282.       00007C   C1430000             MOV.B   #0x0, 0x0(SP)
  283.                         ??DteGetFaxList_3:
  284.       000080   F1920000             CMP.B   #0x8, 0x0(SP)
  285.       000084   752C                 JC      ??DteGetFaxList_8
  286.     101                {
  287.     102          //COMMAND
  288.     103             COMMAND_VAL=0x00; //#0X00 //00H READ1 0-2111BYTE
  289.       000086   C243....             MOV.B   #0x0, &COMMAND_VAL
  290.     104             COMMAND_LATCH_INTO();
  291.       00008A   B012....             CALL    #COMMAND_LATCH_INTO
  292.     105          //ADDRESS
  293.     106          
  294.     107             ADDRESS_VALUE=wColumnAddress & 0xff;//COLUMN_ADDRESS_LOW;
  295.       00008E   C24A....             MOV.B   R10, &ADDRESS_VALUE
  296.     108             ADDRESS_LATCH_INTO();
  297.       000092   B012....             CALL    #ADDRESS_LATCH_INTO
  298.     109          
  299.     110             ADDRESS_VALUE=(wColumnAddress>>8) & 0XFF;//COLUMN_ADDRESS_HIGH;
  300.       000096   0E4A                 MOV.W   R10, R14
  301.       000098   8E10                 SWPB    R14
  302.       00009A   3EF0FF00             AND.W   #0xff, R14
  303.       00009E   C24E....             MOV.B   R14, &ADDRESS_VALUE
  304.     111             ADDRESS_LATCH_INTO();
  305.       0000A2   B012....             CALL    #ADDRESS_LATCH_INTO
  306.     112          
  307.     113             ADDRESS_VALUE=ROW_ADDRESS_LOW;
  308.       0000A6   D242........         MOV.B   &ROW_ADDRESS_LOW, &ADDRESS_VALUE
  309.     114             ADDRESS_LATCH_INTO();
  310.       0000AC   B012....             CALL    #ADDRESS_LATCH_INTO
  311.     115          
  312.     116             ADDRESS_VALUE=ROW_ADDRESS_HIGH;
  313.       0000B0   D242........         MOV.B   &ROW_ADDRESS_HIGH, &ADDRESS_VALUE
  314.     117             ADDRESS_LATCH_INTO();
  315.       0000B6   B012....             CALL    #ADDRESS_LATCH_INTO
  316.     118             FLASH_CON_PORT_OUT &=~ ALE;
  317.       0000BA   E2C32900             BIC.B   #0x2, &0x29
  318.     119          
  319.     120             COMMAND_VAL=0X30;
  320.       0000BE   F2403000....         MOV.B   #0x30, &COMMAND_VAL
  321.     121             COMMAND_LATCH_INTO();
  322.       0000C4   B012....             CALL    #COMMAND_LATCH_INTO
  323.     122             //ATcmdDelay();
  324.     123             while((FLASH_CON_PORT_IN & RB)==0);
  325.                         ??DteGetFaxList_1:
  326.       0000C8   F2B020002800         BIT.B   #0x20, &0x28
  327.       0000CE   FC2B                 JNC     ??DteGetFaxList_1
  328.     124             DATA_PORT_IN_INITIAL;
  329.       0000D0   C2433200             MOV.B   #0x0, &0x32
  330.     125             for (ucFaxPropertyLenCnt=0;ucFaxPropertyLenCnt<16;ucFaxPropertyLenCnt++)
  331.       0000D4   C1430100             MOV.B   #0x0, 0x1(SP)
  332.                         ??DteGetFaxList_2:
  333.       0000D8   F19010000100         CMP.B   #0x10, 0x1(SP)
  334.       0000DE   142C                 JC      ??DteGetFaxList_9
  335.     126             {
  336.     127               FLASH_CON_PORT_OUT &=~ RE; //RE IS LOW,ENABLE READ DATA
  337.       0000E0   F2C010002900         BIC.B   #0x10, &0x29
  338.     128               SoftUartTxOneFrame(DATA_PORT_IN);//add at Jan. 25, 2007
  339.       0000E6   5C423000             MOV.B   &0x30, R12
  340.       0000EA   B012....             CALL    #SoftUartTxOneFrame
  341.     129               aucUartRxBuf[ucRxIndex++]=DATA_PORT_IN;
  342.       0000EE   4E4B                 MOV.B   R11, R14
  343.       0000F0   3EF0FF00             AND.W   #0xff, R14
  344.       0000F4   DE423000....         MOV.B   &0x30, aucUartRxBuf(R14)
  345.       0000FA   5B53                 ADD.B   #0x1, R11
  346.     130               FLASH_CON_PORT_OUT |= RE;
  347.       0000FC   F2D010002900         BIS.B   #0x10, &0x29
  348.     131             }
  349.       000102   D1530100             ADD.B   #0x1, 0x1(SP)
  350.       000106   E83F                 JMP     ??DteGetFaxList_2
  351.     132             wRearPntCnt++;
  352.                         ??DteGetFaxList_9:
  353.       000108   91530400             ADD.W   #0x1, 0x4(SP)
  354.     133             ucRxIndex3=ucRxIndex-4;
  355.       00010C   7E40FC00             MOV.B   #0xfc, R14
  356.       000110   4E5B                 ADD.B   R11, R14
  357.       000112   444E                 MOV.B   R14, R4
  358.     134                ucRxIndex2=ucRxIndex-3;
  359.       000114   7E40FD00             MOV.B   #0xfd, R14
  360.       000118   4E5B                 ADD.B   R11, R14
  361.       00011A   484E                 MOV.B   R14, R8
  362.     135                ucRxIndex1=ucRxIndex-2;
  363.       00011C   7E40FE00             MOV.B   #0xfe, R14
  364.       000120   4E5B                 ADD.B   R11, R14
  365.       000122   464E                 MOV.B   R14, R6
  366.     136                ucRxIndex0=ucRxIndex-1;
  367.       000124   7E43                 MOV.B   #0xff, R14
  368.       000126   4E5B                 ADD.B   R11, R14
  369.       000128   494E                 MOV.B   R14, R9
  370.     137               if (0xff == aucUartRxBuf[ucRxIndex0] && 0xff == aucUartRxBuf[ucRxIndex1] &&
  371.     138                  0xff == aucUartRxBuf[ucRxIndex2] && 0xff == aucUartRxBuf[ucRxIndex3])
  372.       00012A   4E49                 MOV.B   R9, R14
  373.       00012C   3EF0FF00             AND.W   #0xff, R14
  374.       000130   FE93....             CMP.B   #0xff, aucUartRxBuf(R14)
  375.       000134   1220                 JNE     ??DteGetFaxList_10
  376.       000136   4E46                 MOV.B   R6, R14
  377.       000138   3EF0FF00             AND.W   #0xff, R14
  378.       00013C   FE93....             CMP.B   #0xff, aucUartRxBuf(R14)
  379.       000140   0C20                 JNE     ??DteGetFaxList_10
  380.       000142   4E48                 MOV.B   R8, R14
  381.       000144   3EF0FF00             AND.W   #0xff, R14
  382.       000148   FE93....             CMP.B   #0xff, aucUartRxBuf(R14)
  383.       00014C   0620                 JNE     ??DteGetFaxList_10
  384.       00014E   4E44                 MOV.B   R4, R14
  385.       000150   3EF0FF00             AND.W   #0xff, R14
  386.       000154   FE93....             CMP.B   #0xff, aucUartRxBuf(R14)
  387.       000158   0B24                 JEQ     ??DteGetFaxList_8
  388.     139                {
  389.     140                break;  //next rear   
  390.     141                }//if
  391.     142             if (ucGeneralCnt<4)
  392.                         ??DteGetFaxList_10:
  393.       00015A   E1920000             CMP.B   #0x4, 0x0(SP)
  394.       00015E   032C                 JC      ??DteGetFaxList_11
  395.     143            wColumnAddress+=512;
  396.       000160   3A500002             ADD.W   #0x200, R10
  397.       000164   023C                 JMP     ??DteGetFaxList_12
  398.     144                    else
  399.     145            wColumnAddress+=16;
  400.                         ??DteGetFaxList_11:
  401.       000166   3A501000             ADD.W   #0x10, R10
  402.     146             }//for read next property pointer
  403.                         ??DteGetFaxList_12:
  404.       00016A   D1530000             ADD.B   #0x1, 0x0(SP)
  405.       00016E   883F                 JMP     ??DteGetFaxList_3
  406.     147             
  407.     148             //ucRxIndex3=gucUartRxCnt-4;
  408.     149              //ucRxIndex2=gucUartRxCnt-3;
  409.     150              //ucRxIndex1=gucUartRxCnt-2;
  410.     151              //ucRxIndex0=gucUartRxCnt-1;
  411.     152             if (0xff == aucUartRxBuf[ucRxIndex0] && 0xff == aucUartRxBuf[ucRxIndex1] &&
  412.     153                0xff == aucUartRxBuf[ucRxIndex2] && 0xff == aucUartRxBuf[ucRxIndex3])
  413.                         ??DteGetFaxList_8:
  414.       000170   4E49                 MOV.B   R9, R14
  415.       000172   3EF0FF00             AND.W   #0xff, R14
  416.       000176   FE93....             CMP.B   #0xff, aucUartRxBuf(R14)
  417.       00017A   1220                 JNE     ??DteGetFaxList_13
  418.       00017C   4E46                 MOV.B   R6, R14
  419.       00017E   3EF0FF00             AND.W   #0xff, R14
  420.       000182   FE93....             CMP.B   #0xff, aucUartRxBuf(R14)
  421.       000186   0C20                 JNE     ??DteGetFaxList_13
  422.       000188   4E48                 MOV.B   R8, R14
  423.       00018A   3EF0FF00             AND.W   #0xff, R14
  424.       00018E   FE93....             CMP.B   #0xff, aucUartRxBuf(R14)
  425.       000192   0620                 JNE     ??DteGetFaxList_13
  426.       000194   4E44                 MOV.B   R4, R14
  427.       000196   3EF0FF00             AND.W   #0xff, R14
  428.       00019A   FE93....             CMP.B   #0xff, aucUartRxBuf(R14)
  429.       00019E   0224                 JEQ     ??DteGetFaxList_7
  430.     154               {break;}
  431.     155             }//for next page
  432.                         ??DteGetFaxList_13:
  433.       0001A0   1753                 ADD.W   #0x1, R7
  434.       0001A2   503F                 JMP     ??DteGetFaxList_4
  435.     156          /*   
  436.     157             //send the 16 FaxProperty to PC (16*16=256bytes)
  437.     158             ucRxIndex=0;
  438.     159             for (wGeneralCnt=0;wGeneralCnt<256;wGeneralCnt++)//
  439.     160             {
  440.     161                 SoftUartTxOneFrame(aucUartRxBuf[ucRxIndex++]);
  441.     162                 ucRxIndex3=ucRxIndex+3;
  442.     163                  ucRxIndex2=ucRxIndex+2;
  443.     164                  ucRxIndex1=ucRxIndex+1;
  444.     165                  ucRxIndex0=ucRxIndex+0;
  445.     166                  if (0xff == aucUartRxBuf[ucRxIndex0] && 0xff == aucUartRxBuf[ucRxIndex1] &&
  446.     167                    0xff == aucUartRxBuf[ucRxIndex2] && 0xff == aucUartRxBuf[ucRxIndex3])
  447.     168                  break;
  448.     169             }
  449.     170          */
  450.     171             //ucRxIndex3=gucUartRxCnt-4;
  451.     172              //ucRxIndex2=gucUartRxCnt-3;
  452.     173              //ucRxIndex1=gucUartRxCnt-2;
  453.     174              //ucRxIndex0=gucUartRxCnt-1;
  454.     175             if (0xff == aucUartRxBuf[ucRxIndex0] && 0xff == aucUartRxBuf[ucRxIndex1] &&
  455.     176                0xff == aucUartRxBuf[ucRxIndex2] && 0xff == aucUartRxBuf[ucRxIndex3])
  456.                         ??DteGetFaxList_7:
  457.       0001A4   4E49                 MOV.B   R9, R14
  458.       0001A6   3EF0FF00             AND.W   #0xff, R14
  459.       0001AA   FE93....             CMP.B   #0xff, aucUartRxBuf(R14)
  460.       0001AE   1220                 JNE     ??DteGetFaxList_14
  461.       0001B0   4E46                 MOV.B   R6, R14
  462.       0001B2   3EF0FF00             AND.W   #0xff, R14
  463.       0001B6   FE93....             CMP.B   #0xff, aucUartRxBuf(R14)
  464.       0001BA   0C20                 JNE     ??DteGetFaxList_14
  465.       0001BC   4E48                 MOV.B   R8, R14
  466.       0001BE   3EF0FF00             AND.W   #0xff, R14
  467.       0001C2   FE93....             CMP.B   #0xff, aucUartRxBuf(R14)
  468.       0001C6   0620                 JNE     ??DteGetFaxList_14
  469.       0001C8   4E44                 MOV.B   R4, R14
  470.       0001CA   3EF0FF00             AND.W   #0xff, R14
  471.       0001CE   FE93....             CMP.B   #0xff, aucUartRxBuf(R14)
  472.       0001D2   0224                 JEQ     ??DteGetFaxList_6
  473.     177               {break;}
  474.     178           }//for next block
  475.                         ??DteGetFaxList_14:
  476.       0001D4   1553                 ADD.W   #0x1, R5
  477.       0001D6   2F3F                 JMP     ??DteGetFaxList_5
  478.     179           gwGeneralPageAddress=wPageAddress; //for write Fax property record
  479.                         ??DteGetFaxList_6:
  480.       0001D8   8247....             MOV.W   R7, &gwGeneralPageAddress
  481.     180            gwColumnAddress=wColumnAddress;    //for write Fax property record
  482.       0001DC   824A....             MOV.W   R10, &gwColumnAddress
  483.     181                  SOFTUART_PORT_DIRECTION &= ~bitSOFTUARTTX;//off the SoftUart
  484.       0001E0   D2C33600             BIC.B   #0x1, &0x36
  485.     182          }
  486.       0001E4   31500600             ADD.W   #0x6, SP
  487.       0001E8   3040....             BR      #?Epilogue8
  488.     183          
  489.     184          //*************************************************************************
  490.                                     In segment CODE, align 2, keep-with-next
  491.     185          void DteGetOneFax(unsigned int wEveryFaxHead, unsigned int wEveryFaxRear)
  492.                         DteGetOneFax:
  493.     186          {
  494.       000000   0A12                 PUSH.W  R10
  495.       000002   0B12                 PUSH.W  R11
  496.       000004   0812                 PUSH.W  R8
  497.       000006   0912                 PUSH.W  R9
  498.       000008   0612                 PUSH.W  R6
  499.       00000A   0712                 PUSH.W  R7
  500.       00000C   064C                 MOV.W   R12, R6
  501.       00000E   0A4E                 MOV.W   R14, R10
  502.     187                unsigned char ucFlashColumnAddCnt=0;
  503.       000010   4743                 MOV.B   #0x0, R7
  504.     188                
  505.     189                //unsigned char  ucRxIndex=0;
  506.     190                //unsigned char  ucBlockCnt=0;
  507.     191                unsigned int 
  508.     192                             wNextPageAddress=0,wPageAddress=0,
  509.       000012   0B43                 MOV.W   #0x0, R11
  510.       000014   0843                 MOV.W   #0x0, R8
  511.     193                             wGeneralCnt=0;
  512.       000016   0943                 MOV.W   #0x0, R9
  513.     194              //MODEM_BUS_CON_PORT |= SOFT_UART_2_PC;
  514.     195              //SOFTUART_PORT_DIRECTION |= SOFT_UART_2_PC;
  515.     196              SOFTUART_PORT_DIRECTION |= bitSOFTUARTTX;
  516.       000018   D2D33600             BIS.B   #0x1, &0x36
  517.     197              if (wEveryFaxHead<wEveryFaxRear)//(wEveryFaxHead!=wEveryFaxRear)//
  518.       00001C   069A                 CMP.W   R10, R6
  519.       00001E   7C2C                 JC      ??DteGetOneFax_5
  520.     198                {
  521.     199                   
  522.     200                for (wPageAddress=wEveryFaxHead;wPageAddress<=wEveryFaxRear;)//
  523.       000020   0846                 MOV.W   R6, R8
  524.                         ??DteGetOneFax_3:
  525.       000022   0A98                 CMP.W   R8, R10
  526.       000024   7928                 JNC     ??DteGetOneFax_5
  527.     201                {
  528.     202                  
  529.     203                  ROW_ADDRESS_LOW = wPageAddress & 0xff;
  530.       000026   C248....             MOV.B   R8, &ROW_ADDRESS_LOW
  531.     204                  ROW_ADDRESS_HIGH = (wPageAddress>>8) & 0xff;
  532.       00002A   0E48                 MOV.W   R8, R14
  533.       00002C   8E10                 SWPB    R14
  534.       00002E   3EF0FF00             AND.W   #0xff, R14
  535.       000032   C24E....             MOV.B   R14, &ROW_ADDRESS_HIGH
  536.     205                  for (ucFlashColumnAddCnt = 0;ucFlashColumnAddCnt < 8;ucFlashColumnAddCnt++)//8*256=2048
  537.       000036   4743                 MOV.B   #0x0, R7
  538.                         ??DteGetOneFax_1:
  539.       000038   7792                 CMP.B   #0x8, R7
  540.       00003A   3A2C                 JC      ??DteGetOneFax_6
  541.     206                  {
  542.     207               //8 * 256 == 2048 Bytes 2^4*2^8 12bit column address HighColumnAddr:0~8
  543.     208                      //total 8*256B+64B=2K+64B
  544.     209               COLUMN_ADDRESS_HIGH=ucFlashColumnAddCnt;
  545.       00003C   C247....             MOV.B   R7, &COLUMN_ADDRESS_HIGH
  546.     210               READ_256_BYTE();//read 256 Byte to aucUartRxBuf[256]
  547.       000040   B012....             CALL    #READ_256_BYTE
  548.     211               for (wGeneralCnt=0;wGeneralCnt<256;wGeneralCnt++)//
  549.       000044   0943                 MOV.W   #0x0, R9
  550.                         ??DteGetOneFax_0:
  551.       000046   39900001             CMP.W   #0x100, R9
  552.       00004A   1C2C                 JC      ??DteGetOneFax_7
  553.     212               {
  554.     213           SoftUartTxOneFrame(aucUartRxBuf[wGeneralCnt]);
  555.       00004C   5C49....             MOV.B   aucUartRxBuf(R9), R12
  556.       000050   B012....             CALL    #SoftUartTxOneFrame
  557.     214           if (aucUartRxBuf[wGeneralCnt-1] == 0xfb && aucUartRxBuf[wGeneralCnt-2] == 0x13 && aucUartRxBuf[wGeneralCnt-3] == 0xff)
  558.       000054   3E40....             MOV.W   #aucUartRxBuf, R14
  559.       000058   0E59                 ADD.W   R9, R14
  560.       00005A   FE90FB00FFFF         CMP.B   #0xfb, 0xffff(R14)
  561.       000060   0F20                 JNE     ??DteGetOneFax_8
  562.       000062   3E40....             MOV.W   #aucUartRxBuf, R14
  563.       000066   0E59                 ADD.W   R9, R14
  564.       000068   FE901300FEFF         CMP.B   #0x13, 0xfffe(R14)
  565.       00006E   0820                 JNE     ??DteGetOneFax_8
  566.       000070   3E40....             MOV.W   #aucUartRxBuf, R14
  567.       000074   0E59                 ADD.W   R9, R14
  568.       000076   FE93FDFF             CMP.B   #0xff, 0xfffd(R14)
  569.       00007A   0220                 JNE     ??DteGetOneFax_8
  570.     215             {_NOP();break;}             
  571.       00007C   0343                 NOP
  572.       00007E   023C                 JMP     ??DteGetOneFax_7
  573.     216               }//third for
  574.                         ??DteGetOneFax_8:
  575.       000080   1953                 ADD.W   #0x1, R9
  576.       000082   E13F                 JMP     ??DteGetOneFax_0
  577.     217               if (aucUartRxBuf[wGeneralCnt-1] == 0xfb && aucUartRxBuf[wGeneralCnt-2] == 0x13 && aucUartRxBuf[wGeneralCnt-3] == 0xff)
  578.                         ??DteGetOneFax_7:
  579.       000084   3E40....             MOV.W   #aucUartRxBuf, R14
  580.       000088   0E59                 ADD.W   R9, R14
  581.       00008A   FE90FB00FFFF         CMP.B   #0xfb, 0xffff(R14)
  582.       000090   0D20                 JNE     ??DteGetOneFax_9
  583.       000092   3E40....             MOV.W   #aucUartRxBuf, R14
  584.       000096   0E59                 ADD.W   R9, R14
  585.       000098   FE901300FEFF         CMP.B   #0x13, 0xfffe(R14)
  586.       00009E   0620                 JNE     ??DteGetOneFax_9
  587.       0000A0   3E40....             MOV.W   #aucUartRxBuf, R14
  588.       0000A4   0E59                 ADD.W   R9, R14
  589.       0000A6   FE93FDFF             CMP.B   #0xff, 0xfffd(R14)
  590.       0000AA   0224                 JEQ     ??DteGetOneFax_6
  591.     218             break;        
  592.     219                  }//second for
  593.                         ??DteGetOneFax_9:
  594.       0000AC   5753                 ADD.B   #0x1, R7
  595.       0000AE   C43F                 JMP     ??DteGetOneFax_1
  596.     220                  
  597.     221                 if (aucUartRxBuf[wGeneralCnt-1] == 0xfb && aucUartRxBuf[wGeneralCnt-2] == 0x13 && aucUartRxBuf[wGeneralCnt-3] == 0xff)//pageimage over
  598.                         ??DteGetOneFax_6:
  599.       0000B0   3E40....             MOV.W   #aucUartRxBuf, R14
  600.       0000B4   0E59                 ADD.W   R9, R14
  601.       0000B6   FE90FB00FFFF         CMP.B   #0xfb, 0xffff(R14)
  602.       0000BC   1D20                 JNE     ??DteGetOneFax_10
  603.       0000BE   3E40....             MOV.W   #aucUartRxBuf, R14
  604.       0000C2   0E59                 ADD.W   R9, R14
  605.       0000C4   FE901300FEFF         CMP.B   #0x13, 0xfffe(R14)
  606.       0000CA   1620                 JNE     ??DteGetOneFax_10
  607.       0000CC   3E40....             MOV.W   #aucUartRxBuf, R14
  608.       0000D0   0E59                 ADD.W   R9, R14
  609.       0000D2   FE93FDFF             CMP.B   #0xff, 0xfffd(R14)
  610.       0000D6   1020                 JNE     ??DteGetOneFax_10
  611.     222                    {                                                 
  612.     223                      /*//Record the front pointer for Check new in DCE
  613.     224                      ATcmdDelay();// a bug of Dec.23,2006 FF 10 00 0E // receive data delay(if not, can't receive 0x10 0x03)
  614.     225                      if ((gwGeneralPageAddress>>6) > cstFaxFrontPointerTableOverBlockNum)
  615.     226                     {
  616.     227                      for (ucBlockCnt=0;ucBlockCnt<4;ucBlockCnt++)
  617.     228                      {
  618.     229                           wPageAddress=(cstFaxFrontPointerTableStartBlockNum+ucBlockCnt)<<6;
  619.     230                     ROW_ADDRESS_LOW=wPageAddress & 0XFF;
  620.     231                     ROW_ADDRESS_HIGH=(wPageAddress>>8) & 0XFF; 
  621.     232                     ERASE_ONE_BLOCK();
  622.     233                      }
  623.     234                      gwGeneralPageAddress = cstFaxFrontPointerTableStartPage;
  624.     235                      gwColumnAddress=0;
  625.     236                     }
  626.     237                     
  627.     238                      //Record the front pointer for Check new in DCE
  628.     239                      
  629.     240                      ReadLastFaxFrontPointer();    
  630.     241                      ucRxIndex=0; //write Fax Front Pointer
  631.     242                      aucUartRxBuf[ucRxIndex++]=wPageAddress & 0xff;
  632.     243                      aucUartRxBuf[ucRxIndex++]=(wPageAddress>>8) & 0xff;
  633.     244                      for (ucBlockCnt=0; ucBlockCnt<12; ucBlockCnt++)
  634.     245                      {
  635.     246                       aucUartRxBuf[ucRxIndex++]=0x55;
  636.     247                      }
  637.     248                      //WriteFaxFrontPointerTable();
  638.     249                      Write16Bytes2FlashMemoryArea();
  639.     250                      */
  640.     251                      wPageAddress++;
  641.       0000D8   1853                 ADD.W   #0x1, R8
  642.     252                      if(wPageAddress==0)
  643.       0000DA   0893                 CMP.W   #0x0, R8
  644.       0000DC   0220                 JNE     ??DteGetOneFax_2
  645.     253                         wPageAddress += cstFaxContentStartPage;//2560;//Mar. 1, 20007
  646.       0000DE   38500014             ADD.W   #0x1400, R8
  647.     254                      do{
  648.     255                 wNextPageAddress=wPageAddress+64;
  649.                         ??DteGetOneFax_2:
  650.       0000E2   3E404000             MOV.W   #0x40, R14
  651.       0000E6   0E58                 ADD.W   R8, R14
  652.       0000E8   0B4E                 MOV.W   R14, R11
  653.     256                 wPageAddress=CalNextPageAddress(wPageAddress);
  654.       0000EA   0C48                 MOV.W   R8, R12
  655.       0000EC   B012....             CALL    #CalNextPageAddress
  656.       0000F0   084C                 MOV.W   R12, R8
  657.     257                 }while(wNextPageAddress==wPageAddress);
  658.       0000F2   0B98                 CMP.W   R8, R11
  659.       0000F4   F627                 JEQ     ??DteGetOneFax_2
  660.       0000F6   953F                 JMP     ??DteGetOneFax_3
  661.     258                       //ReadLastFaxFrontPointer();//read next write fax front pointer addr    //delete at Jan. 19, 2007
  662.     259                      continue;//break; a bug of Dec. 12,2006
  663.     260                    }
  664.     261                    wPageAddress++;
  665.                         ??DteGetOneFax_10:
  666.       0000F8   1853                 ADD.W   #0x1, R8
  667.     262                    if(wPageAddress==0)
  668.       0000FA   0893                 CMP.W   #0x0, R8
  669.       0000FC   0220                 JNE     ??DteGetOneFax_4
  670.     263                         wPageAddress += cstFaxContentStartPage;//2560;//Mar. 1, 20007
  671.       0000FE   38500014             ADD.W   #0x1400, R8
  672.     264                      do{
  673.     265                 wNextPageAddress=wPageAddress+64;//wNextPageAddress=gwPageAddress+64;
  674.                         ??DteGetOneFax_4:
  675.       000102   3E404000             MOV.W   #0x40, R14
  676.       000106   0E58                 ADD.W   R8, R14
  677.       000108   0B4E                 MOV.W   R14, R11
  678.     266                 wPageAddress=CalNextPageAddress(wPageAddress);
  679.       00010A   0C48                 MOV.W   R8, R12
  680.       00010C   B012....             CALL    #CalNextPageAddress
  681.       000110   084C                 MOV.W   R12, R8
  682.     267                 }while(wNextPageAddress==wPageAddress);             
  683.       000112   0B98                 CMP.W   R8, R11
  684.       000114   F627                 JEQ     ??DteGetOneFax_4
  685.       000116   853F                 JMP     ??DteGetOneFax_3
  686.     268                 }//third for ----> next page
  687.     269                 
  688.     270                 }//if wNewFaxHead<wNewFaxRear
  689.     271                 //MODEM_BUS_CON_PORT &= ~SOFT_UART_2_PC;
  690.     272                 //SOFTUART_PORT_DIRECTION &= ~SOFT_UART_2_PC;
  691.     273                 SOFTUART_PORT_DIRECTION &= ~bitSOFTUARTTX;
  692.                         ??DteGetOneFax_5:
  693.       000118   D2C33600             BIC.B   #0x1, &0x36
  694.     274          }//DteGetOneFax function over 
  695.       00011C   3040....             BR      #?Epilogue6
  696.     275          
  697.     276          /*
  698.     277          void SetSystemTime(unsigned char ucYear, unsigned char ucMonth, unsigned char ucDate, 
  699.     278                             unsigned char ucHour, unsigned char ucMinute, unsigned char ucSecond)
  700.     279          {
  701.     280          
  702.     281          ;
  703.     282          } 
  704.     283          */ 
  705.     284          
  706.                                     In segment CODE, align 2, keep-with-next
  707.     285          void DceResponsePc(void)
  708.                         DceResponsePc:
  709.     286          {
  710.       000000   0A12                 PUSH.W  R10
  711.     287                 unsigned char ucRxIndex=0;
  712.       000002   4A43                 MOV.B   #0x0, R10
  713.     288                 for (ucRxIndex=0; ucRxIndex<8; ucRxIndex++)
  714.       000004   4A43                 MOV.B   #0x0, R10
  715.                         ??DceResponsePc_0:
  716.       000006   7A92                 CMP.B   #0x8, R10
  717.       000008   092C                 JC      ??DceResponsePc_1
  718.     289                 SoftUartTxOneFrame(aucUartRxBuf[ucRxIndex]);     
  719.       00000A   4E4A                 MOV.B   R10, R14
  720.       00000C   3EF0FF00             AND.W   #0xff, R14
  721.       000010   5C4E....             MOV.B   aucUartRxBuf(R14), R12
  722.       000014   B012....             CALL    #SoftUartTxOneFrame
  723.       000018   5A53                 ADD.B   #0x1, R10
  724.       00001A   F53F                 JMP     ??DceResponsePc_0
  725.     290          } 
  726.                         ??DceResponsePc_1:
  727.       00001C   3A41                 POP.W   R10
  728.       00001E   3041                 RET
  729.    Maximum stack usage in bytes:
  730.      Function                     CSTACK
  731.      --------                     ------
  732.      DceResponsePc                    4
  733.        -> SoftUartTxOneFrame          4
  734.      DteGetFaxList                   24
  735.        -> CalNextPageAddress         24
  736.        -> COMMAND_LATCH_INTO         24
  737.        -> ADDRESS_LATCH_INTO         24
  738.        -> ADDRESS_LATCH_INTO         24
  739.        -> ADDRESS_LATCH_INTO         24
  740.        -> ADDRESS_LATCH_INTO         24
  741.        -> COMMAND_LATCH_INTO         24
  742.        -> SoftUartTxOneFrame         24
  743.      DteGetModemBus                   2
  744.        -> ViewCommunicationTX         2
  745.      DteGetOneFax                    14
  746.        -> READ_256_BYTE              14
  747.        -> SoftUartTxOneFrame         14
  748.        -> CalNextPageAddress         14
  749.        -> CalNextPageAddress         14
  750.      DteReturnModemBus               12
  751.        -> ATcmdDelay                 12
  752.        -> SendATcmd                  12
  753.        -> ATcmdDelay                 12
  754.        -> ATcmdDelay                 12
  755.        -> SendATcmdModemSoftReset    12
  756.        -> ATcmdDelay                 12
  757.        -> ATcmdDelay                 12
  758.        -> ViewCommunicationTX        12
  759.    Segment part sizes:
  760.      Function/Label    Bytes
  761.      --------------    -----
  762.      P2IN                 1
  763.      P2OUT                1
  764.      P5IN                 1
  765.      P5DIR                1
  766.      P6OUT                1
  767.      P6DIR                1
  768.      DteGetModemBus      24
  769.      DteReturnModemBus  190
  770.      DteGetFaxList      492
  771.      DteGetOneFax       288
  772.      DceResponsePc       32
  773.  
  774.  1 026 bytes in segment CODE
  775.      6 bytes in segment DATA16_AN
  776.  
  777.  1 026 bytes of CODE memory
  778.      0 bytes of DATA memory (+ 6 bytes shared)
  779. Errors: none
  780. Warnings: none