www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/18/13:14:25

From: oak9755 AT silver DOT sdsmt DOT edu (Olav Kindt)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Directly calling bank switch function?
Date: 18 Oct 1996 16:26:59 GMT
Organization: South Dakota School of Mines and Technology
Lines: 37
Distribution: world
Message-ID: <548b4j$n3a@news.sdsmt.edu>
References: <53j43r$dcq AT oravannahka DOT Helsinki DOT FI>
NNTP-Posting-Host: silver.sdsmt.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Joonas W N Reynders (reynders AT cc DOT Helsinki DOT FI) wrote:
: 	If I have a segment:offset (16:16) pointer to a function (this
: case the bank switch function ptr returned by a VESA GetModeInfo function),
: how can I call it directly? The bank switch interrup is too slow...
: 
: 
: 	Thaks in advance, 
: 
: 	Joonas
: 
: PS. Email would be nice: I allways forget that I've posted something ;)

I've used this piece of code with luck

	__dpmi_regs	regs;

	regs.x.bx = 0;		// Set page
	regs.x.dx = page;	// Page number
	regs.x.cs = FuncPtr >> 16;		// Segment of function ptr
	regs.x.ip = FuncPtr & 0x0000ffff;	// Offset of function ptr
	regs.x.ss = regs.x.sp = 0;	// Think this must be zero
	__dpmi_simulate_real_mode_procedure_retf(&regs);
	// Not excactly sure about the spelling of that function call

Note if you are making a function out of this, it would help if you made
it inline, or defined it as macro to get rid of parameter passing
overhead.

	Check out the online manuals at www.delorie.com for the correct
spelling on the function call.

BTW. Is there any body out there who knows how to do this in inline asm?
That might be even faster.
 -- 
Olav Kindt		     | email:	oak9755 AT silver DOT sdsmt DOT edu
737 E. Anamosa Street #103   |		xedb_oak AT debet DOT nhh DOT no
Rapid City SD-57701	     | 		MAIL me man.......

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019