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

📄 extract.lst

📁 Philips LPC2138 Demo Application with Keil C
💻 LST
📖 第 1 页 / 共 2 页
字号:
ARM COMPILER V2.42,  extract                                                               27/03/06  10:45:49  PAGE 1   


ARM COMPILER V2.42, COMPILATION OF MODULE extract
OBJECT MODULE PLACED IN .\obj\extract.obj
COMPILER INVOKED BY: C:\Keil\ARM\BIN\CA.exe src\extract.c THUMB DEBUG PRINT(.\LST\EXTRACT.LST) TABS(4) OBJECT(.\obj\extr
                    -act.obj) 

stmt  level    source

    1          /*****************************************************************************\
    2          *              efs - General purpose Embedded Filesystem library              *
    3          *          --------------------- -----------------------------------          *
    4          *                                                                             *
    5          * Filename :  extract.c                                                       *
    6          * Description : This file contains functions to copy structures that get      *
    7          *               corrupted when using direct memory copy                       *
    8          *                                                                             *
    9          * This library is free software; you can redistribute it and/or               *
   10          * modify it under the terms of the GNU Lesser General Public                  *
   11          * License as published by the Free Software Foundation; either                *
   12          * version 2.1 of the License, or (at your option) any later version.          *
   13          *                                                                             *
   14          * This library is distributed in the hope that it will be useful,             *
   15          * but WITHOUT ANY WARRANTY; without even the implied warranty of              *
   16          * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU           *
   17          * Lesser General Public License for more details.                             *
   18          *                                                                             *
   19          *                                                    (c)2005 Michael De Nil   *
   20          *                                                    (c)2005 Lennart Yseboodt *
   21          \*****************************************************************************/
   22          
   23          /*****************************************************************************/
   24          #include "extract.h"
   25          /*****************************************************************************/
   26          
   27          /*****************************************************************************/
   28          #ifdef BYTE_ALIGNMENT
               /*****************************************************************************/
               
               euint16 ex_getb16(euint8* buf,euint32 offset)
               {
                   return(ltb_end16(*((euint16*)(buf+offset))));
               }
               /*****************************************************************************/
               
               euint32 ex_getb32(euint8* buf,euint32 offset)
               {
                   return(ltb_end32(*((euint32*)(buf+offset))));
               }
               /*****************************************************************************/
               
               void ex_setb16(euint8* buf,euint32 offset,euint16 data)
               {
                   *((euint16*)(buf+offset)) = btl_end16(data);
               }
               /*****************************************************************************/
               
               void ex_setb32(euint8* buf,euint32 offset,euint32 data)
               {
                   *((euint32*)(buf+offset)) = btl_end32(data);
               }
               /*****************************************************************************/
               
               void ex_getPartitionField(euint8* buf,PartitionField* pf, euint32 offset)
               {
                   *pf=*((PartitionField*)(buf+offset));
               }
ARM COMPILER V2.42,  extract                                                               27/03/06  10:45:49  PAGE 2   

               /*****************************************************************************/
               
               void ex_setPartitionField(euint8* buf,PartitionField* pf, euint32 offset)
               {
               
               }
               /*****************************************************************************/
               
               
               
               
               /*****************************************************************************/
               /*****************************************************************************/
               #else
   73          /*****************************************************************************/
   74          /*****************************************************************************/
   75          
   76          
   77          
   78          euint16 ex_getb16(euint8* buf,euint32 offset)
   79          {
   80   1          return(ltb_end16(((*(buf+offset+1))<<8) + ((*(buf+offset+0))<<0)));
   81   1      }
   82          /*****************************************************************************/
   83          
   84          euint32 ex_getb32(euint8* buf,euint32 offset)
   85          {
   86   1          return(ltb_end32(((euint32)buf[offset+3]<<24)+
   89   1                ((euint32)buf[offset+2]<<16)+
   89   1                ((euint32)buf[offset+1]<<8)+
   89   1                ((euint32)buf[offset+0]<<0)));
   90   1      }
   91          /*****************************************************************************/
   92          
   93          void ex_setb16(euint8* buf,euint32 offset,euint16 data)
   94          {
   95   1      #ifdef BIG_ENDIAN
                   *(buf+offset+1) = data>>0;
                   *(buf+offset+0) = data>>8;
               #else
   99   1          *(buf+offset+0) = data>>0;
  100   1          *(buf+offset+1) = data>>8;
  101   1      #endif
  102   1      }
  103          /*****************************************************************************/
  104          
  105          void ex_setb32(euint8* buf,euint32 offset,euint32 data)
  106          {
  107   1      #ifdef BIG_ENDIAN
                   *(buf+offset+3) = data>> 0;
                   *(buf+offset+2) = data>> 8;
                   *(buf+offset+1) = data>>16;
                   *(buf+offset+0) = data>>24;
               #else
  113   1          *(buf+offset+0) = data>> 0;
  114   1          *(buf+offset+1) = data>> 8;
  115   1          *(buf+offset+2) = data>>16;
  116   1          *(buf+offset+3) = data>>24;
  117   1      #endif
  118   1      }
  119          /*****************************************************************************/
  120          
  121          void ex_getPartitionField(euint8* buf,PartitionField* pf, euint32 offset)
  122          {
  123   1          pf->bootFlag       = *(buf + offset);
  124   1          pf->CHS_begin[0]   = *(buf + offset + 1);
ARM COMPILER V2.42,  extract                                                               27/03/06  10:45:49  PAGE 3   

  125   1          pf->CHS_begin[1]   = *(buf + offset + 2);
  126   1          pf->CHS_begin[2]   = *(buf + offset + 3);
  127   1          pf->type           = *(buf + offset + 4);
  128   1          pf->CHS_end[0]     = *(buf + offset + 5);
  129   1          pf->CHS_end[1]     = *(buf + offset + 6);
  130   1          pf->CHS_end[2]     = *(buf + offset + 7);
  131   1          pf->LBA_begin      = ex_getb32(buf + offset,8);
  132   1          pf->numSectors     = ex_getb32(buf + offset,12);
  133   1      }
  134          /*****************************************************************************/
  135          
  136          void ex_setPartitionField(euint8* buf,PartitionField* pf, euint32 offset)
  137          {
  138   1      
  139   1      }
