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

📄 mips.h

📁 PL/0源码
💻 H
字号:
//////////////////////////////////////////////////////////////////////////////////  mips.[h,cc] -- procedures for generating MIPS code////  see also prologue.h; it's quite machine-dependent!//#ifndef MIPS_H#define MIPS_H#include "inpbuf.h"#include "codegen.h"enum mips_opcode_t {    // Real Instructions    M_JAL = 1,  M_JALR, M_J,    M_JR,   M_MFLO,    M_LI,       M_MOVE, M_BEQ,  M_BNE,  M_SEQ,    M_SNE,      M_SLE,  M_SLT,  M_SGE,  M_SGT,    M_SUB,      M_ADD,  M_MULT, M_DIV,  M_LW,    M_SW,       M_ADDI, M_ANDI, M_XORI, M_LA,    M_B,    // Pseudo Instructions    M_DATA=90,  M_TEXT, M_WORD, M_ENT,  M_END,    M_FILE};typedef enum  { T_SPIM, T_SGI } target_t;extern bool        generate_comments;extern bool        generate_debug_code;extern bool        g_peep_hole_optimize;extern target_t    compiler_target;void mips_src_lines(location_t sl);//  Output source lines up to slvoid mips_src_finalize(void);//  Print remaining linesvoid mips_cm(string comment);//  Add a comment to the next opcode which is processed by mips_op//////////////////////////////////////////////////////////////////////////////////  mips_op: Generate a MIPS operation instruction.////  This one function is overloaded to generate every class of instruction//  used.//void mips_op(const mips_opcode_t op, const mips_name_t label);void mips_op(const mips_opcode_t op, const mips_register_t r1);void mips_op(const mips_opcode_t op, const mips_register_t r1,             const mips_name_t lab);void mips_op(const mips_opcode_t op, const mips_register_t r1,             const mips_register_t r2);void mips_op(const mips_opcode_t op, const mips_register_t r1,             const mips_register_t r2, const mips_name_t lab);void mips_op(const mips_opcode_t op, const mips_register_t r1,             const mips_register_t r2, const mips_register_t r3);void mips_op(const mips_opcode_t op, const mips_register_t r1,             const mips_register_t r2, const int imm);void mips_op(const mips_opcode_t op, const mips_register_t r1,             const int imm, const mips_register_t r2);void mips_op(const mips_opcode_t op, const mips_register_t reg,             const int imm);void mips_op(const mips_name_t lab);void mips_op(const mips_opcode_t op);void mips_op(const mips_name_t label, const mips_opcode_t op,             const int value);#endif

⌨️ 快捷键说明

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