/***************************************************************************
**
**    $Header:   D:/ECB2S/SRC/LOG/C51ADR.H__   1.2.1.5   17 Apr 1997 15:42:44   ZJRD  $
**
**    $Log:   D:/ECB2S/SRC/LOG/C51ADR.H__  $
** 
**    Rev 1.2.1.5   17 Apr 1997 15:42:44   ZJRD
** No change.
** 
**    Rev 1.2.1.4   16 Apr 1997 10:17:20   ZJRD
** No change.
** 
**    Rev 1.2.1.3   10 Apr 1997 15:28:42   ZJRD
** 2.09F
** 
**    Rev 1.2.1.1   03 Apr 1997 15:10:10   ZJRD
** No change.
** 
**    Rev 1.2.1.0   28 Mar 1997 10:15:10   ZJRD
** easy pack sld 2.09d
** 
**    Rev 1.1   19 Mar 1997 11:26:24   ZJRD
** No change.
** 
**    Rev 1.0   12 Mar 1997 14:44:52   ZJRD
** Initial revision.
** 
**    Rev 1.7.1.0.1.2   09 Dec 1996 10:16:56   ZJRD
** EasyPack/SLD Version 2.0P
** 
**    Rev 1.7.1.0.1.0   11 Nov 1996 13:00:12   ZJRD
** EasyPack/SLD Version 2.01
** 
**    Rev 1.7.1.4   09 Sep 1996 13:20:18   ZJRD
** No change.
** 
**    Rev 1.7.1.3   05 Sep 1996 11:31:48   ZJRD
** No change.
** 
**    Rev 1.7.1.2   02 Sep 1996 09:58:54   ZJRD
** No change.
** 
**    Rev 1.7.1.1   28 Aug 1996 15:51:08   ZJRD
** No change.
** 
**    Rev 1.7.1.0   12 Aug 1996 10:54:54   ZJRD
** EasyPack/SLD Version 1.98
** 
**    Rev 1.5   05 Jun 1996 14:57:54   ZJRD
** No change.
** 
**    Rev 1.4   29 May 1996 09:34:46   ZJRD
** No change.
** 
**    Rev 1.3   16 May 1996 09:00:12   ZJRD
** No change.
** 
**    Rev 1.2   10 May 1996 09:16:46   ZJRD
** No change.
** 
**    Rev 1.1   02 May 1996 10:31:06   ZJRD
** EasyPack/SLD Version 1.92
** 
**    Rev 1.1   18 Apr 1996 12:56:20   Shirley
** EasyPack/SLD Version 1.91
** 
**    Rev 1.0   12 Apr 1996 10:35:52   Shirley
** Initial revision.
** 
****************************************************************************/

/****************************************************************************
**
**  Name:      C51adr.h
**
**  Description:  The sub class C51adr deprived from the CFormatAddress
**                This class is process the 51 base family address
**                51 base family address has the format as following
**                      prefix:address
**                prefix is the space area. Those are :
**                      p: program
**                      x: external
**                      i: internal
**                      b: bit area
**                      r: SFR
**                The address has two format: Hex and Dec
**                      Hex has the prefix before address that is 0x
**                      Dec has no prefix
**
**                Another : the address is a symbol. The symbol has the format
**                as following:
**                      #ModuleName#SymbolName etc.
**                The process must deal all the statment described as before.
**
**  Status: Initialization
**          1996/02/15        Daniel Lin
**
**  Copyright (C) 1996 Microtek International.  All rights reserved.
*****************************************************************************/

#ifndef __C51ADR__H
#define __C51ADR__H


class C51Address : CFormatAddress
{
   private:
      BOOL     IsString;               // Construct from a string;
 ADDR_RETCODE  m_enumRetCode;          // Return code

      // Attribute
      CString  m_strSpace;             // The address space text string,
                                       // 'p'-->'Program';
   ADDR_SPACE  m_enumSpace;            // The enum space

   private:
      // Implenmentation
      void  Initialize();                    // Initialize all attributes
      BOOL  Process(CFormatType *format);    // Process the address server

   public:
      //Constructor
      C51Address() {
      	Initialize();
      }
      
      C51Address(const CString& str);        // from CString
      C51Address(const LPSTR lpsz);          // from LPSTR
      C51Address(const CString& str, 
                 const UINT isHex);          // from CString
      C51Address(const LPSTR lpsz,
                 const UINT isHex);          // from LPSTR
      C51Address(ADDR_SIZE dw);              // from ADDR_SIZE
      C51Address(ADDRESS  adr);              // from ADDRESS struct
      //C51Address(const C51Address &c51adr);// copy constructor

      //Inline function
      CString GetHexAddr();
      CString GetDecAddr();
 ADDR_RETCODE GetRetCode();
 ADDR_SPACE   GetSpace();
 ADDR_SIZE    GetAddress();
 
      // virtual function deprived from parent class
      virtual BOOL  ConvertCheck();                  // Convert the address and
                                                     // check it

      virtual BOOL  SplitPrefix(const char* lpsz);   // Split the prefix and
                                                     // address
};

#endif

////////////////////////////////(EOF)////////////////////////////////////////
