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

📄 timer.cc

📁 一个mips虚拟机非常好代码,使用C++来编写的,希望大家多学学,
💻 CC
字号:
#include "koala.hh"SerialType<Koala::Timer> Koala::Timer::type(    "Koala::Timer");Koala::Timer::Timer(Checkpoint& cp)    : Serializable(cp), Event(cp){    SerialID cid = extract<SerialID>(cp);    cpu = dynamic_cast<Koala *>(find_object(cid));    if (!cpu)	throw Checkpoint::SyntaxError(cp, "%d is not a Koala module ID", cid);}voidKoala::Timer::invoke(){    cpu->deliver_interrupt(5);}voidKoala::Timer::checkpoint(Checkpoint& cp, bool parent) const{    if (parent)	cp << type << ' ' << id << '\n';    Event::checkpoint(cp);    cp << cpu->id << '\n';}voidKoala::set_timer(){    if (timer != NULL)    {	remove(timer);	delete timer;    }    timer = new Timer(this, now + (cp0[Compare] - (cp0[Count] + ((now - count_seed) / 2))) * 2);    insert(timer);}

⌨️ 快捷键说明

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