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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? scoreboarddlg.cpp

?? 用VC實現(xiàn)的模擬指令發(fā)射流程的計分排算法實現(xiàn)
?? 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; 

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一个色在线综合| 国产在线视视频有精品| 久久老女人爱爱| 精品视频在线免费| 91豆麻精品91久久久久久| 99精品久久只有精品| 国产黄人亚洲片| 国内精品久久久久影院一蜜桃| 亚洲成人av福利| 亚洲va欧美va国产va天堂影院| 欧美一区二区三区思思人| 欧美精品乱码久久久久久| 欧美日韩精品一区二区天天拍小说| 日本精品一区二区三区四区的功能| 91免费视频网| 欧美性猛交xxxx乱大交退制版| 欧美在线啊v一区| 欧美日韩一区不卡| 欧美群妇大交群的观看方式| 欧美年轻男男videosbes| 国产精品1区2区| 成人福利视频网站| 一本一道综合狠狠老| 91久久一区二区| 在线播放国产精品二区一二区四区| 精品视频一区二区不卡| 欧美一区二区视频在线观看 | 色综合久久综合网97色综合| 91麻豆高清视频| 另类欧美日韩国产在线| 国产美女精品在线| 99精品一区二区| 欧美亚州韩日在线看免费版国语版| 在线电影院国产精品| 精品蜜桃在线看| 一区在线观看视频| 亚洲一区二区视频| 久久精品国产99国产精品| 高清国产午夜精品久久久久久| aaa亚洲精品| 国产麻豆一精品一av一免费| 成人国产视频在线观看| 欧美日韩一区二区三区不卡| 欧美成人r级一区二区三区| 国产精品久久夜| 五月天欧美精品| 国产成人av电影| 欧美私模裸体表演在线观看| 精品国产三级电影在线观看| 亚洲欧洲韩国日本视频| 五月天一区二区三区| 国产高清视频一区| 欧美亚洲动漫精品| 日本一区二区电影| 午夜欧美一区二区三区在线播放| 国产福利一区二区三区| 国产日韩欧美激情| 久久99精品国产麻豆不卡| 久久综合视频网| 色婷婷精品大在线视频| 久久久久久久一区| 99riav一区二区三区| 亚洲国产岛国毛片在线| 99综合影院在线| 亚洲精品视频在线观看网站| 国产午夜精品美女毛片视频| 99国产精品久| 天天综合天天综合色| 精品乱人伦小说| 久久99精品久久久久久动态图| 欧美日韩久久久一区| 爽好多水快深点欧美视频| 91福利视频网站| 成人免费高清视频| 日韩美女视频一区二区| 色婷婷亚洲综合| 在线播放欧美女士性生活| 日韩精品乱码av一区二区| 欧美日韩在线精品一区二区三区激情 | 欧美激情资源网| 国产欧美一区视频| 成人三级伦理片| 国产东北露脸精品视频| 亚洲免费观看高清完整版在线 | 欧美日韩日日夜夜| 国产精品麻豆久久久| 久久久不卡影院| 日韩av成人高清| 欧美三级韩国三级日本三斤| 中文字幕中文字幕一区二区| 国产精品99久久久久| 欧美一区二区国产| 亚洲一区二区不卡免费| 91蜜桃免费观看视频| 一区二区三区免费看视频| 欧美成人免费网站| 一级日本不卡的影视| 精品一区免费av| 欧美一区二区在线看| 日韩成人免费在线| 欧美精品v国产精品v日韩精品| 亚洲一区在线看| 欧洲一区在线观看| 一区二区三区在线影院| 91麻豆国产香蕉久久精品| 日韩美女视频一区二区| www.亚洲色图| 亚洲国产精品av| 不卡av在线免费观看| 国产精品九色蝌蚪自拍| 成人免费福利片| 亚洲免费色视频| 色噜噜久久综合| 亚洲国产精品一区二区www| 色激情天天射综合网| 一区二区三区资源| 欧美天堂亚洲电影院在线播放| 亚洲一本大道在线| 91麻豆精品国产91久久久资源速度 | www久久精品| 国产盗摄一区二区三区| 国产日产欧美一区| 99久久精品免费观看| 一区二区三区日本| 欧美理论电影在线| 美女视频网站久久| 久久青草国产手机看片福利盒子| 黄页视频在线91| 中文在线一区二区| 欧美主播一区二区三区| 欧美成人精品二区三区99精品| 国产精品中文有码| 中文字幕一区三区| 91蜜桃视频在线| 免费在线观看一区二区三区| 91丨九色porny丨蝌蚪| 亚洲国产成人av网| 欧美一级高清片| 成人精品视频网站| 一区二区三区免费在线观看| 欧美一区二区三区白人| 国产成人精品亚洲日本在线桃色| 国产精品嫩草影院av蜜臀| 欧美视频一区在线| 激情成人综合网| 亚洲黄色尤物视频| 欧美不卡一二三| 色综合久久99| 麻豆精品一区二区综合av| 国产精品每日更新| 91 com成人网| 成人午夜激情影院| 丝袜美腿亚洲色图| 国产亚洲精品aa| 欧美男生操女生| 成人激情小说乱人伦| 亚洲va中文字幕| 国产精品日韩成人| 欧美精品成人一区二区三区四区| 豆国产96在线|亚洲| 日韩精品三区四区| 国产精品福利一区二区三区| 欧美高清视频不卡网| 成人av网址在线| 人人超碰91尤物精品国产| 国产精品三级电影| 日韩欧美国产1| 色素色在线综合| 国产九九视频一区二区三区| 亚洲二区在线观看| 亚洲欧洲精品一区二区精品久久久| 欧美色图一区二区三区| 国产精品自在欧美一区| 日韩精品久久久久久| 亚洲日本在线观看| 久久夜色精品国产噜噜av| 欧美日韩一级大片网址| 99精品国产91久久久久久| 国产一区二区视频在线| 亚洲成人免费电影| 欧美高清在线精品一区| 日韩一级大片在线观看| 欧美中文字幕久久| 91在线免费播放| 国产精品亚洲午夜一区二区三区| 日韩精品成人一区二区三区| 亚洲丝袜制服诱惑| 国产精品私人影院| 久久亚洲一区二区三区四区| 正在播放一区二区| 欧美日韩午夜在线| 91麻豆123| 不卡视频一二三| 国产91在线观看丝袜| 国产在线不卡一卡二卡三卡四卡| 琪琪久久久久日韩精品| 丝袜脚交一区二区| 天天亚洲美女在线视频| 亚洲一二三四区不卡| 亚洲一区二区三区四区五区中文|