亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? scoreboarddlg.cpp

?? 用VC實現的模擬指令發射流程的計分排算法實現
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// scoreboardDlg.cpp : implementation file
//

#include "stdafx.h"
#include "scoreboard.h"
#include "scoreboardDlg.h"
#include "myfile.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
void readcode();
struct Instruction{
	char* op;     //operation code;
	char* dest;   //the destination operand
	char* sour1;  //the first source operand
	char* sour2;  //the second soruce operand
    int   stage;  //register instruction current stage
	int   lasttime;//indaicates the next instrucion's location
	int	  exe_time;//the execuse time
	
} instruction[5];
struct StatusTable{
	bool busy;
	char*  op;
	char*  fi;
	char*  fj;
	char*  fk;
	int    qj;
	int    qk;
	bool   rj;
	bool   rk;
}statustable[Num_FU];

struct Floatreg{
	char * fi;
	int  num;
}floatreg[Num_Floatreg];


char clock1[5];
char *code[Num_instr_set]={"LD","MULTD","ADDD","SUBD","DIVD"};		
//the resulttable to record the float register where is it 
int resulttable[Num_Floatreg+1];


//void readcode();

bool CScoreboardDlg::testfinished()
{
	bool finished=false;
	int count=0;
	for(int i=0;i<Num_Instruc;i++){
		if(instruction[i].stage==WB)
			count++;
	}
	if(count==Num_Instruc)
		finished=true;
	return finished;
}
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
	CAboutDlg();

// Dialog Data
	//{{AFX_DATA(CAboutDlg)
	enum { IDD = IDD_ABOUTBOX };
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CAboutDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	//{{AFX_MSG(CAboutDlg)
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
	//{{AFX_DATA_INIT(CAboutDlg)
	//}}AFX_DATA_INIT
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAboutDlg)
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
	//{{AFX_MSG_MAP(CAboutDlg)
		// No message handlers
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CScoreboardDlg dialog

CScoreboardDlg::CScoreboardDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CScoreboardDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CScoreboardDlg)
	
	//}}AFX_DATA_INIT
	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CScoreboardDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CScoreboardDlg)
	DDX_Control(pDX, FU_LIST1, m_function);
	DDX_Control(pDX, Register_LIST2, m_register);
	DDX_Control(pDX, Instatus_LIST2, m_instatus);
	DDX_Control(pDX, Instruc_LIST1, m_instruction);
	DDX_Text(pDX, IDC_EDIT2, m_inttime);
	DDX_Text(pDX, IDC_EDIT3, m_addtime);
	DDX_Text(pDX, IDC_EDIT4, m_multime);
	DDX_Text(pDX, IDC_EDIT5, m_divtime);
	DDX_Text(pDX, IDC_EDIT1, m_clock);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CScoreboardDlg, CDialog)
	//{{AFX_MSG_MAP(CScoreboardDlg)
	ON_WM_SYSCOMMAND()
	ON_WM_PAINT()
	ON_WM_QUERYDRAGICON()
	ON_COMMAND(ID_open, Onopen)
	ON_COMMAND(ID_runauto, runauto)
	ON_COMMAND(ID_steprun, steprun)
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	ON_COMMAND(ID_MENUITEM32775, OnMenuitem32775)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CScoreboardDlg message handlers

