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

📄 main.cc

📁 一个mips虚拟机非常好代码,使用C++来编写的,希望大家多学学,
💻 CC
字号:
// U4600 LCD Module// Matt Chapman <matthewc@cse.unsw.edu.au>#include <stdio.h>#include <string.h>#include <assert.hh>#include "lcd.hh"// Serialization information.SerialType<U4600_LCD> U4600_LCD::type(    "U4600_LCD",    "U4600 LCD Module");// Runtime constructor.U4600_LCD::U4600_LCD(const SimArgs& args)    : Module(args), Device(8){    if (args.length() > 2)	throw Error("Too many arguments to \"sim::install U4600_LCD\".");}// Serialized constructor.U4600_LCD::U4600_LCD(Checkpoint& cp)    : Module(cp), Device(8){}// Module interface.voidU4600_LCD::reset(bool warm){    for (int i = 0; i < 4; i++)	lcd_contents[i] = ' ';}// Serialization interface.voidU4600_LCD::checkpoint(Checkpoint& cp, bool parent) const{}voidU4600_LCD::show_lcd(){    log("%c%c%c%c", lcd_contents[3], lcd_contents[2], lcd_contents[1], lcd_contents[0]);}ClockValueU4600_LCD::read(UInt64 addr, UInt64* buf, int size){    unsigned int offset = addr & 3;    *buf = lcd_contents[offset];    return 0; // ignore latency}ClockValueU4600_LCD::write(UInt64 addr, const UInt64* buf, int size){    unsigned int offset = addr & 3;    lcd_contents[offset] = *buf;    show_lcd();    return 0; // ignore latency}

⌨️ 快捷键说明

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