instruction.h

来自「浙江大学的悟空嵌入式系统模拟器」· C头文件 代码 · 共 90 行

H
90
字号
/*
*  Copyright (c) 2005 Zhejiang University, P.R.China
*
*  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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ 
//=============================================================================
/**
*  \file    ARM/Instruction.h
*
*  $Id: Instruction.h,v 1.5 2005/06/16 11:26:27 qilj Exp $
*
*  \author    Jie Chen
*                 Lingjie Qi <lingjie_qi@163.com>
*/
//=============================================================================

#ifndef ARM__INSTRUCTION_H_INCLUDED
#define ARM__INSTRUCTION_H_INCLUDED

#include "Core/Instruction.h"
#include "Core/HelperMacro.h"
#include "Core/Memory.h"
#include "Core/Processor.h"
#include "Processor_7TDMI.h"
#include "MMU.h"


using namespace Core;
namespace ARM { 

	class Instruction : public Core::Instruction
	{
	protected:

		Instruction(){}
		Core::Register * get_cpsr();

		//! Executes the instruction
		virtual void execute(Core::Instruction_Unit   binary) = 0;

		//!rotate func
		void rotate_right(u32 &, int);

		void logical_left(u32 &, u32);

		void logical_right(u32 &, u32);

		void arithmetic_right(u32 & ,u32);

		void rotate_right_extend(u32 &, u32);

		void assign(Core::Register &, Core::u32 n, Core::u32 m, Core::u32 val);

		void assign_register(Core::Register &, Core::u32 n, Core::u32 m, Core::u32 val); 

		u32 immediate_generator(Core::Binary_32Bit & bits);

		u32 shift_imm_generator(Core::Binary_32Bit & bits);

		Core::u8 cond_code_;

		Core::Register *cpsr_;

		ARM_CPU * get_cpu(void);

		Core::MMU<Core::u32> *mmu_;

		//temp use
		static int version_num;

		PROHIBIT_COPY(Instruction)

	};
	//#include "Instruction_i.h"
} //namespace


#endif

⌨️ 快捷键说明

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