Mail Archives: djgpp/1996/08/21/04:12:52
On Tue, 20 Aug 1996, John Joseph Newbigin wrote:
> > _main:
> >
> > movl $string, %dx # move string into dx
> > movb $0x09, %ah # print the string, calling
> > int $0x21 # int 21h, subfunction 9h
> This is doing a protected mode int. but DOS is a real mode program. I am
> sure there is a reason why it works under 95, but I don't know it.
I think the above explanation is incorrect. I think the DPMI server
catches the INT instruction and reissues it after switching to real mode.
The real problem is that the DX register has a pointer to a protected-mode
address, and DOS cannot get at these. Windows 95 probably moves the
contents of $string to a buffer in conventional memory and puts its
address into DX before reissuing the interrupt, so it works.
The bottom line is that the above technique can be only used in DJGPP for
interrupt functions that don't need pointers to buffers. For more
details, see sections 18.1 and 18.2 of the DJGPP FAQ list (available as
v2/faq201b.zip from the same place you get DJGPP).
- Raw text -