www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/18/03:33:47

Message-Id: <199604180722.DAA28352@delorie.com>
Date: Thu, 18 Apr 96 10:13:35 LIT
From: Martynas Kunigelis <martynas DOT kunigelis AT VM DOT KTU DOT LT>
Subject: DPMI/CPU
To: DJGPP mailing list <djgpp AT delorie DOT com>

  I noticed some strange things doing this sequence:

() allocate some memory
() setup a code selector for it
() set its limit to 0xffffffff
() put a RETF opcode to its offset 0
() issue a far call to the selector's offset 0

whenver I do this I get a protection fault at eip=0. However, if
I change the segment limit to 0xfffeffff, the problem goes away. Well,
this is not a solution for me, so I found out the following: if I put
the RETF opcode (0xcb) to the offset 16 of the segment and make a far call
to it's offset 16, everything works, even with a segment limit of 0xffffffff.
How come? My only guess is this could be alignment problem, but I think
alignment controll flag is off under most DPMIS. Ah, I forgot. The above
behaviour happens under most DPMIs: CWSDPMI, QDPMI, OS/2 and Win31. Thus I
guess this might be a CPU problem.

Martynas

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019