先修复上一次的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;
}
这个工具在下载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
python">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:
运行成功!