Mail Archives: djgpp/2001/09/13/10:03:06
Hi Eli !
>You can't, not with DJGPP: ES and DS are segment registers, and in
>protected mode they can only be loaded with valid segment selectors,
not
>with any arbitrary number. If you load a value that is not a valid
>selector, your program will get a GPF and crash.
>
>Why do you need to do that, anyway?
Ok, I have GDT with 3 valid entries: code segment, data segment and
data segment pointed to video RAM (0x0b8000).
Than I switch to PM and load CS <- entry 1, DS <- entry 2, ES <-
entry 3.
After it I want output any information to the screen: mov ES:[...], x
in assembler :).
How can I make it in the DJGPP ?
In the Turbo C I can do it : char far* scr = MK_FP(segment,
offset);
then any instruction like it: *scr = '1'; will generate asm code
mov ax,segment
mov es,ax
mov es:[offset] , '1' ------> here ES !!!
but djgpp has not far* !!!
I try functions described in the farptr.h. It's work but I want to use C
POINTERS !!!
--dima
- Raw text -