init.h

来自「< 虚拟机设计与实现> 的source code, linux版本」· C头文件 代码 · 共 53 行

H
53
字号
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+                                                                   +
+ init     - loads bytecode off of disk and into physical memory    +
+                                                                   +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

#ifndef _INIT_H
#define _INIT_H

#include <stdio.h>

#include "common.h"
#include "cmdline.h"
#include "exenv.h"
#include "error.h"

#ifdef OS_WIN
#include "win32.h"
#else
#include "linux.h"
#endif

#define	APPLICATION		0xDEED	/* identifies an executable file (magic number) */

//#define DBG_INIT		1

#ifdef DBG_INIT
#define DBG_INIT0(str);				printf("initHEC(): "); printf(str);
#define DBG_INIT1(str,arg1);		printf("initHEC(): "); printf(str,arg1);
#define DBG_INIT2(str,arg1,arg2);	printf("initHEC(): "); printf(str,arg1,arg2);
#define PRINT_SYM_TBL();			printDebugData(&debugData);	
#else
#define DBG_INIT0(str);
#define DBG_INIT1(str,arg1);
#define DBG_INIT2(str,arg1,arg2); 
#define PRINT_SYM_TBL();	
#endif

#define SIZE_HEADER		26		/* byte size of executable header */

struct HeaderRec
{
	U2 magic;		/*should be magic number 0xDEED */
	U8 szSymTbl;	/*size of symbol table*/
	U8 szStrTbl;	/*size of string table*/
	U8 szByteCode;  /*size of bytecode*/
};

U1 initHEC(struct CmdLine cl);
void closeHEC();

#endif

⌨️ 快捷键说明

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