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

📄 ctrlib.h

📁 ucos porting source for Am188
💻 H
字号:
/*********************************************************

	CTRLIB.H  created  07/06/89  by Drew Gislason

	Copyright (C) 1988-1992 by Datalight
	All Rights Reserved

	Prototypes and macros for use with the C_thru_ROM
	ROMable Library.  Include CTRLIB.H in all projects
	and the following functions are supported.

	Microsoft C Function Prototypes
	-------------------------------
	void assert(int test);
	void * calloc(unsigned items, unsigned size);
	void _disable(void);
	void (interrupt far * _dos_getvect(int intnum))();
	void _dos_setvect(int intnum, void (interrupt far *isr)());
	void _enable(void);
	void free(void * id);
	int inp(unsigned portid);
	unsigned inpw(unsigned portid);
	void outp(unsigned portit, int byte);
	void outpw(unsigned portit, unsigned word);
	void * malloc(unsigned);
	int printf(const char *format, ...);
	int puts(char *s);
	int putchar(char c);
	int sprintf(char * buffer, const char *format, ...);


	Borland C Function Prototypes
	-----------------------------
	void assert(int test);
	void * calloc(unsigned items, unsigned size);
	void disable(void);
	void _disable(void);
	void interrupt (* _dos_getvect(unsigned intnum))();
	void _dos_setvect(unsigned intnum, void interrupt (*isr)());
	void enable(void);
	void _enable(void);
	void far_free(void far * id);
	void far * far_malloc(unsigned long bytes);
	void free(void * id);
	void interrupt (*getvect(int intnum))();
	int inp(unsigned portid);
	int inport(int portid);
	unsigned char inporb(int portid);
	unsigned inpw(unsigned portid);
	void * malloc(unsigned bytes);
	void outp(unsigned portit, int byte);
	void outport(int portit, int value);
	void outportb(int portit, unsigned char value);
	void outpw(unsigned portit, unsigned word);
	int printf(const char *format, ...);
	int puts(char *s);
	int putchar(char c);
	void setvect(int intnum, void interrupt (*isr)());
	int sprintf(char * buffer, const char *format, ...);

**********************************************************/

#ifdef __cplusplus
extern "C" {
#endif

/*
	BORLAND/TURBO C/C++ MACROS
*/
#ifdef __TURBOC__

	#define	enable()					_enable()
	#define	disable()				_disable()
	#define	setvect(intnum,isr)	_dos_setvect(intnum,isr)
	#define	getvect(intnum)		_dos_getvect(intnum)
#endif

/* inline functions */
#define NULL	0

//#define MK_FP(seg,off) \
//    ((void far *)(((unsigned long)(seg)<<16) | (unsigned)(off)))

//#define FP_SEG(farptr)  ((unsigned)((unsigned long)(farptr) >> 16))
//#define FP_OFF(farptr)  ((unsigned)(farptr))

#define assert(expr) if(expr) _assert("expr",__FILE__,__LINE__)
#define puts(s)		_puts(s)
#define putchar(c)	_putchar(c)

/* prototypes for standard library functions */
void * calloc(unsigned items, unsigned size);
void _disable(void);
void (interrupt far * _dos_getvect(int intnum))();
void _dos_setvect(int intnum, void (interrupt far *isr)());
void _enable(void);
void far_free(void far * id);
void far * far_malloc(unsigned long bytes);
void  free(void * id);
int   inp(unsigned portid);
unsigned  inpw(unsigned portid);
void  outp(unsigned portit, int byte);
void  outpw(unsigned portit, unsigned word);
void *  malloc(unsigned);
int  printf(const char  *__format, ...);
int  puts(char *s);
int  putchar(char c);
int  sprintf(char * buffer, const char *format, ...);

/* prototypes for C_thru_ROM unique functions */
unsigned  getDS(void);
unsigned  getCS(void);

#ifdef  __cplusplus
}
#endif

⌨️ 快捷键说明

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