*** WARNING C47 IN LINE 136 OF SRC\EXTRACT.C: 'buf': unreferenced parameter
*** WARNING C47 IN LINE 136 OF SRC\EXTRACT.C: 'pf': unreferenced parameter
*** WARNING C47 IN LINE 136 OF SRC\EXTRACT.C: 'offset': unreferenced parameter
  140          /*****************************************************************************/
  141          
  142          
  143          
  144          /*****************************************************************************/
  145          #endif
  146          /*****************************************************************************/
  147          
ARM COMPILER V2.42,  extract                                                               27/03/06  10:45:49  PAGE 4   

ASSEMBLY LISTING OF GENERATED OBJECT CODE



*** PUBLICS:
 PUBLIC         ex_getb16?T
 PUBLIC         ex_setb16?T
 PUBLIC         ex_getb32?T
 PUBLIC         ex_setb32?T
 PUBLIC         ex_getPartitionField?T
 PUBLIC         ex_setPartitionField?T



*** CODE SEGMENT '?PR?ex_getb16?T?extract':
   78: euint16 ex_getb16(euint8* buf,euint32 offset)
 00000000  B410      PUSH        {R4}
 00000002  1C0C      MOV         R4,R1 ; offset
 00000004  ---- Variable 'offset' assigned to Register 'R4' ----
 00000004  1C03      MOV         R3,R0 ; buf
 00000006  ---- Variable 'buf' assigned to Register 'R3' ----
   80:     return(ltb_end16(((*(buf+offset+1))<<8) + ((*(buf+offset+0))<<0)));
 00000006  1C21      MOV         R1,R4 ; offset
 00000008  1C18      MOV         R0,R3 ; buf
 0000000A  5C40      LDRB        R0,[R0,R1]
 0000000C  1C02      MOV         R2,R0
 0000000E  1C21      MOV         R1,R4 ; offset
 00000010  1C18      MOV         R0,R3 ; buf
 00000012  1840      ADD         R0,R1 ; buf
 00000014  7840      LDRB        R0,[R0,#0x1]
 00000016  0200      LSL         R0,R0,#0x8
 00000018  1880      ADD         R0,R2
   81: }
 0000001A  BC10      POP         {R4}
 0000001C  4770      BX          R14
 0000001E          ENDP ; 'ex_getb16?T'


*** CODE SEGMENT '?PR?ex_getb32?T?extract':
   84: euint32 ex_getb32(euint8* buf,euint32 offset)
 00000000  B410      PUSH        {R4}
 00000002  ---- Variable 'offset' assigned to Register 'R1' ----
 00000002  1C03      MOV         R3,R0 ; buf
 00000004  ---- Variable 'buf' assigned to Register 'R3' ----
   86:     return(ltb_end32(((euint32)buf[offset+3]<<24)+
 00000004  1C0A      MOV         R2,R1 ; offset
 00000006  3202      ADD         R2,#0x2
 00000008  1C18      MOV         R0,R3 ; buf
 0000000A  5C80      LDRB        R0,[R0,R2]
 0000000C  1C02      MOV         R2,R0
 0000000E  0412      LSL         R2,R2,#0x10

⌨️ 快捷键说明

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