From: "dima 3141596" Newsgroups: comp.os.msdos.djgpp Subject: Re: addressing question Date: Thu, 13 Sep 2001 16:49:34 +0300 Organization: Alkar Teleport News Server Lines: 35 Message-ID: <9nqdp9$22n2$1@pandora.alkar.net> References: NNTP-Posting-Host: dial-164-91.alkar.net Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: pandora.alkar.net 1000389225 68322 195.248.164.91 (13 Sep 2001 13:53:45 GMT) X-Complaints-To: abuse AT alkar DOT net NNTP-Posting-Date: Thu, 13 Sep 2001 13:53:45 +0000 (UTC) X-Newsreader: Microsoft Outlook Express 4.72.3155.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com 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