/*
Copyright (C) 2006 - 2009 Evan Teran
                   eteran@alum.rit.edu

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#ifndef SIB_20070530_H_
#define SIB_20070530_H_

#include "edisassm_types.h"

class SIB {
public:
	SIB(uint8_t value) : m_Value(value) {}
	SIB(const SIB &other) : m_Value(other.m_Value) {}
	SIB &operator=(const SIB &rhs) { m_Value = rhs.m_Value; return *this;}
private:
	union {
		struct {
		uint8_t Base  : 3,
				Index : 3,
				Scale : 2;
		} m_Bits;

		uint8_t m_Value;
	};
public:	
	uint8_t base() const	{ return m_Bits.Base; }
	uint8_t index() const	{ return m_Bits.Index; }
	uint8_t scale() const	{ return m_Bits.Scale; }
};

#endif

