⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lib_str.txt

📁 stm32 ucos 精简移殖版本 不需作任何修改直接便可运行。包含串口 定时器
💻 TXT
📖 第 1 页 / 共 3 页
字号:
                  |L1.438|
0001b6  b92b              CBNZ     r3,|L1.452|
0001b8  b90c              CBNZ     r4,|L1.446|
0001ba  2000              MOVS     r0,#0                 ;745
0001bc  bdf0              POP      {r4-r7,pc}
                  |L1.446|
0001be  7820              LDRB     r0,[r4,#0]            ;747
0001c0  4240              RSBS     r0,r0,#0              ;747
0001c2  bdf0              POP      {r4-r7,pc}
                  |L1.452|
0001c4  7818              LDRB     r0,[r3,#0]            ;750
0001c6  bdf0              POP      {r4-r7,pc}
;;;757    
                          ENDP

                  Str_Char PROC
;;;801    
;;;802        if (pstr == (CPU_CHAR *)0) {                                /* Rtn NULL if srch str ptr NULL (see Note #2a).        */
0001c8  b908              CBNZ     r0,|L1.462|
;;;803            return ((CPU_CHAR *)0);
0001ca  2000              MOVS     r0,#0
                  |L1.460|
;;;804        }
;;;805    
;;;806    
;;;807        pstr_next = pstr;
;;;808        pstr_next++;
;;;809        while (( pstr_next != (CPU_CHAR *)0) &&                     /* Srch str until NULL ptr(s) (see Note #2b) ...        */
;;;810               (*pstr      != (CPU_CHAR  )0) &&                     /* ... or NULL char           (see Note #2c) ...        */
;;;811               (*pstr      != (CPU_CHAR  )srch_char)) {             /* ... or srch char found     (see Note #2d).           */
;;;812            pstr++;
;;;813            pstr_next++;
;;;814        }
;;;815    
;;;816    
;;;817        if (*pstr != srch_char) {                                   /* If srch char NOT found, str points to NULL; ...      */
;;;818            return ((CPU_CHAR *)0);                                 /* ... rtn NULL (see Notes #2b & #2c).                  */
;;;819        }
;;;820    
;;;821        return (pstr);                                              /* Else rtn ptr to found srch char (see Note #2d).      */
;;;822    }
0001cc  4770              BX       lr
                  |L1.462|
0001ce  1c42              ADDS     r2,r0,#1              ;808
0001d0  e001              B        |L1.470|
                  |L1.466|
0001d2  1c40              ADDS     r0,r0,#1              ;812
0001d4  1c52              ADDS     r2,r2,#1              ;813
                  |L1.470|
0001d6  b11a              CBZ      r2,|L1.480|
0001d8  7803              LDRB     r3,[r0,#0]            ;810
0001da  b10b              CBZ      r3,|L1.480|
0001dc  428b              CMP      r3,r1                 ;811
0001de  d1f8              BNE      |L1.466|
                  |L1.480|
0001e0  7802              LDRB     r2,[r0,#0]            ;817
0001e2  428a              CMP      r2,r1                 ;817
0001e4  d0f2              BEQ      |L1.460|
0001e6  2000              MOVS     r0,#0                 ;818
0001e8  4770              BX       lr
;;;823    
                          ENDP

                  Str_Char_N PROC
;;;874                           CPU_CHAR     srch_char)
;;;875    {
0001ea  b530              PUSH     {r4,r5,lr}
;;;876        CPU_CHAR    *pstr_next;
;;;877        CPU_SIZE_T   len_srch;
;;;878    
;;;879    
;;;880        if (pstr == (CPU_CHAR *)0) {                                /* Rtn NULL if srch str ptr NULL    (see Note #2a).     */
0001ec  b908              CBNZ     r0,|L1.498|
;;;881            return ((CPU_CHAR *)0);
0001ee  2000              MOVS     r0,#0
;;;882        }
;;;883    
;;;884        if (len_max == (CPU_SIZE_T)0) {                             /* Rtn NULL if srch len equals zero (see Note #2e).     */
;;;885            return ((CPU_CHAR *)0);
;;;886        }
;;;887    
;;;888    
;;;889        pstr_next = pstr;
;;;890        pstr_next++;
;;;891        len_srch  = 0;
;;;892        while (( pstr_next != (CPU_CHAR *)0)         &&             /* Srch str until NULL ptr(s)  (see Note #2b)  ...      */
;;;893               (*pstr      != (CPU_CHAR  )0)         &&             /* ... or NULL char            (see Note #2c)  ...      */
;;;894               (*pstr      != (CPU_CHAR  )srch_char) &&             /* ... or srch char found      (see Note #2d); ...      */
;;;895               ( len_srch  <  (CPU_SIZE_T)len_max)) {               /* ... or max nbr chars srch'd (see Note #2e).          */
;;;896            pstr++;
;;;897            pstr_next++;
;;;898            len_srch++;
;;;899        }
;;;900    
;;;901    
;;;902        if (*pstr != srch_char) {                                   /* If srch char NOT found, str points to NULL; ...      */
;;;903            return ((CPU_CHAR *)0);                                 /* ... rtn NULL (see Notes #2b & #2c).                  */
;;;904        }
;;;905    
;;;906        return (pstr);                                              /* Else rtn ptr to found srch char (see Note #2d).      */
;;;907    }
0001f0  bd30              POP      {r4,r5,pc}
                  |L1.498|
0001f2  b909              CBNZ     r1,|L1.504|
0001f4  2000              MOVS     r0,#0                 ;885
                  |L1.502|
0001f6  bd30              POP      {r4,r5,pc}
                  |L1.504|
0001f8  1c44              ADDS     r4,r0,#1              ;890
0001fa  2300              MOVS     r3,#0                 ;891
0001fc  e002              B        |L1.516|
                  |L1.510|
0001fe  1c40              ADDS     r0,r0,#1              ;896
000200  1c64              ADDS     r4,r4,#1              ;897
000202  1c5b              ADDS     r3,r3,#1              ;898
                  |L1.516|
000204  b12c              CBZ      r4,|L1.530|
000206  7805              LDRB     r5,[r0,#0]            ;893
000208  b11d              CBZ      r5,|L1.530|
00020a  4295              CMP      r5,r2                 ;894
00020c  d001              BEQ      |L1.530|
00020e  428b              CMP      r3,r1                 ;895
000210  d3f5              BCC      |L1.510|
                  |L1.530|
000212  7801              LDRB     r1,[r0,#0]            ;902
000214  4291              CMP      r1,r2                 ;902
000216  d0ee              BEQ      |L1.502|
000218  2000              MOVS     r0,#0                 ;903
00021a  bd30              POP      {r4,r5,pc}
;;;908    
                          ENDP

                  Str_Char_Last PROC
;;;949                              CPU_CHAR   srch_char)
;;;950    {
00021c  b510              PUSH     {r4,lr}
00021e  4603              MOV      r3,r0
000220  460c              MOV      r4,r1
;;;951        CPU_CHAR    *pstr_next;
;;;952        CPU_SIZE_T   str_len;
;;;953    
;;;954    
;;;955        if (pstr == (CPU_CHAR *)0) {                                /* Rtn NULL if srch str ptr NULL (see Note #2a).        */
000222  b90b              CBNZ     r3,|L1.552|
;;;956            return ((CPU_CHAR *)0);
000224  2000              MOVS     r0,#0
                  |L1.550|
;;;957        }
;;;958    
;;;959    
;;;960        pstr_next  = pstr;
;;;961        str_len    = Str_Len(pstr);
;;;962        pstr_next += str_len;
;;;963        while (( pstr_next != pstr) &&                              /* Srch str from end until beg (see Note #2c) ...       */
;;;964               (*pstr_next != srch_char)) {                         /* ... until srch char found   (see Note #2d).          */
;;;965            pstr_next--;
;;;966        }
;;;967    
;;;968    
;;;969        if (*pstr_next != srch_char) {                              /* If srch char NOT found, str points to NULL; ...      */
;;;970            return ((CPU_CHAR *)0);                                 /* ... rtn NULL (see Notes #2b & #2c).                  */
;;;971        }
;;;972    
;;;973        return (pstr_next);                                         /* Else rtn ptr to found srch char (see Note #2d).      */
;;;974    }
000226  bd10              POP      {r4,pc}
                  |L1.552|
000228  4618              MOV      r0,r3                 ;961
00022a  f7fff7ff          BL       Str_Len
00022e  4418              ADD      r0,r0,r3              ;962
000230  e000              B        |L1.564|
                  |L1.562|
000232  1e40              SUBS     r0,r0,#1              ;965
                  |L1.564|
000234  4298              CMP      r0,r3                 ;963
000236  d002              BEQ      |L1.574|
000238  7801              LDRB     r1,[r0,#0]            ;964
00023a  42a1              CMP      r1,r4                 ;964
00023c  d1f9              BNE      |L1.562|
                  |L1.574|
00023e  7801              LDRB     r1,[r0,#0]            ;969
000240  42a1              CMP      r1,r4                 ;969
000242  d0f0              BEQ      |L1.550|
000244  2000              MOVS     r0,#0                 ;970
000246  bd10              POP      {r4,pc}
;;;975    
                          ENDP

                  Str_Str PROC
;;;1019                       CPU_CHAR  *psrch_str)
;;;1020   {
000248  e92de92d          PUSH     {r4-r10,lr}
00024c  4606              MOV      r6,r0
00024e  468a              MOV      r10,r1
;;;1021       CPU_SIZE_T    str_len;
;;;1022       CPU_SIZE_T    srch_str_len;
;;;1023       CPU_SIZE_T    srch_len;
;;;1024       CPU_SIZE_T    srch_ix;
;;;1025       CPU_BOOLEAN   srch_done;
;;;1026       CPU_INT16S    srch_cmp1;
;;;1027       CPU_CHAR     *pstr_srch_ix;
;;;1028   
;;;1029                                                                   /* Rtn NULL if str ptr(s) NULL (see Note #2a).          */
;;;1030       if (pstr == (CPU_CHAR *)0) {
000250  b916              CBNZ     r6,|L1.600|
;;;1031           return ((CPU_CHAR *)0);
000252  2000              MOVS     r0,#0
                  |L1.596|
;;;1032       }
;;;1033       if (psrch_str == (CPU_CHAR *)0) {
;;;1034           return ((CPU_CHAR *)0);
;;;1035       }
;;;1036   
;;;1037   
;;;1038       str_len      = Str_Len(pstr);
;;;1039       srch_str_len = Str_Len(psrch_str);
;;;1040       if (srch_str_len > str_len) {                               /* If srch str len > str len, rtn NULL  (see Note #2b). */
;;;1041           return ((CPU_CHAR *)0);
;;;1042       }
;;;1043       if (srch_str_len == 0) {                                    /* If srch str len = 0, srch str equal NULL str; ...    */
;;;1044           pstr_srch_ix = (CPU_CHAR *)(pstr + str_len);            /* ... rtn ptr to NULL str found in str (see Note #2c). */
;;;1045           return (pstr_srch_ix);
;;;1046       }
;;;1047   
;;;1048       srch_len  = str_len - srch_str_len;                         /* Determine srch len (see Note #2d1).                  */
;;;1049       srch_ix   = 0;
;;;1050       srch_done = DEF_NO;
;;;1051       while ((srch_done == DEF_NO) && (srch_ix <= srch_len)) {
;;;1052           pstr_srch_ix = (CPU_CHAR *)(pstr + srch_ix);
;;;1053           srch_cmp1     =  Str_Cmp_N(pstr_srch_ix, psrch_str, srch_str_len);
;;;1054           srch_done    = (srch_cmp1 == 0) ? DEF_YES : DEF_NO;
;;;1055           srch_ix++;
;;;1056       }
;;;1057   
;;;1058   
;;;1059       if (srch_cmp1 != 0) {                                        /* If srch str NOT found, rtn NULL  (see Note #2d).     */
;;;1060           return ((CPU_CHAR *)0);
;;;1061       }
;;;1062   
;;;1063       return (pstr_srch_ix);                                      /* Rtn ptr to srch str found in str (see Note #2e).     */
;;;1064   }
000254  e8bde8bd          POP      {r4-r10,pc}
                  |L1.600|
000258  f1baf1ba          CMP      r10,#0                ;1033
00025c  d101              BNE      |L1.610|
00025e  2000              MOVS     r0,#0                 ;1034
000260  e7f8              B        |L1.596|
                  |L1.610|
000262  4630              MOV      r0,r6                 ;1038
000264  f7fff7ff          BL       Str_Len
000268  4604              MOV      r4,r0                 ;1038
00026a  4650              MOV      r0,r10                ;1039
00026c  f7fff7ff          BL       Str_Len
000270  4605              MOV      r5,r0                 ;1039
000272  42a5              CMP      r5,r4                 ;1040
000274  d901              BLS      |L1.634|
000276  2000              MOVS     r0,#0                 ;1041
000278  e7ec              B        |L1.596|
                  |L1.634|
00027a  b90d              CBNZ     r5,|L1.640|
00027c  1930              ADDS     r0,r6,r4              ;1044
00027e  e7e9              B        |L1.596|
                  |L1.640|
000280  1b67              SUBS     r7,r4,r5              ;1048
000282  2400              MOVS     r4,#0                 ;1049
000284  2100              MOVS     r1,#0                 ;1050
000286  f04ff04f          MOV      r9,#1                 ;1051
00028a  e00b              B        |L1.676|
                  |L1.652|
00028c  eb06eb06          ADD      r8,r6,r4              ;1052
000290  462a              MOV      r2,r5                 ;1053
000292  4651              MOV      r1,r10                ;1053
000294  4640              MOV      r0,r8                 ;1053
000296  f7fff7ff          BL       Str_Cmp_N
00029a  4603              MOV      r3,r0                 ;1053
00029c  4649              MOV      r1,r9                 ;1054
00029e  b103              CBZ      r3,|L1.674|
0002a0  2100              MOVS     r1,#0                 ;1054
                  |L1.674|
0002a2  1c64              ADDS     r4,r4,#1              ;1055
                  |L1.676|
0002a4  b909              CBNZ     r1,|L1.682|
0002a6  42bc              CMP      r4,r7                 ;1051
0002a8  d9f0              BLS      |L1.652|
                  |L1.682|
0002aa  b10b              CBZ      r3,|L1.688|
0002ac  2000              MOVS     r0,#0                 ;1060
0002ae  e7d1              B        |L1.596|
                  |L1.688|
0002b0  4640              MOV      r0,r8                 ;1063
0002b2  e7cf              B        |L1.596|
;;;1065   
                          ENDP

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -