• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MK_FP函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中MK_FP函数的典型用法代码示例。如果您正苦于以下问题:C++ MK_FP函数的具体用法?C++ MK_FP怎么用?C++ MK_FP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了MK_FP函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: FcbWrite

BOOL FcbWrite(xfcb FAR * lpXfcb, COUNT * nErrorCode)
{
  sft FAR *s;
  LONG lPosit;
  COUNT nWritten;
  psp FAR *p = MK_FP(cu_psp, 0);

  /* Convert to fcb if necessary                                  */
  lpFcb = ExtFcbToFcb(lpXfcb);

  /* Get the SFT block that contains the SFT      */
  if ((s = idx_to_sft(lpFcb->fcb_sftno)) == (sft FAR *) - 1)
    return FALSE;

  /* If this is not opened another error          */
  if (s->sft_count == 0)
    return FALSE;

  /* Now update the fcb and compute where we need to position     */
  /* to.                                                          */
  lPosit = FcbRec() * lpFcb->fcb_recsiz;
  if (SftSeek(s, lPosit, 0) != SUCCESS)
  {
    *nErrorCode = FCB_ERR_EOF;
    return FALSE;
  }

  nWritten = DosWriteSft(s, lpFcb->fcb_recsiz, p->ps_dta, nErrorCode);

  /* Now find out how we will return and do it.                   */
  if (nWritten == lpFcb->fcb_recsiz)
  {
    lpFcb->fcb_fsize = s->sft_size;
    FcbNextRecord(lpFcb);
    *nErrorCode = FCB_SUCCESS;
    return TRUE;
  }
  else if (nWritten <= 0)
  {
    *nErrorCode = FCB_ERR_WRITE;
    return TRUE;
  }
  *nErrorCode = FCB_ERR_WRITE;
  return FALSE;
}
开发者ID:TijmenW,项目名称:FreeDOS,代码行数:45,代码来源:fcbfns.c


示例2: scan

static int scan (void * arg, word segm, word ofs) {
        Context_Tag tag;
	ctxt_info_t *info;

        (void)arg;
	assert(segm);
	assert(ofs != (word)-1);

redo:
	if((tag = peekb(segm, ofs), ctxtIsInfoTag(tag))) {
		info = &CTXT_INFO_STRUCT(tag);
		if(peekb(segm, ofs + 1) == '=' && peekb(segm, ofs + 4) == 0) {
			/* status entry */
			info->c_sizemax = peekw(segm, ofs + 2) & ~0x8001;
		} else {		/* normal entry */
			char far *p = MK_FP(segm, ofs + 1);
			unsigned num;

			for(num = 0; isxdigit(*p); ++p) {
				num <<= 8;
				if(isdigit(*p))
					num |= *p & 0xf;
				else {
					assert(islower(*p));
					num |= *p - 'a' + 10;
				}
			}
			if(*p == '=') {
				info->c_sizecur += env_varlen(segm, ofs);
				if(num < info->c_nummin)
					info->c_nummin = num;
				if(num > info->c_nummax)
					info->c_nummax = num;
			} else {
				/* Invalid entry -> remove to make room for useful stuff */
				env_subVarOffset(segm, ofs);
				goto redo;
			}
		}
	} else if(tag > ' ') {			/* Alias */
		CTXT_INFO(CTXT_TAG_ALIAS, sizecur) += env_varlen(segm ,ofs);
	}

	return 0;		/* proceed */
}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:45,代码来源:ctxt_ss.c


示例3: restoreState

/*
 * restoreState:
 *
 * Restore register state back to the fault frame from the IntResult
 * data structure.
 */
