当前位置: 首页 > article >正文

自制虚拟机(C/C++)(二、分析引导扇区,虚拟机读二进制文件img软盘)

先修复上一次的bug,添加新指令,并增加图形界面

#include <graphics.h>
#include <conio.h>
#include <windows.h>
#include <commdlg.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <unordered_map>
#include <algorithm>
#include <thread>
#include <mutex>
#include <functional>
#include <vector>
#include <string>
#include <map>void VM(const std::string& file);
// 虚拟机配置结构体
struct VMConfig {std::string name;std::string asmPath;
};// 全局配置存储
std::map<std::string, VMConfig> vmConfigs;
const char* CONFIG_FILE = "vm.dll";// 图形界面尺寸参数
const int WIDTH = 800;
const int HEIGHT = 600;
const int BTN_WIDTH = 200;
const int BTN_HEIGHT = 40;// 当前操作状态
enum class AppState {MAIN_MENU,CREATE_VM,OPEN_VM,SETTINGS
};
AppState currentState = AppState::MAIN_MENU;char vmNameInput[64] = {0};
char asmPathInput[256] = {0};// 初始化图形界面
void InitGUI() {initgraph(WIDTH, HEIGHT);setbkcolor(WHITE);cleardevice();settextcolor(BLACK);settextstyle(30, 0, "宋体");
}// 保存配置到文件
void SaveConfig() {std::ofstream fout(CONFIG_FILE);for (auto it = vmConfigs.begin(); it!= vmConfigs.end(); ++it) {fout << it->first << std::endl;fout << it->second.asmPath << std::endl;}fout.close();
}// 加载配置文件
void LoadConfig() {vmConfigs.clear();std::ifstream fin(CONFIG_FILE);std::string name, path;while (std::getline(fin, name) && std::getline(fin, path)) {vmConfigs[name] = {name, path};}fin.close();
}// 绘制主界面
void DrawMainMenu() {cleardevice();// 绘制标题settextcolor(BLUE);outtextxy(100, 50, "VMwork 虚拟机");// 绘制按钮setfillcolor(LIGHTGRAY);// 新建虚拟机按钮fillroundrect(300, 150, 300 + BTN_WIDTH, 150 + BTN_HEIGHT, 5, 5);outtextxy(330, 155, "新建虚拟机");// 打开虚拟机按钮fillroundrect(300, 250, 300 + BTN_WIDTH, 250 + BTN_HEIGHT, 5, 5);outtextxy(330, 255, "打开虚拟机");// 设置按钮fillroundrect(300, 350, 300 + BTN_WIDTH, 350 + BTN_HEIGHT, 5, 5);outtextxy(350, 355, "设置");
}// 文件选择对话框封装
std::string SelectFile() {OPENFILENAMEA ofn;char szFile[260] = {0};ZeroMemory(&ofn, sizeof(ofn));ofn.lStructSize = sizeof(ofn);ofn.lpstrFile = szFile;ofn.nMaxFile = sizeof(szFile);ofn.lpstrFilter = "ASM Files (*.asm)\0*.asm\0All Files (*.*)\0*.*\0";ofn.nFilterIndex = 1;ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;if (GetOpenFileNameA(&ofn)) {return szFile;}return "";
}// 输入框处理函数
bool InputBox(const char* title, char* buffer, int bufferSize) {char prompt[10] = "";// 这里直接调用 easyx 的 InputBox 函数,按照其参数要求传递return InputBox(buffer, bufferSize, prompt, title); 
}// 创建虚拟机流程
void CreateVMProcess() {// 第一步:选择ASM文件std::string asmPath = SelectFile();if (asmPath.empty()) return;// 第二步:输入虚拟机名称if (!InputBox("输入虚拟机名称", vmNameInput, sizeof(vmNameInput))) return;// 保存配置vmConfigs[vmNameInput] = {vmNameInput, asmPath};SaveConfig();}void OpenVMProcess() {LoadConfig();// 创建选择列表cleardevice();settextcolor(BLACK);outtextxy(50, 50, "选择虚拟机:");// 绘制虚拟机列表int y = 100;for (auto it = vmConfigs.begin(); it!= vmConfigs.end(); ++it) {std::string text = it->first + " (" + it->second.asmPath + ")";outtextxy(100, y, text.c_str());y += 50;}// 等待用户选择int choice = 0;while (true) {if (MouseHit()) {MOUSEMSG msg = GetMouseMsg();if (msg.uMsg == WM_LBUTTONDOWN) {int clickY = msg.y;int index = 0;for (auto it = vmConfigs.begin(); it!= vmConfigs.end(); ++it) {int itemTop = 100 + index * 40;if (clickY > itemTop && clickY < itemTop + 50) {choice = index + 1;break;}index++;}}}if (choice!= 0) break;}// 启动选定虚拟机if (choice > 0 && choice <= vmConfigs.size()) {auto it = vmConfigs.begin();std::advance(it, choice - 1);std::string selectedAsmPath = it->second.asmPath;VM(selectedAsmPath);}
}void SetVMProcess() {LoadConfig();cleardevice();cleardevice();settextcolor(BLACK);outtextxy(30, 50, "虚拟机");outtextxy(50, 90, "处理器  : 1");outtextxy(50, 130, "内存    : 64KB");outtextxy(50, 170,"启动方式: 软盘");outtextxy(50, 210,"光盘    : 无");outtextxy(50, 250,"BIOS    : VMwork");outtextxy(50, 290,"方式    : .ASM");while(1) {}}// 主消息循环
void MainLoop() {AppState prevState = AppState::MAIN_MENU; while (true) {if (MouseHit()) {MOUSEMSG msg = GetMouseMsg();if (msg.uMsg == WM_LBUTTONDOWN) {// 主界面按钮处理if (currentState == AppState::MAIN_MENU) {if (msg.x > 300 && msg.x < 300 + BTN_WIDTH) {if (msg.y > 150 && msg.y < 150 + BTN_HEIGHT) {CreateVMProcess();} else if (msg.y > 250 && msg.y < 250 + BTN_HEIGHT) {OpenVMProcess();} else if (msg.y > 350 && msg.y < 350 + BTN_HEIGHT) {SetVMProcess(); }}}}}switch (currentState) {case AppState::MAIN_MENU:if (prevState!= AppState::MAIN_MENU) {//cleardevice();}DrawMainMenu();break;case AppState::CREATE_VM:if (prevState!= AppState::CREATE_VM) {//cleardevice();}DrawMainMenu();break;case AppState::OPEN_VM:if (prevState!= AppState::OPEN_VM) {//cleardevice();}DrawMainMenu();break;case AppState::SETTINGS:if (prevState!= AppState::SETTINGS) {//cleardevice();}DrawMainMenu();break;}prevState = currentState;Sleep(30);}
}// 寄存器声明
unsigned char al = 0, ah = 0, bl = 0, bh = 0, cl = 0, ch = 0, dl = 0, dh = 0, si = 0;
unsigned short ax = 0, bx = 0, cx = 0, dx = 0, sp = 0x8000, bp = 0;
unsigned int org = 0, end_times = 0, end_AA55 = 0;
bool ZF = false, CF = false, SF = false; // 标志寄存器// 标签和指令指针
std::unordered_map<std::string, size_t> labels;
size_t current_line = 0;
size_t new_current_line;
std::vector<std::string> program_lines;// 内存模拟
std::vector<unsigned char> memory(0x10000, 0); // 64KB内存std::mutex fileMutex;
std::ifstream file;// 线程函数,用于读取文件
void readFile(const std::string& filename) {std::ifstream localFile(filename, std::ios::binary);if (localFile.is_open()) {const size_t bufferSize = 4096; // 每块读取4KB,可以根据需要调整char buffer[bufferSize];std::string currentLine;while (localFile.read(buffer, bufferSize)) {for (size_t i = 0; i < localFile.gcount(); ++i) {if (buffer[i] == '\n') {size_t commentPos = currentLine.find(';');if (commentPos!= std::string::npos) {currentLine = currentLine.substr(0, commentPos);}while (!currentLine.empty() && std::isspace(currentLine.front())) {currentLine.erase(currentLine.begin());}while (!currentLine.empty() && std::isspace(currentLine.back())) {currentLine.erase(currentLine.length() - 1);}if (!currentLine.empty()) {std::lock_guard<std::mutex> lock(fileMutex);program_lines.push_back(currentLine);}currentLine.clear();} else {currentLine += buffer[i];}}}// 处理剩余的行size_t commentPos = currentLine.find(';');if (commentPos!= std::string::npos) {currentLine = currentLine.substr(0, commentPos);}while (!currentLine.empty() && std::isspace(currentLine.front())) {currentLine.erase(currentLine.begin());}while (!currentLine.empty() && std::isspace(currentLine.back())) {currentLine.erase(currentLine.length() - 1);}if (!currentLine.empty()) {std::lock_guard<std::mutex> lock(fileMutex);program_lines.push_back(currentLine);}localFile.close();} else {std::cerr << "无法打开文件" << std::endl;}
}// 图形输出参数
int textX = 0;
int textY = 48;
const int CHAR_WIDTH = 8;
const int LINE_HEIGHT = 16;
bool graphicsInitialized = false;// 指令解析错误枚举
enum class InstructionError {INVALID_OPCODE,INVALID_OPERAND,LABEL_NOT_FOUND,UNKNOWN_INTERRUPT,OTHER_ERROR
};// 输出错误信息到终端
void printError(const InstructionError& error, const std::string& details = "") {std::cerr << "ERROR: ";switch (error) {case InstructionError::INVALID_OPCODE:std::cerr << "无效的操作码";break;case InstructionError::INVALID_OPERAND:std::cerr << "无效的操作数";break;case InstructionError::LABEL_NOT_FOUND:std::cerr << "标签未找到";break;case InstructionError::UNKNOWN_INTERRUPT:std::cerr << "未知的中断号";break;case InstructionError::OTHER_ERROR:std::cerr << "其他错误";break;}if (!details.empty()) {std::cerr << " - " << details;}std::cerr << std::endl;
}int parseImmediate(const std::string& immediateStr) {std::string result;bool inQuote = false;char quoteChar = '\0';for (size_t i = 0; i < immediateStr.size(); ++i) {const char c = immediateStr[i];if (c == '\'' || c == '"') {if (!inQuote) {inQuote = true;quoteChar = c;result += c;} else if (c == quoteChar) {inQuote = false;result += c;} else {result += c;}} else if (inQuote) {// 直接将引号内的字符添加到结果中,包括空格result += c;} else if (!std::isspace(c)) {// 非空格且不在引号内,将字符添加到结果中result += c;} else if (i > 0 &&!std::isspace(result.back())) {// 如果前一个字符不是空格,添加当前字符以保留中间的空格result += c;}}// 去除结果字符串两端可能残留的空格while (!result.empty() && std::isspace(result.front())) {result.erase(result.begin());}while (!result.empty() && std::isspace(result.back())) {result.erase(result.length() - 1);}if (result.empty()) return 0;if (result.length() == 3 && result[0] == '\'' && result[2] == '\'') {return static_cast<int>(result[1]);}else if (result.find("0x") == 0) {try {return std::stoi(result.substr(2), nullptr, 16);} catch (const std::invalid_argument& e) {throw std::invalid_argument("无效的十六进制立即数:" + result);} catch (const std::out_of_range& e) {throw std::out_of_range("十六进制立即数超出范围:" + result);}}else if (result.back() == 'h') {try {return std::stoi(result.substr(0, result.length() - 1), nullptr, 16);} catch (const std::invalid_argument& e) {throw std::invalid_argument("无效的十六进制立即数(以h结尾):" + result);} catch (const std::out_of_range& e) {throw std::out_of_range("十六进制立即数(以h结尾)超出范围:" + result);}}else {try {return std::stoi(result);} catch (const std::invalid_argument& e) {throw std::invalid_argument("无效的立即数:" + result);} catch (const std::out_of_range& e) {throw std::out_of_range("立即数超出范围:" + result);}}
}std::unordered_map<std::string, unsigned char*>& createRegister8BitMap() {static std::unordered_map<std::string, unsigned char*> map = {{"al", &al}, {"ah", &ah}, {"bl", &bl}, {"bh", &bh},{"cl", &cl}, {"ch", &ch}, {"dl", &dl}, {"dh", &dh},{"si", &si}};return map;
}std::unordered_map<std::string, unsigned short*>& createRegister16BitMap() {static std::unordered_map<std::string, unsigned short*> map = {{"ax", &ax}, {"bx", &bx}, {"cx", &cx}, {"dx", &dx},{"sp", &sp}, {"bp", &bp}};return map;
}void UpdateTextPosition() {textX += CHAR_WIDTH;if (textX > 620) {textX = 20;textY += LINE_HEIGHT;}if (textY + LINE_HEIGHT > 480) {cleardevice();textX = 0;textY = 0;}
}void MovInstruction(const std::string& line) {std::string processedLine = line;std::replace(processedLine.begin(), processedLine.end(), ',', ' ');std::istringstream iss(processedLine);std::string opcode, dest, src;iss >> opcode >> dest >> src;auto& reg8 = createRegister8BitMap();auto& reg16 = createRegister16BitMap();auto parseOperand = [&](const std::string& op) -> int {if (reg8.count(op)) return *reg8[op];if (reg16.count(op)) return *reg16[op];return parseImmediate(op);};int value = parseOperand(src);if (reg8.count(dest)) {*reg8[dest] = static_cast<unsigned char>(value);}else if (reg16.count(dest)) {*reg16[dest] = static_cast<unsigned short>(value);}
}// add指令处理函数
void AddInstruction(const std::string& line) {std::string processedLine = line;std::replace(processedLine.begin(), processedLine.end(), ',', ' ');std::istringstream iss(processedLine);std::string opcode, dest, src;iss >> opcode >> dest >> src;auto& reg8 = createRegister8BitMap();auto& reg16 = createRegister16BitMap();auto parseOperand = [&](const std::string& op) -> int {if (reg8.count(op)) return *reg8[op];if (reg16.count(op)) return *reg16[op];return parseImmediate(op);};int val1 = parseOperand(dest);int val2 = parseOperand(src);int result = val1 + val2;if (reg8.count(dest)) {*reg8[dest] = static_cast<unsigned char>(result);}else if (reg16.count(dest)) {*reg16[dest] = static_cast<unsigned short>(result);}ZF = (result == 0);SF = (result < 0);CF = (static_cast<unsigned>(result) < static_cast<unsigned>(val1));
}// sub指令处理函数
void SubInstruction(const std::string& line) {std::string processedLine = line;std::replace(processedLine.begin(), processedLine.end(), ',', ' ');std::istringstream iss(processedLine);std::string opcode, dest, src;iss >> opcode >> dest >> src;auto& reg8 = createRegister8BitMap();auto& reg16 = createRegister16BitMap();auto parseOperand = [&](const std::string& op) -> int {if (reg8.count(op)) return *reg8[op];if (reg16.count(op)) return *reg16[op];return parseImmediate(op);};int val1 = parseOperand(dest);int val2 = parseOperand(src);int result = val1 - val2;if (reg8.count(dest)) {*reg8[dest] = static_cast<unsigned char>(result);}else if (reg16.count(dest)) {*reg16[dest] = static_cast<unsigned short>(result);}ZF = (result == 0);SF = (result < 0);CF = (static_cast<unsigned>(val1) < static_cast<unsigned>(val2));
}// inc指令处理函数
void IncInstruction(const std::string& line) {std::istringstream iss(line);std::string opcode, operand;iss >> opcode >> operand;auto& reg8 = createRegister8BitMap();auto& reg16 = createRegister16BitMap();if (reg8.count(operand)) {*reg8[operand] += 1;ZF = (*reg8[operand] == 0);SF = (*reg8[operand] < 0);}else if (reg16.count(operand)) {*reg16[operand] += 1;ZF = (*reg16[operand] == 0);SF = (*reg16[operand] < 0);}
}void CmpInstruction(const std::string& line) {std::string processedLine = line;std::replace(processedLine.begin(), processedLine.end(), ',', ' ');std::istringstream iss(processedLine);std::string opcode, op1, op2;iss >> opcode >> op1 >> op2;auto& reg8 = createRegister8BitMap();auto& reg16 = createRegister16BitMap();auto parseOperand = [&](const std::string& op) -> int {if (reg8.count(op)) return *reg8[op];if (reg16.count(op)) return *reg16[op];return parseImmediate(op);};int val1 = parseOperand(op1);int val2 = parseOperand(op2);int result = val1 - val2;ZF = (result == 0);SF = (result < 0);CF = (static_cast<unsigned>(val1) < static_cast<unsigned>(val2));
}void JmpInstruction(const std::string& line) {std::istringstream iss(line);std::string opcode, label;iss >> opcode >> label;if (labels.count(label)) {new_current_line = labels[label];} else {printError(InstructionError::LABEL_NOT_FOUND, "JMP指令中的标签: " + label);}
}void JeInstruction(const std::string& line) {std::istringstream iss(line);std::string opcode, label;iss >> opcode >> label;if (ZF) {if (labels.count(label)) {new_current_line = labels[label];} else {printError(InstructionError::LABEL_NOT_FOUND, "JE指令中的标签: " + label);}} else {new_current_line = current_line + 1;}
}void JneInstruction(const std::string& line) {std::istringstream iss(line);std::string opcode, label;iss >> opcode >> label;if (!ZF) {if (labels.count(label)) {new_current_line = labels[label];} else {printError(InstructionError::LABEL_NOT_FOUND, "JNE指令中的标签: " + label);}} else {new_current_line = current_line + 1;}
}void PushInstruction(const std::string& line) {std::istringstream iss(line);std::string opcode, src;iss >> opcode >> src;auto& reg16 = createRegister16BitMap();unsigned short value = reg16.count(src)? *reg16[src] : parseImmediate(src);sp -= 2;memory[sp] = value & 0xFF;memory[sp + 1] = (value >> 8) & 0xFF;
}void PopInstruction(const std::string& line) {std::istringstream iss(line);std::string opcode, dest;iss >> opcode >> dest;auto& reg16 = createRegister16BitMap();if (reg16.count(dest)) {*reg16[dest] = memory[sp] | (memory[sp + 1] << 8);sp += 2;}
}void XorInstruction(const std::string& line) {std::string processedLine = line;std::replace(processedLine.begin(), processedLine.end(), ',', ' ');std::istringstream iss(processedLine);std::string opcode, dest, src;iss >> opcode >> dest >> src;auto& reg8 = createRegister8BitMap();auto& reg16 = createRegister16BitMap();auto parseOperand = [&](const std::string& op) -> int {if (reg8.count(op)) return *reg8[op];if (reg16.count(op)) return *reg16[op];return parseImmediate(op);};int val1 = parseOperand(dest);int val2 = parseOperand(src);int result = val1 ^ val2;if (reg8.count(dest)) {*reg8[dest] = static_cast<unsigned char>(result);}else if (reg16.count(dest)) {*reg16[dest] = static_cast<unsigned short>(result);}ZF = (result == 0);SF = (result < 0);CF = false;
}void PreprocessLabels() {for (size_t i = 0; i < program_lines.size(); ++i) {std::string line = program_lines[i];std::istringstream iss(line);std::string address;if (iss >> address) {// 去除地址中的冒号address.erase(std::remove(address.begin(), address.end(), ':'), address.end());labels[address] = i;}size_t colonPos = line.find(':');if (colonPos!= std::string::npos) {std::string label = line.substr(0, colonPos);labels[label] = i;program_lines[i] = line.substr(colonPos + 1);std::cout << "Label found: " << label << " at line " << i << std::endl;}}
}void IntInstruction(const std::string& line) {std::string processedLine = line;std::replace(processedLine.begin(), processedLine.end(), ',', ' ');std::istringstream iss(processedLine);std::string opcode, interrupt;iss >> opcode >> interrupt;if (interrupt == "0x10" || interrupt == "10h") {if (ah == 0x0E) {if (!graphicsInitialized) {initgraph(640, 480);HWND hwnd = GetHWnd();SetWindowPos(hwnd, HWND_TOP, 100, 100, 0, 0, SWP_NOSIZE);setbkcolor(BLACK);cleardevice();settextcolor(CYAN);settextstyle(16, 0, _T("Courier New Bold"));graphicsInitialized = true;outtextxy(textX, 0, "  VMwork BIOS (PCI)");outtextxy(textX, 16, "  This VGA/VBE BIOS is released under the GNU LGPL");settextcolor(RGB(192, 192, 192));}// 处理特殊字符if (al == 0x0D) {outtextxy(textX, textY, " ");textY += LINE_HEIGHT;}else if (al == 0x0A) {outtextxy(textX, textY, " ");textX = 0;}else {char str[2] = { static_cast<char>(al) };outtextxy(textX, textY, " ");outtextxy(textX, textY, str);UpdateTextPosition();outtextxy(textX, textY, "|");}}if (ah == 0x02 && bh == 0) {textX = 0;textY = 0;}if (ax == 0x0600 && bx == 0x0700 && cx == 0 && dx == 0x184f) {setfillcolor(BLACK);bar(0, 0, 640, 480);}}else if (interrupt == "0x16" || interrupt == "16h") {if (ah == 0) {while (true) {if (_kbhit()) {al = _getch();break;}}}}else {printError(InstructionError::UNKNOWN_INTERRUPT, "未知的中断号: " + interrupt);}
}void CallInstruction(const std::string& line) {std::vector<std::string> tokens;std::istringstream iss(line);std::string token;while (iss >> token) {tokens.push_back(token);}if (tokens.size() < 2) {printError(InstructionError::INVALID_OPERAND, "CALL指令缺少操作数");return;}std::string label = tokens.back();if (labels.count(label)) {// 压入返回地址(当前行号的下一条指令)unsigned short return_line = current_line + 1;sp -= 2;memory[sp] = return_line & 0xFF;memory[sp + 1] = (return_line >> 8) & 0xFF;new_current_line = labels[label];} else {printError(InstructionError::LABEL_NOT_FOUND, "CALL指令中的标签: " + label);}
}void OrgInstruction(const std::string& line) {std::string processedLine = line;std::replace(processedLine.begin(), processedLine.end(), ',', ' ');std::istringstream iss(processedLine);std::string opcode, interrupt;iss >> opcode >> interrupt;if (interrupt == "0x7c00" || interrupt == "0x7C00") {org = 0x7c00;} else {printError(InstructionError::INVALID_OPERAND, "ORG指令的操作数无效: " + interrupt);}
}void TimesInstruction(const std::string& line) {std::string processedLine = line;std::replace(processedLine.begin(), processedLine.end(), ',', ' ');std::istringstream iss(processedLine);std::string opcode, interrupt;iss >> opcode >> interrupt;if (interrupt == "510-($-$$) db 0" || interrupt == "510-($-$$)") {end_times = 1;} else {printError(InstructionError::INVALID_OPERAND, "TIMES指令的操作数无效: " + interrupt);}
}void DwInstruction(const std::string& line) {std::string processedLine = line;std::replace(processedLine.begin(), processedLine.end(), ',', ' ');std::istringstream iss(processedLine);std::string opcode, interrupt;iss >> opcode >> interrupt;if (interrupt == "0xAA55" || interrupt == "0xaa55") {end_AA55 = 1;} else {printError(InstructionError::INVALID_OPERAND, "DW指令的操作数无效: " + interrupt);}
}void VM(const std::string& asmPath) {std::ifstream file(asmPath);if (!file.is_open()) {std::cerr << "无法打开文件: " << asmPath << std::endl;return;}std::string line;while (std::getline(file, line)) {size_t commentPos = line.find(';');if (commentPos!= std::string::npos) {line = line.substr(0, commentPos);}// 去除行首尾的空白字符while (!line.empty() && std::isspace(line.front())) {line.erase(line.begin());}while (!line.empty() && std::isspace(line.back())) {line.erase(line.length() - 1);}if (!line.empty()) {program_lines.push_back(line);}}file.close();for (auto& progLine : program_lines) {for (size_t i = 0; i < progLine.size(); ++i) {if (i < progLine.size() - 2 && progLine[i] == '\'' && progLine[i + 1] ==' ' && progLine[i + 2] == '\'') {progLine[i] = static_cast<char>(0x20);progLine.erase(i + 1, 2);  // 移除后面的空格和单引号}if (i < progLine.size() - 2 && progLine[i] == '\'' && progLine[i + 1] ==':' && progLine[i + 2] == '\'') {progLine[i] = '3';progLine[i + 1] = 'A';progLine[i + 2] = 'h';}if (i < progLine.size() - 2 && progLine[i] == '\'' && progLine[i + 1] ==',' && progLine[i + 2] == '\'') {progLine[i] = '2';progLine[i + 1] = 'C';progLine[i + 2] = 'h';}if (i < progLine.size() - 2 && progLine[i] == '\'' && progLine[i + 1] =='_' && progLine[i + 2] == '\'') {progLine[i] = '5';progLine[i + 1] = 'F';progLine[i + 2] = 'h';}}}PreprocessLabels();// 重置指令指针和新的指令指针new_current_line = current_line;while (current_line < program_lines.size()) {std::istringstream iss(program_lines[current_line]);std::string opcode;iss >> opcode;if (opcode == "mov") MovInstruction(program_lines[current_line]);else if (opcode == "int") IntInstruction(program_lines[current_line]);else if (opcode == "org") OrgInstruction(program_lines[current_line]);else if (opcode == "times") TimesInstruction(program_lines[current_line]);else if (opcode == "dw") DwInstruction(program_lines[current_line]);else if (opcode == "cmp") CmpInstruction(program_lines[current_line]);else if (opcode == "jmp") {std::string label;iss >> label;// 处理相对跳转地址表示法,假设这里的相对跳转是相对于当前行号(根据实际情况调整)if (label.find("0x") == 0) {try {size_t targetAddress = std::stoi(label.substr(2), nullptr, 16);// 如果找到地址标签,更新当前行号if (labels.count(label)) {new_current_line = labels[label];} else {// 处理相对地址size_t relativeAddress = targetAddress - (current_line - labels.begin()->second);new_current_line = current_line + relativeAddress;}} catch (const std::invalid_argument& e) {printError(InstructionError::LABEL_NOT_FOUND, "JMP指令中的非法地址标签: " + label);} catch (const std::out_of_range& e) {printError(InstructionError::LABEL_NOT_FOUND, "JMP指令中的地址标签超出范围: " + label);}} else {JmpInstruction(program_lines[current_line]);}}else if (opcode == "je" || opcode == "jz") JeInstruction(program_lines[current_line]);else if (opcode == "jne" || opcode == "jnz") JneInstruction(program_lines[current_line]);else if (opcode == "push") PushInstruction(program_lines[current_line]);else if (opcode == "pop") PopInstruction(program_lines[current_line]);else if (opcode == "xor") XorInstruction(program_lines[current_line]);else if (opcode == "call") CallInstruction(program_lines[current_line]);else if (opcode == "add") AddInstruction(program_lines[current_line]);else if (opcode == "sub") SubInstruction(program_lines[current_line]);else if (opcode == "inc") IncInstruction(program_lines[current_line]);if (opcode == "jmp" || opcode == "je" || opcode == "jne") {current_line = new_current_line;}else {current_line++;}new_current_line = current_line + 1; }if (graphicsInitialized) {_getch();//closegraph();}
}int main() {InitGUI();LoadConfig();MainLoop();closegraph();system("pause");return 0;
}

要反汇编软盘操作系统,就要用到ndisasm

这个工具在下载nasm时附带了

kernel.asm操作系统内核

org 0x7c00start:mov bp, 0x8000mov sp, bp.print:mov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'H'int 0x10mov al, 'a'int 0x10mov al, 'n'int 0x10mov al, 'O'int 0x10mov al, 'S'int 0x10mov al, '>'int 0x10mov al, '>'int 0x10.wait_input:mov ah, 0x00int 0x16cmp al, 'c'je .check_input_c1cmp al, 'e'je .check_input_ecmp al, 'p'je .check_input_6.pycmp al, '.'je .check_input_pycmp al, 'l'je .check_input_lcmp al, 0x0Dje .bad_inputmov ah, 0x0Eint 0x10jmp .wait_input.check_input_l:mov ah, 0x0Eint 0x10mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 's'jne .wait_inputmov ah, 0x00int 0x16cmp al, 0x0Djne .wait_inputmov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'p'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 'P'int 0x10mov al, 'Y'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '1'int 0x10mov al, '2'int 0x10mov al, 'B'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'o'int 0x10mov al, 's'int 0x10mov al, ' 'int 0x10mov al, 'S'int 0x10mov al, 'Y'int 0x10mov al, 'S'int 0x10mov al, ' 'int 0x10mov al, '1'int 0x10mov al, '4'int 0x10mov al, '4'int 0x10mov al, '0'int 0x10mov al, 'K'int 0x10mov al, 'B'int 0x10jmp .print.check_input_py:mov ah, 0x0Eint 0x10mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, '\'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'p'jne .wait_inputmov ah, 0x00int 0x16cmp al, 0x0Djne .wait_inputmov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '6'int 0x10mov al, '6'int 0x10mov al, '6'int 0x10jmp .print.check_input_e:mov ah, 0x0Eint 0x10mov ah, 0x00int 0x16cmp al, 0x0Djne .wait_inputMOV AL,0x13MOV AH,0x00INT 0x10jmp .done.check_input_c1:mov ah, 0x0Eint 0x10mov ah, 0x00int 0x16cmp al, 0x0Djne .wait_input
.bad_input:mov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'b'int 0x10mov al, 'a'int 0x10mov al, 'd'int 0x10jmp .print
.done:retjmp .done.check_input_6.py:mov ah, 0x0Eint 0x10mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, '.'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'p'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'y'jne .wait_inputmov ah, 0x00int 0x16cmp al, 0x0Djne .wait_inputmov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'p'int 0x10mov al, 'r'int 0x10mov al, 'i'int 0x10mov al, 'n'int 0x10mov al, 't'int 0x10mov al, '('int 0x10mov al, '"'int 0x10mov al, '6'int 0x10mov al, '6'int 0x10mov al, '6'int 0x10mov al, '"'int 0x10mov al, ')'int 0x10jmp .printtimes 510-($-$$) db 0
dw 0xAA55

toasm.py用于转换标准nasm

import re
import sys
import chardetdef process_files(input_file_path, output_file_path):# 探测原始文件的编码with open(input_file_path, 'rb') as f:result = chardet.detect(f.read())encoding = result['encoding']pattern = re.compile(r'^([0-9A-Fa-f]{8})\s+([0-9A-Fa-f ]+)\s+(.*)$')with open(input_file_path, 'r', encoding=encoding) as input_file, open(output_file_path, 'w',encoding='utf - 8') as output_file:for line in input_file:line = line.rstrip()if match := pattern.match(line):addr_str, _, instr = match.groups()addr = int(addr_str, 16)output_file.write(f"0x{addr:x}:\n")output_file.write(f"{instr}\n")else:output_file.write(line + "\n")if __name__ == "__main__":if len(sys.argv)!= 3:print("Usage: python script_name.py input_file output_file")sys.exit(1)input_file_path = sys.argv[1]output_file_path = sys.argv[2]process_files(input_file_path, output_file_path)

接下来

nasm kernel.asm -o os.img

os.img是完整的操作系统,可以VMware运行

反汇编

.\ndisasm 123.img > os.img.asm
python toasm.py os.img.asm os.asm

可能需要

pip intall chardet

 编译

g++ main.cpp -o VMwork -std=c++11 -leasyx -lcomdlg32

 双击VMwork.exe

新建虚拟机选择os.asm

打开虚拟机

 运行成功

接下来移植我们以前自制的操作系统HanOS

 


; TAB=4[INSTRSET "i486p"]mov ah, 0x00mov al, 0x03 ; 80x25 文本模式int 0x10; 设置矩形的起始坐标和大小mov dh, 0 ; 矩形上边的 y 坐标mov dl, 0 ; 矩形左边的 x 坐标mov bh, 0  ; 页面号mov cx, 0  ; 矩形的宽度和高度mov cl, 10  ; 宽度mov ch, 10  ; 高度; 绘制矩形
draw_rect:; 设置光标位置mov ah, 0x02int 0x10; 设置矩形颜色mov ah, 0x09mov al, ' ' ; 空格字符mov bl, 0x04 ; 使用预设的蓝色int 0x10add dl, 1loop draw_rectmov ah, 02hxor bh, bhmov dh, 0mov dl, 0int 10hjmp .start.wait_input3:mov ah, 0x00int 0x16cmp al, 0x0Dje .errormov ah, 0x0Eint 0x10jmp .wait_input3.wait_input4:mov ah, 0x00int 0x16cmp al, 0x0Dje .errormov ah, 0x0Emov al, '*'int 0x10jmp .wait_input4.error:mov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'E'int 0x10mov al, 'R'int 0x10mov al, 'R'int 0x10mov al, 'O'int 0x10mov al, 'R'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10jmp .check_input_pass
.start:mov si, 0mov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '`'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '"'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, ' 'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '('int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ')'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, '\'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ','int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, '\'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '/'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10.check_input_pass:mov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '/'int 0x10mov al, '-'int 0x10mov al, '-'int 0x10mov al, '-'int 0x10mov al, '\'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '/'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, '\'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '('int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, 'p'int 0x10mov al, 'a'int 0x10mov al, 's'int 0x10mov al, 's'int 0x10mov al, 'w'int 0x10mov al, 'o'int 0x10mov al, 'r'int 0x10mov al, 'd'int 0x10mov al, '|'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '|'int 0x10mov al, '-'int 0x10mov al, '-'int 0x10mov al, '-'int 0x10mov al, '-'int 0x10mov al, '-'int 0x10mov al, '-'int 0x10mov al, '-'int 0x10mov al, '-'int 0x10mov al, '-'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '/'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 'a'int 0x10mov al, 'd'int 0x10mov al, 'm'int 0x10mov al, 'i'int 0x10mov al, 'n'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'A'int 0x10mov al, 'D'int 0x10mov al, 'M'int 0x10mov al, 'I'int 0x10mov al, 'N'int 0x10mov al, ':'int 0x10mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'l'jne .wait_input3mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'i'jne .wait_input3mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'n'jne .wait_input3mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'h'jne .wait_input3mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'o'jne .wait_input3mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'n'jne .wait_input3mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'g'jne .wait_input3mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'h'jne .wait_input3mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'a'jne .wait_input3mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'n'jne .wait_input3mov ah, 0x00int 0x16cmp al, 0x0Djne .wait_input3mov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'P'int 0x10mov al, 'A'int 0x10mov al, 'S'int 0x10mov al, 'S'int 0x10mov al, 'W'int 0x10mov al, 'O'int 0x10mov al, 'R'int 0x10mov al, 'D'int 0x10mov al, ':'int 0x10mov ah, 0x00int 0x16cmp al, '6'mov ah, 0x0Emov al, '*'int 0x10jne .wait_input4mov ah, 0x00int 0x16cmp al, '6'mov ah, 0x0Emov al, '*'int 0x10jne .wait_input4mov ah, 0x00int 0x16cmp al, '6'mov ah, 0x0Emov al, '*'int 0x10jne .wait_input4mov ah, 0x00int 0x16cmp al, '6'mov ah, 0x0Emov al, '*'int 0x10jne .wait_input4mov ah, 0x00int 0x16cmp al, '6'mov ah, 0x0Emov al, '*'int 0x10jne .wait_input4mov ah, 0x00int 0x16cmp al, '6'mov ah, 0x0Emov al, '*'int 0x10jne .wait_input4mov ah, 0x00int 0x16cmp al, 0x0Dmov ah, 0x0Emov al, '*'int 0x10jne .wait_input4_start:; 初始化文本模式视频mov ah, 0x00mov al, 0x03 ; 80x25 文本模式int 0x10; 设置矩形的起始坐标和大小mov dh, 0 ; 矩形上边的 y 坐标mov dl, 0 ; 矩形左边的 x 坐标mov bh, 0  ; 页面号mov cx, 0  ; 矩形的宽度和高度mov cl, 10  ; 宽度mov ch, 10  ; 高度; 绘制矩形draw_rect1:; 设置光标位置mov ah, 0x02int 0x10; 设置矩形颜色mov ah, 0x09mov al, ' ' ; 空格字符mov bl, 0x1E ; 使用预设的蓝色int 0x10add dl, 1loop draw_rect1mov ah, 0x0Emov al, 'H'int 0x10mov al, 'a'int 0x10mov al, 'n'int 0x10mov al, 'O'int 0x10mov al, 'S'int 0x10mov al, ' 'int 0x10mov al, 'B'int 0x10mov al, 'I'int 0x10mov al, 'O'int 0x10mov al, 'S'int 0x10mov dh, 23 ; 矩形上边的 y 坐标mov dl, 43 ; 矩形左边的 x 坐标mov bh, 0  ; 页面号mov cx, 0  ; 矩形的宽度和高度mov cl, 1  ; 宽度mov ch, 1  ; 高度; 绘制矩形draw_rect2:; 设置光标位置mov ah, 0x02int 0x10; 设置矩形颜色mov ah, 0x09mov al, ' ' ; 空格字符mov bl, 0xF0 ; 使用预设的蓝色int 0x10; 更新坐标并绘制下一个字符add dl, 1loop draw_rect2start:mov ah, 02hxor bh, bhmov dh, 0mov dl, 0int 10hmov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '`'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '"'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, ' 'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '('int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ')'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, '\'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ','int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, '\'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '/'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10.print:mov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'H'int 0x10mov al, 'a'int 0x10mov al, 'n'int 0x10mov al, 'O'int 0x10mov al, 'S'int 0x10mov al, '/'int 0x10inc cxcmp cx, 5je _startcmp si, 1je .ccmp si, 2je .dcmp si, 6je .cSystemmov al, '>'int 0x10mov al, '>'int 0x10.wait_input:mov ah, 0x00int 0x16cmp al, 'c'je .check_input_c1cmp al, 'e'je .check_input_ecmp al, 'p'je .check_input_print.pycmp al, '.'je .check_input_.cmp al, 'l'je .check_input_lcmp al, 'W'je .check_input_WiFicmp al, 'O'je .OScmp al, 'w'je .writercmp al, 'R'je .READMEcmp al, 'h'je .helpcmp al, 0x0Dje .bad_inputmov ah, 0x0Eint 0x10jmp .wait_input.wait_input2:mov ah, 0x00int 0x16cmp al, 0x0Dje .bad_inputmov ah, 0x0Emov al, '*'int 0x10jmp .wait_input2.c:mov al, 'C'int 0x10mov al, ':'int 0x10mov al, '/'int 0x10mov al, '>'int 0x10mov al, '>'int 0x10jmp .wait_input.cSystem:mov al, 'C'int 0x10mov al, ':'int 0x10mov al, '/'int 0x10mov al, 'S'int 0x10mov al, 'y'int 0x10mov al, 's'int 0x10mov al, 't'int 0x10mov al, 'e'int 0x10mov al, 'm'int 0x10mov al, '>'int 0x10mov al, '>'int 0x10jmp .wait_input.d:mov al, 'D'int 0x10mov al, ':'int 0x10mov al, '/'int 0x10mov al, '>'int 0x10mov al, '>'int 0x10jmp .wait_input.check_input_.:mov ah, 0x0Eint 0x10cmp si, 6jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, '\'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'O'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'S'jne .wait_inputmov ah, 0x00int 0x16cmp al, 0x0Djne .wait_inputmov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '`'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '"'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, ' 'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '('int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ')'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, '\'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ','int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, '\'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '/'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10jmp .print.check_input_l:mov ah, 0x0Eint 0x10mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 's'jne .wait_inputmov ah, 0x00int 0x16cmp al, 0x0Djne .wait_inputcmp si, 0je .check_input_l0cmp si, 1je .check_input_l1cmp si, 6je .check_input_l6cmp si, 2je .check_input_l2.check_input_l0:mov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'P'int 0x10mov al, 'A'int 0x10mov al, 'T'int 0x10mov al, 'H'int 0x10mov al, ':'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'H'int 0x10mov al, 'a'int 0x10mov al, 'n'int 0x10mov al, 'O'int 0x10mov al, 'S'int 0x10mov al, '/'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'F'int 0x10mov al, 'O'int 0x10mov al, 'L'int 0x10mov al, 'D'int 0x10mov al, 'E'int 0x10mov al, 'R'int 0x10mov al, ':'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'C'int 0x10mov al, ':'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'D'int 0x10mov al, ':'int 0x10jmp .print.check_input_l1:mov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'P'int 0x10mov al, 'A'int 0x10mov al, 'T'int 0x10mov al, 'H'int 0x10mov al, ':'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'H'int 0x10mov al, 'a'int 0x10mov al, 'n'int 0x10mov al, 'O'int 0x10mov al, 'S'int 0x10mov al, '/'int 0x10mov al, 'C'int 0x10mov al, ':'int 0x10mov al, '/'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'F'int 0x10mov al, 'O'int 0x10mov al, 'L'int 0x10mov al, 'D'int 0x10mov al, 'E'int 0x10mov al, 'R'int 0x10mov al, ':'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'S'int 0x10mov al, 'y'int 0x10mov al, 's'int 0x10mov al, 't'int 0x10mov al, 'e'int 0x10mov al, 'm'int 0x10mov al, '/'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'F'int 0x10mov al, 'I'int 0x10mov al, 'L'int 0x10mov al, 'E'int 0x10mov al, ':'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, 'N'int 0x10mov al, 'A'int 0x10mov al, 'M'int 0x10mov al, 'E'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 'K'int 0x10mov al, 'I'int 0x10mov al, 'N'int 0x10mov al, 'D'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 'B'int 0x10mov al, 'I'int 0x10mov al, 'T'int 0x10mov al, 'S'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'i'int 0x10mov al, 'p'int 0x10mov al, 'l'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 'B'int 0x10mov al, 'I'int 0x10mov al, 'N'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '1'int 0x10mov al, 'K'int 0x10mov al, 'B'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'h'int 0x10mov al, 'a'int 0x10mov al, 'n'int 0x10mov al, 'o'int 0x10mov al, 's'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 'S'int 0x10mov al, 'Y'int 0x10mov al, 'S'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '1'int 0x10mov al, '4'int 0x10mov al, '4'int 0x10mov al, '0'int 0x10mov al, 'K'int 0x10mov al, 'B'int 0x10jmp .print.check_input_l6:mov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'P'int 0x10mov al, 'A'int 0x10mov al, 'T'int 0x10mov al, 'H'int 0x10mov al, ':'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'H'int 0x10mov al, 'a'int 0x10mov al, 'n'int 0x10mov al, 'O'int 0x10mov al, 'S'int 0x10mov al, '/'int 0x10mov al, 'C'int 0x10mov al, ':'int 0x10mov al, '/'int 0x10mov al, 'S'int 0x10mov al, 'y'int 0x10mov al, 's'int 0x10mov al, 't'int 0x10mov al, 'e'int 0x10mov al, 'm'int 0x10mov al, '/'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'F'int 0x10mov al, 'I'int 0x10mov al, 'L'int 0x10mov al, 'E'int 0x10mov al, ':'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, 'N'int 0x10mov al, 'A'int 0x10mov al, 'M'int 0x10mov al, 'E'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 'K'int 0x10mov al, 'I'int 0x10mov al, 'N'int 0x10mov al, 'D'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 'B'int 0x10mov al, 'I'int 0x10mov al, 'T'int 0x10mov al, 'S'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'O'int 0x10mov al, 'S'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 'L'int 0x10mov al, 'H'int 0x10mov al, 'H'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '1'int 0x10mov al, 'K'int 0x10mov al, 'B'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'R'int 0x10mov al, 'E'int 0x10mov al, 'A'int 0x10mov al, 'D'int 0x10mov al, 'M'int 0x10mov al, 'E'int 0x10mov al, ' 'int 0x10mov al, 'M'int 0x10mov al, 'D'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '1'int 0x10mov al, 'K'int 0x10mov al, 'B'int 0x10jmp .print.check_input_l2:mov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'P'int 0x10mov al, 'A'int 0x10mov al, 'T'int 0x10mov al, 'H'int 0x10mov al, ':'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'H'int 0x10mov al, 'a'int 0x10mov al, 'n'int 0x10mov al, 'O'int 0x10mov al, 'S'int 0x10mov al, '/'int 0x10mov al, 'D'int 0x10mov al, ':'int 0x10mov al, '/'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'F'int 0x10mov al, 'I'int 0x10mov al, 'L'int 0x10mov al, 'E'int 0x10mov al, ':'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, 'N'int 0x10mov al, 'A'int 0x10mov al, 'M'int 0x10mov al, 'E'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 'K'int 0x10mov al, 'I'int 0x10mov al, 'N'int 0x10mov al, 'D'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 'B'int 0x10mov al, 'I'int 0x10mov al, 'T'int 0x10mov al, 'S'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'h'int 0x10mov al, 'a'int 0x10mov al, 'n'int 0x10mov al, 'o'int 0x10mov al, 's'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 'B'int 0x10mov al, 'I'int 0x10mov al, 'N'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '2'int 0x10mov al, 'K'int 0x10mov al, 'B'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'p'int 0x10mov al, 'r'int 0x10mov al, 'i'int 0x10mov al, 'n'int 0x10mov al, 't'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 'P'int 0x10mov al, 'Y'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '1'int 0x10mov al, '2'int 0x10mov al, 'B'int 0x10jmp .print.check_input_py:cmp si, 2jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 't'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'h'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'o'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'n'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, ' 'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'p'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'r'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'i'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'n'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 't'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, '.'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'p'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'y'jne .wait_inputmov ah, 0x00int 0x16cmp al, 0x0Djne .wait_inputmov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '6'int 0x10mov al, '6'int 0x10mov al, '6'int 0x10jmp .print.check_input_e:mov ah, 0x0Eint 0x10mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'x'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'i'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 't'jne .wait_inputmov ah, 0x00int 0x16cmp al, 0x0Djne .wait_inputMOV AL,0x13MOV AH,0x00INT 0x10jmp .done.check_input_cd0:mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, ' 'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'H'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'a'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'n'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'O'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'S'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, '/'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'C'je .check_input_cd1cmp al, 'D'je .check_input_cd2cmp al, 0x0Djne .wait_inputmov si, 0jmp .print.check_input_cd1:mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, ':'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, '/'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'S'je .cd11cmp al, 0x0Djne .wait_inputmov si, 1jmp .print.cd11:mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'y'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 's'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 't'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'e'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'm'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, '/'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 0x0Djne .wait_inputmov si, 6jmp .print.check_input_cd2:mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, ':'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, '/'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 0x0Djne .wait_inputmov si, 2jmp .print.check_input_c1:mov ah, 0x0Eint 0x10mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'd'je .check_input_cd0cmp al, 'l'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 's'jne .wait_inputmov ah, 0x00int 0x16cmp al, 0x0Djne .wait_inputmov ax, 0x0600mov bx, 0x0700mov cx, 0mov dx, 0x184fint 0x10mov ah, 02hxor bh, bhmov dh, 0mov dl, 0int 10hjmp _start.help:mov ah, 0x0Eint 0x10mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'e'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'l'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'p'jne .wait_inputmov ah, 0x00int 0x16cmp al, 0x0Djne .wait_inputmov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, '-'int 0x10mov al, ' 'int 0x10mov al, '`'int 0x10mov al, 'c'int 0x10mov al, 'l'int 0x10mov al, 's'int 0x10mov al, '`'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, '-'int 0x10mov al, ' 'int 0x10mov al, '`'int 0x10mov al, 'c'int 0x10mov al, 'd'int 0x10mov al, '`'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, '-'int 0x10mov al, ' 'int 0x10mov al, '`'int 0x10mov al, 'e'int 0x10mov al, 'x'int 0x10mov al, 'i'int 0x10mov al, 't'int 0x10mov al, '`'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, '-'int 0x10mov al, ' 'int 0x10mov al, '`'int 0x10mov al, 'w'int 0x10mov al, 'r'int 0x10mov al, 'i'int 0x10mov al, 't'int 0x10mov al, 'e'int 0x10mov al, 'r'int 0x10mov al, '`'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, '-'int 0x10mov al, ' 'int 0x10mov al, '`'int 0x10mov al, 'W'int 0x10mov al, 'i'int 0x10mov al, 'F'int 0x10mov al, 'i'int 0x10mov al, '`'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, '-'int 0x10mov al, ' 'int 0x10mov al, '`'int 0x10mov al, 'h'int 0x10mov al, 'e'int 0x10mov al, 'l'int 0x10mov al, 'p'int 0x10mov al, '`'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, '-'int 0x10mov al, ' 'int 0x10mov al, '`'int 0x10mov al, 'p'int 0x10mov al, 'y'int 0x10mov al, 't'int 0x10mov al, 'h'int 0x10mov al, 'o'int 0x10mov al, 'n'int 0x10mov al, '`'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'A'int 0x10mov al, 'n'int 0x10mov al, 'd'int 0x10mov al, ' 'int 0x10mov al, 'm'int 0x10mov al, 'o'int 0x10mov al, 'r'int 0x10mov al, 'e'int 0x10mov al, '.'int 0x10mov al, '.'int 0x10mov al, '.'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10jmp .print.README:mov ah, 0x0Eint 0x10cmp si, 6jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'E'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'A'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'D'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'M'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'E'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, '.'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'm'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'd'jne .wait_inputmov ah, 0x00int 0x16cmp al, 0x0Djne .wait_inputmov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '#'int 0x10mov al, ' 'int 0x10mov al, 'H'int 0x10mov al, 'a'int 0x10mov al, 'n'int 0x10mov al, 'O'int 0x10mov al, 'S'int 0x10mov al, ' 'int 0x10mov al, 'I'int 0x10mov al, 'n'int 0x10mov al, 't'int 0x10mov al, 'r'int 0x10mov al, 'o'int 0x10mov al, 'd'int 0x10mov al, 'u'int 0x10mov al, 'c'int 0x10mov al, 'e'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'T'int 0x10mov al, 'h'int 0x10mov al, 'i'int 0x10mov al, 's'int 0x10mov al, ' 'int 0x10mov al, 'o'int 0x10mov al, 'p'int 0x10mov al, 'e'int 0x10mov al, 'r'int 0x10mov al, 'a'int 0x10mov al, 't'int 0x10mov al, 'i'int 0x10mov al, 'n'int 0x10mov al, 'g'int 0x10mov al, ' 'int 0x10mov al, 's'int 0x10mov al, 'y'int 0x10mov al, 's'int 0x10mov al, 't'int 0x10mov al, 'e'int 0x10mov al, 'm'int 0x10mov al, ' 'int 0x10mov al, 'i'int 0x10mov al, 's'int 0x10mov al, ' 'int 0x10mov al, 'm'int 0x10mov al, 'a'int 0x10mov al, 'd'int 0x10mov al, 'e'int 0x10mov al, ' 'int 0x10mov al, 'b'int 0x10mov al, 'y'int 0x10mov al, ' 'int 0x10mov al, 'l'int 0x10mov al, 'i'int 0x10mov al, 'n'int 0x10mov al, 'h'int 0x10mov al, 'o'int 0x10mov al, 'n'int 0x10mov al, 'g'int 0x10mov al, 'h'int 0x10mov al, 'a'int 0x10mov al, 'n'int 0x10mov al, ','int 0x10mov al, ' 'int 0x10mov al, 'a'int 0x10mov al, ' 'int 0x10mov al, 'C'int 0x10mov al, 'h'int 0x10mov al, 'i'int 0x10mov al, 'n'int 0x10mov al, 'e'int 0x10mov al, 's'int 0x10mov al, 'e'int 0x10mov al, ' 'int 0x10mov al, 'p'int 0x10mov al, 'r'int 0x10mov al, 'i'int 0x10mov al, 'm'int 0x10mov al, 'a'int 0x10mov al, 'r'int 0x10mov al, 'y'int 0x10mov al, ' 'int 0x10mov al, 's'int 0x10mov al, 'c'int 0x10mov al, 'h'int 0x10mov al, 'o'int 0x10mov al, 'o'int 0x10mov al, 'l'int 0x10mov al, ' 'int 0x10mov al, 's'int 0x10mov al, 't'int 0x10mov al, 'u'int 0x10mov al, 'd'int 0x10mov al, 'e'int 0x10mov al, 'n'int 0x10mov al, 't'int 0x10mov al, '.'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'T'int 0x10mov al, 'h'int 0x10mov al, 'i'int 0x10mov al, 's'int 0x10mov al, ' 'int 0x10mov al, 'k'int 0x10mov al, 'e'int 0x10mov al, 'r'int 0x10mov al, 'n'int 0x10mov al, 'e'int 0x10mov al, 'l'int 0x10mov al, ' 'int 0x10mov al, 'o'int 0x10mov al, 'f'int 0x10mov al, ' 'int 0x10mov al, 'o'int 0x10mov al, 'p'int 0x10mov al, 'e'int 0x10mov al, 'r'int 0x10mov al, 'a'int 0x10mov al, 't'int 0x10mov al, 'i'int 0x10mov al, 'n'int 0x10mov al, 'g'int 0x10mov al, ' 'int 0x10mov al, 's'int 0x10mov al, 'y'int 0x10mov al, 's'int 0x10mov al, 't'int 0x10mov al, 'e'int 0x10mov al, 'm'int 0x10mov al, ' 'int 0x10mov al, 'w'int 0x10mov al, 'a'int 0x10mov al, 's'int 0x10mov al, ' 'int 0x10mov al, 'm'int 0x10mov al, 'a'int 0x10mov al, 'd'int 0x10mov al, 'e'int 0x10mov al, ' 'int 0x10mov al, 'b'int 0x10mov al, 'y'int 0x10mov al, ' 'int 0x10mov al, 'h'int 0x10mov al, 'i'int 0x10mov al, 'm'int 0x10mov al, 's'int 0x10mov al, 'e'int 0x10mov al, 'l'int 0x10mov al, 'f'int 0x10mov al, '.'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'T'int 0x10mov al, 'h'int 0x10mov al, 'e'int 0x10mov al, 'r'int 0x10mov al, 'e'int 0x10mov al, ' 'int 0x10mov al, 'a'int 0x10mov al, 'r'int 0x10mov al, 'e'int 0x10mov al, ' 'int 0x10mov al, 't'int 0x10mov al, 'h'int 0x10mov al, 'e'int 0x10mov al, ' 'int 0x10mov al, 'c'int 0x10mov al, 'o'int 0x10mov al, 'm'int 0x10mov al, 'm'int 0x10mov al, 'a'int 0x10mov al, 'n'int 0x10mov al, 'd'int 0x10mov al, ' 'int 0x10mov al, 'i'int 0x10mov al, 'n'int 0x10mov al, ' 'int 0x10mov al, 't'int 0x10mov al, 'h'int 0x10mov al, 'e'int 0x10mov al, ' 'int 0x10mov al, 'H'int 0x10mov al, 'a'int 0x10mov al, 'n'int 0x10mov al, ' 'int 0x10mov al, 'O'int 0x10mov al, 'p'int 0x10mov al, 'e'int 0x10mov al, 'r'int 0x10mov al, 'a'int 0x10mov al, 't'int 0x10mov al, 'i'int 0x10mov al, 'n'int 0x10mov al, 'g'int 0x10mov al, ' 'int 0x10mov al, 'S'int 0x10mov al, 'y'int 0x10mov al, 's'int 0x10mov al, 't'int 0x10mov al, 'e'int 0x10mov al, 'm'int 0x10mov al, ':'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, '-'int 0x10mov al, ' 'int 0x10mov al, '`'int 0x10mov al, 'c'int 0x10mov al, 'l'int 0x10mov al, 's'int 0x10mov al, '`'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, '-'int 0x10mov al, ' 'int 0x10mov al, '`'int 0x10mov al, 'c'int 0x10mov al, 'd'int 0x10mov al, '`'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, '-'int 0x10mov al, ' 'int 0x10mov al, '`'int 0x10mov al, 'e'int 0x10mov al, 'x'int 0x10mov al, 'i'int 0x10mov al, 't'int 0x10mov al, '`'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, '-'int 0x10mov al, ' 'int 0x10mov al, '`'int 0x10mov al, 'w'int 0x10mov al, 'r'int 0x10mov al, 'i'int 0x10mov al, 't'int 0x10mov al, 'e'int 0x10mov al, 'r'int 0x10mov al, '`'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, '-'int 0x10mov al, ' 'int 0x10mov al, '`'int 0x10mov al, 'W'int 0x10mov al, 'i'int 0x10mov al, 'F'int 0x10mov al, 'i'int 0x10mov al, '`'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, '-'int 0x10mov al, ' 'int 0x10mov al, '`'int 0x10mov al, 'h'int 0x10mov al, 'e'int 0x10mov al, 'l'int 0x10mov al, 'p'int 0x10mov al, '`'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, '-'int 0x10mov al, ' 'int 0x10mov al, '`'int 0x10mov al, 'p'int 0x10mov al, 'y'int 0x10mov al, 't'int 0x10mov al, 'h'int 0x10mov al, 'o'int 0x10mov al, 'n'int 0x10mov al, '`'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'A'int 0x10mov al, 'n'int 0x10mov al, 'd'int 0x10mov al, ' 'int 0x10mov al, 'm'int 0x10mov al, 'o'int 0x10mov al, 'r'int 0x10mov al, 'e'int 0x10mov al, '.'int 0x10mov al, '.'int 0x10mov al, '.'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10jmp .print.bad_input:mov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'b'int 0x10mov al, 'a'int 0x10mov al, 'd'int 0x10jmp .print
.done:retjmp .done.check_input_WiFi:mov ah, 0x0Eint 0x10mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'i'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'F'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'i'jne .wait_inputmov ah, 0x00int 0x16cmp al, 0x0Djne .wait_inputmov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'N'int 0x10mov al, 'A'int 0x10mov al, 'M'int 0x10mov al, 'E'int 0x10mov al, ':'int 0x10mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, '1'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, '2'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, '3'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, '4'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, '5'jne .wait_inputmov ah, 0x00int 0x16cmp al, 0x0Djne .wait_inputmov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'P'int 0x10mov al, 'A'int 0x10mov al, 'S'int 0x10mov al, 'S'int 0x10mov al, 'W'int 0x10mov al, 'O'int 0x10mov al, 'R'int 0x10mov al, 'D'int 0x10mov al, ':'int 0x10mov ah, 0x00int 0x16cmp al, '1'mov ah, 0x0Emov al, '*'int 0x10jne .wait_input2mov ah, 0x00int 0x16cmp al, '2'mov ah, 0x0Emov al, '*'int 0x10jne .wait_input2mov ah, 0x00int 0x16cmp al, '3'mov ah, 0x0Emov al, '*'int 0x10jne .wait_input2mov ah, 0x00int 0x16cmp al, '4'mov ah, 0x0Emov al, '*'int 0x10jne .wait_input2mov ah, 0x00int 0x16cmp al, '5'mov ah, 0x0Emov al, '*'int 0x10jne .wait_input2mov ah, 0x00int 0x16cmp al, '6'mov ah, 0x0Emov al, '*'int 0x10jne .wait_input2mov ah, 0x00int 0x16cmp al, '7'mov ah, 0x0Emov al, '*'int 0x10jne .wait_input2mov ah, 0x00int 0x16cmp al, '8'mov ah, 0x0Emov al, '*'int 0x10jne .wait_input2mov ah, 0x00int 0x16cmp al, '9'mov ah, 0x0Emov al, '*'int 0x10jne .wait_input2mov ah, 0x00int 0x16cmp al, '0'mov ah, 0x0Emov al, '*'int 0x10jne .wait_input2mov ah, 0x00int 0x16cmp al, 0x0Dmov ah, 0x0Emov al, '*'int 0x10jne .wait_input2mov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'W'int 0x10mov al, 'i'int 0x10mov al, 'F'int 0x10mov al, 'i'int 0x10mov al, ' 'int 0x10mov al, 'i'int 0x10mov al, 's'int 0x10mov al, ' 'int 0x10mov al, 'r'int 0x10mov al, 'e'int 0x10mov al, 'a'int 0x10mov al, 'd'int 0x10mov al, 'y'int 0x10jmp .print.check_input_print.py:mov ah, 0x0Eint 0x10cmp si, 2jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'y'je .check_input_pycmp al, 'r'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'i'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'n'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 't'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, '.'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'p'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'y'jne .wait_inputmov ah, 0x00int 0x16cmp al, 0x0Djne .wait_inputmov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'p'int 0x10mov al, 'r'int 0x10mov al, 'i'int 0x10mov al, 'n'int 0x10mov al, 't'int 0x10mov al, '('int 0x10mov al, '"'int 0x10mov al, '6'int 0x10mov al, '6'int 0x10mov al, '6'int 0x10mov al, '"'int 0x10mov al, ')'int 0x10jmp .print.OS:mov ah, 0x0Eint 0x10mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'S'jne .wait_inputmov ah, 0x00int 0x16cmp al, 0x0Djne .wait_inputmov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'O'int 0x10mov al, 'S'int 0x10mov al, ':'int 0x10mov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'H'int 0x10mov al, 'a'int 0x10mov al, 'n'int 0x10mov al, 'O'int 0x10mov al, 'S'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '('int 0x10mov al, '1'int 0x10mov al, ')'int 0x10mov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, 'C'int 0x10mov al, 'h'int 0x10mov al, 'o'int 0x10mov al, 'o'int 0x10mov al, 's'int 0x10mov al, 'e'int 0x10mov al, ':'int 0x10mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, '1'jne .printjmp .asmhead_code.writer:mov ah, 0x0Eint 0x10mov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'r'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'i'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 't'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'e'jne .wait_inputmov ah, 0x00int 0x16mov ah, 0x0Eint 0x10cmp al, 'r'jne .wait_inputmov ah, 0x00int 0x16cmp al, 0x0Djne .wait_inputmov ah, 0x0Emov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '+'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '/'int 0x10mov al, '\'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '-'int 0x10mov al, '-'int 0x10mov al, '|'int 0x10mov al, '-'int 0x10mov al, '-'int 0x10mov al, ' 'int 0x10mov al, '-'int 0x10mov al, '-'int 0x10mov al, '|'int 0x10mov al, '-'int 0x10mov al, '-'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '-'int 0x10mov al, '_'int 0x10mov al, '-'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, '/'int 0x10mov al, '|'int 0x10mov al, '\'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '/'int 0x10mov al, '|'int 0x10mov al, '\'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '-'int 0x10mov al, '-'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '/'int 0x10mov al, '-'int 0x10mov al, '-'int 0x10mov al, '-'int 0x10mov al, '-'int 0x10mov al, '\'int 0x10mov al, '_'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, ' 'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, '/'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '\'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, '|'int 0x10mov al, '_'int 0x10mov al, '_'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '\'int 0x10mov al, '|'int 0x10mov al, '\'int 0x10mov al, '|'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '_'int 0x10mov al, '/'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '|'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, ' 'int 0x10mov al, '/'int 0x10mov al, '|'int 0x10mov al, '/'int 0x10mov al, '|'int 0x10mov al, 0x0Dint 0x10mov al, 0x0Aint 0x10jmp .print.asmhead_code:

运行成功! 

相关文章:

自制虚拟机(C/C++)(二、分析引导扇区,虚拟机读二进制文件img软盘)

先修复上一次的bug&#xff0c;添加新指令&#xff0c;并增加图形界面 #include <graphics.h> #include <conio.h> #include <windows.h> #include <commdlg.h> #include <iostream> #include <fstream> #include <sstream> #inclu…...

基于最近邻数据进行分类

人工智能例子汇总:AI常见的算法和例子-CSDN博客 完整代码: import torch import numpy as np from sklearn.neighbors import KNeighborsClassifier from sklearn.metrics import accuracy_score import matplotlib.pyplot as plt# 生成一个简单的数据集 (2个特征和2个分类…...

ASP.NET Core 启动并提供静态文件

ASP.NET Core 启动并提供静态文件 即是单个可执行文件&#xff0c;它既运行 API 项目&#xff0c;也托管 前端项目&#xff08;通常是前端的发布文件&#xff09;。 这种方式一般是通过将 前端项目 的发布文件&#xff08;例如 HTML、CSS、JavaScript&#xff09;放入 Web AP…...

【异步编程】CompletableFuture:异步任务的选择(执行最快的)执行

文章目录 一. applyToEither : 拿到第一个任务结束的结果二. runAfterEither &#xff1a;第一个任务完成后执行副作用三. acceptEither&#xff1a;消费第一个任务的结果四. 三种接口总结 对于两个异步任务&#xff0c;我们有时希望在其中一个任务完成时立即执行某些操作&…...

4 [危机13小时追踪一场GitHub投毒事件]

事件概要 自北京时间 2024.12.4 晚间6点起&#xff0c; GitHub 上不断出现“幽灵仓库”&#xff0c;仓库中没有任何代码&#xff0c;只有诱导性的病毒文件。当天&#xff0c;他们成为了 GitHub 上 star 增速最快的仓库。超过 180 个虚假僵尸账户正在传播病毒&#xff0c;等待不…...

变量和常量

一.变量 1.标准声明 var 变量名 变量类型 变量声明行末不需要分号 2..批量声明 package main import "fmt" func main(){var(a string b int c boold float32)}3.变量的初始化 var a int 10 var b float321.1 4.类型推导 var name"tom" var age18 fmt.Pr…...

大模型概述(方便不懂技术的人入门)

1 大模型的价值 LLM模型对人类的作用&#xff0c;就是一个百科全书级的助手。有多么地百科全书&#xff0c;则用参数的量来描述&#xff0c; 一般地&#xff0c;大模型的参数越多&#xff0c;则该模型越好。例如&#xff0c;GPT-3有1750亿个参数&#xff0c;GPT-4可能有超过1万…...

流浪 Linux: 外置 USB SSD 安装 ArchLinux

注: ArchLinux 系统为滚动更新, 变化很快, 所以本文中的安装方法可能很快就过时了, 仅供参考. 实际安装时建议去阅读官方文档. 最近, 突然 (也没有那么突然) 有了一大堆 PC: 4 个笔记本, 2 个台式主机 (M-ATX 主板), 1 个小主机 (迷你主机). 嗯, 多到用不过来. 但是, 窝又不能…...

Hot100之子串

560和为K的子数组 题目 给你一个整数数组 nums 和一个整数 k &#xff0c;请你统计并返回 该数组中和为 k 的子数组的个数 。 子数组是数组中元素的连续非空序列 思路解析 ps&#xff1a;我们的presum【0】就是0&#xff0c;如果没有这个0的话我们的第一个元素就无法减去上…...

网络工程师 (11)软件生命周期与开发模型

一、软件生命周期 前言 软件生命周期&#xff0c;也称为软件开发周期或软件开发生命周期&#xff0c;是指从软件项目的启动到软件不再被使用为止的整个期间。这个过程可以细分为多个阶段&#xff0c;每个阶段都有其特定的目标、任务和产出物。 1. 问题定义与需求分析 问题定义…...

(三)QT——信号与槽机制——计数器程序

目录 前言 信号&#xff08;Signal&#xff09;与槽&#xff08;Slot&#xff09;的定义 一、系统自带的信号和槽 二、自定义信号和槽 三、信号和槽的扩展 四、Lambda 表达式 总结 前言 信号与槽机制是 Qt 中的一种重要的通信机制&#xff0c;用于不同对象之间的事件响…...

从0开始使用面对对象C语言搭建一个基于OLED的图形显示框架(基础图形库实现)

目录 基础图形库的抽象 抽象图形 抽象点 设计我们的抽象 实现我们的抽象 测试 抽象线 设计我们的抽象 实现我们的抽象 绘制垂直的和水平的线 使用Bresenham算法完成任意斜率的绘制 绘制三角形和矩形 矩形 三角形 实现 绘制圆&#xff0c;圆弧和椭圆 继续我们的…...

hot100_21. 合并两个有序链表

将两个升序链表合并为一个新的 升序 链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 示例 1&#xff1a; 输入&#xff1a;l1 [1,2,4], l2 [1,3,4] 输出&#xff1a;[1,1,2,3,4,4] 示例 2&#xff1a; 输入&#xff1a;l1 [], l2 [] 输出&#xff1a;[…...

安全防护前置

就业概述 网络安全工程师/安全运维工程师/安全工程师 安全架构师/安全专员/研究院&#xff08;数学要好&#xff09; 厂商工程师&#xff08;售前/售后&#xff09; 系统集成工程师&#xff08;所有计算机知识都要会一点&#xff09; 学习目标 前言 网络安全事件 蠕虫病毒--&…...

01-六自由度串联机械臂(ABB)位置分析

ABB工业机器人&#xff08;IRB2600&#xff09;如下图所示&#xff08;d1444.8mm&#xff0c;a1150mm&#xff0c;a2700mm&#xff0c;a3115mm&#xff0c;d4795mm&#xff0c;d685mm&#xff09;&#xff0c;利用改进DH法建模&#xff0c;坐标系如下所示&#xff1a; 利用改进…...

JVM运行时数据区域-附面试题

Java虚拟机在执行Java程序的过程中会把它所管理的内存划分为若干个不同的数据区域。这些区域 有各自的用途&#xff0c;以及创建和销毁的时间&#xff0c;有的区域随着虚拟机进程的启动而一直存在&#xff0c;有些区域则是 依赖用户线程的启动和结束而建立和销毁。 1. 程序计…...

Java线程池与Future_优化并发任务执行

1. 引言 1.1 并发编程的重要性 并发编程是现代软件开发中的关键部分,特别是在处理高并发、大数据和分布式系统时。通过并发编程,可以充分利用多核处理器的计算能力,提高系统的吞吐量和响应速度。 1.2 线程池与Future的作用 线程池:提供了对线程资源的有效管理和复用,减…...

HTML(快速入门)

欢迎大家来到我的博客~欢迎大家对我的博客提出指导&#xff0c;有错误的地方会改进的哦~点击这里了解更多内容 目录 一、前言二、HTML基础2.1 什么是HTML?2.2 认识HTML标签2.2.1 HTML标签当中的基本结构2.2.2 标签层次结构 2.3 HTML常见标签2.3.1 标题标签2.3.2 段落标签2.3.3…...

《苍穹外卖》项目学习记录-Day10订单状态定时处理

利用Cron表达式生成器生成Cron表达式 1.处理超时订单 查询订单表把超时的订单查询出来&#xff0c;也就是订单的状态为待付款&#xff0c;下单的时间已经超过了15分钟。 //select * from orders where status ? and order_time < (当前时间 - 15分钟) 遍历集合把数据库…...

WebForms SortedList 深度解析

WebForms SortedList 深度解析 引言 在Web开发领域,对于数据结构的理解与应用至关重要。其中,SortedList类在WebForms中是一个常用的数据结构,它能够帮助开发者高效地管理有序数据集合。本文将深入解析SortedList类在WebForms中的应用,包括其基本概念、常用方法、性能特点…...

AJAX综合案例——图书管理

黑马程序员视频地址&#xff1a; AJAX-Day02-10.案例_图书管理AJAX-Day02-10.案例_图书管理_总结_V1.0是黑马程序员前端AJAX入门到实战全套教程&#xff0c;包含学前端框架必会的&#xff08;ajaxnode.jswebpackgit&#xff09;&#xff0c;一套全覆盖的第25集视频&#xff0c…...

如何在Windows、Linux和macOS上安装Rust并完成Hello World

如何在Windows、Linux和macOS上安装Rust并完成Hello World 如果你刚刚开始学习Rust&#xff0c;第一步就是安装Rust并运行你的第一个程序&#xff01;本文将详细介绍如何在Windows、Linux和macOS上安装Rust&#xff0c;并编写一个简单的“Hello, World!”程序。 1. 安装Rust …...

使用 Redis Streams 实现高性能消息队列

1. 引言 在后端开发中&#xff0c;消息队列是一个常见的组件&#xff0c;主要用于解耦系统、提高吞吐量以及实现异步处理。常见的消息队列包括 Kafka、RabbitMQ 以及 ActiveMQ&#xff0c;但 Redis Streams 作为 Redis 5.0 引入的新特性&#xff0c;也提供了一种高效、轻量的消…...

30.Word:设计并制作新年贺卡以及标签【30】

目录 NO1.2 NO3邮件合并-信函 NO4邮件合并-标签​ NO1.2 另存为/F12&#xff1a;考生文件夹&#xff1a;Word.docx布局→页面设置对话框→页边距&#xff1a;上下左右→纸张&#xff1a;宽度/高度&#xff08;先调页边距&#x1f197;&#xff09;设计→页面颜色→填充效果→…...

Nginx开发01:基础配置

一、下载和启动 1.下载、使用命令行启动&#xff1a;Web开发&#xff1a;web服务器-Nginx的基础介绍&#xff08;含AI文稿&#xff09;_nginx作为web服务器,可以承担哪些基本任务-CSDN博客 注意&#xff1a;我配置的端口是81 2.测试连接是否正常 访问Welcome to nginx! 如果…...

数据分析系列--⑨RapidMiner训练集、测试集、验证集划分

一、数据集获取 二、划分数据集 1.导入和加载数据 2.数据集划分 2.1 划分说明 2.2 方法一 2.3 方法二 一、数据集获取 点击下载数据集 此数据集包含538312条数据. 二、划分数据集 1.导入和加载数据 2.数据集划分 2.1 划分说明 2.2 方法一 使用Filter Example Range算子. …...

C基础寒假练习(6)

一、终端输入行数&#xff0c;打印倒金字塔 #include <stdio.h> int main() {int rows;printf("请输入倒金字塔的行数: ");scanf("%d", &rows);for (int i rows; i > 0; i--) {// 打印空格for (int j 0; j < rows - i; j) {printf(&qu…...

mysqldump+-binlog增量备份

注意&#xff1a;二进制文件删除必须使用help purge 不可用rm -f 会崩 一、概念 增量备份&#xff1a;仅备份上次备份以后变化的数据 差异备份&#xff1a;仅备份上次完全备份以后变化的数据 完全备份&#xff1a;顾名思义&#xff0c;将数据完全备份 其中&#xff0c;…...

《DeepSeek R1:大模型最简安装秘籍》

DeepSeek R1&#xff1a;AI 大模型界的新起之秀 在人工智能的璀璨星空中&#xff0c;大模型如繁星般闪耀&#xff0c;而 DeepSeek R1 无疑是其中一颗冉冉升起的新星&#xff0c;自问世以来便吸引了全球的目光&#xff0c;在人工智能领域占据了重要的一席之地。 从性能表现上看…...

FLTK - FLTK1.4.1 - demo - bitmap

文章目录 FLTK - FLTK1.4.1 - demo - bitmap概述笔记END FLTK - FLTK1.4.1 - demo - bitmap 概述 // 功能 : 演示位图数据在按钮上的显示 // * 以按钮为范围或者以窗口为范围移动 // * 上下左右, 文字和图像的相对位置 // 失能按钮&#xff0c;使能按钮 // 知识点 // FLTK可…...