Mail Archives: djgpp/1996/05/13/01:18:31
On 12 May 1996, John Burton wrote:
> 1. To set the video mode I want I've just been using
> movw $0x13, %ax
> int $0x10
>
> in an assemly language module. All the other examples
> I've seen use __dpmi_int or similar to call the
> interrupt. Is my code reliable?
That depends on the definition of ``reliability''. The INT instruction is
typically caught by the DPMI host and interpreted in a way that's specific
to each host. For example, Windows, which is both a DPMI host and a DOS
extender, does its own things to some services, sometimes bypassing the
real service you mean to call altogether. When you use `__dpmi_int', you
issue an Int 31h call which is more likely to be simply reflected to the
real-mode service.
However, in practice, the two methods yield very similar results,
especially when you call simple register-based functions (i.e. those
which don't use any memory buffers to pass data).
> 2. The __djgpp_nearptr_enable functions appears to
> return sucess but any attempt to access the
> video memory fails under NT.
Not every DPMI server allows you to use near pointers. When you use them,
memory protection is momentarily disabled (since `__djgpp_nearptr_enable'
defines a segment that spans the entire address space), and some operating
systems that take memory protection seriously don't allow such things.
- Raw text -