static void restoreState( volatile fault_frame *ff )
{
    WORD        __far *wptr;

    /*
     * we save all this stuff in our own code segment (see int.asm)
     * because do not have data segment addressability when we need it
     * (when we go to push it onto a new stack)
     */
    wptr = MK_FP( CSAlias, FP_OFF( &NewAX ) );
    *wptr = (WORD) IntResult.EAX;
    wptr = MK_FP( CSAlias, FP_OFF( &NewCS ) );
    *wptr = IntResult.CS;
    wptr = MK_FP( CSAlias, FP_OFF( &NewIP ) );
    *wptr = (WORD) IntResult.EIP;
    wptr = MK_FP( CSAlias, FP_OFF( &NewFLAGS ) );
    *wptr = (WORD) IntResult.EFlags;
    wptr = MK_FP( CSAlias, FP_OFF( &OldretCS ) );
    *wptr = ff->intf.retCS;
    wptr = MK_FP( CSAlias, FP_OFF( &OldretIP ) );
    *wptr = ff->intf.retIP;
    wptr = MK_FP( CSAlias, FP_OFF( &Oldintnumber ) );
    *wptr = ff->intf.intnumber;
    wptr = MK_FP( CSAlias, FP_OFF( &Oldhandle ) );
    *wptr = ff->intf.handle;

    ff->SS = IntResult.SS;
    ff->GS = IntResult.GS;
    ff->FS = IntResult.FS;
    ff->ES = IntResult.ES;
    ff->DS = IntResult.DS;
    ff->EDI = IntResult.EDI;
    ff->ESI = IntResult.ESI;
    // have ESP include the excess crap again
    ff->ESP = IntResult.ESP-EXCESS_CRAP_ON_STACK;
    ff->EBX = IntResult.EBX;
    ff->EDX = IntResult.EDX;
    ff->ECX = IntResult.ECX;
    ff->oldEAX = IntResult.EAX;
    ff->intf.oldEBP = IntResult.EBP;

} /* restoreState */
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:48,代码来源:fault.c


示例4: Load_MCGA

static void Load_MCGA( short rows, short font, short cursor )
/*===========================================================

   This routines loads an alphanumeric font for the MCGA.   */

{
    VideoInt( _BIOS_VIDEO_PAGE, 0, 0, 0 );         // set active page to 0
    VideoInt( _BIOS_SET_MODE + GetVideoMode(), 0, 0, 0 );
    _fmemset( MK_FP( _EgaSeg, _EgaOff ), 0, 0x2000 );  // must do for MCGA 40 rows
    VideoInt( font & 0xFF0F, 0, 0, 0 );             // load character set
    VideoInt( 0x1103, 0, 0, 0 );
    VideoInt( _BIOS_CURSOR_SIZE, 0, cursor, 0 );    // reset the cursor
    outpw( 0x03D4, ( cursor & 0xFF00 ) + 0x09 );    // # double scan lines
    *(char far *)_BIOS_data( ROWS ) = rows - 1;       // # of rows
    // # of vertical points per character
    *(short far *)_BIOS_data( POINTS ) = 2 * ( cursor & 0xFF + 1 );
    _GrCursor = 1;                                          // cursor is on
}
开发者ID:Ukusbobra,项目名称:open-watcom-v2,代码行数:18,代码来源:setrows.c


示例5: mouse_installed

/* ----- test to see if the mouse driver is installed ----- */
BOOL mouse_installed(void)
{
    unsigned char far *ms;
	unsigned short aa, bb;
	aa = peek(__seg0000, MOUSE *4 + 2);
	bb = peek(__seg0000, MOUSE * 4);
	asm {
		mov ax,2
		mov bx,[aa]
		int 0x31
		mov [aa],ax
		jnc ok
	}
	return FALSE;
ok:
	ms = MK_FP(aa, bb);
    return (SCREENWIDTH <= 80 && ms != NULL && *ms != 0xcf);
}
开发者ID:NoSuchProcess,项目名称:OrangeC,代码行数:19,代码来源:MOUSE.C


示例6: MK_FP

