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

📄 oxanf.h

📁 OXCC is a multipass, interpreting C compiler with several language extensions. It generates an Archi
💻 H
📖 第 1 页 / 共 2 页
字号:
/* 
	oxanf.h	-- v1.430 definition of architecture neutral format
	
	Copyright (c) 1995
	Norman D. Culver dba
	Oxbow Software
	1323 S.E. 17th Street #662
	Ft. Lauderdale, FL 33316
	(954) 463-4754
	ndc@icanect.net
	All rights reserved.

 * Redistribution and use in source and binary forms are permitted
 * provided that: (1) source distributions retain this entire copyright
 * notice and comment, and (2) distributions including binaries display
 * the following acknowledgement:  ``This product includes software
 * developed by Norman D. Culver dba Oxbow Software''
 * in the documentation or other materials provided with the distribution
 * and in all advertising materials mentioning features or use of this
 * software.
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

*/


/* F_RETBITS */
#define RET_VOID (0x01)
#define RET_FLOAT (0x02)
#define RET_STRUCT (0x04)
#define RET_DOUBLE (0x08)
#define RET_LDOUBLE (0x10)
#define RET_UNSIGNED (0x20)

/* F_QUALBITS */
#define QUAL_NEAR (0x01)
#define QUAL_FAR (0x02)
#define QUAL_SEG16 (0x04)
#define QUAL_FAR16 (0x08)
#define QUAL_ELLIPSIS (0x10)
#define QUAL_CONST (0x20)
#define QUAL_VOLATILE (0x40)

/* address types in 'atype' for gen_code */
#define A_VALUE (0x0001)
#define A_POINTER (0x0002)
#define A_MEMADDR (0x0004)
#define A_IMMED (0x0008)
#define A_ABSOLUTE (0x0010)
#define A_TEMP (0x0020)
#define A_DATA (0x0040)
#define A_AUTO (0x0080)
#define A_EXTERN (0x0100)
#define A_GLOBAL (0x0200)
#define A_RET (0x0400)
#define A_NOALIAS (0x0800)
#define A_PARAM (0x1000)

/* data types in 'dtype'(low 8 bits) for gen_code */
#define D_SIGNED (0x0000)
#define D_UNSIGNED (0x0001)
#define D_FLOAT (0x0002)
#define D_POINTER (0x0003)
#define D_ARRAY (0x0004)
#define D_STRUCT (0x0005)
#define D_FUNCTION (0x0006)
#define D_FUNCPTR (0x0007)
#define D_SEGMENT (0x0008)

/* data qualifiers in `dtype' (high 8 bits) for gen_code */
#define Q_NEAR	(0x01)
#define Q_FAR	(0x02)
#define Q_HUGE	(0x04)
#define Q_CONST	(0x08)
#define Q_VOLAT (0x10)
#define Q_SEG16	(0x20)
#define Q_FAR16	(0x40)
#define Q_BASED	(0x80)

/* in the opcode 3 address ids */
#define OPIMMED1 (0x00)	/* signed integer type */
#define OPIMMED2 (0x20)	/* unsigned integer type */
#define OPIMMED3 (0x40) /* float type */
#define OPIMMED4 (0x60) /* pointer type */
#define OPTEMP (0x80)
#define OPRET (0xa0)
#define OPAUTO (0xc0)
#define OPDATA (0xe0)

/* HARWARE TYPES */
#define INTEL8616 'i'
#define INTEL8632 'I'
#define POWER_PC 'P'
#define DEC_ALPHA 'D'
#define PA_RISC 'H'
#define MIPS_3000 'm'
#define MIPS_4000 'M'

/* GENCODE TYPE */
#define MACHINE_CODE 'm'
#define SOURCE_CODE 's'
#define BYTE_CODE 'b'
#define RIP_CODE 'r'
#define DEBUG_CODE 'd'
#define ANF_CODE 'n'
#define ASSEMBLER_CODE 'a'

/* OPERATING SYSTEM TYPES */
#define DOS16PLAT 'd'
#define DOS32PLAT 'D'
#define WIN16PLAT 'w'
#define WIN32sPLAT 'W'
#define WIN32gPLAT 'C'
#define WINntPLAT 'N'
#define OS216PLAT 'o'
#define OS232PLAT 'O'
#define UNIXVPLAT 'U'
#define LINUXPLAT 'L'

/* TARGET DEBUGGER INFO */
#define CODEVBUG 'v'
#define WATCBUG 'w'
#define BORLBUG 'b'
#define GDBBUG 'g'
#define DWARF 'd'

/* TARGET ASSEMBLER INFO */
#define UNIX 'u'
#define GAS 'g'
#define MASM 'm'
#define TASM 't'

/* MEMORY MODELS */
#define MODTINY 't'
#define MODSMALL 's'
#define MODMEDIUM 'm'
#define MODLARGE 'l'
#define MODCOMPACT 'c'
#define MODHUGE 'h'
#define MODFLAT 'x'

/* OBJECT FILE FORMATS */
#define OMF16FORMAT 'o'
#define OMF32FORMAT 'O'
#define PHARLAPFORMAT 'P'
#define WATCOM32FORMAT 'W'
#define BORLAND32FORMAT 'B'
#define AOUTFORMAT 'a'
#define COFFFORMAT 'c'
#define ELFFORMAT 'e'

#if NEED_FUNCTHUNK

/* FUNCTHUNK CONTENTS */

