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

📄 uart.lst

📁 使用于克隆器
💻 LST
字号:
C51 COMPILER V7.50   UART                                                                  07/03/2006 14:17:04 PAGE 1   


C51 COMPILER V7.50, COMPILATION OF MODULE UART
OBJECT MODULE PLACED IN ..\..\OUTPUT\NTSC_SOUTH\Uart.obj
COMPILER INVOKED BY: d:\Keil\C51\BIN\C51.EXE ..\..\KERNEL\Uart.c OPTIMIZE(9,SIZE) BROWSE ORDER INCDIR(..\..\INC\;..\..\U
                    -I\NTSC_SOUTH\) DEFINE(PABLO,MCU_MTV412M,OLGA) DEBUG OBJECTEXTEND PRINT(..\..\OUTPUT\NTSC_SOUTH\Uart.lst) OBJECT(..\..\OU
                    -TPUT\NTSC_SOUTH\Uart.obj)

line level    source

   1          /******************************************************************************
   2           Copyright (c) 2003 MStar Semiconductor, Inc.
   3           All rights reserved.
   4          
   5           [Module Name]: Uart.c
   6           [Date]:        04-Nov-2003
   7           [Comment]:
   8             Uart subroutines.
   9           [Reversion History]:
  10          *******************************************************************************/
  11          
  12          #define _UART_C_
  13          
  14          // System
  15          #include <intrins.h>
  16          
  17          // Common
  18          #include "define.h"
  19          #include "mcu.h"
  20          #include "global.h"
  21          #include "userdef.h"
  22          // External
  23          
  24          // Internal
  25          #include "uart.h"
  26          
  27          
  28          //////////////////////////////////////////////////////////////
  29          // Put character to uart
  30          //
  31          // Arguments: ucVal - output character
  32          //////////////////////////////////////////////////////////////
  33          #if (_DEBUG_RW_REG_EN_||_DEBUG_PRINT_EN_)
  34          void putchar(BYTE ucVal)
  35          {
  36   1          //EA = 0; // disable all interrupt
  37   1          ES = 0;
  38   1      
  39   1          SBUF = ucVal; // transfer to uart
  40   1          // wait transfer completing
  41   1          while (1)
  42   1          {
  43   2              if (TI)
  44   2                  break;
  45   2          } // check flag
  46   1          TI = 0; // clear flag
  47   1          //ES = 1;
  48   1          ES = 1;                      // enable uart interrupt
  49   1          //EA = 1; // release all interrupt
  50   1      }
  51          #endif
  52          
  53          //////////////////////////////////////////////////////////////////////////////
C51 COMPILER V7.50   UART                                                                  07/03/2006 14:17:04 PAGE 2   

  54          // Put string to uart.
  55          //
  56          // Arguments: pFmt - string address
  57          //////////////////////////////////////////////////////////////////////////////
  58          #if (_DEBUG_PRINT_EN_)
  59          void putstr(BYTE code* pFmt)
  60          {
  61   1          BYTE ucBff; // character buffer
  62   1      
  63   1          while (1)
  64   1          {
  65   2              ucBff = *pFmt; // get a character
  66   2              if (ucBff == _EOS_) // check end of string
  67   2                  break;
  68   2      
  69   2              putchar(ucBff); // put a character
  70   2      
  71   2              pFmt++; // next
  72   2          } // while
  73   1      }
  74          #else
              void putstr(BYTE code* pFmt)
              {
                  pFmt = pFmt;
              }
              #endif
  80          
  81          //////////////////////////////////////////////////////////////////////////////
  82          // Put string to uart with variable argument
  83          //
  84          // Arguments: pFmt - string address
  85          //            wVal - print variable
  86          //////////////////////////////////////////////////////////////////////////////
  87          #if (_DEBUG_PRINT_EN_)
  88          void printf(BYTE code* pFmt, WORD wVal)
  89          {
  90   1          BYTE ucBff, ucDisp;
  91   1          BOOL bNotZero = FALSE, bHex = FALSE;
  92   1          WORD wDivider = 10000;
  93   1      
  94   1          while (ucBff = *(pFmt++))
  95   1          {
  96   2              if (ucBff == '%') // check special case
  97   2              {
  98   3                  switch (*(pFmt++)) // check next character
  99   3                  {
 100   4                      case 'x': // hexadecimal number
 101   4                      case 'X':
 102   4                          wDivider = 0x1000;
 103   4                          bHex = TRUE;
 104   4                      case 'd': // decimal number
 105   4                      case 'i':
 106   4                          if (wVal)
 107   4                          {
 108   5                              while (wDivider)
 109   5                              {
 110   6                                  ucDisp = wVal / wDivider;
 111   6                                  wVal -= ucDisp * wDivider;
 112   6                                  if (ucDisp)
 113   6                                      bNotZero = TRUE;
 114   6      
 115   6                                  if (bNotZero)
C51 COMPILER V7.50   UART                                                                  07/03/2006 14:17:04 PAGE 3   

 116   6                                  {
 117   7                                      if (ucDisp > 9)
 118   7                                          putchar(ucDisp + 55);
 119   7                                      else
 120   7                                          putchar(ucDisp + 0x30);
 121   7                                  }
 122   6      
 123   6                                  if (bHex)
 124   6                                      wDivider /= 0x10;
 125   6                                  else
 126   6                                      wDivider /= 10;
 127   6                              }
 128   5                          }
 129   4                          else
 130   4                              putchar('0');
 131   4                          break;
 132   4                  } // switch
 133   3              }
 134   2              else // general
 135   2                  putchar(ucBff); // put a character
 136   2          } // while
 137   1      }
 138          #else
              void printf(BYTE code* pFmt, WORD wVal)
              {
                  pFmt = pFmt;
                  wVal = wVal;
              }
              #endif
 145          


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =    248    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =     18    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----       9
   IDATA SIZE       =   ----    ----
   BIT SIZE         =      4    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

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