BOOL CScoreboardDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	CFrameWnd::LoadFrame;

	// Add "About..." menu item to system menu.

	// IDM_ABOUTBOX must be in the system command range.
	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
	ASSERT(IDM_ABOUTBOX < 0xF000);

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		CString strAboutMenu;
		strAboutMenu.LoadString(IDS_ABOUTBOX);
		if (!strAboutMenu.IsEmpty())
		{
			pSysMenu->AppendMenu(MF_SEPARATOR);
			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
		}
	}

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);// Set small icon
		
	
    Start=false;
	stepinto=false;
	stepflag=false;
	clockcnt=0;
	m_clock=0;
	m_inttime=1;UpdateData(FALSE);
	m_addtime=2;UpdateData(FALSE);
	m_multime=10;UpdateData(FALSE);
	m_divtime=40;UpdateData(FALSE);

	initial();
	// TODO: Add extra initialization here
	//m_instruction.InsertColumn(0,"ID",LVCFMT_CENTER,45);
    m_instruction.InsertColumn(0,"指令",LVCFMT_CENTER,50);
    m_instruction.InsertColumn(1,"目的",LVCFMT_CENTER,50);
	m_instruction.InsertColumn(2,"源J",LVCFMT_CENTER,50);
	m_instruction.InsertColumn(3,"源K",LVCFMT_CENTER,50);

	m_instatus.InsertColumn(0,"ID",LVCFMT_CENTER,45);
	m_instatus.InsertColumn(1,"IS",LVCFMT_CENTER,45);
	m_instatus.InsertColumn(2,"RO",LVCFMT_CENTER,45);
	m_instatus.InsertColumn(3,"EX",LVCFMT_CENTER,45);
	m_instatus.InsertColumn(4,"WB",LVCFMT_CENTER,45);

	m_function.InsertColumn(0,"FU",LVCFMT_CENTER,50);
	m_function.InsertColumn(1,"busy",LVCFMT_CENTER,45);
	m_function.InsertColumn(2,"OP",LVCFMT_CENTER,45);
	m_function.InsertColumn(3,"Fi",LVCFMT_CENTER,40);
	m_function.InsertColumn(4,"Fj",LVCFMT_CENTER,40);
	m_function.InsertColumn(5,"Fk",LVCFMT_CENTER,40);
	m_function.InsertColumn(6,"Qj",LVCFMT_CENTER,50);
	m_function.InsertColumn(7,"Qk",LVCFMT_CENTER,50);
	m_function.InsertColumn(8,"Rj",LVCFMT_CENTER,45);
	m_function.InsertColumn(9,"Rk",LVCFMT_CENTER,45);

	m_function.InsertItem(0,"int");
    m_function.InsertItem(1,"mul");
    m_function.InsertItem(2,"add");
    m_function.InsertItem(3,"div");

	m_register.InsertColumn(0,"F0",LVCFMT_CENTER,45);
	m_register.InsertColumn(1,"F1",LVCFMT_CENTER,45);
	m_register.InsertColumn(2,"F2",LVCFMT_CENTER,45);
	m_register.InsertColumn(3,"F3",LVCFMT_CENTER,45);
	m_register.InsertColumn(4,"F4",LVCFMT_CENTER,45);
	m_register.InsertColumn(5,"F5",LVCFMT_CENTER,45);
	m_register.InsertColumn(6,"F6",LVCFMT_CENTER,45);
	m_register.InsertColumn(7,"F7",LVCFMT_CENTER,45);
    //m_register.SetItemText(1,0,"ok!");
	char display[40];
    /*for(int i=0;i<Num_Instruc;i++){
	   
	   m_instatus.InsertItem(i,::itoa(i,display,10));
	   
	}*/
   m_register.InsertItem(0,::itoa(0,display,10));
	for(int num=0;num<=10;num++)
	{
		m_register.SetItemText(0,num,_T("-1"));
	}
	
	return TRUE;  // return TRUE  unless you set the focus to a control

	

	
}

void CScoreboardDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
	if ((nID & 0xFFF0) == IDM_ABOUTBOX)
	{
		CAboutDlg dlgAbout;
		dlgAbout.DoModal();
	}
	else
	{
		CDialog::OnSysCommand(nID, lParam);
	}
}

// If you add a minimize button to your dialog, you will need the code below
//  to draw the icon.  For MFC applications using the document/view model,
//  this is automatically done for you by the framework.

