Mail Archives: djgpp/1996/10/23/19:05:17
> Leathal,
> I started this thread, but I only read the weekly digest, so I've only just
> seen your reply. Using near pointers in no quicker because you still have to
> load the %edi register with your pointer and then no doubt add some stuff to
> this to access the right pixel. With my method you load %es or whatever and
> then load stuff into %edi to point to the right pixel - so it is not slower
> (apart from perhaps another register to save on the stack, although a push
> and a pop will hardly slow a program down even if done hundreds of times a
> second). With my method you retain full memory protection and it will work
> under all DPMI providers. It is a safe method which is guaranteed to work in
> the future and with DOS emulators on other machines. The near pointer method
> is really a hack, so for professional stuff I'd recommend my method which is
> far neater. For example, say you're testing a bit blitter, a gp fault is
> caused when you write outside video memory. Another thing,
> __djgpp_conventional_base is not guaranteed to stay the same - currently it
> does, but in future this may change.
> I think that the protection offered by my method far out-weighs the
> hassle of having to save and restore a single register. My method is for
> people who want to write bullet-proof code which runs fast.
I think it comes down to preference, but your point is noted... :) Maybe
one day when (if? ;) I get this project I am working on finished, I will
change the routines to use the more secure selector method - I spose I
just have a major fear of segment registers... yuk... :)
Leathal.
- Raw text -