const char __far *DOSEnvFind( const char __far *name )
{
    const char  __far *env;
    const char  __far *p;

    env = MK_FP( GET_ENV_FROM_PSP(), 0 );
    do {
        p = name;
        do {
            if( *p == NULLCHAR && *env == '=' ) {
                return( env + 1 );
            }
        } while( *env++ == *p++ );
        while( *env++ != NULLCHAR )
            ;
    } while( *env != NULLCHAR );
    return( NULL );
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:18,代码来源:doslkup.c


示例7: ORPutImage

void DGraphics::ORPutImage( unsigned char far *VirtualScreen, int IgnoredColor,
			     int x, int y, int width, int height )
{
 char far* Screen=(char far*)MK_FP( 0xA000, 0x000 );
 int SrcOff=0,
     DstOff=y*320+x, // x is counted from 0
     j,k;

 for(j=0;j<height;j++)
 {
   for( k=0; k<width; k++ )
    {
     if( VirtualScreen[SrcOff+k]!=IgnoredColor )
      Screen[DstOff+k]=VirtualScreen[SrcOff+k];
    }
   DstOff+=320; SrcOff+=width;
 }
}
开发者ID:dvorka,项目名称:naaga,代码行数:18,代码来源:dgraphic.cpp


示例8: init_tty

int init_tty (void) /*{{{*/
{
   union REGS r;
   struct SREGS s;

   if (TTY_Initialized) return 0;
   bios_key_f = peekb(0x40,0x96) & 0x10; /* enhanced keyboard flag */

   /* Check for system type */
   delay_ptr = delay;
   r.x.ax = 0xC000;
   int86x (0x15, &r, &r, &s);
   if ((r.x.cflag == 0) && (r.h.al == 0))
     {
	unsigned char *table;

	table = MK_FP(s.es, r.x.bx);
	switch (table[2])
	  {
	   case 0xFF:		       /* pc */
	   case 0xFE:		       /* xt */
	   case 0xFB:		       /* xt */
	   case 0xFD:		       /* pc-jr */
	     break;

	   /* AT and higher */
	   default:
	     delay_ptr = my_delay;
	  }
     }

   set_ctrl_break(0);
   ctrlbrk(ctrl_break);
   init_int9_handler();

   TTY_Initialized = 1;

   if (Batch == 0)
     {
	if (X_Open_Mouse_Hook != NULL) (*X_Open_Mouse_Hook) ();
     }
   X_Set_Abort_Char_Hook = ibmpc_set_abort_char;
   return 0;
}
开发者ID:hankem,项目名称:jed,代码行数:44,代码来源:ibmpc.c


示例9: USL_ScreenDraw

///////////////////////////////////////////////////////////////////////////
//
//      USL_ScreenDraw() - Draws a chunk of the text screen (called only by
//              US_TextScreen())
//
///////////////////////////////////////////////////////////////////////////
static void
USL_ScreenDraw(word x,word y,char *s,byte attr)
{
	byte    far *screen,far *oscreen;

	screen = MK_FP(0xb800,(x * 2) + (y * 80 * 2));
	oscreen = (&introscn + 7) + ((x - 1) * 2) + (y * 80 * 2) + 1;
	while (*s)
	{
		*screen++ = *s++;
		if (attr != 0xff)
		{
			*screen++ = (attr & 0x8f) | (*oscreen & 0x70);
			oscreen += 2;
		}
		else
			screen++;
	}
}
开发者ID:FlatRockSoft,项目名称:CatacombApocalypse,代码行数:25,代码来源:ID_US_1.C


示例10: SetColorRegisters

void SetColorRegisters(struct Registers * registers)
{
	Word i;

	//Get a pointer to the color register values
	Byte far * colorRegisterValues = MK_FP(registers->r_es, registers->r_dx.w);

	//Set the color register index
	outportb(0x03c8, registers->r_bx.b.l);

	//Loop through the color registers to set
	for(i = 0; i < registers->r_cx.w; ++i)
	{
		//Set the color register
        outportb(0x03c9, *colorRegisterValues++);
		outportb(0x03c9, *colorRegisterValues++);
		outportb(0x03c9, *colorRegisterValues++);
	}
}
开发者ID:Creeper20428,项目名称:Data,代码行数:19,代码来源:SetCol.c


示例11: main

int main() {
	int msmouse=0;
	struct pos2 point[2],clipped[2];
	int c,redraw=1;
	int pointsel=0;
	int doclip=1;

	/* microsoft mouse present? */
#if TARGET_BITS == 16
	if (*((unsigned long*)MK_FP(0,0x33*4)) != 0) {
		__asm {
			xor	ax,ax		; AH=0 reset driver
			int	33h
			or	ax,ax
			jz	notinst
			inc	[msmouse]
notinst:
		}
	}
开发者ID:adityavs,项目名称:doslib2,代码行数:19,代码来源:common1m.c


示例12: pcrom_init

/* init PC ROM routines, must be called in graphics mode*/
void
pcrom_init(PSD psd)
{
	char *	p;

	/* use INT 10h to get address of rom character table*/
	rom_char_addr = int10(FNGETROMADDR, GETROM8x14);
#if 0
	/* check bios data area for actual character height,
	 * as the returned font isn't always 14 high
	 */
	ROM_CHAR_HEIGHT = GETBYTE_FP(MK_FP(0x0040, 0x0085));
	if(ROM_CHAR_HEIGHT > MAX_ROM_HEIGHT)
		ROM_CHAR_HEIGHT = MAX_ROM_HEIGHT;
#endif
	p = getenv("CHARHEIGHT");
	if(p)
		ROM_CHAR_HEIGHT = atoi(p);
}
开发者ID:allanshin,项目名称:DirectFB_Microwindows,代码行数:20,代码来源:romfont.c


示例13: setupscrnbuff

static bool setupscrnbuff( void )
/*******************************/
{
    int                 rows, cols;
    LP_PIXEL            scrn;
    size_t              num;
    int                 i;

    if( console_size( UIConCtrl, UIConsole, 0, 0, &rows, &cols ) != 0 ) {
        return( false );
    }
    UIData->width = cols;
    UIData->height = rows;
    num = UIData->width * UIData->height * 2;
    scrn = UIData->screen.origin;
#if defined( __386__ )
    scrn = realloc( scrn, num );
    if( scrn == NULL )
        return( false );
#else
    {
        unsigned                seg;

        if( scrn == NULL ) {
            seg = qnx_segment_alloc( num );
        } else {
            seg = qnx_segment_realloc( FP_SEG( scrn ), num );
        }
        if( seg == -1 )
            return( false );
        scrn = MK_FP( seg, 0 );
    }
#endif
    num /= 2;
    for( i = 0; i < num; ++i ) {
        scrn[i].ch = ' ';       /* a space with normal attributes */
        scrn[i].attr = 7;       /* a space with normal attributes */
    }
    UIData->screen.origin = scrn;
    UIData->screen.increment = UIData->width;
    return( true );
}
开发者ID:Azarien,项目名称:open-watcom-v2,代码行数:42,代码来源:cdisp.c


示例14: int86x

char far *printspool_getqueue(void)
{
      char far *result;
      union REGS r;
      struct SREGS s;

      r.x.ax = 0x0104;
      int86x(0x2f, &r, &r, &s);
      result = MK_FP(s.ds,r.x.si);
      if (!r.x.cflag)
      {
            printspool_errno = 0;
            return result;
      }
      else
      {
            printspool_errno = r.x.ax;
            return NULL;
      }
}
开发者ID:wisnu88,项目名称:C-Programming-Refference,代码行数:20,代码来源:prnspool.c


示例15: DrawDot

/* Draws a pixel at screen coordinate (X,Y) */
void DrawDot(int X, int Y) {
   unsigned char far *ScreenPtr;

   /* Point to the byte the pixel is in */
#ifdef __TURBOC__
   ScreenPtr = MK_FP(SCREEN_SEGMENT, (Y*SCREEN_WIDTH_IN_BYTES) + (X/8));
#else
   FP_SEG(ScreenPtr) = SCREEN_SEGMENT;
   FP_OFF(ScreenPtr) = (Y * SCREEN_WIDTH_IN_BYTES) + (X / 8);
#endif

   /* Set the bit mask within the byte for the pixel */
   outp(GC_INDEX + 1, 0x80 >> (X & 0x07));

   /* Draw the pixel. ORed to force read/write to load latches.
      Data written doesn't matter, because set/reset is enabled
      for all planes. Note: don't OR with 0; MSC optimizes that
      statement to no operation */
   *ScreenPtr |= 0xFE;
}
开发者ID:CHMyFork,项目名称:GPBB,代码行数:21,代码来源:Ld-4.c


示例16: CheckPointRestore

void CheckPointRestore( void )
{
    dos_mem_block   *chk;
    tiny_ret_t      rc;
    tiny_handle_t   hdl;

    rc = TinyOpen( ChkFile, TIO_READ );
    if( TINY_ERROR( rc ) )
        return;
    hdl = TINY_INFO( rc );

    TinyRead( hdl, &chk, sizeof( chk ) );
    TinyRead( hdl, chk, sizeof( *chk ) );
    TinyRead( hdl, &chk, sizeof( chk ) );
    while( TinyRead( hdl, chk, 0x8000 ) == 0x8000 ) {
        chk = MK_FP( FP_SEG( chk ) + 0x800, 0 );
    }
    TinyClose( hdl );
    Cleanup();
}
开发者ID:NoSuchProcess,项目名称:open-watcom-v2,代码行数:20,代码来源:doschk.c


示例17: chkRead

/*
 * chkRead - read checkpoint "file"
 */
static bool chkRead( void **buff )
{
    switch( isWhere ) {
    case ON_DISK:
        if( TinyRead( fileHandle, *buff, 0x8000 ) == 0x8000 ) {
            *buff = MK_FP( FP_SEG( *buff ) + 0x800, 0 );
            return( true );
        }
        return( false );
#ifndef NOEMS
    case IN_EMS:
        return( memBlockRead( EMSBlockRead, buff ) );
#endif
#ifndef NOXMS
    case IN_XMS:
        return( memBlockRead( XMSBlockRead, buff ) );
#endif
    }

} /* chkRead */
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:23,代码来源:spawn.c


示例18: initMouse

int initMouse(void) {
	int x = 0, y = 0;
	union REGS r;
	struct SREGS sr;

	r.w.ax = 0;      /* check mouse driver */
	int86(0x33, &r, &r);
	if (r.w.ax != 0xFFFF)
		return 0;

	r.w.ax = 0x0007; /* set horizontal range */
	r.w.cx = 0;
	r.w.dx = _width - 1;
	int86(0x33, &r, &r);
	r.w.ax = 0x0008; /* set vertical range */
	r.w.cx = 0;
	r.w.dx = _height - 1;
	int86(0x33, &r, &r);

	r.w.ax = 0x0004; /* position cursor */
	r.w.cx = x;
	r.w.dx = y;
	int86(0x33, &r, &r);

	r.w.ax = 2;      /* hide cursor */
	int86(0x33, &r, &r);

	r.w.ax = 0x0014; /* install mouse event handler */
	r.w.cx = MOUSE_MOVE | MOUSE_LEFT_DOWN | MOUSE_LEFT_UP | MOUSE_RIGHT_DOWN | MOUSE_RIGHT_UP; /* monitor these events */
	r.x.edx = FP_OFF(mouseEvent);
	memset(&sr, 0, sizeof(sr));
	sr.es = FP_SEG(mouseEvent);
	int86x(0x33, &r, &r, &sr);
	oldMouseEvent = MK_FP(sr.es, r.x.edx);

	buildMouseImage();
	saveMouseBackground(x, y);
	moveMouse(x, y);

	return 1;
}
开发者ID:cocoZhong,项目名称:tetris_watcom,代码行数:41,代码来源:mouse.c


示例19: setkb

/* ---------------------- deinit_keyboard() -------------- April 17,1993 */
void setkb(int vq){
	int i;	/* Index variable */
	if(!vq){ // deinitiation
		/* Abort if our function pointer has no valid address */
		if(oldkb == NULL) return;
		/* Set address in our function pointer in interrupt vector table */
		_dos_setvect(9, oldkb);
		/* Reset our function pointer to contain no valid address */
		oldkb = NULL;
		#ifdef TESTING
		/* Print the key heap */
		printf("\n");
		for(i=0; i<NUM_SCANCODES; i++){
			if(i==NUM_SCANCODES/2) printf("================================\n");
			printf("%03d[%d][%d]",i+1,key[i],kea[i]);
			if(key[i]==1)printf("====");
			printf(",\n");
		}
		#endif
	}else if(vq == 1){ // initiation
		byte far *lock_key;

		/* Abort if our function pointer has a valid address. */
		if(oldkb != NULL) return;

		/* Clear the keyboard buttons state arrays */
		for(i = 0; i < NUM_SCANCODES; i++)
			key[i] = kea[i] = 0;

		/* save old BIOS key board handler */
		oldkb = _dos_getvect(9);

		// turn off num-lock via BIOS
		lock_key = MK_FP(0x040, 0x017); // Pointing to the address of the bios shift state keys
		*lock_key&=(~(16 | 32 | 64)); // toggle off the locks by changing the values of the 4th, 5th, and 6th bits of the address byte of 0040:0017
		oldkb();	// call BIOS keyhandler to change keyboard lights

		/* setup our own handler */
		_dos_setvect(9, newkb);
	}
}
开发者ID:fourks,项目名称:16,代码行数:42,代码来源:dos_kb.c


示例20: rut_is_installed_code

// test di installazione
// reg:
//   ah    code
//   al    0xFF
//   cx    RUT_ACK1
//   dx    RUT_ACK2
//   es:bx &tsr_type
static struct tsr_type far * rut_is_installed_code(uint8 code)
{
	asm mov ah, [code]
	asm xor al, al
	asm xor bx, bx
	asm xor cx, cx
	asm xor dx, dx
	int_2f_call();
	asm cmp al, 0FFh
	asm jne notinst
	asm cmp cx, TSR_RUTACK1
	asm jne notinst
	asm cmp dx, TSR_RUTACK2
	asm jne notinst

	asm mov dx, es
	asm mov ax, bx
	return (struct tsr_type far*)MK_FP(_DX, _AX);
notinst:
	return 0;
}
开发者ID:amadvance,项目名称:advancemame,代码行数:28,代码来源:kernel.c



注:本文中的MK_FP函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MK_TRACE函数代码示例发布时间:2022-05-30
下一篇:
C++ MKTAG函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap