minipentium.h

来自「压缩包里面的都是精致的基本C语言小程序」· C头文件 代码 · 共 57 行

H
57
字号
#ifndef MINIPENTIUM_H#define MINIPENTIUM_H#include "../lib/linkedList.h"#include "../lib/set.h"#include "../lib/str.h"typedef struct operand *operand;typedef struct instruction *instruction;typedef struct pentiumProg *pentiumProg;struct operand{  enum {PID, PNUM} kind;  union  {      str id;    int i;  } u;};struct instruction{  enum {MOVL, ADDL, SUBL, MULL, PPRINT, COMMENT} kind;  operand src;  str dst;};struct pentiumProg{  linkedList instructions;};operand miniPNewOperandNum (int i);operand miniPNewOperandId (str s);instruction miniPNewInstrMovl (operand src, str dst);instruction miniPNewInstrAddl (operand src, str dst);instruction miniPNewInstrSubl (operand src, str dst);instruction miniPNewInstrMull (operand src, str dst);instruction miniPNewInstrPrint (operand src);instruction miniPNewInstrComment (str dst);pentiumProg miniPNewProg (linkedList instructions);void miniPPrettyPrintOperand (operand o);void miniPPrettyPrintInstruction (instruction i);void miniPPrettyPrintProg (pentiumProg p);str miniPToStringProg (pentiumProg p);void miniPToExe (pentiumProg p);set miniPSetOfId (pentiumProg p);#endif

⌨️ 快捷键说明

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