/* F_MODS */
#define Fretvoid (0x0001)
#define Fretflt (0x0002)
#define Fretstr (0x0004)
#define Fretdbl  (0x0008)
#define Fretldbl (0x0010)
#define Fbuiltin (0x0020)
#define Funused1 (0x0040)
#define Funused2 (0x0080)
#define Fnear	 (0x0100)
#define Ffar	 (0x0200)
#define Fseg16  (0x0400)
#define Ffar16  (0x0800)
#define Fellipsis (0x1000)
#define Fthunked (0x2000)
#define Fnested (0x4000)
#define Fextern (0x8000)

typedef struct _functhunk {/* 16 bytes */
	long funcaddr;
	unsigned short stksiz;
	unsigned short argsiz;
	unsigned short stkbeg;
	unsigned short fmods;
	unsigned short retsiz;
	unsigned short maxes;
} *Pft;

typedef union _datum { /* 16 bytes */
#if SUPPORT_LONG_LONG
	unsigned long long Uulonglong;
	long long		Ulonglong;
#endif
	unsigned char	Uuchar;
	char			Uchar;
	unsigned short	Uushort;
	short			Ushort;
	unsigned int	Uuint;
	int				Uint;
	unsigned long	Uulong;
	long			Ulong;
	void *			Upointer;
	float			Ufloat;
	double			Udouble;
#if SUPPORT_LONG_DOUBLE
	long double		Ulongdouble;
#endif
	struct {
		char d[16];
	} chr;
	struct {
		unsigned char d[16];
	} uchr;
	struct {
		short d[8];
	} shrt;
	struct {
		unsigned short d[8];
	} ushrt;
	struct {
		long d[4];
	} lng;
	struct {
		unsigned long d[4];
	} ulng;
#if SUPPORT_LONG_LONG
	struct {
		long long d[2];
	} lnglng;
	struct {
		unsigned long long d[2];
	} ulnglng;
#endif
	struct {
		void *d[4];
	} ptr;
} DATUM;
#endif /* NEED_FUNCTHUNK */

#ifdef NEED_ANFDEFS
enum basedecls {/* 1-21 */
	bd_array = 1, bd_struct, bd_union, bd_function, bd_funcptr,
	bd_pointer, bd_uchar, bd_ushort, bd_uint, bd_ulong,
	bd_ulonglong, bd_float, bd_longdouble, bd_double, bd_char,
	bd_short, bd_int, bd_long, bd_longlong, bd_void,
	bd_segment
};

typedef struct op {
	unsigned char op;
	unsigned char a1;
	unsigned char a2;
	unsigned char a3;
	unsigned char *next;
	long data;
	long data1;
	short data2;
	unsigned short data3;
	long data4;				/* perhaps skip to data in next area */
	long data5;				/* NODEP in functhunk */
	long data5a;			/* ARGSIZ|STKSIZ in functhunk */
	unsigned short data6;	/* STKBEG in functhunk */
	unsigned short data7;	/* F_MODS in functhunk */
	unsigned short data8;	/* F_RETSIZ in functhunk */
	unsigned short data9;	/* MAXES in functhunk */
} *Pop;
#define POP ((Pop)p)

typedef union opD {
	unsigned char	Uuchar;
	char			Uchar;
	unsigned short	Uushort;
	short			Ushort;
	unsigned int	Uuint;
	int				Uint;
	unsigned long	Uulong;
	long			Ulong;
	void *			Upointer;
	float			Ufloat;
	double			Udouble;
#if SUPPORT_LONG_LONG
	unsigned long long Uulonglong;
	long long		Ulonglong;
#else
	long			Ulonglong[2];
	unsigned long	Uulonglong[2];
#endif
#if SUPPORT_LONG_DOUBLE
	long double		Ulongdouble;
#endif
} opD, *PopD;

typedef struct opR {
	unsigned short dtype;
	unsigned short atype;
	long dsize;
} *PopR;

typedef struct opT {
	unsigned short dtype;
	unsigned short atype;
	long dsize;
	long tmpnum;
} *PopT;

typedef struct opA {
	unsigned short dtype;
	unsigned short atype;
	long dsize;
	long offset;
	unsigned short declnum;
	short symnum;
	long pofs;	/* autovars only */
} *PopA;
#define POPA ((PopA)(p+inc))

typedef struct _inst {
	PopA lptr;
	PopA rptr;
	PopA dptr;
	unsigned char loptype;
	unsigned char roptype;
	unsigned char doptype;
} INST, *PINST;

typedef union opI {
	struct  {
		unsigned long total_size;
		unsigned long thunk_offset;
		unsigned long bss_offset;
	} dat;
	struct  {
		unsigned long size;
		unsigned long offset;
		short symnum;
		unsigned short declnum;
		short segid;
		unsigned short dtype;
	} s;
	struct {
		unsigned short declnum;
		unsigned short basedecl;
	} dcl;
	struct {
		unsigned long swdefault;
		unsigned long swnode;
	} swt;
	struct {
		long argsize;
		long bits;
		long retbits;
	} fc;
	struct {
		unsigned long size;
		unsigned long offset;
	} rs;
	struct {
		unsigned long argloc;
		unsigned long argsize;
	} arg;
	struct {
		unsigned long arysize;
		unsigned long elemsize;
		unsigned long dims1;
		unsigned short dcnt;
		unsigned short declnum;
	} ary;
	struct {
		unsigned long dims[4];
	} ary1;
	struct {
		unsigned short parms[8];
	} parm;
	struct {
		unsigned short prmcnt;
		unsigned short fmods;
		unsigned short quals;
		unsigned short declnum;
		unsigned short parmnum;
		short symnum;

⌨️ 快捷键说明

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