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

📄 plx.h

📁 一个PLX教学编译器IDE
💻 H
字号:

#ifndef __PLX__H_
#define __PLX__H_

#define MAX_CODENUMBER    2048 
#define MAX_STACK         (2048*2)

#include <stdio.h>
#include <fstream.h>
#include <string.h>

class plxw  
{
public:
	plxw();
	~plxw();

	void debug(char *filePath);
protected:

	ifstream InFile;
	enum instruction{OPR,LIT,LOD,STO,INT,JMP,JPC,SHO,CAL};
	typedef enum instruction fct;

	typedef struct _code{ int f;
                          int l;
	                      int a;
	}CODE;

	/* 存储代码的数组和指标 */
	CODE code[MAX_CODENUMBER];
	int  cx;
	/*  虚拟机  */  
    int  s[MAX_STACK];          /*  运行栈           */
	int  t;                          /*  运行栈指针       */
	CODE i;                          /*  指令寄存器       */
	int  p;                          /*  PC寄存器         */
	int  b;                          /*  基地址寄存器     */

	void fillCode();
	void interpret(); 
	int  base(int l);	
};

#endif 

⌨️ 快捷键说明

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