void CScoreboardDlg::OnPaint() 
{
	if (IsIconic())
	{
		CPaintDC dc(this); // device context for painting

		SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

		// Center icon in client rectangle
		int cxIcon = GetSystemMetrics(SM_CXICON);
		int cyIcon = GetSystemMetrics(SM_CYICON);
		CRect rect;
		GetClientRect(&rect);
		int x = (rect.Width() - cxIcon + 1) / 2;
		int y = (rect.Height() - cyIcon + 1) / 2;

		// Draw the icon
		dc.DrawIcon(x, y, m_hIcon);
	}
	else
	{
		CDialog::OnPaint();
	}
}

// The system calls this to obtain the cursor to display while the user drags
//  the minimized window.
HCURSOR CScoreboardDlg::OnQueryDragIcon()
{
	return (HCURSOR) m_hIcon;
}


void CScoreboardDlg::Onopen() 
{
	// TODO: Add your command handler code here
	TCHAR* szSelections = NULL;

	CFileDialog FileDlg(true,"s",NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|
 		                OFN_ALLOWMULTISELECT,"scoreboard Files(*.s) |*.s|All Files(*.*) |*.*||",NULL);

    szSelections = new TCHAR[1000];
 	memset(szSelections,NULL,1000);
 	FileDlg.m_ofn.lpstrFile=szSelections;
 	FileDlg.m_ofn.nMaxFile = 1000;
	FileDlg.m_ofn.lpstrTitle = "please choose the source code ";
	if (FileDlg.DoModal()==IDOK)
	{
      PathName=FileDlg.GetPathName();
	}
	MessageBox(PathName);
    readcode();
	char display[40];
	int i;
	for(i=0;i<Num_Instruc;i++){
	m_instruction.InsertItem(i,::itoa(i,display,10));
	m_instruction.SetItemText(i,0,instruction[i].op);
	m_instruction.SetItemText(i,1,instruction[i].dest);
	m_instruction.SetItemText(i,2,instruction[i].sour1);
	m_instruction.SetItemText(i,3,instruction[i].sour2);
	
	} 	

}


int	CScoreboardDlg::determtime(char *str)
{
	int fu_unit=get_fu_number(str);//str point to the instruction's op field
	int time=0;
	switch (fu_unit)
	{
	case Int:	time=m_inttime;
		break;
	case Mult:	time=m_multime;
		break;
	case Addd:	time=m_addtime;
		break;
	case Divd:	 time=m_divtime;
		break;
	default:	time=0;
		break;
	}
	return	time;
}



void CScoreboardDlg::decode(char* str,struct Instruction *instr)
{
//	char ch;
	(*instr).op=new char[10];
	strcpy((*instr).op,"\0");
	(*instr).dest=new char[10];
	strcpy((*instr).dest,"\0");
	(*instr).sour1=new char[10];
	strcpy((*instr).sour1,"\0");
	(*instr).sour2=new char[10];
	strcpy((*instr).sour2,"\0");
	(*instr).stage=BEG;
	(*instr).lasttime=-1;
	(*instr).exe_time=0;

	char *temp=new char[10];
	int index=0;
	int i_temp=0,i_str=0,i_instr=0;
	while(str[i_str]!='\0'){
		if((str[i_str]!=9))			
			temp[i_temp++]=str[i_str++];
		else{
			i_str++;
			temp[i_temp]='\0';
			switch (index++){
			case 0:
				strcpy((*instr).op,temp);
				(*instr).exe_time=determtime(temp);
				break;
			case 1:
				strcpy((*instr).dest,temp);
				break;
			case 2:
				strcpy((*instr).sour1,temp);
				break;
			case 3:
				strcpy((*instr).sour2,temp);
				break;
			}
			i_temp=0;
		}
			
	}

}

