⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pcb.h

📁 一个简单的虚拟机和虚拟操作系统
💻 H
字号:
#pragma once
#include "all.h"
#include<fstream>
using namespace std;
extern int mem[MEM_SIZE];

/*
 * process control block
 */
class PCB
{
public:
	PCB(int id = -1,int pri = PRI_MID,int state = STATE_READY);

public:	
	//process ID
	int ID;

/*
 * control information
 */
public:
	//process priority
	int PRI;
	//process state
	int STATE;
	//the event that the process is waiting for
	int EVENT;
	//run time
	int RUNTIME;
	//total run time
	int TOTALTIME;
	//waiting time
	int WAITTIME;
	//check whether the process is breaked
	bool BREAKED;
	//resourse
	int RES;

/*
 * CPU register information
 */
public:
	//common registers
	int R[24];
	//program counter registers
	int PC;
	//instruction register
	int IR[3];
	//this register records the the head address of the process  
	int PAR;
	//this register records the length of the process instruction section
	int PILR;
	//this register records the length of the process data section
	int PDLR;
	void output()
	{
		ofstream of;
		of.open("c:/a.txt",ios_base::out|ios_base::app);
		for(int i = this->PAR;i<PAR+PILR+PDLR;i++)
		of<<mem[i]<<endl;
	}
};

⌨️ 快捷键说明

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