Date: Thu, 13 Apr 2000 15:39:43 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Chewbaklava cc: djgpp AT delorie DOT com Subject: Re: Graphics In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 12 Apr 2000, Chewbaklava wrote: > My question is this, I see people set mode 13h 2 ways, both work > fine. is there any differance between saying (and I'm doing this from > memory, so if the syntax is a little wrong...) > > union REGS regs; > regs.x.ax = 0x13; > int86(0x10, ®, ®s); > > and > > __dpmi_regs r; > r.x.ax = 0x13; > __dpmi_int(0x10, &r); As Damian suggested, __dpmi_int is the recommended way. The docs of the int86 functions (in the library reference, libc.info) give you some clue as to why. The DJGPP FAQ list explains in section 18.1 why int86 might be dangerous. > Both of these methods work, and as far as I can see do absolutly the same > thing. They accomplish similar things, but in different ways. int86 issues the INT NN instruction in protected mode, whereas __dpmi_int calls a DPMI service which switches the CPU to real mode, then issues the INT NN instruction. The former way is limited to register-based services (no buffers) and is known to cause trouble with some obscure services, in addition to the 16/32-bit nuisance referred to in the docs mentioned above. So __dpmi_int is a better way. > This > is speed sensitive, so I would like to know, what does farpokeb do > exactly??? Look at the header sys/farptr.h, it's all there spelled out in inline assembly. Section 18.6 in the FAQ discusses the relative merits and demerits of _far* functions and the nearptr hack.