void CScoreboardDlg::readcode()
{
	ifstream infile("code.s");
	if(!infile){
		MessageBox("open code file error!\n");
	}
	char* str=new char[100];	//to store a line
	char* remark=new char[100];	//to store the remark 
	int num=0;	//index opsition of a line 
	int num_instr=0;	//index the instruction array
	char ch;	//register the char 
	while(infile.get(ch)){
		if((ch!='\n')){
			if(ch==' ')
				continue;
			if(ch==',')
				ch=9;
			str[num++]=ch;	//make str only contain TAB as the interval;
		}else{
			str[num++]=9;	//add a \tab key;
			str[num]='\0';
			decode(str,&instruction[num_instr]);
			num_instr++;
			if(num_instr>Num_Instruc)
				return;
			num=0;		
		}	//a line have been sucessfully readed;
	}
}



void CScoreboardDlg::initial()
{
	for(int i=0;i<Num_Floatreg+1;i++)
		resulttable[i]=-1;

	for( i=0;i<Num_FU;i++)//initial the statustable array
	{
		statustable[i].busy=false;
		statustable[i].op=NULL;
		statustable[i].fi=NULL;
		statustable[i].fj=NULL;
		statustable[i].fk=NULL;
		statustable[i].qj=-1;
		statustable[i].qk=-1;
		statustable[i].rj=true;
		statustable[i].rk=true;
	}

	//initial the map of floatregister and number
	floatreg[0].fi="F0";floatreg[0].num=0; 
	floatreg[1].fi="F1";floatreg[1].num=1; 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
**欧美大码日韩| 手机精品视频在线观看| 欧美一区二区三区在线观看| 国产精品久久久久久亚洲毛片| 日本道免费精品一区二区三区| 日本不卡高清视频| 亚洲欧美乱综合| 怡红院av一区二区三区| 国产精品88av| 日本不卡免费在线视频| 亚洲色图在线视频| 亚洲特黄一级片| 久久99最新地址| 日韩av中文在线观看| 欧美国产精品一区二区三区| 日本美女一区二区三区| 一区二区三区美女视频| 色综合婷婷久久| 国产精品每日更新在线播放网址| 免费看欧美美女黄的网站| 色综合亚洲欧洲| 亚洲一区二区三区在线看| 99久久精品免费看国产免费软件| 奇米综合一区二区三区精品视频 | 精品国产乱码久久久久久老虎| 美国十次综合导航| 69堂精品视频| 亚洲自拍偷拍综合| 成人动漫一区二区在线| 国产精品免费av| 成人一区二区三区在线观看| 国产欧美一区二区精品性色超碰 | 精品视频在线视频| 久久福利视频一区二区| 亚洲精品一区二区精华| 精品一区二区三区免费观看| 亚洲日本丝袜连裤袜办公室| 国产精品伊人色| 国产精品久久久久7777按摩| 欧美亚洲国产一卡| 亚洲综合激情小说| 7777女厕盗摄久久久| 久久久一区二区三区捆绑**| 国产精品原创巨作av| 国产清纯美女被跳蛋高潮一区二区久久w | 亚洲h精品动漫在线观看| 在线日韩国产精品| 国产精品一卡二卡在线观看| 国产精品欧美极品| 欧洲激情一区二区| 国产精品一区二区男女羞羞无遮挡 | 精品免费日韩av| 成人午夜大片免费观看| 久久99九九99精品| 国产精品美女久久久久久久网站| 色综合久久久久综合| 久久国产福利国产秒拍| 国产日韩欧美不卡在线| 色婷婷久久久综合中文字幕| 国产麻豆成人传媒免费观看| 中文字幕制服丝袜成人av| 欧美精品在线视频| 91久久免费观看| 狠狠色综合日日| 自拍偷在线精品自拍偷无码专区| 久久久国产综合精品女国产盗摄| 欧美激情综合在线| 国产精品自在在线| 精品国产精品一区二区夜夜嗨| 欧美视频一区二区三区四区 | 欧美一级精品在线| 九九精品一区二区| 日韩电影一区二区三区四区| 国产一区二区三区在线观看免费| 欧美日韩国产在线观看| 欧美一区二区三区小说| 一区二区欧美视频| 日本三级亚洲精品| 国产激情偷乱视频一区二区三区| 日韩精品一区二区三区四区视频| 久久电影国产免费久久电影 | 精品国产不卡一区二区三区| 国产一区二区三区免费看| 免费观看在线综合| 91热门视频在线观看| 依依成人综合视频| 欧美午夜理伦三级在线观看| 亚洲素人一区二区| 欧美日韩精品一区二区| 韩国av一区二区| 久久精品国产一区二区三区免费看| 国产午夜精品一区二区三区嫩草 | 久久精品久久久精品美女| 中文字幕在线播放不卡一区| 69p69国产精品| 91精品在线免费| 在线观看av不卡| 国产成人亚洲精品青草天美| 一区二区在线观看不卡| 亚洲国产裸拍裸体视频在线观看乱了| 国产精品第五页| 国产欧美一二三区| 亚洲日本va在线观看| 国产精品亲子伦对白| 精品国产区一区| 欧美三级视频在线播放| 欧美电视剧免费全集观看| 欧美日韩一区二区在线观看 | 久久午夜老司机| 午夜视频一区二区| 日韩欧美国产一二三区| 99在线精品观看| 国产日韩欧美制服另类| 欧美高清精品3d| 欧美日韩在线播| 天天亚洲美女在线视频| 9i看片成人免费高清| 麻豆极品一区二区三区| 国产欧美日韩三级| 自拍视频在线观看一区二区| 日本午夜精品视频在线观看| 91香蕉视频在线| 天天综合色天天综合色h| 国产精品网站在线| 日韩视频在线你懂得| 国产一区二区久久| 91小视频免费看| 麻豆高清免费国产一区| 色综合天天综合网天天狠天天| 欧美一卡二卡在线观看| 777奇米四色成人影色区| 成人性色生活片免费看爆迷你毛片| 国产·精品毛片| 国产精品美女久久久久久2018 | 99免费精品视频| 91视频在线看| 91精品婷婷国产综合久久性色| 在线播放亚洲一区| 国产精品乱人伦| 亚洲综合色成人| 99麻豆久久久国产精品免费优播| 免费观看在线综合| 亚洲第一主播视频| 免费亚洲电影在线| 国产一区二区三区不卡在线观看 | 国模大尺度一区二区三区| 国产精品夫妻自拍| 亚洲免费资源在线播放| 91精品国产一区二区三区| 国产一区二区免费看| 亚洲高清免费观看高清完整版在线观看| 亚洲成a人片在线观看中文| 成人sese在线| 欧美久久久久久久久| 亚洲激情第一区| 一级日本不卡的影视| 97久久久精品综合88久久| 国产亚洲欧美色| 亚洲与欧洲av电影| 一本色道亚洲精品aⅴ| 91麻豆精品国产综合久久久久久| 一级精品视频在线观看宜春院| 日本美女一区二区三区视频| 色噜噜狠狠色综合中国| 久久这里只有精品6| 极品少妇一区二区三区精品视频| 欧美美女直播网站| 日韩毛片视频在线看| 99re成人精品视频| 日韩欧美国产高清| 久久爱www久久做| 色噜噜狠狠色综合中国| 免费欧美在线视频| 91麻豆精品国产自产在线观看一区| 国产拍揄自揄精品视频麻豆| 成人午夜激情影院| 久久九九99视频| 免费精品99久久国产综合精品| 综合在线观看色| 无码av免费一区二区三区试看| 欧美日韩免费电影| 国产成人亚洲精品青草天美| 国产精品免费aⅴ片在线观看| 欧美丰满美乳xxx高潮www| 视频一区在线视频| 欧美日韩三级一区二区| 精品午夜久久福利影院| 国产精品国产自产拍高清av王其| 久久视频一区二区| 久久精品99久久久| 亚洲大片精品永久免费| 久久综合久久综合九色| 久久久精品2019中文字幕之3| 日韩欧美激情四射| 99re视频精品| 777奇米四色成人影色区| 成人av资源下载| 亚洲综合在线电影| 久久久久久夜精品精品免费| 色婷婷精品大在线视频|